@Test public void deserialize() throws IOException { byte[] data = new byte[] { 0 }; when(objectWriter.writeValueAsBytes(patch)).thenReturn(data); byte[] result = underTest.serialize("topic", patch); assertThat(result, is(data)); }
@Override public byte[] serialize(String topic, PatchSet patch) { try { return objectWriter.writeValueAsBytes(patch); } catch (JsonProcessingException e) { throw new RuntimeException(e); } }
PatchSetSerializer implements Serializer<PatchSet> { @Override public byte[] serialize(String topic, PatchSet patch) { try { return objectWriter.writeValueAsBytes(patch); } catch (JsonProcessingException e) { throw new RuntimeException(e); } } }
PatchSetSerializer implements Serializer<PatchSet> { @Override public byte[] serialize(String topic, PatchSet patch) { try { return objectWriter.writeValueAsBytes(patch); } catch (JsonProcessingException e) { throw new RuntimeException(e); } } PatchSetSerializer();  PatchSetSerializer(ObjectWriter objectWriter); }
PatchSetSerializer implements Serializer<PatchSet> { @Override public byte[] serialize(String topic, PatchSet patch) { try { return objectWriter.writeValueAsBytes(patch); } catch (JsonProcessingException e) { throw new RuntimeException(e); } } PatchSetSerializer();  PatchSetSerializer(ObjectWriter objectWriter); @Override void configure(Map<String, ?> configs, boolean isKey); @Override byte[] serialize(String topic, PatchSet patch); @Override void close(); }
PatchSetSerializer implements Serializer<PatchSet> { @Override public byte[] serialize(String topic, PatchSet patch) { try { return objectWriter.writeValueAsBytes(patch); } catch (JsonProcessingException e) { throw new RuntimeException(e); } } PatchSetSerializer();  PatchSetSerializer(ObjectWriter objectWriter); @Override void configure(Map<String, ?> configs, boolean isKey); @Override byte[] serialize(String topic, PatchSet patch); @Override void close();  }