Commit 66156cc2 authored by Madhura Bhave's avatar Madhura Bhave

Polish

parent 681717d0
......@@ -88,7 +88,8 @@ public abstract class ApplicationContextServerWebExchangeMatcher<C>
@SuppressWarnings("unchecked")
private Supplier<C> createContext(ServerWebExchange exchange) {
ApplicationContext context = exchange.getApplicationContext();
Assert.state(context != null, "No ApplicationContext found.");
Assert.state(context != null,
"No ApplicationContext found on ServerWebExchange.");
if (this.contextClass.isInstance(context)) {
return () -> (C) context;
}
......
......@@ -91,7 +91,7 @@ public class ApplicationContextServerWebExchangeMatcherTests {
MockServerWebExchange exchange = MockServerWebExchange
.from(MockServerHttpRequest.get("/path").build());
this.thrown.expect(IllegalStateException.class);
this.thrown.expectMessage("No ApplicationContext found.");
this.thrown.expectMessage("No ApplicationContext found on ServerWebExchange.");
new TestApplicationContextServerWebExchangeMatcher<>(ExistingBean.class)
.callMatchesAndReturnProvidedContext(exchange);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment