Code example for AbstractTransactionalTestNGSpringContextTests

Methods: assertNull

0
 
    @Test 
    public void testGetInvalidId() { 
        Post result = dao.get(-567890L); 
 
        assertNull(result); 
    } 
 
    @Test 
    public void testUpdate() { 
        String newContent = "new content"; 
        Post post = PersistedObjectsFactory.getDefaultPost(); 
        session.save(post); 
        post.setPostContent(newContent); 
 
        dao.saveOrUpdate(post); 
        session.flush(); 
        session.evict(post); 
        Post result = (Post) session.get(Post.class, post.getId());