use of org.talend.daikon.avro.AvroRegistry in project components by Talend.
the class PythonRowPropertiesTest method testSetupSchema_serialization.
@Test
public void testSetupSchema_serialization() {
PythonRowProperties properties = new PythonRowProperties("test");
properties.init();
AvroRegistry registry = new AvroRegistry();
Schema stringSchema = registry.getConverter(String.class).getSchema();
Schema.Field inputValue1Field = new Schema.Field("inputValue1", stringSchema, null, null, Order.ASCENDING);
Schema.Field inputValue2Field = new Schema.Field("inputValue2", stringSchema, null, null, Order.ASCENDING);
Schema inputSchema = Schema.createRecord("inputSchema", null, null, false, Arrays.asList(inputValue1Field, inputValue2Field));
properties.main.schema.setValue(inputSchema);
properties = Helper.fromSerializedPersistent(properties.toSerialized(), PythonRowProperties.class).object;
assertThat(inputSchema, equalTo(properties.main.schema.getValue()));
}
Aggregations