use of org.apache.gobblin.converter.avro.JsonElementConversionFactory.ArrayConverter in project incubator-gobblin by apache.
the class JsonElementConversionFactoryTest method schemaWithArrayOfInts.
@Test
public void schemaWithArrayOfInts() throws Exception {
String testName = "schemaWithArrayOfInts";
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.avro.JsonElementConversionFactory.ArrayConverter 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.avro.JsonElementConversionFactory.ArrayConverter 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.avro.JsonElementConversionFactory.ArrayConverter 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.avro.JsonElementConversionFactory.ArrayConverter in project incubator-gobblin by apache.
the class JsonElementConversionFactoryTest method schemaWithArrayOfRecords.
@Test
public void schemaWithArrayOfRecords() throws Exception {
String testName = "schemaWithArrayOfRecords";
JsonObject schema = getSchemaData(testName).getAsJsonObject();
JsonObject expected = getExpectedSchema(testName).getAsJsonObject();
JsonSchema jsonSchema = new JsonSchema(schema);
jsonSchema.setColumnName("dummy1");
ArrayConverter converter = new ArrayConverter(jsonSchema, state);
Assert.assertEquals(avroSchemaToJsonElement(converter), expected);
}
Aggregations