Code example for AbstractTransactionalTestNGSpringContextTests

Methods: assertFalse

0
 
    @Test 
    public void testDeleteInvalidId() { 
        boolean result = dao.delete(-100500L); 
 
        assertFalse(result, "Entity deleted"); 
    } 
 
    /*===== UserDao specific methods =====*/ 
 
    @Test 
    public void testGetByUsernameSameCase() { 
        JCUser user = ObjectsFactory.getDefaultUser(); 
        session.save(user); 
 
        JCUser result = dao.getByUsername(user.getUsername()); 
 
        assertNotNull(result); 
        assertReflectionEquals(user, result); 
    }