Browse Source

Merge pull request #22836 from izeye

* pr/22836:
  Add missing fail() calls in MockRestServiceServerTests
pull/22870/head
Stephane Nicoll 7 years ago
parent
commit
7cc132b2a9
  1. 2
      spring-test/src/test/java/org/springframework/test/web/client/MockRestServiceServerTests.java

2
spring-test/src/test/java/org/springframework/test/web/client/MockRestServiceServerTests.java

@ -126,6 +126,7 @@ public class MockRestServiceServerTests { @@ -126,6 +126,7 @@ public class MockRestServiceServerTests {
try {
this.restTemplate.getForEntity("/some-service/some-endpoint", String.class);
fail("Expected exception to be thrown.");
}
catch (Exception ex) {
this.restTemplate.postForEntity("/reporting-service/report-error", ex.toString(), String.class);
@ -142,6 +143,7 @@ public class MockRestServiceServerTests { @@ -142,6 +143,7 @@ public class MockRestServiceServerTests {
this.restTemplate.postForEntity("/remoteurl", null, String.class);
try {
this.restTemplate.postForEntity("/remoteurl", null, String.class);
fail("Expected error to be thrown.");
}
catch (AssertionError error) {
assertThat(error.getMessage()).startsWith("No further requests expected");

Loading…
Cancel
Save