Code example for AbstractTransactionalTestNGSpringContextTests

Methods: assertThat, hasPages

0
 
        PersistedObjectsFactory.createAndSaveViewTopicsBranchesEntity( 
                createdTopicList.get(0).getBranch().getId(), "anonymousUser", true); 
        Page<Topic> page = dao.getTopicsUpdatedSince(lastLogin, pageRequest, new AnonymousUser()); 
 
        assertThat("Topics should be paginated for anonymous group", page, hasPages()); 
    } 
 
    @Test 
    public void testGetUpdateTopicsUpdatedSinceWithPagingAndAnonymousUserPageTooLow() { 
        int listSize = 5; 
        int pageSize = 2; 
        List<Topic> createdTopicList = createAndSaveTopicList(listSize); 
        PageRequest pageRequest = new PageRequest("0", pageSize); 
        DateTime lastLogin = new DateTime().minusDays(1); 
 
        PersistedObjectsFactory.createAndSaveViewTopicsBranchesEntity( 
                createdTopicList.get(0).getBranch().getId(), "anonymousUser", true); 
        Page<Topic> page = dao.getTopicsUpdatedSince(lastLogin, pageRequest, new AnonymousUser());