Examples of DbxAccount


Examples of dropbox.gson.DbxAccount

    @Test
    public void testFindOrCreateByDbxAccount() throws Exception {
        // if DbxAccount is null, getOrCreateUser should just return null
        assertNull(User.upsert(null, TOKEN, SECRET));

        DbxAccount account = new DbxAccount();
        account.uid = ID;
        account.name = NAME;

        assertNotNull(User.upsert(account, TOKEN, SECRET).id);
    }
View Full Code Here

Examples of dropbox.gson.DbxAccount

    public void testSave() {
        User user = newUser();
        user.save();
        assertEquals(User.findById(AccountType.DROPBOX, ID), user);
       
        DbxAccount acc = new DbxAccount();
        acc.name = NAME;
        acc.uid = ID;
        user.sync(acc, TOKEN, SECRET);
        assertEquals(User.findById(AccountType.DROPBOX, ID), user);
View Full Code Here

Examples of dropbox.gson.DbxAccount

        assertNull(User.findById(AccountType.DROPBOX, ID));
    }

    @Test
    public void testModstamp() {
        DbxAccount account = new DbxAccount();
        account.uid = ID;
        account.name = NAME;

        User u = User.upsert(account, TOKEN, SECRET);
        assertNotNull(u.modified);
View Full Code Here

Examples of dropbox.gson.DbxAccount

     * Ensure that the Dropbox user authenticated with the given oauth credentials
     * is in the datastore.
     */
    private static User upsertUser(String token, String secret) {
        DropboxClient client = DropboxClientFactory.create(token, secret);
        DbxAccount account = client.getAccount();
        return User.upsert(account, token, secret);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.