Code example for AbstractTransactionalTestNGSpringContextTests

Methods: assertNull

0
 
    @Test 
    public void testGetInvalidId() { 
        JCUser result = dao.get(-567890L); 
 
        assertNull(result); 
    } 
 
    @Test 
    public void testUpdate() { 
        String newName = "new name"; 
        JCUser user = ObjectsFactory.getDefaultUser(); 
        session.save(user); 
        user.setFirstName(newName); 
        dao.saveOrUpdate(user); 
        session.flush(); 
        session.evict(user); 
        JCUser result = (JCUser) session.get(JCUser.class, user.getId());//! 
        assertEquals(result.getFirstName(), newName); 
    } 
Contextual code suggestions in your IDE  Get Codota for Java