content: /*
   *  Copyright (C) 2021 Stichting Akvo (Akvo Foundation)
   *
   *  This file is part of Akvo FLOW.
   *
   *  Akvo FLOW is free software: you can redistribute it and modify it under the terms of
   *  the GNU Affero General Public License (AGPL) as published by the Free Software Foundation,
   *  either version 3 of the License or any later version.
   *
   *  Akvo FLOW is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
   *  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   *  See the GNU Affero General Public License included below for more details.
   *
   *  The full license text can also be seen at <http://www.gnu.org/licenses/agpl.html>.
   */
  
  package org.waterforpeople.mapping.serialization;
  
  import com.google.appengine.tools.development.testing.LocalDatastoreServiceTestConfig;
  import com.google.appengine.tools.development.testing.LocalServiceTestHelper;
  import org.junit.jupiter.api.AfterEach;
  import org.junit.jupiter.api.BeforeEach;
  import org.junit.jupiter.api.Test;
  import org.waterforpeople.mapping.domain.QuestionAnswerStore;
  import org.waterforpeople.mapping.domain.SurveyInstance;
  
  import java.util.List;
  
  import static org.junit.jupiter.api.Assertions.assertEquals;
  
  public class SurveyInstanceHandlerTests {
  
      private final String DATA_JSON = "{\"dataPointId\":\"cjd4-18p7-xtqu\",\"deviceId\":\"valeria_pixel3\",\"duration\":5,\"formId\":\"291513002\",\"formVersion\":1.0,\"responses\":[{\"answerType\":\"META_NAME\",\"iteration\":0,\"questionId\":\"-1\",\"value\":\"test\"},{\"answerType\":\"VALUE\",\"iteration\":0,\"questionId\":\"275613002\",\"value\":\"test\"}],\"submissionDate\":1623940101098,\"username\":\"valeria_pixel3\",\"uuid\":\"5e7d9f3b-54bf-4766-a9ae-c71fcd85abfc\"}";
  
      private final String DATA_JSON_REPETITIONS = "{\"dataPointId\": \"o98y-ffax-kjh\",\"deviceId\": \"Test devices\",\"duration\": 1006,\"formId\": \"9876065051\",\"responses\": [{\"answerType\": \"OPTION\",\"iteration\": 0,\"questionId\": \"8676209876\",\"value\": \"[{\\\"text\\\":\\\"Yes\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 0,\"questionId\": \"8232599248\",\"value\": \"[{\\\"text\\\":\\\"First Option\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 0,\"questionId\": \"8232599375\",\"value\": \"[{\\\"text\\\":\\\"Table Top Option\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 0,\"questionId\": \"8232610786\",\"value\": \"[{\\\"text\\\":\\\"Yes\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 0,\"questionId\": \"8234070468\",\"value\": \"[{\\\"text\\\":\\\"1\\\"}]\"}, {\"answerType\": \"VALUE\",\"iteration\": 0,\"questionId\": \"8234070473\",\"value\": \"FirstName\"}, {\"answerType\": \"OPTION\",\"iteration\": 0,\"questionId\": \"8234098001\",\"value\": \"[{\\\"text\\\":\\\"Chateau\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 0,\"questionId\": \"8234112582\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 0,\"questionId\": \"8234112786\",\"value\": \"[{\\\"text\\\":\\\"Yes\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 1,\"questionId\": \"8236311951\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 2,\"questionId\": \"8236311951\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 3,\"questionId\": \"8236311951\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 4,\"questionId\": \"8236311951\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 5,\"questionId\": \"8236311951\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 6,\"questionId\": \"8236311951\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 7,\"questionId\": \"8236311951\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 8,\"questionId\": \"8236311951\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 9,\"questionId\": \"8236311951\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"VALUE\",\"iteration\": 2,\"questionId\": \"8239569036\",\"value\": \"Raton\"}, {\"answerType\": \"VALUE\",\"iteration\": 3,\"questionId\": \"8239569036\",\"value\": \"Raton\"}, {\"answerType\": \"VALUE\",\"iteration\": 4,\"questionId\": \"8239569036\",\"value\": \"Raton\"}, {\"answerType\": \"VALUE\",\"iteration\": 5,\"questionId\": \"8239569036\",\"value\": \"Raton\"}, {\"answerType\": \"VALUE\",\"iteration\": 6,\"questionId\": \"8239569036\",\"value\": \"Raton\"}, {\"answerType\": \"VALUE\",\"iteration\": 7,\"questionId\": \"8239569036\",\"value\": \"Raton\"}, {\"answerType\": \"VALUE\",\"iteration\": 8,\"questionId\": \"8239569036\",\"value\": \"Section\"}, {\"answerType\": \"VALUE\",\"iteration\": 9,\"questionId\": \"8239569036\",\"value\": \"Variable\"}, {\"answerType\": \"OPTION\",\"iteration\": 1,\"questionId\": \"8239573503\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 2,\"questionId\": \"8239573503\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 3,\"questionId\": \"8239573503\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 4,\"questionId\": \"8239573503\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 5,\"questionId\": \"8239573503\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 6,\"questionId\": \"8239573503\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 7,\"questionId\": \"8239573503\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 8,\"questionId\": \"8239573503\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 9,\"questionId\": \"8239573503\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 1,\"questionId\": \"8239573506\",\"value\": \"[{\\\"text\\\":\\\"Daily paper\\\"}]\"}, {\"answerType\": \"VALUE\",\"iteration\": 0,\"questionId\": \"8242190437\",\"value\": \"Chateau\"}, {\"answerType\": \"OPTION\",\"iteration\": 0,\"questionId\": \"8242282679\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 0,\"questionId\": \"8246451763\",\"value\": \"[{\\\"text\\\":\\\"Max\\\"},{\\\"text\\\":\\\"Utencils\\\"}]\"}, {\"answerType\": \"VALUE\",\"iteration\": 0,\"questionId\": \"8246461709\",\"value\": \"Education\"}, {\"answerType\": \"DATE\",\"iteration\": 0,\"questionId\": \"8246742613\",\"value\": \"287058090079\"}, {\"answerType\": \"OPTION\",\"iteration\": 0,\"questionId\": \"8247779445\",\"value\": \"[{\\\"text\\\":\\\"More than one year\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 1,\"questionId\": \"8247779456\",\"value\": \"[{\\\"text\\\":\\\"Yes\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 2,\"questionId\": \"8247779456\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 3,\"questionId\": \"8247779456\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 4,\"questionId\": \"8247779456\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 5,\"questionId\": \"8247779456\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 6,\"questionId\": \"8247779456\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 7,\"questionId\": \"8247779456\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 8,\"questionId\": \"8247779456\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 9,\"questionId\": \"8247779456\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 0,\"questionId\": \"8249871295\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 0,\"questionId\": \"8249880774\",\"value\": \"[{\\\"text\\\":\\\"Ugandan\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 0,\"questionId\": \"8249880882\",\"value\": \"[{\\\"text\\\":\\\"None\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 0,\"questionId\": \"8249890613\",\"value\": \"[{\\\"text\\\":\\\"Single source of fund\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 0,\"questionId\": \"8250072338\",\"value\": \"[{\\\"text\\\":\\\"Alternatives\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 2,\"questionId\": \"8252128653\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 4,\"questionId\": \"8252128653\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 5,\"questionId\": \"8252128653\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 6,\"questionId\": \"8252128653\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 7,\"questionId\": \"8252128653\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 8,\"questionId\": \"8252128653\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 9,\"questionId\": \"8252128653\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"VALUE\",\"iteration\": 0,\"questionId\": \"8252140647\",\"value\": \"876657865\"}, {\"answerType\": \"VALUE\",\"iteration\": 0,\"questionId\": \"8252140661\",\"value\": \"Michael Tester\"}, {\"answerType\": \"OPTION\",\"iteration\": 0,\"questionId\": \"8252140824\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"DATE\",\"iteration\": 1,\"questionId\": \"8258261347\",\"value\": \"287056452915\"}, {\"answerType\": \"DATE\",\"iteration\": 2,\"questionId\": \"8258261347\",\"value\": \"1072958087931\"}, {\"answerType\": \"DATE\",\"iteration\": 3,\"questionId\": \"8258261347\",\"value\": \"1136116507415\"}, {\"answerType\": \"DATE\",\"iteration\": 4,\"questionId\": \"8258261347\",\"value\": \"1167652518050\"}, {\"answerType\": \"DATE\",\"iteration\": 5,\"questionId\": \"8258261347\",\"value\": \"1293882933069\"}, {\"answerType\": \"DATE\",\"iteration\": 6,\"questionId\": \"8258261347\",\"value\": \"1388577353213\"}, {\"answerType\": \"DATE\",\"iteration\": 7,\"questionId\": \"8258261347\",\"value\": \"1469530570736\"}, {\"answerType\": \"DATE\",\"iteration\": 8,\"questionId\": \"8258261347\",\"value\": \"1513943783767\"}, {\"answerType\": \"DATE\",\"iteration\": 9,\"questionId\": \"8258261347\",\"value\": \"473434600903\"}, {\"answerType\": \"OPTION\",\"iteration\": 0,\"questionId\": \"8258261374\",\"value\": \"[{\\\"text\\\":\\\"Partially\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 0,\"questionId\": \"8258261431\",\"value\": \"[{\\\"text\\\":\\\"Pick first school\\\"},{\\\"text\\\":\\\"Send necessary documents\\\"}]\"}, {\"answerType\": \"VALUE\",\"iteration\": 0,\"questionId\": \"8256051916\",\"value\": \"Bobby Tester\"}, {\"answerType\": \"OPTION\",\"iteration\": 0,\"questionId\": \"8256052039\",\"value\": \"[{\\\"text\\\":\\\"Apartment\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 0,\"questionId\": \"8256062163\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"VALUE\",\"iteration\": 0,\"questionId\": \"8256071865\",\"value\": \"314135\"}, {\"answerType\": \"OPTION\",\"iteration\": 1,\"questionId\": \"8256071968\",\"value\": \"[{\\\"text\\\":\\\"None\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 2,\"questionId\": \"8256071968\",\"value\": \"[{\\\"text\\\":\\\"None\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 3,\"questionId\": \"8256071968\",\"value\": \"[{\\\"text\\\":\\\"None\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 4,\"questionId\": \"8256071968\",\"value\": \"[{\\\"text\\\":\\\"None\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 5,\"questionId\": \"8256071968\",\"value\": \"[{\\\"text\\\":\\\"None\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 6,\"questionId\": \"8256071968\",\"value\": \"[{\\\"text\\\":\\\"None\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 7,\"questionId\": \"8256071968\",\"value\": \"[{\\\"text\\\":\\\"None\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 8,\"questionId\": \"8256071968\",\"value\": \"[{\\\"text\\\":\\\"None\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 9,\"questionId\": \"8256071968\",\"value\": \"[{\\\"text\\\":\\\"Other\\\"}]\"}, {\"answerType\": \"VALUE\",\"iteration\": 0,\"questionId\": \"8258262378\",\"value\": \"05360559821\"}, {\"answerType\": \"OPTION\",\"iteration\": 2,\"questionId\": \"8258262388\",\"value\": \"[{\\\"text\\\":\\\"Other - explain\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 3,\"questionId\": \"8258262388\",\"value\": \"[{\\\"text\\\":\\\"Other - explain\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 4,\"questionId\": \"8258262388\",\"value\": \"[{\\\"text\\\":\\\"Other - explain\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 5,\"questionId\": \"8258262388\",\"value\": \"[{\\\"text\\\":\\\"Other - explain\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 6,\"questionId\": \"8258262388\",\"value\": \"[{\\\"text\\\":\\\"Other - explain\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 7,\"questionId\": \"8258262388\",\"value\": \"[{\\\"text\\\":\\\"Other - explain\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 8,\"questionId\": \"8258262388\",\"value\": \"[{\\\"text\\\":\\\"Other - explain\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 9,\"questionId\": \"8258262388\",\"value\": \"[{\\\"text\\\":\\\"Other - explain\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 0,\"questionId\": \"8258262536\",\"value\": \"[{\\\"text\\\":\\\"Green pastures\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 2,\"questionId\": \"8258282363\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 4,\"questionId\": \"8258282363\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 5,\"questionId\": \"8258282363\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 6,\"questionId\": \"8258282363\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 7,\"questionId\": \"8258282363\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 8,\"questionId\": \"8258282363\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 9,\"questionId\": \"8258282363\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 0,\"questionId\": \"8258291470\",\"value\": \"[{\\\"text\\\":\\\"Yes\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 0,\"questionId\": \"8258291629\",\"value\": \"[{\\\"text\\\":\\\"Yes\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 0,\"questionId\": \"8258702503\",\"value\": \"[{\\\"text\\\":\\\"Male\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 2,\"questionId\": \"8259719677\",\"value\": \"[{\\\"text\\\":\\\"More than 1 year\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 3,\"questionId\": \"8259719677\",\"value\": \"[{\\\"text\\\":\\\"More than 1 year\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 4,\"questionId\": \"8259719677\",\"value\": \"[{\\\"text\\\":\\\"More than 1 year\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 5,\"questionId\": \"8259719677\",\"value\": \"[{\\\"text\\\":\\\"More than 1 year\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 6,\"questionId\": \"8259719677\",\"value\": \"[{\\\"text\\\":\\\"More than 1 year\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 7,\"questionId\": \"8259719677\",\"value\": \"[{\\\"text\\\":\\\"More than 1 year\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 8,\"questionId\": \"8259719677\",\"value\": \"[{\\\"text\\\":\\\"More than 1 year\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 9,\"questionId\": \"8259719677\",\"value\": \"[{\\\"text\\\":\\\"More than 1 year\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 0,\"questionId\": \"8259719799\",\"value\": \"[{\\\"text\\\":\\\"Yes\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 0,\"questionId\": \"8263691213\",\"value\": \"[{\\\"text\\\":\\\"Male\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 1,\"questionId\": \"8263691213\",\"value\": \"[{\\\"text\\\":\\\"Male\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 2,\"questionId\": \"8263691213\",\"value\": \"[{\\\"text\\\":\\\"Female\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 3,\"questionId\": \"8263691213\",\"value\": \"[{\\\"text\\\":\\\"Male\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 4,\"questionId\": \"8263691213\",\"value\": \"[{\\\"text\\\":\\\"Female\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 5,\"questionId\": \"8263691213\",\"value\": \"[{\\\"text\\\":\\\"Female\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 6,\"questionId\": \"8263691213\",\"value\": \"[{\\\"text\\\":\\\"Female\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 7,\"questionId\": \"8263691213\",\"value\": \"[{\\\"text\\\":\\\"Female\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 8,\"questionId\": \"8263691213\",\"value\": \"[{\\\"text\\\":\\\"Female\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 9,\"questionId\": \"8263691213\",\"value\": \"[{\\\"text\\\":\\\"Female\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 0,\"questionId\": \"8263691245\",\"value\": \"[{\\\"text\\\":\\\"Yes\\\"}]\"}, {\"answerType\": \"OPTION\",\"iteration\": 0,\"questionId\": \"8263691346\",\"value\": \"[{\\\"text\\\":\\\"No\\\"}]\"}, {\"answerType\": \"VALUE\",\"iteration\": 0,\"questionId\": \"8267330945\",\"value\": \"99142830972\"}],\"submissionDate\": 1633613839983,\"username\": \"Phone Number 6543\",\"uuid\": \"7a0aa190-931e-4efe-a0a7-986765cdb126\"}";
  
      @Test
      void testSimpleSubmission() {
          SurveyInstance formInstance = SurveyInstanceHandler.fromJSON(DATA_JSON);
          assertEquals("cjd4-18p7-xtqu", formInstance.getSurveyedLocaleIdentifier());
          assertEquals("valeria_pixel3", formInstance.getDeviceIdentifier());
          assertEquals(291513002l, formInstance.getSurveyId());
  
          List<QuestionAnswerStore> responses = formInstance.getQuestionAnswersStore();
          assertEquals(1, responses.size());
      }
  
      @Test
      void testSubmissionWithRepetitions() {
          SurveyInstance formInstance = SurveyInstanceHandler.fromJSON(DATA_JSON_REPETITIONS);
          assertEquals("o98y-ffax-kjh", formInstance.getSurveyedLocaleIdentifier());
          assertEquals("Test devices", formInstance.getDeviceIdentifier());
          assertEquals(9876065051l, formInstance.getSurveyId());
  
          List<QuestionAnswerStore> responses = formInstance.getQuestionAnswersStore();
          assertEquals(132, responses.size());
      }
  }
  