aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/xyz/driver/pdsuidomain/formats/json/PatientIssueFormatSuite.scala
diff options
context:
space:
mode:
authorvlad <vlad@driver.xyz>2017-10-30 14:21:55 -0700
committervlad <vlad@driver.xyz>2017-10-30 14:21:55 -0700
commit78f467dd0b3b9f35bb49ae973b26fb37c458b138 (patch)
treee45ec25c7d914bed07774d862d59fdaa56fd6d60 /src/test/scala/xyz/driver/pdsuidomain/formats/json/PatientIssueFormatSuite.scala
parent604fbf0a7a082bc440c0778abd6f90005b210c16 (diff)
downloadrest-query-78f467dd0b3b9f35bb49ae973b26fb37c458b138.tar.gz
rest-query-78f467dd0b3b9f35bb49ae973b26fb37c458b138.tar.bz2
rest-query-78f467dd0b3b9f35bb49ae973b26fb37c458b138.zip
Fixing Patients and Trials parsing, some refined to tryv0.11.1
Diffstat (limited to 'src/test/scala/xyz/driver/pdsuidomain/formats/json/PatientIssueFormatSuite.scala')
-rw-r--r--src/test/scala/xyz/driver/pdsuidomain/formats/json/PatientIssueFormatSuite.scala6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/test/scala/xyz/driver/pdsuidomain/formats/json/PatientIssueFormatSuite.scala b/src/test/scala/xyz/driver/pdsuidomain/formats/json/PatientIssueFormatSuite.scala
index 0d56918..d904150 100644
--- a/src/test/scala/xyz/driver/pdsuidomain/formats/json/PatientIssueFormatSuite.scala
+++ b/src/test/scala/xyz/driver/pdsuidomain/formats/json/PatientIssueFormatSuite.scala
@@ -2,10 +2,12 @@ package xyz.driver.pdsuidomain.formats.json
import java.time.LocalDateTime
+import eu.timepit.refined.collection.NonEmpty
import spray.json._
import org.scalatest.{FlatSpec, Matchers}
import xyz.driver.pdsuicommon.domain.{LongId, StringId, UuidId}
import xyz.driver.pdsuidomain.entities.PatientIssue
+import eu.timepit.refined.refineMV
class PatientIssueFormatSuite extends FlatSpec with Matchers {
import xyz.driver.pdsuidomain.formats.json.patientissue._
@@ -17,7 +19,7 @@ class PatientIssueFormatSuite extends FlatSpec with Matchers {
userId = StringId("userId-001"),
lastUpdate = LocalDateTime.parse("2017-08-10T18:00:00"),
isDraft = false,
- text = "message text",
+ text = refineMV[NonEmpty]("message text"),
archiveRequired = false
)
val writtenJson = patientIssueWriter.write(patientIssue)
@@ -35,7 +37,7 @@ class PatientIssueFormatSuite extends FlatSpec with Matchers {
val updatePatientIssueJson =
"""{"text":"new issue text","evidence":"issue evidence","archiveRequired":true}""".parseJson
val expectedUpdatedPatientIssue = patientIssue.copy(
- text = "new issue text",
+ text = refineMV[NonEmpty]("new issue text"),
archiveRequired = true
)
val parsedUpdatePatientIssue = applyUpdateToPatientIssue(updatePatientIssueJson, patientIssue)