use of com.cloudant.client.api.model.Response in project java-cloudant by cloudant.
the class DocumentsCRUDTest method saveWithIdContainSlash.
@Test
public void saveWithIdContainSlash() {
String idWithSlash = "a/b/" + generateUUID();
Response response = db.save(new Foo(idWithSlash));
assertEquals(idWithSlash, response.getId());
}
use of com.cloudant.client.api.model.Response in project java-cloudant by cloudant.
the class DocumentsCRUDTest method findWithParams.
@Test
public void findWithParams() {
Response response = db.save(new Foo());
Foo foo = db.find(Foo.class, response.getId(), new Params().revsInfo());
assertNotNull(foo);
}
use of com.cloudant.client.api.model.Response in project java-cloudant by cloudant.
the class DocumentsCRUDTest method saveObjectPost.
@Test
public void saveObjectPost() {
// database generated id will be assigned
Response response = db.post(new Foo());
assertNotNull(response.getId());
}
use of com.cloudant.client.api.model.Response in project java-cloudant by cloudant.
the class DocumentsCRUDTest method deleteByIdContainSlash.
@Test
public void deleteByIdContainSlash() {
String idWithSlash = "a/" + generateUUID();
Response response = db.save(new Bar(idWithSlash));
Response responseRemove = db.remove(response.getId(), response.getRev());
assertEquals(idWithSlash, responseRemove.getId());
}
use of com.cloudant.client.api.model.Response in project java-cloudant by cloudant.
the class DocumentsCRUDTest method findInputstream.
@Test
public void findInputstream() throws IOException {
Response response = db.save(new Foo());
InputStream inputStream = db.find(response.getId());
assertTrue(inputStream.read() != -1);
inputStream.close();
}
Aggregations