From 57f91f9948a4350e851e42eba42638ccb8139daa Mon Sep 17 00:00:00 2001 From: Krzysiek Date: Thu, 27 Jan 2022 10:15:16 +0100 Subject: [PATCH] JAVA-9605: Disable security for the integration tests --- .../secondservice/SecondServiceIntegrationTest.java | 4 +++- .../customfilters/service/ServiceIntegrationTest.java | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/springcloudgateway/customfilters/secondservice/SecondServiceIntegrationTest.java b/spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/springcloudgateway/customfilters/secondservice/SecondServiceIntegrationTest.java index 6b2a432d20..f4b3d0f00d 100644 --- a/spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/springcloudgateway/customfilters/secondservice/SecondServiceIntegrationTest.java +++ b/spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/springcloudgateway/customfilters/secondservice/SecondServiceIntegrationTest.java @@ -2,12 +2,14 @@ package com.baeldung.springcloudgateway.customfilters.secondservice; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.security.reactive.ReactiveSecurityAutoConfiguration; import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; import org.springframework.test.web.reactive.server.WebTestClient; import com.baeldung.springcloudgateway.customfilters.secondservice.web.SecondServiceRestController; -@WebFluxTest(SecondServiceRestController.class) +@WebFluxTest(controllers = SecondServiceRestController.class, + excludeAutoConfiguration = ReactiveSecurityAutoConfiguration.class) public class SecondServiceIntegrationTest { @Autowired diff --git a/spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/springcloudgateway/customfilters/service/ServiceIntegrationTest.java b/spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/springcloudgateway/customfilters/service/ServiceIntegrationTest.java index bfb3f23f0d..9990cd003c 100644 --- a/spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/springcloudgateway/customfilters/service/ServiceIntegrationTest.java +++ b/spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/springcloudgateway/customfilters/service/ServiceIntegrationTest.java @@ -2,13 +2,15 @@ package com.baeldung.springcloudgateway.customfilters.service; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.security.reactive.ReactiveSecurityAutoConfiguration; import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; import org.springframework.http.HttpHeaders; import org.springframework.test.web.reactive.server.WebTestClient; import com.baeldung.springcloudgateway.customfilters.service.web.ServiceRestController; -@WebFluxTest(ServiceRestController.class) +@WebFluxTest(controllers = ServiceRestController.class, + excludeAutoConfiguration = ReactiveSecurityAutoConfiguration.class) public class ServiceIntegrationTest { @Autowired