简体   繁体   中英

How to disable Spring Security on Tests for Webflux Functional Endpoints

I would like to disable security on endpoints during some unit tests. I am using webflux functional endpoints so the below configuration does not work.

@AutoConfigureMockMvc(secure = false)

I desactivated it by using profiles, but that means I cannot test security with test profile anymore. Is there another way to do it with webflux?

Thanks in advance for your helps

you can add:

@WebFluxTest(controllers = XXXX, excludeAutoConfiguration = {ReactiveSecurityAutoConfiguration.class})

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