use of jakarta.nosql.column.ColumnFamilyManager in project jnosql-diana by eclipse.
the class ColumnTemplateConverter method success.
@Override
public ColumnTemplate success(String value) {
Config config = BeanManagers.getInstance(Config.class);
final ColumnFamilyManager manager = config.getValue(value, ColumnFamilyManager.class);
ColumnTemplateProducer producer = BeanManagers.getInstance(ColumnTemplateProducer.class);
return producer.get(manager);
}
use of jakarta.nosql.column.ColumnFamilyManager in project jnosql-diana by eclipse.
the class ManagerProducerProducer method getColumnFamilyManager.
@Produces
public ColumnFamilyManager getColumnFamilyManager() {
ColumnFamilyManager columnFamilyManager = Mockito.mock(ColumnFamilyManager.class);
ColumnEntity entity = ColumnEntity.of("person");
entity.add(Column.of("name", "Ada"));
entity.add(Column.of("age", 10));
entity.add(Column.of("salary", BigDecimal.TEN));
entity.add(Column.of("phones", singletonList("22342342")));
when(columnFamilyManager.insert(Mockito.any(ColumnEntity.class))).thenReturn(entity);
when(columnFamilyManager.update(Mockito.any(ColumnEntity.class))).thenReturn(entity);
return columnFamilyManager;
}
use of jakarta.nosql.column.ColumnFamilyManager in project jnosql-diana-driver by eclipse.
the class CassandraColumnFamilyManagerFactoryTest method shouldReturnEntityManager.
@Test
public void shouldReturnEntityManager() {
ColumnFamilyManager columnEntityManager = subject.get(Constants.KEY_SPACE);
assertNotNull(columnEntityManager);
}
use of jakarta.nosql.column.ColumnFamilyManager in project jnosql-diana by eclipse.
the class DefaultSelectQueryBuilderTest method shouldExecuteManager.
@Test
public void shouldExecuteManager() {
ColumnFamilyManager manager = Mockito.mock(ColumnFamilyManager.class);
ArgumentCaptor<ColumnQuery> queryCaptor = ArgumentCaptor.forClass(ColumnQuery.class);
String columnFamily = "columnFamily";
Stream<ColumnEntity> entities = select().from(columnFamily).getResult(manager);
entities.collect(Collectors.toList());
Mockito.verify(manager).select(queryCaptor.capture());
checkQuery(queryCaptor, columnFamily);
}
use of jakarta.nosql.column.ColumnFamilyManager in project jnosql-diana by eclipse.
the class ReactiveTemplateBean method create.
@Override
public ReactiveColumnTemplate create(CreationalContext<ReactiveColumnTemplate> context) {
ColumnTemplateProducer producer = getInstance(ColumnTemplateProducer.class);
ColumnFamilyManager manager = getManager();
return producer.get(manager);
}
Aggregations