Package org.springframework.social.dropbox.api

Examples of org.springframework.social.dropbox.api.DropboxUserProfile


        mockServer
                .expect(requestTo("https://api.dropbox.com/1/account/info"))
                .andExpect(method(GET))
                .andRespond(withResponse(jsonResource("/profileValid"), responseHeaders));

        DropboxUserProfile profile = dropbox.getUserProfile();
        assertEquals("US", profile.getCountry());
        assertEquals("Some User", profile.getDisplayName());
        assertEquals("some email", profile.getEmail());
        assertEquals(BigInteger.valueOf(10), profile.getUid());
        assertEquals("referralLink", profile.getReferralLink());
        assertEquals(BigInteger.valueOf(108179488768L), profile.getQuota());
        assertEquals(BigInteger.valueOf(44962990383L), profile.getSharedQuota());
        assertEquals(BigInteger.valueOf(46970996076L), profile.getNormalQuota());
    }
View Full Code Here


        final BigInteger normalQuota = BigInteger.valueOf(323);
        String email = "emailaddress";
        String referralLink = "referralLink";

        Mockito.when(dropboxApi.getUserProfile())
                .thenReturn(new DropboxUserProfile(uid, displayName, email, country, referralLink, sharedQuota, quota, normalQuota));

        UserProfile profile = adapter.fetchUserProfile(dropboxApi);

        assertEquals(displayName, profile.getName());
    }
View Full Code Here

        }
    }

    @Override
    public void setConnectionValues(Dropbox dropboxApi, ConnectionValues values) {
        DropboxUserProfile profile = dropboxApi.getUserProfile();
        values.setProviderUserId(profile.getUid().toString());
        values.setDisplayName(profile.getDisplayName());
        values.setProfileUrl(profile.getReferralLink());
    }
View Full Code Here

        values.setProfileUrl(profile.getReferralLink());
    }

    @Override
    public UserProfile fetchUserProfile(Dropbox dropboxApi) {
        DropboxUserProfile profile = dropboxApi.getUserProfile();
        return new UserProfileBuilder().setName(profile.getDisplayName()).setUsername(profile.getEmail()).setEmail(profile.getEmail()).build();
    }
View Full Code Here

            JsonNode quotaNode = tree.get("quota_info");
            BigInteger sharedQuota = quotaNode.get("shared").getBigIntegerValue();
            BigInteger quota = quotaNode.get("quota").getBigIntegerValue();
            BigInteger normalQuota = quotaNode.get("normal").getBigIntegerValue();

            return new DropboxUserProfile(uid, displayName,  email,  country,  referralLink, sharedQuota,  quota, normalQuota);
        }
View Full Code Here

TOP

Related Classes of org.springframework.social.dropbox.api.DropboxUserProfile

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.