final String name = "Test User";
final String mail = "testuser@mail.com";
final String phone = "052-551-1861";
final String zipcode = "450-0002";
final String address = "架空の住所";
Transaction tx = Datastore.beginTransaction();
User user = service.put(tx, uid, name, mail, phone, zipcode, address);
assertThat(user, is(notNullValue()));
assertThat(user, instanceOf(Manager.class));
Manager manager = (Manager)user;
assertThat(manager.getName(), is(name));
assertThat(manager.getMail().getEmail(), is(mail));
assertThat(manager.getPhone().getNumber(), is(phone));
assertThat(manager.getZipcode(), is(zipcode));
assertThat(manager.getAddress().getAddress(), is(address));
assertNotNull(user.getInitialKey());
assertThat(user.getInitialKey(), not(""));
Manager stored = Datastore.getOrNull(Manager.class, user.getUid());
assertThat(stored, is(nullValue()));
tx.commit();
stored = Datastore.getOrNull(Manager.class, user.getUid());
assertThat(stored, instanceOf(Manager.class));
manager = (Manager)stored;
assertThat(manager.getName(), is(name));
assertThat(manager.getMail().getEmail(), is(mail));