use of io.opencensus.proto.agent.trace.v1.TraceServiceGrpc in project instrumentation-java by census-instrumentation.
the class FakeOcAgentTraceServiceGrpcImplTest method config.
@Test
public void config() {
FakeOcAgentTraceServiceGrpcImpl traceServiceGrpc = new FakeOcAgentTraceServiceGrpcImpl();
StreamObserver<CurrentLibraryConfig> currentConfigObsever = traceServiceGrpc.config(updatedConfigObserver);
CurrentLibraryConfig currentLibraryConfig = CurrentLibraryConfig.getDefaultInstance();
currentConfigObsever.onNext(currentLibraryConfig);
assertThat(traceServiceGrpc.getCurrentLibraryConfigs()).containsExactly(currentLibraryConfig);
assertThat(updatedLibraryConfigs).containsExactly(traceServiceGrpc.getUpdatedLibraryConfig());
updatedLibraryConfigs.clear();
}
use of io.opencensus.proto.agent.trace.v1.TraceServiceGrpc in project instrumentation-java by census-instrumentation.
the class FakeOcAgentTraceServiceGrpcImplTest method export.
@Test
public void export() {
FakeOcAgentTraceServiceGrpcImpl traceServiceGrpc = new FakeOcAgentTraceServiceGrpcImpl();
StreamObserver<ExportTraceServiceRequest> exportRequestObserver = traceServiceGrpc.export(exportResponseObserver);
ExportTraceServiceRequest request = ExportTraceServiceRequest.getDefaultInstance();
exportRequestObserver.onNext(request);
assertThat(traceServiceGrpc.getExportTraceServiceRequests()).containsExactly(request);
}
use of io.opencensus.proto.agent.trace.v1.TraceServiceGrpc in project instrumentation-java by census-instrumentation.
the class FakeOcAgentTraceServiceGrpcImplTest method config_WithNeverSampler.
@Test
public void config_WithNeverSampler() {
FakeOcAgentTraceServiceGrpcImpl traceServiceGrpc = new FakeOcAgentTraceServiceGrpcImpl();
traceServiceGrpc.setUpdatedLibraryConfig(neverSampledLibraryConfig);
StreamObserver<CurrentLibraryConfig> currentConfigObsever = traceServiceGrpc.config(updatedConfigObserver);
CurrentLibraryConfig currentLibraryConfig = CurrentLibraryConfig.getDefaultInstance();
currentConfigObsever.onNext(currentLibraryConfig);
assertThat(traceServiceGrpc.getCurrentLibraryConfigs()).containsExactly(currentLibraryConfig);
assertThat(updatedLibraryConfigs).containsExactly(neverSampledLibraryConfig);
updatedLibraryConfigs.clear();
}
Aggregations