Fixing tests

This commit is contained in:
Ryan Baxter
2023-03-09 11:22:54 -05:00
parent c40eddef88
commit 68f5566732

View File

@@ -104,7 +104,7 @@ public class CompositeIntegrationTests {
@LocalServerPort
private int port;
@BeforeClass
@BeforeAll
public static void init() throws Exception {
// mock Git configuration to make tests independent of local Git configuration
SystemReader.setInstance(new MockSystemReader());
@@ -114,20 +114,6 @@ public class CompositeIntegrationTests {
"target/repos/svn-config-repo");
}
@Test
public void contextLoads() {
ResponseEntity<Environment> response = new TestRestTemplate().exchange(
"http://localhost:" + this.port + "/foo/development/", HttpMethod.GET, getV2AcceptEntity(),
Environment.class);
Environment environment = response.getBody();
assertThat(3).isEqualTo(environment.getPropertySources().size());
assertThat("overrides").isEqualTo(environment.getPropertySources().get(0).getName());
assertThat(environment.getPropertySources().get(1).getName().contains("config-repo")
&& !environment.getPropertySources().get(1).getName().contains("svn-config-repo")).isTrue();
assertThat(environment.getPropertySources().get(2).getName().contains("svn-config-repo")).isTrue();
ConfigServerTestUtils.assertConfigEnabled(environment);
}
@Test
public void resourceEndpointsWork() {
// This request will get the file from the Git Repo because its order is first
@@ -143,7 +129,6 @@ public class CompositeIntegrationTests {
}
@RunWith(SpringRunner.class)
@SpringBootTest(classes = TestConfigServerApplication.class,
properties = { "spring.config.name:compositeconfigserver",
"spring.cloud.config.server.composite[0].uri:file:./target/repos/config-repo",