本文整理汇总了Java中com.google.api.services.plus.model.Person.Image方法的典型用法代码示例。如果您正苦于以下问题:Java Person.Image方法的具体用法?Java Person.Image怎么用?Java Person.Image使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.api.services.plus.model.Person
的用法示例。
在下文中一共展示了Person.Image方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testSaveWithGoogleData_NotFound
import com.google.api.services.plus.model.Person; //导入方法依赖的package包/类
@Test
public void testSaveWithGoogleData_NotFound() throws Exception {
HmhbUser expected = new HmhbUser();
expected.setAdmin(false);
expected.setEmail(EMAIL);
expected.setDisplayName(DISPLAY_NAME);
expected.setFirstName(FIRST_NAME);
expected.setLastName(LAST_NAME);
expected.setImageUrl(IMAGE_URL);
expected.setProfileUrl(PROFILE_URL);
expected.setCreatedBy("system-generated");
expected.setCreatedOn(NOW);
Person.Image image = new Person.Image();
image.setUrl(IMAGE_URL);
Person.Name name = new Person.Name();
name.setFamilyName(LAST_NAME);
name.setGivenName(FIRST_NAME);
Person gPlusProfile = new Person();
gPlusProfile.setUrl(PROFILE_URL);
gPlusProfile.setDisplayName(DISPLAY_NAME);
gPlusProfile.setImage(image);
gPlusProfile.setName(name);
/* Train the mocks. */
when(auditHelper.getCurrentTime()).thenReturn(NOW);
when(dao.findByEmailIgnoreCase(EMAIL)).thenReturn(null);
when(dao.save(expected)).thenReturn(expected);
/* Make the call. */
HmhbUser actual = toTest.saveWithGoogleData(EMAIL, gPlusProfile);
/* Verify the results. */
assertEquals(expected, actual);
}
示例2: testSaveWithGoogleData
import com.google.api.services.plus.model.Person; //导入方法依赖的package包/类
@Test
public void testSaveWithGoogleData() throws Exception {
HmhbUser userInDb = new HmhbUser();
userInDb.setId(USER_ID);
userInDb.setAdmin(true);
userInDb.setEmail(EMAIL);
userInDb.setDisplayName(DISPLAY_NAME + "-old");
userInDb.setFirstName(FIRST_NAME + "-old");
userInDb.setLastName(LAST_NAME + "-old");
userInDb.setImageUrl(IMAGE_URL + "-old");
userInDb.setProfileUrl(PROFILE_URL + "-old");
userInDb.setCreatedBy("system-generated");
userInDb.setCreatedOn(BEFORE);
HmhbUser expected = new HmhbUser();
expected.setId(USER_ID);
expected.setAdmin(true);
expected.setEmail(EMAIL);
expected.setDisplayName(DISPLAY_NAME);
expected.setFirstName(FIRST_NAME);
expected.setLastName(LAST_NAME);
expected.setImageUrl(IMAGE_URL);
expected.setProfileUrl(PROFILE_URL);
expected.setCreatedBy("system-generated");
expected.setCreatedOn(BEFORE);
expected.setUpdatedBy("system-updated-from-google-login");
expected.setUpdatedOn(NOW);
Person.Image image = new Person.Image();
image.setUrl(IMAGE_URL);
Person.Name name = new Person.Name();
name.setFamilyName(LAST_NAME);
name.setGivenName(FIRST_NAME);
Person gPlusProfile = new Person();
gPlusProfile.setUrl(PROFILE_URL);
gPlusProfile.setDisplayName(DISPLAY_NAME);
gPlusProfile.setImage(image);
gPlusProfile.setName(name);
/* Train the mocks. */
when(auditHelper.getCurrentTime()).thenReturn(NOW);
when(dao.findByEmailIgnoreCase(EMAIL)).thenReturn(userInDb);
when(dao.save(expected)).thenReturn(expected);
/* Make the call. */
HmhbUser actual = toTest.saveWithGoogleData(EMAIL, gPlusProfile);
/* Verify the results. */
assertEquals(userInDb, actual);
}