use of com.vaadin.flow.server.MockServletContext in project flow by vaadin.
the class RouteConfigurationTest method init.
@Before
public void init() {
servletContext = new MockServletContext();
vaadinContext = new MockVaadinContext(servletContext);
registry = ApplicationRouteRegistry.getInstance(vaadinContext);
vaadinService = Mockito.mock(MockService.class);
Mockito.when(vaadinService.getRouteRegistry()).thenReturn(registry);
Mockito.when(vaadinService.getContext()).thenReturn(vaadinContext);
VaadinService.setCurrent(vaadinService);
session = new MockVaadinSession(vaadinService) {
@Override
public VaadinService getService() {
return vaadinService;
}
};
}
Aggregations