@ Then ( "^a Cassandra keyspace '(.+?)' contains a table '(.+?)' with '(.+?)' rows$" ) public void assertRowNumberOfTableOnCassandraKeyspace ( String keyspace , String tableName , String numberRows ) { Long numberRowsLong = Long . parseLong ( numberRows ) ; commonspec . getCassandraClient ( ) . useKeyspace ( keyspace ) ; assertThat ( commonspec . getCassandraClient ( ) . executeQuery ( "SELECT COUNT(*) FROM " + tableName + ";" ) . all ( ) . get ( 0 ) . getLong ( 0 ) ) . as ( "The table " + tableName + "exists on cassandra" ) . isEqualTo ( numberRowsLong ) ; }
Checks the number of rows in a cassandra table .