Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.

Commit

Permalink
Remove all about bio. (Solve the issue "(#12) bio field is deprecated…
Browse files Browse the repository at this point in the history
… for versions v2.8 and higher")
  • Loading branch information
bh-eslee committed Oct 10, 2016
1 parent c2b447c commit f1318be
Show file tree
Hide file tree
Showing 13 changed files with 6 additions and 40 deletions.
Expand Up @@ -49,8 +49,6 @@ public class Page extends FacebookObject {

private Page bestPage;

private String bio;

private String birthday;

private String bookingAgent;
Expand Down Expand Up @@ -461,10 +459,6 @@ public String getBandInterests() {
return bandInterests;
}

public String getBio() {
return bio;
}

public String getBuilt() {
return built;
}
Expand Down
Expand Up @@ -28,8 +28,6 @@ public class PageUpdate {

private String about;

private String bio;

private String cover;

private String name;
Expand Down Expand Up @@ -63,11 +61,6 @@ public PageUpdate about(String about) {
return this;
}

public PageUpdate bio(String bio) {
this.bio = bio;
return this;
}

public PageUpdate cover(String cover, Integer offsetX, Integer offsetY, Float zoomScaleX, Float zoomScaleY, Float focusX, Float focusY) {
this.cover = cover;
this.offsetX = offsetX;
Expand All @@ -87,7 +80,6 @@ public PageUpdate name(String name) {
public MultiValueMap<String, Object> toRequestParameters() {
MultiValueMap<String, Object> parameters = new LinkedMultiValueMap<String, Object>();
if (about != null) { parameters.add("about", about); }
if (bio != null) { parameters.add("bio", bio); }
if (cover != null) { parameters.add("cover", cover); }
if (name != null) { parameters.add("name", name); }
if (offsetX != null) { parameters.add("offset_x", offsetX.toString()); }
Expand Down
Expand Up @@ -37,8 +37,6 @@ public class User extends FacebookObject implements Serializable {

private AgeRange ageRange = AgeRange.UNKNOWN;

private String bio;

private String birthday;

private CoverPhoto cover;
Expand Down Expand Up @@ -287,15 +285,6 @@ public String getAbout() {
return about;
}

/**
* The user's bio.
* Available only with "user_about_me" permission for the authenticated user.
* @return the user's bio, if available.
*/
public String getBio() {
return bio;
}

/**
* The user's birthday.
* Available only with "user_birthday" permission for the authentication user permission for the user's friends.
Expand Down
Expand Up @@ -127,7 +127,7 @@ public interface UserOperations {
PagedList<Reference> search(String query);

static final String[] PROFILE_FIELDS = {
"id", "about", "age_range", "bio", "birthday", "context", "cover", "currency", "devices", "education", "email",
"id", "about", "age_range", "birthday", "context", "cover", "currency", "devices", "education", "email",
"favorite_athletes", "favorite_teams", "first_name", "gender", "hometown", "inspirational_people", "installed", "install_type",
"is_verified", "languages", "last_name", "link", "locale", "location", "meeting_for", "middle_name", "name", "name_format",
"political", "quotes", "payment_pricepoints", "relationship_status", "religion", "security_settings", "significant_other",
Expand Down
Expand Up @@ -120,6 +120,6 @@ public PagedList<UserTaggableFriend> getTaggableFriends() {
"id", "name" ,"picture", "first_name", "last_name", "middle_name");
}

private static final String FULL_PROFILE_FIELDS = "id,name,first_name,last_name,gender,locale,education,work,email,third_party_id,link,timezone,updated_time,verified,about,bio,birthday,location,hometown,interested_in,religion,political,quotes,relationship_status,significant_other,website";
private static final String FULL_PROFILE_FIELDS = "id,name,first_name,last_name,gender,locale,education,work,email,third_party_id,link,timezone,updated_time,verified,about,birthday,location,hometown,interested_in,religion,political,quotes,relationship_status,significant_other,website";

}
Expand Up @@ -74,6 +74,6 @@ public PagedList<Group> search(String query, PagingParameters pagedListParameter
return graphApi.fetchConnections("search", "", Group.class, queryMap);
}

private static final String[] FULL_PROFILE_FIELDS = {"id", "name", "first_name", "last_name", "gender", "locale", "education", "work", "email", "third_party_id", "link", "timezone", "updated_time", "verified", "about", "bio", "birthday", "location", "hometown", "interested_in", "religion", "political", "quotes", "relationship_status", "significant_other", "website"};
private static final String[] FULL_PROFILE_FIELDS = {"id", "name", "first_name", "last_name", "gender", "locale", "education", "work", "email", "third_party_id", "link", "timezone", "updated_time", "verified", "about", "birthday", "location", "hometown", "interested_in", "religion", "political", "quotes", "relationship_status", "significant_other", "website"};

}
Expand Up @@ -191,9 +191,6 @@ abstract class PageMixin extends FacebookObjectMixin {
@JsonProperty("band_interests")
String bandInterests;

@JsonProperty("bio")
String bio;

@JsonProperty("built")
String built;

Expand Down
Expand Up @@ -110,9 +110,6 @@ abstract class UserMixin extends FacebookObjectMixin {
@JsonProperty("verified")
Boolean verified;

@JsonProperty("bio")
String bio;

@JsonProperty("birthday")
String birthday;

Expand Down
Expand Up @@ -95,7 +95,7 @@ public void getFriendIds_forSpecificUser() {

@Test
public void getFriendProfiles() {
mockServer.expect(requestTo(facebook.getBaseGraphApiUrl() + "me/friends?fields=id%2Cname%2Cfirst_name%2Clast_name%2Cgender%2Clocale%2Ceducation%2Cwork%2Cemail%2Cthird_party_id%2Clink%2Ctimezone%2Cupdated_time%2Cverified%2Cabout%2Cbio%2Cbirthday%2Clocation%2Chometown%2Cinterested_in%2Creligion%2Cpolitical%2Cquotes%2Crelationship_status%2Csignificant_other%2Cwebsite"))
mockServer.expect(requestTo(facebook.getBaseGraphApiUrl() + "me/friends?fields=id%2Cname%2Cfirst_name%2Clast_name%2Cgender%2Clocale%2Ceducation%2Cwork%2Cemail%2Cthird_party_id%2Clink%2Ctimezone%2Cupdated_time%2Cverified%2Cabout%2Cbirthday%2Clocation%2Chometown%2Cinterested_in%2Creligion%2Cpolitical%2Cquotes%2Crelationship_status%2Csignificant_other%2Cwebsite"))
.andExpect(method(GET))
.andExpect(header("Authorization", "OAuth someAccessToken"))
.andRespond(withSuccess(jsonResource("user-profiles"), MediaType.APPLICATION_JSON));
Expand All @@ -106,7 +106,7 @@ public void getFriendProfiles() {

@Test
public void getFriendProfiles_forSpecificUser() {
mockServer.expect(requestTo(facebook.getBaseGraphApiUrl() + "1234567/friends?fields=id%2Cname%2Cfirst_name%2Clast_name%2Cgender%2Clocale%2Ceducation%2Cwork%2Cemail%2Cthird_party_id%2Clink%2Ctimezone%2Cupdated_time%2Cverified%2Cabout%2Cbio%2Cbirthday%2Clocation%2Chometown%2Cinterested_in%2Creligion%2Cpolitical%2Cquotes%2Crelationship_status%2Csignificant_other%2Cwebsite"))
mockServer.expect(requestTo(facebook.getBaseGraphApiUrl() + "1234567/friends?fields=id%2Cname%2Cfirst_name%2Clast_name%2Cgender%2Clocale%2Ceducation%2Cwork%2Cemail%2Cthird_party_id%2Clink%2Ctimezone%2Cupdated_time%2Cverified%2Cabout%2Cbirthday%2Clocation%2Chometown%2Cinterested_in%2Creligion%2Cpolitical%2Cquotes%2Crelationship_status%2Csignificant_other%2Cwebsite"))
.andExpect(method(GET))
.andExpect(header("Authorization", "OAuth someAccessToken"))
.andRespond(withSuccess(jsonResource("user-profiles"), MediaType.APPLICATION_JSON));
Expand Down
Expand Up @@ -68,7 +68,7 @@ public void getMembers() {

@Test
public void getMemberProfiles() {
mockServer.expect(requestTo(fbUrl("213106022036379/members?fields=id%2Cname%2Cfirst_name%2Clast_name%2Cgender%2Clocale%2Ceducation%2Cwork%2Cemail%2Cthird_party_id%2Clink%2Ctimezone%2Cupdated_time%2Cverified%2Cabout%2Cbio%2Cbirthday%2Clocation%2Chometown%2Cinterested_in%2Creligion%2Cpolitical%2Cquotes%2Crelationship_status%2Csignificant_other%2Cwebsite")))
mockServer.expect(requestTo(fbUrl("213106022036379/members?fields=id%2Cname%2Cfirst_name%2Clast_name%2Cgender%2Clocale%2Ceducation%2Cwork%2Cemail%2Cthird_party_id%2Clink%2Ctimezone%2Cupdated_time%2Cverified%2Cabout%2Cbirthday%2Clocation%2Chometown%2Cinterested_in%2Creligion%2Cpolitical%2Cquotes%2Crelationship_status%2Csignificant_other%2Cwebsite")))
.andExpect(method(GET))
.andExpect(header("Authorization", "OAuth someAccessToken"))
.andRespond(withSuccess(jsonResource("group-members"), MediaType.APPLICATION_JSON));
Expand Down
Expand Up @@ -60,7 +60,6 @@ public void getUserProfile_currentUser() {
assertEquals(toDate("2010-08-22T00:01:59+0000"), profile.getUpdatedTime());
assertTrue(profile.isVerified());
assertEquals("Just some dude", profile.getAbout());
assertEquals("I was born at a very early age.", profile.getBio());
assertEquals("06/09/1971", profile.getBirthday());
assertEquals("111762725508574", profile.getLocation().getId());
assertEquals("Dallas, Texas", profile.getLocation().getName());
Expand Down
Expand Up @@ -9,7 +9,6 @@
"timezone":-5,
"about":"Just some dude",
"birthday":"06\/09\/1971",
"bio":"I was born at a very early age.",
"hometown":
{
"id":"107925612568471",
Expand Down
Expand Up @@ -10,7 +10,6 @@
"timezone":-5,
"about":"Just some dude",
"birthday":"06\/09\/1971",
"bio":"I was born at a very early age.",
"hometown":
{
"id":"107925612568471",
Expand Down

0 comments on commit f1318be

Please sign in to comment.