From afebf11cf7513a4ffb7507a412bee1c5b249dda7 Mon Sep 17 00:00:00 2001 From: LIM YI TING Date: Sun, 27 Apr 2025 15:28:26 +0800 Subject: [PATCH] Fix CrashControllerIntegrationTests to match new error page format --- .../petclinic/system/CrashControllerIntegrationTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/springframework/samples/petclinic/system/CrashControllerIntegrationTests.java b/src/test/java/org/springframework/samples/petclinic/system/CrashControllerIntegrationTests.java index 3cdca47bf..fc8a115a5 100644 --- a/src/test/java/org/springframework/samples/petclinic/system/CrashControllerIntegrationTests.java +++ b/src/test/java/org/springframework/samples/petclinic/system/CrashControllerIntegrationTests.java @@ -88,9 +88,9 @@ class CrashControllerIntegrationTests { assertThat(resp.getStatusCode()).isEqualTo(HttpStatus.INTERNAL_SERVER_ERROR); assertThat(resp.getBody()).isNotNull(); // html: - assertThat(resp.getBody()).containsSubsequence("", "

", "Something happened...", "

", "

", + assertThat(resp.getBody()).containsSubsequence("", "

", "Something happened...", "

", "Expected:", "controller", "used", "to", "showcase", "what", "happens", "when", "an", "exception", "is", - "thrown", "

", ""); + "thrown", ""); // Not the whitelabel error page: assertThat(resp.getBody()).doesNotContain("Whitelabel Error Page", "This application has no explicit mapping for");