javatestcontainerswiremock

How to dynamically configure stubbing etc. for a WireMock testcontainer?


All the examples I've seen so far configure stubbings etc. of a WireMock testcontainer statically at definition.

How can I configure it dynamically via stubFor etc.?


Solution

  • You should be able to configure a running wiremock server using the java client by specifying first

    WireMock.configureFor("my.remote.host", 8000);
    

    and then using stubFor etc. as usual.