Dao<ManagedSchema> managedDao = new SpecificAvroDao<ManagedSchema>(
tablePool, "managed_schemas", managedRecordString, ManagedSchema.class);
managedDao.delete(new PartitionKey(tableName, "test"));
SchemaManager manager = new DefaultSchemaManager(tablePool);
try {
manager.getEntityVersion(tableName, "test",
parser.parseEntitySchema(testRecord));
fail();
} catch (SchemaNotFoundException e) {
// This is what we expect
}
manager.createSchema(tableName, "test", testRecord,
"org.kitesdk.data.hbase.avro.AvroKeyEntitySchemaParser",
"org.kitesdk.data.hbase.avro.AvroKeySerDe",
"org.kitesdk.data.hbase.avro.AvroEntitySerDe");
assertEquals(
0,
manager.getEntityVersion(tableName, "test",
parser.parseEntitySchema(testRecord)));
}