diff --git a/samples/demo-authorizationserver/src/main/java/sample/config/TomcatServerConfig.java b/samples/demo-authorizationserver/src/main/java/sample/config/TomcatServerConfig.java index 3d378211..59e7537d 100644 --- a/samples/demo-authorizationserver/src/main/java/sample/config/TomcatServerConfig.java +++ b/samples/demo-authorizationserver/src/main/java/sample/config/TomcatServerConfig.java @@ -21,11 +21,13 @@ import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactor import org.springframework.boot.web.server.WebServerFactoryCustomizer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; /** * @author Joe Grandja * @since 1.3 */ +@Profile("!test") // Exclude this from DemoAuthorizationServerApplicationTests and DemoAuthorizationServerConsentTests @Configuration(proxyBeanMethods = false) public class TomcatServerConfig { diff --git a/samples/demo-authorizationserver/src/test/java/sample/DemoAuthorizationServerApplicationTests.java b/samples/demo-authorizationserver/src/test/java/sample/DemoAuthorizationServerApplicationTests.java index 36d121f0..316658be 100644 --- a/samples/demo-authorizationserver/src/test/java/sample/DemoAuthorizationServerApplicationTests.java +++ b/samples/demo-authorizationserver/src/test/java/sample/DemoAuthorizationServerApplicationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2023 the original author or authors. + * Copyright 2020-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ import static org.assertj.core.api.Assertions.assertThat; * @author Daniel Garnier-Moiroux */ @ExtendWith(SpringExtension.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = {"spring.profiles.include=test"}) @AutoConfigureMockMvc public class DemoAuthorizationServerApplicationTests { private static final String REDIRECT_URI = "http://127.0.0.1:8080/login/oauth2/code/messaging-client-oidc"; diff --git a/samples/demo-authorizationserver/src/test/java/sample/DemoAuthorizationServerConsentTests.java b/samples/demo-authorizationserver/src/test/java/sample/DemoAuthorizationServerConsentTests.java index d3a6a3f9..2199d798 100644 --- a/samples/demo-authorizationserver/src/test/java/sample/DemoAuthorizationServerConsentTests.java +++ b/samples/demo-authorizationserver/src/test/java/sample/DemoAuthorizationServerConsentTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2023 the original author or authors. + * Copyright 2020-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,7 +48,7 @@ import static org.mockito.Mockito.when; * @author Dmitriy Dubson */ @ExtendWith(SpringExtension.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = {"spring.profiles.include=test"}) @AutoConfigureMockMvc public class DemoAuthorizationServerConsentTests {