@@ -0,0 +1,965 @@
+package de.vorb.platon.web.rest.json;%0A%0Aimport com.fasterxml.jackson.core.JsonGenerator;%0Aimport com.fasterxml.jackson.databind.SerializerProvider;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.Mock;%0Aimport org.mockito.Mockito;%0Aimport org.mockito.runners.MockitoJUnitRunner;%0A%0Aimport java.math.BigInteger;%0A%0A@RunWith(MockitoJUnitRunner.class)%0Apublic class ByteArraySerializerTest %7B%0A%0A    @Mock%0A    private JsonGenerator jsonGenerator;%0A%0A    @Mock%0A    private SerializerProvider serializerProvider;%0A%0A    @Test%0A    public void testSerialize() throws Exception %7B%0A%0A        final String sampleHash = %22341be97d9aff90c9978347f66f945b77%22;%0A        final byte%5B%5D bytes = new BigInteger(sampleHash, 16).toByteArray();%0A%0A        new ByteArraySerializer().serialize(bytes, jsonGenerator, serializerProvider);%0A%0A        // verify that the byte array is correctly serialized%0A        Mockito.verify(jsonGenerator).writeString(Mockito.eq(sampleHash));%0A%0A    %7D%0A%0A%7D%0A

Test JSON byte array serialization