public SchemaIdVersion addSchemaVersion(String schemaBranchName, SchemaMetadata schemaMetadata, SchemaVersion schemaVersion) throws IncompatibleSchemaException, InvalidSchemaException, SchemaNotFoundException, SchemaBranchNotFoundException { lockSchemaMetadata(schemaMetadata.getName()); return schemaVersionLifecycleManager.addSchemaVersion(schemaBranchName, schemaMetadata, schemaVersion, x -> registerSchemaMetadata(x)); }
public SchemaIdVersion addSchemaVersion(SchemaMetadata schemaMetadata, SchemaVersion schemaVersion) throws IncompatibleSchemaException, InvalidSchemaException, SchemaNotFoundException, SchemaBranchNotFoundException { lockSchemaMetadata(schemaMetadata.getName()); return schemaVersionLifecycleManager.addSchemaVersion(SchemaBranch.MASTER_BRANCH, schemaMetadata, schemaVersion, x -> registerSchemaMetadata(x)); }
@Test public void testSchemaMetadataOps() throws Exception { for (SchemaCompatibility schemaCompatibility : SchemaCompatibility.values()) { SchemaMetadata schemaMetadata = new SchemaMetadata.Builder("compatibility-" + schemaCompatibility) .type(AvroSchemaProvider.TYPE) .description("devices schema") .compatibility(schemaCompatibility) .schemaGroup(SCHEMA_GROUP).build(); Long schemaMetadataId = schemaRegistry.registerSchemaMetadata(schemaMetadata); SchemaMetadata schemaMetadataReturned = schemaRegistry.getSchemaMetadataInfo(schemaMetadataId).getSchemaMetadata(); Assert.assertEquals(schemaMetadata, schemaMetadataReturned); } }
.schemaGroup(SCHEMA_GROUP).build(); Long schemaMetadataId = schemaRegistry.registerSchemaMetadata(schemaMetadata); SchemaMetadata schemaMetadataReturned = schemaRegistry.getSchemaMetadataInfo(schemaMetadataId).getSchemaMetadata(); Assert.assertEquals(schemaMetadata, schemaMetadataReturned);