Updates tests to use use-legacy-processing property
This commit is contained in:
@@ -78,6 +78,7 @@ public class ConsulPropertySourceLocatorAppNameCustomizedTests {
|
||||
this.context = new SpringApplicationBuilder(Config.class)
|
||||
.web(WebApplicationType.NONE)
|
||||
.run("--spring.application.name=testConsulPropertySourceLocatorAppNameCustomized",
|
||||
"--spring.config.use-legacy-processing=true",
|
||||
"--spring.cloud.consul.config.name=" + CONFIG_NAME,
|
||||
"--spring.cloud.consul.config.prefix=" + ROOT);
|
||||
|
||||
@@ -89,7 +90,9 @@ public class ConsulPropertySourceLocatorAppNameCustomizedTests {
|
||||
@After
|
||||
public void teardown() {
|
||||
this.client.deleteKVValues(PREFIX);
|
||||
this.context.close();
|
||||
if (context != null) {
|
||||
this.context.close();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -32,6 +32,7 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = ConsulPropertySourceLocatorFailFastTests.Config.class,
|
||||
properties = { "spring.application.name=testConsulPropertySourceLocatorFailFast",
|
||||
"spring.config.use-legacy-processing=true",
|
||||
"spring.cloud.consul.host=53210a7c-4809-42cb-8b30-057d2db85fcc",
|
||||
"spring.cloud.consul.port=65530",
|
||||
"spring.cloud.consul.retry.enabled=false",
|
||||
|
||||
@@ -78,6 +78,7 @@ public class ConsulPropertySourceLocatorFilesTests {
|
||||
|
||||
this.context = new SpringApplicationBuilder(Config.class)
|
||||
.web(WebApplicationType.NONE).run("--spring.application.name=" + APP_NAME,
|
||||
"--spring.config.use-legacy-processing=true",
|
||||
"--spring.cloud.consul.config.prefix=" + ROOT,
|
||||
"--spring.cloud.consul.config.format=FILES",
|
||||
"--spring.profiles.active=dev",
|
||||
|
||||
@@ -41,6 +41,7 @@ public class ConsulPropertySourceLocatorRetryTests {
|
||||
Assert.assertThrows(TransportException.class, () -> {
|
||||
new SpringApplicationBuilder(Config.class).properties(
|
||||
"spring.application.name=testConsulPropertySourceLocatorRetry",
|
||||
"spring.config.use-legacy-processing=true",
|
||||
"spring.cloud.consul.host=53210a7c-4809-42cb-8b30-057d2db85fcc",
|
||||
"logging.level.org.springframework.retry=TRACE", "server.port=0",
|
||||
"spring.cloud.consul.port=65530",
|
||||
|
||||
@@ -93,6 +93,7 @@ public class ConsulPropertySourceLocatorTests {
|
||||
|
||||
this.context = new SpringApplicationBuilder(Config.class)
|
||||
.web(WebApplicationType.NONE).run("--SPRING_APPLICATION_NAME=" + APP_NAME,
|
||||
"--spring.config.use-legacy-processing=true",
|
||||
"--spring.cloud.consul.config.prefix=" + ROOT,
|
||||
"spring.cloud.consul.config.watch.delay=10");
|
||||
|
||||
@@ -104,7 +105,9 @@ public class ConsulPropertySourceLocatorTests {
|
||||
@After
|
||||
public void teardown() {
|
||||
this.client.deleteKVValues(PREFIX);
|
||||
this.context.close();
|
||||
if (context != null) {
|
||||
this.context.close();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -114,7 +117,7 @@ public class ConsulPropertySourceLocatorTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore // FIXME broken tests with boot 2.0.0
|
||||
@Ignore // FIXME: broken tests with boot 2.0.0
|
||||
public void propertyLoadedAndUpdated() throws Exception {
|
||||
String testProp = this.environment.getProperty(TEST_PROP_CANONICAL);
|
||||
assertThat(testProp).as("testProp was wrong").isEqualTo(VALUE1);
|
||||
@@ -132,7 +135,7 @@ public class ConsulPropertySourceLocatorTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore // FIXME broken tests with boot 2.0.0
|
||||
@Ignore // FIXME: broken tests with boot 2.0.0
|
||||
public void contextDoesNotExistThenExists() throws Exception {
|
||||
String testProp = this.environment.getProperty(TEST_PROP3_CANONICAL);
|
||||
assertThat(testProp).as("testProp was wrong").isNull();
|
||||
|
||||
Reference in New Issue
Block a user