aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/xyz/driver/pdsuidomain/formats
diff options
context:
space:
mode:
authorKseniya Tomskikh <ktomskih@datamonsters.co>2017-10-02 17:26:43 +0700
committerGitHub <noreply@github.com>2017-10-02 17:26:43 +0700
commit1913870abec9e31d080f6858d0fc296445852cc6 (patch)
tree0fd3f012bfa563315e3f9a93b8e1788efe03fa12 /src/test/scala/xyz/driver/pdsuidomain/formats
parentd0482b45b6f9149f050c5e5a6dbab6f059229282 (diff)
parent14b460edbebb1d5c39809dbc591b786edec9fa8e (diff)
downloadrest-query-1913870abec9e31d080f6858d0fc296445852cc6.tar.gz
rest-query-1913870abec9e31d080f6858d0fc296445852cc6.tar.bz2
rest-query-1913870abec9e31d080f6858d0fc296445852cc6.zip
Merge pull request #33 from drivergroup/TRIAL-17v0.5.4
TRIAL-17 Added 'inclusion' field to Criterion
Diffstat (limited to 'src/test/scala/xyz/driver/pdsuidomain/formats')
-rw-r--r--src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/CriterionFormatSuite.scala17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/CriterionFormatSuite.scala b/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/CriterionFormatSuite.scala
index d24c4c1..708aed9 100644
--- a/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/CriterionFormatSuite.scala
+++ b/src/test/scala/xyz/driver/pdsuidomain/formats/json/sprayformats/CriterionFormatSuite.scala
@@ -15,7 +15,8 @@ class CriterionFormatSuite extends FlatSpec with Matchers {
trialId = StringId("NCT000001"),
text = Some("text"),
isCompound = false,
- meta = "{}"
+ meta = "{}",
+ inclusion = None
)
val labels = List(
CriterionLabel(
@@ -44,12 +45,12 @@ class CriterionFormatSuite extends FlatSpec with Matchers {
val writtenJson = richCriterionFormat.write(richCriterion)
writtenJson should be(
- """{"text":"text","isCompound":false,"trialId":"NCT000001","arms":[20,21,21],"id":10,"meta":"{}",
+ """{"text":"text","isCompound":false,"trialId":"NCT000001","inclusion":null,"arms":[20,21,21],"id":10,"meta":"{}",
"labels":[{"labelId":101,"categoryId":3,"value":"Yes","isDefining":true},
{"labelId":102,"categoryId":3,"value":"No","isDefining":true}]}""".parseJson)
val createCriterionJson =
- """{"text":"text","isCompound":false,"trialId":"NCT000001",
+ """{"text":"text","isCompound":false,"trialId":"NCT000001","inclusion":null,
"arms":[20,21,21],"meta":"{}","labels":[{"labelId":101,"categoryId":3,"value":"Yes","isDefining":true},
{"labelId":102,"categoryId":3,"value":"No","isDefining":true}]}""".parseJson
val parsedRichCriterion = richCriterionFormat.read(createCriterionJson)
@@ -59,8 +60,14 @@ class CriterionFormatSuite extends FlatSpec with Matchers {
)
parsedRichCriterion should be(expectedRichCriterion)
- val updateCriterionJson = """{"meta":null,"text":"new text","isCompound":true}""".parseJson
- val expectedUpdatedCriterion = richCriterion.copy(criterion = criterion.copy(text = Some("new text"), isCompound = true, meta = "{}"))
+ val updateCriterionJson = """{"meta":null,"text":"new text","isCompound":true,"inclusion":true}""".parseJson
+ val expectedUpdatedCriterion = richCriterion.copy(
+ criterion = criterion.copy(
+ text = Some("new text"),
+ isCompound = true,
+ meta = "{}",
+ inclusion = Some(true)
+ ))
val parsedUpdateCriterion = applyUpdateToCriterion(updateCriterionJson, richCriterion)
parsedUpdateCriterion should be(expectedUpdatedCriterion)
}