aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/xyz/driver
diff options
context:
space:
mode:
authorKseniya Tomskikh <ktomskih@datamonsters.co>2017-10-04 13:16:42 +0700
committerKseniya Tomskikh <ktomskih@datamonsters.co>2017-10-04 13:16:42 +0700
commitbc4f67fe6755a34d410e75ce9b475b3e1c2d38e3 (patch)
tree6e615a688d90951c6586944f390db1a29ed8841f /src/test/scala/xyz/driver
parenta321a978353439fc516b0f2016c28fb32ba1b7ae (diff)
downloadrest-query-bc4f67fe6755a34d410e75ce9b475b3e1c2d38e3.tar.gz
rest-query-bc4f67fe6755a34d410e75ce9b475b3e1c2d38e3.tar.bz2
rest-query-bc4f67fe6755a34d410e75ce9b475b3e1c2d38e3.zip
Replace tuples in services replies to rich-classes
Diffstat (limited to 'src/test/scala/xyz/driver')
-rw-r--r--src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/PatientCriterionFormatSuite.scala5
-rw-r--r--src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/PatientHypothesisFormatSuite.scala3
-rw-r--r--src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/PatientLabelFormatSuite.scala3
3 files changed, 7 insertions, 4 deletions
diff --git a/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/PatientCriterionFormatSuite.scala b/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/PatientCriterionFormatSuite.scala
index 0f5e4e2..623b3a9 100644
--- a/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/PatientCriterionFormatSuite.scala
+++ b/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/PatientCriterionFormatSuite.scala
@@ -6,7 +6,7 @@ import spray.json._
import org.scalatest.{FlatSpec, Matchers}
import xyz.driver.pdsuicommon.domain.{FuzzyValue, LongId, StringId}
import xyz.driver.pdsuidomain.entities.{PatientCriterion, PatientCriterionArm}
-import xyz.driver.pdsuidomain.services.PatientCriterionService.DraftPatientCriterion
+import xyz.driver.pdsuidomain.services.PatientCriterionService.{DraftPatientCriterion, RichPatientCriterion}
class PatientCriterionFormatSuite extends FlatSpec with Matchers {
import patientcriterion._
@@ -31,7 +31,8 @@ class PatientCriterionFormatSuite extends FlatSpec with Matchers {
PatientCriterionArm(patientCriterionId = LongId(1), armId = LongId(31), armName = "arm 31"),
PatientCriterionArm(patientCriterionId = LongId(1), armId = LongId(32), armName = "arm 32")
)
- val writtenJson = patientCriterionWriter.write((orig, LongId(21), arms))
+ val richPatientCriterion = RichPatientCriterion(orig, LongId(21), arms)
+ val writtenJson = patientCriterionWriter.write(richPatientCriterion)
writtenJson should be (
"""{"id":1,"labelId":21,"nctId":"NCT00001","criterionId":101,"criterionText":"criterion text","criterionValue":"Yes",
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 2999cc1..1a5b7eb 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
@@ -4,6 +4,7 @@ import spray.json._
import org.scalatest.{FlatSpec, Matchers}
import xyz.driver.pdsuicommon.domain.UuidId
import xyz.driver.pdsuidomain.entities.PatientHypothesis
+import xyz.driver.pdsuidomain.services.PatientHypothesisService.RichPatientHypothesis
class PatientHypothesisFormatSuite extends FlatSpec with Matchers {
import patienthypothesis._
@@ -16,7 +17,7 @@ class PatientHypothesisFormatSuite extends FlatSpec with Matchers {
rationale = None,
matchedTrials = 1
)
- val writtenJson = patientHypothesisWriter.write((orig, true))
+ val writtenJson = patientHypothesisWriter.write(RichPatientHypothesis(orig, true))
writtenJson should be (
"""{"id":"815d9715-1089-4775-b120-3afb983b9a97","patientId":"748b5884-3528-4cb9-904b-7a8151d6e343",
diff --git a/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/PatientLabelFormatSuite.scala b/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/PatientLabelFormatSuite.scala
index e18239c..8b7c138 100644
--- a/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/PatientLabelFormatSuite.scala
+++ b/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/PatientLabelFormatSuite.scala
@@ -6,6 +6,7 @@ import spray.json._
import org.scalatest.{FlatSpec, Matchers}
import xyz.driver.pdsuicommon.domain.{FuzzyValue, LongId, UuidId}
import xyz.driver.pdsuidomain.entities.{PatientLabel, PatientLabelEvidenceView}
+import xyz.driver.pdsuidomain.services.PatientLabelService.RichPatientLabel
class PatientLabelFormatSuite extends FlatSpec with Matchers {
@@ -21,7 +22,7 @@ class PatientLabelFormatSuite extends FlatSpec with Matchers {
score = 1,
isImplicitMatch = false
)
- val writtenJson = patientLabelWriter.write((orig, true))
+ val writtenJson = patientLabelWriter.write(RichPatientLabel(orig, true))
writtenJson should be (
"""{"id":1,"labelId":20,"primaryValue":"Yes","verifiedPrimaryValue":null,"isVisible":true,"isVerified":true,