Search in sources :

Example 1 with DocumentCollectionManager

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);
}
Also used : DocumentCollectionManager(org.jnosql.diana.api.document.DocumentCollectionManager) Test(org.junit.jupiter.api.Test)

Example 2 with DocumentCollectionManager

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);
}
Also used : DocumentCollectionManager(org.jnosql.diana.api.document.DocumentCollectionManager) Test(org.junit.jupiter.api.Test)

Example 3 with DocumentCollectionManager

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);
}
Also used : DocumentCollectionManager(org.jnosql.diana.api.document.DocumentCollectionManager) DocumentTemplateProducer(org.jnosql.artemis.document.DocumentTemplateProducer)

Example 4 with DocumentCollectionManager

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);
}
Also used : DocumentCollectionManager(org.jnosql.diana.api.document.DocumentCollectionManager) Test(org.junit.jupiter.api.Test)

Example 5 with DocumentCollectionManager

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;
}
Also used : DocumentQuery(org.jnosql.diana.api.document.DocumentQuery) DocumentEntity(org.jnosql.diana.api.document.DocumentEntity) DocumentCollectionManager(org.jnosql.diana.api.document.DocumentCollectionManager) Produces(javax.enterprise.inject.Produces)

Aggregations

DocumentCollectionManager (org.jnosql.diana.api.document.DocumentCollectionManager)7 Produces (javax.enterprise.inject.Produces)3 DocumentEntity (org.jnosql.diana.api.document.DocumentEntity)3 Test (org.junit.jupiter.api.Test)3 DocumentTemplateProducer (org.jnosql.artemis.document.DocumentTemplateProducer)1 DocumentQuery (org.jnosql.diana.api.document.DocumentQuery)1