Skip to content

Commit

Permalink
Adds vintage engine to zipkin-tests to help avoid time lost downstream (
Browse files Browse the repository at this point in the history
openzipkin#2778)

This prevents us from interfering with JUnit 4 runtimes.

See openzipkin/zipkin-gcp#130
  • Loading branch information
adriancole authored and abesto committed Sep 10, 2019
1 parent 61acadd commit 668a4a6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,12 @@
<version>${junit.jupiter.version}</version>
</dependency>

<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit.jupiter.version}</version>
</dependency>

<!--
Current versions of JUnit5 provide the above junit-jupiter artifact for convenience but we may
still have transitive dependencies on these older artifacts and have to make sure they're all
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ private void expectSuccess(ScribeSpanConsumer scribe, LogEntry entry) {
assertThat(scribeMetrics.spansDropped()).isZero();
}

@Test public void consumerExceptionBeforeCallbackSetsFutureException() {
@Test public void consumerExceptionBeforeCallbackDoesntSetFutureException() {
consumer = (input) -> {
throw new NullPointerException("endpoint was null");
};
Expand All @@ -166,7 +166,9 @@ private void expectSuccess(ScribeSpanConsumer scribe, LogEntry entry) {

CaptureAsyncMethodCallback callback = new CaptureAsyncMethodCallback();
scribe.Log(asList(entry), callback);
assertThat(callback.error).hasMessage("endpoint was null");

// Storage related exceptions are not propagated to the caller. Only marshalling ones are.
assertThat(callback.error).isNull();

assertThat(scribeMetrics.messages()).isEqualTo(1);
assertThat(scribeMetrics.messagesDropped()).isZero();
Expand Down
6 changes: 4 additions & 2 deletions zipkin-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@
<artifactId>gson</artifactId>
</dependency>

<!-- This prevents us from interfering with JUnit 4 runtimes.
See https://github.com/openzipkin/zipkin-gcp/issues/130 -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down

0 comments on commit 668a4a6

Please sign in to comment.