@Test
public void shouldRedirectUsingResolvedBookmarkUrl() throws Exception {
SpringFacesContextSetter.setCurrentInstance(this.springFacesContext);
DestinationAndModel destinationAndModel = mock(DestinationAndModel.class);
BookmarkableView destination = mock(BookmarkableView.class);
given(destinationAndModel.getDestination()).willReturn(destination);
given(destination.getBookmarkUrl(anyModel(), any(HttpServletRequest.class))).willReturn("/bookmark");
given(this.destinationAndModelRegistry.get(this.context, this.viewId)).willReturn(destinationAndModel);
Map<String, List<String>> parameters = new HashMap<String, List<String>>();
boolean includeViewParams = false;
String redirect = this.handler.getRedirectURL(this.context, this.viewId, parameters, includeViewParams);
assertThat(redirect, is(equalTo("/bookmark")));