Code example for AbstractTransactionalTestNGSpringContextTests

Methods: assertEquals

0
        List<Long> allowedBranchesIds = new ArrayList<>(); 
        allowedBranchesIds.add(-1L); 
 
        Page<Post> postsPage = dao.getUserPosts(author, pageRequest, allowedBranchesIds); 
 
        assertEquals(postsPage.getContent().size(), 0, "Incorrect count of posts in one page."); 
        assertEquals(postsPage.getTotalElements(), 0, "Incorrect total count."); 
        assertEquals(postsPage.getTotalPages(), 0, "Incorrect count of pages."); 
    } 
 
    @Test 
    public void testReturnedUserPostListIsSortedInDescOrderByDate() { 
        int totalSize = 50; 
        int pageCount = 2; 
        int pageSize = totalSize / pageCount; 
 
        PageRequest pageRequest = new PageRequest("1", pageSize); 
        List<Post> posts = PersistedObjectsFactory.createAndSavePostList(totalSize); 
        JCUser author = posts.get(0).getUserCreated(); 
        List<Long> allowedBranchesIds = new ArrayList<>();