Skip to content

Commit 9bd5c1a

Browse files
committed
Polish "Bind WebTestClient to the default WebHandler"
See gh-47617
1 parent 54d60da commit 9bd5c1a

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,14 @@ void shouldFailWhenDefaultWebHandlerIsNotAvailable() {
8787
void shouldFailWithNeitherDefaultWebHandlerNorWebApplicationContext() {
8888
ClassLoader parentClassLoader = Thread.currentThread().getContextClassLoader();
8989
this.contextRunner.withClassLoader(new FilteredClassLoader(parentClassLoader, WebApplicationContext.class))
90-
.run((context) -> assertThat(context).getFailure()
91-
.rootCause()
92-
.isInstanceOf(RuntimeException.class)
93-
.hasMessageStartingWith("Mock WebTestClient support requires")
94-
.hasMessageContaining("WebApplicationContext"));
90+
.run((context) -> {
91+
assertThat(context).hasFailed();
92+
assertThat(context).getFailure()
93+
.rootCause()
94+
.isInstanceOf(RuntimeException.class)
95+
.hasMessageStartingWith("Mock WebTestClient support requires")
96+
.hasMessageContaining("WebApplicationContext");
97+
});
9598
}
9699

97100
@Test

0 commit comments

Comments
 (0)