MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Rub

Overview

MockServer            Tweet Build status GitHub license GitHub stars Trello Backlog  Join Slack

Documentation

For usage guide please see: www.mock-server.com

Change Log

Please see: Change Log

Community

Chat Join Slack
Feature Requests Github Issues
Issues / Bugs Github Issues
Backlog Trello Backlog

Versions

Maven Central mockserver

Maven Central contains the following MockServer artifacts:

In addition MockServer SNAPSHOT artifacts can also be found on Sonatype.

Node Module & Grunt Plugin

NPM Registry contains the following module:

Docker Hub

Docker Hub contains the following artifacts:

Helm Chart
MockServer Clients
Previous Versions
Version Date Git & Docker Tag / Git Hash Documentation Java API REST API
5.11.2 08 Nov 2020 mockserver-5.11.2 / eb84f2 Documentation Java API 5.11.x REST API
5.11.1 22 Jul 2020 mockserver-5.11.1 / 361e5c Documentation Java API 5.11.x REST API
5.11.0 08 Jul 2020 mockserver-5.11.0 / 756758 Documentation Java API 5.11.x REST API
5.10.0 24 Mar 2020 mockserver-5.10.0 / 14124d Documentation Java API 5.10.x REST API
5.9.0 01 Feb 2020 mockserver-5.9.0 / eacf07 Documentation Java API 5.9.x REST API
5.8.1 23 Dec 2019 mockserver-5.8.1 / f0e9ab Documentation Java API 5.8.x REST API
5.8.0 01 Dec 2019 mockserver-5.8.0 / 7c9fc5 Documentation Java API 5.8.x REST API
5.7.2 16 Nov 2019 mockserver-5.7.2 / 7c9fc5 Documentation Java API 5.7.x REST API
5.7.1 09 Nov 2019 mockserver-5.7.1 / 0ca353 Documentation Java API 5.7.x REST API
5.7.0 01 Nov 2019 mockserver-5.7.0 / b58bc5 Documentation Java API 5.7.x REST API
5.6.1 21 Jul 2019 mockserver-5.6.1 / aec1fb Documentation Java API 5.6.x REST API
5.6.0 21 Jun 2019 mockserver-5.6.0 / 8f82dc Documentation Java API 5.6.x REST API
5.5.4 26 Apr 2019 mockserver-5.5.4 / 4ffd31 Documentation Java API 5.5.x REST API
5.5.1 29 Dec 2018 mockserver-5.5.1 / 11d8a9 Documentation Java API 5.5.x REST API
5.5.0 15 Nov 2018 mockserver-5.5.0 / 06e6fd Documentation Java API 5.5.x REST API
5.4.1 20 Jun 2018 mockserver-5.4.1 / 7cd5de Documentation Java API 5.4.x REST API
5.3.0 25 Dec 2017 mockserver-5.3.0 / ad62bb Documentation Java API 5.2.x REST API
5.2.3 17 Dec 2017 mockserver-5.2.3 / e81c53 Documentation Java API 5.2.x REST API
5.2.2 12 Dec 2017 mockserver-5.2.2 / b47090 Documentation Java API 5.2.x REST API
5.2.1 11 Dec 2017 mockserver-5.2.1 / 834ec8 Documentation Java API 5.2.x REST API
5.2.0 10 Dec 2017 mockserver-5.2.0 / ccb4d2 Documentation Java API 5.2.x REST API
5.1.1 06 Dec 2017 mockserver-5.1.1 / 664afb Documentation Java API 5.1.x REST API
5.1.0 05 Dec 2017 mockserver-5.1.0 / bbdda1 Documentation Java API 5.1.x REST API
5.0.1 05 Dec 2017 mockserver-5.0.1 / 975fb8 Documentation Java API 5.0.x REST API
5.0.0 04 Dec 2017 mockserver-5.0.0 / ed5d13 Documentation Java API 5.0.x REST API
4.1.0 30 Nov 2017 mockserver-4.1.0 / 4e37b2 Documentation Java API 4.x.x REST API
4.0.0 28 Nov 2017 mockserver-4.0.0 / 8b2455 Documentation Java API 4.x.x REST API

Issues

If you have any problems, please check the project issues and avoid opening issues that have already been fixed. When you open an issue please provide the following information:

  • MockServer version (i.e. 5.11.2)
  • How your running the MockServer (i.e maven plugin, docker, etc)
  • MockServer log output, at INFO level (or higher)
  • What the error is
  • What you are trying to do

Contributions

Pull requests are, of course, very welcome! Please read our contributing to the project guide first. Then head over to the open issues to see what we need help with. Make sure you let us know if you intend to work on something. Also check out Trello Backlog to see what is already in the backlog.

Feature Requests

Feature requests are submitted to github issues. Once accepted they will be added to the backlog. Please check out Trello Backlog to see what is already in the backlog.

Maintainers

