@Test public void testKafkaAvroSerializer() { byte[] bytes; IndexedRecord avroRecord = createUserRecord(); bytes = avroSerializer.serialize(topic, avroRecord); assertEquals(avroRecord, avroDeserializer.deserialize(topic, bytes)); assertEquals(avroRecord, avroDecoder.fromBytes(bytes)); bytes = avroSerializer.serialize(topic, null); assertEquals(null, avroDeserializer.deserialize(topic, bytes)); assertEquals(null, avroDecoder.fromBytes(bytes)); bytes = avroSerializer.serialize(topic, true); assertEquals(true, avroDeserializer.deserialize(topic, bytes)); assertEquals(true, avroDecoder.fromBytes(bytes)); bytes = avroSerializer.serialize(topic, 123); assertEquals(123, avroDeserializer.deserialize(topic, bytes)); assertEquals(123, avroDecoder.fromBytes(bytes)); bytes = avroSerializer.serialize(topic, 345L); assertEquals(345l, avroDeserializer.deserialize(topic, bytes)); assertEquals(345l, avroDecoder.fromBytes(bytes)); bytes = avroSerializer.serialize(topic, 1.23f); assertEquals(1.23f, avroDeserializer.deserialize(topic, bytes)); assertEquals(1.23f, avroDecoder.fromBytes(bytes)); bytes = avroSerializer.serialize(topic, 2.34d); assertEquals(2.34, avroDeserializer.deserialize(topic, bytes)); assertEquals(2.34, avroDecoder.fromBytes(bytes)); bytes = avroSerializer.serialize(topic, "abc"); assertEquals("abc", avroDeserializer.deserialize(topic, bytes)); assertEquals("abc", avroDecoder.fromBytes(bytes)); bytes = avroSerializer.serialize(topic, "abc".getBytes()); assertArrayEquals("abc".getBytes(), (byte[]) avroDeserializer.deserialize(topic, bytes)); assertArrayEquals("abc".getBytes(), (byte[]) avroDecoder.fromBytes(bytes)); bytes = avroSerializer.serialize(topic, new Utf8("abc")); assertEquals("abc", avroDeserializer.deserialize(topic, bytes)); assertEquals("abc", avroDecoder.fromBytes(bytes)); }
public KafkaAvroSerializer() { }
KafkaAvroSerializer extends AbstractKafkaAvroSerializer implements Serializer<Object> { public KafkaAvroSerializer() { } }
KafkaAvroSerializer extends AbstractKafkaAvroSerializer implements Serializer<Object> { public KafkaAvroSerializer() { } KafkaAvroSerializer();  KafkaAvroSerializer(SchemaRegistryClient client);  KafkaAvroSerializer(SchemaRegistryClient client, Map<String, ?> props); }
KafkaAvroSerializer extends AbstractKafkaAvroSerializer implements Serializer<Object> { public KafkaAvroSerializer() { } KafkaAvroSerializer();  KafkaAvroSerializer(SchemaRegistryClient client);  KafkaAvroSerializer(SchemaRegistryClient client, Map<String, ?> props); @Override void configure(Map<String, ?> configs, boolean isKey); @Override byte[] serialize(String topic, Object record); @Override void close(); }
KafkaAvroSerializer extends AbstractKafkaAvroSerializer implements Serializer<Object> { public KafkaAvroSerializer() { } KafkaAvroSerializer();  KafkaAvroSerializer(SchemaRegistryClient client);  KafkaAvroSerializer(SchemaRegistryClient client, Map<String, ?> props); @Override void configure(Map<String, ?> configs, boolean isKey); @Override byte[] serialize(String topic, Object record); @Override void close();  }