Search in sources :

Example 1 with ChangesResult

use of com.cloudant.client.api.model.ChangesResult in project java-cloudant by cloudant.

the class ChangeNotificationsTest method changes_normalFeed.

@Test
public void changes_normalFeed() {
    db.save(new Foo());
    ChangesResult changes = db.changes().includeDocs(true).limit(1).getChanges();
    List<ChangesResult.Row> rows = changes.getResults();
    for (Row row : rows) {
        List<ChangesResult.Row.Rev> revs = row.getChanges();
        String docId = row.getId();
        JsonObject doc = row.getDoc();
        assertNotNull(revs);
        assertNotNull(docId);
        assertNotNull(doc);
    }
    assertThat(rows.size(), is(1));
}
Also used : JsonObject(com.google.gson.JsonObject) ChangesResult(com.cloudant.client.api.model.ChangesResult) Row(com.cloudant.client.api.model.ChangesResult.Row) Test(org.junit.jupiter.api.Test)

Aggregations

ChangesResult (com.cloudant.client.api.model.ChangesResult)1 Row (com.cloudant.client.api.model.ChangesResult.Row)1 JsonObject (com.google.gson.JsonObject)1 Test (org.junit.jupiter.api.Test)1