Skip to content

Commit 608e0df

Browse files
committed
Update dependencies and clean up unit tests
1 parent 63e71c0 commit 608e0df

File tree

8 files changed

+68
-34
lines changed

8 files changed

+68
-34
lines changed

build.gradle

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ plugins {
22
id 'java-library'
33
id 'checkstyle'
44
id 'jacoco'
5-
id "com.github.spotbugs" version "5.0.12"
5+
id "com.github.spotbugs" version "5.0.14"
66
id 'maven-publish'
77
id 'signing'
88
id "io.codearte.nexus-staging" version "0.30.0"
99
id 'com.adarshr.test-logger' version '3.2.0'
10-
id "com.github.ben-manes.versions" version "0.42.0"
11-
id 'org.sonatype.gradle.plugins.scan' version '2.4.1'
12-
id "org.sonarqube" version "3.4.0.2513"
10+
id "com.github.ben-manes.versions" version "0.47.0"
11+
id 'org.sonatype.gradle.plugins.scan' version '2.6.0'
12+
id "org.sonarqube" version "4.2.1.3168"
1313
}
1414

1515
group = 'com.imsweb'
@@ -34,22 +34,22 @@ repositories {
3434
}
3535

3636
dependencies {
37-
spotbugs 'com.github.spotbugs:spotbugs:4.7.2'
37+
spotbugs 'com.github.spotbugs:spotbugs:4.7.3'
3838

3939
api 'com.squareup.retrofit2:retrofit:2.9.0'
4040
api 'com.squareup.retrofit2:converter-jackson:2.9.0'
4141

4242
// retrofit will not update these dependencies to fix vulnerabilities
43-
api 'com.squareup.okhttp3:okhttp:4.10.0'
44-
api 'com.squareup.okio:okio:3.2.0'
43+
api 'com.squareup.okhttp3:okhttp:4.11.0'
44+
api 'com.squareup.okio:okio:3.4.0'
4545

4646
// newer version of dependency to fix vulnerability until converter-jackson is updated
47-
api 'com.fasterxml.jackson.core:jackson-databind:2.13.4'
47+
api 'com.fasterxml.jackson.core:jackson-databind:2.15.2'
4848

49-
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1'
50-
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.9.1'
51-
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1'
52-
testImplementation 'org.assertj:assertj-core:3.23.1'
49+
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.3'
50+
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.9.3'
51+
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.3'
52+
testImplementation 'org.assertj:assertj-core:3.24.2'
5353
testImplementation 'com.google.code.bean-matchers:bean-matchers:0.14'
5454
}
5555

@@ -111,8 +111,21 @@ ossIndexAudit {
111111
printBanner = false
112112
}
113113

114+
def isNonStable = { String version ->
115+
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
116+
def regex = /^[0-9,.v-]+(-r)?$/
117+
return !stableKeyword && !(version ==~ regex)
118+
}
119+
120+
// https://github.com/ben-manes/gradle-versions-plugin
121+
tasks.named("dependencyUpdates").configure {
122+
rejectVersionIf {
123+
isNonStable(it.candidate.version)
124+
}
125+
}
126+
114127
wrapper {
115-
gradleVersion = '7.5.1'
128+
gradleVersion = '8.2.1'
116129
distributionType = Wrapper.DistributionType.ALL
117130
}
118131

gradle/wrapper/gradle-wrapper.jar

2.56 KB
Binary file not shown.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
46
zipStoreBase=GRADLE_USER_HOME
57
zipStorePath=wrapper/dists

gradlew

