}
@Test
public void testSaveProfileWithNull() throws Exception {
// Save the profile for the first time with null values.
Profile profile = conferenceApi.saveProfile(user, new ProfileForm(null, null));
String displayName = EMAIL.substring(0, EMAIL.indexOf("@"));
// Check the return value first.
assertEquals(USER_ID, profile.getUserId());
assertEquals(EMAIL, profile.getMainEmail());
assertEquals(TEE_SHIRT_SIZE, profile.getTeeShirtSize());
assertEquals(displayName, profile.getDisplayName());
// Fetch the Profile via Objectify.
profile = ofy().load().key(Key.create(Profile.class, user.getUserId())).now();
assertEquals(USER_ID, profile.getUserId());
assertEquals(EMAIL, profile.getMainEmail());
assertEquals(TEE_SHIRT_SIZE, profile.getTeeShirtSize());
assertEquals(displayName, profile.getDisplayName());
}