assertEquals("The render parameters map is obviously not being cleared out.",
0, response.getRenderParameterMap().size());
}
public void testClearAllRenderParametersDoesNotPropagateExceptionIfRedirectAlreadySentAtTimeOfCall() throws Exception {
MockActionResponse response = new MockActionResponse() {
public void setRenderParameters(Map parameters) {
throw new IllegalStateException();
}
};
response.setRenderParameter("William", "Baskerville");
response.setRenderParameter("Adso", "Melk");
PortletUtils.clearAllRenderParameters(response);
assertEquals("The render parameters map must not be cleared if ActionResponse.sendRedirect() has been called (already).",
2, response.getRenderParameterMap().size());
}