diff --git a/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/Facebook.java b/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/Facebook.java index 3ca51b630..b98cafbb1 100644 --- a/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/Facebook.java +++ b/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/Facebook.java @@ -27,7 +27,7 @@ */ public interface Facebook extends GraphApi, ApiBinding { - public static final String DEFAULT_API_VERSION = "2.10"; + String DEFAULT_API_VERSION = "2.10"; /** * API for working with achievements. diff --git a/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/OpenGraphOperations.java b/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/OpenGraphOperations.java index 42e03b094..b577b8d9b 100644 --- a/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/OpenGraphOperations.java +++ b/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/OpenGraphOperations.java @@ -26,7 +26,7 @@ */ public interface OpenGraphOperations { - static final ActionMetadata EMPTY_ACTION_METADATA = new ActionMetadata(); + ActionMetadata EMPTY_ACTION_METADATA = new ActionMetadata(); /** * @return Operations for working with built-in general OpenGraph actions such as "og.like" and "og.follow". diff --git a/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/UserOperations.java b/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/UserOperations.java index 00d1155f6..e17f6e324 100644 --- a/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/UserOperations.java +++ b/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/UserOperations.java @@ -126,13 +126,6 @@ public interface UserOperations { */ PagedList search(String query); - static final String[] PROFILE_FIELDS = { - "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", - "sports", "test_group", "timezone", "third_party_id", "updated_time", "verified", "video_upload_limits", "viewer_can_send_gift", - "website", "work" - }; + } diff --git a/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/AbstractFacebookOperations.java b/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/AbstractFacebookOperations.java index e2d7816e6..e51b45d9e 100644 --- a/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/AbstractFacebookOperations.java +++ b/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/AbstractFacebookOperations.java @@ -17,7 +17,7 @@ import org.springframework.social.MissingAuthorizationException; -class AbstractFacebookOperations { +public class AbstractFacebookOperations { private final boolean isAuthorized; diff --git a/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/CommentTemplate.java b/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/CommentTemplate.java index f286a7b42..422a62007 100644 --- a/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/CommentTemplate.java +++ b/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/CommentTemplate.java @@ -25,7 +25,7 @@ import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; -class CommentTemplate implements CommentOperations { +public class CommentTemplate implements CommentOperations { private final GraphApi graphApi; diff --git a/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/EventTemplate.java b/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/EventTemplate.java index a43ee17e5..0bc9b0ba2 100644 --- a/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/EventTemplate.java +++ b/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/EventTemplate.java @@ -28,7 +28,7 @@ import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; -class EventTemplate implements EventOperations { +public class EventTemplate implements EventOperations { private final GraphApi graphApi; diff --git a/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/FacebookErrorHandler.java b/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/FacebookErrorHandler.java index d99ec9d86..6ad36d3b4 100644 --- a/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/FacebookErrorHandler.java +++ b/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/FacebookErrorHandler.java @@ -48,7 +48,7 @@ * Graph API, interpreting them into appropriate exceptions. * @author Craig Walls */ -class FacebookErrorHandler extends DefaultResponseErrorHandler { +public class FacebookErrorHandler extends DefaultResponseErrorHandler { private static final String FACEBOOK_PROVIDER_ID = "facebook"; private final static Log logger = LogFactory.getLog(FacebookErrorHandler.class); diff --git a/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/FeedTemplate.java b/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/FeedTemplate.java index 5d64fdf20..dc8a59c73 100644 --- a/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/FeedTemplate.java +++ b/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/FeedTemplate.java @@ -42,7 +42,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; -class FeedTemplate implements FeedOperations { +public class FeedTemplate implements FeedOperations { private static final PagingParameters FIRST_PAGE = new PagingParameters(25, null, null, null); diff --git a/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/FriendTemplate.java b/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/FriendTemplate.java index 52855d873..9ec63e4de 100644 --- a/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/FriendTemplate.java +++ b/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/FriendTemplate.java @@ -37,7 +37,7 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ArrayNode; -class FriendTemplate implements FriendOperations { +public class FriendTemplate implements FriendOperations { private final GraphApi graphApi; diff --git a/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/GroupTemplate.java b/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/GroupTemplate.java index d8e7ed39b..5167def71 100644 --- a/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/GroupTemplate.java +++ b/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/GroupTemplate.java @@ -26,7 +26,7 @@ import org.springframework.social.facebook.api.PagingParameters; import org.springframework.util.MultiValueMap; -class GroupTemplate implements GroupOperations { +public class GroupTemplate implements GroupOperations { private final GraphApi graphApi; diff --git a/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/LikeTemplate.java b/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/LikeTemplate.java index 1fe490a68..7f1064457 100644 --- a/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/LikeTemplate.java +++ b/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/LikeTemplate.java @@ -23,7 +23,7 @@ import org.springframework.social.facebook.api.Reference; import org.springframework.util.LinkedMultiValueMap; -class LikeTemplate implements LikeOperations { +public class LikeTemplate implements LikeOperations { private final GraphApi graphApi; diff --git a/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/MediaTemplate.java b/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/MediaTemplate.java index a86a7e79c..706645509 100644 --- a/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/MediaTemplate.java +++ b/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/MediaTemplate.java @@ -32,7 +32,7 @@ import org.springframework.util.MultiValueMap; import org.springframework.web.client.RestTemplate; -class MediaTemplate implements MediaOperations { +public class MediaTemplate implements MediaOperations { private final GraphApi graphApi; diff --git a/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/OpenGraphTemplate.java b/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/OpenGraphTemplate.java index af5e6d3b1..9198b1cdd 100644 --- a/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/OpenGraphTemplate.java +++ b/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/OpenGraphTemplate.java @@ -26,7 +26,7 @@ import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; -class OpenGraphTemplate implements OpenGraphOperations { +public class OpenGraphTemplate implements OpenGraphOperations { private GraphApi graphApi; diff --git a/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/PageTemplate.java b/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/PageTemplate.java index 044da575c..a38c0db96 100644 --- a/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/PageTemplate.java +++ b/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/PageTemplate.java @@ -33,7 +33,7 @@ import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; -class PageTemplate implements PageOperations { +public class PageTemplate implements PageOperations { private final GraphApi graphApi; diff --git a/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/ProfileData.java b/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/ProfileData.java new file mode 100644 index 000000000..091fc8aa8 --- /dev/null +++ b/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/ProfileData.java @@ -0,0 +1,16 @@ +package org.springframework.social.facebook.api.impl; + +/** + * Created by fbalicchia on 13/04/2018. + */ +public class ProfileData +{ + public static final String[] PROFILE_FIELDS = { + "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", + "sports", "test_group", "timezone", "third_party_id", "updated_time", "verified", "video_upload_limits", "viewer_can_send_gift", + "website", "work" + }; +} diff --git a/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/SocialContextTemplate.java b/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/SocialContextTemplate.java index 06778ac2d..70479f84d 100644 --- a/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/SocialContextTemplate.java +++ b/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/SocialContextTemplate.java @@ -27,7 +27,7 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ArrayNode; -class SocialContextTemplate implements SocialContextOperations { +public class SocialContextTemplate implements SocialContextOperations { private static final int LIMIT = 25; diff --git a/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/UserTemplate.java b/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/UserTemplate.java index f6cb73143..9e66c54d4 100644 --- a/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/UserTemplate.java +++ b/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/impl/UserTemplate.java @@ -34,10 +34,10 @@ import com.fasterxml.jackson.databind.JsonNode; -class UserTemplate implements UserOperations { +public class UserTemplate implements UserOperations { private final GraphApi graphApi; - + private final RestTemplate restTemplate; public UserTemplate(GraphApi graphApi, RestTemplate restTemplate) { @@ -50,7 +50,7 @@ public User getUserProfile() { } public User getUserProfile(String facebookId) { - return graphApi.fetchObject(facebookId, User.class, PROFILE_FIELDS); + return graphApi.fetchObject(facebookId, User.class, ProfileData.PROFILE_FIELDS); } public byte[] getUserProfileImage() { diff --git a/spring-social-facebook/src/test/java/org/springframework/social/facebook/api/UserTemplateTest.java b/spring-social-facebook/src/test/java/org/springframework/social/facebook/api/UserTemplateTest.java index 3dd8e213b..990941628 100644 --- a/spring-social-facebook/src/test/java/org/springframework/social/facebook/api/UserTemplateTest.java +++ b/spring-social-facebook/src/test/java/org/springframework/social/facebook/api/UserTemplateTest.java @@ -17,6 +17,7 @@ import static org.junit.Assert.*; import static org.springframework.http.HttpMethod.*; +import org.springframework.social.facebook.api.impl.ProfileData; import static org.springframework.test.web.client.match.MockRestRequestMatchers.*; import static org.springframework.test.web.client.response.MockRestResponseCreators.*; @@ -37,9 +38,9 @@ public class UserTemplateTest extends AbstractFacebookApiTest { private static String PROFILE_FIELDS; static { - StringBuilder builder = new StringBuilder(UserOperations.PROFILE_FIELDS[0]); - for (int i=1; i < UserOperations.PROFILE_FIELDS.length; i++) { - builder.append("%2C").append(UserOperations.PROFILE_FIELDS[i]); + StringBuilder builder = new StringBuilder(ProfileData.PROFILE_FIELDS[0]); + for (int i=1; i < ProfileData.PROFILE_FIELDS.length; i++) { + builder.append("%2C").append(ProfileData.PROFILE_FIELDS[i]); } PROFILE_FIELDS = builder.toString(); }