pull/13815/head
Madhura Bhave 6 years ago
parent 681717d07a
commit 66156cc24f

@ -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);
}

Loading…
Cancel
Save