Search in sources :

Example 1 with ResponseStatusExceptionHandler

use of org.springframework.web.server.handler.ResponseStatusExceptionHandler in project spring-framework by spring-projects.

the class SimpleUrlHandlerMappingIntegrationTests method createHttpHandler.

@Override
protected HttpHandler createHttpHandler() {
    AnnotationConfigApplicationContext wac = new AnnotationConfigApplicationContext();
    wac.register(WebConfig.class);
    wac.refresh();
    return WebHttpHandlerBuilder.webHandler(new DispatcherHandler(wac)).exceptionHandlers(Collections.singletonList(new ResponseStatusExceptionHandler())).build();
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) DispatcherHandler(org.springframework.web.reactive.DispatcherHandler) ResponseStatusExceptionHandler(org.springframework.web.server.handler.ResponseStatusExceptionHandler)

Aggregations

AnnotationConfigApplicationContext (org.springframework.context.annotation.AnnotationConfigApplicationContext)1 DispatcherHandler (org.springframework.web.reactive.DispatcherHandler)1 ResponseStatusExceptionHandler (org.springframework.web.server.handler.ResponseStatusExceptionHandler)1