use of com.datastax.driver.mapping.entity.EntityWithIndexes in project cassandra-driver-mapping by valchkou.
the class MappingSessionAsyncTest method saveAndGetAndDeleteTest.
@Test
public void saveAndGetAndDeleteTest() throws Exception {
UUID uuid = UUID.randomUUID();
EntityWithIndexes obj = new EntityWithIndexes();
obj.setCount(100);
obj.setEmail("email@at");
obj.setName("test");
obj.setTimeStamp(new Date());
obj.setUuid(uuid);
EntityWithIndexes loaded = target.get(EntityWithIndexes.class, uuid);
assertNull(loaded);
ResultSetFuture f = target.saveAsync(obj);
f.getUninterruptibly();
loaded = target.get(EntityWithIndexes.class, uuid);
assertEquals(obj, loaded);
f = target.deleteAsync(loaded);
f.getUninterruptibly();
loaded = target.get(EntityWithIndexes.class, uuid);
assertNull(loaded);
}
Aggregations