Comments
  • Requests being forgotten

    Requests being forgotten

    Describe the issue Similar to https://github.com/mock-server/mockserver/issues/794 when I upgrade from Mockserver 5.10.0 to 5.11.X, running curl -X PUT "http://localhost:1080/mockserver/retrieve?type=REQUESTS" | grep "method" | wc -l results in different numbers.

    5.10.0 - 341 5.11.0 - 146 5.11.1 - 79 5.11.2 - 145 Latest FROM mockserver/mockserver@sha256:29fdd72462a6b5c48de17c01d184b29327a1c96181de7bffac1defb5f7832986 - 103

    From my application logs, I can see that the expectations/requests do exist, as my calls are succeeding, just the record of them is being wiped out.

    What you are trying to do Verify that calls were made to MockServer

    MockServer version See above.

    To Reproduce

    I'm running MockServer via Docker, loading my expectations via JSON files. These are my environment variables

          MOCKSERVER_MAX_LOG_ENTRIES: 20000 # Only added to try and help debug
          MOCKSERVER_INITIALIZATION_JSON_PATH: /config/initializerJson.json
    

    Expected behaviour The number of recorded expectations would match between 5.10.0 and higher

    MockServer Log

    2022-02-07 15:08:53 5.11.1 INFO loading JSON initialization file:
    2022-02-07T15:08:54.011066200Z 
    2022-02-07T15:08:54.011080700Z   /config/initializerJson.json
    2022-02-07T15:08:54.011098300Z  
    2022-02-07T15:08:54.134884200Z 2022-02-07 15:08:54 5.11.1 INFO processing JSON expectation 1 of 222
    

    And it continues and creates them all.

    opened by busches 26
  • mockserver-war file not works in Wildfly

    mockserver-war file not works in Wildfly

    Hello,

    I really love mock-server project, in fact currently I am developing an Arquillian extension for mock-server. But I have found one problem when I try to deploy mockserver-war-2.10 to wildfly 8.0. When I deploy the war file inside Wildfly next exception is thrown:

    23:39:44,968 INFO  [org.jboss.weld.deployer] (MSC service thread 1-3) JBAS016008: Starting weld service for deployment mockserver-war-2.10.war
    23:39:45,042 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.deployment.unit."mockserver-war-2.10.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."mockserver-war-2.10.war".WeldStartService: Failed to start service
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0]
        at java.lang.Thread.run(Thread.java:744) [rt.jar:1.8.0]
    Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type Set<Service> with qualifiers @Default
      at injection point [BackedAnnotatedParameter] Parameter 1 of [BackedAnnotatedConstructor] @Inject com.google.common.util.concurrent.ServiceManager(Set<Service>)
      at com.google.common.util.concurrent.ServiceManager.<init>(ServiceManager.java:0)
    
        at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:368)
        at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:289)
        at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:135)
        at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:166)
        at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:514)
        at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:68)
        at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:66)
        at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:60)
        at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:53)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0]
        ... 3 more
    
    23:39:45,045 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 33) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "mockserver-war-2.10.war")]) - failure description: {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"mockserver-war-2.10.war\".WeldStartService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"mockserver-war-2.10.war\".WeldStartService: Failed to start service
        Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type Set<Service> with qualifiers @Default
      at injection point [BackedAnnotatedParameter] Parameter 1 of [BackedAnnotatedConstructor] @Inject com.google.common.util.concurrent.ServiceManager(Set<Service>)
      at com.google.common.util.concurrent.ServiceManager.<init>(ServiceManager.java:0)
    "}}
    23:39:45,045 ERROR [org.jboss.as.server] (management-handler-thread - 33) JBAS015870: Deploy of deployment "mockserver-war-2.10.war" was rolled back with the following failure message:
    {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"mockserver-war-2.10.war\".WeldStartService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"mockserver-war-2.10.war\".WeldStartService: Failed to start service
        Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type Set<Service> with qualifiers @Default
      at injection point [BackedAnnotatedParameter] Parameter 1 of [BackedAnnotatedConstructor] @Inject com.google.common.util.concurrent.ServiceManager(Set<Service>)
      at com.google.common.util.concurrent.ServiceManager.<init>(ServiceManager.java:0)
    "}}
    

    Any idea of what it is happening?

    Thank you so much for your help, Alex.

    opened by lordofthejars 24
  • Add spring test module to facilitate Spring Tests with random MockServer port

    Add spring test module to facilitate Spring Tests with random MockServer port

    Describe the feature request Add an extra spring test module which provides a @MockServerTest annotation which starts MockServer for each test instance and resets it after each test method. The MockServer is started with a random port which also can be used to customize test properties: @MockServerTest('client.serviceUrl=http://localhost:${mockServerPort}/')

    What you are trying to do Context: Spring / Spring Boot Use Case: You write a test for a client to a remote service. The client is a Spring Bean which is configured via properties. You want to replace the remote service with MockServer. As multiple tests may run on the CI server the MockServer should use a random free port.

    The solution you'd like I have already implemented the feature in our company as follows: The comments in spring.factories explain it best:

    # Starts the MockServer with the mockserverPort property in the environment and resets it after test methods
    org.springframework.test.context.TestExecutionListener=test.mockserver.MockServerTestExecutionListener
    
    # adds a context customizer which replaces ${mockserverPort} placeholder of the @MockServer annotation and ads it as test property
    org.springframework.test.context.ContextCustomizerFactory=test.mockserver.MockServerTestCustomizerFactory
    

    Usage: MyClient connects to the property myClient.remoteServiceUrl. The remote service is mocked. MockServerClient is filled by MockServerTestExecutionListener.

    @MockServerTest('myClient.remoteServiceUrl=http://localhost:${mockServerPort}/')
    @WebMvcTest
    class ClientIT extends Specification {
    
        @Inject
        MyClient myClient
    
        MockServerClient mockServerClient
    }
    

    Describe alternatives you've considered

    First TestPropertySource

    @TestPropertySource(properties = ["myClient.remoteServiceUrl=http://localhost:4711"])
    

    This works, but the port is fixed and may conflict with other ports on the server. If multiple tests with MockServer are running, the given ports must be managed.

    Questions Does this fit into this project? If yes where should it be located?

    Other As I have already implemented the feature I can provide a PR if it fits and all questions are discussed.

    enhancement 
    opened by masooh 21
  • Error in deserialization of  JSON

    Error in deserialization of JSON

    i'm trying to send application/x-www-form-urlencoded request with body to:[email protected]

    this is the test code: new MockServerClient("localhost", 1080) .when(request("/messages") .withMethod("POST") .withQueryStringParameter(Parameter.param("to","[email protected]")) ) .respond(response().withStatusCode(200)); And when this code is executed, i have this exception: IllegalArgumentException: Exception while parsing [{ "httpRequest" : { "method" : "POST", "path" : "/messages", "queryStringParameters" : { "to" : [ "[email protected]" ] } }, "httpResponse" : { "statusCode" : 200 }, "times" : { "remainingTimes" : 0, "unlimited" : true }, "timeToLive" : { "unlimited" : true } }] for Expectation

    com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance ofjava.lang.Stringout of FIELD_NAME token at [Source: (String)"{ "httpRequest" : { "method" : "POST", "path" : "/messages", "queryStringParameters" : { "to" : [ "[email protected]" ] } }, "httpResponse" : { "statusCode" : 200 }, "times" : { "remainingTimes" : 0, "unlimited" : true }, "timeToLive" : { "unlimited" : true } }"

    How can i bypass or fix this?

    opened by IgorMaksymov 17
  • Channel set as inactive before valid response has been received

    Channel set as inactive before valid response has been received

    Hello I deployed Mockserver from docker image (jamesdbloom/mockserver). After that I set expectations by curl -v -X PUT ":1080/expectation" -d '{ "httpRequest" : { "method" : "GET", "path" : "/view/cart"}, "httpResponse" : {"body" : "some_response_body"}}'

    and I able to get response first time by curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET :1080/view/cart

    However, when I run preceding curl command second time it fails as below. Is it a bug? What is solution/workaround? Thanks in advance! Dimitry

    Error 2018-01-24 03:55:14,005 ERROR o.m.m.HttpStateHandler Exception processing { "method" : "GET", "path" : "/view/cart", "headers" : { "User-Agent" : [ "curl/7.49.1" ], "Accept" : [ "application/json" ], "Content-Type" : [ "application/json" ], "host" : [ "a176448f5fffa11e7ac720a19521a2cc-1910945988.eu-west-1.elb.amazonaws.com:1080" ], "accept-encoding" : [ "gzip,deflate" ], "content-length" : [ "0" ], "connection" : [ "keep-alive" ] }, "keepAlive" : true, "secure" : false } java.lang.RuntimeException: Exception while sending request - java.lang.RuntimeException: Channel set as inactive before valid response has been received at org.mockserver.client.netty.NettyHttpClient.sendRequest(NettyHttpClient.java:101) ~[mockserver-netty-jar-with-dependencies.jar:na] at org.mockserver.mock.action.ActionHandler.processAction(ActionHandler.java:111) ~[mockserver-netty-jar-with-dependencies.jar:na] at org.mockserver.mockserver.MockServerHandler.channelRead0(MockServerHandler.java:107) [mockserver-netty-jar-with-dependencies.jar:na] at org.mockserver.mockserver.MockServerHandler.channelRead0(MockServerHandler.java:37) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:108) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [mockserver-netty-jar-with-dependencies.jar:na] at org.mockserver.unification.PortUnificationHandler.switchToHttp(PortUnificationHandler.java:188) [mockserver-netty-jar-with-dependencies.jar:na] at org.mockserver.unification.PortUnificationHandler.channelRead0(PortUnificationHandler.java:91) [mockserver-netty-jar-with-dependencies.jar:na] at org.mockserver.unification.PortUnificationHandler.channelRead0(PortUnificationHandler.java:37) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1359) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:935) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:138) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:645) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:580) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:497) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138) [mockserver-netty-jar-with-dependencies.jar:na] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_151] Caused by: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Channel set as inactive before valid response has been received at com.google.common.util.concurrent.AbstractFuture$Sync.getValue(AbstractFuture.java:299) ~[mockserver-netty-jar-with-dependencies.jar:na] at com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:272) ~[mockserver-netty-jar-with-dependencies.jar:na] at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:96) ~[mockserver-netty-jar-with-dependencies.jar:na] at org.mockserver.client.netty.NettyHttpClient.sendRequest(NettyHttpClient.java:80) ~[mockserver-netty-jar-with-dependencies.jar:na] ... 51 common frames omitted Caused by: java.lang.RuntimeException: Channel set as inactive before valid response has been received at org.mockserver.client.netty.HttpClientConnectionHandler.updatePromise(HttpClientConnectionHandler.java:19) ~[mockserver-netty-jar-with-dependencies.jar:na] at org.mockserver.client.netty.HttpClientConnectionHandler.channelInactive(HttpClientConnectionHandler.java:25) ~[mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:245) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:231) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:224) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.DefaultChannelPipeline$HeadContext.channelInactive(DefaultChannelPipeline.java:1354) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:245) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:231) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.DefaultChannelPipeline.fireChannelInactive(DefaultChannelPipeline.java:917) [mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.AbstractChannel$AbstractUnsafe$8.run(AbstractChannel.java:822) ~[mockserver-netty-jar-with-dependencies.jar:na] at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) ~[mockserver-netty-jar-with-dependencies.jar:na] at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403) ~[mockserver-netty-jar-with-dependencies.jar:na] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463) [mockserver-netty-jar-with-dependencies.jar:na] ... 3 common frames omitted

    bug enhancement 
    opened by dimirtyg 17
  • Support method / object callbacks instead of class name

    Support method / object callbacks instead of class name

    Thanks for nice piece of software. I have just started using MockServer I love it however I feel I miss one feature. While mocking I'm able to specify HttpCallback which will be executed on server invocation. However HttpCallback may contain only class name. For some use cases I would like something more dynamic. I wonder if you considered allowing to put instance rather than class into HttpCallback so user could define behavior more dynamically.

    That would be more similar to Mockito's when(something).thenAnswer(code_to_execute_here)

    What do you think?

    enhancement documentation 
    opened by JanGurda 17
  • default expectations

    default expectations

    **Flow ** I have BaseIT where i want to add some default expectation for mockserver to lower boilerplate code in child tests. In some test needed some another behavior so i clear old and add new expectation. Its work correct.

    I used here 1 MockServerClient Bean is it ok? Or i should create new bean per each child it class?

    Issue description Its similar to issues#577. But i do not think its good to create mockServerClient every time for creating expectation and verification

    I have about 260 test and somewhere between 60-100 test i faced with org.mockserver.client.netty.SocketCommunicationException: Response was not received from MockServer after 20000 milliseconds, to make the proxy wait longer please use

    What you are trying to do

    1. increase timeout but i faced with java.lang.OutOfMemoryError: GC overhead limit exceeded

    MockServer version The version you are using (i.e. 5.7.2)

    To Reproduce I use docker. Steps to reproduce the issue: create Base class with default expectations and so not use server api in some tests.

    Expected behaviour Possibility use default expectation for all tests which can even do not call some of expectation.

    question need_more_information 
    opened by DmitryShabalin 16
  • Mockserver double-logging requests from 5.7.1

    Mockserver double-logging requests from 5.7.1

    In version 5.7.1, we are seeing mockserver double logging a request:

    In one specific test:

    • We make 5 requests
    • We call retrieve
    • We consistently get back 6
    • There is one specific request which is always there twice

    This doesn't happen on 5.7.0.

    The truth is, we don't really know enough about mockserver to debug it more than that, but happy to work with you to try and form a repro case we can share.

    This is what we get from mockserver (we've removed the headers, if you need them for repro we can send them to you but ideally not over github) You can see 3 and 4 are the same, but we are definitely not retrying from our side.

    Array
    (
        [0] => stdClass Object
            (
                [method] => GET
                [path] => /xero/api.xro/2.0/Invoices
                [queryStringParameters] => stdClass Object
                    (
                        [IDs] => Array
                            (
                                [0] => INV_GUID1_1,INV_GUID1_2,INV_GUID1_FLAKY_404,INV_GUID2_FLAKY_404,INV_GUID1_REALLY_NOT_FOUND
                            )
                    )
            )
        [1] => stdClass Object
            (
                [method] => GET
                [path] => /xero/api.xro/2.0/Invoices/INV_GUID1_FLAKY_404
            )
    
        [2] => stdClass Object
            (
                [method] => GET
                [path] => /xero/api.xro/2.0/Invoices/INV_GUID2_FLAKY_404
            )
    
        [3] => stdClass Object
            (
                [method] => GET
                [path] => /xero/api.xro/2.0/Invoices/INV_GUID1_REALLY_NOT_FOUND
            )
    
        [4] => stdClass Object
            (
                [method] => GET
                [path] => /xero/api.xro/2.0/Invoices/INV_GUID1_REALLY_NOT_FOUND
              
            )
    
        [5] => stdClass Object
            (
                [method] => GET
                [path] => /xero/api.xro/2.0/Contacts/CON_GUID1_99
            )
    )
    
    bug need_more_information 
    opened by paprikati 16
  • Request-body incorrectly parsed

    Request-body incorrectly parsed

    This is similar to this issue: https://github.com/jamesdbloom/mockserver/issues/204

    I use OkHttp to do REST-requests, and use MockServer for the tests. I've also tested it with RestTemplate from Spring with the same result.

    The java:

    final SomeDTO requestObject = new SomeDTO(someParams);
    final String jsonObject = objectMapper.writeValueAsString(requestObject);
    final MediaType MEDIA_TYPE_JSON = MediaType.get("application/json; charset=utf-8");
    
    final RequestBody requestBody = RequestBody.create(MEDIA_TYPE_JSON, jsonObject);
    final Request request = new Request.Builder().url("serverUrl").post(requestBody).build();
    
    final Response response = client.newCall(request).execute();
    final String responseJson = response.body().string();
    final ResultDTO result = objectMapper.readValue(responseJson, ResultDTO.class);
    

    The MockServer expectation:

    final MockServerClient client = new MockServerClient("127.0.0.1", 1080);
    client.when(request().withMethod("POST") //
                         .withPath("serverUrl") //
                         .withBody(json(correctJsonString, MatchType.ONLY_MATCHING_FIELDS))) //
          .respond(response().withStatusCode(200) //
                             .withHeaders(new Header("Content-Type", "application/json; charset=utf-8"),
                                        new Header("Cache-Control", "public, max-age=86400"))
                             .withBody(responseJson));
    

    I get a request didn't match expectation because: body didn't match, where the difference between the bodies are:

    Request:

    "body" : {
      "type" : "STRING",
      "string" : "{\"id\":33611,\"prop1\":28,\"prop2\":\"value2\",\"graph\":[...]}",
      "contentType" : "text/plain; charset=utf-8"
    }
    

    Request should match:

    "body" : {
      "type" : "JSON",
      "json" : "{\"prop2\":\"value2\",\"prop1\":28,\"graph\":[...]}"
    }
    

    Am I doing something wrong? Why does MockServer detects the body as STRING instead of JSON, while the content type is set correctly? Why is the contentType set to "text/plain". Why is there even a separate contentType for the body...?

    need_more_information unable_to_reproduce 
    opened by ThomasStubbe 16
  • Access to mockserver by container name hangs mockserver

    Access to mockserver by container name hangs mockserver

    Hello, in my scenario I am trying to put mockserver behind nginx and proxy requests to it. But this issue is not about nginx at all. I encountered interesting issue when I try to access mockserver using container name. Here is example how to achieve that: Firstly, I create network

    docker network create mynetwork
    

    Then I start mockserver in that network and install curl in new container

    docker run -d --net=mynetwork --name mockserver jamesdbloom/mockserver:mockserver-5.3.0
    docker exec -ti mockserver apk add --no-cache curl
    

    Then I add watcher in the second ssh session to ensure mockserver container is responsive:

    watch docker exec -ti mockserver curl -v localhost:1080
    

    Output:

    Every 2.0s: docker exec -ti mockserver curl -v localhost:1080                                                                                                                                                       Tue Mar 13 14:46:33 2018
    
    * Rebuilt URL to: localhost:1080/
    *   Trying 127.0.0.1...
    * TCP_NODELAY set
    * Connected to localhost (127.0.0.1) port 1080 (#0)
    > GET / HTTP/1.1
    > Host: localhost:1080
    > User-Agent: curl/7.58.0
    > Accept: */*
    >
    < HTTP/1.1 404 Not Found
    < connection: keep-alive
    < content-length: 0
    <
    * Connection #0 to host localhost left intact
    

    I also see that time (14:46:33) is changing every 2 seconds as expected. Then I start another container in the same network, for example alpine:

    docker run -ti --net=mynetwork alpine:3.6
    apk add --no-cache curl
    curl -v mockserver:1080
    

    Instantly after request to mockserver:1080 time in watcher stops changing meaning that request is hanging. Also, request to mockserver:1080 hangs himself for about 2 minutes. Output is:

    * Rebuilt URL to: mockserver:1080/
    *   Trying 172.20.0.2...
    * TCP_NODELAY set
    * Connected to mockserver (172.20.0.2) port 1080 (#0)
    > GET / HTTP/1.1
    > Host: mockserver:1080
    > User-Agent: curl/7.58.0
    > Accept: */*
    >
    < HTTP/1.1 400 Bad Request
    < connection: keep-alive
    < content-length: 202
    <
    * Connection #0 to host mockserver left intact
    

    This is what I see in logs:

    2018-03-13 14:53:33,177 ERROR o.m.m.HttpStateHandler Exception processing {
      "method" : "GET",
      "path" : "/",
      "headers" : {
        "User-Agent" : [ "curl/7.58.0" ],
        "Accept" : [ "*/*" ],
        "host" : [ "mockserver:1080" ],
        "accept-encoding" : [ "gzip,deflate" ],
        "content-length" : [ "0" ],
        "connection" : [ "keep-alive" ]
      },
      "keepAlive" : true,
      "secure" : false
    }
    org.mockserver.client.netty.SocketCommunicationException: Response was not received after 120000 milliseconds, to make the proxy wait longer please use "mockserver.maxSocketTimeout" system property or ConfigurationProperties.maxSocketTimeout(long milliseconds)
            at org.mockserver.client.netty.NettyHttpClient.sendRequest(NettyHttpClient.java:89) ~[mockserver-netty-jar-with-dependencies.jar:na]
            at org.mockserver.mock.action.ActionHandler.processAction(ActionHandler.java:111) ~[mockserver-netty-jar-with-dependencies.jar:na]
            at org.mockserver.mockserver.MockServerHandler.channelRead0(MockServerHandler.java:107) [mockserver-netty-jar-with-dependencies.jar:na]
            at org.mockserver.mockserver.MockServerHandler.channelRead0(MockServerHandler.java:37) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:108) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [mockserver-netty-jar-with-dependencies.jar:na]
            at org.mockserver.unification.PortUnificationHandler.switchToHttp(PortUnificationHandler.java:188) [mockserver-netty-jar-with-dependencies.jar:na]
            at org.mockserver.unification.PortUnificationHandler.channelRead0(PortUnificationHandler.java:91) [mockserver-netty-jar-with-dependencies.jar:na]
            at org.mockserver.unification.PortUnificationHandler.channelRead0(PortUnificationHandler.java:37) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1359) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:935) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:138) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:645) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:580) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:497) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858) [mockserver-netty-jar-with-dependencies.jar:na]
            at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138) [mockserver-netty-jar-with-dependencies.jar:na]
            at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]
    

    And my watcher continues to be unresponsive. So at this moment any request from any container (including mockserver) hangs. Additional information: Docker version 18.02.0-ce, build fc4de44

    docker network inspect mynetwork
    [
        {
            "Name": "mynetwork",
            "Id": "43d1571ce8d484507a852b3df6b250f36df9a0058bbf17ee187632375eca7fa4",
            "Created": "2018-03-13T14:50:46.942848193Z",
            "Scope": "local",
            "Driver": "bridge",
            "EnableIPv6": false,
            "IPAM": {
                "Driver": "default",
                "Options": {},
                "Config": [
                    {
                        "Subnet": "172.20.0.0/16",
                        "Gateway": "172.20.0.1"
                    }
                ]
            },
            "Internal": false,
            "Attachable": false,
            "Ingress": false,
            "ConfigFrom": {
                "Network": ""
            },
            "ConfigOnly": false,
            "Containers": {
                "44c9276d690bf968991b46fcd3c6266a2b18411c175ae2baa3ffa85b0d8e8e57": {
                    "Name": "mockserver",
                    "EndpointID": "51532c23bf06c21d8cf7d4e08bc53d5da3c4e8c3731511bfdf2faf488754aaa4",
                    "MacAddress": "02:42:ac:14:00:02",
                    "IPv4Address": "172.20.0.2/16",
                    "IPv6Address": ""
                },
                "5276a0cf89297a67186907779c4aa410d773e007b3a2ac1308e02592a5487514": {
                    "Name": "sleepy_lewin",
                    "EndpointID": "b7c0f62d816e003cb89e264d64c6e982e6c56078ffd391636d8fa55fcdbeb54e",
                    "MacAddress": "02:42:ac:14:00:03",
                    "IPv4Address": "172.20.0.3/16",
                    "IPv6Address": ""
                }
            },
            "Options": {},
            "Labels": {}
        }
    ]
    
    opened by OlegRakovitch 16
  • Adding httpForward expectation with JavaScript API fails

    Adding httpForward expectation with JavaScript API fails

    I'm trying to add a simple httpForward expectation using JavaScript API (v. 5.3.0) but it fails with an error message : oneOf of the following must be specified "httpResponseTemplate" "httpForwardTemplate" "httpClassCallback" "httpError" "httpObjectCallback"

    The reason is mockServerClient.mockAnyResponse() adds all expectations pre-defined default response headers. Although i want to add a forward expectation with:

        {
            "httpRequest": {
              "path": "/some/path"
            },
            "httpForward": {
              "host": "mock-server.com",
              "port": 8080,
              "scheme": "HTTP"
            }
          }
    

    the generated request with JavaScript API is:

    [{
    		"httpRequest" : {
    			"path" : "/some/path"
    		},
    		"httpForward" : {
    			"host" : "mock-server.com",
    			"port" : 8080,
    			"scheme" : "HTTP"
    		},
    		"httpResponse" : {
    			"headers" : [{
    					"name" : "Content-Type",
    					"values" : ["application/json; charset=utf-8"]
    				}, {
    					"name" : "Cache-Control",
    					"values" : ["no-cache, no-store"]
    				}
    			]
    		}
    	}
    ]
    

    which is, i think, not allowed.

    bug 
    opened by edilaver 16
  • DirectProxy asynchronous communication

    DirectProxy asynchronous communication

    This PR focuses on asynchronous communication (non-paired messages). This is not part of http and is achieved by use of the BinaryRequestProxyingHandler, i.e. direct-proxy mode. Three main changes were made:

    • An extra option forwardBinaryRequestsAsynchronously was added, enabling (or disabling, by default) the next two changes
    • An extra mode was added to the NettyHttpClient. This mode keeps the socket to the remote server open. This is necessary when multiple packets from the client to the mockserver comprise one message. The mockserver should forward these messages using one socket channel.
    • The binaryExchangeCallback is triggered immediately, not only after a response is received in the MockServer.
    opened by Arkinator 2
  • Spelling

    Spelling

    This PR corrects misspellings identified by the check-spelling action.

    The misspellings have been reported at https://github.com/jsoref/mockserver/commit/d755652695c7ecb9662b94a7127236cd4e705057#commitcomment-94332162

    The action reports that the changes in this PR would make it happy: https://github.com/jsoref/mockserver/commit/544555c3baf931f8bd5cad286c0cde068011c8b4

    Note: this PR does not include the action. If you're interested in running a spell check on every PR and push, that can be offered separately.

    opened by jsoref 1
  • [Snyk] Upgrade com.networknt:json-schema-validator from 1.0.73 to 1.0.74

    [Snyk] Upgrade com.networknt:json-schema-validator from 1.0.73 to 1.0.74

    This PR was automatically created by Snyk using the credentials of a real user.


    Snyk has created this PR to upgrade com.networknt:json-schema-validator from 1.0.73 to 1.0.74.

    :information_source: Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.


    • The recommended version is 1 version ahead of your current version.
    • The recommended version was released 23 days ago, on 2022-12-02.

    Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.

    For more information:

    🧐 View latest project report

    πŸ›  Adjust upgrade PR settings

    πŸ”• Ignore this dependency or unsubscribe from future upgrade PRs

    opened by jamesdbloom 0
  • Connection timeout emulation

    Connection timeout emulation

    Describe the feature request It would be nice to have the possibility to set the connection delay on the MockServer to be able to test the connect timeout

    What you are trying to do I'm trying to do testing for connection timeout. Right now there is a possibility to test the read timeout using withDelay function. https://www.mock-server.com/mock_server/creating_expectations.html#button_response_literal_with_10_second_delay

    But connect timeout - looks impossible.

    enhancement 
    opened by feanor777 0
  • build(deps): bump spring-boot-starter-webflux from 2.7.6 to 3.0.1

    build(deps): bump spring-boot-starter-webflux from 2.7.6 to 3.0.1

    Bumps spring-boot-starter-webflux from 2.7.6 to 3.0.1.

    Release notes

    Sourced from spring-boot-starter-webflux's releases.

    v3.0.1

    :lady_beetle: Bug Fixes

    • Fix typo in LocalDevToolsAutoConfiguration logging #33615
    • No warning is given when <springProfile> is used in a Logback <root> block #33610
    • Auto-configure PropagationWebGraphQlInterceptor for tracing propagation #33542
    • WebClient instrumentation fails with IllegalArgumentException when adapting to WebClientExchangeTagsProvider #33483
    • Reactive observation auto-configuration does not declare order for WebFilter #33444
    • Web server fails to start due to "Resource location must not be null" when attempting to use a PKCS 11 KeyStore #33433
    • Actuator health endpoint for neo4j throws NoSuchElementException and always returns Status.DOWN #33428
    • Anchors in YAML configuration files throw UnsupportedOperationException #33404
    • ZipkinRestTemplateSender is not customizable #33399
    • AOT doesn't work with Logstash Logback Encoder #33387
    • Maven process-aot goal fails when release version is set in Maven compiler plugin #33382
    • DependsOnDatabaseInitializationPostProcessor re-declares bean dependencies at native image runtime #33374
    • @SpringBootTest now throws a NullPointerException rather than a helpful IllegalStateException when @SpringBootConfiguration is not found #33371
    • bootBuildImage always trys to create a native image due to bootJar always adding a META-INF/native-image/argfile to the jar #33363

    :notebook_with_decorative_cover: Documentation

    • Improve gradle plugin tags documentation #33617
    • Improve maven plugin tags documentation #33616
    • Fix typo in tomcat accesslog checkExists doc #33512
    • Documented Java compiler level is wrong #33505
    • Fix typo in documentation #33453
    • Update instead of replace environment in bootBuildImage documentation #33424
    • Update the reference docs to document the need to declare the native-maven-plugin when using buildpacks to create a native image #33422
    • Document that the shutdown endpoint is not intended for use when deploying a war to a servlet container #33410
    • Reinstate GraphQL testing documentaion #33407
    • Description of NEVER in Sanitize Sensitive Values isn't formatted correctly #33398

    :hammer: Dependency Upgrades

    • Upgrade to AspectJ 1.9.19 #33586
    • Upgrade to Byte Buddy 1.12.20 #33587
    • Upgrade to Couchbase Client 3.4.1 #33588
    • Upgrade to Dropwizard Metrics 4.2.14 #33589
    • Upgrade to Elasticsearch Client 8.5.3 #33590
    • Upgrade to Hibernate 6.1.6.Final #33591
    • Upgrade to HttpClient 4.5.14 #33592
    • Upgrade to HttpCore 4.4.16 #33593
    • Upgrade to Infinispan 14.0.4.Final #33594
    • Upgrade to Jaybird 4.0.8.java11 #33595
    • Upgrade to Jetty 11.0.13 #33596
    • Upgrade to jOOQ 3.17.6 #33597
    • Upgrade to Kotlin 1.7.22 #33598
    • Upgrade to Lettuce 6.2.2.RELEASE #33599
    • Upgrade to MongoDB 4.8.1 #33600
    • Upgrade to MSSQL JDBC 11.2.2.jre17 #33601
    • Upgrade to Native Build Tools Plugin 0.9.19 #33602

    ... (truncated)

    Commits
    • 837947c Release v3.0.1
    • 5929d95 Merge branch '2.7.x'
    • b10b788 Next development version (v2.7.8-SNAPSHOT)
    • f588793 Update copyright year of changed files
    • 0254619 Merge branch '2.7.x'
    • e4772cf Update copyright year of changed files
    • 2e7ca6f Warning if <springProfile> is used in phase 2 model elements
    • 2ed512d Use model.deepMarkAsSkipped in SpringProfileModelHandler
    • 532fed3 Increase couchbase connection timeout for tests
    • 9562a2c Merge branch '2.7.x'
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies java 
    opened by dependabot[bot] 0
  • Support Spring boot 3

    Support Spring boot 3

    Hello

    Are you planning to add support for Spring boot 3?

    Currently validation-api:1.1.0, jetty:9x and httpclient:4x are being imported and they are not compatible with Spring Boot 3.

    Thank you

    enhancement 
    opened by jorgerod 0
