Browse Source

Polish "Bind WebTestClient to the default WebHandler"

See gh-47617
pull/47626/head
Stéphane Nicoll 2 months ago
parent
commit
9bd5c1a3c2
  1. 7
      module/spring-boot-webtestclient/src/test/java/org/springframework/boot/webflux/test/autoconfigure/WebTestClientAutoConfigurationTests.java

7
module/spring-boot-webtestclient/src/test/java/org/springframework/boot/webflux/test/autoconfigure/WebTestClientAutoConfigurationTests.java

@ -87,11 +87,14 @@ class WebTestClientAutoConfigurationTests { @@ -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()
.run((context) -> {
assertThat(context).hasFailed();
assertThat(context).getFailure()
.rootCause()
.isInstanceOf(RuntimeException.class)
.hasMessageStartingWith("Mock WebTestClient support requires")
.hasMessageContaining("WebApplicationContext"));
.hasMessageContaining("WebApplicationContext");
});
}
@Test

Loading…
Cancel
Save