use of com.ibm.cloud.cloudant.v1.model.HeadDesignDocumentOptions in project cloudant-java-sdk by IBM.
the class CloudantTest method testHeadDesignDocumentWOptions.
@Test
public void testHeadDesignDocumentWOptions() throws Throwable {
// Schedule some responses.
String mockResponseBody = "";
String headDesignDocumentPath = "/testString/_design/testString";
server.enqueue(new MockResponse().setResponseCode(200).setBody(mockResponseBody));
constructClientService();
// Construct an instance of the HeadDesignDocumentOptions model
HeadDesignDocumentOptions headDesignDocumentOptionsModel = new HeadDesignDocumentOptions.Builder().db("testString").ddoc("testString").ifNoneMatch("testString").build();
// Invoke operation with valid options model (positive test)
Response<Void> response = cloudantService.headDesignDocument(headDesignDocumentOptionsModel).execute();
assertNotNull(response);
Void responseObj = response.getResult();
// Response does not have a return type. Check that the result is null.
assertNull(responseObj);
// Verify the contents of the request
RecordedRequest request = server.takeRequest();
assertNotNull(request);
assertEquals(request.getMethod(), "HEAD");
// Check query
Map<String, String> query = TestUtilities.parseQueryString(request);
assertNull(query);
// Check request path
String parsedPath = TestUtilities.parseReqPath(request);
assertEquals(parsedPath, headDesignDocumentPath);
}
use of com.ibm.cloud.cloudant.v1.model.HeadDesignDocumentOptions in project cloudant-java-sdk by IBM.
the class HeadDesignDocumentOptionsTest method testHeadDesignDocumentOptions.
@Test
public void testHeadDesignDocumentOptions() throws Throwable {
HeadDesignDocumentOptions headDesignDocumentOptionsModel = new HeadDesignDocumentOptions.Builder().db("testString").ddoc("testString").ifNoneMatch("testString").build();
assertEquals(headDesignDocumentOptionsModel.db(), "testString");
assertEquals(headDesignDocumentOptionsModel.ddoc(), "testString");
assertEquals(headDesignDocumentOptionsModel.ifNoneMatch(), "testString");
}
Aggregations