diff options
author | Kseniya Tomskikh <ktomskih@datamonsters.co> | 2017-10-20 16:25:04 +0700 |
---|---|---|
committer | Kseniya Tomskikh <ktomskih@datamonsters.co> | 2017-10-20 16:25:04 +0700 |
commit | 54b15dae509212f6661dc1f1bc4ca248cb487443 (patch) | |
tree | 85b1ceafd9a56da511513797bd263977f52b556c /src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/MedicalRecordIssueFormatSuite.scala | |
parent | 6d6e732368e97e319653f00e498189afceeb4671 (diff) | |
download | rest-query-54b15dae509212f6661dc1f1bc4ca248cb487443.tar.gz rest-query-54b15dae509212f6661dc1f1bc4ca248cb487443.tar.bz2 rest-query-54b15dae509212f6661dc1f1bc4ca248cb487443.zip |
PDSUI-2336 Deleted api classes of play format, userhistory and message services
Diffstat (limited to 'src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/MedicalRecordIssueFormatSuite.scala')
-rw-r--r-- | src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/MedicalRecordIssueFormatSuite.scala | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/MedicalRecordIssueFormatSuite.scala b/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/MedicalRecordIssueFormatSuite.scala deleted file mode 100644 index 5fa740b..0000000 --- a/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/MedicalRecordIssueFormatSuite.scala +++ /dev/null @@ -1,47 +0,0 @@ -package xyz.driver.pdsuidomain.formats.json.sprayformats - -import java.time.LocalDateTime - -import spray.json._ -import org.scalatest.{FlatSpec, Matchers} -import xyz.driver.pdsuicommon.domain.{LongId, StringId} -import xyz.driver.pdsuidomain.entities.MedicalRecordIssue - -class MedicalRecordIssueFormatSuite extends FlatSpec with Matchers { - import recordissue._ - - "Json format for MedicalRecordIssue" should "read and write correct JSON" in { - val recordIssue = MedicalRecordIssue( - id = LongId(10), - recordId = LongId(1), - userId = StringId("userId-001"), - lastUpdate = LocalDateTime.parse("2017-08-10T18:00:00"), - isDraft = false, - text = "message text", - archiveRequired = false, - startPage = Some(1.0), - endPage = Some(2.0) - ) - val writtenJson = recordIssueFormat.write(recordIssue) - - writtenJson should be( - """{"id":10,"recordId":1,"userId":"userId-001","lastUpdate":"2017-08-10T18:00Z","isDraft":false, - "text":"message text","archiveRequired":false,"startPage":1.0,"endPage":2.0}""".parseJson) - - val createRecordIssueJson = """{"text":"message text","startPage":1.0,"endPage":2.0}""".parseJson - val expectedCreatedRecordIssue = recordIssue.copy(id = LongId(0), lastUpdate = LocalDateTime.MIN, isDraft = true) - val parsedCreateRecordIssue = jsValueToRecordIssue(createRecordIssueJson, LongId(1), StringId("userId-001")) - parsedCreateRecordIssue should be(expectedCreatedRecordIssue) - - val updateRecordIssueJson = - """{"text":"new issue text","evidence":"issue evidence","archiveRequired":true,"startPage":1.0,"endPage":4.0}""".parseJson - val expectedUpdatedRecordIssue = recordIssue.copy( - text = "new issue text", - archiveRequired = true, - endPage = Some(4.0) - ) - val parsedUpdateRecordIssue = applyUpdateToRecordIssue(updateRecordIssueJson, recordIssue) - parsedUpdateRecordIssue should be(expectedUpdatedRecordIssue) - } - -} |