Search in sources :

Example 1 with SpringVaadinServletService

use of com.vaadin.flow.spring.SpringVaadinServletService in project flow by vaadin.

the class RequestUtilTest method setupMockServlet.

private SpringServlet setupMockServlet() {
    SpringServlet servlet = Mockito.mock(SpringServlet.class);
    SpringVaadinServletService service = Mockito.mock(SpringVaadinServletService.class);
    Router router = Mockito.mock(Router.class);
    RouteRegistry routeRegistry = Mockito.mock(RouteRegistry.class);
    Mockito.when(springServletRegistration.getServlet()).thenReturn(servlet);
    Mockito.when(servlet.getService()).thenReturn(service);
    Mockito.when(service.getRouter()).thenReturn(router);
    Mockito.when(router.getRegistry()).thenReturn(routeRegistry);
    return servlet;
}
Also used : RouteRegistry(com.vaadin.flow.server.RouteRegistry) Router(com.vaadin.flow.router.Router) SpringVaadinServletService(com.vaadin.flow.spring.SpringVaadinServletService) SpringServlet(com.vaadin.flow.spring.SpringServlet)

Aggregations

Router (com.vaadin.flow.router.Router)1 RouteRegistry (com.vaadin.flow.server.RouteRegistry)1 SpringServlet (com.vaadin.flow.spring.SpringServlet)1 SpringVaadinServletService (com.vaadin.flow.spring.SpringVaadinServletService)1