use of com.vaadin.flow.router.legacy.ImmutableRouterConfiguration in project flow by vaadin.
the class VaadinUIScopeTest method mockUI.
private UI mockUI() {
VaadinSession session = mockSession();
RouterInterface routerIface = mock(RouterInterface.class);
VaadinService service = session.getService();
when(service.getRouter()).thenReturn(routerIface);
ImmutableRouterConfiguration config = mock(ImmutableRouterConfiguration.class);
when(routerIface.getConfiguration()).thenReturn(config);
when(config.isConfigured()).thenReturn(false);
UI ui = new UI();
ui.getInternals().setSession(session);
ui.doInit(null, 1);
UI.setCurrent(ui);
// prevent UI from being GCed.
this.ui = ui;
return ui;
}
use of com.vaadin.flow.router.legacy.ImmutableRouterConfiguration in project flow by vaadin.
the class RouterTest method testConfigurationImmutable.
@Test(expected = IllegalStateException.class)
public void testConfigurationImmutable() {
Router router = new Router();
ImmutableRouterConfiguration configuration = router.getConfiguration();
((RouterConfiguration) configuration).setResolver(e -> null);
}
Aggregations