### Question:
BookmarkableRedirectViewIdResolver extends UrlBasedViewResolver { @Override protected View createView(String viewName, Locale locale) throws Exception { if (!canHandle(viewName, locale)) { return null; } if (viewName.startsWith(REDIRECT_URL_PREFIX)) { String redirectUrl = viewName.substring(REDIRECT_URL_PREFIX.length()); return new BookmarkableRedirectView(redirectUrl, isRedirectContextRelative(), isRedirectHttp10Compatible()); } return super.createView(viewName, locale); } BookmarkableRedirectViewIdResolver();   }### Answer:
@Test public void shouldCreateNonRedirectView() throws Exception { View view = this.resolver.createView("test", Locale.CANADA); assertThat(view, is(instanceOf(FacesView.class))); }
@Test public void shouldCreateRedirectView() throws Exception { View view = this.resolver.createView("redirect:http: assertThat(view, is(instanceOf(BookmarkableView.class))); String url = ((BookmarkableView) view).getBookmarkUrl(Collections.<String, Object> emptyMap(), mock(HttpServletRequest.class)); assertThat(url, is("http: }