use of com.vaadin.flow.router.Location in project flow by vaadin.
the class LocationTest method locationWithParametersPath_emptyParams.
@Test
public void locationWithParametersPath_emptyParams() {
String initialPath = "foo/bar/";
Location location = new Location(initialPath);
String pathWithParameters = location.getPathWithQueryParameters();
assertEquals(initialPath, pathWithParameters);
assertEquals(location.getPath(), pathWithParameters);
}
use of com.vaadin.flow.router.Location in project flow by vaadin.
the class LocationTest method toggleTrailingSlash.
@Test
public void toggleTrailingSlash() {
assertEquals("foo", new Location("foo/").toggleTrailingSlash().getPath());
assertEquals("foo/", new Location("foo").toggleTrailingSlash().getPath());
}
use of com.vaadin.flow.router.Location in project flow by vaadin.
the class LocationTest method parseLocationWithEndingSlash.
@Test
public void parseLocationWithEndingSlash() {
Location location = new Location("foo/bar/");
assertEquals(Arrays.asList("foo", "bar", ""), location.getSegments());
}
use of com.vaadin.flow.router.Location in project flow by vaadin.
the class LocationTest method noSubLocation_emptyOptional.
@Test
public void noSubLocation_emptyOptional() {
Location location = new Location("foo");
Optional<Location> maybeSubLocation = location.getSubLocation();
Assert.assertFalse(maybeSubLocation.isPresent());
}
use of com.vaadin.flow.router.Location in project flow by vaadin.
the class LocationTest method umlautInLocation.
@Test
public void umlautInLocation() {
Location location = new Location("foo/åäö/bar");
assertEquals("foo", location.getSegments().get(0));
assertEquals("åäö", location.getSegments().get(1));
assertEquals("bar", location.getSegments().get(2));
}
Aggregations