public GenericContainer container;
@Test
public void simpleTest() throws IOException {
String address = String.format("http://%s:%s", container.getContainerIpAddress(), container.getMappedPort(80));
CloseableHttpClient httpClient = HttpClientBuilder.create().build();
<BUG>HttpGet get = new HttpGet(address);
try (CloseableHttpResponse response = httpClient.execute(get)) {</BUG>
assertEquals("A container built from a dockerfile can run nginx as expected, and returns a good status code",
200,
response.getStatusLine().getStatusCode());

public GenericContainer container;
@Test
public void simpleTest() throws IOException {
String address = String.format("http://%s:%s", container.getContainerIpAddress(), container.getMappedPort(80));
CloseableHttpClient httpClient = HttpClientBuilder.create().build();
HttpGet get = new HttpGet(address);
Unreliables.retryUntilSuccess(5, TimeUnit.SECONDS, () -> {
try (CloseableHttpResponse response = httpClient.execute(get)) {
assertEquals("A container built from a dockerfile can run nginx as expected, and returns a good status code",
200,
response.getStatusLine().getStatusCode());
