Code example for AbstractTransactionalTestNGSpringContextTests

Methods: assertThat, hasPages

0
        List<Topic> topicList = PersistedObjectsFactory.createAndSaveTopicList(totalSize); 
        Branch branch = topicList.get(0).getBranch(); 
 
        Page<Topic> topicsPage = dao.getTopics(branch, pageRequest); 
 
        assertThat("Incorrect pagination", topicsPage, hasPages()); 
    } 
 
    @Test 
    public void testGetTopicsWithEnabledPagingPageTooLow() { 
        int totalSize = 50; 
        int pageCount = 2; 
        int pageSize = totalSize / pageCount; 
        PageRequest pageRequest = new PageRequest("0", pageSize); 
        List<Topic> topicList = PersistedObjectsFactory.createAndSaveTopicList(totalSize); 
        Branch branch = topicList.get(0).getBranch(); 
 
        Page<Topic> topicsPage = dao.getTopics(branch, pageRequest); 
 
        assertThat("Incorrect pagination", topicsPage, hasPages()); 
Contextual code suggestions in your IDE  Get Codota for Java