use of org.apache.beam.sdk.schemas.utils.TestPOJOs.POJOWithByteArray in project beam by apache.
the class POJOUtilsTest method testGeneratedByteBufferSetters.
@Test
public void testGeneratedByteBufferSetters() {
POJOWithByteArray pojo = new POJOWithByteArray();
List<FieldValueSetter> setters = POJOUtils.getSetters(POJOWithByteArray.class, POJO_WITH_BYTE_ARRAY_SCHEMA, JavaFieldTypeSupplier.INSTANCE, new DefaultTypeConversionsFactory());
setters.get(0).set(pojo, BYTE_ARRAY);
setters.get(1).set(pojo, BYTE_BUFFER.array());
assertArrayEquals("not equal", BYTE_ARRAY, pojo.bytes1);
assertEquals(BYTE_BUFFER, pojo.bytes2);
}
Aggregations