Source:
<code>public void should_parse_virtual_metadata() { KeyspaceMetadata km = session().getCluster().getMetadata().getKeyspace("system_views"); assertThat(km.getTables().size() >= 2); assertThat(km.isVirtual()).isTrue(); assertThat(km.isDurableWrites()).isFalse(); assertThat(km.getName()).isEqualTo("system_views"); assertThat(km.getUserTypes().size()).isEqualTo(0); assertThat(km.getFunctions().size()).isEqualTo(0); assertThat(km.getMaterializedViews().size()).isEqualTo(0); assertThat(km.getAggregates().size()).isEqualTo(0); assertThat(km.asCQLQuery()).isEqualTo(" "); TableMetadata tm = km.getTable("clients"); assertThat(tm).isNotNull(); assertThat(tm.getName()).isEqualTo("clients"); assertThat(tm.isVirtual()).isTrue(); assertThat(tm.getColumns().size()).isEqualTo(12); assertThat(tm.getIndexes().size()).isEqualTo(0); assertThat(tm.getViews().size()).isEqualTo(0); <START> assertThat(tm.getClusteringColumns().size()).isEqualTo(1); <END> assertThat(tm.getClusteringOrder().size()).isEqualTo(1); assertThat(tm.getId()).isEqualTo(new UUID(0L, 0L)); assertThat(tm.getOptions()).isNull(); assertThat(tm.getKeyspace()).isEqualTo(km); assertThat(tm.asCQLQuery()).isEqualTo(" "); ColumnMetadata cm = tm.getColumn("driver_name"); assertThat(cm).isNotNull(); assertThat(cm.getParent()).isEqualTo(tm); assertThat(cm.getType()).isEqualTo(DataType.text()); assertThat(cm.getName()).isEqualTo("driver_name"); }</code><technical_language>nice add validation for partition keys check column names for clustering partition keys correct ordering is right</technical_language>

Target:
public void should_parse_virtual_metadata() { KeyspaceMetadata km = session().getCluster().getMetadata().getKeyspace("system_views"); assertThat(km.getTables().size() >= 2); assertThat(km.isVirtual()).isTrue(); assertThat(km.isDurableWrites()).isFalse(); assertThat(km.getName()).isEqualTo("system_views"); assertThat(km.getUserTypes().size()).isEqualTo(0); assertThat(km.getFunctions().size()).isEqualTo(0); assertThat(km.getMaterializedViews().size()).isEqualTo(0); assertThat(km.getAggregates().size()).isEqualTo(0); assertThat(km.asCQLQuery()).isEqualTo(" "); TableMetadata tm = km.getTable("clients"); assertThat(tm).isNotNull(); assertThat(tm.getName()).isEqualTo("clients"); assertThat(tm.isVirtual()).isTrue(); assertThat(tm.getColumns().size()).isEqualTo(12); assertThat(tm.getPartitionKey().size()).isEqualTo(1); assertThat(tm.getPartitionKey().get(0).getName()).isEqualTo("address"); assertThat(tm.getClusteringColumns().size()).isEqualTo(1); assertThat(tm.getClusteringColumns().get(0).getName()).isEqualTo("port"); assertThat(tm.getIndexes().size()).isEqualTo(0); assertThat(tm.getViews().size()).isEqualTo(0); assertThat(tm.getClusteringColumns().size()).isEqualTo(1); assertThat(tm.getClusteringOrder().size()).isEqualTo(1); assertThat(tm.getId()).isEqualTo(new UUID(0L, 0L)); assertThat(tm.getOptions()).isNull(); assertThat(tm.getKeyspace()).isEqualTo(km); assertThat(tm.asCQLQuery()).isEqualTo(" "); ColumnMetadata cm = tm.getColumn("driver_name"); assertThat(cm).isNotNull(); assertThat(cm.getParent()).isEqualTo(tm); assertThat(cm.getType()).isEqualTo(DataType.text()); assertThat(cm.getName()).isEqualTo("driver_name"); }