Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Wiremock API for generating json stubs #30

Open
otrosien opened this issue Sep 16, 2016 · 3 comments
Open

Support Wiremock API for generating json stubs #30

otrosien opened this issue Sep 16, 2016 · 3 comments

Comments

@otrosien
Copy link
Contributor

At the moment the stub json is fixed by introspecting the request. Instead it should be possible to use and manipulate the wiremock stub in the test case.

@otrosien otrosien added bug and removed bug labels Sep 16, 2016
@otrosien
Copy link
Contributor Author

see spring cloud contract for an example.

@otrosien
Copy link
Contributor Author

The easiest way would be to provide call-backs so that the initial stub mappings can be customized.

com.github.tomakehurst.wiremock.stubbing.StubMapping.buildFrom(mappingDefinition);

see https://github.com/spring-cloud/spring-cloud-contract/blob/master/spring-cloud-contract-wiremock/src/main/java/org/springframework/cloud/contract/wiremock/WireMockStubMapping.java

@otrosien
Copy link
Contributor Author

So we'll end-up in: Map<String,Object> -> JSON String -> StubMapping -> callback to caller -> modified StubMapping -> JSON String.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants