0

I just run standalone version of WireMock to catch my requests and corresponding responses from multimodule project in Java EE. Now I have these (thousands) files in folders __files and mappings. I have many of tests with a lot of requests so I want to load relevant mapping and responses. How is this done? I found only answers like this:

public void exampleTest() {
stubFor(get(urlEqualTo("/my/resource"))
        .withHeader("Accept", equalTo("text/xml"))
        .willReturn(aResponse()
            .withStatus(200)
            .withHeader("Content-Type", "text/xml")
            .withBody("<response>Some content</response>")));

I just do not want to change every field manually. Thanks.

stanly
  • 123
  • 1
  • 8
  • Did you read the manual: http://wiremock.org/docs/stubbing/? –  Nov 16 '16 at 12:12
  • Of course I did. But I don't see there any hint how to achieve this behaviour. Do i miss something? – stanly Nov 16 '16 at 12:24
  • WireMock automatically loads all of the mapping files under its file source root on startup, and when you call reset to defaults. This is the current directory if you're running standalone, src/test/resources if you're running from JUnit. You can also pass in your own value. – Tom Nov 17 '16 at 09:12

0 Answers0