Owner
Mock-Server
MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS
Mock-Server
WireMock - A tool for mocking HTTP services

WireMock only uses log4j in its test dependencies. Neither the thin nor standalone JAR depends on or embeds log4j, so you can continue to use WireMock 2.32.0 without any risk of exposue to the recently discovered vulnerability.

null 5.3k Dec 31, 2022
Most popular Mocking framework for unit tests written in Java

Most popular mocking framework for Java Current version is 3.x Still on Mockito 1.x? See what's new in Mockito 2! Mockito 3 does not introduce any bre

mockito 13.6k Jan 9, 2023
Advanced Java library for integration testing, mocking, faking, and code coverage

Codebase for JMockit 1.x releases - Documentation - Release notes How to build the project: use JDK 1.8 or newer use Maven 3.6.0 or newer; the followi

The JMockit Testing Toolkit 439 Dec 9, 2022
A sample repo to help you capture JavaScript exception for automation test in Java-selenium on LambdaTest. Run your Java Selenium tests on LambdaTest platform.

How to capture JavaScript exception for automation test in Java-selenium on LambdaTest Prerequisites Install and set environment variable for java. Wi

null 12 Jul 13, 2022
πŸŽ‰Ultimate test automation for testing any application on any platform

boyka-java Ultimate test automation for testing any application on any platform boyka-java Setup Write conventional commits 1.

