Search in sources :

Example 1 with ColumnFamilyManager

use of jakarta.nosql.column.ColumnFamilyManager in project jnosql-diana by eclipse.

the class DefaultSelectQueryBuilderTest method shouldExecuteSingleResultManager.

@Test
public void shouldExecuteSingleResultManager() {
    ColumnFamilyManager manager = Mockito.mock(ColumnFamilyManager.class);
    ArgumentCaptor<ColumnQuery> queryCaptor = ArgumentCaptor.forClass(ColumnQuery.class);
    String columnFamily = "columnFamily";
    Optional<ColumnEntity> entities = select().from(columnFamily).getSingleResult(manager);
    Mockito.verify(manager).singleResult(queryCaptor.capture());
    checkQuery(queryCaptor, columnFamily);
}
Also used : ColumnQuery(jakarta.nosql.column.ColumnQuery) ColumnEntity(jakarta.nosql.column.ColumnEntity) ColumnFamilyManager(jakarta.nosql.column.ColumnFamilyManager) Test(org.junit.jupiter.api.Test)

Example 2 with ColumnFamilyManager

use of jakarta.nosql.column.ColumnFamilyManager in project jnosql-diana by eclipse.

the class DefaultColumnRepositoryProducerTest method shouldCreateFromManager.

@Test
public void shouldCreateFromManager() {
    ColumnFamilyManager manager = Mockito.mock(ColumnFamilyManager.class);
    PersonRepository personRepository = producer.get(PersonRepository.class, manager);
    assertNotNull(personRepository);
}
Also used : ColumnFamilyManager(jakarta.nosql.column.ColumnFamilyManager) PersonRepository(jakarta.nosql.tck.entities.PersonRepository) Test(org.junit.jupiter.api.Test)

Example 3 with ColumnFamilyManager

use of jakarta.nosql.column.ColumnFamilyManager in project jnosql-diana by eclipse.

the class MockProducer method getColumnFamilyManager.

@Produces
public ColumnFamilyManager getColumnFamilyManager() {
    ColumnEntity entity = ColumnEntity.of("Person");
    entity.add(Column.of("name", "Default"));
    entity.add(Column.of("age", 10));
    ColumnFamilyManager manager = mock(ColumnFamilyManager.class);
    when(manager.insert(Mockito.any(ColumnEntity.class))).thenReturn(entity);
    return manager;
}
Also used : ColumnEntity(jakarta.nosql.column.ColumnEntity) ColumnFamilyManager(jakarta.nosql.column.ColumnFamilyManager) Produces(javax.enterprise.inject.Produces)

Example 4 with ColumnFamilyManager

use of jakarta.nosql.column.ColumnFamilyManager in project jnosql-diana by eclipse.

the class MockProducer method getColumnFamilyManager.

@Produces
public ColumnFamilyManager getColumnFamilyManager() {
    ColumnEntity entity = ColumnEntity.of("Person");
    entity.add(Column.of("name", "Default"));
    entity.add(Column.of("age", 10));
    ColumnFamilyManager manager = mock(ColumnFamilyManager.class);
    when(manager.insert(Mockito.any(ColumnEntity.class))).thenReturn(entity);
    return manager;
}
Also used : ColumnEntity(jakarta.nosql.column.ColumnEntity) ColumnFamilyManager(jakarta.nosql.column.ColumnFamilyManager) Produces(javax.enterprise.inject.Produces)

Example 5 with ColumnFamilyManager

use of jakarta.nosql.column.ColumnFamilyManager in project jnosql-diana by eclipse.

the class DefaultColumnTemplateProducerTest method shouldReturn.

@Test
public void shouldReturn() {
    ColumnFamilyManager manager = Mockito.mock(ColumnFamilyManager.class);
    ColumnTemplate columnTemplate = producer.get(manager);
    assertNotNull(columnTemplate);
}
Also used : ColumnFamilyManager(jakarta.nosql.column.ColumnFamilyManager) ColumnTemplate(jakarta.nosql.mapping.column.ColumnTemplate) Test(org.junit.jupiter.api.Test)

Aggregations

ColumnFamilyManager (jakarta.nosql.column.ColumnFamilyManager)16 ColumnEntity (jakarta.nosql.column.ColumnEntity)8 Test (org.junit.jupiter.api.Test)7 Produces (javax.enterprise.inject.Produces)5 ColumnTemplateProducer (jakarta.nosql.mapping.column.ColumnTemplateProducer)3 ColumnQuery (jakarta.nosql.column.ColumnQuery)2 Database (jakarta.nosql.mapping.Database)2 Column (jakarta.nosql.column.Column)1 ColumnDeleteQuery (jakarta.nosql.column.ColumnDeleteQuery)1 Pagination (jakarta.nosql.mapping.Pagination)1 ColumnEventPersistManager (jakarta.nosql.mapping.column.ColumnEventPersistManager)1 ColumnQueryPagination (jakarta.nosql.mapping.column.ColumnQueryPagination)1 ColumnTemplate (jakarta.nosql.mapping.column.ColumnTemplate)1 PersonRepository (jakarta.nosql.tck.entities.PersonRepository)1 Config (org.eclipse.microprofile.config.Config)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1