Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • 04:39

    jamesdbloom on master

    reduced time range of CA certif… added basic support to proxy bi… saved certificate and private k… and 4 more (compare)

  • 04:29
    jamesdbloom closed #786
  • 04:29
    jamesdbloom commented #786
  • 02:48
    ndhilliprasad commented #773
  • 02:42
    ndhilliprasad labeled #788
  • 02:42
    ndhilliprasad opened #788
  • May 25 18:15
    Alterant-zz commented #787
  • May 25 17:55
    Alterant-zz opened #787
  • May 25 13:22
    Vampire edited #786
  • May 25 13:22
    Vampire opened #786
  • May 25 10:25
    MahatmaFatalError commented #779
  • May 22 23:46
    jamesdbloom closed #779
  • May 22 23:46
    jamesdbloom commented #779
  • May 22 23:45

    jamesdbloom on master

    Fixing concurrency issues for v… (compare)

  • May 22 23:45
    jamesdbloom closed #782
  • May 22 20:05
    ndhilliprasad commented #782
  • May 21 18:53
    dependabot[bot] labeled #785
  • May 21 18:53
    dependabot[bot] opened #785
  • May 21 18:53

    dependabot[bot] on maven

    Bump tomcat-embed-core from 9.0… (compare)

  • May 21 15:57
    vaibhavpatil123 commented #784
Jonathan Vila
tbh, I dont find the way to download a file
I have a simple expectation :
                        .respond(myrequest -> {
                            try {
                                return response()
                                        .withHeader("Content-Type", "application/zip")
                                        .withBody(new BinaryBody(IOUtils.resourceToByteArray("platform.upload.xavier.json.gz", EndToEndIT.class.getClassLoader())));
                            } catch (IOException e) {
                                return notFoundResponse();
and this is the client
InputStream outputStream = new RestTemplate().postForObject("http://localhost:8000/insights-upload-perm-test2", "", ByteArrayInputStream.class);
        GZIPInputStream gzipInputStream = new GZIPInputStream(outputStream);
        System.out.println(" Descarga : " + IOUtils.toString(gzipInputStream, StandardCharsets.UTF_8));
it complains with : org.springframework.web.client.RestClientException: Could not extract response: no suitable HttpMessageConverter found for response type [class] and content type [application/zip]
Jonathan Vila
        List<HttpMessageConverter<?>> messageConverters = new ArrayList<HttpMessageConverter<?>>();
        messageConverters.add(new ByteArrayHttpMessageConverter());
        HttpHeaders headers = new HttpHeaders();
        HttpEntity<String> entity = new HttpEntity<String>(headers);
        ResponseEntity<byte[]> outputStream = new RestTemplate(messageConverters).exchange("http://localhost:8000/insights-upload-perm-test2", HttpMethod.GET, entity, byte[].class, "1");
        GZIPInputStream gzipInputStream = new GZIPInputStream(new ByteArrayInputStream(outputStream.getBody()));
        System.out.println(" Descarga : " + IOUtils.toString(gzipInputStream, StandardCharsets.UTF_8));
Lasse Benn Nørregaard
@jonathanvila I don’t know how you’re running WireMock, but have you looked at this:
Jonathan Vila
Hi @lassebn , I gave up on WireMock because the issues with Spring Boot.... now I'm using mock-server that works perfectly well..... but, I'm having an issue in the way of serving a file
@jamesdbloom I've tried today and if I point my Camel application to download a zip file from internet ( random web page serving a zip file ) it works fine with current code, but doing the above approach with mock-server creates some kind of issues on the type conversion
Lasse Benn Nørregaard
@jonathanvila Sorry, I confused myself thinking this channel was for WireMock.
Jonathan Vila
Jonathan Vila
@jamesdbloom Fixed..... I have added (and calculated) the Content-length header and everything worked fine. :)
Do i need to do anything special to get the UI to work? I go to http://localhost:1080/mockserver/dashboard and don't see any of the logs/active expectations/etc.
Tim Dolgov
I have a problem help. I do not understand how to make it work! If there are no mocks, so that there is a redirection to normal integration. And if there are mocks to respond to them.
William Lightning
@browerjs The UI only works on https:// and your browser trusts the MockServer CA
@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