Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove opencensus-impl dependency.
Browse files Browse the repository at this point in the history
HailongWen committed Feb 8, 2018

Verified

This commit was signed with the committer’s verified signature.
addaleax Anna Henningsen
1 parent aec2843 commit f14c3bb
Showing 3 changed files with 18 additions and 10 deletions.
5 changes: 0 additions & 5 deletions google-cloud-bom/pom.xml
Original file line number Diff line number Diff line change
@@ -1047,11 +1047,6 @@
<artifactId>opencensus-api</artifactId>
<version>${opencensus.version}</version>
</dependency>
<dependency>
<groupId>io.opencensus</groupId>
<artifactId>opencensus-impl</artifactId>
<version>${opencensus.version}</version>
</dependency>
<dependency>
<groupId>io.opencensus</groupId>
<artifactId>opencensus-contrib-grpc-util</artifactId>
4 changes: 0 additions & 4 deletions google-cloud-core-http/pom.xml
Original file line number Diff line number Diff line change
@@ -127,10 +127,6 @@
<groupId>io.opencensus</groupId>
<artifactId>opencensus-api</artifactId>
</dependency>
<dependency>
<groupId>io.opencensus</groupId>
<artifactId>opencensus-impl</artifactId>
</dependency>
<dependency>
<groupId>io.opencensus</groupId>
<artifactId>opencensus-contrib-http-util</artifactId>
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@
import static com.google.common.truth.Truth.assertThat;

import static org.easymock.EasyMock.createMock;
import static org.easymock.EasyMock.createMockBuilder;
import static org.easymock.EasyMock.replay;
import static org.easymock.EasyMock.verify;

@@ -30,11 +31,18 @@
import com.google.api.client.http.javanet.NetHttpTransport;

import io.opencensus.common.Scope;
import io.opencensus.trace.Span;
import io.opencensus.trace.SpanContext;
import io.opencensus.trace.SpanId;
import io.opencensus.trace.TraceId;
import io.opencensus.trace.TraceOptions;
import io.opencensus.trace.Tracer;
import io.opencensus.trace.Tracing;
import io.opencensus.trace.propagation.TextFormat;

import java.io.IOException;
import java.util.EnumSet;
import java.util.Random;

import org.junit.Before;
import org.junit.Rule;
@@ -105,7 +113,16 @@ public void censusHttpExecuteInterceptorShouldExecuteOriginal() throws IOExcepti

@Test
public void censusHttpExecuteInterceptorShouldInjectHeader() throws IOException {
Scope scope = censusHttpModule.getTracer().spanBuilder("Test span").startScopedSpan();
Random random = new Random();
SpanContext spanContext = SpanContext.create(
TraceId.generateRandomId(random),
SpanId.generateRandomId(random),
TraceOptions.DEFAULT);
Span mockSpan = createMockBuilder(Span.class)
.withConstructor(SpanContext.class, EnumSet.class)
.withArgs(spanContext, null)
.createMock();
Scope scope = tracer.withSpan(mockSpan);
try {
HttpExecuteInterceptor interceptor = censusHttpModule.new CensusHttpExecuteInterceptor(null);
interceptor.intercept(httpRequest);

0 comments on commit f14c3bb

Please sign in to comment.