@Test
public void testEncodedValue() throws Exception {

    SofaTracerSpanContext spanContext = SofaTracerSpanContext.rootStart();
    Map<String, String> baggage = new HashMap<>();
    baggage.put("key", "value");
    baggage.put("key1", "value1");
    baggage.put("key2", "value2");
    spanContext.addBizBaggage(baggage);
    //
    final TextMap carrier = new TextMap() {
        Map<String, String> carr = new HashMap<>();
        @Override
        public Iterator<Map.Entry<String, String>> iterator() {
            return carr.entrySet().iterator();
        }
        @Override
        public void put(String key, String value) {
            carr.put(key, value);
        }
        @Override
        public String toString() {
            return "$classname{" + "carr=" + carr + '}';
        }
    };
    this.registryExtractorInjector.inject(spanContext, carrier);
    SofaTracerSpanContext extractContext = this.registryExtractorInjector.extract(carrier);
    // traceId spanId sampled
    extractContext.equals(spanContext);
    assertTrue("Extract baggage : " + extractContext.getBizBaggage(),
        baggage.equals(extractContext.getBizBaggage()));
}