@Test
    public void encodeSofaResponse() {
        AbstractByteBuf data;
        SofaResponse response = new SofaResponse();
        response.setErrorMsg("1233");
        Assert.assertTrue(response.isError());
        Assert.assertEquals("1233", response.getErrorMsg());
        data = serializer.encode(response, null);
        SofaResponse newResponse = (SofaResponse) serializer.decode(data, SofaResponse.class, null);
        Assert.assertTrue(newResponse.isError());
        SofaResponse newResponse2 = (SofaResponse) serializer.decode(data, SofaResponse.class,
            Collections.singletonMap(RemotingConstants.HEAD_GENERIC_TYPE,
                RemotingConstants.SERIALIZE_FACTORY_GENERIC));
        Assert.assertTrue(newResponse2.isError());

        response = new SofaResponse();
        response.setAppResponse("123");
        data = serializer.encode(response, null);
        newResponse = (SofaResponse) serializer.decode(data, SofaResponse.class, null);
        Assert.assertFalse(newResponse.isError());
        Assert.assertEquals(response.getAppResponse(), newResponse.getAppResponse());
    }
@author <a href="mailto:zhanggeng.zg@antfin.com">GengZhang</a>
codec/codec-sofa-hessian/src/test/java/com/alipay/sofa/rpc/codec/sofahessian/SofaHessianSerializerTest.java