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(), 1, "Incorrect number of page"); 
    } 
 
    @Test 
    public void testGetPostsWithEnabledPagingPageTooBig() { 
        int totalSize = 50; 
        int pageCount = 2; 
        int pageSize = totalSize / pageCount; 
        PageRequest pageRequest = new PageRequest(PAGE_NUMBER_TOO_BIG, pageSize); 
        List<Post> posts = PersistedObjectsFactory.createAndSavePostList(totalSize); 
        Topic topic = posts.get(0).getTopic(); 
 
Contextual code suggestions in your IDE  Get Codota for Java