Skip to content

Commit

Permalink
fixed jenkins by resolving compiler error in test class (did not appe…
Browse files Browse the repository at this point in the history
…ar locally) and adjusting asserts to older version of spring mock objects
  • Loading branch information
cnenning committed Jan 29, 2016
1 parent 2a6acab commit c44566b
Showing 1 changed file with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,17 @@ public void testNormalRedirect() throws Exception {

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());
Expand Down Expand Up @@ -79,9 +83,13 @@ public void testValidateOnlyFalse() throws Exception {

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
Expand Down

0 comments on commit c44566b

Please sign in to comment.