@Test public void deserializeInvalidData() { TestPojo expected = new TestPojo(true, (byte) -2, (short) -3, 'a', 2, 5, 3.2f, -8.5, null, new String[] {"bar"}, null); final Buffer serialized = serializePojo(expected); serialized.setByte(serialized.writerIndex() - 1, serialized.getByte(serialized.writerIndex() - 1) + 1); final StreamingDeserializer<TestPojo> deserializer = serializationProvider.getDeserializer(TestPojo.class); try { deserializer.deserialize(serialized); fail(); } catch (SerializationException e) { assertThat("Unexpected exception", e.getCause(), instanceOf(JsonParseException.class)); } assertThat("Unexpected data remaining in deserializer", deserializer.hasData(), is(true)); }
@Override public <T> StreamingDeserializer<T> getDeserializer(final Class<T> classToDeSerialize) { return newDeserializer(mapper.readerFor(classToDeSerialize)); }
JacksonSerializationProvider implements SerializationProvider { @Override public <T> StreamingDeserializer<T> getDeserializer(final Class<T> classToDeSerialize) { return newDeserializer(mapper.readerFor(classToDeSerialize)); } }
JacksonSerializationProvider implements SerializationProvider { @Override public <T> StreamingDeserializer<T> getDeserializer(final Class<T> classToDeSerialize) { return newDeserializer(mapper.readerFor(classToDeSerialize)); } JacksonSerializationProvider();  JacksonSerializationProvider(final ObjectMapper mapper); }
JacksonSerializationProvider implements SerializationProvider { @Override public <T> StreamingDeserializer<T> getDeserializer(final Class<T> classToDeSerialize) { return newDeserializer(mapper.readerFor(classToDeSerialize)); } JacksonSerializationProvider();  JacksonSerializationProvider(final ObjectMapper mapper); @Override StreamingSerializer getSerializer(final Class<T> classToSerialize); @Override StreamingSerializer getSerializer(final TypeHolder<T> typeToSerialize); @Override StreamingDeserializer<T> getDeserializer(final Class<T> classToDeSerialize); @Override StreamingDeserializer<T> getDeserializer(final TypeHolder<T> typeToDeserialize); @Override void serialize(final T toSerialize, final Buffer destination); }
JacksonSerializationProvider implements SerializationProvider { @Override public <T> StreamingDeserializer<T> getDeserializer(final Class<T> classToDeSerialize) { return newDeserializer(mapper.readerFor(classToDeSerialize)); } JacksonSerializationProvider();  JacksonSerializationProvider(final ObjectMapper mapper); @Override StreamingSerializer getSerializer(final Class<T> classToSerialize); @Override StreamingSerializer getSerializer(final TypeHolder<T> typeToSerialize); @Override StreamingDeserializer<T> getDeserializer(final Class<T> classToDeSerialize); @Override StreamingDeserializer<T> getDeserializer(final TypeHolder<T> typeToDeserialize); @Override void serialize(final T toSerialize, final Buffer destination);  }