aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/xyz/driver/pdsuidomain
diff options
context:
space:
mode:
authorAleksandr <ognelisar@gmail.com>2017-11-14 15:45:50 +0700
committerAleksandr <ognelisar@gmail.com>2017-11-14 15:45:50 +0700
commitadd98e1a1100d5b0fb666ac4669d0a90272959ca (patch)
tree4e32e92e7bc3a6373f95f04bd28f946b5b100234 /src/test/scala/xyz/driver/pdsuidomain
parent2afec69b277c031eb52e1a05e57ff7bb0079f8d1 (diff)
parent29ee5de759374ceed9c856a51443a3f7c2cec029 (diff)
downloadrest-query-add98e1a1100d5b0fb666ac4669d0a90272959ca.tar.gz
rest-query-add98e1a1100d5b0fb666ac4669d0a90272959ca.tar.bz2
rest-query-add98e1a1100d5b0fb666ac4669d0a90272959ca.zip
Merge branch 'master' into PDSUI-2345
Diffstat (limited to 'src/test/scala/xyz/driver/pdsuidomain')
-rw-r--r--src/test/scala/xyz/driver/pdsuidomain/DocumentSuite.scala3
-rw-r--r--src/test/scala/xyz/driver/pdsuidomain/formats/json/PatientCriterionFormatSuite.scala8
-rw-r--r--src/test/scala/xyz/driver/pdsuidomain/formats/json/PatientEligibleTrialFormatSuite.scala4
-rw-r--r--src/test/scala/xyz/driver/pdsuidomain/formats/json/PatientLabelFormatSuite.scala12
-rw-r--r--src/test/scala/xyz/driver/pdsuidomain/formats/json/TrialHistoryFormatSuite.scala5
5 files changed, 16 insertions, 16 deletions
diff --git a/src/test/scala/xyz/driver/pdsuidomain/DocumentSuite.scala b/src/test/scala/xyz/driver/pdsuidomain/DocumentSuite.scala
index 63c4aa2..ccd5a3a 100644
--- a/src/test/scala/xyz/driver/pdsuidomain/DocumentSuite.scala
+++ b/src/test/scala/xyz/driver/pdsuidomain/DocumentSuite.scala
@@ -7,10 +7,9 @@ import org.scalatest.FreeSpecLike
import org.scalatest.concurrent.ScalaFutures
import org.scalatest.time.{Millis, Span}
import xyz.driver.pdsuicommon.domain.{LongId, TextJson}
-import xyz.driver.pdsuicommon.utils.DiffUtils
import xyz.driver.pdsuidomain.entities.Document
-class DocumentSuite extends FreeSpecLike with DiffUtils with ScalaFutures {
+class DocumentSuite extends FreeSpecLike with ScalaFutures {
implicit val defaultPatience: PatienceConfig =
PatienceConfig(timeout = Span(1000, Millis), interval = Span(20, Millis))
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 e0f96bb..94d80c9 100644
--- a/src/test/scala/xyz/driver/pdsuidomain/formats/json/PatientCriterionFormatSuite.scala
+++ b/src/test/scala/xyz/driver/pdsuidomain/formats/json/PatientCriterionFormatSuite.scala
@@ -22,8 +22,8 @@ class PatientCriterionFormatSuite extends FlatSpec with Matchers {
criterionText = "criterion text",
criterionValue = Some(true),
criterionIsDefining = false,
- eligibilityStatus = Some(LabelValue.Yes),
- verifiedEligibilityStatus = None,
+ eligibilityStatus = LabelValue.Yes,
+ verifiedEligibilityStatus = LabelValue.Unknown,
isVisible = true,
isVerified = true,
lastUpdate = LocalDateTime.parse("2017-08-10T18:00:00"),
@@ -39,12 +39,12 @@ class PatientCriterionFormatSuite extends FlatSpec with Matchers {
writtenJson should be(
"""{"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",
+ "armId":32,"armName":"arm 32"}],"eligibilityStatus":"Yes","verifiedEligibilityStatus":"Unknown","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))
+ val expectedUpdatedPatientCriterion = orig.copy(verifiedEligibilityStatus = LabelValue.No)
val parsedUpdatePatientCriterion = applyUpdateToPatientCriterion(updatePatientCriterionJson, orig)
parsedUpdatePatientCriterion should be(expectedUpdatedPatientCriterion)
diff --git a/src/test/scala/xyz/driver/pdsuidomain/formats/json/PatientEligibleTrialFormatSuite.scala b/src/test/scala/xyz/driver/pdsuidomain/formats/json/PatientEligibleTrialFormatSuite.scala
index b5fbf3f..faef0f6 100644
--- a/src/test/scala/xyz/driver/pdsuidomain/formats/json/PatientEligibleTrialFormatSuite.scala
+++ b/src/test/scala/xyz/driver/pdsuidomain/formats/json/PatientEligibleTrialFormatSuite.scala
@@ -38,8 +38,8 @@ class PatientEligibleTrialFormatSuite extends FlatSpec with Matchers {
patientId = UuidId("748b5884-3528-4cb9-904b-7a8151d6e343"),
trialId = StringId("NCT000001"),
hypothesisId = UuidId("e76e2fc4-a29c-44fb-a81b-8856d06bb1d4"),
- eligibilityStatus = Some(LabelValue.Yes),
- verifiedEligibilityStatus = Some(LabelValue.Yes),
+ eligibilityStatus = LabelValue.Yes,
+ verifiedEligibilityStatus = LabelValue.Yes,
isVerified = false
)
val arms = List(
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 b83aad1..289de53 100644
--- a/src/test/scala/xyz/driver/pdsuidomain/formats/json/PatientLabelFormatSuite.scala
+++ b/src/test/scala/xyz/driver/pdsuidomain/formats/json/PatientLabelFormatSuite.scala
@@ -17,8 +17,8 @@ class PatientLabelFormatSuite extends FlatSpec with Matchers {
id = LongId(1),
patientId = UuidId("748b5884-3528-4cb9-904b-7a8151d6e343"),
labelId = LongId(20),
- primaryValue = Some(LabelValue.Yes),
- verifiedPrimaryValue = None,
+ primaryValue = LabelValue.Yes,
+ verifiedPrimaryValue = LabelValue.Unknown,
isVisible = true,
score = 1,
isImplicitMatch = false
@@ -26,11 +26,11 @@ class PatientLabelFormatSuite extends FlatSpec with Matchers {
val writtenJson = richPatientLabelFormat.write(RichPatientLabel(orig, isVerified = true))
writtenJson should be(
- """{"id":1,"labelId":20,"primaryValue":"Yes","isVisible":true,"isVerified":true,
+ """{"id":1,"labelId":20,"primaryValue":"Yes","isVisible":true,"isVerified":true,"verifiedPrimaryValue":"Unknown",
"score":1,"isImplicitMatch":false, "patientId":"748b5884-3528-4cb9-904b-7a8151d6e343"}""".parseJson)
val updatePatientLabelJson = """{"verifiedPrimaryValue":"No"}""".parseJson
- val expectedUpdatedPatientLabel = orig.copy(verifiedPrimaryValue = Some(LabelValue.No))
+ val expectedUpdatedPatientLabel = orig.copy(verifiedPrimaryValue = LabelValue.No)
val parsedUpdatePatientLabel = applyUpdateToPatientLabel(updatePatientLabelJson, orig)
parsedUpdatePatientLabel should be(expectedUpdatedPatientLabel)
}
@@ -65,8 +65,8 @@ class PatientLabelFormatSuite extends FlatSpec with Matchers {
id = LongId(1),
patientId = UuidId("748b5884-3528-4cb9-904b-7a8151d6e343"),
labelId = LongId(20),
- primaryValue = Some(LabelValue.Yes),
- verifiedPrimaryValue = Some(LabelValue.Yes),
+ primaryValue = LabelValue.Yes,
+ verifiedPrimaryValue = LabelValue.Yes,
isVisible = true,
score = 1,
isImplicitMatch = false
diff --git a/src/test/scala/xyz/driver/pdsuidomain/formats/json/TrialHistoryFormatSuite.scala b/src/test/scala/xyz/driver/pdsuidomain/formats/json/TrialHistoryFormatSuite.scala
index c17327b..7f4f169 100644
--- a/src/test/scala/xyz/driver/pdsuidomain/formats/json/TrialHistoryFormatSuite.scala
+++ b/src/test/scala/xyz/driver/pdsuidomain/formats/json/TrialHistoryFormatSuite.scala
@@ -17,12 +17,13 @@ class TrialHistoryFormatSuite extends FlatSpec with Matchers {
executor = xyz.driver.core.Id("userId-001"),
state = TrialHistory.State.Summarize,
action = TrialHistory.Action.Start,
- created = LocalDateTime.parse("2017-08-10T18:00:00")
+ created = LocalDateTime.parse("2017-08-10T18:00:00"),
+ comment = Option("Yolo!")
)
val writtenJson = trialHistoryFormat.write(trialHistory)
writtenJson should be("""{"id":10,"executor":"userId-001","trialId":"NCT000001","state":"Summarize",
- "action":"Start","created":"2017-08-10T18:00Z"}""".parseJson)
+ "action":"Start","created":"2017-08-10T18:00Z", "comment": "Yolo!"}""".parseJson)
val parsedTrialHistory = trialHistoryFormat.read(writtenJson)
parsedTrialHistory should be(trialHistory)