protected boolean shouldLinkAndUnlinkDistributedTraceInfoForMethod( HandlerMethodToExecute methodToExecute, boolean isDefaultMethodImpl, boolean forceEnableDTraceOnAllMethods, boolean debugHandlerMethodCalls, ChannelHandlerContext ctx, Object msgOrEvt, Throwable cause ) { return (!isDefaultMethodImpl && argsAreEligibleForLinkingAndUnlinkingDistributedTracingInfo(methodToExecute, ctx, msgOrEvt, cause) ) || forceEnableDTraceOnAllMethods || debugHandlerMethodCalls; }
protected boolean shouldLinkAndUnlinkDistributedTraceInfoForMethod( HandlerMethodToExecute methodToExecute, boolean isDefaultMethodImpl, boolean forceEnableDTraceOnAllMethods, boolean debugHandlerMethodCalls, ChannelHandlerContext ctx, Object msgOrEvt, Throwable cause ) { return (!isDefaultMethodImpl && argsAreEligibleForLinkingAndUnlinkingDistributedTracingInfo(methodToExecute, ctx, msgOrEvt, cause) ) || forceEnableDTraceOnAllMethods || debugHandlerMethodCalls; }
@Test public void argsAreEligibleForLinkingAndUnlinkingDistributedTracingInfo_returns_true_by_default() { assertThat(handler.argsAreEligibleForLinkingAndUnlinkingDistributedTracingInfo(null, null, null, null), is(true)); }
doReturn(argsEligibleForLinkUnlink).when(handlerSpy).argsAreEligibleForLinkingAndUnlinkingDistributedTracingInfo( eq(expectedHandlerMethodToExecute), eq(ctxMock), anyObject(), any(Throwable.class) ); int numExpectedArgsEligibleMethodCalls = (argsEligibleMethodShouldHaveBeenCalled) ? 1 : 0; verify(handlerSpy, times(numExpectedArgsEligibleMethodCalls)).argsAreEligibleForLinkingAndUnlinkingDistributedTracingInfo( eq(expectedHandlerMethodToExecute), eq(ctxMock), anyObject(), any(Throwable.class) );