CatnapWrappingView implements View, WrappingView<CatnapView> { @Override public void render(Map<String, ?> model, HttpServletRequest request, HttpServletResponse response) throws Exception { setContentTypeHeader(response); catnapView.render(request, response, extractResult(model), httpStatus(request)); } CatnapWrappingView(final CatnapView view);  CatnapWrappingView(final CatnapView view, final String modelName); @Override void render(Map<String, ?> model, HttpServletRequest request, HttpServletResponse response); void setContentTypeHeader(HttpServletResponse response); com.github.gregwhitaker.catnap.core.context.HttpStatus httpStatus(HttpServletRequest request); Object extractResult(Map<String, ?> model); @Override String getContentType(); @Override String getCharacterEncoding(); @Override CatnapView getWrappedView(); @Override String getModelName(); static final String DEFAULT_MODELNAME; }
@Test public void renderOnWrappingViewRendersWrappedView() throws Exception { JsonView wrappedView = new JsonView(); CatnapWrappingView view = new CatnapWrappingView(wrappedView); view.render(new HashMap<>(), new MockHttpServletRequest(), new MockHttpServletResponse()); assertTrue(wrappedView.isRenderExecuted()); }