Skip to content

Commit 31d693e

Browse files
committed
Add test for SampleType with expected PID and null molecular formula
1 parent 4795c59 commit 31d693e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/test/java/org/icatproject/integration/TestRS.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,17 @@ public void TestJsoniseBean() throws Exception {
287287
JsonArray st_response = search(session, "SELECT st from SampleType st WHERE st.name = 'diamond'", 1);
288288
collector.checkThat(st_response.getJsonObject(0).containsKey("SampleType"), is(true));
289289

290+
/*
291+
* Expected: <[{"SampleType":{"id":????,"createId":"db/notroot","createTime":
292+
* "2019-03-11T15:58:33.000Z","modId":"db/notroot","modTime":
293+
* "2019-03-11T15:58:33.000Z","molecularFormula":null,"name":"N/A",
294+
* "pid":"st:004","safetyInformation":"N/A","samples":[]}}]>
295+
*/
296+
JsonArray st_null_response = search(session, "SELECT st from SampleType st WHERE st.name = 'N/A'", 1);
297+
collector.checkThat(st_null_response.getJsonObject(0).containsKey("SampleType"), is(true));
298+
collector.checkThat(st_null_response.getJsonObject(0).getJsonObject("SampleType").getString("pid"), is("st:004"));
299+
collector.checkThat(st_null_response.getJsonObject(0).getJsonObject("SampleType").get("molecularFormula"), is(JsonValue.NULL));
300+
290301
/*
291302
* Expected: <[{"Sample":{"id":2181,"createId":"db/notroot","createTime":
292303
* "2019-03-11T15:58:33.000Z","modId":"db/notroot","modTime":

0 commit comments

Comments
 (0)