use of org.jnosql.diana.api.column.ColumnFamilyManager in project jnosql-artemis by eclipse.
the class DefaultColumnTemplateProducerTest method shouldReturn.
@Test
public void shouldReturn() {
ColumnFamilyManager manager = Mockito.mock(ColumnFamilyManager.class);
ColumnTemplate columnTemplate = producer.get(manager);
assertNotNull(columnTemplate);
}
use of org.jnosql.diana.api.column.ColumnFamilyManager in project jnosql-artemis by eclipse.
the class ColumnTemplateBean method create.
@Override
public ColumnTemplate create(CreationalContext<ColumnTemplate> creationalContext) {
ColumnTemplateProducer producer = getInstance(ColumnTemplateProducer.class);
ColumnFamilyManager columnFamilyManager = getColumnFamilyManager();
return producer.get(columnFamilyManager);
}
use of org.jnosql.diana.api.column.ColumnFamilyManager in project jnosql-artemis by eclipse.
the class MockProducer method getColumnFamilyManager.
@Produces
public ColumnFamilyManager getColumnFamilyManager() {
ColumnEntity entity = ColumnEntity.of("Person");
entity.add(org.jnosql.diana.api.column.Column.of("name", "Default"));
entity.add(org.jnosql.diana.api.column.Column.of("age", 10));
ColumnFamilyManager manager = mock(ColumnFamilyManager.class);
when(manager.insert(Mockito.any(ColumnEntity.class))).thenReturn(entity);
return manager;
}
use of org.jnosql.diana.api.column.ColumnFamilyManager in project jnosql-diana-driver by eclipse.
the class CassandraColumnFamilyManagerFactoryTest method shouldReturnEntityManager.
@Test
public void shouldReturnEntityManager() throws Exception {
ColumnFamilyManager columnEntityManager = subject.get(org.jnosql.diana.cassandra.column.Constants.KEY_SPACE);
assertNotNull(columnEntityManager);
}
use of org.jnosql.diana.api.column.ColumnFamilyManager in project jnosql-artemis 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;
}
Aggregations