aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/PatientHypothesisFormatSuite.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/PatientHypothesisFormatSuite.scala')
-rw-r--r--src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/PatientHypothesisFormatSuite.scala19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/PatientHypothesisFormatSuite.scala b/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/PatientHypothesisFormatSuite.scala
index 1a5b7eb..fbb5213 100644
--- a/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/PatientHypothesisFormatSuite.scala
+++ b/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/PatientHypothesisFormatSuite.scala
@@ -9,7 +9,7 @@ import xyz.driver.pdsuidomain.services.PatientHypothesisService.RichPatientHypot
class PatientHypothesisFormatSuite extends FlatSpec with Matchers {
import patienthypothesis._
- "Json format for PatientHypothesis" should "read and write correct JSON" in {
+ "Json format for RichPatientHypothesis" should "read and write correct JSON" in {
val orig = PatientHypothesis(
id = UuidId("815d9715-1089-4775-b120-3afb983b9a97"),
patientId = UuidId("748b5884-3528-4cb9-904b-7a8151d6e343"),
@@ -17,7 +17,7 @@ class PatientHypothesisFormatSuite extends FlatSpec with Matchers {
rationale = None,
matchedTrials = 1
)
- val writtenJson = patientHypothesisWriter.write(RichPatientHypothesis(orig, true))
+ val writtenJson = richPatientHypothesisWriter.write(RichPatientHypothesis(orig, isRequired = true))
writtenJson should be (
"""{"id":"815d9715-1089-4775-b120-3afb983b9a97","patientId":"748b5884-3528-4cb9-904b-7a8151d6e343",
@@ -29,4 +29,19 @@ class PatientHypothesisFormatSuite extends FlatSpec with Matchers {
parsedUpdatePatientHypothesis should be(expectedUpdatedPatientHypothesis)
}
+ "Json format for patientHypothesis" should "read and write correct JSON" in {
+ val orig = PatientHypothesis(
+ id = UuidId("815d9715-1089-4775-b120-3afb983b9a97"),
+ patientId = UuidId("748b5884-3528-4cb9-904b-7a8151d6e343"),
+ hypothesisId = UuidId("e76e2fc4-a29c-44fb-a81b-8856d06bb1d4"),
+ rationale = None,
+ matchedTrials = 1
+ )
+ val writtenJson = patientHypothesisWriter.write(orig)
+
+ writtenJson should be (
+ """{"id":"815d9715-1089-4775-b120-3afb983b9a97","patientId":"748b5884-3528-4cb9-904b-7a8151d6e343",
+ "hypothesisId":"e76e2fc4-a29c-44fb-a81b-8856d06bb1d4","rationale":null,"matchedTrials":1}""".parseJson)
+ }
+
}