use of org.jnosql.diana.cassandra.column.Constants.COLUMN_FAMILY in project jnosql-diana-driver by eclipse.
the class CassandraColumnFamilyManagerAsyncTest method shouldDeleteWithCallBack.
@Test
public void shouldDeleteWithCallBack() {
AtomicBoolean callback = new AtomicBoolean(false);
ColumnDeleteQuery deleteQuery = delete().from(COLUMN_FAMILY).where("id").eq(10L).build();
columnEntityManager.delete(deleteQuery, v -> callback.set(true));
await().untilTrue(callback);
ColumnQuery query = select().from(COLUMN_FAMILY).where("id").eq(10L).build();
AtomicReference<List<ColumnEntity>> entities = new AtomicReference<>(emptyList());
callback.set(false);
Consumer<List<ColumnEntity>> result = (l) -> {
callback.set(true);
entities.set(l);
};
columnEntityManager.select(query, result);
await().untilTrue(callback);
assertTrue(entities.get().isEmpty());
}
Aggregations