Questions tagged [mockserver]

What is MockServer

MockServer can be used for mocking any system you integrate with via HTTP or HTTPS (i.e. services, web sites, etc).

MockServer can:

  • return a "mock" response when a request matches an expectation

  • forward a request when the request matches an expectation (i.e. a dynamic port forwarding proxy)

  • execute a callback when a request matches an expectation, allowing the response to be created dynamically

  • verify requests have been sent (i.e. as a test assertion)

What is MockServer Proxy

MockServer Proxy can be used for transparently recording all requests sent by a system (i.e. an application or set of applications).

MockServer Proxy can:

  • proxy all requests using any of the following proxying methods:

    • Port Forwarding
    • Web Proxying (i.e. HTTP proxy)
    • HTTPS Tunneling Proxying (using HTTP CONNECT)
    • SOCKS Proxying (i.e. dynamic port forwarding)
  • verify requests have been sent (i.e. in a test assertion)
  • record requests and responses to analyse how a system behaves
175 questions
0
votes
1 answer

How to read an aggregated entity from Odata Service SAP ui5

In OData Model V2, I'm struggling by reading the odata of my mocked server: I want to get access to the child entity which is associated with a Parent entity. From Open_Station I can navigate to_Order_Header: [{ "results": [ { …
0
votes
1 answer

Does HTTP stub server stubby4j support request proxying with additional query params setting?

TL;DR: Does stubby4j request proxying functionality support the setting of additional query params with the request which is being proxied? Details: I am using stubby4j HTTP stub server, the latest version (i.e.: v7.3.3) to proxy requests to another…
0
votes
1 answer

kubernetes nginx ingress controller rewrites

We have deployed a mockserver on kubernetes. Currently, we only have one hostname which is shared by couple other applications (using a different path). However, the dashboard is not working because of the css location. What's the best way to solve…
user2501711
  • 461
  • 7
  • 16
0
votes
1 answer

Run Mockserver behind Nginx Reverse proxy

I'm trying to run Mockserver behind a nginx reverse but when I'm tryning to acces the Dashboard of mockserver through the proxy i'm getting a blank page. my config : Mockserver : 172.30.10.30:1080 Nginx server : 172.30.10.31 nginx.cfg : server { …
Vince
  • 23
  • 4
0
votes
0 answers

Error 404 Not found Error while using simple-json-replay-server

I am creating an angular application with a simple-json-replay-server as a mock server, I have the API POST call. mock POST call { "request": { "path": "upload", "method":"post", }, "response": { "status": 200, …
Thriveni
  • 4,183
  • 2
  • 14
  • 12
0
votes
0 answers

MockServer | Return simple list in HttpResponse

We're calling an external API that return a simple List, not DTO/Json, like ResponseEntity> In my tests I'm trying to mock the response using mockServer but failed to return the result as List (just String as it not helped…
AsfK
  • 3,328
  • 4
  • 36
  • 73
0
votes
1 answer

Render Individual React Components in browser for local development

I am creating a JS Library which acts as a React Widget for a main application. I integration process with the main library is a little complex which makes local development difficult as I have to setup a servers at all times. So what I am seeking…
AppleCiderGuy
  • 1,249
  • 1
  • 9
  • 16
0
votes
1 answer

Access mockserver from postman

I would like to set a mock server using https://mock-server.com/. As postman limits the numbers of calls with its free version I have opted for this tool. I have pulled and run the mock server docker image here is what I have when launching docker…
ziwdig44bugs
  • 177
  • 2
  • 13
0
votes
0 answers

Mockserver in dev profile spring boot

Can I uses mockserver in spring boot to mock a server (mock al request to ...), but not in a integration test? I mean... Running in a dev or local profile to uses jmeter and take measurements to detect memory leaks etc. Did you something similar can…
0
votes
1 answer

Postman mock server vs JSON mock server

I know if i have node installed i can spin up JSON mock server in no time and then i can create endpoints which support GET,PUT,POST etc. Also i realise that data can be stored (like insertion deletion, updation etc) in db.json until json server is…
user3921104
  • 154
  • 13
0
votes
0 answers

Are the Methods described in the Documentation of MockServer static imports or am i supposed to pass my own methods?

i am trying to learn how to write a test using MockServer. In order to test a method, that sends Post Requests. But as i copied the Code from the Documentation into my IDE it can't find the methods: "request()", "exact()", exactly(1)" and…
Krutoj
  • 23
  • 3
0
votes
1 answer

How can I deserialize XML strings to composite Java object with JAXB annotations containing @XmlElement

I have the following JAXB annotated classes: @Data @XmlAccessorType(XmlAccessType.NONE) @XmlRootElement(name="Channels", namespace="http://abc.channeltypes") public class Channels { @XmlElement(name = "Channel", required…
0
votes
1 answer

MockServer -> Return custom object response

I am trying to return custom object response from mockserver. In client side, I am expecting to get response as "GetChannelsResponse". ResponseEntity response = restTemplate.exchange(url, HttpMethod.GET, request, A.class); Here is the model…
0
votes
1 answer

Unit test fail with Error(MockKException) for MockResponse()

I have a Client that will make a request to a GraphQL end point as below import com.apollographql.apollo.ApolloClient internal class GraphQLClient(apolloClient:ApolloClient, retryStrategy:RetryStrategy){ override fun
HMK
  • 383
  • 1
  • 5
  • 18
0
votes
1 answer

MockServer unexpectedly responds with empty body

Let's see a test, which is using MockServer (org.mock-server:mockserver-netty:5.10.0) for mocking responses. It is expected that the response body will be equal to string "something". Nevertheless, this test fails, because the response body is an…
diziaq
  • 6,881
  • 16
  • 54
  • 96