@Test
public void testEncodeAndDecodeWithCustomSerializer() {

    JsonObjectMapper mapper = new JsonObjectMapper();
    Map<Class<?>, JsonSerializer<?>> serializers = new HashMap<Class<?>, JsonSerializer<?>>();
    serializers.put(Point.class, new PointSerializer());
    mapper.setSerializers(serializers);
    transcoder = new JsonTranscoder(mapper);
    Point p = new Point(40, 50);
    // it won't be possible to deserialize it because no custom deserializer is registered and serialized data
    // doesn't contain info about class (type of serialized object), so the Jackson cannot figure out what
    // deserializer should be used
    CachedObject co = transcoder.encode(p);
    assertNotNull(co);
    assertNotNull(co.getData());
    assertEquals("{\"v\":\"40x50\"}", new String(co.getData()));
}