Search in sources :

Example 1 with StringConverter

use of org.apache.gobblin.converter.avro.JsonElementConversionFactory.StringConverter in project incubator-gobblin by apache.

the class JsonElementConversionFactoryTest method schemaWithIsNullable.

@Test
public void schemaWithIsNullable() throws Exception {
    String testName = "schemaWithIsNullable";
    JsonObject schema = getSchemaData(testName).getAsJsonObject();
    JsonArray expected = getExpectedSchema(testName).getAsJsonArray();
    StringConverter converter = new StringConverter(new JsonSchema(schema));
    Assert.assertEquals(avroSchemaToJsonElement(converter), expected);
}
Also used : JsonArray(com.google.gson.JsonArray) JsonSchema(org.apache.gobblin.converter.json.JsonSchema) JsonObject(com.google.gson.JsonObject) StringConverter(org.apache.gobblin.converter.avro.JsonElementConversionFactory.StringConverter) Test(org.testng.annotations.Test)

Aggregations

JsonArray (com.google.gson.JsonArray)1 JsonObject (com.google.gson.JsonObject)1 StringConverter (org.apache.gobblin.converter.avro.JsonElementConversionFactory.StringConverter)1 JsonSchema (org.apache.gobblin.converter.json.JsonSchema)1 Test (org.testng.annotations.Test)1