Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate off JUnit 4 vintage #2495

Closed
wants to merge 63 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
d7c471d
Excavator: Update conjure plugins and dependencies (#2565)
svc-excavator-bot Mar 17, 2023
2d2921e
Excavator: Upgrade dependencies (#2566)
svc-excavator-bot Mar 17, 2023
ede76be
Excavator: Update policy-bot config (#2568)
svc-excavator-bot Mar 22, 2023
e752fa8
Report metrics when unusually large strings are parsed (#2569)
carterkozak Mar 22, 2023
becaeba
Autorelease 7.41.0
svc-autorelease Mar 22, 2023
2e25bdb
Excavator: Upgrades Baseline to the latest version (#2560)
svc-excavator-bot Mar 22, 2023
702461b
InstrumentedJsonFactory sets the expected 'JSON' format name (#2570)
carterkozak Mar 22, 2023
5e2aee3
Autorelease 7.42.0
svc-autorelease Mar 22, 2023
b448fcd
Json parser string length metrics are tagged by format (#2571)
carterkozak Mar 23, 2023
150043e
Autorelease 7.43.0
svc-autorelease Mar 23, 2023
51fe9f0
Excavator: Update conjure plugins and dependencies (#2572)
svc-excavator-bot Mar 23, 2023
88d3fee
Excavator: Update conjure plugins and dependencies (#2573)
svc-excavator-bot Mar 24, 2023
f2b8c7a
Increase string-length observability thresholds (#2574)
carterkozak Mar 28, 2023
4219091
Autorelease 7.44.0
svc-autorelease Mar 28, 2023
6587413
Excavator: Update conjure plugins and dependencies (#2575)
svc-excavator-bot Mar 28, 2023
23604d3
Excavator: Upgrade dependencies (#2578)
svc-excavator-bot Mar 31, 2023
9882565
Excavator: Update gradle-jdks infrastructure plugins (#2579)
svc-excavator-bot Mar 31, 2023
e63817a
Excavator: Upgrades Baseline to the latest version (#2577)
svc-excavator-bot Apr 3, 2023
d00a69b
Upgrade Undertow to 2.2.24.Final (#2580)
carterkozak Apr 3, 2023
a05e2ec
Excavator: Update conjure plugins and dependencies (#2581)
svc-excavator-bot Apr 4, 2023
add558f
Excavator: Upgrade dependencies (#2582)
svc-excavator-bot Apr 4, 2023
9a1d9e1
Disable Jackson field name interning (#2583)
schlosna Apr 4, 2023
37d4d91
Autorelease 7.46.0
svc-autorelease Apr 4, 2023
99cc417
Excavator: Upgrade dependencies (#2584)
svc-excavator-bot Apr 4, 2023
1229c48
Add public JsonFactory factories to ObjectMappers (#2586)
carterkozak Apr 5, 2023
93303cc
Autorelease 7.47.0
svc-autorelease Apr 5, 2023
6a0eff5
Use a TypeFactory backed by a Caffeine Cache (#2587)
carterkozak Apr 6, 2023
6b1ba60
Autorelease 7.48.0
svc-autorelease Apr 6, 2023
9751bb3
Add TypeFactory cache instrumentation (#2588)
carterkozak Apr 6, 2023
520bc76
Autorelease 7.49.0
svc-autorelease Apr 6, 2023
d56cd27
Excavator: Upgrade dependencies (#2589)
svc-excavator-bot Apr 7, 2023
59ff239
Excavator: Upgrade dependencies (#2590)
svc-excavator-bot Apr 8, 2023
4a5e822
Excavator: Upgrades Baseline to the latest version (#2585)
svc-excavator-bot Apr 10, 2023
e7c5920
Excavator: Update conjure plugins and dependencies (#2592)
svc-excavator-bot Apr 10, 2023
0852a78
Excavator: Upgrade dependencies (#2594)
svc-excavator-bot Apr 11, 2023
24e0aad
Excavator: Prefer AssertJ (#2596)
svc-excavator-bot Apr 13, 2023
58623f6
Opt out of the TypeFactory cache until we can resolve cache contentio…
carterkozak Apr 13, 2023
8a30073
Autorelease 7.50.0
svc-autorelease Apr 13, 2023
1d1c5e9
ObjectMappers.withDefaultModules(ObjectMapper) does not replace exist…
carterkozak Apr 14, 2023
9a955a8
Autorelease 7.51.0
svc-autorelease Apr 14, 2023
ecbfa5f
Excavator: Upgrade dependencies (#2598)
svc-excavator-bot Apr 17, 2023
6b35a9d
Excavator: Update conjure plugins and dependencies (#2600)
svc-excavator-bot Apr 18, 2023
562ded8
Excavator: Upgrade dependencies (#2599)
svc-excavator-bot Apr 19, 2023
72a587a
Excavator: Upgrades Baseline to the latest version (#2593)
svc-excavator-bot Apr 19, 2023
5ef5279
Apply an excessively permissive large string length limit by default …
carterkozak Apr 19, 2023
c43a974
Autorelease 7.52.0
svc-autorelease Apr 19, 2023
b3686ca
Opt out of canonicalization in Conjure JsonFactories (#2603)
carterkozak Apr 20, 2023
732be9c
Autorelease 7.53.0
svc-autorelease Apr 20, 2023
949861c
Excavator: Upgrades Baseline to the latest version (#2602)
svc-excavator-bot Apr 20, 2023
d34821f
Excavator: Upgrade buildscript dependencies (#2432)
svc-excavator-bot Apr 20, 2023
612bc16
Excavator: Upgrade dependencies (#2606)
svc-excavator-bot Apr 21, 2023
d4ece22
Excavator: Upgrade dependencies (#2607)
svc-excavator-bot Apr 22, 2023
114c425
SslSocketFactoriesTests checks if Conscrypt is supported (#2610)
carterkozak Apr 24, 2023
51d201f
SslSocketFactories avoids duplicate effort creating TLS components (#…
carterkozak Apr 24, 2023
f1e0ddb
Autorelease 7.54.0
svc-autorelease Apr 24, 2023
9d1418f
Client configuration build accepts TrustContextFactory (#2611)
jpcorreia99 Apr 25, 2023
0d6b79f
Autorelease 7.55.0
svc-autorelease Apr 25, 2023
7ce426c
Excavator: Upgrade dependencies (#2612)
svc-excavator-bot Apr 25, 2023
179b3ef
Excavator: Upgrade dependencies (#2613)
svc-excavator-bot Apr 26, 2023
6538261
Excavator: Update conjure plugins and dependencies (#2614)
svc-excavator-bot Apr 27, 2023
936ba36
Excavator: Format Java files (#2615)
svc-excavator-bot Apr 28, 2023
fc1b846
Migrate to junit5 (#2616)
schlosna Apr 28, 2023
09ef5fb
Migrate off JUnit 4 vintage
schlosna Nov 11, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .policy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ approval_rules:
- "^versions.lock$"
- "^internal/generated/.*"
- "^internal/generated_src/.*"
- "^gradle-baseline-java/src/main/resources/checkstyle.version$"
has_valid_signatures_by_keys:
key_ids: ["C9AF124A484882E0"]

Expand Down
17 changes: 6 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ buildscript {

dependencies {
classpath 'com.palantir.jakartapackagealignment:jakarta-package-alignment:0.5.0'
classpath 'com.palantir.gradle.jdks:gradle-jdks:0.31.0'
classpath 'com.palantir.gradle.jdks:gradle-jdks:0.32.0'
classpath 'com.palantir.gradle.jdkslatest:gradle-jdks-latest:0.7.0'
classpath 'com.palantir.gradle.externalpublish:gradle-external-publish-plugin:1.12.0'
classpath 'com.palantir.javaformat:gradle-palantir-java-format:2.28.0'
classpath 'com.palantir.javaformat:gradle-palantir-java-format:2.30.0'
classpath 'com.palantir.gradle.revapi:gradle-revapi:1.7.0'
classpath 'com.netflix.nebula:gradle-dependency-lock-plugin:7.0.1'
classpath 'com.palantir.baseline:gradle-baseline-java:4.188.0'
classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.15.0'
classpath 'com.palantir.metricschema:gradle-metric-schema:0.16.0'
classpath 'com.palantir.baseline:gradle-baseline-java:5.7.0'
classpath 'com.palantir.gradle.gitversion:gradle-git-version:3.0.0'
classpath 'com.palantir.metricschema:gradle-metric-schema:0.20.0'
classpath 'gradle.plugin.org.inferred:gradle-processors:3.7.0'
classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:2.11.0'
classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:2.12.0'
}
}

Expand Down Expand Up @@ -59,11 +59,6 @@ allprojects {

dependencies {
constraints {
rootConfiguration 'io.dropwizard.metrics:metrics-core', {
version { strictly '[3, 4[' }
because "Spark still uses 3.X, which can't co-exist with 4.X"
}

rootConfiguration 'com.squareup.retrofit2:retrofit', {
version { strictly '2.4.0' }
because 'Retrofit 2.5.0 breaks with our path parameter routing logic'
Expand Down
6 changes: 6 additions & 0 deletions changelog/7.41.0/pr-2569.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type: improvement
improvement:
description: Report metrics when unusually large strings are parsed using JSON mappers
created using Conjure ObjectMappers factory methods.
links:
- https://github.com/palantir/conjure-java-runtime/pull/2569
5 changes: 5 additions & 0 deletions changelog/7.42.0/pr-2570.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: InstrumentedJsonFactory sets the expected 'JSON' format name
links:
- https://github.com/palantir/conjure-java-runtime/pull/2570
5 changes: 5 additions & 0 deletions changelog/7.43.0/pr-2571.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: Json parser string length metrics are tagged by format
links:
- https://github.com/palantir/conjure-java-runtime/pull/2571
5 changes: 5 additions & 0 deletions changelog/7.44.0/pr-2574.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: Increase string-length observability thresholds
links:
- https://github.com/palantir/conjure-java-runtime/pull/2574
5 changes: 5 additions & 0 deletions changelog/7.46.0/pr-2583.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: Interning introduces excessive contention
links:
- https://github.com/palantir/conjure-java-runtime/pull/2583
5 changes: 5 additions & 0 deletions changelog/7.47.0/pr-2586.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: Add public JsonFactory factories to ObjectMappers
links:
- https://github.com/palantir/conjure-java-runtime/pull/2586
5 changes: 5 additions & 0 deletions changelog/7.48.0/pr-2587.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: Use a TypeFactory backed by a Caffeine Cache
links:
- https://github.com/palantir/conjure-java-runtime/pull/2587
5 changes: 5 additions & 0 deletions changelog/7.49.0/pr-2588.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: Add TypeFactory cache instrumentation
links:
- https://github.com/palantir/conjure-java-runtime/pull/2588
5 changes: 5 additions & 0 deletions changelog/7.50.0/pr-2595.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: Opt out of the TypeFactory cache until we can resolve cache contention
links:
- https://github.com/palantir/conjure-java-runtime/pull/2595
6 changes: 6 additions & 0 deletions changelog/7.51.0/pr-2597.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type: fix
fix:
description: ObjectMappers.withDefaultModules(ObjectMapper) does not replace existing
TypeFactories with state from registered modules
links:
- https://github.com/palantir/conjure-java-runtime/pull/2597
6 changes: 6 additions & 0 deletions changelog/7.52.0/pr-2601.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type: improvement
improvement:
description: Apply a large StreamReadConstraints maxStringLength to reduce friction
in preparation for jackson 2.15 adoption
links:
- https://github.com/palantir/conjure-java-runtime/pull/2601
5 changes: 5 additions & 0 deletions changelog/7.53.0/pr-2603.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: Opt out of canonicalization in Conjure JsonFactories
links:
- https://github.com/palantir/conjure-java-runtime/pull/2603
5 changes: 5 additions & 0 deletions changelog/7.54.0/pr-2609.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: SslSocketFactories avoids duplicate effort creating TLS components
links:
- https://github.com/palantir/conjure-java-runtime/pull/2609
6 changes: 6 additions & 0 deletions changelog/7.55.0/pr-2611.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type: improvement
improvement:
description: Overload client config creation method to allow a TrustContextFactory
to be passed as well.
links:
- https://github.com/palantir/conjure-java-runtime/pull/2611
5 changes: 5 additions & 0 deletions changelog/@unreleased/pr-2616.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: Migrate to junit5
links:
- https://github.com/palantir/conjure-java-runtime/pull/2616
3 changes: 2 additions & 1 deletion client-config/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ dependencies {
implementation 'com.google.guava:guava'
implementation project(":keystores")

testImplementation "junit:junit"
testImplementation 'com.google.guava:guava'
testImplementation "org.assertj:assertj-core"
testImplementation "org.mockito:mockito-core"
Expand All @@ -20,4 +19,6 @@ dependencies {
annotationProcessor "org.immutables:value"
compileOnly 'org.immutables:value::annotations'
implementation 'com.palantir.safe-logging:logger'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.junit.jupiter:junit-jupiter-api'
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
import com.palantir.conjure.java.api.config.service.ProxyConfiguration;
import com.palantir.conjure.java.api.config.service.ServiceConfiguration;
import com.palantir.conjure.java.api.config.service.UserAgent;
import com.palantir.conjure.java.api.config.ssl.SslConfiguration;
import com.palantir.conjure.java.config.ssl.SslSocketFactories;
import com.palantir.conjure.java.config.ssl.TrustContext;
import com.palantir.logsafe.UnsafeArg;
import com.palantir.logsafe.exceptions.SafeIllegalArgumentException;
import com.palantir.logsafe.logger.SafeLogger;
Expand Down Expand Up @@ -75,9 +77,19 @@ private ClientConfigurations() {}
* empty/absent configuration with the defaults specified as constants in this class.
*/
public static ClientConfiguration of(ServiceConfiguration config) {
return ClientConfigurations.of(config, SslSocketFactories::createTrustContext);
}

/**
* Creates a new {@link ClientConfiguration} instance from the given {@link ServiceConfiguration} and
* {@link TrustContextFactory}, filling in empty/absent configuration with the defaults specified as constants
* in this class.
*/
public static ClientConfiguration of(ServiceConfiguration config, TrustContextFactory factory) {
TrustContext trustContext = factory.create(config.security());
return ClientConfiguration.builder()
.sslSocketFactory(SslSocketFactories.createSslSocketFactory(config.security()))
.trustManager(SslSocketFactories.createX509TrustManager(config.security()))
.sslSocketFactory(trustContext.sslSocketFactory())
.trustManager(trustContext.x509TrustManager())
.uris(config.uris())
.connectTimeout(config.connectTimeout().orElse(DEFAULT_CONNECT_TIMEOUT))
.readTimeout(config.readTimeout().orElse(DEFAULT_READ_TIMEOUT))
Expand Down Expand Up @@ -246,4 +258,12 @@ public String toString() {
return "FixedProxySelector{proxy=" + proxy + '}';
}
}

/**
* A factory for {@link TrustContext} which allows to define how one will be created,
* based on implementer defined security configurations. See {@link SslConfiguration}.
*/
public interface TrustContextFactory {
TrustContext create(SslConfiguration configuration);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import java.util.List;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.X509TrustManager;
import org.junit.Test;
import org.junit.jupiter.api.Test;

public final class ClientConfigurationsTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import org.junit.Test;
import org.junit.jupiter.api.Test;

public class ConjureClientsTest {

Expand Down
4 changes: 3 additions & 1 deletion conjure-java-client-verifier/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ dependencies {
testImplementation project(':conjure-java-retrofit2-client')
testImplementation project(':conjure-java-jackson-serialization')
testImplementation project(':keystores')
testImplementation 'junit:junit'
testImplementation "org.slf4j:slf4j-api"
testImplementation 'org.assertj:assertj-core'
testImplementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml'
testImplementation 'org.apache.commons:commons-lang3'
testImplementation 'com.palantir.safe-logging:logger'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'org.junit.jupiter:junit-jupiter-params'
}
Loading