From 33ac14f0990c01d7f8c19b674bd2041fa06b24c9 Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Thu, 25 Apr 2019 17:53:28 +0900 Subject: [PATCH] Add missing fail() calls in MockRestServiceServerTests Closes gh-22836 --- .../test/web/client/MockRestServiceServerTests.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spring-test/src/test/java/org/springframework/test/web/client/MockRestServiceServerTests.java b/spring-test/src/test/java/org/springframework/test/web/client/MockRestServiceServerTests.java index f9af4dd58cb..71b46c401e2 100644 --- a/spring-test/src/test/java/org/springframework/test/web/client/MockRestServiceServerTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/client/MockRestServiceServerTests.java @@ -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 { 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");