Polish "Bind WebTestClient to the default WebHandler"

See gh-47617
This commit is contained in:
Stéphane Nicoll
2025-10-14 11:33:03 +02:00
parent 54d60da47b
commit 9bd5c1a3c2
@@ -87,11 +87,14 @@ class WebTestClientAutoConfigurationTests {
void shouldFailWithNeitherDefaultWebHandlerNorWebApplicationContext() {
ClassLoader parentClassLoader = Thread.currentThread().getContextClassLoader();
this.contextRunner.withClassLoader(new FilteredClassLoader(parentClassLoader, WebApplicationContext.class))
.run((context) -> assertThat(context).getFailure()
.rootCause()
.isInstanceOf(RuntimeException.class)
.hasMessageStartingWith("Mock WebTestClient support requires")
.hasMessageContaining("WebApplicationContext"));
.run((context) -> {
assertThat(context).hasFailed();
assertThat(context).getFailure()
.rootCause()
.isInstanceOf(RuntimeException.class)
.hasMessageStartingWith("Mock WebTestClient support requires")
.hasMessageContaining("WebApplicationContext");
});
}
@Test