Skip to content

Commit 296c87b

Browse files
committed
Exclude TomcatServerConfig from integration tests in demo-authorizationserver sample
1 parent 0d7ba70 commit 296c87b

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

samples/demo-authorizationserver/src/main/java/sample/config/TomcatServerConfig.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@
2121
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
2222
import org.springframework.context.annotation.Bean;
2323
import org.springframework.context.annotation.Configuration;
24+
import org.springframework.context.annotation.Profile;
2425

2526
/**
2627
* @author Joe Grandja
2728
* @since 1.3
2829
*/
30+
@Profile("!test") // Exclude this from DemoAuthorizationServerApplicationTests and DemoAuthorizationServerConsentTests
2931
@Configuration(proxyBeanMethods = false)
3032
public class TomcatServerConfig {
3133

samples/demo-authorizationserver/src/test/java/sample/DemoAuthorizationServerApplicationTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2023 the original author or authors.
2+
* Copyright 2020-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -43,7 +43,7 @@
4343
* @author Daniel Garnier-Moiroux
4444
*/
4545
@ExtendWith(SpringExtension.class)
46-
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
46+
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = {"spring.profiles.include=test"})
4747
@AutoConfigureMockMvc
4848
public class DemoAuthorizationServerApplicationTests {
4949
private static final String REDIRECT_URI = "http://127.0.0.1:8080/login/oauth2/code/messaging-client-oidc";

samples/demo-authorizationserver/src/test/java/sample/DemoAuthorizationServerConsentTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2023 the original author or authors.
2+
* Copyright 2020-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -48,7 +48,7 @@
4848
* @author Dmitriy Dubson
4949
*/
5050
@ExtendWith(SpringExtension.class)
51-
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
51+
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = {"spring.profiles.include=test"})
5252
@AutoConfigureMockMvc
5353
public class DemoAuthorizationServerConsentTests {
5454

0 commit comments

Comments
 (0)