Search in sources :

Example 1 with MandrillRequestWithQuery

use of com.cribbstechnologies.clients.mandrill.model.MandrillRequestWithQuery in project Java-Mandrill-Wrapper by cribbstechnologies.

the class UrlsTest method testQuery.

@Test
public void testQuery() {
    MandrillRequestWithQuery request = new MandrillRequestWithQuery();
    request.setQ("http://www.google.com");
    try {
        UrlListResponse response = urlsRequest.doSearch(request);
    } catch (RequestFailedException e) {
        e.printStackTrace();
        fail(e.getMessage());
    }
}
Also used : MandrillRequestWithQuery(com.cribbstechnologies.clients.mandrill.model.MandrillRequestWithQuery) RequestFailedException(com.cribbstechnologies.clients.mandrill.exception.RequestFailedException) UrlListResponse(com.cribbstechnologies.clients.mandrill.model.response.urls.UrlListResponse) Test(org.junit.Test)

Example 2 with MandrillRequestWithQuery

use of com.cribbstechnologies.clients.mandrill.model.MandrillRequestWithQuery in project Java-Mandrill-Wrapper by cribbstechnologies.

the class MandrillRESTRequestTest method testGetPostDataMandrillRequestWithQuery.

@Test
public void testGetPostDataMandrillRequestWithQuery() throws Exception {
    this.initRequestWithActualMapper();
    assertEquals("{\"key\":null,\"q\":null}", this.request.getPostData(this.emptyQueryRequest));
    this.mutableQueryRequest = new MandrillRequestWithQuery();
    this.mutableQueryRequest.setKey("7890");
    this.mutableQueryRequest.setQ("query string");
    assertEquals("{\"key\":\"7890\",\"q\":\"query string\"}", this.request.getPostData(this.mutableQueryRequest));
}
Also used : MandrillRequestWithQuery(com.cribbstechnologies.clients.mandrill.model.MandrillRequestWithQuery) Test(org.junit.Test)

Aggregations

MandrillRequestWithQuery (com.cribbstechnologies.clients.mandrill.model.MandrillRequestWithQuery)2 Test (org.junit.Test)2 RequestFailedException (com.cribbstechnologies.clients.mandrill.exception.RequestFailedException)1 UrlListResponse (com.cribbstechnologies.clients.mandrill.model.response.urls.UrlListResponse)1