diff options
Diffstat (limited to 'src/test/scala/xyz/driver/pdsuidomain')
4 files changed, 8 insertions, 10 deletions
diff --git a/src/test/scala/xyz/driver/pdsuidomain/DocumentSuite.scala b/src/test/scala/xyz/driver/pdsuidomain/DocumentSuite.scala index 7d8a418..915e4e7 100644 --- a/src/test/scala/xyz/driver/pdsuidomain/DocumentSuite.scala +++ b/src/test/scala/xyz/driver/pdsuidomain/DocumentSuite.scala @@ -82,7 +82,8 @@ class DocumentSuite extends BaseSuite { startDate = Some(lastUpdate.toLocalDate.minusDays(2)), endDate = None, lastUpdate = lastUpdate, - meta = Some(TextJson(Document.Meta(1.1, 2.2))) + meta = Some(TextJson(Document.Meta(1.1, 2.2))), + labelVersion = 1 ) } } diff --git a/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/DocumentFormatSuite.scala b/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/DocumentFormatSuite.scala index e6dd4a1..111da6e 100644 --- a/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/DocumentFormatSuite.scala +++ b/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/DocumentFormatSuite.scala @@ -28,14 +28,15 @@ class DocumentFormatSuite extends FlatSpec with Matchers { requiredType = Some(Document.RequiredType.OPN), meta = None, startDate = None, - endDate = None + endDate = None, + labelVersion = 0 ) val writtenJson = documentFormat.write(orig) writtenJson should be( """{"id":1,"recordId":101,"physician":"physician","typeId":10,"provider":"provider 21","providerTypeId":21, "requiredType":"OPN","institutionName":"institution name","startDate":null,"endDate":null,"status":"New","assignee":null,"previousStatus":null, - "previousAssignee":null,"lastActiveUser":null,"lastUpdate":"2017-08-10T18:00Z","meta":null}""".parseJson) + "previousAssignee":null,"lastActiveUser":null,"lastUpdate":"2017-08-10T18:00Z","meta":null,"labelVersion":0}""".parseJson) val createDocumentJson = """{"recordId":101,"physician":"physician","typeId":10,"provider":"provider 21","providerTypeId":21}""".parseJson diff --git a/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/InterventionFormatSuite.scala b/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/InterventionFormatSuite.scala index 5891e1c..4532da4 100644 --- a/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/InterventionFormatSuite.scala +++ b/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/InterventionFormatSuite.scala @@ -59,7 +59,7 @@ class InterventionFormatSuite extends FlatSpec with Matchers { } "Json format for InterventionType" should "read and write correct JSON" in { - val interventionType = InterventionType.typeFromString("Surgery/Procedure") + val interventionType = InterventionType.SurgeryProcedure val writtenJson = interventionTypeFormat.write(interventionType) writtenJson should be( diff --git a/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/StudyDesignFormatSuite.scala b/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/StudyDesignFormatSuite.scala index 9cf9b5f..e847445 100644 --- a/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/StudyDesignFormatSuite.scala +++ b/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/StudyDesignFormatSuite.scala @@ -2,20 +2,16 @@ package xyz.driver.pdsuidomain.formats.json.sprayformats import spray.json._ import org.scalatest.{FlatSpec, Matchers} -import xyz.driver.pdsuicommon.domain.LongId import xyz.driver.pdsuidomain.entities.StudyDesign class StudyDesignFormatSuite extends FlatSpec with Matchers { import studydesign._ "Json format for StudyDesign" should "read and write correct JSON" in { - val studyDesign = StudyDesign( - id = LongId(10), - name = "study design name" - ) + val studyDesign = StudyDesign.Randomized val writtenJson = studyDesignFormat.write(studyDesign) - writtenJson should be("""{"id":10,"name":"study design name"}""".parseJson) + writtenJson should be("""{"id":1,"name":"Randomized"}""".parseJson) val parsedStudyDesign = studyDesignFormat.read(writtenJson) parsedStudyDesign should be(studyDesign) |