@@ -0,0 +1,2520 @@
+/*%0A *  Copyright (C) 2021 Stichting Akvo (Akvo Foundation)%0A *%0A *  This file is part of Akvo FLOW.%0A *%0A *  Akvo FLOW is free software: you can redistribute it and modify it under the terms of%0A *  the GNU Affero General Public License (AGPL) as published by the Free Software Foundation,%0A *  either version 3 of the License or any later version.%0A *%0A *  Akvo FLOW is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;%0A *  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.%0A *  See the GNU Affero General Public License included below for more details.%0A *%0A *  The full license text can also be seen at %3Chttp://www.gnu.org/licenses/agpl.html%3E.%0A */%0A%0Apackage org.waterforpeople.mapping.serialization;%0A%0Aimport com.google.appengine.tools.development.testing.LocalDatastoreServiceTestConfig;%0Aimport com.google.appengine.tools.development.testing.LocalServiceTestHelper;%0Aimport org.junit.jupiter.api.AfterEach;%0Aimport org.junit.jupiter.api.BeforeEach;%0Aimport org.junit.jupiter.api.Test;%0Aimport org.waterforpeople.mapping.domain.QuestionAnswerStore;%0Aimport org.waterforpeople.mapping.domain.SurveyInstance;%0A%0Aimport java.util.List;%0A%0Aimport static org.junit.jupiter.api.Assertions.assertEquals;%0A%0Apublic class SurveyInstanceHandlerTests %7B%0A    private final LocalServiceTestHelper helper = new LocalServiceTestHelper(new LocalDatastoreServiceTestConfig());%0A%0A    private final String DATA_JSON = %22%7B%5C%22dataPointId%5C%22:%5C%22cjd4-18p7-xtqu%5C%22,%5C%22deviceId%5C%22:%5C%22valeria_pixel3%5C%22,%5C%22duration%5C%22:5,%5C%22formId%5C%22:%5C%22291513002%5C%22,%5C%22formVersion%5C%22:1.0,%5C%22responses%5C%22:%5B%7B%5C%22answerType%5C%22:%5C%22META_NAME%5C%22,%5C%22iteration%5C%22:0,%5C%22questionId%5C%22:%5C%22-1%5C%22,%5C%22value%5C%22:%5C%22test%5C%22%7D,%7B%5C%22answerType%5C%22:%5C%22VALUE%5C%22,%5C%22iteration%5C%22:0,%5C%22questionId%5C%22:%5C%22275613002%5C%22,%5C%22value%5C%22:%5C%22test%5C%22%7D%5D,%5C%22submissionDate%5C%22:1623940101098,%5C%22username%5C%22:%5C%22valeria_pixel3%5C%22,%5C%22uuid%5C%22:%5C%225e7d9f3b-54bf-4766-a9ae-c71fcd85abfc%5C%22%7D%22;%0A%0A    @BeforeEach%0A    public void setUp() %7B%0A        helper.setUp();%0A    %7D%0A%0A    @AfterEach%0A    public void tearDown() %7B%0A        helper.tearDown();%0A    %7D%0A%0A    @Test%0A    void testSimpleSubmission() %7B%0A        SurveyInstance formInstance = SurveyInstanceHandler.fromJSON(DATA_JSON);%0A        assertEquals(%22cjd4-18p7-xtqu%22, formInstance.getSurveyedLocaleIdentifier());%0A        assertEquals(%22valeria_pixel3%22, formInstance.getDeviceIdentifier());%0A        assertEquals(291513002l, formInstance.getSurveyId());%0A%0A        List%3CQuestionAnswerStore%3E responses = formInstance.getQuestionAnswersStore();%0A        assertEquals(1, responses.size());%0A%0A    %7D%0A%7D%0A

Add simple test case for submissions file processing