### Question:
MvcViewHandler extends ViewHandlerWrapper { @Override public UIViewRoot restoreView(FacesContext context, String viewId) { if (SpringFacesContext.getCurrentInstance() != null && SpringFacesContext.getCurrentInstance().getRendering() != null) { ModelAndViewArtifact rendering = SpringFacesContext.getCurrentInstance().getRendering(); context.getAttributes().put(ACTION_ATTRIBUTE, rendering.getViewArtifact().toString()); return super.restoreView(context, rendering.getViewArtifact().toString()); } return super.restoreView(context, viewId); } MvcViewHandler(ViewHandler delegate, DestinationViewResolver destinationViewResolver); @Override ViewHandler getWrapped(); @Override UIViewRoot createView(FacesContext context, String viewId); @Override UIViewRoot restoreView(FacesContext context, String viewId); @Override String getActionURL(FacesContext context, String viewId); @Override ViewDeclarationLanguage getViewDeclarationLanguage(FacesContext context, String viewId); @Override void renderView(FacesContext context, UIViewRoot viewToRender); @Override String getBookmarkableURL(FacesContext context, String viewId, Map<String, List<String>> parameters,
			boolean includeViewParams); @Override String getRedirectURL(FacesContext context, String viewId, Map<String, List<String>> parameters,
			boolean includeViewParams);  }### Answer:
@Test public void shouldDelegateRestoreView() throws Exception { this.handler.restoreView(this.context, this.viewId); verify(this.delegate).restoreView(this.context, this.viewId); }
@Test public void shouldUseArtifactForRestoreViewOfMVCRender() throws Exception { SpringFacesContextSetter.setCurrentInstance(this.springFacesContext); ModelAndViewArtifact modelAndViewArtifact = mockModelAndViewArtifact(); given(this.springFacesContext.getRendering()).willReturn(modelAndViewArtifact); this.handler.restoreView(this.context, "anything"); verify(this.delegate).restoreView(this.context, "mvc"); }