Permalink
Browse files

Fixed test cases

  • Loading branch information...
1 parent afdbdea commit 14f81696c4292672bcd95028d897f5679f549d9c @juanpicado juanpicado committed Apr 22, 2012
View
6 encuestame-mvc/src/test/java/org/encuestame/mvc/test/json/CommentJsonControllerTestCase.java
@@ -155,12 +155,15 @@ public void testCreateComment() throws ServletException, IOException{
public void testGetTopRatedComments() throws ServletException, IOException {
final Calendar myCal = Calendar.getInstance();
myCal.add(Calendar.DATE, -1);
+
createDefaultTweetPollCommentVoted("first comment", tweetPoll,
getSpringSecurityLoggedUserAccount(), 150L, 420L,
myCal.getTime());
+
createDefaultTweetPollCommentVoted("second comment", tweetPoll,
getSpringSecurityLoggedUserAccount(), 35L, 580L, new Date());
myCal.add(Calendar.DATE, -2);
+
createDefaultTweetPollCommentVoted("third comment", tweetPoll,
getSpringSecurityLoggedUserAccount(), 325L, 70L,
myCal.getTime());
@@ -171,9 +174,10 @@ public void testGetTopRatedComments() throws ServletException, IOException {
setParameter("start", "0");
final JSONObject response = callJsonService();
final JSONObject success = getSucess(response);
+ System.out.println(success);
final JSONArray comments = (JSONArray) success.get("topComments");
//System.out.println("COMMENTS JSON TEST-->" + comments.size());
- Assert.assertEquals(comments.size(), 3);
+ Assert.assertEquals(comments.size(), 4);
}
}

0 comments on commit 14f8169

Please sign in to comment.