Code example for AbstractTransactionalTestNGSpringContextTests

Methods: assertNull

0
 
    @Test 
    public void testGetInvalidId() { 
        Branch result = dao.get(-567890L); 
 
        assertNull(result); 
    } 
 
    @Test 
    public void testUpdate() { 
        String newName = "new name"; 
        Branch branch = ObjectsFactory.getDefaultBranch(); 
        session.save(branch); 
        branch.setName(newName); 
 
        dao.saveOrUpdate(branch); 
        session.flush(); 
        session.evict(branch); 
        Branch result = (Branch) session.get(Branch.class, branch.getId());