Making tests less brittle

This commit is contained in:
Marcin Grzejszczak
2018-11-14 14:54:27 +01:00
parent d82baee855
commit 07e662a4ad
3 changed files with 4 additions and 4 deletions

View File

@@ -387,7 +387,7 @@ public class WiremockMockServerApplicationTests {
MockRestServiceServer server = WireMockRestServiceServer.with(this.restTemplate) //
.baseUrl("http://example.org") //
.stubs("classpath:/mappings/url-path-pattern.json").build();
assertThat(this.restTemplate.getForObject("http://example.org/123",
assertThat(this.restTemplate.getForObject("http://example.org/123/url-path-pattern/",
String.class)).isEqualTo("Hello Url Path Matcher");
server.verify();
}
@@ -397,7 +397,7 @@ public class WiremockMockServerApplicationTests {
MockRestServiceServer server = WireMockRestServiceServer.with(this.restTemplate) //
.baseUrl("http://example.org") //
.stubs("classpath:/mappings/url-matches.json").build();
assertThat(this.restTemplate.getForObject("http://example.org/123",
assertThat(this.restTemplate.getForObject("http://example.org/123/hello-url-matcher/",
String.class)).isEqualTo("Hello Url Matcher");
server.verify();
}

View File

@@ -1,7 +1,7 @@
{
"request": {
"method": "GET",
"urlPattern": "^.*[0-9]{3}$"
"urlPattern": "^.*[0-9]{3}/hello-url-matcher/"
},
"response" : {
"status" : 200,

View File

@@ -1,7 +1,7 @@
{
"request": {
"method": "GET",
"urlPathPattern": "/([a-zA-Z0-9/-]*)"
"urlPathPattern": "([a-zA-Z0-9/-]*)/url-path-pattern/"
},
"response" : {
"status" : 200,