コード例 #1
0
 @Test
 public void testGetProfileFirstTime() throws Exception {
   Profile profile = ofy().load().key(Key.create(Profile.class, user.getUserId())).now();
   assertNull(profile);
   profile = conferenceApi.getProfile(user);
   assertNull(profile);
 }
コード例 #2
0
 @Test
 public void testGetProfile() throws Exception {
   conferenceApi.saveProfile(user, new ProfileForm(DISPLAY_NAME, TEE_SHIRT_SIZE));
   // Fetch the Profile via the API.
   Profile profile = conferenceApi.getProfile(user);
   assertEquals(USER_ID, profile.getUserId());
   assertEquals(EMAIL, profile.getMainEmail());
   assertEquals(TEE_SHIRT_SIZE, profile.getTeeShirtSize());
   assertEquals(DISPLAY_NAME, profile.getDisplayName());
 }
コード例 #3
0
 @Test(expected = UnauthorizedException.class)
 public void testGetProfileWithoutUser() throws Exception {
   conferenceApi.getProfile(null);
 }