use of org.jnosql.diana.api.column.ColumnEntity in project jnosql-artemis by eclipse.
the class DefaultColumnTemplateAsyncTest method shouldInsertTTL.
@Test
public void shouldInsertTTL() {
ColumnEntity entity = ColumnEntity.of("Person");
entity.addAll(Stream.of(columns).collect(Collectors.toList()));
subject.insert(this.person, Duration.ofSeconds(1L));
verify(managerMock).insert(Mockito.any(ColumnEntity.class), Mockito.eq(Duration.ofSeconds(1L)), Mockito.any(Consumer.class));
}
use of org.jnosql.diana.api.column.ColumnEntity in project jnosql-artemis by eclipse.
the class DefaultColumnTemplateAsyncTest method shouldUpdate.
@Test
public void shouldUpdate() {
ColumnEntity entity = ColumnEntity.of("Person");
entity.addAll(Stream.of(columns).collect(Collectors.toList()));
subject.update(this.person);
verify(managerMock).update(captor.capture(), Mockito.any(Consumer.class));
ColumnEntity value = captor.getValue();
assertEquals(entity.getName(), value.getName());
}
use of org.jnosql.diana.api.column.ColumnEntity in project jnosql-artemis by eclipse.
the class MockProducer method getColumnFamilyManagerMock.
@Produces
@Database(value = DatabaseType.COLUMN, provider = "columnRepositoryMock")
public ColumnFamilyManager getColumnFamilyManagerMock() {
ColumnEntity entity = ColumnEntity.of("Person");
entity.add(org.jnosql.diana.api.column.Column.of("name", "columnRepositoryMock"));
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;
}
Aggregations