SpringBoot项目单元测试不经过过滤器问题


SpringBoot使用MockMvc:https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-testing-spring-boot-applications-testing-with-mock-environment

使用MockMvc对象进行请求,不会进行一个完整的请求(就是说不会经过过滤器,异常处理等操作)

 

 

需要完整的请求请按  https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-testing-spring-boot-applications-testing-with-running-server  这个文档使用即可,,

 

 

这是jsonpath的文档:https://github.com/json-path/JsonPath  ,一个解析工具


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM