Package com.bluetangstudio.searchcloud.client.request

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


            URI.create("http://localhost:" + port), "apikey"
        );

        UserModelId modelId = new UserModelId(new UserId("test"), "testGetDocument");
        DocumentId docId = new DocumentId(10);
        Document document = client.getDocument(new GetDocumentRequest(modelId, docId));

        Assert.assertNotNull(document);
        Assert.assertEquals(document.getId(), docId);
    }
View Full Code Here


*/
public class GetDocumentRequestBuilderTest extends RequestBuilderTestBase {

    @Test
    public void buildHttpUriRequest() {
        GetDocumentRequest get = new GetDocumentRequest("GetDocumentRequestBuilderTest", 1);
        setTrackingVariables(get);
        get.setFields("fields");

        GetDocumentRequestBuilder builder = new GetDocumentRequestBuilder();
        HttpUriRequest httpUriRequest = builder.build(get);

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

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

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

        RestSearchCloudClient client = buildMockRestSearchCloudClient();
        String modelId = "test_GetDocument";
        client.getDocument(new GetDocumentRequest(modelId, 10));

    }
View Full Code Here

    }

    /** {@inheritDoc} */
    @Override
    public final T getDocument(String modelId, int documentId) throws IOException, ServiceException {
        return getDocument(new GetDocumentRequest(modelId, documentId));
    }
View Full Code Here

    public void testGetDocument() throws IOException, ServiceException {

        RestSearchCloudClient<Document> client = new RestSearchCloudClient<Document>(new DefaultHttpClientFactory(), getUri(), "apikey");

        String modelId = "test_GetDocument";
        Document document = client.getDocument(new GetDocumentRequest(modelId, 10));

        Assert.assertNotNull(document);
        Assert.assertEquals(document.getId(), new Integer(10));
    }
View Full Code Here

TOP

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

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.