### Question:
DefaultPojoBinding implements PojoBinding<P> { @Override public void verifySchema(KeyspaceMetadata keyspaceMetadata, String tableName) { TableMetadata tableMetadata = keyspaceMetadata.getTable(tableName); if(tableMetadata == null) { throw new SchemaVerificationException("Table \"%s\" not found in keyspace \"%s\".", tableName, keyspaceMetadata.getName()); } keyBinding.verifySchema(keyspaceMetadata, tableMetadata); facetBindings.forEach(facetBinding -> facetBinding.verifySchema(keyspaceMetadata, tableMetadata)); } DefaultPojoBinding(Class<P> pojoType); @Override BoundStatement bindInsert(PreparedStatement statement, P pojo, int ttl); @Override BoundStatement bindWhereIdEquals(PreparedStatement statement, List<Object> keys); @Override P createPojo(); @Override Delete.Where deleteFrom(String tableName); @Override void describe(Table table, Schema schema); @Override KeyBinding getKeyBinding(); @Override Map<String, ParameterBinding> getParameterBindings(); @Override Class<P> getPojoType(); @Override void injectValues(P pojo, Row row, PojoQueryContext context); @Override Insert insertInto(String tableName); @Override Select.Where selectFrom(String tableName); @Override Select.Where selectFromByKey(String tableName); @Override void verifySchema(KeyspaceMetadata keyspaceMetadata, String tableName); @Override void visitChildren(P pojo, Predicate<Facet> predicate, PojoVisitor visitor); void setKeyBinding(KeyBinding keyBinding); @Override boolean equals(Object o); @Override int hashCode(); void addFacetBinding(ColumnBinding facetBinding);  }### Answer:
@Test @Cassandra(keyspace = "bar") public void testValidateSchemaWithMissingTable() { PojoBinding<SimpleKeyEntity> binding = getBindingFactory().createPojoBinding(SimpleKeyEntity.class); assertHecateException("Table \"foo\" not found in keyspace \"bar\".", verifySchema(binding, "foo")); }
@Test @Cassandra public void testValidateSchemaWithMissingColumn() { PojoBinding<SimpleKeyEntity> binding = getBindingFactory().createPojoBinding(SimpleKeyEntity.class); getSession().execute(SchemaBuilder.createTable("foo").addPartitionKey("baz", DataType.varchar())); assertHecateException("Table \"foo\" does not contain column \"id\" of type \"varchar\".", verifySchema(binding, "foo")); }
@Test @Cassandra public void testValidateSchemaWithColumnTypeMismatch() { PojoBinding<SimpleKeyEntity> binding = getBindingFactory().createPojoBinding(SimpleKeyEntity.class); getSession().execute(SchemaBuilder.createTable("foo").addPartitionKey("id", DataType.cint())); assertHecateException("Column \"id\" in table \"foo\" is of the wrong type \"int\" (expected \"varchar\").", verifySchema(binding, "foo")); }
@Test @Cassandra public void testValidateSchemaWithNonPartitionKeySimple() { PojoBinding<SimpleKeyEntity> binding = getBindingFactory().createPojoBinding(SimpleKeyEntity.class); getSession().execute(SchemaBuilder.createTable("foo").addPartitionKey("baz", DataType.cint()).addColumn("id", DataType.varchar())); assertHecateException("Column \"id\" in table \"foo\" is not a partition key.", verifySchema(binding, "foo")); }
@Test @Cassandra public void testValidateSchemaWithNonPartitionKeyComposite() { PojoBinding<CompositeKeyEntity> binding = getBindingFactory().createPojoBinding(CompositeKeyEntity.class); getSession().execute(SchemaBuilder.createTable("foo").addPartitionKey("baz", DataType.cint()).addColumn("id", DataType.varchar())); assertHecateException("Column \"id\" in table \"foo\" is not a partition key.", verifySchema(binding, "foo")); }
@Test @Cassandra public void testValidateSchemaWithNonClusteringColumnComposite() { PojoBinding<CompositeKeyEntity> binding = getBindingFactory().createPojoBinding(CompositeKeyEntity.class); getSession().execute(SchemaBuilder.createTable("foo").addPartitionKey("id", DataType.varchar()).addColumn("cluster", DataType.varchar())); assertHecateException("Column \"cluster\" in table \"foo\" is not a clustering column.", verifySchema(binding, "foo")); }