diff options
author | Kseniya Tomskikh <ktomskih@datamonsters.co> | 2017-10-30 16:29:46 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-30 16:29:46 +0700 |
commit | 604fbf0a7a082bc440c0778abd6f90005b210c16 (patch) | |
tree | fd846d42448b2d3f432056898f0c3433475ea0da /src/test/scala/xyz/driver/pdsuidomain/formats/json/StudyDesignFormatSuite.scala | |
parent | 8811d60442d060097027b33784ece9a704458e1d (diff) | |
parent | d92a2795a02b9711aa9aed92a770f85377b31460 (diff) | |
download | rest-query-604fbf0a7a082bc440c0778abd6f90005b210c16.tar.gz rest-query-604fbf0a7a082bc440c0778abd6f90005b210c16.tar.bz2 rest-query-604fbf0a7a082bc440c0778abd6f90005b210c16.zip |
Merge pull request #54 from drivergroup/PDSUI-2336v0.11.0
PDSUI-2336 Cleanup
Diffstat (limited to 'src/test/scala/xyz/driver/pdsuidomain/formats/json/StudyDesignFormatSuite.scala')
-rw-r--r-- | src/test/scala/xyz/driver/pdsuidomain/formats/json/StudyDesignFormatSuite.scala | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/scala/xyz/driver/pdsuidomain/formats/json/StudyDesignFormatSuite.scala b/src/test/scala/xyz/driver/pdsuidomain/formats/json/StudyDesignFormatSuite.scala new file mode 100644 index 0000000..f3a4c83 --- /dev/null +++ b/src/test/scala/xyz/driver/pdsuidomain/formats/json/StudyDesignFormatSuite.scala @@ -0,0 +1,20 @@ +package xyz.driver.pdsuidomain.formats.json + +import spray.json._ +import org.scalatest.{FlatSpec, Matchers} +import xyz.driver.pdsuidomain.entities.StudyDesign + +class StudyDesignFormatSuite extends FlatSpec with Matchers { + import xyz.driver.pdsuidomain.formats.json.studydesign._ + + "Json format for StudyDesign" should "read and write correct JSON" in { + val studyDesign = StudyDesign.Randomized + val writtenJson = studyDesignFormat.write(studyDesign) + + writtenJson should be("""{"id":1,"name":"Randomized"}""".parseJson) + + val parsedStudyDesign = studyDesignFormat.read(writtenJson) + parsedStudyDesign should be(studyDesign) + } + +} |