Search in sources :

Example 1 with ColumnFamilyManager

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);
}
Also used : ColumnFamilyManager(org.jnosql.diana.api.column.ColumnFamilyManager) Test(org.junit.jupiter.api.Test)

Example 2 with ColumnFamilyManager

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);
}
Also used : ColumnFamilyManager(org.jnosql.diana.api.column.ColumnFamilyManager) ColumnTemplateProducer(org.jnosql.artemis.column.ColumnTemplateProducer)

Example 3 with 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;
}
Also used : ColumnEntity(org.jnosql.diana.api.column.ColumnEntity) ColumnFamilyManager(org.jnosql.diana.api.column.ColumnFamilyManager) Produces(javax.enterprise.inject.Produces)

Example 4 with ColumnFamilyManager

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);
}
Also used : ColumnFamilyManager(org.jnosql.diana.api.column.ColumnFamilyManager) Test(org.junit.jupiter.api.Test)

Example 5 with ColumnFamilyManager

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;
}
Also used : ColumnEntity(org.jnosql.diana.api.column.ColumnEntity) ColumnFamilyManager(org.jnosql.diana.api.column.ColumnFamilyManager) Produces(javax.enterprise.inject.Produces)

Aggregations

ColumnFamilyManager (org.jnosql.diana.api.column.ColumnFamilyManager)6 Produces (javax.enterprise.inject.Produces)3 ColumnEntity (org.jnosql.diana.api.column.ColumnEntity)3 Test (org.junit.jupiter.api.Test)2 ColumnTemplateProducer (org.jnosql.artemis.column.ColumnTemplateProducer)1