Wasiq Bhamla 52 Dec 30, 2022
A sample repo to help you capture JavaScript exception for automation test in Java-TestNG on LambdaTest. Run Selenium tests with TestNG on LambdaTest platform.

How to capture JavaScript exception for automation test in Java-TestNG on LambdaTest Environment Setup Global Dependencies Install Maven Or Install Ma

null 11 Jul 13, 2022
πŸ”Œ Simple library to manipulate HTTP requests/responses and capture network logs made by the browser using selenium tests without using any proxies

Simple library to manipulate HTTP requests and responses, capture the network logs made by the browser using selenium tests without using any proxies

Sudharsan Selvaraj 29 Oct 23, 2022
JVM version of Pact. Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project.

pact-jvm JVM implementation of the consumer driven contract library pact. From the Ruby Pact website: Define a pact between service consumers and prov

Pact Foundation 962 Dec 31, 2022
Utility to automatically manage all web element waits and enables to write wait-free selenium tests.

selenium-auto-wait selenium-auto-wait automatically manages all weblement waits and makes you to write wait free selenium tests. Features Waits till e

Sudharsan Selvaraj 31 Nov 1, 2022
JVM version of Pact Enables consumer driven contract testing

JVM version of Pact. Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project.

Pact Foundation 961 Dec 30, 2022
Capture JavaScript error by running Selenium test with JUnit on LambdaTest cloud.

