Skip to content

Commit 178fbf0

Browse files
Copilotebyhr
authored andcommitted
Replace FixedHostPortGenericContainer with GenericContainer
1 parent 615aead commit 178fbf0

File tree

1 file changed

+5
-6
lines changed
  • gateway-ha/src/test/java/io/trino/gateway/ha/security

1 file changed

+5
-6
lines changed

gateway-ha/src/test/java/io/trino/gateway/ha/security/TestOIDC.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import org.junit.jupiter.api.BeforeAll;
3131
import org.junit.jupiter.api.Test;
3232
import org.junit.jupiter.api.TestInstance;
33-
import org.testcontainers.containers.FixedHostPortGenericContainer;
3433
import org.testcontainers.containers.GenericContainer;
3534
import org.testcontainers.containers.Network;
3635
import org.testcontainers.containers.PostgreSQLContainer;
@@ -91,19 +90,17 @@ void setup()
9190
.withStartupCheckStrategy(new OneShotStartupCheckStrategy());
9291
migrationContainer.start();
9392

94-
FixedHostPortGenericContainer<?> hydraConsent = new FixedHostPortGenericContainer<>("python:3.10.1-alpine")
95-
.withFixedExposedPort(3000, 3000)
93+
GenericContainer<?> hydraConsent = new GenericContainer<>("python:3.10.1-alpine")
9694
.withNetwork(network)
9795
.withNetworkAliases("hydra-consent")
9896
.withExposedPorts(3000)
9997
.withCopyFileToContainer(forClasspathResource("auth/login_and_consent_server.py"), "/")
10098
.withCommand("python", "/login_and_consent_server.py")
10199
.waitingFor(Wait.forHttp("/healthz").forPort(3000).forStatusCode(200));
100+
hydraConsent.setPortBindings(List.of("3000:3000"));
102101
hydraConsent.start();
103102

104-
FixedHostPortGenericContainer<?> hydra = new FixedHostPortGenericContainer<>(HYDRA_IMAGE)
105-
.withFixedExposedPort(4444, 4444)
106-
.withFixedExposedPort(4445, 4445)
103+
GenericContainer<?> hydra = new GenericContainer<>(HYDRA_IMAGE)
107104
.withNetwork(network)
108105
.withNetworkAliases("hydra")
109106
.withEnv("LOG_LEVEL", "debug")
@@ -124,6 +121,8 @@ void setup()
124121
.withStrategy(Wait.forLogMessage(".*Setting up http server on :4444.*", 1))
125122
.withStrategy(Wait.forLogMessage(".*Setting up http server on :4445.*", 1)))
126123
.withStartupTimeout(java.time.Duration.ofMinutes(3));
124+
hydra.setPortBindings(List.of("4444:4444", "4445:4445"));
125+
hydra.start();
127126

128127
String clientId = "trino_client_id";
129128
String clientSecret = "trino_client_secret";

0 commit comments

Comments
 (0)