use of org.apache.gobblin.converter.json.JsonSchema in project incubator-gobblin by apache.
the class JsonElementConversionFactoryTest method schemaWithRecordOfEnumCheckNamespace.
@Test
public void schemaWithRecordOfEnumCheckNamespace() throws Exception {
String testName = "schemaWithRecordOfEnumCheckNamespace";
JsonObject schema = getSchemaData(testName).getAsJsonObject();
JsonObject expected = getExpectedSchema(testName).getAsJsonObject();
RecordConverter converter = new RecordConverter(new JsonSchema(schema), state, buildNamespace(state.getExtract().getNamespace(), "something"));
Assert.assertEquals(avroSchemaToJsonElement(converter), expected);
Assert.assertEquals(converter.schema().getField("someperson").schema().getNamespace(), "namespace.something.myrecord");
Assert.assertEquals(converter.schema().getNamespace(), "namespace.something");
}
Aggregations