Run Selenium 4 Tests With JUnit On LambdaTest Blog β‹… Docs β‹… Learning Hub β‹… Newsletter β‹… Certifications β‹… YouTube       Learn how to use JUnit framewor

null 12 Jul 11, 2022
Objenesis is a library dedicated to bypass the constructor when creating an object. On any JVM there is.

Objenesis Objenesis is a library dedicated to bypass the constructor when creating an object. On any JVM there is. You can find the website and user d

EasyMock 532 Jan 2, 2023
High-level contextual steps in your tests for any reporting tool

Xteps High-level contextual steps in your tests for any reporting tool. License Maven Central Javadoc Xteps Xteps Allure Xteps ReportPortal How to use

Evgenii Plugatar 8 Dec 11, 2022
Gatling is a load test tool. It officially supports HTTP, WebSocket, Server-Sent-Events and JMS.

Gatling What is Gatling ? Gatling is a load test tool. It officially supports HTTP, WebSocket, Server-Sent-Events and JMS. Motivation Finding fancy GU

Gatling 5.8k Dec 27, 2022
Library that allows tests written in Java to follow the BDD style introduced by RSpec and Jasmine.

J8Spec J8Spec is a library that allows tests written in Java to follow the BDD style introduced by RSpec and Jasmine. More details here: j8spec.github

J8Spec 45 Feb 17, 2022
Java DSL for easy testing of REST services

Testing and validation of REST services in Java is harder than in dynamic languages such as Ruby and Groovy. REST Assured brings the simplicity of usi

REST Assured 6.2k Dec 31, 2022
Java DSL for easy testing of REST services

Testing and validation of REST services in Java is harder than in dynamic languages such as Ruby and Groovy. REST Assured brings the simplicity of usi

REST Assured 6.2k Dec 25, 2022
Sikuli's official repository on github. Ask questions or report bugs at http://launchpad.net/sikuli.

!!!This Sikuli X-1.0rc3 IS NO LONGER SUPPORTED !!! A new version of Sikuli(X) is available since 2013 as a follow up development GitHub repo: RaiMan/S

Sikuli Lab 1.7k Jan 3, 2023
πŸŸͺ DeepfakeHTTP is a web server that uses HTTP dumps as a source for responses.

DeepfakeHTTP – Your 100% static dynamic backend DeepfakeHTTP is a web server that uses HTTP dumps as a source for responses. What are people using it

null 445 Dec 30, 2022