@Test
    public void testGenericSofaRequestSuccess() throws Exception {
        AbstractSerializer.registerGenericService(GenericService.class.getCanonicalName() + ":1.0",
            GenericServiceImpl.class.getName());

        SofaRequest request = buildGenericRequest();
        AbstractByteBuf data = serializer.encode(request, null);

        Map<String, String> head = new HashMap<String, String>();
        head.put(RemotingConstants.HEAD_TARGET_SERVICE, GenericService.class.getCanonicalName() + ":1.0");
        head.put(RemotingConstants.HEAD_METHOD_NAME, "hello");
        head.put(RemotingConstants.HEAD_TARGET_APP, "targetApp");
        head.put(RemotingConstants.RPC_TRACE_NAME + ".a", "xxx");
        head.put(RemotingConstants.RPC_TRACE_NAME + ".b", "yyy");
        head.put("unkown", "yes");

        SofaRequest newRequest = new SofaRequest();
        serializer.decode(data, newRequest, head);
        Object[] methodArgs = newRequest.getMethodArgs();
        MyReq req = (MyReq) methodArgs[0];
        Assert.assertNotNull(req);
        Assert.assertEquals(req.getName(), "hello");

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