Skip to content

Commit

Permalink
Re #123: Fixed nginx testcontainers startup condition.
Browse files Browse the repository at this point in the history
  • Loading branch information
tkowalcz committed Jul 25, 2024
1 parent 22cb479 commit 0f93e9f
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.NginxContainer;
import org.testcontainers.containers.wait.strategy.HttpWaitStrategy;
import org.testcontainers.containers.wait.strategy.Wait;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;
Expand Down Expand Up @@ -60,9 +59,8 @@ public class ServerNameIndicatorTest {
)
.withExposedPorts(3100);


@Container
public NginxContainer<?> nginx = new NginxContainer<>("nginx:latest")
public NginxContainer<?> nginx = new NginxContainer<>("nginx:1.25")
.withNetwork(network)
.dependsOn(loki1, loki2)
.withClasspathResourceMapping("loki.sni.nginx.conf",
Expand All @@ -81,7 +79,11 @@ public class ServerNameIndicatorTest {
"/etc/nginx/passwords",
BindMode.READ_ONLY
)
.waitingFor(new HttpWaitStrategy())
.waitingFor(Wait
.forHttp("/")
.forStatusCode(200)
.forStatusCode(400)
)
.withExposedPorts(81);

@BeforeEach
Expand Down

0 comments on commit 0f93e9f

Please sign in to comment.