mirror of
https://github.com/apache/struts.git
synced 2026-08-11 01:27:14 +00:00
fixed jenkins by resolving compiler error in test class (did not appear locally) and adjusting asserts to older version of spring mock objects
This commit is contained in:
+15
-7
@@ -37,13 +37,17 @@ public class JSONActionRedirectResultTest extends StrutsTestCase {
|
||||
|
||||
String content = response.getContentAsString();
|
||||
assertEquals("", content);
|
||||
String location = response.getHeader("Location");
|
||||
assertEquals("/targetAction.action", location);
|
||||
assertEquals(302, response.getStatus());
|
||||
|
||||
// spring MockHttpServletResponse does not set Location-Header and status code on sendRedirect()
|
||||
// String location = response.getHeader("Location").toString();
|
||||
// assertEquals("/targetAction.action", location);
|
||||
// assertEquals(302, response.getStatus());
|
||||
String redirectedUrl = response.getRedirectedUrl();
|
||||
assertEquals("/targetAction.action", redirectedUrl);
|
||||
}
|
||||
|
||||
public void testJsonRedirect() throws Exception {
|
||||
JSONActionRedirectResult result = new JSONActionRedirectResult();
|
||||
JSONActionRedirectResult result = new JSONActionRedirectResult();
|
||||
result.setActionName("targetAction");
|
||||
result.setActionMapper(new DefaultActionMapper());
|
||||
result.setUrlHelper(new DefaultUrlHelper());
|
||||
@@ -79,9 +83,13 @@ public class JSONActionRedirectResultTest extends StrutsTestCase {
|
||||
|
||||
String content = response.getContentAsString();
|
||||
assertEquals("", content);
|
||||
String location = response.getHeader("Location");
|
||||
assertEquals("/targetAction.action", location);
|
||||
assertEquals(302, response.getStatus());
|
||||
|
||||
// spring MockHttpServletResponse does not set Location-Header and status code on sendRedirect()
|
||||
// String location = response.getHeader("Location").toString();
|
||||
// assertEquals("/targetAction.action", location);
|
||||
// assertEquals(302, response.getStatus());
|
||||
String redirectedUrl = response.getRedirectedUrl();
|
||||
assertEquals("/targetAction.action", redirectedUrl);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user