use of com.datastax.driver.mapping.entity.EntityWithEnum in project cassandra-driver-mapping by valchkou.
the class MappingSessionAsyncTest method saveEntityWithEnumTest.
@Test
public void saveEntityWithEnumTest() throws Exception {
UUID uuid = UUID.randomUUID();
EntityWithEnum obj = new EntityWithEnum();
obj.setId(uuid);
obj.setMonth(Month.JUNE);
EntityWithEnum loaded = target.get(EntityWithEnum.class, uuid);
assertNull(loaded);
ResultSetFuture f = target.saveAsync(obj);
f.getUninterruptibly();
loaded = target.get(EntityWithEnum.class, uuid);
assertEquals(obj, loaded);
obj.setMonth(Month.APRIL);
f = target.saveAsync(obj);
f.getUninterruptibly();
loaded = target.get(EntityWithEnum.class, uuid);
assertEquals(obj, loaded);
f = target.deleteAsync(loaded);
f.getUninterruptibly();
loaded = target.get(EntityWithEnum.class, uuid);
assertNull(loaded);
}
Aggregations