@Test public void deserializerShouldWork() { String topic = "test"; CloudEvent inEvent = Data.V1_WITH_JSON_DATA; CloudEventMessageDeserializer deserializer = new CloudEventMessageDeserializer(); ProducerRecord<Void, byte[]> inRecord = KafkaMessageFactory.createWriter(topic).writeBinary(inEvent); MessageReader outMessage = deserializer.deserialize(topic, inRecord.headers(), inRecord.value()); assertThat(outMessage.getEncoding()) .isEqualTo(Encoding.BINARY); assertThat(outMessage.toEvent()) .isEqualTo(inEvent); }
@Override public MessageReader deserialize(String topic, byte[] data) { throw new UnsupportedOperationException("CloudEventDeserializer supports only the signature deserialize(String, Headers, byte[])"); }
CloudEventMessageDeserializer implements Deserializer<MessageReader> { @Override public MessageReader deserialize(String topic, byte[] data) { throw new UnsupportedOperationException("CloudEventDeserializer supports only the signature deserialize(String, Headers, byte[])"); } }
CloudEventMessageDeserializer implements Deserializer<MessageReader> { @Override public MessageReader deserialize(String topic, byte[] data) { throw new UnsupportedOperationException("CloudEventDeserializer supports only the signature deserialize(String, Headers, byte[])"); }  }
CloudEventMessageDeserializer implements Deserializer<MessageReader> { @Override public MessageReader deserialize(String topic, byte[] data) { throw new UnsupportedOperationException("CloudEventDeserializer supports only the signature deserialize(String, Headers, byte[])"); }  @Override MessageReader deserialize(String topic, byte[] data); @Override MessageReader deserialize(String topic, Headers headers, byte[] data); }
CloudEventMessageDeserializer implements Deserializer<MessageReader> { @Override public MessageReader deserialize(String topic, byte[] data) { throw new UnsupportedOperationException("CloudEventDeserializer supports only the signature deserialize(String, Headers, byte[])"); }  @Override MessageReader deserialize(String topic, byte[] data); @Override MessageReader deserialize(String topic, Headers headers, byte[] data);  }