Code example for AbstractTransactionalTestNGSpringContextTests

Methods: assertEquals, assertThat, hasPages

0
        user.setGroups(ObjectsFactory.getDefaultGroupList()); 
        PersistedObjectsFactory.createAndSaveViewTopicsBranchesEntity(createdTopicList.get(0).getBranch().getId(), 
                String.valueOf(user.getGroups().get(0).getId()), true); 
        Page<Topic> page = dao.getTopicsUpdatedSince(lastLogin, pageRequest, user); 
 
        assertThat("Topics should be paginated for registered users", page, hasPages()); 
        assertEquals(page.getNumber(), lastPage); 
    } 
 
    @Test 
    public void testGetUpdateTopicsUpdatedSinceWithPagingAndAnonymousUser() { 
        int listSize = 5; 
        int pageSize = 2; 
        int lastPage = listSize / pageSize; 
        List<Topic> createdTopicList = createAndSaveTopicList(listSize); 
        PageRequest pageRequest = new PageRequest( 
                String.valueOf(lastPage), pageSize); 
        DateTime lastLogin = new DateTime().minusDays(1); 
 
        PersistedObjectsFactory.createAndSaveViewTopicsBranchesEntity( 
Experience pair programming with AI  Get Codota for Java