@Test
public void testtraceWhenParentNotNullAndCurrentSpanNotNull(){

    // Setup
    final RequestGlobalTransaction rgt = mock(RequestGlobalTransaction.class);
    final String traceId = "traceId";
    final Span span = mock(Span.class);
    when(rgt.getParent()).thenReturn(null);
    when(mockTracer.getCurrentSpan()).thenReturn(span);
    when(span.traceIdString()).thenReturn(traceId);
    // Run the test
    String result = businessGlobalTransactionServiceImplUnderTest.trace(rgt);
    // Verify the results
    assertEquals(result, traceId);
    verify(mockTracer, never()).createSpan(anyString());
    verify(mockPublisher, never()).publishEvent(any(GtxSpanStarted.class));
}