Search in sources :

Example 1 with LocalizedSamplingStrategy

use of com.amazonaws.xray.strategy.sampling.LocalizedSamplingStrategy in project aws-xray-sdk-java by aws.

the class AWSXRayServletFilterTest method getMockRecorder.

private AWSXRayRecorder getMockRecorder() {
    Emitter blankEmitter = mock(Emitter.class);
    LocalizedSamplingStrategy defaultSamplingStrategy = new LocalizedSamplingStrategy();
    Mockito.doReturn(true).when(blankEmitter).sendSegment(Mockito.anyObject());
    Mockito.doReturn(true).when(blankEmitter).sendSubsegment(Mockito.anyObject());
    return AWSXRayRecorderBuilder.standard().withEmitter(blankEmitter).withSamplingStrategy(defaultSamplingStrategy).build();
}
Also used : Emitter(com.amazonaws.xray.emitters.Emitter) LocalizedSamplingStrategy(com.amazonaws.xray.strategy.sampling.LocalizedSamplingStrategy)

Example 2 with LocalizedSamplingStrategy

use of com.amazonaws.xray.strategy.sampling.LocalizedSamplingStrategy in project aws-xray-sdk-java by aws.

the class DefaultStreamingStrategyTest method setupAWSXRay.

@Before
public void setupAWSXRay() {
    Emitter blankEmitter = Mockito.mock(Emitter.class);
    LocalizedSamplingStrategy defaultSamplingStrategy = new LocalizedSamplingStrategy();
    Mockito.doReturn(true).when(blankEmitter).sendSegment(Mockito.anyObject());
    Mockito.doReturn(true).when(blankEmitter).sendSubsegment(Mockito.anyObject());
    AWSXRay.setGlobalRecorder(AWSXRayRecorderBuilder.standard().withEmitter(blankEmitter).withSamplingStrategy(defaultSamplingStrategy).build());
    AWSXRay.clearTraceEntity();
}
Also used : Emitter(com.amazonaws.xray.emitters.Emitter) LocalizedSamplingStrategy(com.amazonaws.xray.strategy.sampling.LocalizedSamplingStrategy) Before(org.junit.Before)

Example 3 with LocalizedSamplingStrategy

use of com.amazonaws.xray.strategy.sampling.LocalizedSamplingStrategy in project aws-xray-sdk-java by aws.

the class EntityTest method setupAWSXRay.

@Before
public void setupAWSXRay() {
    Emitter blankEmitter = Mockito.mock(Emitter.class);
    LocalizedSamplingStrategy defaultSamplingStrategy = new LocalizedSamplingStrategy();
    Mockito.doReturn(true).when(blankEmitter).sendSegment(Mockito.anyObject());
    Mockito.doReturn(true).when(blankEmitter).sendSubsegment(Mockito.anyObject());
    AWSXRay.setGlobalRecorder(AWSXRayRecorderBuilder.standard().withEmitter(blankEmitter).withSamplingStrategy(defaultSamplingStrategy).build());
    AWSXRay.clearTraceEntity();
}
Also used : Emitter(com.amazonaws.xray.emitters.Emitter) LocalizedSamplingStrategy(com.amazonaws.xray.strategy.sampling.LocalizedSamplingStrategy) Before(org.junit.Before)

Example 4 with LocalizedSamplingStrategy

use of com.amazonaws.xray.strategy.sampling.LocalizedSamplingStrategy in project aws-xray-sdk-java by aws.

the class ConcurrencyTest method setupAWSXRay.

@BeforeEach
void setupAWSXRay() {
    Emitter blankEmitter = Mockito.mock(Emitter.class);
    LocalizedSamplingStrategy defaultSamplingStrategy = new LocalizedSamplingStrategy();
    Mockito.doReturn(true).when(blankEmitter).sendSegment(Mockito.anyObject());
    Mockito.doReturn(true).when(blankEmitter).sendSubsegment(Mockito.anyObject());
    AWSXRay.setGlobalRecorder(AWSXRayRecorderBuilder.standard().withEmitter(blankEmitter).withSamplingStrategy(defaultSamplingStrategy).build());
    AWSXRay.clearTraceEntity();
}
Also used : Emitter(com.amazonaws.xray.emitters.Emitter) LocalizedSamplingStrategy(com.amazonaws.xray.strategy.sampling.LocalizedSamplingStrategy) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 5 with LocalizedSamplingStrategy

use of com.amazonaws.xray.strategy.sampling.LocalizedSamplingStrategy in project aws-xray-sdk-java by aws.

the class AWSXRayRecorderTest method setupAWSXRay.

@Before
public void setupAWSXRay() {
    MockitoAnnotations.initMocks(this);
    Emitter blankEmitter = Mockito.mock(Emitter.class);
    LocalizedSamplingStrategy defaultSamplingStrategy = new LocalizedSamplingStrategy();
    Mockito.doReturn(true).when(blankEmitter).sendSegment(Mockito.anyObject());
    Mockito.doReturn(true).when(blankEmitter).sendSubsegment(Mockito.anyObject());
    AWSXRay.setGlobalRecorder(AWSXRayRecorderBuilder.standard().withEmitter(blankEmitter).withSamplingStrategy(defaultSamplingStrategy).build());
    AWSXRay.clearTraceEntity();
}
Also used : Emitter(com.amazonaws.xray.emitters.Emitter) LocalizedSamplingStrategy(com.amazonaws.xray.strategy.sampling.LocalizedSamplingStrategy) Before(org.junit.Before)

Aggregations

Emitter (com.amazonaws.xray.emitters.Emitter)7 LocalizedSamplingStrategy (com.amazonaws.xray.strategy.sampling.LocalizedSamplingStrategy)7 Before (org.junit.Before)3 BeforeEach (org.junit.jupiter.api.BeforeEach)3