Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class TestMock {
- private static final String HOST = "localhost";
- private static final String END_POINT = "/footer";
- private static final int PORT = 1337;
- private static WireMockServer server = new WireMockServer(PORT);
- @Test
- public void exampleTest() {
- server.start();
- WireMock.configureFor(HOST, 1337);
- ResponseDefinitionBuilder rdb = new ResponseDefinitionBuilder();
- rdb.withStatus(200);
- rdb.withBody("{\"message\" : \"hello world\"}");
- WireMock.stubFor(WireMock.get(END_POINT).willReturn(rdb));
- open("http://localhost:3000/");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment