@Test
 public void testUpdateUser() throws Exception {
   assertSame(user, db.retrieveUserById(user.getId()));
   UaaUser newUser =
       new UaaUser(
           user.getId(),
           user.getUsername(),
           user.getPassword(),
           user.getEmail(),
           user.getAuthorities(),
           user.getGivenName(),
           user.getFamilyName(),
           user.getCreated(),
           user.getModified(),
           user.getOrigin(),
           user.getExternalId(),
           false,
           user.getZoneId(),
           user.getSalt(),
           user.getPasswordLastModified());
   db.updateUser(user.getId(), newUser);
   assertSame(newUser, db.retrieveUserById(user.getId()));
 }
 @Test(expected = UsernameNotFoundException.class)
 public void testRetrieveUserByInvalidId() throws Exception {
   db.retrieveUserById(user.getId() + "1");
 }
 @Test
 public void testRetrieveUserById() throws Exception {
   assertSame(user, db.retrieveUserById(user.getId()));
 }