Skip to content

Commit 6bd3d05

Browse files
authored
Merge pull request #45 from imsweb/cleanup
Cleanup tests and update dependencies
2 parents 3a1764a + 481d3fc commit 6bd3d05

File tree

10 files changed

+51
-39
lines changed

10 files changed

+51
-39
lines changed

.github/workflows/integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
distribution: 'adopt'
2121
java-version: '17'
2222
- name: Cache Gradle packages
23-
uses: actions/cache@v2
23+
uses: actions/cache@v4
2424
with:
2525
path: |
2626
~/.gradle/caches

build.gradle

Lines changed: 15 additions & 12 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 "6.0.25"
5+
id "com.github.spotbugs" version "6.1.11"
66
id 'maven-publish'
77
id 'signing'
88
id "io.codearte.nexus-staging" version "0.30.0"
99
id 'com.adarshr.test-logger' version '4.0.0'
10-
id "com.github.ben-manes.versions" version "0.51.0"
11-
id 'org.sonatype.gradle.plugins.scan' version '2.8.3'
12-
id "org.sonarqube" version "5.1.0.4882"
10+
id "com.github.ben-manes.versions" version "0.52.0"
11+
id 'org.sonatype.gradle.plugins.scan' version '3.1.1'
12+
id "org.sonarqube" version "6.1.0.5360"
1313
}
1414

1515
group = 'com.imsweb'
@@ -18,7 +18,7 @@ description = 'Java client library for SEER*API'
1818

1919
tasks.withType(JavaCompile).configureEach {
2020
options.encoding = 'UTF-8'
21-
options.compilerArgs << "-Werror"
21+
options.compilerArgs << "-Werror" << "-Xlint:-options"
2222
}
2323