Lines changed: 16 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gradlew.bat

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/test/java/com/imsweb/seerapi/client/hcpcs/mph/MphTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ void testResults() throws IOException {
7979
MphOutput result = _MPH.mph(new MphInputPair(input1, input2)).execute().body();
8080
assertNotNull(result);
8181
assertEquals(MphOutput.Result.SINGLE_PRIMARY, result.getResult());
82-
assertEquals("mp_2007_breast", result.getGroupId());
82+
assertEquals("mph_2007_to_2017_breast", result.getGroupId());
8383
assertEquals("M13", result.getStep());
8484
assertEquals("Tumors that do not meet any of the criteria are abstracted as a single primary.", result.getReason());
8585
assertEquals(10, result.getAppliedRules().size());
@@ -90,9 +90,9 @@ void testResults() throws IOException {
9090
result = _MPH.mph(new MphInputPair(input1, input2)).execute().body();
9191
assertNotNull(result);
9292
assertEquals(MphOutput.Result.QUESTIONABLE, result.getResult());
93-
assertEquals("mp_2007_breast", result.getGroupId());
93+
assertEquals("mph_2007_to_2017_breast", result.getGroupId());
9494
assertEquals("M7", result.getStep());
95-
assertEquals("Unable to apply Rule M7 of mp_2007_breast. Valid and known laterality should be provided.", result.getReason());
95+
assertEquals("Unable to apply Rule M7 of MPH 2007-2017 Breast. Valid and known laterality should be provided.", result.getReason());
9696
assertEquals(4, result.getAppliedRules().size());
9797
assertEquals("Is there a tumor(s) in each breast?", result.getAppliedRules().get(3).getQuestion());
9898

@@ -110,7 +110,7 @@ void testResults() throws IOException {
110110
result = _MPH.mph(new MphInputPair(input1, input2)).execute().body();
111111
assertNotNull(result);
112112
assertEquals(MphOutput.Result.MULTIPLE_PRIMARIES, result.getResult());
113-
assertEquals("mp_2007_breast", result.getGroupId());
113+
assertEquals("mph_2007_to_2017_breast", result.getGroupId());
114114
assertEquals("M5", result.getStep());
115115
assertEquals("Tumors diagnosed more than five (5) years apart are multiple primaries.", result.getReason());
116116
assertEquals(2, result.getAppliedRules().size());

src/test/java/com/imsweb/seerapi/client/rx/RxTest.java

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,19 @@ void testRxVersions() throws IOException {
4848

4949
@Test
5050
void testRxById() throws IOException {
51-
Rx rx = _RX.getById("latest", "53c44afe102c1290262dc672").execute().body();
51+
Rx rx = _RX.getById("latest", "53c44b0a102c1290262dce76").execute().body();
5252

5353
assertNotNull(rx);
54-
assertEquals("ABT-751", rx.getName());
54+
assertEquals("Imatinib mesylate", rx.getName());
5555
assertTrue(rx.getAlternateName().size() > 1);
5656
assertEquals(Rx.Type.DRUG, rx.getType());
5757
assertNull(rx.getHistology());
58-
assertTrue(rx.getRemarks().startsWith("Phase II ALL"));
58+
assertTrue(rx.getRemarks().startsWith("January 31, 2012"));
5959
assertNull(rx.getEvsId());
6060
assertNull(rx.getAbbreviation());
6161
assertEquals(Collections.singletonList("Chemotherapy"), rx.getCategory());
6262
assertTrue(rx.getSubcategory().size() > 0);
63-
assertNull(rx.getNscNumber());
63+
assertEquals(1, rx.getNscNumber().size());
6464
assertNull(rx.getDrugs());
6565
assertNull(rx.getRadiation());
6666
assertNull(rx.getHidden());
@@ -72,7 +72,17 @@ void testRxById() throws IOException {
7272
assertNull(rx.getNote());
7373
assertNull(rx.getFieldNotes());
7474
assertNull(rx.getScore());
75-
assertEquals(Arrays.asList("neuroblastoma", "Pediatric ALL"), rx.getPrimarySite());
75+
assertEquals(Arrays.asList("aggressive mastocytosis",
76+
"chronic eosinophilic leukemia",
77+
"Colorectal",
78+
"dermatofibrosarcoma protuberans",
79+
"gastric",
80+
"GIST",
81+
"hypereosinophilic syndrome",
82+
"leukemia",
83+
"lung",
84+
"other cancer",
85+
"Ph+ALL"), rx.getPrimarySite());
7686
assertNull(rx.getHistory());
7787
}
7888

@@ -112,8 +122,8 @@ void testRxSearch() throws IOException {
112122

113123
assertNotNull(results);
114124
assertEquals(25, results.getCount().longValue());
115-
assertEquals(12, results.getTotal().longValue());
116-
assertEquals(12, results.getResults().size());
125+
assertEquals(8, results.getTotal().longValue());
126+
assertEquals(8, results.getResults().size());
117127
assertEquals(Collections.singletonList("abt"), results.getTerms());
118128

119129
search.setMode(PublishableSearch.SearchMode.OR);

src/test/java/com/imsweb/seerapi/client/siterecode/SiteRecodeTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void testExceptionMessages() throws IOException {
5151

5252
// the API call works out to:
5353
// https://api.seer.cancer.gov/rest/recode/sitegroup?site=C379
54-
assertEquals("Required request parameter 'hist' for method parameter type String is not present", message);
54+
assertEquals("Required parameter 'hist' is not present.", message);
5555
}
5656

5757
@Test

0 commit comments

Comments
 (0)