diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/result/MockMvcResultMatchersTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/result/MockMvcResultMatchersTests.java index d734465c391..42570aa3d0f 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/result/MockMvcResultMatchersTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/result/MockMvcResultMatchersTests.java @@ -118,15 +118,15 @@ class MockMvcResultMatchersTests { @Test void forwardNonMatching() { assertThatExceptionOfType(AssertionError.class) - .isThrownBy(() -> forwardedUrlPattern("api/resource/2").match(forwardedUrlStub("api/resource/1"))) - .withMessage("'api/resource/2' is not an Ant-style path pattern"); + .isThrownBy(() -> forwardedUrl("/api/resource/2").match(forwardedUrlStub("/api/resource/1"))) + .withMessageEndingWith("expected: but was:"); } @Test void forwardNonMatchingBecauseNotForward() { assertThatExceptionOfType(AssertionError.class) - .isThrownBy(() -> forwardedUrlPattern("/resource/*").match(redirectedUrlStub("/resource/1"))) - .withMessage("Forwarded URL 'null' does not match the expected URL pattern '/resource/*'"); + .isThrownBy(() -> forwardedUrl("/resource/1").match(redirectedUrlStub("/resource/1"))) + .withMessageEndingWith("expected: but was:"); } @Test // gh-22155