Code example for AbstractTransactionalTestNGSpringContextTests

Methods: assertEquals, 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()); 
        assertEquals(page.getNumber(), lastPage); 
    } 
 
    @Test 
    public void testGetUpdateTopicsUpdatedForNoneExistingBranchAndUserGroup() { 
        int listSize = 5; 
        int pageSize = 2; 
        int lastPage = listSize / pageSize; 
        createAndSaveTopicList(listSize); 
        PageRequest pageRequest = new PageRequest( 
                String.valueOf(lastPage), pageSize); 
        DateTime lastLogin = new DateTime().minusDays(1); 
 
        PersistedObjectsFactory.createAndSaveViewTopicsBranchesEntity(22l, "noneExistingGroup", true);