Code example for AbstractTransactionalTestNGSpringContextTests

Methods: assertEquals

0
        List<Long> allowedBranchesIds = new ArrayList<>(); 
        allowedBranchesIds.add(posts.get(0).getTopic().getBranch().getId()); 
 
        Page<Post> postsPage = dao.getUserPosts(author, pageRequest, allowedBranchesIds); 
 
        assertEquals(postsPage.getContent().size(), pageSize, "Incorrect count of posts in one page."); 
        assertEquals(postsPage.getTotalElements(), totalSize, "Incorrect total count."); 
        assertEquals(postsPage.getTotalPages(), pageCount, "Incorrect count of pages."); 
        assertEquals(postsPage.getNumber(), pageCount, "Incorrect page number"); 
    } 
 
    @Test 
    public void testNullPostOfUser() { 
        PageRequest pageRequest = new PageRequest("1", 50); 
        JCUser user = ObjectsFactory.getDefaultUser(); 
        session.save(user); 
        List<Long> allowedBranchesIds = new ArrayList<>(); 
        allowedBranchesIds.add(1L); 
 
        Page<Post> postsPage = dao.getUserPosts(user, pageRequest, allowedBranchesIds); 
Contextual code suggestions in your IDE  Get Codota for Java