0

I'm trying to stub interaction (groovy code)

stubInteraction(
        post(urlEqualTo("/someUrl"))
                .withRequestBody(matchingJsonPath("\$.firstName"))
            aResponse()
                .withBody("")
                .withStatus(200)

I receive exception

Problem accessing /someUrl. Reason:
com.jayway.jsonpath.JsonPath.read(Ljava/lang/String;Ljava/lang/String;[Lcom/jayway/jsonpath/Filter;)Ljava/lang/Object;</pre></p><h3>Caused by:</h3><pre>java.lang.NoSuchMethodError: com.jayway.jsonpath.JsonPath.read(Ljava/lang/String;Ljava/lang/String;[Lcom/jayway/jsonpath/Filter;)Ljava/lang/Object;
at com.github.tomakehurst.wiremock.matching.ValuePattern.isJsonPathMatch(ValuePattern.java:194)

For json:

{"firstName":"Jan"}

What i am doing wrong?

MariuszS
  • 30,646
  • 12
  • 114
  • 155

1 Answers1

1

Looks like a dependency problem. Do you have jsonpath included via some other dependency?

If this is the case you might want to try including the standalone version with all dependencies excluded as described here: http://wiremock.org/getting-started.html

Tom
  • 3,471
  • 21
  • 14
  • Standalone version includes old class `javax.servlet.http.HttpServletRequest` without `isAsyncStarted`, so I still have problem. – MariuszS Nov 25 '14 at 11:51