Package com.box.boxjavalibv2

Examples of com.box.boxjavalibv2.BoxConnectionManagerBuilder$BoxConnectionManager


        LOG.debug("getFolder: " + result);
    }

    @Test
    public void testGetFolderCollaborations() throws Exception {
        final BoxFolder testFolder = createFolder();

        try {
            final Map<String, Object> headers = new HashMap<String, Object>();
            // parameter type is String
            headers.put("CamelBox.folderId", testFolder.getId());
            // parameter type is com.box.restclientv2.requestsbase.BoxDefaultRequestObject
//            headers.put("CamelBox.defaultRequest", null);

            List result = requestBodyAndHeaders("direct://GETFOLDERCOLLABORATIONS", null, headers);
            assertNotNull("getFolderCollaborations result", result);
            LOG.debug("getFolderCollaborations: " + result);
        } finally {
            deleteFolder(testFolder.getId());
        }
    }
View Full Code Here


    }

    @Test
    public void testUpdateFolderInfo() throws Exception {
        // create test folder
        final BoxFolder testFolder = createFolder();

        try {

            final Map<String, Object> headers = new HashMap<String, Object>();
            // parameter type is String
            headers.put("CamelBox.folderId", testFolder.getId());
            // parameter type is com.box.boxjavalibv2.requests.requestobjects.BoxFolderRequestObject
            final BoxFolderRequestObject folderRequestObject = BoxFolderRequestObject.getRequestObject();
            folderRequestObject.setTags(new String[]{CAMEL_TEST_TAG});
            folderRequestObject.setName(CAMEL_TEST_COPY_FOLDER);
            headers.put("CamelBox.folderRequest", folderRequestObject);

            BoxFolder result = requestBodyAndHeaders("direct://UPDATEFOLDERINFO", null, headers);
            assertNotNull("updateFolderInfo result", result);
            assertEquals("updateFolderInfo folder name", CAMEL_TEST_COPY_FOLDER, result.getName());
//            assertEquals("updateFolderInfo result", "["+ CAMEL_TEST_TAG + "]", Arrays.toString(result.getTags()));
            LOG.debug("updateFolderInfo: " + result);
        } finally {
            deleteFolder(testFolder.getId());
        }
View Full Code Here

    private static final String CAMEL_TEST_GROUP = "CamelTestGroup";

    public BoxGroup createGroup() throws Exception {
        // using com.box.boxjavalibv2.requests.requestobjects.BoxGroupRequestObject message body for single parameter "groupRequest"
        final BoxGroupRequestObject requestObject = BoxGroupRequestObject.createGroupRequestObject(CAMEL_TEST_GROUP);
        BoxGroup result = requestBody("direct://CREATEGROUP", requestObject);

        assertNotNull("createGroup result", result);
        return result;
    }
View Full Code Here

    }

    @Test
    public void testCreateGroup1() throws Exception {
        // using String message body for single parameter "name"
        BoxGroup result = requestBody("direct://CREATEGROUP_1", CAMEL_TEST_GROUP);

        assertNotNull("createGroup result", result);
        LOG.debug("createGroup: " + result);

        deleteGroup(result.getId());
    }
View Full Code Here

        return result;
    }

    @Test
    public void testCreateMembership1() throws Exception {
        final BoxGroup group = createGroup();

        try {
            final Map<String, Object> headers = new HashMap<String, Object>();
            // parameter type is String
            headers.put("CamelBox.groupId", group.getId());
            // parameter type is String
            headers.put("CamelBox.userId", testUserId);
            // parameter type is String
            headers.put("CamelBox.role", BoxGroupMembership.ROLE_MEMBER);

            BoxGroupMembership result = requestBodyAndHeaders("direct://CREATEMEMBERSHIP_1", null, headers);

            assertNotNull("createMembership result", result);
            LOG.debug("createMembership: " + result);
        } finally {
            deleteGroup(group.getId());
        }
    }
