Esempio n. 1
0
 private void startWireMock() {
   wireMockServer = new WireMockServer();
   wireMockServer.start();
   wireMockServer.stubFor(
       get(urlEqualTo("/user"))
           .withHeader("Authorization", containing("Basic dGVzdDoxMjM0"))
           .willReturn(aResponse().withStatus(200)));
   wireMockServer.stubFor(
       get(urlEqualTo(coursesExtension.toString()))
           .withHeader("Authorization", containing("Basic dGVzdDoxMjM0"))
           .willReturn(
               aResponse()
                   .withStatus(200)
                   .withHeader("Content-Type", "application/json")
                   .withBody(ExampleJson.allCoursesExample)));
 }