Polish and update reactive getting started reference
This commit updates the instructions on getting started with Spring Web Reactive and also updates constructors and setters to streamline the getting started procedure. Issue: SPR-14640
This commit is contained in:
@@ -71,6 +71,14 @@ public class DispatcherHandler implements WebHandler, ApplicationContextAware {
|
||||
private List<HandlerResultHandler> resultHandlers;
|
||||
|
||||
|
||||
public DispatcherHandler() {
|
||||
}
|
||||
|
||||
public DispatcherHandler(ApplicationContext applicationContext) {
|
||||
initStrategies(applicationContext);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
||||
initStrategies(applicationContext);
|
||||
|
||||
@@ -87,8 +87,7 @@ public class DispatcherHandlerErrorTests {
|
||||
appContext.register(TestConfig.class);
|
||||
appContext.refresh();
|
||||
|
||||
this.dispatcherHandler = new DispatcherHandler();
|
||||
this.dispatcherHandler.setApplicationContext(appContext);
|
||||
this.dispatcherHandler = new DispatcherHandler(appContext);
|
||||
|
||||
this.request = new MockServerHttpRequest(HttpMethod.GET, new URI("/"));
|
||||
MockServerHttpResponse response = new MockServerHttpResponse();
|
||||
|
||||
@@ -61,10 +61,7 @@ public class SimpleUrlHandlerMappingIntegrationTests extends AbstractHttpHandler
|
||||
wac.register(WebConfig.class);
|
||||
wac.refresh();
|
||||
|
||||
DispatcherHandler dispatcherHandler = new DispatcherHandler();
|
||||
dispatcherHandler.setApplicationContext(wac);
|
||||
|
||||
return WebHttpHandlerBuilder.webHandler(dispatcherHandler)
|
||||
return WebHttpHandlerBuilder.webHandler(new DispatcherHandler(wac))
|
||||
.exceptionHandlers(new ResponseStatusExceptionHandler())
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -44,9 +44,9 @@ public abstract class AbstractRequestMappingIntegrationTests extends AbstractHtt
|
||||
@Override
|
||||
protected HttpHandler createHttpHandler() {
|
||||
this.applicationContext = initApplicationContext();
|
||||
DispatcherHandler handler = new DispatcherHandler();
|
||||
handler.setApplicationContext(this.applicationContext);
|
||||
return WebHttpHandlerBuilder.webHandler(handler).build();
|
||||
return WebHttpHandlerBuilder
|
||||
.webHandler(new DispatcherHandler(this.applicationContext))
|
||||
.build();
|
||||
}
|
||||
|
||||
protected abstract ApplicationContext initApplicationContext();
|
||||
|
||||
@@ -65,10 +65,7 @@ public class SseIntegrationTests extends AbstractHttpHandlerIntegrationTests {
|
||||
this.wac.register(TestConfiguration.class);
|
||||
this.wac.refresh();
|
||||
|
||||
DispatcherHandler webHandler = new DispatcherHandler();
|
||||
webHandler.setApplicationContext(this.wac);
|
||||
|
||||
return WebHttpHandlerBuilder.webHandler(webHandler).build();
|
||||
return WebHttpHandlerBuilder.webHandler(new DispatcherHandler(this.wac)).build();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user