aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEddie Ringle2012-04-05 11:28:22 (EDT)
committerKevin Sawicki2012-04-05 11:28:22 (EDT)
commit9d5d851d6bdffeda3f837ed6955750cd150fe4c7 (patch)
treecc5c29b6cd796b62b1f2cfe73d3f116db2c29c36
parent5bfa684c1b28b1d845f3748e72ea204681c3deb9 (diff)
downloadegit-github-9d5d851d6bdffeda3f837ed6955750cd150fe4c7.zip
egit-github-9d5d851d6bdffeda3f837ed6955750cd150fe4c7.tar.gz
egit-github-9d5d851d6bdffeda3f837ed6955750cd150fe4c7.tar.bz2
Add the gravatar id field to the User modelrefs/changes/28/5528/2
Change-Id: Id9cc14c5eda40584e7a097ff64ff802f4e252618 Signed-off-by: Eddie Ringle <eddie@eringle.net> Signed-off-by: Kevin Sawicki <kevin@github.com>
-rw-r--r--org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/UserTest.java2
-rw-r--r--org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/live/UserTest.java18
-rw-r--r--org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/User.java18
3 files changed, 30 insertions, 8 deletions
diff --git a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/UserTest.java b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/UserTest.java
index f863ff8..bf88b47 100644
--- a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/UserTest.java
+++ b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/UserTest.java
@@ -41,6 +41,7 @@ public class UserTest {
assertNull(user.getEmail());
assertEquals(0, user.getFollowers());
assertEquals(0, user.getFollowing());
+ assertNull(user.getGravatarId());
assertNull(user.getHtmlUrl());
assertEquals(0, user.getId());
assertNull(user.getLocation());
@@ -73,6 +74,7 @@ public class UserTest {
assertEquals("e@mai.l", user.setEmail("e@mai.l").getEmail());
assertEquals(1, user.setFollowers(1).getFollowers());
assertEquals(2, user.setFollowing(2).getFollowing());
+ assertEquals("gid", user.setGravatarId("gid").getGravatarId());
assertEquals("html", user.setHtmlUrl("html").getHtmlUrl());
assertEquals(90, user.setId(90).getId());
assertEquals("earth", user.setLocation("earth").getLocation());
diff --git a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/live/UserTest.java b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/live/UserTest.java
index b7fe901..d74bb28 100644
--- a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/live/UserTest.java
+++ b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/live/UserTest.java
@@ -29,7 +29,7 @@ public class UserTest extends LiveTest {
/**
* Test fetching currently authenticated user
- *
+ *
* @throws Exception
*/
@Test
@@ -40,6 +40,7 @@ public class UserTest extends LiveTest {
User user = service.getUser();
assertNotNull(user);
assertEquals(client.getUser(), user.getLogin());
+ assertNotNull(user.getGravatarId());
assertNotNull(user.getAvatarUrl());
assertNotNull(user.getCreatedAt());
assertNotNull(user.getPlan());
@@ -47,7 +48,7 @@ public class UserTest extends LiveTest {
/**
* Test fetching user by login name
- *
+ *
* @throws Exception
*/
@Test
@@ -58,13 +59,14 @@ public class UserTest extends LiveTest {
User user = service.getUser(client.getUser());
assertNotNull(user);
assertEquals(client.getUser(), user.getLogin());
+ assertNotNull(user.getGravatarId());
assertNotNull(user.getAvatarUrl());
assertNotNull(user.getCreatedAt());
}
/**
* Test fetching followers
- *
+ *
* @throws Exception
*/
@Test
@@ -82,7 +84,7 @@ public class UserTest extends LiveTest {
/**
* Test fetching followed users
- *
+ *
* @throws Exception
*/
@Test
@@ -100,7 +102,7 @@ public class UserTest extends LiveTest {
/**
* Test finding out if user is followed
- *
+ *
* @throws Exception
*/
@Test
@@ -116,7 +118,7 @@ public class UserTest extends LiveTest {
/**
* Test adding, fetching, and deleting an e-mail address to a user account
- *
+ *
* @throws Exception
*/
@Test
@@ -140,7 +142,7 @@ public class UserTest extends LiveTest {
/**
* Test adding, fetching, and deleting an e-mail addresses to a user account
- *
+ *
* @throws Exception
*/
@Test
@@ -168,7 +170,7 @@ public class UserTest extends LiveTest {
/**
* Test adding, fetching, and deleting a key to a user account
- *
+ *
* @throws Exception
*/
@Test
diff --git a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/User.java b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/User.java
index 92be857..2fd774d 100644
--- a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/User.java
+++ b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/User.java
@@ -65,6 +65,8 @@ public class User implements Serializable {
private String email;
+ private String gravatarId;
+
private String htmlUrl;
private String location;
@@ -336,6 +338,22 @@ public class User implements Serializable {
}
/**
+ * @return gravatarId
+ */
+ public String getGravatarId() {
+ return gravatarId;
+ }
+
+ /**
+ * @param gravatarId
+ * @return this user
+ */
+ public User setGravatarId(String gravatarId) {
+ this.gravatarId = gravatarId;
+ return this;
+ }
+
+ /**
* @return htmlUrl
*/
public String getHtmlUrl() {