Skip to content

Commit

Permalink
[PF-2983] Minor version upgrades that should be low risk (#150)
Browse files Browse the repository at this point in the history
* Upgrade test and quality dependencies

* spotless
  • Loading branch information
cahrens authored Feb 26, 2024
1 parent d453199 commit f865a61
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 13 deletions.
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ plugins {
id 'java-library'
id 'maven-publish'

id 'com.diffplug.spotless' version '6.16.0'
id 'com.diffplug.spotless' version '6.25.0'
id 'com.github.ben-manes.versions' version '0.42.0'
id 'com.jfrog.artifactory' version '5.1.14'
id 'org.sonarqube' version '4.0.0.2929'
id 'org.sonarqube' version '4.4.1.3373'
// [dd 2021-05-17] Use of Spring dependency management generates invalid POM, making
// it impossible to publish to mavenLocal. In order to make TCL testable, I have
// removed this plugin and filled in specific version numbers. I also removed all
Expand Down Expand Up @@ -121,11 +121,11 @@ dependencies {
testImplementation('org.springframework.boot:spring-boot-starter-test:3.1.2') {
exclude group: 'com.vaadin.external.google', module: 'android-json'
}
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: '5.9.0'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.9.0'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: '5.10.2'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.10.2'
testImplementation group: 'org.hamcrest', name: 'hamcrest', version: '2.2'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.10.0'
testImplementation group: 'org.openapitools', name: 'jackson-databind-nullable', version: '0.2.3'
testImplementation group: 'org.openapitools', name: 'jackson-databind-nullable', version: '0.2.6'
testImplementation 'org.awaitility:awaitility:4.2.0'

// Transitive dependency constraints due to security vulnerabilities in prior versions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class FlagsmithService {
* @param feature the name of the feature
*/
public Optional<Boolean> isFeatureEnabled(String feature) {
return isFeatureEnabled(feature, /*userEmail=*/ null);
return isFeatureEnabled(feature, /* userEmail= */ null);
}

/**
Expand Down Expand Up @@ -78,7 +78,7 @@ public Optional<Boolean> isFeatureEnabled(String feature, @Nullable String userE
* return {@code Optional.empty()}.
*/
public <T> Optional<T> getFeatureValueJson(String feature, Class<T> clazz) {
return getFeatureValueJson(feature, clazz, /*userEmail=*/ null);
return getFeatureValueJson(feature, clazz, /* userEmail= */ null);
}

/**
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/bio/terra/common/stairway/MetricsHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ public class MetricsHelper {
public static final AttributeKey<String> KEY_STEP_DIRECTION =
AttributeKey.stringKey("step_direction");
public static final AttributeKey<String> KEY_ERROR = AttributeKey.stringKey("error_code");

/** Unit string for count. */
private static final String COUNT = "1";

/** Unit string for millisecond. */
private static final String MILLISECOND = "ms";

Expand All @@ -41,10 +43,13 @@ public class MetricsHelper {

/** Gauge for flight latency in milliseconds. */
private final LongHistogram flightLatencyHistogram;

/** Counter for number of errors from stairway flights. */
private final LongCounter flightErrorCounter;

/** Gauge for step latency in milliseconds. */
private final LongHistogram stepLatencyHistogram;

/** Counter for number of errors from stairway steps. */
private final LongCounter stepErrorCounter;

Expand Down
4 changes: 2 additions & 2 deletions src/test/java/bio/terra/common/sam/SamRetryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ private boolean testRetryAllErrorCodesFinishInner(int failCount) throws ApiExcep
throw new ApiException(
"testing",
new SocketTimeoutException(),
/*statusCode=*/ 0,
/*responseHeaders=*/ null);
/* statusCode= */ 0,
/* responseHeaders= */ null);
case 1:
throw new ApiException(HttpStatus.SC_INTERNAL_SERVER_ERROR, "testing");
case 2:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ public void ConnectionException() {
new ApiException(
"testing",
new SocketTimeoutException(),
/*statusCode=*/ 0,
/*responseHeaders=*/ null));
/* statusCode= */ 0,
/* responseHeaders= */ null));
assertTrue(errorReportException instanceof SamTimeoutException);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public static Stairway setupStairway(StairwayBuilder builder) {
try {
Stairway stairway = builder.build();
stairway.initialize(
makeDataSource(), /* forceCleanStart =*/ true, /* migrateUpgrade =*/ true);
stairway.recoverAndStart(/* obsoleteStairways =*/ null);
makeDataSource(), /* forceCleanStart= */ true, /* migrateUpgrade= */ true);
stairway.recoverAndStart(/* obsoleteStairways= */ null);
return stairway;
} catch (StairwayException | InterruptedException e) {
throw new RuntimeException(
Expand Down

0 comments on commit f865a61

Please sign in to comment.