|
14 | 14 | import com.imsweb.seerapi.client.mph.MphInput; |
15 | 15 | import com.imsweb.seerapi.client.mph.MphInputPair; |
16 | 16 | import com.imsweb.seerapi.client.mph.MphOutput; |
| 17 | +import com.imsweb.seerapi.client.mph.MphOutput.Result; |
17 | 18 | import com.imsweb.seerapi.client.mph.MphRule; |
18 | 19 | import com.imsweb.seerapi.client.mph.MphService; |
19 | 20 |
|
@@ -55,8 +56,9 @@ void testMissingSite() throws IOException { |
55 | 56 | input2.setDateOfDiagnosisYear("2016"); |
56 | 57 | input2.setLaterality("1"); |
57 | 58 |
|
58 | | - Call<MphOutput> call = _MPH.mph(new MphInputPair(input1, input2)); |
59 | | - assertThrows(BadRequestException.class, call::execute); |
| 59 | + MphOutput result = _MPH.mph(new MphInputPair(input1, input2)).execute().body(); |
| 60 | + assertNotNull(result); |
| 61 | + assertEquals(Result.INVALID_INPUT, result.getResult()); |
60 | 62 | } |
61 | 63 |
|
62 | 64 | @Test |
@@ -112,9 +114,9 @@ void testResults() throws IOException { |
112 | 114 | assertEquals(MphOutput.Result.MULTIPLE_PRIMARIES, result.getResult()); |
113 | 115 | assertEquals("mph_2007_to_2017_breast", result.getGroupId()); |
114 | 116 | assertEquals("M5", result.getStep()); |
115 | | - assertEquals("Tumors diagnosed more than five (5) years apart are multiple primaries.", result.getReason()); |
| 117 | + assertEquals("Tumors diagnosed more than 5 years apart are multiple primaries.", result.getReason()); |
116 | 118 | assertEquals(2, result.getAppliedRules().size()); |
117 | | - assertEquals("Are there tumors diagnosed more than five (5) years apart?", result.getAppliedRules().get(1).getQuestion()); |
| 119 | + assertEquals("Are there tumors diagnosed more than 5 years apart?", result.getAppliedRules().get(1).getQuestion()); |
118 | 120 | } |
119 | 121 |
|
120 | 122 | @Test |
@@ -160,8 +162,9 @@ void testInvalidInput() throws IOException { |
160 | 162 | i1.setDateOfDiagnosisYear("2015"); |
161 | 163 | i2.setDateOfDiagnosisYear("2015"); |
162 | 164 |
|
163 | | - Call<MphOutput> call = _MPH.mph(new MphInputPair(i1, i2)); |
164 | | - assertThrows(BadRequestException.class, call::execute); |
| 165 | + MphOutput result = _MPH.mph(new MphInputPair(i1, i2)).execute().body(); |
| 166 | + assertNotNull(result); |
| 167 | + assertEquals(MphOutput.Result.INVALID_INPUT, result.getResult()); |
165 | 168 | } |
166 | 169 |
|
167 | 170 | @Test |
|
0 commit comments