use of org.jnosql.diana.api.document.DocumentCollectionManager in project jnosql-diana-driver by eclipse.
the class OrientDBDocumentCollectionManagerFactoryTest method shouldCreateEntityManager.
@Test
public void shouldCreateEntityManager() {
DocumentCollectionManager database = managerFactory.get("database");
assertNotNull(database);
}
use of org.jnosql.diana.api.document.DocumentCollectionManager in project jnosql-artemis by eclipse.
the class DefaultDocumentTemplateProducerTest method shouldReturn.
@Test
public void shouldReturn() {
DocumentCollectionManager manager = Mockito.mock(DocumentCollectionManager.class);
DocumentTemplate documentTemplate = producer.get(manager);
assertNotNull(documentTemplate);
}
use of org.jnosql.diana.api.document.DocumentCollectionManager in project jnosql-artemis by eclipse.
the class DocumentTemplateBean method create.
@Override
public DocumentTemplate create(CreationalContext<DocumentTemplate> creationalContext) {
DocumentTemplateProducer producer = getInstance(DocumentTemplateProducer.class);
DocumentCollectionManager manager = getManager();
return producer.get(manager);
}
use of org.jnosql.diana.api.document.DocumentCollectionManager in project jnosql-diana-driver by eclipse.
the class ArangoDBDocumentCollectionManagerFactoryTest method shouldCreateEntityManager.
@Test
public void shouldCreateEntityManager() {
DocumentCollectionManager database = managerFactory.get("database");
assertNotNull(database);
}
use of org.jnosql.diana.api.document.DocumentCollectionManager in project jnosql-artemis by eclipse.
the class MockProducer method getDocumentCollectionManagerMock.
@Produces
@Database(value = DatabaseType.DOCUMENT, provider = "documentRepositoryMock")
public DocumentCollectionManager getDocumentCollectionManagerMock() {
DocumentEntity entity = DocumentEntity.of("Person");
entity.add(Document.of("name", "documentRepositoryMock"));
entity.add(Document.of("age", 10));
DocumentCollectionManager manager = mock(DocumentCollectionManager.class);
when(manager.insert(Mockito.any(DocumentEntity.class))).thenReturn(entity);
when(manager.singleResult(Mockito.any(DocumentQuery.class))).thenReturn(Optional.empty());
return manager;
}
Aggregations