@Test
public void testGetThisAsParentWhenExceedLayer() throws Exception {

    StringBuilder spanIdBuilder = new StringBuilder("0").append(".");
    int i = 1;
    for (; i < 150; i++) {
        spanIdBuilder.append(i).append(".");
    }
    spanIdBuilder.append(i);
    Map<String, String> baggage = new HashMap<String, String>();
    baggage.put("key", "value");
    baggage.put("key1", "value1");
    baggage.put("key2", "value2");
    String traceId = TraceIdGenerator.generate();
    SofaTracerSpanContext sofaTracerSpanContext = new SofaTracerSpanContext(traceId,
        spanIdBuilder.toString(), "");
    sofaTracerSpanContext.addBizBaggage(baggage);
    SofaTracerSpan sofaTracerSpan = new SofaTracerSpan(this.sofaTracer,
        System.currentTimeMillis(), "open", sofaTracerSpanContext, null);
    //
    SofaTracerSpan thisAsParentSpan = sofaTracerSpan.getThisAsParentWhenExceedLayer();
    assertEquals("\n" + sofaTracerSpanContext, SofaTracer.ROOT_SPAN_ID, thisAsParentSpan
        .getSofaTracerSpanContext().getSpanId());
    assertNotEquals(traceId, thisAsParentSpan.getSofaTracerSpanContext().getTraceId());
    assertEquals(baggage, sofaTracerSpanContext.getBizBaggage());
    TestUtil.waitForAsyncLog();
    Assert.assertTrue(checkSelfLogContainsError());
}