use of org.jnosql.diana.api.document.DocumentCollectionManager in project jnosql-artemis by eclipse.
the class MockProducer method getDocumentCollectionManager.
@Produces
public DocumentCollectionManager getDocumentCollectionManager() {
DocumentEntity entity = DocumentEntity.of("Person");
entity.add(Document.of("name", "Default"));
entity.add(Document.of("age", 10));
DocumentCollectionManager manager = mock(DocumentCollectionManager.class);
when(manager.insert(Mockito.any(DocumentEntity.class))).thenReturn(entity);
return manager;
}
use of org.jnosql.diana.api.document.DocumentCollectionManager in project jnosql-artemis by eclipse.
the class ManagerProducerProducer method getDocumentCollectionManager.
@Produces
public DocumentCollectionManager getDocumentCollectionManager() {
DocumentCollectionManager collectionManager = Mockito.mock(DocumentCollectionManager.class);
DocumentEntity entity = DocumentEntity.of("person");
entity.add(Document.of("name", "Ada"));
entity.add(Document.of("age", 10));
entity.add(Document.of("salary", BigDecimal.TEN));
entity.add(Document.of("phones", singletonList("22342342")));
when(collectionManager.insert(Mockito.any(DocumentEntity.class))).thenReturn(entity);
when(collectionManager.update(Mockito.any(DocumentEntity.class))).thenReturn(entity);
return collectionManager;
}
Aggregations