diff --git a/src/test/java/com/amazon/opendistroforelasticsearch/security/auditlog/sink/WebhookAuditLogTest.java b/src/test/java/com/amazon/opendistroforelasticsearch/security/auditlog/sink/WebhookAuditLogTest.java index 915fa247f6..c4adf3ae8d 100644 --- a/src/test/java/com/amazon/opendistroforelasticsearch/security/auditlog/sink/WebhookAuditLogTest.java +++ b/src/test/java/com/amazon/opendistroforelasticsearch/security/auditlog/sink/WebhookAuditLogTest.java @@ -444,11 +444,11 @@ public void httpsTest() throws Exception { @Test public void httpsTestPemDefault() throws Exception { - + final int port = 8088; TestHttpHandler handler = new TestHttpHandler(); server = ServerBootstrap.bootstrap() - .setListenerPort(8084) + .setListenerPort(port) .setServerInfo("Test/1.1") .setSslContext(createSSLContext()) .registerHandler("*", handler) @@ -458,7 +458,7 @@ public void httpsTestPemDefault() throws Exception { AuditMessage msg = MockAuditMessageFactory.validAuditMessage(); LoggingSink fallback = new LoggingSink("test", Settings.EMPTY, null, null); - String url = "https://localhost:8084/endpoint"; + String url = "https://localhost:" + port + "/endpoint"; // test default with filepath handler.reset();