@Test
    public void testJacksonFeature() throws UnsupportedEncodingException {

        try {
            JacksonSerializer serializer = new JacksonSerializer();
            serializer.decode(new ByteArrayWrapperByteBuf("{\"a\":1}".getBytes("UTF-8")), DemoRequest.class, null);
            Assert.fail();
        } catch (SofaRpcException e) {
            // ok
        } catch (Throwable e) {
            Assert.fail();
        }

        try {
            JacksonSerializer serializer = new JacksonSerializer();
            serializer.encode(new DemoRequest2(), null);
            Assert.fail();
        } catch (SofaRpcException e) {
            // ok
        } catch (Throwable e) {
            Assert.fail();
        }

        System.setProperty("sofa.rpc.codec.jackson.DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES", "false");
        JacksonSerializer serializer = new JacksonSerializer();
        serializer.decode(new ByteArrayWrapperByteBuf("{\"a\":1}".getBytes("UTF-8")), DemoRequest.class, null);

        System.setProperty("sofa.rpc.codec.jackson.SerializationFeature.FAIL_ON_EMPTY_BEANS", "false");
        serializer = new JacksonSerializer();
        serializer.encode(new DemoRequest2(), null);

        System.setProperty("sofa.rpc.codec.jackson.DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES", "true");
        System.setProperty("sofa.rpc.codec.jackson.SerializationFeature.FAIL_ON_EMPTY_BEANS", "true");

    }
@author <a href="mailto:zhanggeng.zg@antfin.com">GengZhang</a>
codec/codec-jackson/src/test/java/com/alipay/sofa/rpc/codec/jackson/JacksonSerializerTest.java