@Test public void testDeserializeRecordWithKeyAndValue() throws IOException, RestClientException { formatter.init(props); ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream ps = new PrintStream(baos); formatter.writeTo(recordWithKeyAndValue, ps); assertEquals("\"" + A_STRING + "\"\n", baos.toString()); }
@Override protected void writeTo(byte[] data, PrintStream output) throws IOException { Object object = deserializer.deserialize(data); try { AvroSchemaUtils.toJson(object, output); } catch (AvroRuntimeException e) { Schema schema = AvroSchemaUtils.getSchema(object); throw new SerializationException( String.format("Error serializing Avro data of schema %s to json", schema), e); } }
AvroMessageFormatter extends SchemaMessageFormatter<Object> { @Override protected void writeTo(byte[] data, PrintStream output) throws IOException { Object object = deserializer.deserialize(data); try { AvroSchemaUtils.toJson(object, output); } catch (AvroRuntimeException e) { Schema schema = AvroSchemaUtils.getSchema(object); throw new SerializationException( String.format("Error serializing Avro data of schema %s to json", schema), e); } } }
AvroMessageFormatter extends SchemaMessageFormatter<Object> { @Override protected void writeTo(byte[] data, PrintStream output) throws IOException { Object object = deserializer.deserialize(data); try { AvroSchemaUtils.toJson(object, output); } catch (AvroRuntimeException e) { Schema schema = AvroSchemaUtils.getSchema(object); throw new SerializationException( String.format("Error serializing Avro data of schema %s to json", schema), e); } } AvroMessageFormatter();   AvroMessageFormatter(
      SchemaRegistryClient schemaRegistryClient,
      Deserializer keyDeserializer
  ); }
AvroMessageFormatter extends SchemaMessageFormatter<Object> { @Override protected void writeTo(byte[] data, PrintStream output) throws IOException { Object object = deserializer.deserialize(data); try { AvroSchemaUtils.toJson(object, output); } catch (AvroRuntimeException e) { Schema schema = AvroSchemaUtils.getSchema(object); throw new SerializationException( String.format("Error serializing Avro data of schema %s to json", schema), e); } } AvroMessageFormatter();   AvroMessageFormatter(
      SchemaRegistryClient schemaRegistryClient,
      Deserializer keyDeserializer
  );  }
AvroMessageFormatter extends SchemaMessageFormatter<Object> { @Override protected void writeTo(byte[] data, PrintStream output) throws IOException { Object object = deserializer.deserialize(data); try { AvroSchemaUtils.toJson(object, output); } catch (AvroRuntimeException e) { Schema schema = AvroSchemaUtils.getSchema(object); throw new SerializationException( String.format("Error serializing Avro data of schema %s to json", schema), e); } } AvroMessageFormatter();   AvroMessageFormatter(
      SchemaRegistryClient schemaRegistryClient,
      Deserializer keyDeserializer
  );   }