是否可以使用@AutoConfigureRestDocs与restassured而不是mockmvc?

时间:2016-10-26 10:11:19

标签: java spring spring-boot spring-restdocs

Spring Boot 1.4引入了@AutoConfigureRestDocs(参见http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#boot-features-testing-spring-boot-applications-testing-autoconfigured-rest-docs)。文档声明:

  

它会自动配置MockMvc以使用Spring REST Docs,并且无需使用Spring REST Docs' JUnit规则。

我想使用Spring REST Docs的restassured支持而不是mockmvc。我可以使用@AutoConfigureRestDocs吗?

1 个答案:

答案 0 :(得分:1)

不,不是现在。 @AutoConfigureRestDocs建立在Spring Boot的测试支持之上,能够自动配置MockMvc。不支持自动配置REST Assured,然后可以构建REST Docs自动配置。如果你想在Spring Boot中看到它,请open an enhancement request