Examples of BoxCollabRequestObject


Examples of com.box.boxjavalibv2.requests.requestobjects.BoxCollabRequestObject

    private BoxCollaboration createCollaboration() throws InterruptedException {
        final Map<String, Object> headers = new HashMap<String, Object>();
        // parameter type is String
        headers.put("CamelBox.folderId", testFolderId);
        // parameter type is com.box.boxjavalibv2.requests.requestobjects.BoxCollabRequestObject
        final BoxCollabRequestObject collabObject = BoxCollabRequestObject.createCollabObject(testFolderId, null,
                "camel.test@localhost.com", BoxCollaborationRole.VIEWER);
        headers.put("CamelBox.collabRequest", collabObject);

        BoxCollaboration result = requestBodyAndHeaders("direct://CREATECOLLABORATION",
                null, headers);
View Full Code Here

Examples of com.box.boxjavalibv2.requests.requestobjects.BoxCollabRequestObject

        try {
            final Map<String, Object> headers = new HashMap<String, Object>();
            // parameter type is String
            headers.put("CamelBox.collabId", collaboration.getId());
            // parameter type is com.box.boxjavalibv2.requests.requestobjects.BoxCollabRequestObject
            final BoxCollabRequestObject requestObject = BoxCollabRequestObject.updateCollabObjects(
                    BoxCollaborationRole.EDITOR);
            headers.put("CamelBox.collabRequest", requestObject);

            BoxCollaboration result = requestBodyAndHeaders("direct://UPDATECOLLABORATION", null, headers);
            assertNotNull("updateCollaboration result", result);
View Full Code Here

Examples of com.box.boxjavalibv2.requests.requestobjects.BoxCollabRequestObject

        String folderId = "testfolderid123";
        String userId = "testuserid456";
        String login = "abc@box.com";
        String role = "testrole789";

        BoxCollabRequestObject obj = BoxCollabRequestObject.createCollabObject(folderId, userId, login, role);

        // String jsonStr = obj.getJSONEntity().toJSONString(new BoxJSONParser(new BoxResourceHub()));
        MapJSONStringEntity item = (MapJSONStringEntity) obj.getFromEntity(ITEM_STR);
        Assert.assertEquals(folderId, item.get(BoxFolder.FIELD_ID));
        Assert.assertEquals(BoxResourceType.FOLDER.toString(), item.get(BoxFolder.FIELD_TYPE));

        MapJSONStringEntity accessible = (MapJSONStringEntity) obj.getFromEntity(ACCESSIBLE_STR);
        Assert.assertEquals(userId, accessible.get(BoxUser.FIELD_ID));
        Assert.assertEquals(login, accessible.get(BoxUser.FIELD_LOGIN));

        Assert.assertEquals(role, obj.getFromEntity(ROLE_STR));
    }
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.