View Full Code Here

        requestBodyAndHeaders("direct://DELETEGROUP", null, headers);
    }

    @Test
    public void testDeleteMembership() throws Exception {
        final BoxGroup group = createGroup();

        try {
            final BoxGroupMembership membership = createMembership(group.getId());

            final Map<String, Object> headers = new HashMap<String, Object>();
            // parameter type is String
            headers.put("CamelBox.membershipId", membership.getId());
            // parameter type is com.box.restclientv2.requestsbase.BoxDefaultRequestObject
//            headers.put("CamelBox.defaultRequest", null);
            requestBodyAndHeaders("direct://DELETEMEMBERSHIP", null, headers);
        } finally {
            deleteGroup(group.getId());
        }
    }
View Full Code Here

        }
    }

    @Test
    public void testGetAllCollaborations() throws Exception {
        final BoxGroup group = createGroup();
        try {
            final Map<String, Object> headers = new HashMap<String, Object>();
            // parameter type is String
            headers.put("CamelBox.groupId", group.getId());
            // parameter type is com.box.restclientv2.requestsbase.BoxDefaultRequestObject
//            headers.put("CamelBox.defaultRequest", null);

            BoxCollection result = requestBodyAndHeaders("direct://GETALLCOLLABORATIONS", null, headers);

            assertNotNull("getAllCollaborations result", result);
            LOG.debug("getAllCollaborations: " + result);
        } finally {
            deleteGroup(group.getId());
        }
    }
View Full Code Here

        LOG.debug("getAllGroups: " + result);
    }

    @Test
    public void testGetMembership() throws Exception {
        final BoxGroup group = createGroup();

        try {
            final BoxGroupMembership membership = createMembership(group.getId());

            final Map<String, Object> headers = new HashMap<String, Object>();
            // parameter type is String
            headers.put("CamelBox.membershipId", membership.getId());
            // parameter type is com.box.restclientv2.requestsbase.BoxDefaultRequestObject
//            headers.put("CamelBox.defaultRequest", null);

            BoxGroupMembership result = requestBodyAndHeaders("direct://GETMEMBERSHIP", null, headers);

            assertNotNull("getMembership result", result);
            LOG.debug("getMembership: " + result);
        } finally {
            deleteGroup(group.getId());
        }
    }
View Full Code Here

        }
    }

    @Test
    public void testGetMemberships() throws Exception {
        final BoxGroup group = createGroup();

        try {
            final Map<String, Object> headers = new HashMap<String, Object>();
            // parameter type is String
            headers.put("CamelBox.groupId", group.getId());
            // parameter type is com.box.restclientv2.requestsbase.BoxDefaultRequestObject
            headers.put("CamelBox.defaultRequest", null);

            BoxCollection result = requestBodyAndHeaders("direct://GETMEMBERSHIPS", null, headers);

            assertNotNull("getMemberships result", result);
            LOG.debug("getMemberships: " + result);
        } finally {
            deleteGroup(group.getId());
        }
    }
View Full Code Here

        }
    }

    @Test
    public void testUpdateGroup() throws Exception {
        final BoxGroup group = createGroup();

        try {
            final Map<String, Object> headers = new HashMap<String, Object>();
            // parameter type is String
            headers.put("CamelBox.groupId", group.getId());
            // parameter type is com.box.boxjavalibv2.requests.requestobjects.BoxGroupRequestObject
            final BoxGroupRequestObject requestObject =
                    BoxGroupRequestObject.updateGroupRequestObject(CAMEL_TEST_GROUP + "_Updated");
            headers.put("CamelBox.groupRequest", requestObject);

            BoxGroup result = requestBodyAndHeaders("direct://UPDATEGROUP", null, headers);

            assertNotNull("updateGroup result", result);
            LOG.debug("updateGroup: " + result);
        } finally {
            deleteGroup(group.getId());
View Full Code Here

TOP

Related Classes of com.box.boxjavalibv2.BoxConnectionManagerBuilder$BoxConnectionManager

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.