Code example for AbstractTransactionalTestNGSpringContextTests

Methods: assertNull

0
 
    @Test 
    public void testGetInvalidId() { 
        Topic result = dao.get(-567890L); 
 
        assertNull(result); 
    } 
 
    @Test 
    public void testUpdate() { 
        String newTitle = "new title"; 
        Topic topic = PersistedObjectsFactory.getDefaultTopic(); 
        session.save(topic); 
        topic.setTitle(newTitle); 
 
        dao.saveOrUpdate(topic); 
        session.flush(); 
        session.evict(topic); 
        Topic result = (Topic) session.get(Topic.class, topic.getId());