From 3626528140d02705787fd95021d9c6360df9d5fe Mon Sep 17 00:00:00 2001 From: svc-excavator-bot Date: Tue, 22 Oct 2019 20:37:15 +0000 Subject: [PATCH 1/3] Excavator: Upgrades Baseline to the latest version --- .baseline/checkstyle/checkstyle.xml | 8 +++--- .baseline/spotless/eclipse.xml | 1 + build.gradle | 2 +- .../config/KeepAliveSslSocketFactory.java | 1 + .../config/ClientConfigurationsTest.java | 2 +- .../java/serialization/ObjectMappersTest.java | 2 +- .../NeverRetryingBackoffStrategy.java | 2 +- .../PathTemplateHeaderEnrichmentContract.java | 2 +- .../feignimpl/PathTemplateHeaderRewriter.java | 2 +- .../feignimpl/SlashEncodingContract.java | 2 +- .../jaxrs/JaxRsClientConfigRefreshTest.java | 4 +-- .../jaxrs/JaxRsClientProxyConfigTest.java | 4 +-- .../conjure/java/client/jaxrs/TracerTest.java | 4 +-- .../GuavaOptionalAwareDecoderTest.java | 2 +- .../jaxrs/feignimpl/GuavaTestServer.java | 2 +- .../Java8OptionalAwareDecoderTest.java | 2 +- .../jaxrs/feignimpl/Java8TestServer.java | 4 +-- .../jaxrs/feignimpl/ServiceConfigTest.java | 2 +- .../feignimpl/SlashEncodingContractTest.java | 2 +- .../feignimpl/TextDelegateDecoderTest.java | 10 +++---- .../feignimpl/TextDelegateEncoderTest.java | 6 ++--- .../server/jersey/ExceptionMappingTest.java | 6 ++--- ...ncSerializableErrorCallAdapterFactory.java | 10 +++---- ...ptionalObjectToStringConverterFactory.java | 2 +- .../retrofit2/Retrofit2ClientApiTest.java | 4 +-- .../Retrofit2ClientConfigRefreshTest.java | 4 +-- .../Retrofit2ClientFailoverTest.java | 12 ++++----- .../retrofit2/Retrofit2ClientProxyTest.java | 4 +-- .../server/AutoDeserializeTest.java | 5 ++-- .../undertest/ServerUnderTestApplication.java | 4 +-- .../java/config/ssl/KeyStoresTests.java | 6 ++--- .../config/ssl/pkcs1/Pkcs1ReadersTests.java | 2 +- .../java/okhttp/Okhttp39HostnameVerifier.java | 10 +++---- .../ConcurrencyLimitingInterceptorTest.java | 4 +-- .../conjure/java/okhttp/HostMetricsTest.java | 2 +- .../okhttp/InstrumentedInterceptorTest.java | 2 +- .../conjure/java/okhttp/LeakDetectorTest.java | 2 +- .../java/okhttp/OkHttpClientsTest.java | 26 +++++++++---------- 38 files changed, 88 insertions(+), 83 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/.baseline/spotless/eclipse.xml b/.baseline/spotless/eclipse.xml index 7bf7de787..fe1fc71ea 100644 --- a/.baseline/spotless/eclipse.xml +++ b/.baseline/spotless/eclipse.xml @@ -92,6 +92,7 @@ + diff --git a/build.gradle b/build.gradle index 82dcbc484..41d57d663 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ buildscript { classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' classpath 'com.netflix.nebula:gradle-dependency-lock-plugin:7.0.1' classpath 'com.netflix.nebula:nebula-publishing-plugin:14.0.0' - classpath 'com.palantir.baseline:gradle-baseline-java:2.7.0' + classpath 'com.palantir.baseline:gradle-baseline-java:2.25.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/client-config/src/main/java/com/palantir/conjure/java/client/config/KeepAliveSslSocketFactory.java b/client-config/src/main/java/com/palantir/conjure/java/client/config/KeepAliveSslSocketFactory.java index 7fc39e3f1..c67003edf 100644 --- a/client-config/src/main/java/com/palantir/conjure/java/client/config/KeepAliveSslSocketFactory.java +++ b/client-config/src/main/java/com/palantir/conjure/java/client/config/KeepAliveSslSocketFactory.java @@ -48,6 +48,7 @@ Socket wrap(Socket socket) throws SocketException { return socket; } + @Override public String toString() { return "KeepAliveSslSocketFactory{delegate=" + delegate + '}'; } diff --git a/client-config/src/test/java/com/palantir/conjure/java/client/config/ClientConfigurationsTest.java b/client-config/src/test/java/com/palantir/conjure/java/client/config/ClientConfigurationsTest.java index a43f9824c..cccb1f323 100644 --- a/client-config/src/test/java/com/palantir/conjure/java/client/config/ClientConfigurationsTest.java +++ b/client-config/src/test/java/com/palantir/conjure/java/client/config/ClientConfigurationsTest.java @@ -102,7 +102,7 @@ public void meshProxy_maxRetriesMustBe0() throws Exception { ClientConfiguration validConfig = ClientConfigurations.of(meshProxyServiceConfig(uris, 0)); assertThat(validConfig.meshProxy()).isEqualTo(Optional.of(HostAndPort.fromParts("localhost", 1234))); - assertThat(validConfig.maxNumRetries()).isEqualTo(0); + assertThat(validConfig.maxNumRetries()).isZero(); } @Test diff --git a/conjure-java-jackson-serialization/src/test/java/com/palantir/conjure/java/serialization/ObjectMappersTest.java b/conjure-java-jackson-serialization/src/test/java/com/palantir/conjure/java/serialization/ObjectMappersTest.java index dcba63720..714e3e5e3 100644 --- a/conjure-java-jackson-serialization/src/test/java/com/palantir/conjure/java/serialization/ObjectMappersTest.java +++ b/conjure-java-jackson-serialization/src/test/java/com/palantir/conjure/java/serialization/ObjectMappersTest.java @@ -66,7 +66,7 @@ public void deserializeJdk8ModulePresentOptional() throws IOException { @Test public void deserializeJdk8ModuleAbsentOptional() throws IOException { - assertThat(MAPPER.readValue("null", Optional.class)).isEqualTo(Optional.empty()); + assertThat(MAPPER.readValue("null", Optional.class)).isNotPresent(); } @Test diff --git a/conjure-java-jaxrs-client/src/main/java/com/palantir/conjure/java/client/jaxrs/feignimpl/NeverRetryingBackoffStrategy.java b/conjure-java-jaxrs-client/src/main/java/com/palantir/conjure/java/client/jaxrs/feignimpl/NeverRetryingBackoffStrategy.java index ed3909941..c66ade0ba 100644 --- a/conjure-java-jaxrs-client/src/main/java/com/palantir/conjure/java/client/jaxrs/feignimpl/NeverRetryingBackoffStrategy.java +++ b/conjure-java-jaxrs-client/src/main/java/com/palantir/conjure/java/client/jaxrs/feignimpl/NeverRetryingBackoffStrategy.java @@ -23,7 +23,7 @@ public enum NeverRetryingBackoffStrategy implements BackoffStrategy { INSTANCE; @Override - public boolean backoff(int numFailedAttempts) { + public boolean backoff(int _numFailedAttempts) { return false; } } diff --git a/conjure-java-jaxrs-client/src/main/java/com/palantir/conjure/java/client/jaxrs/feignimpl/PathTemplateHeaderEnrichmentContract.java b/conjure-java-jaxrs-client/src/main/java/com/palantir/conjure/java/client/jaxrs/feignimpl/PathTemplateHeaderEnrichmentContract.java index 9e567c122..25c6460fa 100644 --- a/conjure-java-jaxrs-client/src/main/java/com/palantir/conjure/java/client/jaxrs/feignimpl/PathTemplateHeaderEnrichmentContract.java +++ b/conjure-java-jaxrs-client/src/main/java/com/palantir/conjure/java/client/jaxrs/feignimpl/PathTemplateHeaderEnrichmentContract.java @@ -28,7 +28,7 @@ public PathTemplateHeaderEnrichmentContract(Contract delegate) { } @Override - protected void processMetadata(Class targetType, Method method, MethodMetadata metadata) { + protected void processMetadata(Class _targetType, Method _method, MethodMetadata metadata) { metadata.template() .header(OkhttpTraceInterceptor.PATH_TEMPLATE_HEADER, metadata.template().method() + " " diff --git a/conjure-java-jaxrs-client/src/main/java/com/palantir/conjure/java/client/jaxrs/feignimpl/PathTemplateHeaderRewriter.java b/conjure-java-jaxrs-client/src/main/java/com/palantir/conjure/java/client/jaxrs/feignimpl/PathTemplateHeaderRewriter.java index a2840640e..65d056e1a 100644 --- a/conjure-java-jaxrs-client/src/main/java/com/palantir/conjure/java/client/jaxrs/feignimpl/PathTemplateHeaderRewriter.java +++ b/conjure-java-jaxrs-client/src/main/java/com/palantir/conjure/java/client/jaxrs/feignimpl/PathTemplateHeaderRewriter.java @@ -28,7 +28,7 @@ public enum PathTemplateHeaderRewriter implements RequestInterceptor { INSTANCE; @Override - public void apply(RequestTemplate template) { + public void apply(RequestTemplate _template) { // nop } } diff --git a/conjure-java-jaxrs-client/src/main/java/com/palantir/conjure/java/client/jaxrs/feignimpl/SlashEncodingContract.java b/conjure-java-jaxrs-client/src/main/java/com/palantir/conjure/java/client/jaxrs/feignimpl/SlashEncodingContract.java index b02b07d83..eb0597ff8 100644 --- a/conjure-java-jaxrs-client/src/main/java/com/palantir/conjure/java/client/jaxrs/feignimpl/SlashEncodingContract.java +++ b/conjure-java-jaxrs-client/src/main/java/com/palantir/conjure/java/client/jaxrs/feignimpl/SlashEncodingContract.java @@ -30,7 +30,7 @@ public SlashEncodingContract(Contract delegate) { } @Override - protected void processMetadata(Class targetType, Method method, MethodMetadata metadata) { + protected void processMetadata(Class _targetType, Method _method, MethodMetadata metadata) { metadata.template().decodeSlash(false); } } diff --git a/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/JaxRsClientConfigRefreshTest.java b/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/JaxRsClientConfigRefreshTest.java index 2eff3938e..aa1a9aa1f 100644 --- a/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/JaxRsClientConfigRefreshTest.java +++ b/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/JaxRsClientConfigRefreshTest.java @@ -50,13 +50,13 @@ public void testConfigRefresh() throws Exception { server1.enqueue(new MockResponse().setBody("\"server1\"")); assertThat(proxy.string()).isEqualTo("server1"); assertThat(server1.getRequestCount()).isEqualTo(1); - assertThat(server2.getRequestCount()).isEqualTo(0); + assertThat(server2.getRequestCount()).isZero(); // Call 2 server1.enqueue(new MockResponse().setBody("\"server1\"")); assertThat(proxy.string()).isEqualTo("server1"); assertThat(server1.getRequestCount()).isEqualTo(2); - assertThat(server2.getRequestCount()).isEqualTo(0); + assertThat(server2.getRequestCount()).isZero(); // Switch config refreshableConfig.set(config2); diff --git a/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/JaxRsClientProxyConfigTest.java b/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/JaxRsClientProxyConfigTest.java index 3d158246c..7575dcbf9 100644 --- a/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/JaxRsClientProxyConfigTest.java +++ b/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/JaxRsClientProxyConfigTest.java @@ -89,13 +89,13 @@ public void testAuthenticatedProxy() throws Exception { private static ProxySelector createProxySelector(String host, int port) { return new ProxySelector() { @Override - public List select(URI uri) { + public List select(URI _uri) { InetSocketAddress addr = new InetSocketAddress(host, port); return ImmutableList.of(new Proxy(Proxy.Type.HTTP, addr)); } @Override - public void connectFailed(URI uri, SocketAddress sa, IOException ioe) {} + public void connectFailed(URI _uri, SocketAddress _sa, IOException _ioe) {} }; } } diff --git a/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/TracerTest.java b/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/TracerTest.java index 2432bd811..3643a2342 100644 --- a/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/TracerTest.java +++ b/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/TracerTest.java @@ -145,12 +145,12 @@ private void runTwoRequestsInParallel() { ExecutorService executor = Executors.newFixedThreadPool(2); CompletableFuture first = CompletableFuture.runAsync(() -> { Tracer.initTrace(Optional.of(true), "first"); - OpenSpan ignored = Tracer.startSpan(""); + Tracer.startSpan(""); service.string(); }, executor); CompletableFuture second = CompletableFuture.runAsync(() -> { Tracer.initTrace(Optional.of(true), "second"); - OpenSpan ignored = Tracer.startSpan(""); + Tracer.startSpan(""); service.string(); }, executor); first.join(); diff --git a/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/feignimpl/GuavaOptionalAwareDecoderTest.java b/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/feignimpl/GuavaOptionalAwareDecoderTest.java index 22b37b5a0..0a330b45e 100644 --- a/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/feignimpl/GuavaOptionalAwareDecoderTest.java +++ b/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/feignimpl/GuavaOptionalAwareDecoderTest.java @@ -66,7 +66,7 @@ public void testOptional() { @Test public void testNonOptional() { assertThat(service.getNonOptional("something")).isEqualTo(ImmutableMap.of("something", "something")); - assertThat(service.getNonOptional(null)).isEqualTo(ImmutableMap.of()); + assertThat(service.getNonOptional(null)).isEmpty(); } @Test diff --git a/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/feignimpl/GuavaTestServer.java b/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/feignimpl/GuavaTestServer.java index 5986ccd96..7c6b0253b 100644 --- a/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/feignimpl/GuavaTestServer.java +++ b/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/feignimpl/GuavaTestServer.java @@ -43,7 +43,7 @@ public class GuavaTestServer extends Application { @Override - public final void run(Configuration config, final Environment env) throws Exception { + public final void run(Configuration _config, final Environment env) throws Exception { env.jersey().register(ConjureJerseyFeature.INSTANCE); env.jersey().register(new JacksonMessageBodyProvider(ObjectMappers.newServerObjectMapper())); env.jersey().register(new TestResource()); diff --git a/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/feignimpl/Java8OptionalAwareDecoderTest.java b/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/feignimpl/Java8OptionalAwareDecoderTest.java index d87847015..732a25092 100644 --- a/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/feignimpl/Java8OptionalAwareDecoderTest.java +++ b/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/feignimpl/Java8OptionalAwareDecoderTest.java @@ -66,7 +66,7 @@ public void testOptional() { @Test public void testNonOptional() { assertThat(service.getNonOptional("something")).isEqualTo(ImmutableMap.of("something", "something")); - assertThat(service.getNonOptional(null)).isEqualTo(ImmutableMap.of()); + assertThat(service.getNonOptional(null)).isEmpty(); } @Test diff --git a/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/feignimpl/Java8TestServer.java b/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/feignimpl/Java8TestServer.java index c8b2f84e7..763926abf 100644 --- a/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/feignimpl/Java8TestServer.java +++ b/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/feignimpl/Java8TestServer.java @@ -51,7 +51,7 @@ public class Java8TestServer extends Application { @Override - public final void run(Configuration config, final Environment env) throws Exception { + public final void run(Configuration _config, final Environment env) throws Exception { env.jersey().register(ConjureJerseyFeature.INSTANCE); env.jersey().register(new JacksonMessageBodyProvider(ObjectMappers.newServerObjectMapper())); env.jersey().register(new EmptyOptionalTo204ExceptionMapper()); @@ -61,7 +61,7 @@ public final void run(Configuration config, final Environment env) throws Except @Provider private static final class EmptyOptionalTo204ExceptionMapper implements ExceptionMapper { @Override - public Response toResponse(EmptyOptionalException exception) { + public Response toResponse(EmptyOptionalException _exception) { return Response.noContent().build(); } } diff --git a/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/feignimpl/ServiceConfigTest.java b/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/feignimpl/ServiceConfigTest.java index 03fd51643..5dee87fb0 100644 --- a/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/feignimpl/ServiceConfigTest.java +++ b/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/feignimpl/ServiceConfigTest.java @@ -83,7 +83,7 @@ public void initialize(Bootstrap bootstrap) { } @Override - public void run(ServiceConfigTestAppConfig configuration, Environment environment) throws Exception { + public void run(ServiceConfigTestAppConfig _configuration, Environment environment) throws Exception { environment.jersey().register(new Resource()); } diff --git a/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/feignimpl/SlashEncodingContractTest.java b/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/feignimpl/SlashEncodingContractTest.java index e4a988087..c95ef708a 100644 --- a/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/feignimpl/SlashEncodingContractTest.java +++ b/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/feignimpl/SlashEncodingContractTest.java @@ -92,7 +92,7 @@ public interface Service { public static class Server extends Application { @Override - public final void run(Configuration config, final Environment env) throws Exception { + public final void run(Configuration _config, final Environment env) throws Exception { env.jersey().register(resource); } } diff --git a/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/feignimpl/TextDelegateDecoderTest.java b/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/feignimpl/TextDelegateDecoderTest.java index 1a88cb61d..b151dd21c 100644 --- a/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/feignimpl/TextDelegateDecoderTest.java +++ b/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/feignimpl/TextDelegateDecoderTest.java @@ -21,7 +21,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.mockito.Matchers.any; import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verifyZeroInteractions; +import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; import com.google.common.collect.ImmutableSet; @@ -82,7 +82,7 @@ public void testUsesStringDecoderWithTextPlain() throws Exception { Object decodedObject = textDelegateDecoder.decode(response, String.class); assertThat("text response").isEqualTo(decodedObject); - verifyZeroInteractions(delegate); + verifyNoMoreInteractions(delegate); } @Test @@ -100,7 +100,7 @@ public void testUsesStringDecoderWithTextPlainAndCharset() throws Exception { Object decodedObject = textDelegateDecoder.decode(response, String.class); assertThat("text response").isEqualTo(decodedObject); - verifyZeroInteractions(delegate); + verifyNoMoreInteractions(delegate); } @Test @@ -110,7 +110,7 @@ public void testUsesStringDecoderWithTextPlainWithWeirdHeaderCapitalization() th Object decodedObject = textDelegateDecoder.decode(response, String.class); assertThat("text response").isEqualTo(decodedObject); - verifyZeroInteractions(delegate); + verifyNoMoreInteractions(delegate); } @Test @@ -120,7 +120,7 @@ public void testReturnsEmptyStringForNullResponseBodyWithTextPlain() throws Exce Object decodedObject = textDelegateDecoder.decode(response, String.class); assertThat(decodedObject).isEqualTo(""); - verifyZeroInteractions(delegate); + verifyNoMoreInteractions(delegate); } @Test diff --git a/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/feignimpl/TextDelegateEncoderTest.java b/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/feignimpl/TextDelegateEncoderTest.java index 1e39b69d9..cf933993f 100644 --- a/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/feignimpl/TextDelegateEncoderTest.java +++ b/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/feignimpl/TextDelegateEncoderTest.java @@ -18,7 +18,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyZeroInteractions; +import static org.mockito.Mockito.verifyNoMoreInteractions; import com.google.common.collect.Maps; import com.google.common.net.HttpHeaders; @@ -66,7 +66,7 @@ public void doesNotUseDelegateWhenContentTypeIsTextPlain() { headers.put(HttpHeaders.CONTENT_TYPE, Arrays.asList(MediaType.TEXT_PLAIN)); requestTemplate.headers(headers); textDelegateEncoder.encode(null, null, requestTemplate); - verifyZeroInteractions(delegate); + verifyNoMoreInteractions(delegate); } @Test @@ -74,6 +74,6 @@ public void doesNotUseDelegateWhenContentTypeHeaderHasArbitraryCase() { headers.put("Content-TYPE", Arrays.asList(MediaType.TEXT_PLAIN)); requestTemplate.headers(headers); textDelegateEncoder.encode(null, null, requestTemplate); - verifyZeroInteractions(delegate); + verifyNoMoreInteractions(delegate); } } diff --git a/conjure-java-jersey-server/src/test/java/com/palantir/conjure/java/server/jersey/ExceptionMappingTest.java b/conjure-java-jersey-server/src/test/java/com/palantir/conjure/java/server/jersey/ExceptionMappingTest.java index cab845328..1001b8b8a 100644 --- a/conjure-java-jersey-server/src/test/java/com/palantir/conjure/java/server/jersey/ExceptionMappingTest.java +++ b/conjure-java-jersey-server/src/test/java/com/palantir/conjure/java/server/jersey/ExceptionMappingTest.java @@ -140,9 +140,9 @@ public void testServiceException() throws IOException { Map rawError = ObjectMappers.newClientObjectMapper().readValue(body, new TypeReference>() {}); - assertThat(rawError.get("errorCode")).isEqualTo(ErrorType.INVALID_ARGUMENT.code().toString()); - assertThat(rawError.get("errorName")).isEqualTo(ErrorType.INVALID_ARGUMENT.name()); - assertThat(rawError.get("parameters")).isEqualTo(ImmutableMap.of("arg", "value")); + assertThat(rawError).containsEntry("errorCode", ErrorType.INVALID_ARGUMENT.code().toString()); + assertThat(rawError).containsEntry("errorName", ErrorType.INVALID_ARGUMENT.name()); + assertThat(rawError).containsEntry("parameters", ImmutableMap.of("arg", "value")); } @Test diff --git a/conjure-java-retrofit2-client/src/main/java/com/palantir/conjure/java/client/retrofit2/AsyncSerializableErrorCallAdapterFactory.java b/conjure-java-retrofit2-client/src/main/java/com/palantir/conjure/java/client/retrofit2/AsyncSerializableErrorCallAdapterFactory.java index d27de51af..460a8f171 100644 --- a/conjure-java-retrofit2-client/src/main/java/com/palantir/conjure/java/client/retrofit2/AsyncSerializableErrorCallAdapterFactory.java +++ b/conjure-java-retrofit2-client/src/main/java/com/palantir/conjure/java/client/retrofit2/AsyncSerializableErrorCallAdapterFactory.java @@ -48,7 +48,7 @@ final class AsyncSerializableErrorCallAdapterFactory extends CallAdapter.Factory private AsyncSerializableErrorCallAdapterFactory() {} @Override - public CallAdapter get(Type returnType, Annotation[] annotations, Retrofit retrofit) { + public CallAdapter get(Type returnType, Annotation[] _annotations, Retrofit _retrofit) { Type outerType = getRawType(returnType); if (outerType != CompletableFuture.class && outerType != ListenableFuture.class) { return null; @@ -91,7 +91,7 @@ public boolean cancel(boolean mayInterruptIfRunning) { } @Override - public void onResponse(Call call, Response response) { + public void onResponse(Call _call, Response response) { boolean futureWasCancelled = !set(response.body()); if (futureWasCancelled) { close(response); @@ -99,7 +99,7 @@ public void onResponse(Call call, Response response) { } @Override - public void onFailure(Call call, Throwable throwable) { + public void onFailure(Call _call, Throwable throwable) { // TODO(rfink): Would be good to not leak okhttp internals here if (throwable instanceof IoRemoteException) { setException(((IoRemoteException) throwable).getWrappedException()); @@ -157,7 +157,7 @@ public boolean cancel(boolean mayInterruptIfRunning) { call.enqueue(new Callback() { @Override - public void onResponse(Call call, Response response) { + public void onResponse(Call _call, Response response) { boolean futureWasCancelled = !future.complete(response.body()); if (futureWasCancelled) { close(response); @@ -165,7 +165,7 @@ public void onResponse(Call call, Response response) { } @Override - public void onFailure(Call call, Throwable throwable) { + public void onFailure(Call _call, Throwable throwable) { // TODO(rfink): Would be good to not leak okhttp internals here if (throwable instanceof IoRemoteException) { future.completeExceptionally( diff --git a/conjure-java-retrofit2-client/src/main/java/com/palantir/conjure/java/client/retrofit2/OptionalObjectToStringConverterFactory.java b/conjure-java-retrofit2-client/src/main/java/com/palantir/conjure/java/client/retrofit2/OptionalObjectToStringConverterFactory.java index aacf5d6d9..34b5e497b 100644 --- a/conjure-java-retrofit2-client/src/main/java/com/palantir/conjure/java/client/retrofit2/OptionalObjectToStringConverterFactory.java +++ b/conjure-java-retrofit2-client/src/main/java/com/palantir/conjure/java/client/retrofit2/OptionalObjectToStringConverterFactory.java @@ -39,7 +39,7 @@ public final class OptionalObjectToStringConverterFactory extends Converter.Fact private OptionalObjectToStringConverterFactory() {} @Override - public Converter stringConverter(Type type, Annotation[] annotations, Retrofit retrofit) { + public Converter stringConverter(Type type, Annotation[] annotations, Retrofit _retrofit) { Optional pathQueryAnnotation = ImmutableList.copyOf(annotations) .stream() .map(Annotation::annotationType) diff --git a/conjure-java-retrofit2-client/src/test/java/com/palantir/conjure/java/client/retrofit2/Retrofit2ClientApiTest.java b/conjure-java-retrofit2-client/src/test/java/com/palantir/conjure/java/client/retrofit2/Retrofit2ClientApiTest.java index 5577b7be8..499d8f32d 100644 --- a/conjure-java-retrofit2-client/src/test/java/com/palantir/conjure/java/client/retrofit2/Retrofit2ClientApiTest.java +++ b/conjure-java-retrofit2-client/src/test/java/com/palantir/conjure/java/client/retrofit2/Retrofit2ClientApiTest.java @@ -399,12 +399,12 @@ public void async_retrofit_call_should_throw_RemoteException_for_server_serializ retrofit2.Call call = service.getRelative(); call.enqueue(new retrofit2.Callback() { @Override - public void onResponse(Call call, Response response) { + public void onResponse(Call _call, Response _response) { failBecauseExceptionWasNotThrown(RemoteException.class); } @Override - public void onFailure(Call call, Throwable throwable) { + public void onFailure(Call _call, Throwable throwable) { assertThat(throwable).isInstanceOf(RemoteException.class); assertThat(((RemoteException) throwable).getError()).isEqualTo(ERROR); assertionsPassed.countDown(); // if you delete this countdown latch then this test will vacuously pass. diff --git a/conjure-java-retrofit2-client/src/test/java/com/palantir/conjure/java/client/retrofit2/Retrofit2ClientConfigRefreshTest.java b/conjure-java-retrofit2-client/src/test/java/com/palantir/conjure/java/client/retrofit2/Retrofit2ClientConfigRefreshTest.java index ebe366e06..d58432193 100644 --- a/conjure-java-retrofit2-client/src/test/java/com/palantir/conjure/java/client/retrofit2/Retrofit2ClientConfigRefreshTest.java +++ b/conjure-java-retrofit2-client/src/test/java/com/palantir/conjure/java/client/retrofit2/Retrofit2ClientConfigRefreshTest.java @@ -49,13 +49,13 @@ public void testConfigRefresh() throws Exception { server1.enqueue(new MockResponse().setBody("\"server1\"")); assertThat(proxy.get().execute().body()).isEqualTo("server1"); assertThat(server1.getRequestCount()).isEqualTo(1); - assertThat(server2.getRequestCount()).isEqualTo(0); + assertThat(server2.getRequestCount()).isZero(); // Call 2 server1.enqueue(new MockResponse().setBody("\"server1\"")); assertThat(proxy.get().execute().body()).isEqualTo("server1"); assertThat(server1.getRequestCount()).isEqualTo(2); - assertThat(server2.getRequestCount()).isEqualTo(0); + assertThat(server2.getRequestCount()).isZero(); // Switch config refreshableConfig.set(config2); diff --git a/conjure-java-retrofit2-client/src/test/java/com/palantir/conjure/java/client/retrofit2/Retrofit2ClientFailoverTest.java b/conjure-java-retrofit2-client/src/test/java/com/palantir/conjure/java/client/retrofit2/Retrofit2ClientFailoverTest.java index ffd2a7f6a..5ad867083 100644 --- a/conjure-java-retrofit2-client/src/test/java/com/palantir/conjure/java/client/retrofit2/Retrofit2ClientFailoverTest.java +++ b/conjure-java-retrofit2-client/src/test/java/com/palantir/conjure/java/client/retrofit2/Retrofit2ClientFailoverTest.java @@ -130,12 +130,12 @@ public void testQosError_performsFailover_forAsynchronousOperation( CompletableFuture future = new CompletableFuture<>(); proxy.get().enqueue(new Callback() { @Override - public void onResponse(Call call, Response response) { + public void onResponse(Call _call, Response response) { future.complete(response.body()); } @Override - public void onFailure(Call call, Throwable throwable) { + public void onFailure(Call _call, Throwable throwable) { future.completeExceptionally(throwable); } }); @@ -215,12 +215,12 @@ public void testQosError_performsRetryWithOneNode_forAsynchronousOperation() thr CompletableFuture future = new CompletableFuture<>(); anotherProxy.get().enqueue(new Callback() { @Override - public void onResponse(Call call, Response response) { + public void onResponse(Call _call, Response response) { future.complete(response.body()); } @Override - public void onFailure(Call call, Throwable throwable) { + public void onFailure(Call _call, Throwable throwable) { future.completeExceptionally(throwable); } }); @@ -247,12 +247,12 @@ public void testQosError_performsRetryWithOneNodeAndCache_forAsynchronousOperati CompletableFuture future = new CompletableFuture<>(); anotherProxy.get().enqueue(new Callback() { @Override - public void onResponse(Call call, Response response) { + public void onResponse(Call _call, Response response) { future.complete(response.body()); } @Override - public void onFailure(Call call, Throwable throwable) { + public void onFailure(Call _call, Throwable throwable) { future.completeExceptionally(throwable); } }); diff --git a/conjure-java-retrofit2-client/src/test/java/com/palantir/conjure/java/client/retrofit2/Retrofit2ClientProxyTest.java b/conjure-java-retrofit2-client/src/test/java/com/palantir/conjure/java/client/retrofit2/Retrofit2ClientProxyTest.java index 950da06be..a7ad35561 100644 --- a/conjure-java-retrofit2-client/src/test/java/com/palantir/conjure/java/client/retrofit2/Retrofit2ClientProxyTest.java +++ b/conjure-java-retrofit2-client/src/test/java/com/palantir/conjure/java/client/retrofit2/Retrofit2ClientProxyTest.java @@ -89,13 +89,13 @@ public void testAuthenticatedProxy() throws Exception { private static ProxySelector createProxySelector(String host, int port) { return new ProxySelector() { @Override - public List select(URI uri) { + public List select(URI _uri) { InetSocketAddress addr = new InetSocketAddress(host, port); return ImmutableList.of(new Proxy(Proxy.Type.HTTP, addr)); } @Override - public void connectFailed(URI uri, SocketAddress sa, IOException ioe) {} + public void connectFailed(URI _uri, SocketAddress _sa, IOException _ioe) {} }; } } diff --git a/conjure-java-server-verifier/src/test/java/com/palantir/verification/server/AutoDeserializeTest.java b/conjure-java-server-verifier/src/test/java/com/palantir/verification/server/AutoDeserializeTest.java index 716cc434b..35ff484bd 100644 --- a/conjure-java-server-verifier/src/test/java/com/palantir/verification/server/AutoDeserializeTest.java +++ b/conjure-java-server-verifier/src/test/java/com/palantir/verification/server/AutoDeserializeTest.java @@ -36,12 +36,13 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -import org.slf4j.Logger; import org.slf4j.LoggerFactory; @RunWith(Parameterized.class) public class AutoDeserializeTest { - private static final Logger log = LoggerFactory.getLogger(AutoDeserializeTest.class); + static { + LoggerFactory.getLogger(AutoDeserializeTest.class); + } @ClassRule public static final DropwizardAppRule serverUnderTestRule = new DropwizardAppRule<>( diff --git a/conjure-java-server-verifier/src/test/java/com/palantir/verification/server/undertest/ServerUnderTestApplication.java b/conjure-java-server-verifier/src/test/java/com/palantir/verification/server/undertest/ServerUnderTestApplication.java index 4007a8895..1cd2299ca 100644 --- a/conjure-java-server-verifier/src/test/java/com/palantir/verification/server/undertest/ServerUnderTestApplication.java +++ b/conjure-java-server-verifier/src/test/java/com/palantir/verification/server/undertest/ServerUnderTestApplication.java @@ -44,7 +44,7 @@ public void initialize(Bootstrap bootstrap) { } @Override - public void run(Configuration configuration, Environment environment) { + public void run(Configuration _configuration, Environment environment) { environment.jersey() .register( Reflection.newProxy(AutoDeserializeService.class, new EchoResourceInvocationHandler())); @@ -59,7 +59,7 @@ public void run(Configuration configuration, Environment environment) { */ static class EchoResourceInvocationHandler extends AbstractInvocationHandler { @Override - protected Object handleInvocation(Object proxy, Method method, Object[] args) { + protected Object handleInvocation(Object _proxy, Method method, Object[] args) { Preconditions.checkArgument(args.length == 1, "Expected single argument. Method: %s", method); return args[0]; } diff --git a/keystores/src/test/java/com/palantir/conjure/java/config/ssl/KeyStoresTests.java b/keystores/src/test/java/com/palantir/conjure/java/config/ssl/KeyStoresTests.java index 2c1efd7f0..785245348 100644 --- a/keystores/src/test/java/com/palantir/conjure/java/config/ssl/KeyStoresTests.java +++ b/keystores/src/test/java/com/palantir/conjure/java/config/ssl/KeyStoresTests.java @@ -66,7 +66,7 @@ public void testCreateTrustStoreFromEmptyDirectory() throws GeneralSecurityExcep File certFolder = tempFolder.newFolder(); KeyStore trustStore = KeyStores.createTrustStoreFromCertificates(certFolder.toPath()); - assertThat(trustStore.size()).isEqualTo(0); + assertThat(trustStore.size()).isZero(); } @Test @@ -75,7 +75,7 @@ public void testCreateTrustStoreFromDirectoryIgnoresHiddenFiles() throws IOExcep Files.copy(TestConstants.CA_DER_CERT_PATH.toFile(), certFolder.toPath().resolve(".hidden_file").toFile()); KeyStore trustStore = KeyStores.createTrustStoreFromCertificates(certFolder.toPath()); - assertThat(trustStore.size()).isEqualTo(0); + assertThat(trustStore.size()).isZero(); } @Test @@ -167,7 +167,7 @@ public void testCreateKeyStoreFromEmptyDirectory() throws GeneralSecurityExcepti File keyFolder = tempFolder.newFolder(); KeyStore trustStore = KeyStores.createKeyStoreFromCombinedPems(keyFolder.toPath(), "changeit"); - assertThat(trustStore.size()).isEqualTo(0); + assertThat(trustStore.size()).isZero(); } @Test diff --git a/keystores/src/test/java/com/palantir/conjure/java/config/ssl/pkcs1/Pkcs1ReadersTests.java b/keystores/src/test/java/com/palantir/conjure/java/config/ssl/pkcs1/Pkcs1ReadersTests.java index 9a9d02810..3562f1dff 100644 --- a/keystores/src/test/java/com/palantir/conjure/java/config/ssl/pkcs1/Pkcs1ReadersTests.java +++ b/keystores/src/test/java/com/palantir/conjure/java/config/ssl/pkcs1/Pkcs1ReadersTests.java @@ -31,7 +31,7 @@ public final class Pkcs1ReadersTests { public void testReadPrivateKeyFailsIfNoProvidersPresent() throws IOException { Assume.assumeFalse(ServiceLoader.load(Pkcs1Reader.class).iterator().hasNext()); - assertThatThrownBy(() -> Pkcs1Readers.getInstance()) + assertThatThrownBy(Pkcs1Readers::getInstance) .isInstanceOf(IllegalStateException.class) .hasMessageContaining("No Pkcs1Reader services were present"); } diff --git a/okhttp-clients/src/main/java/com/palantir/conjure/java/okhttp/Okhttp39HostnameVerifier.java b/okhttp-clients/src/main/java/com/palantir/conjure/java/okhttp/Okhttp39HostnameVerifier.java index 6e93e5191..cf236ec58 100644 --- a/okhttp-clients/src/main/java/com/palantir/conjure/java/okhttp/Okhttp39HostnameVerifier.java +++ b/okhttp-clients/src/main/java/com/palantir/conjure/java/okhttp/Okhttp39HostnameVerifier.java @@ -150,14 +150,14 @@ public boolean verifyHostname(String hostname, String pattern) { // Basic sanity checks // Check length == 0 instead of .isEmpty() to support Java 5. if ((hostname == null) || (hostname.length() == 0) - || (hostname.startsWith(".")) - || (hostname.endsWith(".."))) { + || hostname.startsWith(".") + || hostname.endsWith("..")) { // Invalid domain name return false; } if ((pattern == null) || (pattern.length() == 0) - || (pattern.startsWith(".")) - || (pattern.endsWith(".."))) { + || pattern.startsWith(".") + || pattern.endsWith("..")) { // Invalid pattern/domain name return false; } @@ -198,7 +198,7 @@ public boolean verifyHostname(String hostname, String pattern) { // sub.test.example.com. // 3. Wildcard patterns for single-label domain names are not permitted. - if ((!pattern.startsWith("*.")) || (pattern.indexOf('*', 1) != -1)) { + if (!pattern.startsWith("*.") || (pattern.indexOf('*', 1) != -1)) { // Asterisk (*) is only permitted in the left-most domain name label and must be the only // character in that label return false; diff --git a/okhttp-clients/src/test/java/com/palantir/conjure/java/okhttp/ConcurrencyLimitingInterceptorTest.java b/okhttp-clients/src/test/java/com/palantir/conjure/java/okhttp/ConcurrencyLimitingInterceptorTest.java index 580cfb82b..baa8c2f92 100644 --- a/okhttp-clients/src/test/java/com/palantir/conjure/java/okhttp/ConcurrencyLimitingInterceptorTest.java +++ b/okhttp-clients/src/test/java/com/palantir/conjure/java/okhttp/ConcurrencyLimitingInterceptorTest.java @@ -19,7 +19,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyZeroInteractions; +import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; import com.google.common.util.concurrent.Futures; @@ -115,7 +115,7 @@ public void wrapsResponseBody() throws IOException { ResponseBody body = ResponseBody.create(MediaType.parse("application/json"), data); when(chain.proceed(request)).thenReturn(response.newBuilder().body(body).build()); Response wrappedResponse = interceptor.intercept(chain); - verifyZeroInteractions(listener); + verifyNoMoreInteractions(listener); assertThat(wrappedResponse.body().string()).isEqualTo(data); verify(listener).onSuccess(); } diff --git a/okhttp-clients/src/test/java/com/palantir/conjure/java/okhttp/HostMetricsTest.java b/okhttp-clients/src/test/java/com/palantir/conjure/java/okhttp/HostMetricsTest.java index 83570c353..a903b4e97 100644 --- a/okhttp-clients/src/test/java/com/palantir/conjure/java/okhttp/HostMetricsTest.java +++ b/okhttp-clients/src/test/java/com/palantir/conjure/java/okhttp/HostMetricsTest.java @@ -90,7 +90,7 @@ public void testUpdateMetricUpdatesMeter_other() { private void testUpdateMetricUpdatesMeter(int statusCode, Timer timer) { assertThat(timer.getCount()).isZero(); - assertThat(timer.getSnapshot().getMin()).isEqualTo(0); + assertThat(timer.getSnapshot().getMin()).isZero(); hostMetrics.record(statusCode, 1); diff --git a/okhttp-clients/src/test/java/com/palantir/conjure/java/okhttp/InstrumentedInterceptorTest.java b/okhttp-clients/src/test/java/com/palantir/conjure/java/okhttp/InstrumentedInterceptorTest.java index 3a9239012..6c62f4628 100644 --- a/okhttp-clients/src/test/java/com/palantir/conjure/java/okhttp/InstrumentedInterceptorTest.java +++ b/okhttp-clients/src/test/java/com/palantir/conjure/java/okhttp/InstrumentedInterceptorTest.java @@ -85,7 +85,7 @@ public void testResponseMetricRegistered() throws IOException { .build(); Timer timer = registry.timer(name); - assertThat(timer.getCount()).isEqualTo(0); + assertThat(timer.getCount()).isZero(); successfulRequest(REQUEST_A); interceptor.intercept(chain); diff --git a/okhttp-clients/src/test/java/com/palantir/conjure/java/okhttp/LeakDetectorTest.java b/okhttp-clients/src/test/java/com/palantir/conjure/java/okhttp/LeakDetectorTest.java index fd84d176e..e7775afab 100644 --- a/okhttp-clients/src/test/java/com/palantir/conjure/java/okhttp/LeakDetectorTest.java +++ b/okhttp-clients/src/test/java/com/palantir/conjure/java/okhttp/LeakDetectorTest.java @@ -45,7 +45,7 @@ public void canUnregister() { String track = UUID.randomUUID().toString(); leakDetector.register(track, Optional.empty()); leakDetector.unregister(track); - track = null; + System.gc(); leakDetector.register("trigger", Optional.empty()); assertThat(leaks).isEmpty(); diff --git a/okhttp-clients/src/test/java/com/palantir/conjure/java/okhttp/OkHttpClientsTest.java b/okhttp-clients/src/test/java/com/palantir/conjure/java/okhttp/OkHttpClientsTest.java index 3a2545e16..4dd471f89 100644 --- a/okhttp-clients/src/test/java/com/palantir/conjure/java/okhttp/OkHttpClientsTest.java +++ b/okhttp-clients/src/test/java/com/palantir/conjure/java/okhttp/OkHttpClientsTest.java @@ -123,12 +123,12 @@ public void cancelCall() { } @Override - public void onFailure(Call unused, IOException exception) { + public void onFailure(Call _value, IOException exception) { setException(exception); } @Override - public void onResponse(Call unused, Response response) { + public void onResponse(Call _value, Response response) { set(response); } @@ -253,10 +253,10 @@ public void handlesSuccessfulResponseCodesWithSuccessHandler() throws Exception CountDownLatch wasSuccessful = new CountDownLatch(1); call.enqueue(new Callback() { @Override - public void onFailure(Call call, IOException exception) {} + public void onFailure(Call _call, IOException _exception) {} @Override - public void onResponse(Call call, Response response) throws IOException { + public void onResponse(Call _call, Response response) throws IOException { if (response.code() == code) { wasSuccessful.countDown(); } @@ -275,12 +275,12 @@ public void successfulCallDoesNotInvokeFailureHandler() throws Exception { Semaphore successHandlerExecuted = new Semaphore(0); call.enqueue(new Callback() { @Override - public void onFailure(Call call, IOException ioException) { + public void onFailure(Call _call, IOException _ioException) { failureHandlerExecuted.release(); // should never happen } @Override - public void onResponse(Call call, Response response) throws IOException { + public void onResponse(Call _call, Response _response) throws IOException { successHandlerExecuted.release(); } }); @@ -299,12 +299,12 @@ public void unsuccessfulCallDoesNotInvokeSuccessHandler() throws Exception { Semaphore successHandlerExecuted = new Semaphore(0); call.enqueue(new Callback() { @Override - public void onFailure(Call call, IOException ioException) { + public void onFailure(Call _call, IOException _ioException) { failureHandlerExecuted.release(); } @Override - public void onResponse(Call call, Response response) throws IOException { + public void onResponse(Call _call, Response _response) throws IOException { successHandlerExecuted.release(); // should never happen } }); @@ -498,12 +498,12 @@ public void handlesQosExceptions_asyncCall() throws Exception { CompletableFuture future = new CompletableFuture<>(); call.enqueue(new Callback() { @Override - public void onFailure(Call call, IOException ioException) { + public void onFailure(Call _call, IOException ioException) { future.completeExceptionally(ioException); } @Override - public void onResponse(Call call, Response response) throws IOException { + public void onResponse(Call _call, Response response) throws IOException { future.complete(response.body().string()); } }); @@ -639,7 +639,7 @@ public void handlesIoExceptions_obeysMaxNumRetries() throws Exception { .hasLogMessage("Failed to complete the request due to an IOException") .hasExactlyArgs(UnsafeArg.of("requestUrl", url2 + "/foo?bar")); - assertThat(server3.getRequestCount()).isEqualTo(0); + assertThat(server3.getRequestCount()).isZero(); } @Test @@ -902,12 +902,12 @@ public void non_ioexceptions_dont_break_the_world() throws IOException { HostEventsSink throwingSink = new HostEventsSink() { @Override - public void record(String serviceName, String hostname, int port, int statusCode, long micros) { + public void record(String _serviceName, String _hostname, int _port, int _statusCode, long _micros) { throw new IllegalStateException("I am not an IOException"); } @Override - public void recordIoException(String serviceName, String hostname, int port) { + public void recordIoException(String _serviceName, String _hostname, int _port) { //empty; } }; From 635ed1d2fcbf369f98a49fd3ac3f18400a3da57f Mon Sep 17 00:00:00 2001 From: Dan Sanduleac Date: Wed, 23 Oct 2019 09:04:00 +0100 Subject: [PATCH 2/3] fix test --- .../com/palantir/conjure/java/client/jaxrs/TracerTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/TracerTest.java b/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/TracerTest.java index 3643a2342..4eb95b875 100644 --- a/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/TracerTest.java +++ b/conjure-java-jaxrs-client/src/test/java/com/palantir/conjure/java/client/jaxrs/TracerTest.java @@ -145,12 +145,12 @@ private void runTwoRequestsInParallel() { ExecutorService executor = Executors.newFixedThreadPool(2); CompletableFuture first = CompletableFuture.runAsync(() -> { Tracer.initTrace(Optional.of(true), "first"); - Tracer.startSpan(""); + Tracer.fastStartSpan(""); service.string(); }, executor); CompletableFuture second = CompletableFuture.runAsync(() -> { Tracer.initTrace(Optional.of(true), "second"); - Tracer.startSpan(""); + Tracer.fastStartSpan(""); service.string(); }, executor); first.join(); From f00d76bf245d6b2489e4b7dc98b4f2a05304f475 Mon Sep 17 00:00:00 2001 From: Dan Sanduleac Date: Wed, 23 Oct 2019 09:19:25 +0100 Subject: [PATCH 3/3] get rid of empty logger --- .../com/palantir/verification/server/AutoDeserializeTest.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/conjure-java-server-verifier/src/test/java/com/palantir/verification/server/AutoDeserializeTest.java b/conjure-java-server-verifier/src/test/java/com/palantir/verification/server/AutoDeserializeTest.java index 35ff484bd..fc1fd0f66 100644 --- a/conjure-java-server-verifier/src/test/java/com/palantir/verification/server/AutoDeserializeTest.java +++ b/conjure-java-server-verifier/src/test/java/com/palantir/verification/server/AutoDeserializeTest.java @@ -36,13 +36,9 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -import org.slf4j.LoggerFactory; @RunWith(Parameterized.class) public class AutoDeserializeTest { - static { - LoggerFactory.getLogger(AutoDeserializeTest.class); - } @ClassRule public static final DropwizardAppRule serverUnderTestRule = new DropwizardAppRule<>(