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;
}
Aggregations