Skip to content

Commit

Permalink
TFJ-488 adding getter for profile_use_background_image attribute to U…
Browse files Browse the repository at this point in the history
…ser interface
  • Loading branch information
yusuke committed Dec 15, 2010
1 parent 05fc123 commit e46c6e0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
2 changes: 2 additions & 0 deletions twitter4j-core/src/main/java/twitter4j/User.java
Expand Up @@ -186,6 +186,8 @@ public interface User extends Comparable<User>, TwitterResponse, java.io.Seriali

String getProfileSidebarBorderColor();

boolean isProfileUseBackgroundImage();

int getFriendsCount();

Date getCreatedAt();
Expand Down
9 changes: 9 additions & 0 deletions twitter4j-core/src/main/java/twitter4j/UserJSONImpl.java
Expand Up @@ -62,6 +62,7 @@
private String profileLinkColor;
private String profileSidebarFillColor;
private String profileSidebarBorderColor;
private boolean profileUseBackgroundImage;
private int friendsCount;
private Date createdAt;
private int favouritesCount;
Expand Down Expand Up @@ -111,6 +112,7 @@ private void init(JSONObject json) throws TwitterException {
profileLinkColor = getRawString("profile_link_color", json);
profileSidebarFillColor = getRawString("profile_sidebar_fill_color", json);
profileSidebarBorderColor = getRawString("profile_sidebar_border_color", json);
profileUseBackgroundImage = getBoolean("profile_use_background_image", json);
friendsCount = getInt("friends_count", json);
createdAt = getDate("created_at", json, "EEE MMM dd HH:mm:ss z yyyy");
favouritesCount = getInt("favourites_count", json);
Expand Down Expand Up @@ -308,6 +310,13 @@ public String getProfileSidebarBorderColor() {
return profileSidebarBorderColor;
}

/**
* {@inheritDoc}
*/
public boolean isProfileUseBackgroundImage() {
return profileUseBackgroundImage;
}

/**
* {@inheritDoc}
*/
Expand Down
Expand Up @@ -271,6 +271,7 @@ public void testAccountMethods() throws Exception{
assertEquals("0ff", user.getProfileLinkColor());
assertEquals("0f0", user.getProfileSidebarFillColor());
assertEquals("f0f", user.getProfileSidebarBorderColor());
assertTrue(user.isProfileUseBackgroundImage());
async1.updateProfileColors("f0f", "f00", "f0f", "0ff", "0f0");
waitForResponse();
assertEquals("f0f", user.getProfileBackgroundColor());
Expand Down
10 changes: 9 additions & 1 deletion twitter4j-core/src/test/java/twitter4j/DAOTest.java
Expand Up @@ -275,18 +275,23 @@ public void testSchema() throws Exception {
schema = new String[]{
"favorited",
"in_reply_to_status_id",
"in_reply_to_status_id_str",
"created_at",
"geo",
"place",
"source",
"in_reply_to_screen_name",
"in_reply_to_user_id",
"in_reply_to_user_id_str",
"coordinates",
"truncated",
"contributors",
"id",
"id_str",
"text",
"user/*"
"user/*",
"retweeted",
"retweet_count"

};
url="http://api.twitter.com/1/statuses/show/2245071380.json";
Expand Down Expand Up @@ -314,13 +319,16 @@ public void testSchema() throws Exception {
"verified",
"time_zone",
"profile_background_color",
"profile_use_background_image",
"protected",
"name",
"profile_text_color",
"followers_count",
"id",
"id_str",
"lang",
"statuses_count",
"follow_request_sent",
"utc_offset"};

url="http://api.twitter.com/1/users/show/yusukey.json";
Expand Down

0 comments on commit e46c6e0

Please sign in to comment.