Advertisement
ogionfrost

Untitled

Aug 10th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.78 KB | None | 0 0
  1. import com.github.tomakehurst.wiremock.WireMockServer;
  2.  
  3. import static com.github.tomakehurst.wiremock.client.WireMock.*;
  4. import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;
  5.  
  6. public class Main {
  7.  
  8.  
  9.  
  10.     public static void main(String[] args) {
  11.         WireMockServer wireMockServer = new WireMockServer(
  12.                 wireMockConfig()
  13.                         //.port(8089)
  14.                         .asynchronousResponseEnabled(true)); //No-args constructor will start on port 8080, no HTTPS
  15.         wireMockServer.start();
  16.  
  17.         stubFor(post(urlEqualTo("/post")).withRequestBody()
  18.                 .willReturn(aResponse()
  19.                         .withHeader("Content-Type", "text/plain")
  20.                         .withBody("ok")));
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement