Search in sources :

Example 1 with ResponseSerializationServiceImpl

use of com.enonic.xp.web.impl.serializer.ResponseSerializationServiceImpl in project xp by enonic.

the class WebDispatcherServletTest method configure.

@Override
protected void configure() throws Exception {
    this.handler = new TestWebHandler();
    this.servlet = new WebDispatcherServlet(new WebDispatcherImpl());
    this.servlet.addWebHandler(this.handler);
    this.servlet.setExceptionMapper(new ExceptionMapperImpl());
    this.servlet.setExceptionRenderer((req, cause) -> WebResponse.create().status(HttpStatus.NOT_FOUND).build());
    this.servlet.setWebSocketContextFactory(Mockito.mock(WebSocketContextFactory.class));
    this.servlet.setResponseSerializationService(new ResponseSerializationServiceImpl());
    this.handler.response = WebResponse.create().status(HttpStatus.OK).build();
    addServlet(this.servlet, "/site/*");
}
Also used : WebSocketContextFactory(com.enonic.xp.web.websocket.WebSocketContextFactory) ResponseSerializationServiceImpl(com.enonic.xp.web.impl.serializer.ResponseSerializationServiceImpl) ExceptionMapperImpl(com.enonic.xp.web.impl.exception.ExceptionMapperImpl)

Aggregations

ExceptionMapperImpl (com.enonic.xp.web.impl.exception.ExceptionMapperImpl)1 ResponseSerializationServiceImpl (com.enonic.xp.web.impl.serializer.ResponseSerializationServiceImpl)1 WebSocketContextFactory (com.enonic.xp.web.websocket.WebSocketContextFactory)1