mirror of
https://github.com/google/nomulus.git
synced 2025-07-09 04:33:28 +02:00
Implement changes suggested by testcontainer dev (#426)
* Implement changes suggested by testcontainer dev See https://github.com/google/nomulus/issues/401 Specifically: - Use getContainerIpAddress() instead of localhost to insulate us from off-machine docker usage. - Remove shutdown hook to close the container, as testcontainers does this for us.
This commit is contained in:
parent
eb7d779bc8
commit
b523b3835f
2 changed files with 2 additions and 2 deletions
|
@ -97,7 +97,6 @@ abstract class JpaTransactionManagerRule extends ExternalResource {
|
|||
new PostgreSQLContainer(NomulusPostgreSql.getDockerTag())
|
||||
.withDatabaseName(MANAGEMENT_DB_NAME);
|
||||
container.start();
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(() -> container.close()));
|
||||
return container;
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,8 @@ class DockerWebDriverRule extends ExternalResource {
|
|||
url =
|
||||
new URL(
|
||||
String.format(
|
||||
"http://localhost:%d/wd/hub",
|
||||
"http://%s:%d/wd/hub",
|
||||
container.getContainerIpAddress(),
|
||||
container.getMappedPort(CHROME_DRIVER_SERVICE_PORT)));
|
||||
} catch (MalformedURLException e) {
|
||||
throw new IllegalArgumentException(e);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue