/////////////////////// STATIC AND NON STATIC SIMPLE COLUMNS ////////////////////////////////
@Test
public void should_query_static_column() throws Exception {
Long partitionKey = RandomUtils.nextLong(0,Long.MAX_VALUE);
ClusteredEntityWithStaticColumn parisStreet1 = new ClusteredEntityWithStaticColumn(new ClusteredKey(partitionKey, "street1"), "Paris", "rue de la paix");
ClusteredEntityWithStaticColumn parisStreet2 = new ClusteredEntityWithStaticColumn(new ClusteredKey(partitionKey, "street2"), "Paris", "avenue des Champs Elysees");
manager.insert(parisStreet1);
manager.insert(parisStreet2);
List<ClusteredEntityWithStaticColumn> found = manager.sliceQuery(ClusteredEntityWithStaticColumn.class)
.forSelect()
.withPartitionComponents(partitionKey)
.get(100);
assertThat(found).hasSize(2);
final ClusteredEntityWithStaticColumn foundParisStreet1 = found.get(0);
final ClusteredEntityWithStaticColumn foundParisStreet2 = found.get(1);
assertThat(foundParisStreet1.getStreet()).isEqualTo("rue de la paix");
assertThat(foundParisStreet2.getStreet()).isEqualTo("avenue des Champs Elysees");
ClusteredEntityWithStaticColumn lyonStreet3 = new ClusteredEntityWithStaticColumn(new ClusteredKey(partitionKey, "street3"), "Lyon", "rue Lamartine");
manager.insert(lyonStreet3);
found = manager.sliceQuery(ClusteredEntityWithStaticColumn.class)
.forSelect()
.withPartitionComponents(partitionKey)
.get(100);
assertThat(found).hasSize(3);
final ClusteredEntityWithStaticColumn foundLyonStreet1 = found.get(0);
final ClusteredEntityWithStaticColumn foundLyonStreet2 = found.get(1);
final ClusteredEntityWithStaticColumn foundLyonStreet3 = found.get(2);
assertThat(foundLyonStreet1.getStreet()).isEqualTo("rue de la paix");
assertThat(foundLyonStreet1.getCity()).isEqualTo("Lyon");
assertThat(foundLyonStreet2.getStreet()).isEqualTo("avenue des Champs Elysees");
assertThat(foundLyonStreet3.getCity()).isEqualTo("Lyon");
assertThat(foundLyonStreet3.getStreet()).isEqualTo("rue Lamartine");
assertThat(foundLyonStreet3.getCity()).isEqualTo("Lyon");
}