TableRepositoryImpl extends AbstractCRUDRepository<Table> implements TableRepository { @Override public long countTableSize(String database, String tableName) { PreparedStatement readCountTableSizeStmt = PreparedStatementFactory.getPreparedStatement(String.format(READ_COUNT_TABLE_SIZE_CQL, database + "_" + tableName), getSession()); BoundStatement bs = new BoundStatement(readCountTableSizeStmt); return (getSession().execute(bs).one().getLong(0)); } TableRepositoryImpl(Session session); @Override boolean exists(Identifier identifier); @Override Table read(Identifier identifier); @Override Table create(Table entity); @Override Table update(Table entity); @Override void delete(Table entity); @Override void delete(Identifier id); @Override List<Table> readAll(Identifier id); @Override List<Table> readAll(); @Override long countAllTables(String database); @Override long countTableSize(String database, String tableName);  }
@Test public void testCountTableSize() { System.out.println("countTableSize"); TableRepository instance = new TableRepositoryImpl(f.getSession()); Table testTable = Fixtures.createTestTable(); String database = testTable.getDatabaseName(); String tableName = testTable.getName(); f.insertTable(testTable); long expResult = 0L; long result = instance.countTableSize(database, tableName); assertEquals(expResult, result); f.insertDocument(Fixtures.createTestDocument()); expResult = 1L; result = instance.countTableSize(database, tableName); assertEquals(expResult, result); f.insertDocument(Fixtures.createTestDocument2()); expResult = 2L; result = instance.countTableSize(database, tableName); assertEquals(expResult, result); }