简体   繁体   中英

How to exclude some tests from spring rest docs?

I'm working on integrating spring-rest-doc inside my project in order to generate API documentation based on my test. Although sometimes I tend to test something that is not worthed documenting for instance I test a wrong rest call and I want it to give me the correct error code. Spring rest doc generates documentation for this test too.

Is there a way to say spring-rest-doc "skip this one"? It seems I can't find it on the documentation. I'd like to avoid to split my test in two separate classes, one with basic cruds (documented) and one with more complex testing logic.

REST Docs won't document anything if it isn't integrated with MockMvc, REST Assured, or WebTestClient. If you have two separate instances of whichever of those testing clients you're using – one with REST Docs integrated and one without – you'll be able to control which tests generate documentation and which do not.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM