mapping.setURIPrefix("/blabla/");
@Test public void whenRequestingTheHandleMakeSureItIsNotAppendedTwice() throws Exception { // GIVEN final String uri = "/travel"; final URI2RepositoryMapping mapping = new URI2RepositoryMapping(); mapping.setHandlePrefix("/travel"); mapping.setURIPrefix(""); mapping.setRepository(RepositoryConstants.WEBSITE); // WHEN final String handle = mapping.getHandle(uri); // THEN assertThat("We're expecting the actual URI (which equals to the handle) plus a trailing slash", handle, is(uri + "/")); }