Package com.bluetangstudio.searchcloud.client.request

Examples of com.bluetangstudio.searchcloud.client.request.ListDocumentsRequest


    @Test
    public void testListDocuments() throws IOException, ServiceException {

        RestSearchCloudClient client = buildMockRestSearchCloudClient();
        String modelId = "test_ListDocuments";
        client.listDocuments(new ListDocumentsRequest(modelId, 0, 10));

    }
View Full Code Here


        int count = 10;

        RestSearchCloudClient client = new RestSearchCloudClient(new DefaultHttpClientFactory(), getUri(), "apikey");
        String modelId = "test_ListDocuments";

        List<Document> documents = client.listDocuments(new ListDocumentsRequest(modelId, start, count));

        Assert.assertNotNull(documents);
        Assert.assertEquals(documents.size(), count);

    }
View Full Code Here

    /** {@inheritDoc} */
    @Override
    public final List<T> listDocuments(String modelId, int start, int count) throws IOException,
            ServiceException {
        return listDocuments(new ListDocumentsRequest(modelId, start, count));
    }
View Full Code Here

*/
public class ListDocumentsRequestBuilderTest extends RequestBuilderTestBase {

    @Test
    public void buildHttpUriRequest() {
        ListDocumentsRequest list = new ListDocumentsRequest("ListDocumentsRequestBuilderTest", 1, 10);
        setTrackingVariables(list);
        list.setFields("fields");


        ListDocumentsRequestBuilder builder = new ListDocumentsRequestBuilder();
        HttpUriRequest httpUriRequest = builder.build(list);

        Assert.assertEquals(httpUriRequest.getClass(), HttpGet.class);
        Assert.assertEquals(httpUriRequest.getURI().getPath(),
                "/rest/1.0/model/ListDocumentsRequestBuilderTest/list/1/10");
        Map<String, String> params = parseQueryParams(httpUriRequest);

        assertContainsTrackingVariables(params);
        Assert.assertEquals(params.get("fl"), list.getFields());
    }
View Full Code Here

TOP

Related Classes of com.bluetangstudio.searchcloud.client.request.ListDocumentsRequest

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.