use of org.apache.gobblin.converter.avro.JsonElementConversionFactory.UnionConverter in project incubator-gobblin by apache.
the class JsonElementConversionFactoryTest method schemaWithUnion.
@Test
public void schemaWithUnion() throws Exception {
String testName = "schemaWithUnion";
JsonObject schema = getSchemaData(testName).getAsJsonObject();
JsonArray expected = getExpectedSchema(testName).getAsJsonArray();
UnionConverter converter = new UnionConverter(new JsonSchema(schema), state);
Assert.assertEquals(avroSchemaToJsonElement(converter), expected);
}
use of org.apache.gobblin.converter.avro.JsonElementConversionFactory.UnionConverter in project incubator-gobblin by apache.
the class JsonElementConversionFactoryTest method schemaWithComplexUnion.
@Test
public void schemaWithComplexUnion() throws Exception {
String testName = "schemaWithComplexUnion";
JsonObject schema = getSchemaData(testName).getAsJsonObject();
JsonArray expected = getExpectedSchema(testName).getAsJsonArray();
UnionConverter converter = new UnionConverter(new JsonSchema(schema), state);
Assert.assertEquals(avroSchemaToJsonElement(converter), expected);
}
Aggregations