diff --git a/ksql-version-metrics-client/pom.xml b/ksql-version-metrics-client/pom.xml
index aa076f5ae6c5..393ffe51daea 100644
--- a/ksql-version-metrics-client/pom.xml
+++ b/ksql-version-metrics-client/pom.xml
@@ -59,29 +59,9 @@
- org.mock-server
- mockserver-netty
- 3.10.4
+ com.github.tomakehurst
+ wiremock-jre8
test
-
-
- ch.qos.logback
- logback-classic
-
-
-
-
-
- org.mock-server
- mockserver-client-java
- 3.10.4
- test
-
-
- ch.qos.logback
- logback-classic
-
-
diff --git a/ksql-version-metrics-client/src/test/java/io/confluent/ksql/version/metrics/VersionCheckerIntegrationTest.java b/ksql-version-metrics-client/src/test/java/io/confluent/ksql/version/metrics/VersionCheckerIntegrationTest.java
index 97647328dbd0..426fce5d008c 100644
--- a/ksql-version-metrics-client/src/test/java/io/confluent/ksql/version/metrics/VersionCheckerIntegrationTest.java
+++ b/ksql-version-metrics-client/src/test/java/io/confluent/ksql/version/metrics/VersionCheckerIntegrationTest.java
@@ -15,39 +15,35 @@
package io.confluent.ksql.version.metrics;
-import static org.mockserver.model.HttpRequest.request;
-
+import com.github.tomakehurst.wiremock.client.WireMock;
+import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
+import com.github.tomakehurst.wiremock.junit.WireMockRule;
import io.confluent.ksql.version.metrics.collector.KsqlModuleType;
import io.confluent.support.metrics.BaseSupportConfig;
import java.util.Properties;
import java.util.concurrent.TimeUnit;
import org.apache.kafka.test.TestUtils;
-import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.Timeout;
-import org.mockserver.integration.ClientAndProxy;
-import org.mockserver.socket.PortFactory;
public class VersionCheckerIntegrationTest {
-
- private static int proxyPort;
- private static ClientAndProxy clientAndProxy;
-
+
@Rule
public final Timeout timeout = Timeout.builder()
.withTimeout(30, TimeUnit.SECONDS)
.withLookingForStuckThread(true)
.build();
- @BeforeClass
- public static void startProxy() {
- proxyPort = PortFactory.findFreePort();
- clientAndProxy = ClientAndProxy.startClientAndProxy(proxyPort);
- }
+ @Rule
+ public WireMockRule wireMockRule = new WireMockRule(
+ WireMockConfiguration.wireMockConfig()
+ .dynamicPort()
+ );
@Test
public void testMetricsAgent() throws InterruptedException {
+ WireMock.stubFor(WireMock.post("/ksql/anon").willReturn(WireMock.ok()));
final KsqlVersionCheckerAgent versionCheckerAgent = new KsqlVersionCheckerAgent(
() -> false
@@ -57,13 +53,13 @@ public void testMetricsAgent() throws InterruptedException {
.CONFLUENT_SUPPORT_METRICS_ENDPOINT_SECURE_ENABLE_CONFIG, "false");
versionCheckProps.setProperty(
BaseSupportConfig.CONFLUENT_SUPPORT_PROXY_CONFIG,
- "http://localhost:" + proxyPort
+ "http://localhost:" + wireMockRule.port()
);
versionCheckerAgent.start(KsqlModuleType.SERVER, versionCheckProps);
TestUtils.waitForCondition(() -> {
try {
- clientAndProxy.verify(request().withPath("/ksql/anon").withMethod("POST"));
+ WireMock.verify(WireMock.postRequestedFor(WireMock.urlPathEqualTo("/ksql/anon")));
return true;
} catch (final AssertionError e) {
return false;