diff --git a/README.md b/README.md index da07de1..23b6014 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ A common example is using Wiremock 3.x with Java 1.8. The module is compatible with the following WireMock versions: - WireMock (aka WireMock Java) `2.0.0` and above -- WireMock (aka WireMock Java) `3.0.0` beta versions. +- WireMock (aka WireMock Java) `3.x` versions. Note that the official image for WireMock 3 is yet to be released and verified ([issue #59](https://github.com/wiremock/wiremock-testcontainers-java/issues/59)) Other WireMock implementations may work but have not been tested yet. diff --git a/pom.xml b/pom.xml index 9cdc74a..e2993d6 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ 1.8 ${java.version} ${java.version} - 2.35.0 + 3.5.4 1.19.0 5.10.0 3.24.2 @@ -165,10 +165,15 @@ 0.4.1 jar-with-dependencies + + org.wiremock + wiremock + ${wiremock.version} + org.wiremock wiremock-webhooks-extension - 2.35.1 + 2.35.0 ${project.build.directory}/test-wiremock-extension diff --git a/src/main/java/org/wiremock/integrations/testcontainers/WireMockContainer.java b/src/main/java/org/wiremock/integrations/testcontainers/WireMockContainer.java index ab71296..19ec173 100644 --- a/src/main/java/org/wiremock/integrations/testcontainers/WireMockContainer.java +++ b/src/main/java/org/wiremock/integrations/testcontainers/WireMockContainer.java @@ -48,7 +48,7 @@ public class WireMockContainer extends GenericContainer { public static final String OFFICIAL_IMAGE_NAME = "wiremock/wiremock"; private static final String WIREMOCK_2_LATEST_TAG = "2.35.0-1"; - private static final String WIREMOCK_3_LATEST_TAG = "3.0.1-1"; + private static final String WIREMOCK_3_LATEST_TAG = "3.5.4"; /*package*/ static final String WIREMOCK_2_MINIMUM_SUPPORTED_VERSION = "2.0.0"; /** diff --git a/src/test/java/org/wiremock/integrations/testcontainers/TestConfig.java b/src/test/java/org/wiremock/integrations/testcontainers/TestConfig.java index d32a67e..de2bcf0 100644 --- a/src/test/java/org/wiremock/integrations/testcontainers/TestConfig.java +++ b/src/test/java/org/wiremock/integrations/testcontainers/TestConfig.java @@ -5,7 +5,7 @@ public class TestConfig { private static final String DEFAULT_TEST_TAG = - System.getProperty("wiremock.testcontainer.defaultTag", "3.1.0-1"); + System.getProperty("wiremock.testcontainer.defaultTag", "3.5.4"); private static final String WIREMOCK_2_TEST_TAG = System.getProperty("wiremock.testcontainer.wiremock2Tag", "2.35.1-1"); diff --git a/src/test/java/org/wiremock/integrations/testcontainers/WireMockContainerExtensionsCombinationTest.java b/src/test/java/org/wiremock/integrations/testcontainers/WireMockContainerExtensionsCombinationTest.java index 17b4ee6..e11e236 100644 --- a/src/test/java/org/wiremock/integrations/testcontainers/WireMockContainerExtensionsCombinationTest.java +++ b/src/test/java/org/wiremock/integrations/testcontainers/WireMockContainerExtensionsCombinationTest.java @@ -44,7 +44,7 @@ class WireMockContainerExtensionsCombinationTest { .withMapping("json-body-transformer", WireMockContainerExtensionsCombinationTest.class, "json-body-transformer.json") .withExtensions("Webhook", Collections.singleton("org.wiremock.webhooks.Webhooks"), - Collections.singleton(Paths.get("target", "test-wiremock-extension", "wiremock-webhooks-extension-3.0.1.jar").toFile())) + Collections.singleton(Paths.get("target", "test-wiremock-extension", "wiremock-webhooks-extension-3.5.4.jar").toFile())) .withExtensions("JSON Body Transformer", Collections.singleton("com.ninecookies.wiremock.extensions.JsonBodyTransformer"), Collections.singleton(Paths.get("target", "test-wiremock-extension", "wiremock-extensions-0.4.1-jar-with-dependencies.jar").toFile())); diff --git a/src/test/java/org/wiremock/integrations/testcontainers/WireMockContainerWebhooksTest.java b/src/test/java/org/wiremock/integrations/testcontainers/WireMockContainerWebhooksTest.java index 4fa98f2..a39b665 100644 --- a/src/test/java/org/wiremock/integrations/testcontainers/WireMockContainerWebhooksTest.java +++ b/src/test/java/org/wiremock/integrations/testcontainers/WireMockContainerWebhooksTest.java @@ -60,7 +60,6 @@ class WireMockContainerWebhooksTest { .withLogConsumer(new Slf4jLogConsumer(LOGGER)) .withCliArg("--global-response-templating") .withMapping("webhook-callback-template", WireMockContainerWebhooksTest.class, "webhook-callback-template.json") - .withExtension("org.wiremock.webhooks.Webhooks") .withAccessToHost(true); // Force the host access mechanism @Test diff --git a/src/test/java/org/wiremock/integrations/testcontainers/wiremock2/WebhooksExtensionTest.java b/src/test/java/org/wiremock/integrations/testcontainers/wiremock2/WebhooksExtensionTest.java index fcf4d82..eb047b6 100644 --- a/src/test/java/org/wiremock/integrations/testcontainers/wiremock2/WebhooksExtensionTest.java +++ b/src/test/java/org/wiremock/integrations/testcontainers/wiremock2/WebhooksExtensionTest.java @@ -15,6 +15,13 @@ */ package org.wiremock.integrations.testcontainers.wiremock2; +import static org.assertj.core.api.Assertions.assertThat; +import static org.testcontainers.Testcontainers.exposeHostPorts; +import static org.testcontainers.shaded.org.awaitility.Awaitility.await; + +import java.nio.file.Paths; +import java.time.Duration; +import java.util.Collections; import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -28,14 +35,6 @@ import org.wiremock.integrations.testcontainers.testsupport.http.TestHttpClient; import org.wiremock.integrations.testcontainers.testsupport.http.TestHttpServer; -import java.nio.file.Paths; -import java.time.Duration; -import java.util.Collections; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.testcontainers.Testcontainers.exposeHostPorts; -import static org.testcontainers.shaded.org.awaitility.Awaitility.await; - /** * Tests the WireMock Webhook extension and TestContainers Networking * For this type of tests we should use following steps: @@ -59,14 +58,13 @@ class WebhooksExtensionTest { TestHttpServer applicationServer = TestHttpServer.newInstance(); @Container WireMockContainer wiremockServer = new WireMockContainer(TestConfig.WIREMOCK_2_IMAGE) - .withLogConsumer(new Slf4jLogConsumer(LOGGER)) - .withCliArg("--global-response-templating") - .withMapping("webhook-callback-template", WebhooksExtensionTest.class, "webhook-callback-template.json") - .withExtensions("Webhooks", - Collections.singleton("org.wiremock.webhooks.Webhooks"), - Collections.singleton(Paths.get("target", "test-wiremock-extension", "wiremock-webhooks-extension-2.35.1.jar").toFile())) - .withAccessToHost(true); // Force the host access mechanism - + .withLogConsumer(new Slf4jLogConsumer(LOGGER)) + .withCliArg("--global-response-templating") + .withMapping("webhook-callback-template", WebhooksExtensionTest.class, "webhook-callback-template.json") + .withExtensions("Webhooks", + Collections.singleton("org.wiremock.webhooks.Webhooks"), + Collections.singleton(Paths.get("target", "test-wiremock-extension", "wiremock-webhooks-extension-2.35.0.jar").toFile())) + .withAccessToHost(true); // Force the host access mechanism @Test void callbackUsingJsonStub() throws Exception { diff --git a/src/test/java/org/wiremock/integrations/testcontainers/wiremock2/WireMockContainerExtensionsCombinationTest.java b/src/test/java/org/wiremock/integrations/testcontainers/wiremock2/WireMockContainerExtensionsCombinationTest.java index d347008..1bc30ca 100644 --- a/src/test/java/org/wiremock/integrations/testcontainers/wiremock2/WireMockContainerExtensionsCombinationTest.java +++ b/src/test/java/org/wiremock/integrations/testcontainers/wiremock2/WireMockContainerExtensionsCombinationTest.java @@ -46,7 +46,7 @@ class WireMockContainerExtensionsCombinationTest { .withMapping("json-body-transformer", WireMockContainerExtensionsCombinationTest.class, "json-body-transformer.json") .withExtensions("Webhook", Collections.singleton("org.wiremock.webhooks.Webhooks"), - Collections.singleton(Paths.get("target", "test-wiremock-extension", "wiremock-webhooks-extension-2.35.1.jar").toFile())) + Collections.singleton(Paths.get("target", "test-wiremock-extension", "wiremock-webhooks-extension-2.35.0.jar").toFile())) .withExtensions("JSON Body Transformer", Collections.singleton("com.ninecookies.wiremock.extensions.JsonBodyTransformer"), Collections.singleton(Paths.get("target", "test-wiremock-extension", "wiremock-extensions-0.4.1-jar-with-dependencies.jar").toFile()));