MockServer is a mock HTTP server that enables easy mocking of any system you integrate with via HTTP or HTTPS (i.e. services, web sites, etc) with clients written in Java, JavaScript and Ruby. MockServer also includes a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding).
jamesdbloom on master
downgrading jersey version due … (compare)
dependabot[bot] on maven
Bump jetty.version from 9.4.35.… (compare)
Hello all, I have a testsuite which uses a standalone mock server instance and the tests use a client created like so return new MockServerClient("localhost", 1080);
The test are run locally (using Docker containers ) and in a Jenkins job (also using Docker containers) and things have worked very nicely. However, for reasons that I cannot figure out the Jenkins job is now failing and I have localized the failing step to where the test issue reset()
on the mockserver client : MockServerClient mc = mockserverClient();
mc.reset();
(where mockserverClient()
just does the creation stated above. In the log of the MockServer container I see java -Xmx128m -Dfile.encoding=UTF-8 -jar /opt/mockserver/mockserver-netty-jar-with-dependencies.jar -serverPort 1080 -logLevel INFO &
2019-10-21 07:57:26,307 INFO o.m.m.HttpStateHandler started on port: 1080
2019-10-21 07:59:18,581 INFO o.m.m.HttpStateHandler resetting all expectations and request logs
2019-10-21 07:59:18,837 INFO o.m.m.HttpStateHandler resetting all expectations and request logs
2019-10-21 07:59:18,878 INFO o.m.m.HttpStateHandler resetting all expectations and request logs
2019-10-21 07:59:18,936 INFO o.m.m.HttpStateHandler resetting all expectations and request logs
2019-10-21 07:59:18,969 INFO o.m.m.HttpStateHandler resetting all expectations and request logs
2019-10-21 07:59:19,038 INFO o.m.m.HttpStateHandler resetting all expectations and request logs
2019-10-21 07:59:19,073 INFO o.m.m.HttpStateHandler resetting all expectations and request logs
2019-10-21 07:59:19,162 INFO o.m.m.HttpStateHandler resetting all expectations and request logs
2019-10-21 07:59:19,242 INFO o.m.m.HttpStateHandler resetting all expectations and request logs
2019-10-21 07:59:26,098 INFO o.m.m.HttpStateHandler resetting all expectations and request logs
2019-10-21 07:59:31,684 INFO o.m.m.HttpStateHandler resetting all expectations and request logs
and the test log shows that it's the reset step that fails with a org.mockserver.client.ClientException
: ```com.resurs.signicatdocumentmover.workinitiator.service.AlternativeFlowsIntegrationTest > service_disabled_renders_no_action FAILED
java.lang.Exception
Caused by: org.mockserver.client.ClientException at AlternativeFlowsIntegrationTest.java:133 ( mc.reset() )
com.resurs.signicatdocumentmover.workinitiator.service.AlternativeFlowsIntegrationTest > multiple_taskinfo_searches_for_current_period FAILED
org.mockserver.client.ClientException at AlternativeFlowsIntegrationTest.java:391 ( mc.reset(); )
com.resurs.signicatdocumentmover.workinitiator.service.AlternativeFlowsIntegrationTest > no_taskinfo_for_current_period_and_next_period_too_recent_yields_no_action FAILED
java.lang.Exception
Caused by: org.mockserver.client.ClientException at AlternativeFlowsIntegrationTest.java:336 ``` ( mc.reset(); ) I have no idea about why this happens, anyone with a clue?
FYI, I do:
cmd : docker run -p1080:1080 jamesdbloom/mockserver:latest -serverPort 1080 -jvmOptions "-Dmockserver.disableRequestAudit=true"
executing: java -Dmockserver.disableRequestAudit=true -Dfile.encoding=UTF-8 -jar /opt/mockserver/mockserver-netty-jar-with-dependencies.jar -serverPort 1080 -logLevel INFO
And I got 202 response when do PUT http://localhost:1080/mockserver/verify with {
"httpRequest": {
"method": "GET",
"path": "/demo",
"queryStringParameters": {
"test": [
"1"
]
}
},
"times": {
"atLeast": 1,
"atMost": 2
}
}