Skip to content

Commit

Permalink
progress
Browse files Browse the repository at this point in the history
  • Loading branch information
paultuckey committed Jun 9, 2023
1 parent d6480dc commit ad80f3f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Expand Up @@ -50,8 +50,6 @@
@Testcontainers
public abstract class ContainerTestBase {

private int mappedPort = 0;

protected HttpClient client = new HttpClient();
private File systemPropBaseReportsDir = new File("container-test", "reports");
private String containerId = "test";
Expand All @@ -69,8 +67,8 @@ public abstract class ContainerTestBase {
public void setUp() throws Exception {
container.start();
System.out.println(container.getContainerId());
System.out.println("HOST " + container.getHost());
System.out.println("PORT " + container.getFirstMappedPort());
this.mappedPort = container.getFirstMappedPort();
assert (container.isRunning());

String containerId = System.getProperty("test.container.id");
Expand All @@ -92,7 +90,7 @@ public void setUp() throws Exception {
}

protected String getBaseUrl() {
return "http://localhost:" + this.mappedPort + "/" + getApp();
return "http://" + container.getHost() + ":" + container.getFirstMappedPort() + "/" + getApp();
}

protected void recordRewriteStatus() throws IOException {
Expand Down
Expand Up @@ -45,7 +45,7 @@ public void testTestUtf() throws ServletException, IOException {
method.setFollowRedirects(false);
client.executeMethod(method);
assertNotNull(method.getResponseHeader("Location"), "no location header");
assertEquals(getBaseUrl() + "/utf-redir/done/" + encodedStr + "/", method.getResponseHeader("Location").getValue());
assertEquals("/" + getApp() + "/utf-redir/done/" + encodedStr + "/", method.getResponseHeader("Location").getValue());
}

@Test
Expand Down

0 comments on commit ad80f3f

Please sign in to comment.