2424
java {
@@ -34,19 +34,22 @@ repositories {
3434
}
3535

3636
dependencies {
37-
spotbugs 'com.github.spotbugs:spotbugs:4.8.6'
37+
spotbugs 'com.github.spotbugs:spotbugs:4.9.3'
3838

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

4242
// retrofit will not update these dependencies to fix vulnerabilities
4343
api 'com.squareup.okhttp3:okhttp:4.12.0'
44-
api 'com.squareup.okio:okio:3.9.1'
44+
api 'com.squareup.okio:okio:3.11.0'
4545

46-
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.11.3'
47-
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.11.3'
48-
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.11.3'
49-
testImplementation 'org.assertj:assertj-core:3.26.3'
46+
testImplementation platform('org.junit:junit-bom:5.12.2')
47+
testImplementation 'org.junit.jupiter:junit-jupiter-api'
48+
testImplementation 'org.junit.jupiter:junit-jupiter-params'
49+
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
50+
testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.12.2'
51+
52+
testImplementation 'org.assertj:assertj-core:3.27.3'
5053
testImplementation 'com.google.code.bean-matchers:bean-matchers:0.14'
5154
}
5255

@@ -122,7 +125,7 @@ tasks.named("dependencyUpdates").configure {
122125
}
123126

124127
wrapper {
125-
gradleVersion = '8.8'
128+
gradleVersion = '8.14'
126129
distributionType = Wrapper.DistributionType.ALL
127130
}
128131

gradle/wrapper/gradle-wrapper.jar

311 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -84,7 +86,7 @@ done
8486
# shellcheck disable=SC2034
8587
APP_BASE_NAME=${0##*/}
8688
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87-
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
8890

8991
# Use the maximum available, or set MAX_FD != -1 to use that value.
9092
MAX_FD=maximum
@@ -112,7 +114,7 @@ case "$( uname )" in #(
112114
NONSTOP* ) nonstop=true ;;
113115
esac
114116

115-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
117+
CLASSPATH="\\\"\\\""
116118

117119

118120
# Determine the Java command to use to start the JVM.
@@ -203,15 +205,15 @@ fi
203205
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
204206

205207
# Collect all arguments for the java command:
206-
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
208+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
207209
# and any embedded shellness will be escaped.
208210
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
209211
# treated as '${Hostname}' itself on the command line.
210212

211213
set -- \
212214
"-Dorg.gradle.appname=$APP_BASE_NAME" \
213215
-classpath "$CLASSPATH" \
214-
org.gradle.wrapper.GradleWrapperMain \
216+
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
215217
"$@"
216218

217219
# Stop when "xargs" is not available.

gradlew.bat

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@rem See the License for the specific language governing permissions and
1414
@rem limitations under the License.
1515
@rem
16+
@rem SPDX-License-Identifier: Apache-2.0
17+
@rem
1618

1719
@if "%DEBUG%"=="" @echo off
1820
@rem ##########################################################################
@@ -68,11 +70,11 @@ goto fail
6870
:execute
6971
@rem Setup the command line
7072

71-
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73+
set CLASSPATH=
7274

7375

7476
@rem Execute Gradle
75-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
77+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
7678

7779
:end
7880
@rem End local scope for the variables with windows NT shell

src/test/java/com/imsweb/seerapi/client/disease/DiseaseTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class DiseaseTest {
2828
private static DiseaseService _DISEASE;
2929

3030
@BeforeAll
31-
public static void setup() {
31+
static void setup() {
3232
_DISEASE = new SeerApi.Builder().connect().disease();
3333
}
3434

@@ -117,7 +117,7 @@ void testDiseaseById() throws IOException {
117117
assertEquals(2, disease.getTreatment().size());
118118
assertNull(disease.getGenetics());
119119
assertFalse(disease.getAlternateName().isEmpty());
120-
assertEquals("Acute erythremia", disease.getAlternateName().get(0).getValue());
120+
assertEquals("Acute erythemia [OBS]", disease.getAlternateName().get(0).getValue());
121121
assertTrue(disease.getIcdO2Morphology().contains("9840/3"));
122122
assertTrue(disease.getIcdO1Morphology().contains("9840/3"));
123123
assertEquals("C94.0 Acute erythroid leukemia", disease.getIcd10CmCode().get(0).getValue());

src/test/java/com/imsweb/seerapi/client/glossary/GlossaryTest.java

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import static com.google.code.beanmatchers.BeanMatchers.hasValidBeanConstructor;
2222
import static com.google.code.beanmatchers.BeanMatchers.hasValidGettersAndSetters;
2323
import static com.imsweb.seerapi.client.glossary.Glossary.Category.GENERAL;
24+
import static com.imsweb.seerapi.client.glossary.Glossary.Category.HEMATO;
2425
import static org.junit.jupiter.api.Assertions.assertEquals;
2526
import static org.junit.jupiter.api.Assertions.assertFalse;
2627
import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -32,7 +33,7 @@ class GlossaryTest {
3233
private static GlossaryService _GLOSSARY;
3334

3435
@BeforeAll
35-
public static void setup() {
36+
static void setup() {
3637
_GLOSSARY = new SeerApi.Builder().connect().glossary();
3738
}
3839

@@ -49,7 +50,7 @@ void testGlossaryVersions() throws IOException {
4950
assertEquals(1, versions.size());
5051
GlossaryVersion version = versions.get(0);
5152
assertEquals("latest", version.getName());
52-
assertNull(version.getType()); // type not returned when no permisisons
53+
assertNull(version.getType()); // type isn't returned when no permisisons
5354
assertNotNull(version.getFirstPublished());
5455
assertNotNull(version.getCount());
5556
}
@@ -68,7 +69,7 @@ void testGlossaryById() throws IOException {
6869
assertNull(glossary.getPrimarySite());
6970

7071
assertNull(glossary.getHistology());
71-
assertTrue(glossary.getDefinition().startsWith("An x-ray of the lymphatic system."));
72+
assertTrue(glossary.getDefinition().startsWith("An x-ray or computer image of the lymphatic system."));
7273
assertNull(glossary.getAlternateName());
7374
assertNull(glossary.getHistory());
7475
}
@@ -87,15 +88,15 @@ void testGlossarySearch() throws IOException {
8788
assertEquals(Collections.singletonList(term), results.getTerms());
8889

8990
// add the category and verify there are no results
90-
results = _GLOSSARY.search("latest", search.paramMap(), EnumSet.of(Glossary.Category.SOLID_TUMOR)).execute().body();
91+
results = _GLOSSARY.search("latest", search.paramMap(), EnumSet.of(GENERAL)).execute().body();
9192

9293
assertNotNull(results);
9394
assertEquals(25, results.getCount().longValue());
94-
assertEquals(0, results.getTotal().longValue());
95-
assertNull(results.getResults());
95+
assertTrue(results.getTotal().longValue() > 0);
96+
assertFalse(results.getResults().isEmpty());
9697

9798
// add a second category and verify there are we get the results again
98-
results = _GLOSSARY.search("latest", search.paramMap(), EnumSet.of(Glossary.Category.SOLID_TUMOR, Glossary.Category.HEMATO)).execute().body();
99+
results = _GLOSSARY.search("latest", search.paramMap(), EnumSet.of(GENERAL, Glossary.Category.HEMATO)).execute().body();
99100

100101
assertNotNull(results);
101102
assertEquals(25, results.getCount().longValue());
@@ -126,19 +127,23 @@ void testGlossarySearchIterate() throws IOException {
126127
search.setOffset(search.getOffset() + results.getResults().size());
127128
}
128129

129-
assertTrue(total > 100);
130+
assertTrue(total > 0);
130131
}
131132

132133
@Test
133134
void testGlossaryMatch() throws IOException {
134-
String text = "This text contains summary stage which should be found.";
135+
String text = "white blood cells that produce antibodies";
135136

136137
Set<KeywordMatch> matches = _GLOSSARY.match(text, null, true).execute().body();
137138
assertNotNull(matches);
138-
assertEquals(1, matches.size());
139+
assertEquals(2, matches.size());
139140

140141
matches = _GLOSSARY.match(text, EnumSet.of(GENERAL), true).execute().body();
141142
assertNotNull(matches);
143+
assertEquals(2, matches.size());
144+
145+
matches = _GLOSSARY.match(text, EnumSet.of(HEMATO), true).execute().body();
146+
assertNotNull(matches);
142147
assertEquals(0, matches.size());
143148
}
144149

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class RxTest {
3030
private static RxService _RX;
3131

3232
@BeforeAll
33-
public static void setup() {
33+
static void setup() {
3434
_RX = new SeerApi.Builder().connect().rx();
3535
}
3636

@@ -123,8 +123,8 @@ void testRxSearch() throws IOException {
123123

124124
assertNotNull(results);
125125
assertEquals(25, results.getCount().longValue());
126-
assertEquals(7, results.getTotal().longValue());
127-
assertEquals(7, results.getResults().size());
126+
assertEquals(8, results.getTotal().longValue());
127+
assertEquals(8, results.getResults().size());
128128
assertEquals(Collections.singletonList("abt"), results.getTerms());
129129

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

src/test/java/com/imsweb/seerapi/client/staging/StagingTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class StagingTest {
9595
private static StagingService _STAGING;
9696

9797
@BeforeAll
98-
public static void setup() {
98+
static void setup() {
9999
_STAGING = new SeerApi.Builder().connect().staging();
100100
}
101101

@@ -538,11 +538,11 @@ void testStagingWithErrors() throws IOException {
538538
void testStagingGlossary() throws IOException {
539539
Set<KeywordMatch> matches = _STAGING.schemaGlossary("eod_public", "2.0", "breast", null, true).execute().body();
540540
assertThat(matches).hasSize(26);
541-
matches = _STAGING.schemaGlossary("eod_public", "2.0", "breast", EnumSet.of(Category.STAGING), true).execute().body();
542-
assertThat(matches).hasSize(1);
541+
matches = _STAGING.schemaGlossary("eod_public", "2.0", "breast", EnumSet.of(Category.GENERAL), true).execute().body();
542+
assertThat(matches).hasSize(26);
543543

544544
matches = _STAGING.tableGlossary("eod_public", "2.0", "cea_pretx_lab_value_33864", null, true).execute().body();
545-
assertThat(matches).hasSize(24);
545+
assertThat(matches).hasSize(23);
546546
matches = _STAGING.tableGlossary("eod_public", "2.0", "cea_pretx_lab_value_33864", EnumSet.of(Category.STAGING), true).execute().body();
547547
assertThat(matches).isEmpty();
548548
}

0 commit comments

Comments
 (0)