use of com.vaadin.flow.router.legacy.RouterConfiguration in project flow by vaadin.
the class RouterConfigurationTest method testSetExistingPlaceholderThrows.
@Test(expected = IllegalStateException.class)
public void testSetExistingPlaceholderThrows() {
RouterConfiguration configuration = createConfiguration();
configuration.setRoute("{name}", createNoopHandler());
configuration.setRoute("{anotherName}", createNoopHandler());
}
use of com.vaadin.flow.router.legacy.RouterConfiguration in project flow by vaadin.
the class RouterConfigurationTest method testReplaceParentViewThrows.
@Test(expected = IllegalStateException.class)
public void testReplaceParentViewThrows() {
RouterConfiguration configuration = createConfiguration();
configuration.setParentView(TestView.class, ParentView.class);
configuration.setParentView(TestView.class, AnotherParentView.class);
}
use of com.vaadin.flow.router.legacy.RouterConfiguration in project flow by vaadin.
the class RouterConfigurationTest method testEverythingIsCopied.
@Test
public void testEverythingIsCopied() throws Exception {
RouterConfiguration original = createConfiguration();
original.setRoute("foo/bar", TestView.class);
original.setErrorView(TestView.class);
RouterConfiguration copy = new RouterConfiguration(original, false);
validateNoSameInstances(original, copy);
}
use of com.vaadin.flow.router.legacy.RouterConfiguration in project flow by vaadin.
the class RouterConfigurationTest method testRoutesCopied.
@Test
public void testRoutesCopied() throws Exception {
RouterConfiguration original = createConfiguration();
original.setRoute("foo/bar", createNoopHandler());
RouterConfiguration copy = new RouterConfiguration(original, false);
original.removeRoute("foo/bar");
Assert.assertNotNull("Updating the original should not affect the copy", copy.resolveRoute(new Location("foo/bar")));
}
use of com.vaadin.flow.router.legacy.RouterConfiguration in project flow by vaadin.
the class RouterConfigurationTest method testParentViewLoopDetection.
@Test(expected = IllegalStateException.class)
public void testParentViewLoopDetection() {
RouterConfiguration configuration = createConfiguration();
configuration.setParentView(AnotherParentView.class, ParentView.class);
configuration.setParentView(ParentView.class, AnotherParentView.class);
}
Aggregations