Skip to content

Commit

Permalink
Merge pull request #254 from jaconi-io/default-ports
Browse files Browse the repository at this point in the history
test: use default ports
  • Loading branch information
jnodorp-jaconi authored Feb 28, 2024
2 parents f146a84 + 8bb70d6 commit 12d646c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
10 changes: 5 additions & 5 deletions src/integrationTest/java/io/jaconi/morp/SeleniumIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ void tearDown() {

@ParameterizedTest
@CsvSource({
"tenant1, morp:8081, /upstream/tenant1, /test",
"tenant1, tenant1-morp:8081, /upstream, /test"
"tenant1, morp:8080, /upstream/tenant1, /test",
"tenant1, tenant1-morp:8080, /upstream, /test"
})
void testWithKeycloak(String tenant, String host, String prefix, String path) throws MalformedURLException {

Expand All @@ -105,7 +105,7 @@ void testWithKeycloak(String tenant, String host, String prefix, String path) th
// assert that we ended up in the right place
URL url = new URL(driver.getCurrentUrl());
assertThat(url.getHost()).isEqualTo(StringUtils.substringBefore(host, ":"));
assertThat(url.getPort()).isEqualTo(8081);
assertThat(url.getPort()).isEqualTo(8080);
assertThat(url.getPath()).isEqualTo(prefix + path);

assertThat(driver.findElement(By.id("test")).getText()).isEqualTo("Hello from mockserver");
Expand All @@ -128,8 +128,8 @@ void testWithKeycloak(String tenant, String host, String prefix, String path) th

@ParameterizedTest
@CsvSource({
"tenant2, morp:8081, /upstream/tenant2, /test",
"tenant2, tenant2-morp:8081, /upstream, /test"
"tenant2, morp:8080, /upstream/tenant2, /test",
"tenant2, tenant2-morp:8080, /upstream, /test"
})
void testWithOkta(String tenant, String host, String prefix, String path) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ public TestContainerSetup() {
this.morp = new GenericContainer<>(DockerImageName.parse("ghcr.io/jaconi-io/morp:latest"))
.withNetwork(network)
.withNetworkAliases("morp", "tenant1-morp", "tenant2-morp")
.withExposedPorts(8081, 8082)
.withExposedPorts(8080, 8081)
.withEnv("SPRING_PROFILES_ACTIVE", "test")
.withFileSystemBind(
"./src/integrationTest/resources/morp/application.yaml",
"/workspace/config/application.yaml",
BindMode.READ_ONLY)
.waitingFor(new HttpWaitStrategy()
.forPort(8082)
.forPort(8081)
.forPath("/actuator/health/readiness")
.withStartupTimeout(Duration.ofMinutes(5)));

Expand Down Expand Up @@ -103,11 +103,11 @@ public TestContainerSetup() {
.wiretap(true) // hex dump wiretap
.compress(true);
webTestClient = WebTestClient.bindToServer(new ReactorClientHttpConnector(httpClient))
.baseUrl("http://localhost:" + morp.getMappedPort(8081))
.baseUrl("http://localhost:" + morp.getMappedPort(8080))
.build();

managementTestClient = WebTestClient.bindToServer(new ReactorClientHttpConnector(httpClient))
.baseUrl("http://localhost:" + morp.getMappedPort(8082))
.baseUrl("http://localhost:" + morp.getMappedPort(8081))
.build();
}

Expand Down
7 changes: 0 additions & 7 deletions src/integrationTest/resources/morp/application.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# keycloak is running on 8080 so we need different ports for Morp here
server:
port: 8081
management:
server:
port: 8082

# Routing config
spring:
cloud:
Expand Down

0 comments on commit 12d646c

Please sign in to comment.