assertThat(user.getMail().getEmail(), is(mail));
assertNotNull(user.getInitialKey());
assertThat(user.getInitialKey(), not(""));
Administrator stored = Datastore.get(Administrator.class, user.getUid());
assertThat(stored, instanceOf(Administrator.class));
assertThat(stored.getName(), is(name));
assertThat(stored.getMail().getEmail(), is(mail));
assertThat(stored.getRegisteredDate(), is(stored.getUpdatedDate()));
// パスワードを保存する
service.savePassword(uid, "password");
final String name2 = "Test User2";
final String mail2 = "testuser2@mail.com";
user = service.put(uid, name2, mail2);
assertThat(user, is(notNullValue()));
assertThat(user, instanceOf(Administrator.class));
assertThat(user.getName(), is(name2));
assertThat(user.getMail().getEmail(), is(mail2));
assertThat(user.getInitialKey(), is(""));
stored = Datastore.get(Administrator.class, user.getUid());
assertThat(stored, instanceOf(Administrator.class));
assertThat(stored.getName(), is(name2));
assertThat(stored.getMail().getEmail(), is(mail2));
assertTrue(stored.getRegisteredDate().before(stored.getUpdatedDate()));
}