@Test @SuppressWarnings("unchecked") public void checkToDocument_correct() throws CouchbaseLiteException { Document document = PowerMockito.mock(Document.class); Person person = new Person("Pepe", 23); CouchbaseLiteOrm orm = new CouchbaseLiteOrmInternal(); Document document1 = orm.toDocument(person, document); final Map<String, Object> properties = new HashMap<>(); properties.put("type", "person"); properties.put("name", "Pepe"); properties.put("age", 23); ArgumentCaptor<Map> argumentCaptor = ArgumentCaptor.forClass(Map.class); verify(document).putProperties(argumentCaptor.capture()); ASSERT.that(argumentCaptor.getValue()).isEqualTo(properties); ASSERT.that(document1).isSameAs(document); }
public <T> Document toDocument(T object, Document document) throws CouchbaseLiteException { Map<String, Object> properties = toProperties(object); document.putProperties(properties); return document; }
CouchbaseLiteOrm { public <T> Document toDocument(T object, Document document) throws CouchbaseLiteException { Map<String, Object> properties = toProperties(object); document.putProperties(properties); return document; } }
CouchbaseLiteOrm { public <T> Document toDocument(T object, Document document) throws CouchbaseLiteException { Map<String, Object> properties = toProperties(object); document.putProperties(properties); return document; } CouchbaseLiteOrm(); }
CouchbaseLiteOrm { public <T> Document toDocument(T object, Document document) throws CouchbaseLiteException { Map<String, Object> properties = toProperties(object); document.putProperties(properties); return document; } CouchbaseLiteOrm(); static CouchbaseLiteOrm newInstance(); T toObject(Document document); Document toDocument(T object, Document document); Map<String, Object> toProperties(T object); }
CouchbaseLiteOrm { public <T> Document toDocument(T object, Document document) throws CouchbaseLiteException { Map<String, Object> properties = toProperties(object); document.putProperties(properties); return document; } CouchbaseLiteOrm(); static CouchbaseLiteOrm newInstance(); T toObject(Document document); Document toDocument(T object, Document document); Map<String, Object> toProperties(T object);  }