use of org.apache.gobblin.converter.json.JsonSchema in project incubator-gobblin by apache.
the class JsonElementConversionFactoryTest method schemaWithArrayIsNullable.
@Test
public void schemaWithArrayIsNullable() throws Exception {
String testName = "schemaWithArrayIsNullable";
JsonObject schema = getSchemaData(testName).getAsJsonObject();
JsonArray expected = getExpectedSchema(testName).getAsJsonArray();
ArrayConverter converter = new ArrayConverter(new JsonSchema(schema), state);
Assert.assertEquals(avroSchemaToJsonElement(converter), expected);
}
use of org.apache.gobblin.converter.json.JsonSchema in project incubator-gobblin by apache.
the class JsonElementConversionFactoryTest method schemaWithArrayOfEnums.
@Test
public void schemaWithArrayOfEnums() throws Exception {
String testName = "schemaWithArrayOfEnums";
JsonObject schema = getSchemaData(testName).getAsJsonObject();
JsonObject expected = getExpectedSchema(testName).getAsJsonObject();
ArrayConverter converter = new ArrayConverter(new JsonSchema(schema), state);
Assert.assertEquals(avroSchemaToJsonElement(converter), expected);
}
use of org.apache.gobblin.converter.json.JsonSchema in project incubator-gobblin by apache.
the class JsonElementConversionFactoryTest method schemaWithMapIsNullable.
@Test
public void schemaWithMapIsNullable() throws Exception {
String testName = "schemaWithMapIsNullable";
JsonObject schema = getSchemaData(testName).getAsJsonObject();
JsonArray expected = getExpectedSchema(testName).getAsJsonArray();
MapConverter converter = new MapConverter(new JsonSchema(schema), state);
Assert.assertEquals(avroSchemaToJsonElement(converter), expected);
}
use of org.apache.gobblin.converter.json.JsonSchema in project incubator-gobblin by apache.
the class JsonElementConversionFactoryTest method schemaWithArrayOfMaps.
@Test
public void schemaWithArrayOfMaps() throws Exception {
String testName = "schemaWithArrayOfMaps";
JsonObject schema = getSchemaData(testName).getAsJsonObject();
JsonObject expected = getExpectedSchema(testName).getAsJsonObject();
JsonSchema jsonSchema = new JsonSchema(schema);
jsonSchema.setColumnName("dummy");
ArrayConverter converter = new ArrayConverter(jsonSchema, state);
Assert.assertEquals(avroSchemaToJsonElement(converter), expected);
}
use of org.apache.gobblin.converter.json.JsonSchema in project incubator-gobblin by apache.
the class JsonElementConversionFactoryTest method schemaWithRecordOfArray.
@Test
public void schemaWithRecordOfArray() throws Exception {
String testName = "schemaWithRecordOfArray";
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);
}
Aggregations