Search in sources :

Example 6 with CompatibilityResult

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

the class AvroCompatibilityCheckerTest method testInvalidCompatibilities.

@Test
public void testInvalidCompatibilities() throws Exception {
    SchemaCompatibility[] compatibilities = { SchemaCompatibility.BACKWARD, SchemaCompatibility.FORWARD, SchemaCompatibility.BOTH };
    for (SchemaCompatibility compatibility : compatibilities) {
        CompatibilityResult compatibilityResult = new AvroSchemaProvider().checkCompatibility(fetchResourceText("/avro/book-invalid-compat.avsc"), initialVersionSchema(), compatibility);
        Assert.assertFalse(compatibilityResult.isCompatible());
    }
}
Also used : SchemaCompatibility(com.hortonworks.registries.schemaregistry.SchemaCompatibility) CompatibilityResult(com.hortonworks.registries.schemaregistry.CompatibilityResult) Test(org.junit.Test)

Aggregations

CompatibilityResult (com.hortonworks.registries.schemaregistry.CompatibilityResult)6 Test (org.junit.Test)5 Timed (com.codahale.metrics.annotation.Timed)1 CatalogResponse (com.hortonworks.registries.common.catalog.CatalogResponse)1 UnitOfWork (com.hortonworks.registries.common.transaction.UnitOfWork)1 SchemaCompatibility (com.hortonworks.registries.schemaregistry.SchemaCompatibility)1 IncompatibleSchemaException (com.hortonworks.registries.schemaregistry.errors.IncompatibleSchemaException)1 InvalidSchemaBranchDeletionException (com.hortonworks.registries.schemaregistry.errors.InvalidSchemaBranchDeletionException)1 InvalidSchemaException (com.hortonworks.registries.schemaregistry.errors.InvalidSchemaException)1 SchemaBranchAlreadyExistsException (com.hortonworks.registries.schemaregistry.errors.SchemaBranchAlreadyExistsException)1 SchemaBranchNotFoundException (com.hortonworks.registries.schemaregistry.errors.SchemaBranchNotFoundException)1 SchemaNotFoundException (com.hortonworks.registries.schemaregistry.errors.SchemaNotFoundException)1 UnsupportedSchemaTypeException (com.hortonworks.registries.schemaregistry.errors.UnsupportedSchemaTypeException)1 SchemaLifecycleException (com.hortonworks.registries.schemaregistry.state.SchemaLifecycleException)1 ApiOperation (io.swagger.annotations.ApiOperation)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 POST (javax.ws.rs.POST)1 Path (javax.ws.rs.Path)1 Response (javax.ws.rs.core.Response)1