You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
curl -i -X POST http://localhost:8080/foo/graphql -d @graphql-request.json
The following error response was returned
HTTP/1.1 500 Server Error
Cache-Control: must-revalidate,no-cache,no-store
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 5094
Connection: close
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 500 org.json.JSONException: Unterminated string at 58 [character 0 line 3]</title>
</head>
<body><h2>HTTP ERROR 500 org.json.JSONException: Unterminated string at 58 [character 0 line 3]</h2>
<table>
<tr><th>URI:</th><td>/foo/graphql</td></tr>
<tr><th>STATUS:</th><td>500</td></tr>
<tr><th>MESSAGE:</th><td>org.json.JSONException: Unterminated string at 58 [character 0 line 3]</td></tr>
<tr><th>SERVLET:</th><td>com.github.tomakehurst.wiremock.servlet.WireMockHandlerDispatchingServlet-5c669da8</td></tr>
<tr><th>CAUSED BY:</th><td>org.json.JSONException: Unterminated string at 58 [character 0 line 3]</td></tr>
</table>
<h3>Caused by:</h3><pre>org.json.JSONException: Unterminated string at 58 [character 0 line 3]
at org.json.JSONTokener.syntaxError(JSONTokener.java:497)
at org.json.JSONTokener.nextString(JSONTokener.java:302)
at org.json.JSONTokener.nextValue(JSONTokener.java:410)
at org.json.JSONObject.<init>(JSONObject.java:245)
at org.json.JSONObject.<init>(JSONObject.java:404)
at io.github.nilwurtz.GraphqlBodyMatcher.match(GraphqlBodyMatcher.kt:116)
at com.github.tomakehurst.wiremock.matching.RequestPattern.match(RequestPattern.java:242)
at com.github.tomakehurst.wiremock.store.StubMappingStore.lambda$findAllMatchingRequest$0(StubMappingStore.java:42)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.base/java.util.concurrent.ConcurrentSkipListMap$KeySpliterator.tryAdvance(Unknown Source)
at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.base/java.util.stream.ReferencePipeline.findFirst(Unknown Source)
at com.github.tomakehurst.wiremock.stubbing.AbstractStubMappings.serveFor(AbstractStubMappings.java:83)
at com.github.tomakehurst.wiremock.core.WireMockApp.serveStubFor(WireMockApp.java:247)
at com.github.tomakehurst.wiremock.http.StubRequestHandler.handleRequest(StubRequestHandler.java:72)
at com.github.tomakehurst.wiremock.http.AbstractRequestHandler.handle(AbstractRequestHandler.java:72)
at com.github.tomakehurst.wiremock.servlet.WireMockHandlerDispatchingServlet.service(WireMockHandlerDispatchingServlet.java:157)
at wiremock.jakarta.servlet.http.HttpServlet.service(HttpServlet.java:587)
at wiremock.org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:764)
at wiremock.org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1665)
at wiremock.org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:527)
at wiremock.org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:221)
at wiremock.org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1381)
at wiremock.org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:176)
at wiremock.org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:484)
at wiremock.org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:174)
at wiremock.org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1303)
at wiremock.org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129)
at wiremock.org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
at wiremock.org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:822)
at wiremock.org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:141)
at wiremock.org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
at wiremock.org.eclipse.jetty.server.Server.handle(Server.java:563)
at wiremock.org.eclipse.jetty.server.HttpChannel$RequestDispatchable.dispatch(HttpChannel.java:1598)
at wiremock.org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:753)
at wiremock.org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:501)
at wiremock.org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:282)
at wiremock.org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:314)
at wiremock.org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100)
at wiremock.org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
at wiremock.org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:969)
at wiremock.org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1194)
at wiremock.org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1149)
at java.base/java.lang.Thread.run(Unknown Source)
</pre>
</body>
</html>
It worked correctly when I removed the line breaks as follows
val expectedJson =""" { "query": "$expectedQuery" }""".trimIndent().replace("\n", "")
References
No response
The text was updated successfully, but these errors were encountered:
Summary
What I did
Try Running with a Remote Wiremock Server
Client-side (Test) Configuration
References
No response
The text was updated successfully, but these errors were encountered: