Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • 16:50
    baniocarpentercode42 opened #760
  • Apr 08 23:08
    mattnelson opened #759
  • Apr 07 13:30
    golx opened #758
  • Apr 06 17:13

    jamesdbloom on master

    Add apiVersion to Chart.yaml M… (compare)

  • Apr 06 17:13
    jamesdbloom closed #756
  • Apr 06 14:35
    jakubjab commented #756
  • Apr 06 11:42
    jamesdbloom commented #756
  • Apr 06 09:02
    jakubjab commented #756
  • Apr 06 08:54
    jamesdbloom commented #756
  • Apr 06 08:49
    jamesdbloom closed #757
  • Apr 06 08:49
    jamesdbloom commented #757
  • Apr 06 08:35
    davidwestonuk2000 labeled #757
  • Apr 06 08:35
    davidwestonuk2000 opened #757
  • Apr 06 08:21
    jakubjab commented #756
  • Apr 06 08:08
    jamesdbloom commented #756
  • Apr 06 08:03
    jakubjab opened #756
  • Apr 06 02:46
    gabrielkirsten commented #755
  • Apr 06 02:45
    gabrielkirsten closed #755
  • Apr 06 02:45
    gabrielkirsten commented #755
  • Apr 06 00:48
    gabrielkirsten edited #755
@jamesdbloom Is it possible to use org.mockserver.client.initialize.ExpectationInitializer when running the server from the docker container?
nevermind, i was able to get it to work with the server package
Maciej Gunia
hey guys, trying to use mockserver-node alongside mockserver-client on my dev environment it works fine but in docker i get Error: spawn java ENOENT. Do I really need to install java inside the container? I had the impression that the node package should do that for me?
Marko Sertic
Hi, could anyone help me with my question ? I have noticed that when I set mockserver in my test, and uses lets say Future .get() to block execution until i get response from mockserver(because i am using async-http client but i need this part of code to be synchronous ). Test hangs until async-client timeouts. I have also use isDone() method to check if i will ever get response back, but it seems that for some reason mockserver doesn't return anything. Question is why is this happening and if there is a way to avoid such behaviour ? Also when i tried to lets say call real endpoint i Future .get() returns result perfectly fine, but i need wiremock for testing and this kinds of test just hangs until timeout on Future .get() call.
Alex Skrypnyk
Hi, is there a /version or other endpoint that can be used as a probe that the Mockserver is up and running?
@alexdesignworks You can just create an expectation for that, but I do realize the use case for that.
Alex Skrypnyk

yeah, this is what I do - create a GET expectation /selftest and call it. But this means that all helping functions that create such expectations in my framework should work correctly. Having /mockserver/version and CURL'ing it would be a much easier way to make sure that the server is running.

Thank you @Rahul-Bhargav

Hi everyone
i don't know how to run the examples which is available in examples
i ran the jar file using java -jar mockserver-netty-5.6.2-SNAPSHOT-jar-with-dependencies.jar --serverPort 1080 --debugLevel DEBUG
I am having an issue with responses. If my response text has a linefeed between elements, the program will not run:
"httpResponse" : {
"body" : '<test>
If the response is on one line it works. Why?
"httpResponse" : {
"body" : '<test></test>'
i need to response as a json file when trigger http://localhost:1800/api/v1/offlinedata
how to do anyone can help me out?
I used mockserver with maven and it worked fine.
Now I am trying to use mockserver with the testing tool - Cypress
Installed mockserver and mockserver-client through node,npm
But when i try to start the server, it throws TypeError: fs.readdirSync is not a function
But there is no place where i have worked with fileSystem(fs).
code -
it('try with npm node', ()=>{
var mockserver = require('mockserver-node');
verbose: true,
trace: true
console.log("started MockServer");
Can someone help me out with this please
Khushboo Agrawal
Hi I am new to this mock-server . I am trying to implement one request with it . I am able to start the server but when I am trying to HIT the request
Its returning 404
Can someone please help ?
I have raised an issue on github jamesdbloom/mockserver#658 20 days back. I still didn't get any response on it.
Yuriy Olkhovyy
Hi everyone, what's the right way of configuring multiple identical expectations when there are multiple instances of the same test run against a single instance of the MockServer? I am thinking about adding a header with a UUID value, so that the identical expectations do not collide, not sure though if it is the right way of making the identical expectations unique.
Second question - is there a common approach of cleaning up expectations? When a test is finished I'd like to clean all expectations created by that specific test.
Björn Kautler
@kiakimov when you create an expectation, you can say how often it should match, or also to always match.
Hello All, question around mockserver and FIPs. Has anyone gotten this working before? I'm seeing ssl is broken when you try to use FIPs version of bouncycastle with mockserver. Everything else seems fine, but I do not know enough about how all the backend is working to debug this well enough. So any help would be appreciated! Thanks in advance!
I use MVN to start the mock service, then how can I write the expected results of the hot interface if I make java? At present, I see the examples you give here all need to restart a mockserver service. It's very urgent. Please see the reply as soon as possible. Thank you very much!!!
Hello again All, I figured out FIPs on mockserver. I will be making a PR to go to the normal repo to try to alleviate this for anyone who might need to have FIPs working with mockserver. Will take me a few days to get it out there, reach out if anyone needs assistance in the mean time.
Uri Berman
Hi everyone. I'm configuring MockServer as a standalone process through Docker, using the latest version as of today.
I'm configuring a callback based response using the Node MockServer client.
Afterwards, I call the "reset" function of the client. However, it seems like the WebSocket connection created through "mockWithCallback" keeps existing, because my tests runner (Jest) does not exit, complaining about a persistent connection still existing
Has anyone ran into this issue in the past? I found a GitHub issue complaining about the same thing in the Java client, which was solved, but it seems like the same hasn't happened in the Javascript client
Hi Does MockServer support http2.0
Hi newbie here. Trying to get the examples war file to work. I have it deployed on jboss eap without error, but cannot seem to browse to URL. jboss is running on port 8080. Seeing messages like this on deployment: 2019-09-18 12:45:32,035 WARN [org.springframework.web.servlet.PageNotFound] (default task-1) No mapping found for HTTP request with URI [/mockserver-examples-5.6.2-SNAPSHOT] in DispatcherServlet with name 'dispatcherServlet'
Another newbie question. I need to have a response handler that reads in a template file, replaces some parameters, and return as the html result (in java). I am assuming you have to implement a callback class to do that? thanks!
Asif Ameer
Hello, I am running mock-server in a performance test where I send in 10000 requests to my AUT. I want to use the mock-server to confirm that 10K downstream calls were made. But I only get a max of 2000 requests reported by mock-server when I query it with verify or when I do a retrieve of requests after the test. Is this 2000 request log limit a hard limit in the mock-server?
Hello everyone, I would like to get a simple use application of mockServer. Could someone give me a link ? thanks
Hello every, I'm looking for a way to use the regex matched value within the expectation Response. Anyone can tell me if this possible ? If not, any idea how I could do, maybe with a javascript template ?
"httpRequest" : {
"method" : "POST",
"path" : "/api/v1/endpoint",
"headers" : {
"X-Service-Id" : [ "XXXX" ]
"body" : {
"type" : "REGEX",
"string" : "[{\"ref\":\"(.)\",(.)}]
"httpResponse" : {
"statusCode" : 200,
"reasonPhrase" : "OK"
"body" : {
"type" : "STRING",
"string" : "[{\"ref\":\"$1\",....}]
My question is about the way to have a matched value ref "$1" into the Response body.
Thanks in advance for your help :)
Ben Fradet
hello, I'm upgrading from 3.12 to 5.6.1 and getting Cause: java.net.SocketException: Unexpected end of file from server for every test, is there something I'm missing on the upgrade path?
Anton Shapiro
Hi all, I am trying to set up mock Server in stand alone mode, that is java -jar ... I could not find any clear explanation/example on how to : capture response from "to be mocked" system and how to respond with captured response. Can anyone please help me out or point me to an example? Thanks
Anton Shapiro
Jun Yu
I have been using mockserver for function testing. Can the mockserver be used for load testing? Will mockserver become the bottleneck?
Anton Shapiro
Stand alone mode, repointed my server to talk to mock, pointed postman to hit mock URL. Post man runs fine, i am getting mocked response, however my app gets 502 Connection refused, while trying to connect to mock server. Any ideas?
Vikramsingh Rajput
how to check if my mockserver is running on my local port? is it possible to hit URL on web browser.
Raajeev H dave
Hi Everyone. I have installed MockServer Proxy to record
and I want to mock one of my Web Url
How should process now
Any help will be appriciated

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
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
Caused by: org.mockserver.client.ClientException at AlternativeFlowsIntegrationTest.java:336 ``` ( mc.reset(); ) I have no idea about why this happens, anyone with a clue?

Hello, did someone already use configuration option: mockserver.disableRequestAudit=true ? into our env, we are generating too much traffic for mock server and so we would like to not store the requests as we are not using /verify. But I always see the requests when using /retrieve, did I misunderstand this option ?

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": [
"times": {
"atLeast": 1,
"atMost": 2

hi, Does mock-server support browser proxy?
the document doesn't seem to be clear about this