Search in sources :

Example 6 with SchemaData

use of org.apache.pulsar.common.schema.SchemaData in project incubator-pulsar by apache.

the class SchemaServiceTest method getByVersionReturnsTheCorrectEntry2.

@Test
public void getByVersionReturnsTheCorrectEntry2() throws Exception {
    putSchema(schemaId1, schema1, version(0));
    putSchema(schemaId1, schema2, version(1));
    SchemaData version1 = getSchema(schemaId1, version(1));
    assertEquals(schema2, version1);
}
Also used : SchemaData(org.apache.pulsar.common.schema.SchemaData) Test(org.testng.annotations.Test) MockedPulsarServiceBaseTest(org.apache.pulsar.broker.auth.MockedPulsarServiceBaseTest)

Example 7 with SchemaData

use of org.apache.pulsar.common.schema.SchemaData in project incubator-pulsar by apache.

the class SchemaServiceTest method writeSchemasToDifferentIds.

@Test
public void writeSchemasToDifferentIds() throws Exception {
    SchemaData schemaWithDifferentId = schema3;
    putSchema(schemaId1, schema1, version(0));
    String schemaId2 = "id2";
    putSchema(schemaId2, schemaWithDifferentId, version(0));
    SchemaData withFirstId = getLatestSchema(schemaId1, version(0));
    SchemaData withDifferentId = getLatestSchema(schemaId2, version(0));
    assertEquals(schema1, withFirstId);
    assertEquals(schema3, withDifferentId);
}
Also used : SchemaData(org.apache.pulsar.common.schema.SchemaData) Test(org.testng.annotations.Test) MockedPulsarServiceBaseTest(org.apache.pulsar.broker.auth.MockedPulsarServiceBaseTest)

Aggregations

MockedPulsarServiceBaseTest (org.apache.pulsar.broker.auth.MockedPulsarServiceBaseTest)7 SchemaData (org.apache.pulsar.common.schema.SchemaData)7 Test (org.testng.annotations.Test)7