Search in sources :

Example 1 with EnumConverter

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

the class JsonElementConversionFactoryTest method schemaWithEnumIsNullable.

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

Aggregations

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