Describe the bug
Running the Gradle build from master branch the ServerJwtDslTests & WebTestClientHtmlUnitDriverBuilderTests tests are failing when accessing root path in test cases.
The following test cases are failing:
ServerJwtDslTests -> request when JWT configured with public key and valid token then responds with ok()
java.lang.AssertionError: Status expected:<200 OK> but was:<404 NOT_FOUND>
at org.springframework.test.util.AssertionErrors.fail(AssertionErrors.java:59)
at org.springframework.test.util.AssertionErrors.assertEquals(AssertionErrors.java:122)
at org.springframework.test.web.reactive.server.StatusAssertions.lambda$assertStatusAndReturn$4(StatusAssertions.java:236)
at org.springframework.test.web.reactive.server.ExchangeResult.assertWithDiagnostics(ExchangeResult.java:232)
at org.springframework.test.web.reactive.server.StatusAssertions.assertStatusAndReturn(StatusAssertions.java:236)
at org.springframework.test.web.reactive.server.StatusAssertions.isOk(StatusAssertions.java:68)
at org.springframework.security.config.web.server.ServerJwtDslTests.request when JWT configured with public key and valid token then responds with ok(ServerJwtDslTests.kt:95)
WebTestClientHtmlUnitDriverBuilderTests -> helloWorld()
java.lang.AssertionError:
Expecting actual:
""
to contain:
"Hello World"
at org.springframework.security.htmlunit.server.WebTestClientHtmlUnitDriverBuilderTests.helloWorld(WebTestClientHtmlUnitDriverBuilderTests.java:54)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
To Reproduce
Runt the ./gradlew clean build from the master branch
Expected behavior The test should pass in green light.
Sample
Comment From: igorbolic
Apparently the trailing slash match in Spring Framework is now deprecated and set to false by default. This causes the tests to fail, wherever there is trailing slash path call assertion.
I believe the test cases should be updated to reflect the new default behavior of the Spring Framework configuration.
Comment From: igorbolic
I have created the #11462 to remedy the failing tests.