diff --git a/data-prepper-plugins/kafka-plugins/src/test/java/org/opensearch/dataprepper/plugins/kafka/util/CustomClientSslEngineFactoryTest.java b/data-prepper-plugins/kafka-plugins/src/test/java/org/opensearch/dataprepper/plugins/kafka/util/CustomClientSslEngineFactoryTest.java index 6056f4c35e..a149fb840d 100644 --- a/data-prepper-plugins/kafka-plugins/src/test/java/org/opensearch/dataprepper/plugins/kafka/util/CustomClientSslEngineFactoryTest.java +++ b/data-prepper-plugins/kafka-plugins/src/test/java/org/opensearch/dataprepper/plugins/kafka/util/CustomClientSslEngineFactoryTest.java @@ -8,10 +8,10 @@ import java.nio.file.Path; import java.util.Collections; import java.util.Objects; +import java.util.UUID; +import java.util.concurrent.ThreadLocalRandom; import static org.hamcrest.MatcherAssert.assertThat; -import static org.mockito.ArgumentMatchers.anyInt; -import static org.mockito.ArgumentMatchers.anyString; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.notNullValue; @@ -19,7 +19,8 @@ public class CustomClientSslEngineFactoryTest { @Test public void createClientSslEngine() { try (final CustomClientSslEngineFactory customClientSslEngineFactory = new CustomClientSslEngineFactory()) { - final SSLEngine sslEngine = customClientSslEngineFactory.createClientSslEngine(anyString(), anyInt(), anyString()); + final SSLEngine sslEngine = customClientSslEngineFactory.createClientSslEngine( + UUID.randomUUID().toString(), ThreadLocalRandom.current().nextInt(), UUID.randomUUID().toString()); assertThat(sslEngine, is(notNullValue())); } } @@ -32,7 +33,8 @@ public void createClientSslEngineWithConfig() throws IOException { final String certificateContent = Files.readString(certFilePath); customClientSslEngineFactory.configure(Collections.singletonMap("certificateContent", certificateContent)); - final SSLEngine sslEngine = customClientSslEngineFactory.createClientSslEngine(anyString(), anyInt(), anyString()); + final SSLEngine sslEngine = customClientSslEngineFactory.createClientSslEngine( + UUID.randomUUID().toString(), ThreadLocalRandom.current().nextInt(), UUID.randomUUID().toString()); assertThat(sslEngine, is(notNullValue())); } }