Skip to content

Commit 12eea2e

Browse files
author
may
committed
Fix failing units
1 parent 3a1764a commit 12eea2e

File tree

5 files changed

+21
-16
lines changed

5 files changed

+21
-16
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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 {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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: 14 additions & 9 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;
@@ -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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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)