From 3a7ebf5c953d5dae8da1e3f291b9c5652fc0edd5 Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Fri, 11 Oct 2019 11:02:02 +0100 Subject: [PATCH] Excavator: Upgrades Baseline to the latest version (#306) --- .baseline/checkstyle/checkstyle.xml | 8 +++++--- build.gradle | 2 +- .../src/test/java/com/palantir/tracing/TracingDemos.java | 8 ++++---- .../com/palantir/tracing/TestTracingExtensionDemo.java | 2 +- .../src/test/java/com/palantir/tracing/TracerTest.java | 8 ++++---- .../src/test/java/com/palantir/tracing/TracersTest.java | 4 ++-- 6 files changed, 17 insertions(+), 15 deletions(-) diff --git a/.baseline/checkstyle/checkstyle.xml b/.baseline/checkstyle/checkstyle.xml index f541b63e2..43ec38a3a 100644 --- a/.baseline/checkstyle/checkstyle.xml +++ b/.baseline/checkstyle/checkstyle.xml @@ -84,11 +84,13 @@ + org.apache.commons.lang3.Validate.*, + org.assertj.core.api.Assertions.*, + org.mockito.Mockito.*"/> diff --git a/build.gradle b/build.gradle index 9dccac181..ab8dc5369 100644 --- a/build.gradle +++ b/build.gradle @@ -27,7 +27,7 @@ buildscript { classpath 'com.github.jengelman.gradle.plugins:shadow:5.1.0' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' classpath 'com.netflix.nebula:nebula-publishing-plugin:14.0.0' - classpath 'com.palantir.baseline:gradle-baseline-java:2.10.1' + classpath 'com.palantir.baseline:gradle-baseline-java:2.19.0' classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.12.2' classpath 'gradle.plugin.org.inferred:gradle-processors:3.1.0' classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.12.4' diff --git a/tracing-demos/src/test/java/com/palantir/tracing/TracingDemos.java b/tracing-demos/src/test/java/com/palantir/tracing/TracingDemos.java index 151c921a6..6bf622af2 100644 --- a/tracing-demos/src/test/java/com/palantir/tracing/TracingDemos.java +++ b/tracing-demos/src/test/java/com/palantir/tracing/TracingDemos.java @@ -51,7 +51,7 @@ void handles_async_spans() throws Exception { Tracer.clearCurrentTrace(); // just pretending all these tasks are on a fresh request DetachedSpan crossThread = DetachedSpan.start("task-queue-time" + i); - executorService.submit(() -> { + executorService.execute(() -> { try (CloseableSpan t = crossThread.completeAndStartChild("task" + i)) { emit_nested_spans(); countDownLatch.countDown(); @@ -97,7 +97,7 @@ public void onFailure(Throwable _throwable) { }); try (CloseableTracer root = CloseableTracer.startSpan("bbb")) { - executorService.submit(() -> { + executorService.execute(() -> { future.set(null); }); } @@ -124,7 +124,7 @@ void multi_producer_single_consumer() throws InterruptedException { Tracer.clearCurrentTrace(); // just pretending all these tasks are on a fresh request DetachedSpan span = DetachedSpan.start("callback-pending" + i + " (cross thread span)"); - producerExecutorService.submit(() -> { + producerExecutorService.execute(() -> { work.add(new QueuedWork() { @Override public String name() { @@ -219,7 +219,7 @@ public void onFailure(Throwable _throwable) { } }, executor); - executor.submit(() -> { + executor.execute(() -> { future.set(null); }); diff --git a/tracing-test-utils/src/test/java/com/palantir/tracing/TestTracingExtensionDemo.java b/tracing-test-utils/src/test/java/com/palantir/tracing/TestTracingExtensionDemo.java index d68ff5434..f8ccc9e9c 100644 --- a/tracing-test-utils/src/test/java/com/palantir/tracing/TestTracingExtensionDemo.java +++ b/tracing-test-utils/src/test/java/com/palantir/tracing/TestTracingExtensionDemo.java @@ -91,7 +91,7 @@ void handles_async_spans() throws Exception { IntStream.range(0, numTasks).forEach(i -> { DetachedSpan detachedSpan = DetachedSpan.start("task-queue-time" + i); - executorService.submit(() -> { + executorService.execute(() -> { try (CloseableSpan closeableSpan = detachedSpan.completeAndStartChild("do-work-" + i)) { prod_code(); countDownLatch.countDown(); diff --git a/tracing/src/test/java/com/palantir/tracing/TracerTest.java b/tracing/src/test/java/com/palantir/tracing/TracerTest.java index 8464dc9db..89d4420e7 100644 --- a/tracing/src/test/java/com/palantir/tracing/TracerTest.java +++ b/tracing/src/test/java/com/palantir/tracing/TracerTest.java @@ -202,7 +202,7 @@ public void testTraceCopyIsIndependent() throws Exception { } finally { Tracer.fastCompleteSpan(); } - assertThat(Tracer.completeSpan().isPresent()).isFalse(); + assertThat(Tracer.completeSpan()).isNotPresent(); } @Test @@ -250,13 +250,13 @@ public void testCompleteSpanWithMetadataIncludesMetadata() { "key2", "value2"); Tracer.fastStartSpan("operation"); Optional maybeSpan = Tracer.completeSpan(metadata); - assertThat(maybeSpan.isPresent()).isTrue(); + assertThat(maybeSpan).isPresent(); assertThat(maybeSpan.get().getMetadata()).isEqualTo(metadata); } @Test public void testCompleteSpanWithoutMetadataHasNoMetadata() { - assertThat(startAndCompleteSpan().getMetadata().isEmpty()).isTrue(); + assertThat(startAndCompleteSpan().getMetadata()).isEmpty(); } @Test @@ -339,7 +339,7 @@ public void testCompleteRootSpanCompletesTrace() { } finally { Tracer.unsubscribe("traceIds"); } - assertThat(traceIds.size()).isEqualTo(2); + assertThat(traceIds).hasSize(2); } @Test diff --git a/tracing/src/test/java/com/palantir/tracing/TracersTest.java b/tracing/src/test/java/com/palantir/tracing/TracersTest.java index f9aefb9ed..d5dfb219a 100644 --- a/tracing/src/test/java/com/palantir/tracing/TracersTest.java +++ b/tracing/src/test/java/com/palantir/tracing/TracersTest.java @@ -603,7 +603,7 @@ private static Callable traceExpectingCallableWithSingleSpan(String operat String traceId = Tracer.getTraceId(); List trace = getCurrentTrace(); OpenSpan span = trace.remove(trace.size() - 1); - assertThat(trace.size()).isEqualTo(0); + assertThat(trace).hasSize(0); assertThat(traceId).isEqualTo(outsideTraceId); assertThat(span.getOperation()).isEqualTo(operation); @@ -619,7 +619,7 @@ private static Runnable traceExpectingRunnableWithSingleSpan(String operation) { String traceId = Tracer.getTraceId(); List trace = getCurrentTrace(); OpenSpan span = trace.remove(trace.size() - 1); - assertThat(trace.size()).isEqualTo(0); + assertThat(trace).hasSize(0); assertThat(traceId).isEqualTo(outsideTraceId); assertThat(span.getOperation()).isEqualTo(operation);