Skip to content

Commit ce5e6f7

Browse files
committed
Update ServiceInstanceRecentLogsAutoConfigurationTests
Trying a different test setup to avoid an NPE in CI.
1 parent 2f8f0f1 commit ce5e6f7

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

spring-cloud-app-broker-autoconfigure/src/test/java/org/springframework/cloud/appbroker/autoconfigure/ServiceInstanceRecentLogsAutoConfigurationTests.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package org.springframework.cloud.appbroker.autoconfigure;
1818

19+
import org.junit.jupiter.api.BeforeEach;
1920
import org.junit.jupiter.api.Test;
2021
import reactor.core.publisher.Flux;
2122

@@ -33,12 +34,17 @@
3334

3435
class ServiceInstanceRecentLogsAutoConfigurationTests {
3536

36-
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
37-
.withConfiguration(AutoConfigurations.of(AppBrokerAutoConfiguration.class,
38-
CloudFoundryAppDeployerAutoConfiguration.class, ServiceInstanceRecentLogsAutoConfiguration.class))
39-
.withPropertyValues("spring.cloud.appbroker.deployer.cloudfoundry.api-host=https://api.example.local",
40-
"spring.cloud.appbroker.deployer.cloudfoundry.username=user",
41-
"spring.cloud.appbroker.deployer.cloudfoundry.password=secret");
37+
private ApplicationContextRunner contextRunner;
38+
39+
@BeforeEach
40+
void setUp() {
41+
this.contextRunner = new ApplicationContextRunner()
42+
.withConfiguration(AutoConfigurations.of(AppBrokerAutoConfiguration.class,
43+
CloudFoundryAppDeployerAutoConfiguration.class, ServiceInstanceRecentLogsAutoConfiguration.class))
44+
.withPropertyValues("spring.cloud.appbroker.deployer.cloudfoundry.api-host=https://api.example.local",
45+
"spring.cloud.appbroker.deployer.cloudfoundry.username=user",
46+
"spring.cloud.appbroker.deployer.cloudfoundry.password=secret");
47+
}
4248

4349
@Test
4450
void servicesAreNotCreatedWithoutLoggingOnClasspath() {

0 commit comments

Comments
 (0)