SchemaUtil { public static String asString(Object field) { return new RecordWriter().append(field).toString(); } private  SchemaUtil(); static String asString(Object field); static String asString(Field field); static String asString(Struct struct); static String asString(Schema schema); static String asString(SourceRecord record); static String asDetailedString(Field field); static String asDetailedString(Struct struct); static String asDetailedString(Schema schema); static String asDetailedString(SourceRecord record);  }
@Test @FixFor("DBZ-759") public void correctlySerializesByteArray() { assertThat(SchemaUtil.asString(new byte[]{ 1, 3, 5, 7 })).isEqualTo("[1, 3, 5, 7]"); }
@Test @FixFor("DBZ-759") public void correctlySerializesByteBuffer() { final ByteBuffer buffer = ByteBuffer.allocate(3); buffer.put(new byte[]{ 11, 13, 17 }); assertThat(SchemaUtil.asString(buffer)).isEqualTo("[11, 13, 17]"); }
@Test @FixFor("DBZ-759") public void correctlySerializesStructWithByteArray() { Schema schema = SchemaBuilder.struct() .field("some_field", SchemaBuilder.bytes().build()) .build(); Struct struct = new Struct(schema).put("some_field", new byte[]{ 1, 3, 5, 7 }); assertThat(SchemaUtil.asString(struct)).isEqualTo("{\"some_field\" : [1, 3, 5, 7]}"); }