### Question:
BookmarkableRedirectView extends RedirectView implements BookmarkableView, FacesRenderedView { public String getBookmarkUrl(Map<String, ?> model, HttpServletRequest request) throws IOException { return doCreateTargetUrl(model, request); } BookmarkableRedirectView();  BookmarkableRedirectView(String url);  BookmarkableRedirectView(String url, boolean contextRelative);  BookmarkableRedirectView(String url, boolean contextRelative, boolean http10Compatible);  BookmarkableRedirectView(String url, boolean contextRelative, boolean http10Compatible,
			boolean exposeModelAttributes); void render(Map<String, ?> model, FacesContext facesContext); String getBookmarkUrl(Map<String, ?> model, HttpServletRequest request);  }### Answer:
@Test public void shouldExpandPathVariables() throws Exception { BookmarkableRedirectView view = new BookmarkableRedirectView("/ab/{cd}/ef/{gh}"); Map<String, Object> model = new HashMap<String, Object>(); model.put("cd", "CD"); model.put("gh", "GH"); String actual = view.getBookmarkUrl(model, this.request); assertThat(actual, is(equalTo("/ab/CD/ef/GH"))); }
@Test @Ignore public void shouldEncodePathVariables() throws Exception { BookmarkableRedirectView view = new BookmarkableRedirectView("/ab/{cd}"); Map<String, Object> model = new HashMap<String, Object>(); model.put("cd", "C D"); String actual = view.getBookmarkUrl(model, this.request); assertThat(actual, is(equalTo("/ab/C%20D"))); }
@Test public void shouldNotAddQueryParamForPathVariable() throws Exception { BookmarkableRedirectView view = new BookmarkableRedirectView("/ab/{cd}"); Map<String, Object> model = new HashMap<String, Object>(); model.put("cd", "CD"); model.put("gh", "GH"); String actual = view.getBookmarkUrl(model, this.request); assertThat(actual, is(equalTo("/ab/CD?gh=GH"))); }
@Test public void shouldAddContextPath() throws Exception { BookmarkableRedirectView view = new BookmarkableRedirectView("/ab", true); String actual = view.getBookmarkUrl(null, this.request); assertThat(actual, is(equalTo("/context/ab"))); }
@Test public void shouldNotAddContextPathIfNotSlashPrefixed() throws Exception { BookmarkableRedirectView view = new BookmarkableRedirectView("ab", true); String actual = view.getBookmarkUrl(null, this.request); assertThat(actual, is(equalTo("ab"))); }