Skip to content

Commit 0753b60

Browse files
committed
Fixed surgery endpoint to match API changes
1 parent 65b86cb commit 0753b60

File tree

3 files changed

+25
-49
lines changed

3 files changed

+25
-49
lines changed

src/main/java/com/imsweb/seerapi/client/surgery/SurgeryService.java

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,25 @@
1010
import retrofit2.http.Path;
1111
import retrofit2.http.Query;
1212

13-
import com.imsweb.seerapi.client.shared.Version;
14-
1513
public interface SurgeryService {
1614

1715
/**
18-
* Return a collection of Version objects which describe the available versions
19-
* @return a list of the available site-specific surgery versions and information about each of them
20-
*/
21-
@GET("surgery/versions")
22-
Call<List<Version>> versions();
23-
24-
/**
25-
* Return a list of all the site-specific surgery table titles from a specific version
26-
* @param version version
16+
* Return a list of all the site-specific surgery table titles from a specific year
17+
* @param year year
2718
* @return a list of site-specific surgery table titles
2819
*/
29-
@GET("surgery/{version}/tables")
30-
Call<List<String>> tables(@Path("version") String version);
20+
@GET("surgery/{year}/tables")
21+
Call<List<String>> tables(@Path("year") String year);
3122

3223
/**
33-
* Return a specific site-specific surgary table from a specific version
34-
* @param version version
24+
* Return a specific site-specific surgary table from a specific year
25+
* @param year year
3526
* @param title site title (optional if the site/histology is provided)
3627
* @param site primary site (optional if the title is provided)
3728
* @param histology histology (optional if the title is provided)
3829
* @return a site-specific surgery table
3930
*/
40-
@GET("surgery/{version}/table")
41-
Call<SurgeryTable> table(@Path("version") String version, @Query("title") String title, @Query("site") String site, @Query("hist") String histology);
31+
@GET("surgery/{year}/table")
32+
Call<SurgeryTable> table(@Path("year") String year, @Query("title") String title, @Query("site") String site, @Query("hist") String histology);
4233

4334
}

src/test/java/com/imsweb/seerapi/client/ndc/NdcTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public void testNdcByCode() throws IOException {
6767
assertThat(product.getProprietaryName()).isEqualTo("Verzenio");
6868
assertThat(product.getSeerInfo()).as("must have 'seerinfo'").isNotNull();
6969
assertThat(product.getSeerInfo().getCategories()).containsExactly(Category.CHEMOTHERAPY);
70-
assertThat(product.getSeerInfo().getMajorDrugClass()).startsWith("Cyclin dependent");
70+
assertThat(product.getSeerInfo().getMajorDrugClass()).contains("Cyclin Dependent");
7171
assertThat(product.getSeerInfo().getMinorDrugClass()).isEqualTo("CDK 4/6");
7272

7373
// the subcategory is being removed but still exists in production; the key should be ignored

src/test/java/com/imsweb/seerapi/client/surgery/SurgeryTest.java

Lines changed: 16 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,8 @@
1010
import org.junit.Test;
1111

1212
import com.imsweb.seerapi.client.SeerApi;
13-
import com.imsweb.seerapi.client.shared.Version;
1413

15-
import static org.junit.Assert.assertEquals;
16-
import static org.junit.Assert.assertFalse;
17-
import static org.junit.Assert.assertNotNull;
18-
import static org.junit.Assert.assertNull;
19-
import static org.junit.Assert.assertTrue;
14+
import static org.assertj.core.api.Assertions.assertThat;
2015

2116
public class SurgeryTest {
2217

@@ -27,43 +22,33 @@ public static void setup() {
2722
_SURGERY = new SeerApi.Builder().connect().surgery();
2823
}
2924

30-
@Test
31-
public void testSiteSpecificSurgeryVersions() throws IOException {
32-
List<Version> versions = _SURGERY.versions().execute().body();
33-
34-
assertTrue(versions.size() > 0);
35-
for (Version version : versions) {
36-
assertTrue(version.getVersion().length() > 0);
37-
assertTrue(version.getCount() > 0);
38-
}
39-
}
40-
4125
@Test
4226
public void testSiteSpecificSurgeryTables() throws IOException {
4327
List<String> titles = _SURGERY.tables("2014").execute().body();
4428

45-
assertTrue(titles.size() > 0);
46-
assertTrue(titles.contains("Oral Cavity"));
29+
assertThat(titles).isNotEmpty();
30+
assertThat(titles).containsAnyOf("Oral Cavity");
4731
}
4832

4933
@Test
5034
public void testSiteSpecificSurgeryTable() throws IOException {
5135
SurgeryTable table = _SURGERY.table("2014", "Oral Cavity", null, null).execute().body();
5236

53-
assertNotNull(table);
54-
assertEquals("Oral Cavity", table.getTitle());
55-
assertNotNull(table.getSiteInclusions());
56-
assertNotNull(table.getHistExclusions());
57-
assertNull(table.getHistInclusions());
58-
assertNotNull(table.getPreNote());
59-
assertNull(table.getPostNote());
37+
assertThat(table).isNotNull();
38+
assertThat(table.getTitle()).isEqualTo("Oral Cavity");
39+
assertThat(table.getSiteInclusions()).isNotNull();
40+
assertThat(table.getHistExclusions()).isNotNull();
41+
assertThat(table.getHistInclusions()).isNull();
42+
assertThat(table.getPreNote()).isNotNull();
43+
assertThat(table.getPostNote()).isNull();
44+
6045
SurgeryRow row = table.getRows().get(0);
61-
assertEquals("00", row.getCode());
62-
assertNotNull(row.getDescription());
63-
assertEquals(Integer.valueOf(0), row.getLevel());
64-
assertFalse(row.getLineBreak());
46+
assertThat(row.getCode()).isEqualTo("00");
47+
assertThat(row.getDescription()).isNotNull();
48+
assertThat(row.getLevel()).isEqualTo(Integer.valueOf(0));
49+
assertThat(row.getLineBreak()).isFalse();
6550

6651
table = _SURGERY.table("2014", null, "C001", "8000").execute().body();
67-
assertEquals("Oral Cavity", table.getTitle());
52+
assertThat(table.getTitle()).isEqualTo("Oral Cavity");
6853
}
6954
}

0 commit comments

Comments
 (0)