Skip to content

Commit a08d366

Browse files
committed
[3940] Update tests
1 parent 4f21d6c commit a08d366

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

GAE/test/org/akvo/flow/util/FlowJsonObjectWriterTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ void testWriteSimpleJsonObjectWithExcludeNonNull() {
9393
// ignoring exception
9494
}
9595

96-
String jsonStringExpected = "{\"type\":\"FREE_TEXT\",\"text\":\"First Question\",\"allowOtherFlag\":true,\"collapseable\":false,\"immutable\":false,\"personalData\":false,\"order\":0}";
96+
String jsonStringExpected = "{\"type\":\"FREE_TEXT\",\"text\":\"First Question\",\"allowOtherFlag\":true,\"collapseable\":false,\"immutable\":false,\"personalData\":false,\"answerStats\":false,\"order\":0}";
9797
assertEquals(jsonStringExpected, jsonString);
9898
}
9999

@@ -127,7 +127,7 @@ void testWriteSimpleJsonObjectWithTranslations() {
127127
// ignoring exception
128128
}
129129

130-
String jsonStringExpected = "{\"type\":\"FREE_TEXT\",\"tip\":\"Help\",\"text\":\"First Question\",\"translations\":[{\"languageCode\":\"es\",\"text\":\"Primera pregunta\",\"parentType\":\"QUESTION_TEXT\"},{\"languageCode\":\"es\",\"text\":\"Ayuda\",\"parentType\":\"QUESTION_TIP\"}],\"allowOtherFlag\":true,\"collapseable\":false,\"immutable\":false,\"personalData\":false,\"order\":0}";
130+
String jsonStringExpected = "{\"type\":\"FREE_TEXT\",\"tip\":\"Help\",\"text\":\"First Question\",\"translations\":[{\"languageCode\":\"es\",\"text\":\"Primera pregunta\",\"parentType\":\"QUESTION_TEXT\"},{\"languageCode\":\"es\",\"text\":\"Ayuda\",\"parentType\":\"QUESTION_TIP\"}],\"allowOtherFlag\":true,\"collapseable\":false,\"immutable\":false,\"personalData\":false,\"answerStats\":false,\"order\":0}";
131131
assertEquals(jsonStringExpected, jsonString);
132132
}
133133

GAE/test/org/akvo/flow/xml/FlowXmlObjectWriterTests.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class FlowXmlObjectWriterTests {
5757
"</question><question variableName=\"questionTwo\" id=\"1002\" order=\"2\" type=\"free\" mandatory=\"true\" localeNameFlag=\"false\">" +
5858
"<validationRule validationType=\"numeric\" allowDecimal=\"false\" signed=\"false\"/>" +
5959
"<text>This is question two</text></question>" +
60-
"<question id=\"1003\" order=\"3\" personalData=\"true\" type=\"geoshape\" mandatory=\"false\" " +
60+
"<question id=\"1003\" order=\"3\" personalData=\"true\" answerStats=\"false\" type=\"geoshape\" mandatory=\"false\" " +
6161
"localeNameFlag=\"false\" allowPoints=\"false\" allowLine=\"false\" allowPolygon=\"false\">" +
6262
"<text>This is question three</text></question>" +
6363
"<heading>This is a group</heading>" +
@@ -199,6 +199,7 @@ void testSerialiseMinimalForm() throws IOException {
199199
q3.setType(Question.Type.GEOSHAPE);
200200
q3.setMandatoryFlag(false);
201201
q3.setPersonalData(true);
202+
q3.setAnswerStats(false);
202203
qm.put(3, q3);
203204

204205
int questionCount = qm.size();
@@ -239,6 +240,7 @@ void testSerialiseMinimalForm() throws IOException {
239240
assertEquals("This is question three", xq3.getText());
240241
assertEquals(Boolean.FALSE, xq3.getMandatory());
241242
assertEquals(Boolean.TRUE, xq3.getPersonalData());
243+
assertEquals(Boolean.FALSE, xq3.getAnswerStats());
242244
assertEquals("geoshape", xq3.getType());
243245

244246
//Convert Jackson tree into an XML string

0 commit comments

Comments
 (0)