Code example for AbstractTransactionalTestNGSpringContextTests

Methods: assertEquals

0
    public void testGetUnansweredTopicsForAnonymousUsers() { 
        createAndSaveTopicsWithUnansweredTopics(); 
        PageRequest pageRequest = new PageRequest("1", 2); 
 
        Page<Topic> result = dao.getUnansweredTopics(pageRequest, new AnonymousUser()); 
        assertEquals(result.getContent().size(), 2); 
        assertEquals(result.getTotalElements(), 2); 
    } 
 
    @Test 
    public void testGetUnansweredTopicsWithPaging() { 
        JCUser user = createAndSaveTopicsWithUnansweredTopics(); 
        PageRequest pageRequest = new PageRequest("2", 1); 
        Page<Topic> result = dao.getUnansweredTopics(pageRequest, user); 
        assertEquals(result.getContent().size(), 1); 
        assertEquals(result.getTotalElements(), 2); 
    } 
 
    @Test 
    public void testGetUnansweredTopicsWithPagingPageTooLow() {