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."); 
    } 
 
    @Test 
    public void testPostOfUserWithForbiddenBranchesIds() { 
        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<>(); 
Connect your IDE to all the code out there  Get Codota for Java