diff options
Diffstat (limited to 'src/test/scala')
-rw-r--r-- | src/test/scala/xyz/driver/pdsuidomain/formats/json/PatientCriterionFormatSuite.scala | 10 | ||||
-rw-r--r-- | src/test/scala/xyz/driver/pdsuidomain/formats/json/PatientLabelFormatSuite.scala | 6 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/test/scala/xyz/driver/pdsuidomain/formats/json/PatientCriterionFormatSuite.scala b/src/test/scala/xyz/driver/pdsuidomain/formats/json/PatientCriterionFormatSuite.scala index 93284d9..e0f96bb 100644 --- a/src/test/scala/xyz/driver/pdsuidomain/formats/json/PatientCriterionFormatSuite.scala +++ b/src/test/scala/xyz/driver/pdsuidomain/formats/json/PatientCriterionFormatSuite.scala @@ -34,12 +34,14 @@ class PatientCriterionFormatSuite extends FlatSpec with Matchers { PatientCriterionArm(patientCriterionId = LongId(1), armId = LongId(32), armName = "arm 32") ) val richPatientCriterion = RichPatientCriterion(orig, LongId(21), arms) - val writtenJson = patientCriterionWriter.write(richPatientCriterion) + val writtenJson = richPatientCriterionFormat.write(richPatientCriterion) writtenJson should be( - """{"id":1,"labelId":21,"nctId":"NCT00001","criterionId":101,"criterionText":"criterion text","criterionValue":"Yes", - "criterionIsDefining":false,"criterionIsCompound":false,"eligibilityStatus":"Yes","verifiedEligibilityStatus":null, - "isVisible":true,"isVerified":true,"lastUpdate":"2017-08-10T18:00Z","arms":["arm 31","arm 32"],"inclusion":true}""".parseJson) + """{"isVerified":true,"patientLabelId":1,"lastUpdate":"2017-08-10T18:00Z","trialId":0, + "armList":[{"patientCriterionId":1,"armId":31,"armName":"arm 31"},{"patientCriterionId":1, + "armId":32,"armName":"arm 32"}],"eligibilityStatus":"Yes","id":1,"nctId":"NCT00001", + "criterionId":101,"criterionValue":true,"criterionIsDefining":false,"labelId":21, + "isVisible":true,"criterionText":"criterion text","inclusion":true}""".parseJson) val updatePatientCriterionJson = """{"verifiedEligibilityStatus":"No"}""".parseJson val expectedUpdatedPatientCriterion = orig.copy(verifiedEligibilityStatus = Some(LabelValue.No)) diff --git a/src/test/scala/xyz/driver/pdsuidomain/formats/json/PatientLabelFormatSuite.scala b/src/test/scala/xyz/driver/pdsuidomain/formats/json/PatientLabelFormatSuite.scala index 95dfa68..b83aad1 100644 --- a/src/test/scala/xyz/driver/pdsuidomain/formats/json/PatientLabelFormatSuite.scala +++ b/src/test/scala/xyz/driver/pdsuidomain/formats/json/PatientLabelFormatSuite.scala @@ -23,11 +23,11 @@ class PatientLabelFormatSuite extends FlatSpec with Matchers { score = 1, isImplicitMatch = false ) - val writtenJson = richPatientLabelWriter.write(RichPatientLabel(orig, isVerified = true)) + val writtenJson = richPatientLabelFormat.write(RichPatientLabel(orig, isVerified = true)) writtenJson should be( - """{"id":1,"labelId":20,"primaryValue":"Yes","verifiedPrimaryValue":null,"isVisible":true,"isVerified":true, - "score":1,"isImplicitMatch":false}""".parseJson) + """{"id":1,"labelId":20,"primaryValue":"Yes","isVisible":true,"isVerified":true, + "score":1,"isImplicitMatch":false, "patientId":"748b5884-3528-4cb9-904b-7a8151d6e343"}""".parseJson) val updatePatientLabelJson = """{"verifiedPrimaryValue":"No"}""".parseJson val expectedUpdatedPatientLabel = orig.copy(verifiedPrimaryValue = Some(LabelValue.No)) |