Skip to content

Commit

Permalink
Manually migrate a few stragglers
Browse files Browse the repository at this point in the history
  • Loading branch information
carterkozak committed Jul 22, 2021
1 parent 456cc8a commit 69224ee
Show file tree
Hide file tree
Showing 13 changed files with 47 additions and 39 deletions.
3 changes: 1 addition & 2 deletions dialogue-annotations/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ dependencies {
implementation project(':dialogue-serde')
implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation 'com.google.code.findbugs:jsr305'
implementation 'com.palantir.safe-logging:logger'
implementation 'com.palantir.safe-logging:preconditions'
implementation 'com.palantir.safe-logging:safe-logging'
implementation 'com.google.guava:guava'
implementation 'org.slf4j:slf4j-api'

// MultipartRequestBody
implementation 'org.apache.httpcomponents.core5:httpcore5'
Expand All @@ -30,5 +30,4 @@ dependencies {

// com.dialogue.annotations.MultipartRequestBody == okhttp.MultipartBody
testImplementation 'com.squareup.okhttp3:okhttp'
implementation 'com.palantir.safe-logging:logger'
}
3 changes: 1 addition & 2 deletions dialogue-apache-hc5-client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dependencies {
api 'com.palantir.conjure.java.runtime:client-config'
api 'org.apache.httpcomponents.client5:httpclient5'
implementation project(':dialogue-blocking-channels')
implementation 'com.palantir.safe-logging:logger'
implementation 'com.palantir.safe-logging:preconditions'
implementation 'com.palantir.tracing:tracing-api'
implementation 'com.palantir.tritium:tritium-metrics'
Expand All @@ -18,11 +19,9 @@ dependencies {
implementation 'com.palantir.safe-logging:safe-logging'
implementation 'io.dropwizard.metrics:metrics-core'
implementation 'org.apache.httpcomponents.core5:httpcore5'
implementation 'org.slf4j:slf4j-api'

testImplementation project(':dialogue-test-common')
testImplementation project(':dialogue-serde')
testImplementation 'org.awaitility:awaitility'
testImplementation 'org.junit.jupiter:junit-jupiter'
implementation 'com.palantir.safe-logging:logger'
}
3 changes: 1 addition & 2 deletions dialogue-blocking-channels/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ dependencies {
implementation project(':dialogue-futures')
implementation 'com.palantir.tracing:tracing'
implementation 'com.palantir.tritium:tritium-metrics'
implementation 'com.palantir.safe-logging:logger'
implementation 'com.palantir.safe-logging:preconditions'
implementation 'com.palantir.safe-logging:safe-logging'
implementation 'com.palantir.tritium:tritium-registry'
implementation 'org.slf4j:slf4j-api'

testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.assertj:assertj-core'
testImplementation 'org.mockito:mockito-core'
testImplementation 'org.awaitility:awaitility'
testImplementation project(':dialogue-test-common')
implementation 'com.palantir.safe-logging:logger'
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
import com.palantir.dialogue.com.palantir.conjure.verification.server.AutoDeserializeConfirmServiceBlocking;
import com.palantir.dialogue.com.palantir.conjure.verification.server.AutoDeserializeServiceBlocking;
import com.palantir.dialogue.com.palantir.conjure.verification.server.EndpointName;
import com.palantir.logsafe.SafeArg;
import com.palantir.logsafe.logger.SafeLogger;
import com.palantir.logsafe.logger.SafeLoggerFactory;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
Expand All @@ -32,16 +35,14 @@
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 {

@ClassRule
public static final VerificationServerRule server = new VerificationServerRule();

private static final Logger log = LoggerFactory.getLogger(AutoDeserializeTest.class);
private static final SafeLogger log = SafeLoggerFactory.get(AutoDeserializeTest.class);
private static final AutoDeserializeServiceBlocking testService =
server.client(AutoDeserializeServiceBlocking.class);
private static final AutoDeserializeConfirmServiceBlocking confirmService =
Expand Down Expand Up @@ -120,7 +121,11 @@ public void runTestCase() throws Error, NoSuchMethodException {
private Optional<Error> expectSuccess(Method method) {
try {
Object resultFromServer = method.invoke(testService, index);
log.info("Received result for endpoint {} and index {}: {}", endpointName, index, resultFromServer);
log.info(
"Received result for endpoint {} and index {}: {}",
SafeArg.of("endpointName", endpointName),
SafeArg.of("index", index),
SafeArg.of("resultFromServer", resultFromServer));
confirmService.confirm(endpointName, index, resultFromServer);
return Optional.empty();
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
import com.palantir.dialogue.com.palantir.conjure.verification.server.SingleHeaderServiceBlocking;
import com.palantir.dialogue.com.palantir.conjure.verification.server.SinglePathParamServiceBlocking;
import com.palantir.dialogue.com.palantir.conjure.verification.server.SingleQueryParamServiceBlocking;
import com.palantir.logsafe.SafeArg;
import com.palantir.logsafe.logger.SafeLogger;
import com.palantir.logsafe.logger.SafeLoggerFactory;
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
Expand All @@ -37,16 +40,14 @@
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 SingleParamServicesTest {

@ClassRule
public static final VerificationServerRule server = new VerificationServerRule();

private static final Logger log = LoggerFactory.getLogger(SingleParamServicesTest.class);
private static final SafeLogger log = SafeLoggerFactory.get(SingleParamServicesTest.class);
private static final ObjectMapper objectMapper = ObjectMappers.newClientObjectMapper();
private static ImmutableMap<String, Object> servicesMaps = ImmutableMap.of(
"singlePathParamService",
Expand Down Expand Up @@ -99,7 +100,11 @@ public static Collection<Object[]> data() {
public void runTestCase() throws Exception {
Assume.assumeFalse(Cases.shouldIgnore(endpointName, jsonString));

log.info("Invoking {} {}({})", serviceName, endpointName, jsonString);
log.info(
"Invoking {} {}({})",
SafeArg.of("serviceName", serviceName),
SafeArg.of("endpointName", endpointName),
SafeArg.of("jsonString", jsonString));

Object service = servicesMaps.get(serviceName);
for (Method method : servicesMaps.get(serviceName).getClass().getMethods()) {
Expand All @@ -125,9 +130,15 @@ public void runTestCase() throws Exception {
method.invoke(service, index, objectMapper.readValue(jsonString, cls));
}

log.info("Successfully post param to endpoint {} and index {}", endpointName, index);
log.info(
"Successfully post param to endpoint {} and index {}",
SafeArg.of("endpointName", endpointName),
SafeArg.of("index", index));
} catch (RemoteException e) {
log.error("Caught exception with params: {}", e.getError().parameters(), e);
log.error(
"Caught exception with params: {}",
SafeArg.of("errorParameters", e.getError().parameters()),
e);
throw e;
}
}
Expand Down
3 changes: 1 addition & 2 deletions dialogue-clients/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ dependencies {
implementation 'com.google.errorprone:error_prone_annotations'
implementation 'com.google.guava:guava'
implementation 'com.palantir.conjure.java.runtime:keystores'
implementation 'com.palantir.safe-logging:logger'
implementation 'com.palantir.safe-logging:preconditions'
implementation 'com.palantir.safe-logging:safe-logging'
implementation 'com.palantir.tritium:tritium-registry'
implementation 'org.slf4j:slf4j-api'

annotationProcessor 'org.immutables:value'
compileOnly 'org.immutables:value::annotations'
Expand All @@ -37,5 +37,4 @@ dependencies {

testAnnotationProcessor 'org.immutables:value'
testCompileOnly 'org.immutables:value::annotations'
implementation 'com.palantir.safe-logging:logger'
}
5 changes: 2 additions & 3 deletions dialogue-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ dependencies {
implementation project(':dialogue-futures')
implementation 'com.github.ben-manes.caffeine:caffeine'
implementation 'com.google.guava:guava'
implementation 'com.palantir.safe-logging:logger'
implementation 'com.palantir.safe-logging:preconditions'
implementation 'com.palantir.safe-logging:safe-logging'
implementation 'com.palantir.tracing:tracing'
implementation 'io.dropwizard.metrics:metrics-core'
implementation 'com.palantir.safethreadlocalrandom:safe-thread-local-random'
implementation 'com.palantir.tritium:tritium-metrics'
implementation 'com.google.code.findbugs:jsr305'
implementation 'com.google.errorprone:error_prone_annotations'
implementation 'com.palantir.conjure.java.api:service-config'
implementation 'com.palantir.safe-logging:safe-logging'
implementation 'com.palantir.tracing:tracing-api'
implementation 'org.slf4j:slf4j-api'

testImplementation 'com.palantir.tracing:tracing-test-utils'
testImplementation 'com.palantir.safe-logging:preconditions-assertj'
Expand All @@ -38,7 +38,6 @@ dependencies {

testAnnotationProcessor 'org.immutables:value'
testCompileOnly 'org.immutables:value::annotations'
implementation 'com.palantir.safe-logging:logger'
}

configurations.testCompileClasspath.exclude module: 'junit' // prefer junit5
3 changes: 1 addition & 2 deletions dialogue-futures/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ dependencies {
api 'com.google.guava:guava'
implementation 'com.google.code.findbugs:jsr305'
implementation 'com.google.errorprone:error_prone_annotations'
implementation 'com.palantir.safe-logging:logger'
implementation 'com.palantir.safe-logging:preconditions'
implementation 'org.slf4j:slf4j-api'

testImplementation 'org.assertj:assertj-core'
testImplementation 'org.assertj:assertj-guava'
testImplementation 'org.mockito:mockito-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.junit.jupiter:junit-jupiter-api'
implementation 'com.palantir.safe-logging:logger'
}
3 changes: 1 addition & 2 deletions dialogue-serde/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ dependencies {
implementation 'com.palantir.safethreadlocalrandom:safe-thread-local-random'
implementation 'com.palantir.safe-logging:preconditions'
implementation 'com.palantir.tracing:tracing'
implementation 'org.slf4j:slf4j-api'
implementation 'com.fasterxml.jackson.core:jackson-annotations'
implementation 'com.fasterxml.jackson.core:jackson-core'
implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation 'com.google.code.findbugs:jsr305'
implementation 'com.google.errorprone:error_prone_annotations'
implementation 'com.palantir.conjure.java.api:errors'
implementation 'com.palantir.conjure.java:conjure-lib'
implementation 'com.palantir.safe-logging:logger'
implementation 'com.palantir.safe-logging:safe-logging'
implementation 'jakarta.ws.rs:jakarta.ws.rs-api'

Expand All @@ -34,7 +34,6 @@ dependencies {
testImplementation 'org.mockito:mockito-core'
testImplementation 'com.palantir.safe-logging:preconditions-assertj'
testImplementation 'org.apache.commons:commons-lang3'
implementation 'com.palantir.safe-logging:logger'
}

configurations.testCompileClasspath.exclude module: 'junit' // prefer junit5
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import com.palantir.logsafe.SafeLoggable;
import com.palantir.logsafe.UnsafeArg;
import com.palantir.logsafe.exceptions.SafeExceptions;
import com.palantir.logsafe.logger.SafeLogger;
import com.palantir.logsafe.logger.SafeLoggerFactory;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
Expand All @@ -42,8 +44,6 @@
import java.time.Duration;
import java.util.List;
import java.util.Optional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Extracts and returns a {@link RemoteException} from an {@link Response}.
Expand All @@ -54,7 +54,7 @@
public enum ErrorDecoder {
INSTANCE;

private static final Logger log = LoggerFactory.getLogger(ErrorDecoder.class);
private static final SafeLogger log = SafeLoggerFactory.get(ErrorDecoder.class);
private static final ObjectMapper MAPPER = ObjectMappers.newClientObjectMapper();

public boolean isError(Response response) {
Expand All @@ -63,7 +63,7 @@ public boolean isError(Response response) {

public RuntimeException decode(Response response) {
if (log.isDebugEnabled()) {
log.debug("Received an error response", diagnosticArgs(response).toArray(new Object[0]));
log.debug("Received an error response", diagnosticArgs(response));
}
RuntimeException result = decodeInternal(response);
result.addSuppressed(diagnostic(response));
Expand Down
3 changes: 1 addition & 2 deletions dialogue-target/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ dependencies {
api 'com.palantir.ri:resource-identifier'
api 'com.palantir.conjure.java:conjure-lib'
implementation 'com.palantir.safe-logging:preconditions'
implementation 'org.slf4j:slf4j-api'
implementation 'com.google.errorprone:error_prone_annotations'
implementation 'com.palantir.safe-logging:safe-logging'
implementation 'com.google.errorprone:error_prone_annotations'
implementation 'com.google.code.findbugs:jsr305'

testImplementation 'jakarta.ws.rs:jakarta.ws.rs-api'
Expand Down
14 changes: 7 additions & 7 deletions versions.lock
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ com.palantir.conjure.java.runtime:keystores:7.10.0 (2 constraints: 5319f2db)
com.palantir.goethe:goethe:0.2.0 (1 constraints: 0405f135)
com.palantir.refreshable:refreshable:2.0.1 (2 constraints: e91893b1)
com.palantir.ri:resource-identifier:1.3.0 (2 constraints: f1145cb6)
com.palantir.safe-logging:logger:1.17.0 (1 constraints: 3b053e3b)
com.palantir.safe-logging:logger-slf4j:1.17.0 (1 constraints: 340e9050)
com.palantir.safe-logging:logger-spi:1.17.0 (2 constraints: 771ed6b0)
com.palantir.safe-logging:preconditions:1.17.0 (14 constraints: 4ee77ee4)
com.palantir.safe-logging:safe-logging:1.17.0 (12 constraints: d8bb30ee)
com.palantir.safe-logging:logger:1.18.0 (1 constraints: 3c05413b)
com.palantir.safe-logging:logger-slf4j:1.18.0 (1 constraints: 350e9350)
com.palantir.safe-logging:logger-spi:1.18.0 (2 constraints: 791e0cb1)
com.palantir.safe-logging:preconditions:1.18.0 (14 constraints: 50e7dfe7)
com.palantir.safe-logging:safe-logging:1.18.0 (12 constraints: ddbb3af4)
com.palantir.safethreadlocalrandom:safe-thread-local-random:0.1.0 (1 constraints: 0305ee35)
com.palantir.tokens:auth-tokens:3.10.0 (3 constraints: e4276661)
com.palantir.tracing:tracing:4.23.0 (2 constraints: 5616060e)
Expand Down Expand Up @@ -62,7 +62,7 @@ org.glassfish.jersey.core:jersey-common:2.31 (1 constraints: da04fa30)
org.hdrhistogram:HdrHistogram:2.1.12 (1 constraints: 3e103aa2)
org.immutables:value:2.8.8 (1 constraints: 14051536)
org.mpierce.metrics.reservoir:hdrhistogram-metrics-reservoir:1.1.3 (1 constraints: 0d10f991)
org.slf4j:slf4j-api:1.7.32 (12 constraints: e1b67cca)
org.slf4j:slf4j-api:1.7.32 (11 constraints: a3b19f12)

[Test dependencies]
com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.12.3 (2 constraints: ee13f781)
Expand All @@ -71,7 +71,7 @@ com.google.auto.value:auto-value-annotations:1.7.4 (1 constraints: 640a29b9)
com.google.code.findbugs:annotations:3.0.1 (1 constraints: 9e0aafc3)
com.google.testing.compile:compile-testing:0.19 (1 constraints: de04f630)
com.google.truth:truth:1.1 (1 constraints: b71111d7)
com.palantir.safe-logging:preconditions-assertj:1.17.0 (1 constraints: 3b053e3b)
com.palantir.safe-logging:preconditions-assertj:1.18.0 (1 constraints: 3c05413b)
com.palantir.tracing:tracing-test-utils:4.23.0 (1 constraints: 3b05483b)
com.spotify.dataenum:dataenum:1.3.2 (1 constraints: e91058c1)
com.squareup.okhttp3:mockwebserver:3.13.1 (1 constraints: 3a053f3b)
Expand Down
2 changes: 1 addition & 1 deletion versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ com.palantir.conjure.java.api:* = 2.19.0
com.palantir.conjure.java.runtime:* = 7.10.0
com.palantir.refreshable:* = 2.0.1
com.palantir.ri:resource-identifier = 1.3.0
com.palantir.safe-logging:* = 1.17.0
com.palantir.safe-logging:* = 1.18.0
com.palantir.safethreadlocalrandom:safe-thread-local-random = 0.1.0
com.palantir.tokens:auth-tokens = 3.10.0
com.palantir.tracing:* = 4.23.0
Expand Down

0 comments on commit 69224ee

Please sign in to comment.