Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
distribution: 'adopt'
java-version: '17'
- name: Cache Gradle packages
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
Expand Down
27 changes: 15 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ plugins {
id 'java-library'
id 'checkstyle'
id 'jacoco'
id "com.github.spotbugs" version "6.0.25"
id "com.github.spotbugs" version "6.1.11"
id 'maven-publish'
id 'signing'
id "io.codearte.nexus-staging" version "0.30.0"
id 'com.adarshr.test-logger' version '4.0.0'
id "com.github.ben-manes.versions" version "0.51.0"
id 'org.sonatype.gradle.plugins.scan' version '2.8.3'
id "org.sonarqube" version "5.1.0.4882"
id "com.github.ben-manes.versions" version "0.52.0"
id 'org.sonatype.gradle.plugins.scan' version '3.1.1'
id "org.sonarqube" version "6.1.0.5360"
}

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

tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.compilerArgs << "-Werror"
options.compilerArgs << "-Werror" << "-Xlint:-options"
}

java {
Expand All @@ -34,19 +34,22 @@ repositories {
}

dependencies {
spotbugs 'com.github.spotbugs:spotbugs:4.8.6'
spotbugs 'com.github.spotbugs:spotbugs:4.9.3'

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

// retrofit will not update these dependencies to fix vulnerabilities
api 'com.squareup.okhttp3:okhttp:4.12.0'
api 'com.squareup.okio:okio:3.9.1'
api 'com.squareup.okio:okio:3.11.0'

testImplementation 'org.junit.jupiter:junit-jupiter-api:5.11.3'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.11.3'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.11.3'
testImplementation 'org.assertj:assertj-core:3.26.3'
testImplementation platform('org.junit:junit-bom:5.12.2')
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'org.junit.jupiter:junit-jupiter-params'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.12.2'

testImplementation 'org.assertj:assertj-core:3.27.3'
testImplementation 'com.google.code.bean-matchers:bean-matchers:0.14'
}

Expand Down Expand Up @@ -122,7 +125,7 @@ tasks.named("dependencyUpdates").configure {
}

wrapper {
gradleVersion = '8.8'
gradleVersion = '8.14'
distributionType = Wrapper.DistributionType.ALL
}

Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
10 changes: 6 additions & 4 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

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

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

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
CLASSPATH="\\\"\\\""


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

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

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"

# Stop when "xargs" is not available.
Expand Down
6 changes: 4 additions & 2 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down Expand Up @@ -68,11 +70,11 @@ goto fail
:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
set CLASSPATH=


@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
"%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" %*

:end
@rem End local scope for the variables with windows NT shell
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class DiseaseTest {
private static DiseaseService _DISEASE;

@BeforeAll
public static void setup() {
static void setup() {
_DISEASE = new SeerApi.Builder().connect().disease();
}

Expand Down Expand Up @@ -117,7 +117,7 @@ void testDiseaseById() throws IOException {
assertEquals(2, disease.getTreatment().size());
assertNull(disease.getGenetics());
assertFalse(disease.getAlternateName().isEmpty());
assertEquals("Acute erythremia", disease.getAlternateName().get(0).getValue());
assertEquals("Acute erythemia [OBS]", disease.getAlternateName().get(0).getValue());
assertTrue(disease.getIcdO2Morphology().contains("9840/3"));
assertTrue(disease.getIcdO1Morphology().contains("9840/3"));
assertEquals("C94.0 Acute erythroid leukemia", disease.getIcd10CmCode().get(0).getValue());
Expand Down
25 changes: 15 additions & 10 deletions src/test/java/com/imsweb/seerapi/client/glossary/GlossaryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import static com.google.code.beanmatchers.BeanMatchers.hasValidBeanConstructor;
import static com.google.code.beanmatchers.BeanMatchers.hasValidGettersAndSetters;
import static com.imsweb.seerapi.client.glossary.Glossary.Category.GENERAL;
import static com.imsweb.seerapi.client.glossary.Glossary.Category.HEMATO;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
Expand All @@ -32,7 +33,7 @@ class GlossaryTest {
private static GlossaryService _GLOSSARY;

@BeforeAll
public static void setup() {
static void setup() {
_GLOSSARY = new SeerApi.Builder().connect().glossary();
}

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

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

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

assertNotNull(results);
assertEquals(25, results.getCount().longValue());
assertEquals(0, results.getTotal().longValue());
assertNull(results.getResults());
assertTrue(results.getTotal().longValue() > 0);
assertFalse(results.getResults().isEmpty());

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

assertNotNull(results);
assertEquals(25, results.getCount().longValue());
Expand Down Expand Up @@ -126,19 +127,23 @@ void testGlossarySearchIterate() throws IOException {
search.setOffset(search.getOffset() + results.getResults().size());
}

assertTrue(total > 100);
assertTrue(total > 0);
}

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

Set<KeywordMatch> matches = _GLOSSARY.match(text, null, true).execute().body();
assertNotNull(matches);
assertEquals(1, matches.size());
assertEquals(2, matches.size());

matches = _GLOSSARY.match(text, EnumSet.of(GENERAL), true).execute().body();
assertNotNull(matches);
assertEquals(2, matches.size());

matches = _GLOSSARY.match(text, EnumSet.of(HEMATO), true).execute().body();
assertNotNull(matches);
assertEquals(0, matches.size());
}

Expand Down
6 changes: 3 additions & 3 deletions src/test/java/com/imsweb/seerapi/client/rx/RxTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class RxTest {
private static RxService _RX;

@BeforeAll
public static void setup() {
static void setup() {
_RX = new SeerApi.Builder().connect().rx();
}

Expand Down Expand Up @@ -123,8 +123,8 @@ void testRxSearch() throws IOException {

assertNotNull(results);
assertEquals(25, results.getCount().longValue());
assertEquals(7, results.getTotal().longValue());
assertEquals(7, results.getResults().size());
assertEquals(8, results.getTotal().longValue());
assertEquals(8, results.getResults().size());
assertEquals(Collections.singletonList("abt"), results.getTerms());

search.setMode(PublishableSearch.SearchMode.OR);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class StagingTest {
private static StagingService _STAGING;

@BeforeAll
public static void setup() {
static void setup() {
_STAGING = new SeerApi.Builder().connect().staging();
}

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

matches = _STAGING.tableGlossary("eod_public", "2.0", "cea_pretx_lab_value_33864", null, true).execute().body();
assertThat(matches).hasSize(24);
assertThat(matches).hasSize(23);
matches = _STAGING.tableGlossary("eod_public", "2.0", "cea_pretx_lab_value_33864", EnumSet.of(Category.STAGING), true).execute().body();
assertThat(matches).isEmpty();
}
Expand Down