Search in sources :

Example 16 with DocumentCollectionManager

use of jakarta.nosql.document.DocumentCollectionManager in project jnosql-diana by eclipse.

the class DefaultSelectQueryBuilderTest method shouldExecuteManager.

@Test
public void shouldExecuteManager() {
    DocumentCollectionManager manager = Mockito.mock(DocumentCollectionManager.class);
    ArgumentCaptor<DocumentQuery> queryCaptor = ArgumentCaptor.forClass(DocumentQuery.class);
    String collection = "collection";
    Stream<DocumentEntity> entities = select().from(collection).getResult(manager);
    Mockito.verify(manager).select(queryCaptor.capture());
    checkQuery(queryCaptor, collection);
}
Also used : DocumentQuery(jakarta.nosql.document.DocumentQuery) DocumentEntity(jakarta.nosql.document.DocumentEntity) DocumentCollectionManager(jakarta.nosql.document.DocumentCollectionManager) Test(org.junit.jupiter.api.Test)

Example 17 with DocumentCollectionManager

use of jakarta.nosql.document.DocumentCollectionManager in project jnosql-diana by eclipse.

the class ReactiveTemplateBean method create.

@Override
public ReactiveDocumentTemplate create(CreationalContext<ReactiveDocumentTemplate> context) {
    DocumentTemplateProducer producer = getInstance(DocumentTemplateProducer.class);
    DocumentCollectionManager manager = getManager();
    return producer.get(manager);
}
Also used : DocumentCollectionManager(jakarta.nosql.document.DocumentCollectionManager) DocumentTemplateProducer(jakarta.nosql.mapping.document.DocumentTemplateProducer)

Aggregations

DocumentCollectionManager (jakarta.nosql.document.DocumentCollectionManager)17 DocumentEntity (jakarta.nosql.document.DocumentEntity)8 Test (org.junit.jupiter.api.Test)8 Produces (javax.enterprise.inject.Produces)5 DocumentQuery (jakarta.nosql.document.DocumentQuery)4 DocumentTemplateProducer (jakarta.nosql.mapping.document.DocumentTemplateProducer)3 Database (jakarta.nosql.mapping.Database)2 Document (jakarta.nosql.document.Document)1 DocumentDeleteQuery (jakarta.nosql.document.DocumentDeleteQuery)1 Pagination (jakarta.nosql.mapping.Pagination)1 DocumentEventPersistManager (jakarta.nosql.mapping.document.DocumentEventPersistManager)1 DocumentQueryPagination (jakarta.nosql.mapping.document.DocumentQueryPagination)1 DocumentTemplate (jakarta.nosql.mapping.document.DocumentTemplate)1 PersonRepository (jakarta.nosql.tck.entities.PersonRepository)1 DocumentCollectionManagerMock (org.eclipse.jnosql.mapping.document.configuration.DocumentConfigurationMock.DocumentCollectionManagerMock)1 Config (org.eclipse.microprofile.config.Config)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1