mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-10-01 14:59:50 +00:00
Merge branch '2.0.x'
This commit is contained in:
+1
-1
@@ -88,7 +88,7 @@ public abstract class ApplicationContextServerWebExchangeMatcher<C>
|
||||
@SuppressWarnings("unchecked")
|
||||
private Supplier<C> createContext(ServerWebExchange exchange) {
|
||||
ApplicationContext context = exchange.getApplicationContext();
|
||||
Assert.state(context != null, "No WebApplicationContext found.");
|
||||
Assert.state(context != null, "No ApplicationContext found.");
|
||||
if (this.contextClass.isInstance(context)) {
|
||||
return () -> (C) context;
|
||||
}
|
||||
|
||||
+1
-1
@@ -91,7 +91,7 @@ public class ApplicationContextServerWebExchangeMatcherTests {
|
||||
MockServerWebExchange exchange = MockServerWebExchange
|
||||
.from(MockServerHttpRequest.get("/path").build());
|
||||
this.thrown.expect(IllegalStateException.class);
|
||||
this.thrown.expectMessage("No WebApplicationContext found.");
|
||||
this.thrown.expectMessage("No ApplicationContext found.");
|
||||
new TestApplicationContextServerWebExchangeMatcher<>(ExistingBean.class)
|
||||
.callMatchesAndReturnProvidedContext(exchange);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user