@Test
    public void testParseRequestHeader() {
        String headerRpcId = RPC_TRACE_NAME + "." + RPC_ID_KEY;
        SofaRpcSerialization sofaRpcSerialization = new SofaRpcSerialization();
        SofaRequest sofaRequest = new SofaRequest();
        Map<String, String> headerMap = new HashMap<>();
        Map<String, String> tracerCtx = new HashMap<String, String>();
        tracerCtx.put(TRACE_ID_KEY, "MOCK_traceId");
        tracerCtx.put(RPC_ID_KEY, "MOCK_rpcId");
        sofaRequest.addRequestProp(RPC_TRACE_NAME, tracerCtx);
        sofaRequest.addRequestProp("exist", "exist");
        headerMap.put(headerRpcId, "changedRpcId");
        headerMap.put("X-Tldc-Target-Tenant", "fia");
        headerMap.put("exist", "");
        sofaRpcSerialization.parseRequestHeader(headerMap, sofaRequest);
        Map<String, Object> requestProps = sofaRequest.getRequestProps();
        Assert.assertEquals("MOCK_traceId", ((Map) requestProps.get(RPC_TRACE_NAME)).get(TRACE_ID_KEY));
        Assert.assertEquals("changedRpcId", ((Map) requestProps.get(RPC_TRACE_NAME)).get(RPC_ID_KEY));
        Assert.assertEquals("fia", requestProps.get("X-Tldc-Target-Tenant"));
        Assert.assertEquals("exist", requestProps.get("exist"));
        sofaRequest.getRequestProps().clear();
        headerMap.put(headerRpcId, "changedRpcId");
        headerMap.put("X-Tldc-Target-Tenant", "fia");
        headerMap.put("exist", "");
        sofaRpcSerialization.parseRequestHeader(headerMap, sofaRequest);
        Assert.assertNull(((Map) requestProps.get(RPC_TRACE_NAME)).get(TRACE_ID_KEY));
        Assert.assertEquals("changedRpcId", ((Map) requestProps.get(RPC_TRACE_NAME)).get(RPC_ID_KEY));
        Assert.assertEquals("fia", requestProps.get("X-Tldc-Target-Tenant"));
        Assert.assertEquals("", requestProps.get("exist"));
    }
@author <a href="mailto:zhanggeng.zg@antfin.com">GengZhang</a>
remoting/remoting-bolt/src/test/java/com/alipay/sofa/rpc/codec/bolt/SimpleMapSerializerTest.java