Jackie chen
11/13/2023, 3:13 AMamir fallah
11/13/2023, 10:22 AMamir fallah
11/13/2023, 10:23 AMДмитро Пашковський
11/13/2023, 10:51 AM[ERROR] test.TestGetProductListGet.testGetProductListXMLForCI(EventTypesForTestScenarios)[3] Time elapsed: 0.344 s <<< ERROR!
java.lang.Throwable: Test case exception: [engine:junit-platform-suite]/[suite:test.PolygonSuite]/[engine:junit-jupiter]/[class:test.TestGetProductListGet]/[test-template:testGetProductListXMLForCI(test.EventTypesForTestScenarios)]/[test-template-invocation:#3]
Suppressed: com.github.tomakehurst.wiremock.common.JsonException: {
"errors" : [ {
"code" : 10,
"source" : {
"pointer" : "/"
},
"title" : "Error parsing JSON",
"detail" : "Cannot construct instance of `com.github.tomakehurst.wiremock.common.Errors` (although at least one Creator exists): no int/Int-argument constructor/factory method to deserialize from Number value (404)"
} ]
}
Roman Putko
11/13/2023, 12:02 PMJulian Berryessa
11/14/2023, 9:35 PMJayanth Culli
11/15/2023, 3:43 PM{
"mappings": [
{
"name": "get-credit-report-fail",
"request": {
"method": "GET",
"urlPathPattern": "/pvt/v1/bureau/pan-number",
"queryParameters": {
"uuid": {
"matches": ".*crs-fail"
}
}
},
"response": {
"status": 500
}
},
{
"name": "get-credit-report-success",
"request": {
"method": "GET",
"urlPathPattern": "/pvt/v1/bureau/pan-number"
},
"response": {
"status": 200,
"jsonBody": {
"success": true,
"data": {
"panNumber": "ABCDE1234F",
"vendor": "EQUIFAX"
},
"status_code": 200
}
}
}
]
}
When I try to match it with curl
curl --location 'localhost:8080/pvt/v1/bureau/pan-number?uuid=crs-fail'
it gives the below response
{
"success": true,
"data": {
"panNumber": "ABCDE1234F",
"vendor": "EQUIFAX"
},
"status_code": 200
}
instead of 500 error末永卓
11/17/2023, 12:49 AMmessage testRequest {
string id = 1;
}
message testResponse {
oneof Content {
uint32 status = 1;
string result = 2;
string log = 3;
}
}
service TestService {
rpc Test(testRequest) returns (stream testResponse) {}
}
Navjot Singh
11/17/2023, 6:49 AMVitonofrio Del Rosso
11/17/2023, 12:48 PMVitonofrio Del Rosso
11/17/2023, 12:48 PMVitonofrio Del Rosso
11/17/2023, 12:59 PMDaniel Augustin
11/17/2023, 1:03 PMJayanth Culli
11/18/2023, 6:28 AM2023-11-18 11:54:17.196 Verbose logging enabled
Exception in thread "main" wiremock.com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "mappings" (class com.github.tomakehurst.wiremock.stubbing.StubMapping), not marked as ignorable (10 known properties: "response", "requiredScenarioState", "priority", "persistent", "id", "postServeActions", "request", "newScenarioState", "uuid", "scenarioName"])
at [Source: {
"mappings": [
{
"name": "get-cif",
"request": {
"method": "POST",
"urlPathPattern": "/cif"
},
"response": {
"status": 200,
"jsonBody": {
"success": true,
"data": {
"cifNumber": "1234567890"
},
"status_code": 200
}
}
}
]
}
; line: 2, column: 18] (through reference chain: com.github.tomakehurst.wiremock.stubbing.StubMapping["mappings"])
at wiremock.com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:51)
at wiremock.com.fasterxml.jackson.databind.DeserializationContext.reportUnknownProperty(DeserializationContext.java:836)
at wiremock.com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:1045)
at wiremock.com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1352)
at wiremock.com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1330)
at wiremock.com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:262)
at wiremock.com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:125)
at wiremock.com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3702)
at wiremock.com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2714)
at com.github.tomakehurst.wiremock.common.Json.read(Json.java:39)
at com.github.tomakehurst.wiremock.stubbing.StubMapping.buildFrom(StubMapping.java:69)
at com.github.tomakehurst.wiremock.standalone.JsonFileMappingsSource.loadMappingsInto(JsonFileMappingsSource.java:79)
at com.github.tomakehurst.wiremock.core.WireMockApp.loadMappingsUsing(WireMockApp.java:152)
at com.github.tomakehurst.wiremock.core.WireMockApp.loadDefaultMappings(WireMockApp.java:148)
at com.github.tomakehurst.wiremock.core.WireMockApp.<init>(WireMockApp.java:86)
at com.github.tomakehurst.wiremock.WireMockServer.<init>(WireMockServer.java:69)
at com.github.tomakehurst.wiremock.standalone.WireMockServerRunner.run(WireMockServerRunner.java:65)
at com.github.tomakehurst.wiremock.standalone.WireMockServerRunner.main(WireMockServerRunner.java:113)
Balog Tamás
11/20/2023, 11:43 AMWireMock.stubFor(...)
calls into the JSON stub mapping format.
But, before diving into that, I'd like to ask the community how common is the need for converting either individual stubFor(...)
calls, or migrating an entire project of them from Java to the JSON DSL. If anyone has had such experience, what challenges did you face during that conversion/migration?
Any feedback is greatly welcome.Lucian Crasovan
11/20/2023, 2:44 PMAllen Vachon
11/20/2023, 4:32 PM"myArray": [
{
"Key1": "AnyValue",
"Key2": "AnyValue"
},
{
"Key1": "AnyValue",
"Key2": "AnyValue"
},
{
"Key1": "AnyValue"
}
]
In my example, the first two elements are valid but not the third one.Ahmad Saad
11/20/2023, 6:35 PMcontains
work?Navjot Singh
11/22/2023, 11:43 AMException in thread "grpc-default-executor-2" wiremock.com.google.protobuf.InvalidProtocolBufferException: Missing type url when parsing: {"greeting":"Hello Duis"}
at wiremock.com.google.protobuf.util.JsonFormat$ParserImpl.mergeAny(JsonFormat.java:1504)
at wiremock.com.google.protobuf.util.JsonFormat$ParserImpl.access$2000(JsonFormat.java:1276)
at wiremock.com.google.protobuf.util.JsonFormat$ParserImpl$1.merge(JsonFormat.java:1343)
at wiremock.com.google.protobuf.util.JsonFormat$ParserImpl.merge(JsonFormat.java:1432)
at wiremock.com.google.protobuf.util.JsonFormat$ParserImpl.merge(JsonFormat.java:1317)
at wiremock.com.google.protobuf.util.JsonFormat$Parser.merge(JsonFormat.java:449)
at org.wiremock.grpc.internal.JsonMessageUtils.lambda$toMessage$1(JsonMessageUtils.java:36)
at com.github.tomakehurst.wiremock.common.Exceptions.uncheck(Exceptions.java:72)
at org.wiremock.grpc.internal.JsonMessageUtils.toMessage(JsonMessageUtils.java:36)
at org.wiremock.grpc.internal.UnaryServerCallHandler.lambda$invoke$0(UnaryServerCallHandler.java:92)
at com.github.tomakehurst.wiremock.http.AbstractRequestHandler.handle(AbstractRequestHandler.java:101)
at org.wiremock.grpc.internal.UnaryServerCallHandler.invoke(UnaryServerCallHandler.java:60)
at org.wiremock.grpc.internal.UnaryServerCallHandler.invoke(UnaryServerCallHandler.java:31)
at wiremock.grpc.io.grpc.stub.ServerCalls$UnaryServerCallHandler$UnaryServerCallListener.onHalfClose(ServerCalls.java:182)
at wiremock.grpc.io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.halfClosed(ServerCallImpl.java:351)
at wiremock.grpc.io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed.runInContext(ServerImpl.java:860)
at wiremock.grpc.io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
at wiremock.grpc.io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
Amit Rawat
11/22/2023, 2:30 PMPriya RajeshKumar
11/22/2023, 4:29 PMLucian Crasovan
11/23/2023, 3:31 PMJoonas Krohn
11/27/2023, 12:09 PMjava.lang.IncompatibleClassChangeError: class org.eclipse.jetty.http2.server.HttpChannelOverHTTP2 has interface org.eclipse.jetty.server.HttpChannel as super class
Stacktrace in the thread.Jackie chen
11/27/2023, 1:02 PMbob
11/29/2023, 4:16 PM/__admin/webapp
web interface to work. When running the latest standalone and docker instance, i'm getting a 404 not found. I did enabled -enabled-browser
also but its not working. Any tips?Tarun Bhalla
11/29/2023, 4:46 PMMehmet Gul
11/29/2023, 5:21 PMAlx Dark
12/01/2023, 3:01 PM{
"mappings": [
{
"request": {
"method": "DELETE",
"urlPathTemplate": "/path/{tn}",
"pathParameters": {
"tn": {
"matches": "[0-9]+"
}
}
},
"serveEventListeners": [
{
"name": "webhook",
"parameters": {
"method": "POST",
"url": "/webhook/path",
"headers": {
"Content-Type": "application/json"
},
"body": "{\"tn\":\"{{tn}}\",\"timestamp\":\"{{now}}\"}}"
}
}
]
}
]
}
If the request is the only variable passed into the webhook templating system, then I guess I'm hoping there's something like originalRequest.parameters
that I can refer to in order to get at that variable. (btw I'm aware that I can get at a path element via originalRequest.path.[#]
but I that's somewhat fragile and hard for others to follow.) Thanks in advance for any help on this!Preeda Payattakool
12/02/2023, 4:39 PMNS_ERROR_UNKNOWN_HOST
, but if i use wiremock standalone (.jar file) and running as browser proxy everything works perfectly , Appreciate for your guidance / clue , thx a lot
below is my scala code (Not work with https site )
w = new WireMockServer(op.httpsPort(8443)
.caKeystoreType("jks")
.trustAllProxyTargets(false)
.caKeystorePath("/Users/oz4899/.wiremock/ca-keystore.jks")
.enableBrowserProxying(true)
.notifier(new ConsoleNotifier(true)))
w.start()
below is command that i used to run standalone (work fines)
java -jar wiremock-standalone-3.3.1.jar --enable-browser-proxying --port 8080 --verbose
StrawHat
12/05/2023, 10:17 AMwiremock
as part of a Java/Spring Boot project, and when trying to upgrade to the latest version, we have found 2 different wiremock maven dependencies. So maybe you can help me understand the difference between wiremock
and wiremock-standalone
jars ?
I have run mvn dependency:tree
to see the differences:
Having wiremock-standalone
in pom.xml
[INFO] +- org.wiremock:wiremock-standalone:jar:3.3.1:test
Having `wiremock `in pom.xml :
[INFO] +- org.wiremock:wiremock:jar:3.3.1:test
[INFO] | +- org.eclipse.jetty:jetty-server:jar:11.0.18:test
[INFO] | | +- org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:jar:5.0.2:test
[INFO] | | +- org.eclipse.jetty:jetty-http:jar:11.0.18:test
[INFO] | | \- org.eclipse.jetty:jetty-io:jar:11.0.18:test
[INFO] | +- org.eclipse.jetty:jetty-servlet:jar:11.0.18:test
[INFO] | | \- org.eclipse.jetty:jetty-security:jar:11.0.18:test
[INFO] | +- org.eclipse.jetty:jetty-servlets:jar:11.0.18:test
[INFO] | | \- org.eclipse.jetty:jetty-util:jar:11.0.18:test
[INFO] | +- org.eclipse.jetty:jetty-webapp:jar:11.0.18:test
[INFO] | | \- org.eclipse.jetty:jetty-xml:jar:11.0.18:test
[INFO] | +- org.eclipse.jetty:jetty-proxy:jar:11.0.18:test
[INFO] | | \- org.eclipse.jetty:jetty-client:jar:11.0.18:test
[INFO] | +- org.eclipse.jetty.http2:http2-server:jar:11.0.18:test
[INFO] | | \- org.eclipse.jetty.http2:http2-common:jar:11.0.18:test
[INFO] | | \- org.eclipse.jetty.http2:http2-hpack:jar:11.0.18:test
[INFO] | +- org.eclipse.jetty:jetty-alpn-server:jar:11.0.18:test
[INFO] | +- org.eclipse.jetty:jetty-alpn-java-server:jar:11.0.18:test
[INFO] | +- org.eclipse.jetty:jetty-alpn-java-client:jar:11.0.18:test
[INFO] | +- org.eclipse.jetty:jetty-alpn-client:jar:11.0.18:test
[INFO] | +- com.google.guava:guava:jar:32.1.3-jre:test
[INFO] | | +- com.google.guava:failureaccess:jar:1.0.1:test
[INFO] | | +- com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:test
[INFO] | | +- org.checkerframework:checker-qual:jar:3.37.0:test
[INFO] | | +- com.google.errorprone:error_prone_annotations:jar:2.21.1:test
[INFO] | | \- com.google.j2objc:j2objc-annotations:jar:2.8:test
[INFO] | +- org.apache.httpcomponents.client5:httpclient5:jar:5.2.1:test
[INFO] | | +- org.apache.httpcomponents.core5:httpcore5:jar:5.2:test
[INFO] | | \- org.apache.httpcomponents.core5:httpcore5-h2:jar:5.2:test
[INFO] | +- org.xmlunit:xmlunit-core:jar:2.9.1:test
[INFO] | | \- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.3:test
[INFO] | | \- jakarta.activation:jakarta.activation-api:jar:1.2.2:test
[INFO] | +- org.xmlunit:xmlunit-legacy:jar:2.9.1:test
[INFO] | +- org.xmlunit:xmlunit-placeholders:jar:2.9.1:test
[INFO] | +- net.javacrumbs.json-unit:json-unit-core:jar:2.38.0:test
[INFO] | | \- org.hamcrest:hamcrest-core:jar:2.2:test
[INFO] | | \- org.hamcrest:hamcrest:jar:2.2:test
[INFO] | +- com.jayway.jsonpath:json-path:jar:2.8.0:test
[INFO] | | \- net.minidev:json-smart:jar:2.4.10:test
[INFO] | | \- net.minidev:accessors-smart:jar:2.4.9:test
[INFO] | +- org.ow2.asm:asm:jar:9.6:test
[INFO] | +- net.sf.jopt-simple:jopt-simple:jar:5.0.4:test
[INFO] | +- org.apache.commons:commons-lang3:jar:3.13.0:test
[INFO] | +- com.github.jknack:handlebars:jar:4.3.1:test
[INFO] | +- com.github.jknack:handlebars-helpers:jar:4.3.1:test
[INFO] | +- commons-fileupload:commons-fileupload:jar:1.5:test
[INFO] | +- commons-io:commons-io:jar:2.15.0:test
[INFO] | \- com.networknt:json-schema-validator:jar:1.0.87:test
[INFO] | +- com.ethlo.time:itu:jar:1.7.0:test
[INFO] | \- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.16.0:test
[INFO] | \- org.yaml:snakeyaml:jar:2.2:test
When running my unit tests with wiremock-standalone
, I don't get verbose logs, but when running them with with `wiremock `I get the following logs:
[INFO] --- surefire:3.0.0-M3:test (default-test) @ *** ---
[INFO] Running ***
[main] INFO org.eclipse.jetty.server.Server - jetty-11.0.18; built: 2023-10-27T02:14:36.036Z; git: 5a9a771a9fbcb9d36993630850f612581b78c13f; jvm 11.0.21+9-LTS
[main] INFO org.eclipse.jetty.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler@6d7d0946{/__admin,null,AVAILABLE}
[main] INFO org.eclipse.jetty.server.handler.ContextHandler.ROOT - RequestHandlerClass from context returned com.github.tomakehurst.wiremock.http.StubRequestHandler. Normalized mapped under returned 'null'
[main] INFO org.eclipse.jetty.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler@3054cdd3{/,null,AVAILABLE}
[main] INFO org.eclipse.jetty.server.AbstractConnector - Started NetworkTrafficServerConnector@2fd409c1{HTTP/1.1, (http/1.1, h2c)}{0.0.0.0:39051}
[main] INFO org.eclipse.jetty.server.Server - Started Server@9fd5dd0{STARTING}[11.0.18,sto=1000] @10755ms
[main] INFO org.eclipse.jetty.server.Server - Stopped Server@9fd5dd0{STOPPING}[11.0.18,sto=1000]
[main] INFO org.eclipse.jetty.server.Server - Shutdown Server@9fd5dd0{STOPPING}[11.0.18,sto=1000]
[main] INFO org.eclipse.jetty.server.AbstractConnector - Stopped NetworkTrafficServerConnector@2fd409c1{HTTP/1.1, (http/1.1, h2c)}{0.0.0.0:0}
[main] INFO org.eclipse.jetty.server.handler.ContextHandler - Stopped o.e.j.s.ServletContextHandler@3054cdd3{/,null,STOPPED}
[main] INFO org.eclipse.jetty.server.handler.ContextHandler - Stopped o.e.j.s.ServletContextHandler@6d7d0946{/__admin,null,STOPPED}
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.178 s - in ***
And when adding Spring Boot BOM (just an example) I get errors when running my UT with wiremock
, but no errors with wiremock-standalone
Sample of errors with Spring boot BOM (2.7.18)
java.lang.NoClassDefFoundError: jakarta/servlet/DispatcherType
Caused by: java.lang.ClassNotFoundException: jakarta.servlet.DispatcherType
Thank you!