Search in sources :

Example 1 with EntityMixedCase

use of com.datastax.driver.mapping.entity.EntityMixedCase in project cassandra-driver-mapping by valchkou.

the class MappingSessionAsyncTest method saveAndGetAndDeleteMixedCaseTest.

@Test
public void saveAndGetAndDeleteMixedCaseTest() throws Exception {
    int id = 12245;
    EntityMixedCase obj = new EntityMixedCase();
    obj.setId(id);
    obj.setFirstName("firstName");
    obj.setLastName("lastName");
    obj.setAge(25);
    EntityMixedCase loaded = target.get(EntityMixedCase.class, id);
    assertNull(loaded);
    ResultSetFuture f = target.saveAsync(obj);
    f.getUninterruptibly();
    loaded = target.get(EntityMixedCase.class, id);
    assertEquals(obj, loaded);
    f = target.deleteAsync(loaded);
    f.getUninterruptibly();
    loaded = target.get(EntityMixedCase.class, id);
    assertNull(loaded);
}
Also used : EntityMixedCase(com.datastax.driver.mapping.entity.EntityMixedCase) ResultSetFuture(com.datastax.driver.core.ResultSetFuture) Test(org.junit.Test)

Aggregations

ResultSetFuture (com.datastax.driver.core.ResultSetFuture)1 EntityMixedCase (com.datastax.driver.mapping.entity.EntityMixedCase)1 Test (org.junit.Test)1