Examples of BoxDefaultRequestObject


Examples of com.box.restclientv2.requestsbase.BoxDefaultRequestObject

    @Test
    public void testRequestIsWellFormed() throws BoxRestException, IllegalStateException, IOException, AuthFatalFailureException {
        String folderId = "testfolderid123";

        GetFolderCollaborationsRequest request = new GetFolderCollaborationsRequest(CONFIG, JSON_PARSER, folderId, new BoxDefaultRequestObject());
        testRequestIsWellFormed(request, TestUtils.getConfig().getApiUrlAuthority(),
            TestUtils.getConfig().getApiUrlPath().concat(GetFolderCollaborationsRequest.getUri(folderId)), HttpStatus.SC_OK, RestMethod.GET);
    }
View Full Code Here

Examples of com.box.restclientv2.requestsbase.BoxDefaultRequestObject

    @Test
    public void testRequestIsWellFormed() throws BoxRestException, AuthFatalFailureException {
        String id = "testid123";
        String sha1 = "testsha1456";
        BoxDefaultRequestObject obj = new BoxDefaultRequestObject();
        obj.getRequestExtras().setIfMatch(sha1);
        DeleteFileRequest request = new DeleteFileRequest(CONFIG, JSON_PARSER, id, obj);
        testRequestIsWellFormed(request, TestUtils.getConfig().getApiUrlAuthority(),
            TestUtils.getConfig().getApiUrlPath().concat(DeleteFileRequest.getUri(id)), HttpStatus.SC_NO_CONTENT, RestMethod.DELETE);

        Header header = request.getRawRequest().getFirstHeader(Constants.IF_MATCH);
View Full Code Here

Examples of com.box.restclientv2.requestsbase.BoxDefaultRequestObject

    public void testRequestIsWellFormed() throws BoxRestException, IllegalStateException, IOException, AuthFatalFailureException {
        int limit = 100;
        int offset = 200;
        String filterTerm = "testfilterterm";
        GetAllUsersInEnterpriseRequest request = new GetAllUsersInEnterpriseRequest(CONFIG, JSON_PARSER,
            (new BoxDefaultRequestObject()).setPage(limit, offset), filterTerm);

        testRequestIsWellFormed(request, TestUtils.getConfig().getApiUrlAuthority(),
            TestUtils.getConfig().getApiUrlPath().concat(GetAllUsersInEnterpriseRequest.getUri()), HttpStatus.SC_OK, RestMethod.GET);
        Assert.assertEquals(Integer.toString(limit), request.getQueryParams().get("limit"));
        Assert.assertEquals(Integer.toString(offset), request.getQueryParams().get("offset"));
View Full Code Here

Examples of com.box.restclientv2.requestsbase.BoxDefaultRequestObject

        Assert.assertEquals(filterTerm, request.getQueryParams().get("filter_term"));
    }

    @Test
    public void testRequestDoesNotHaveFilterTermIfNotSupplied() throws BoxRestException {
        GetAllUsersInEnterpriseRequest request = new GetAllUsersInEnterpriseRequest(CONFIG, JSON_PARSER, (new BoxDefaultRequestObject()).setPage(1, 2), null);
        Assert.assertFalse(request.getQueryParams().containsKey("filter_term"));

    }
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.