Add additional build() step to allow ordered stubs

This commit is contained in:
Dave Syer
2016-07-28 09:32:21 +01:00
parent d82a5917b1
commit bcce5699de
9 changed files with 133 additions and 35 deletions

View File

@@ -29,7 +29,8 @@ public class WiremockForDocsMockServerApplicationTests {
public void contextLoads() throws Exception {
// will read stubs classpath
MockRestServiceServer server = WireMockRestServiceServer.with(this.restTemplate)
.baseUrl("http://example.org").stubs("classpath:/stubs/resource.json");
.baseUrl("http://example.org").stubs("classpath:/stubs/resource.json")
.build();
// We're asserting if WireMock responded properly
assertThat(this.service.go()).isEqualTo("Hello World");
server.verify();

View File

@@ -28,7 +28,7 @@ public class WiremockMockServerApplicationTests {
public void contextLoads() throws Exception {
MockRestServiceServer server = WireMockRestServiceServer.with(this.restTemplate) //
.baseUrl("http://example.org") //
.stubs("classpath:/stubs/resource.json");
.stubs("classpath:/stubs/resource.json").build();
assertThat(this.service.go()).isEqualTo("Hello World");
server.verify();
}