3030import org .junit .jupiter .api .BeforeAll ;
3131import org .junit .jupiter .api .Test ;
3232import org .junit .jupiter .api .TestInstance ;
33- import org .testcontainers .containers .FixedHostPortGenericContainer ;
3433import org .testcontainers .containers .GenericContainer ;
3534import org .testcontainers .containers .Network ;
3635import 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