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

Mockserver Request not found

I am currently trying to create expectations and get them verified by mockServer (can be found here). I've read their documentation several times now but I can't find out why the verifcation of my expectation fails. This is my code @Rule …
NewOasis
  • 63
  • 1
  • 7
0
votes
1 answer

Mock API calls During Unit Test cases Spring boot

I have two microservices Microservice A ( context path - /abc ) and microservice B (context path - /def ) Example URLs: test.domain.com/abc/endpoint1 ,test.domain.com/def/endpoint2 In one of the apis of Microservice A (…
svs teja
  • 957
  • 2
  • 22
  • 43
0
votes
1 answer

Can we mask postman mock server url

I have mocked my API's using postman mock server I want to mask the url of mock server ex : my current url kj3433434n34kjrh98434kjn.mock.pstmn.io TO examplename this name i want to mock i have explored in google but no helpful article found. please…
var a
  • 39
  • 9
0
votes
0 answers

Unable to connect to MockServer from Django Docker container

I've setup a Django container along with a MockServer container running in docker-compose. I can access the MockServers' endpoints fine using postman, but when doing a request from the python container I get an…
Snorre Hukkelås
  • 141
  • 1
  • 1
  • 13
0
votes
1 answer

SAPUI5 Mockserver always generate same random ids

I have a UI5 application that I run it with UI5 standard build-in mock server for testing. Here is the code from mockserver.js that is generate by Web IDE…
MJBZA
  • 4,796
  • 8
  • 48
  • 97
0
votes
2 answers

How to set an environment variable in application.yml - Spring Boot

I'm working on a spring boot application and I'm writing some tests which use MockServer. In order to not have all the requests to the mock servers displayed in the logs, I have to set the environment variable mockserver.logLevel to OFF. When I do…
0
votes
2 answers

Java org.mockserver load response body from file

is there a easy way to load the content of a file (like a Json file) for the response body from a org.mockserver? Or do i have to do it in the usual way?
TheRadianer
  • 57
  • 1
  • 7
0
votes
1 answer

Mountebank - How do I assert message body is JSON format in a POST request in mountebank

I want to stub and check the message body in POST request in mountebank, { "port": "22001", "protocol": "http", "name": "login_user", "stubs": [ { "responses": [ { "is": { "statusCode": 201, …
0
votes
0 answers

mocked data with multiple JSON files seem to be overwrited when load at browser (vuex+axios)

I'm having an error that's blowing my mind. I'm trying to mock some data in order to test my app developed with Vuex + Axios. So... Having these JSON files at my project's folder: And this AJAX method: function fetchChartsData(platform, content)…
SazLamas
  • 45
  • 8
0
votes
1 answer

mockserver-netty test doesn't works

I'm trying to start simple test with mock-server. I use dependency: testCompile group: 'org.mock-server', name: 'mockserver-netty', version: '5.6.1' I have taken test example from the guide. My test is very simple: public class MockServerTest…
Valeriy K.
  • 2,616
  • 1
  • 30
  • 53
0
votes
0 answers

require npm package inside mock-server docker container (javascript template response) not working

I have a mock-server (https://github.com/jamesdbloom/mockserver) docker container instance with some expectation that should return a javascript template. It would make my life a lot easier if I could use npm packages within that template (namely…
Sal B
  • 93
  • 1
  • 8
0
votes
1 answer

How to use the odata expand-parameter in a SAPUI5 Table?

I want to show data from 2 odata entities that have a one to many relationship inside a SAPUI5 table. I have tried multiple ways of referencing in the table (e.g entries/title). Debugging showed that the data from entries is received but not…
Thylomer
  • 1
  • 1
0
votes
1 answer

Retrieve different post request responses based on different body inputs

I am setting up a mock server for a third party API using postman. My goal is to get specific POST request responses based on different body inputs. I was wondering if this was something possible to do using postman, and if so, how?
Rayan Ahmed
  • 165
  • 2
  • 11
0
votes
0 answers

Get data from .json file without XML in MockServer

I'm new in SAPUI5 and on this way at all. I'm sorry if my question looks stupid. I created a project and MockServer in this project. Now I want to get data from "products.json" file and show it in my "localServer.html". But I don't have…
dkolodin
  • 23
  • 7
0
votes
2 answers

How can we start a mockserver from Java to receive incoming traffic?

I am trying to start a mock a server from Java and keep it running to receive incoming requests from other sources (Postman, CURL, etc). I have tried the Junit approach, but when the unit tests finishes, the server is shutdown. On the other hand,…
user3690435