diff --git a/examples/testcontainers-java/pom.xml b/examples/testcontainers-java/pom.xml index 9ac9b3c..7a50381 100644 --- a/examples/testcontainers-java/pom.xml +++ b/examples/testcontainers-java/pom.xml @@ -15,7 +15,7 @@ UTF-8 1.0-alpha-13 1.19.0 - 0.7.0 + 0.8.0 3.3.1 5.10.1 diff --git a/examples/testcontainers-java/src/test/java/TestSample.java b/examples/testcontainers-java/src/test/java/TestSample.java index 8e5a4cf..e36a714 100644 --- a/examples/testcontainers-java/src/test/java/TestSample.java +++ b/examples/testcontainers-java/src/test/java/TestSample.java @@ -46,7 +46,7 @@ public void testGraphql() throws IOException, InterruptedException { WireMock.post(WireMock.urlEqualTo("/graphql")) .andMatching( GraphqlBodyMatcher.extensionName, - GraphqlBodyMatcher.Companion.withRequest( + GraphqlBodyMatcher.withRequest( "{ \"query\": \"{ query { name id }}\" }" ) ) diff --git a/wiremock-graphql-extension/src/main/kotlin/io/github/nilwurtz/GraphqlBodyMatcher.kt b/wiremock-graphql-extension/src/main/kotlin/io/github/nilwurtz/GraphqlBodyMatcher.kt index b726102..58fdd74 100644 --- a/wiremock-graphql-extension/src/main/kotlin/io/github/nilwurtz/GraphqlBodyMatcher.kt +++ b/wiremock-graphql-extension/src/main/kotlin/io/github/nilwurtz/GraphqlBodyMatcher.kt @@ -32,6 +32,8 @@ class GraphqlBodyMatcher() : RequestMatcherExtension() { * @throws InvalidQueryException if the given query is invalid. */ @Deprecated("This method will be deleted in a future release. Use withRequestJson instead.") + @JvmStatic + @JvmOverloads fun withRequestQueryAndVariables(expectedQuery: String, expectedVariables: String? = null): GraphqlBodyMatcher { // Avoid to parse json here. It will be parsed in initExpectedRequestJson return GraphqlBodyMatcher().apply { @@ -52,6 +54,7 @@ class GraphqlBodyMatcher() : RequestMatcherExtension() { * @throws InvalidJsonException if the given JSON is malformed. * @throws InvalidQueryException if the given query is invalid. */ + @JvmStatic fun withRequestJson(expectedJson: String): GraphqlBodyMatcher { return GraphqlBodyMatcher().apply { initExpectedRequestJson(expectedJson) @@ -68,6 +71,7 @@ class GraphqlBodyMatcher() : RequestMatcherExtension() { * @throws InvalidJsonException if the given JSON is malformed. * @throws InvalidQueryException if the given query is invalid. */ + @JvmStatic fun withRequest(expectedJson: String): Parameters { // check if the json and query is valid expectedJson.toJSONObject().graphqlQueryDocument()