Search in sources :

Example 1 with ErrorView

use of com.vaadin.flow.router.legacy.ViewRendererTest.ErrorView in project flow by vaadin.

the class RouterTest method testNavigateToEmptyLocation_triggersErrorView.

@Test
public void testNavigateToEmptyLocation_triggersErrorView() {
    UI ui = new RouterTestUI();
    Router router = new Router();
    router.reconfigure(c -> {
        c.setErrorView(ErrorView.class);
    });
    router.navigate(ui, new Location(""), NavigationTrigger.PROGRAMMATIC);
    Assert.assertEquals(new ErrorView().getText(), ui.getElement().getTextRecursively());
}
Also used : UI(com.vaadin.flow.component.UI) Router(com.vaadin.flow.router.legacy.Router) ErrorView(com.vaadin.flow.router.legacy.ViewRendererTest.ErrorView) DefaultErrorView(com.vaadin.flow.router.legacy.DefaultErrorView) Location(com.vaadin.flow.router.Location) Test(org.junit.Test)

Aggregations

UI (com.vaadin.flow.component.UI)1 Location (com.vaadin.flow.router.Location)1 DefaultErrorView (com.vaadin.flow.router.legacy.DefaultErrorView)1 Router (com.vaadin.flow.router.legacy.Router)1 ErrorView (com.vaadin.flow.router.legacy.ViewRendererTest.ErrorView)1 Test (org.junit.Test)1