Skip to content

Commit

Permalink
Update TracingHandlerLambdaTest.java
Browse files Browse the repository at this point in the history
  • Loading branch information
atshaw43 authored Jul 24, 2023
1 parent dda2f84 commit 1a88af7
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ public void testSamplingOverrideFalseInLambda() throws Exception {
public void testSamplingOverrideTrueInLambda() {
Emitter mockedEmitted = Mockito.mock(DefaultEmitter.class);

TraceHeader header = TraceHeader.fromString(TRACE_HEADER);

PowerMockito.stub(PowerMockito.method(
LambdaSegmentContext.class, "getTraceHeaderFromEnvironment")).toReturn(header);
PowerMockito.stub(PowerMockito.method(
Expand All @@ -83,8 +85,6 @@ public void testSamplingOverrideTrueInLambda() {
.withEmitter(mockedEmitted)
.build();

TraceHeader header = TraceHeader.fromString(TRACE_HEADER);

Mockito.doAnswer(invocation -> { return true; }).when(mockedEmitted).sendSubsegment(any());

lambdaTestHelper(recorder, "testTrue", true);
Expand All @@ -95,6 +95,8 @@ public void testSamplingOverrideTrueInLambda() {
public void testSamplingOverrideMixedInLambda() {
Emitter mockedEmitted = Mockito.mock(DefaultEmitter.class);

TraceHeader header = TraceHeader.fromString(TRACE_HEADER);

PowerMockito.stub(PowerMockito.method(
LambdaSegmentContext.class, "getTraceHeaderFromEnvironment")).toReturn(header);
PowerMockito.stub(PowerMockito.method(
Expand All @@ -105,8 +107,6 @@ public void testSamplingOverrideMixedInLambda() {
.withEmitter(mockedEmitted)
.build();

TraceHeader header = TraceHeader.fromString(TRACE_HEADER);

Mockito.doAnswer(invocation -> { return true; }).when(mockedEmitted).sendSubsegment(any());

lambdaTestHelper(recorder, "test1", true);
Expand Down

0 comments on commit 1a88af7

Please sign in to comment.