Code example for AbstractTransactionalTestNGSpringContextTests

Methods: assertEquals

0
        List<Post> posts = PersistedObjectsFactory.createAndSavePostList(totalSize); 
        Topic topic = posts.get(0).getTopic(); 
 
        Page<Post> postsPage = dao.getPosts(topic, pageRequest); 
 
        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 number of page"); 
    } 
 
    @Test 
    public void testGetLastPostForBranch() { 
        int size = 2; 
        List<Post> posts = PersistedObjectsFactory.createAndSavePostList(size); 
        Topic postsTopic = posts.get(0).getTopic(); 
        Branch postsBranch = postsTopic.getBranch(); 
        Post expectedLastPost = posts.get(0); 
        ReflectionTestUtils.setField( 
                expectedLastPost, 
Contextual code suggestions in your IDE  Get Codota for Java