Code example for AbstractTransactionalTestNGSpringContextTests

Methods: assertEquals, 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()); 
        assertEquals(topicsPage.getNumber(), pageCount); 
    } 
 
    @Test 
    public void testAddCodeReview() { 
        Topic topic = PersistedObjectsFactory.getDefaultTopic(); 
 
        CodeReview review = new CodeReview(); 
        topic.setCodeReview(review); 
        review.setTopic(topic); 
        dao.saveOrUpdate(topic); 
        session.flush(); 
        session.evict(topic); 
        assertNotNull(dao.get(topic.getId()).getCodeReview());