user = dao.saveUser(user); assertTrue(user.getUsername() != null); assertTrue(user.getPassword().equals("testpass"));
dao.saveUser(user);  assertNotNull(user.getUsername()); assertEquals("testpass", user.getPassword());
    public void testAddAndRemoveUser() throws Exception {        user = new User();        user.setUsername("testuser");        user.setPassword("testpass");        user.setFirstName("Test");        user.setLastName("Last");        Address address = new Address();        address.setCity("Denver");        address.setProvince("CO");        address.setCountry("USA");        address.setPostalCode("80210");        user.setAddress(address);        user.setEmail("testuser@appfuse.org");        user.setWebsite("http://raibledesigns.com");        user.addRole(Constants.USER_ROLE);        user = dao.saveUser(user);        assertTrue(user.getUsername() != null);        assertTrue(user.getPassword().equals("testpass"));        dao.removeUser("testuser");        try {            user = dao.getUser("testuser");            fail("Expected 'ObjectRetrievalFailureException' not thrown");        } catch (DataAccessException d) {            if (log.isDebugEnabled()) {                log.debug(d);            }            assertNotNull(d);        }    }