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);
}
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);
}
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;
}
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;
}
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);
}
Aggregations