Search in sources :

Example 16 with SchemaBranch

use of com.hortonworks.registries.schemaregistry.SchemaBranch in project registry by hortonworks.

the class SchemaBranchLifeCycleTest method addIncompatibleSchemaToBranch.

@Test(expected = IncompatibleSchemaException.class)
public void addIncompatibleSchemaToBranch() throws IOException, SchemaBranchNotFoundException, InvalidSchemaException, SchemaNotFoundException, IncompatibleSchemaException, SchemaBranchAlreadyExistsException {
    SchemaMetadata schemaMetadata = addSchemaMetadata(testNameRule.getMethodName(), SchemaCompatibility.BACKWARD);
    SchemaIdVersion masterSchemaIdVersion = addSchemaVersion(SchemaBranch.MASTER_BRANCH, schemaMetadata, "/device.avsc");
    SchemaBranch schemaBranch1 = addSchemaBranch("BRANCH1", schemaMetadata, masterSchemaIdVersion.getSchemaVersionId());
    addSchemaVersion(schemaBranch1.getName(), schemaMetadata, "/device-incompat.avsc");
}
Also used : SchemaBranch(com.hortonworks.registries.schemaregistry.SchemaBranch) SchemaMetadata(com.hortonworks.registries.schemaregistry.SchemaMetadata) SchemaIdVersion(com.hortonworks.registries.schemaregistry.SchemaIdVersion) Test(org.junit.Test)

Aggregations

SchemaBranch (com.hortonworks.registries.schemaregistry.SchemaBranch)16 SchemaIdVersion (com.hortonworks.registries.schemaregistry.SchemaIdVersion)15 SchemaMetadata (com.hortonworks.registries.schemaregistry.SchemaMetadata)15 Test (org.junit.Test)15 SchemaVersion (com.hortonworks.registries.schemaregistry.SchemaVersion)6 SchemaVersionInfo (com.hortonworks.registries.schemaregistry.SchemaVersionInfo)5 SchemaBranchAlreadyExistsException (com.hortonworks.registries.schemaregistry.errors.SchemaBranchAlreadyExistsException)4 SchemaNotFoundException (com.hortonworks.registries.schemaregistry.errors.SchemaNotFoundException)4 Lists (com.google.common.collect.Lists)3 SchemaCompatibility (com.hortonworks.registries.schemaregistry.SchemaCompatibility)3 SchemaRegistryTestProfileType (com.hortonworks.registries.schemaregistry.avro.conf.SchemaRegistryTestProfileType)3 SchemaRegistryTestServerClientWrapper (com.hortonworks.registries.schemaregistry.avro.helper.SchemaRegistryTestServerClientWrapper)3 AvroSchemaRegistryClientUtil (com.hortonworks.registries.schemaregistry.avro.util.AvroSchemaRegistryClientUtil)3 CustomParameterizedRunner (com.hortonworks.registries.schemaregistry.avro.util.CustomParameterizedRunner)3 SchemaRegistryClient (com.hortonworks.registries.schemaregistry.client.SchemaRegistryClient)3 IncompatibleSchemaException (com.hortonworks.registries.schemaregistry.errors.IncompatibleSchemaException)3 InvalidSchemaBranchDeletionException (com.hortonworks.registries.schemaregistry.errors.InvalidSchemaBranchDeletionException)3 InvalidSchemaException (com.hortonworks.registries.schemaregistry.errors.InvalidSchemaException)3 SchemaBranchNotFoundException (com.hortonworks.registries.schemaregistry.errors.SchemaBranchNotFoundException)3 SchemaLifecycleException (com.hortonworks.registries.schemaregistry.state.SchemaLifecycleException)3