Package facebook4j.conf

Examples of facebook4j.conf.Configuration


        FacebookAPIVersion annotation = method.getAnnotation(FacebookAPIVersion.class);
        if (annotation != null) {
            String apiVersion = annotation.value();
            restBaseURL += apiVersion + "/";
        }
        Configuration conf = ((FacebookBaseImpl) facebook).conf;
        Field field = conf.getClass().getSuperclass().getDeclaredField("restBaseURL");
        field.setAccessible(true);
        field.set(conf, restBaseURL);
    }
View Full Code Here


    protected MockFacebook facebook;

    @Before
    public void setUp() throws Exception {
        Configuration conf = new ConfigurationBuilder().setJSONStoreEnabled(true).build();
        facebook = MockFacebookFactory.create(conf);
        facebook.setOAuthAppId("mock", "json");
        facebook.setOAuthAccessToken(new AccessToken("required"));
    }
View Full Code Here

     * Returns {@link Facebook} instance. If needed, creates one from configuration.
     * @return {@link Facebook} instance
     */
    public Facebook getFacebook() throws FacebookException {
        if (facebook == null) {
            final Configuration configuration = getConfiguration();
            FacebookFactory factory = new FacebookFactory(configuration);
            if (this.oAuthAccessToken == null) {
                // app login
                facebook = factory.getInstance(new OAuthAuthorization(configuration));
                // also get the App access token
View Full Code Here

        String appSecret = p.getProperty("oauth.appSecret");

        ConfigurationBuilder build = new ConfigurationBuilder();
        build.setOAuthAppId(appId);
        build.setOAuthAppSecret(appSecret);
        Configuration configuration = build.build();
        HttpClientWrapper http = new HttpClientWrapper(configuration);
        HttpResponse res = http.get(configuration.getOAuthAccessTokenURL() +
                "?client_id=" + appId +
                "&client_secret=" + appSecret +
                "&grant_type=client_credentials");
        AccessToken at = new AccessToken(res);
        assertThat(at.getToken(), is(notNullValue()));
View Full Code Here

public class OAuthAuthorizationTest {

    public static class AppSecretProof {
        @Test
        public void defaultCacheSize() throws Exception {
            Configuration conf = new ConfigurationBuilder()
                    .setAppSecretProofEnabled(true)
                    .setOAuthAppSecret("1234567890123456")
                    .build();
            OAuthAuthorization auth = new OAuthAuthorization(conf);
            auth.setOAuthAccessToken(new AccessToken("access_token1"));
View Full Code Here

            assertThat(reComputedProof2, is(not(proof2)));   // re-computed
        }

        @Test
        public void customCacheSize() throws Exception {
            Configuration conf = new ConfigurationBuilder()
                    .setAppSecretProofEnabled(true)
                    .setOAuthAppSecret("1234567890123456")
                    .setAppSecretProofCacheSize(3)
                    .build();
            OAuthAuthorization auth = new OAuthAuthorization(conf);
View Full Code Here

TOP

Related Classes of facebook4j.conf.Configuration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.