diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml
index d6b083aa..ed6d4059 100644
--- a/.github/workflows/create-release.yml
+++ b/.github/workflows/create-release.yml
@@ -8,6 +8,9 @@ on:
- 'src/**'
- 'pom.xml'
+env:
+ JAVA_VERSION: '17'
+
jobs:
check-version:
runs-on: ubuntu-latest
@@ -93,7 +96,7 @@ jobs:
- name: Set up Maven Central Repository
uses: actions/setup-java@v4
with:
- java-version: 11
+ java-version: ${{ env.JAVA_VERSION }}
distribution: adopt
server-id: ossrh
server-username: MAVEN_USERNAME
diff --git a/.github/workflows/create-snapshot.yml b/.github/workflows/create-snapshot.yml
index aeefd745..8412953e 100644
--- a/.github/workflows/create-snapshot.yml
+++ b/.github/workflows/create-snapshot.yml
@@ -4,6 +4,9 @@ on:
pull_request:
types: [opened, edited, synchronize, reopened, labeled]
+env:
+ JAVA_VERSION: '17'
+
jobs:
# begin the snapshot verification before deployment
check-version:
@@ -47,11 +50,11 @@ jobs:
steps:
- uses: actions/checkout@v4
- - name: Set up JDK 11
+ - name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: "temurin"
- java-version: "11"
+ java-version: ${{ env.JAVA_VERSION }}
- name: Tests
run: mvn test --no-transfer-progress
@@ -79,7 +82,7 @@ jobs:
- name: Set up Maven Central Repository
uses: actions/setup-java@v4
with:
- java-version: 11
+ java-version: ${{ env.JAVA_VERSION }}
distribution: adopt
server-id: ossrh
server-username: MAVEN_USERNAME
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 81846b72..9eb80415 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -4,6 +4,9 @@ on:
pull_request:
types: [opened, edited, synchronize, reopened]
+env:
+ JAVA_VERSION: '17'
+
jobs:
test:
if: ${{ ! contains(github.event.pull_request.labels.*.name, 'deploy-snapshot') }}
@@ -11,11 +14,11 @@ jobs:
steps:
- uses: actions/checkout@v4
- - name: Set up JDK 11
+ - name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: "temurin"
- java-version: "11"
+ java-version: ${{ env.JAVA_VERSION }}
- name: Tests
run: mvn test --no-transfer-progress
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index dbfff366..1230ab59 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
fr.insee.lunatic
lunatic-model
- 2.6.4
+ 2.7.0
jar
Lunatic Model
@@ -20,7 +20,7 @@
UTF-8
UTF-8
- 11
+ 17
12.4
@@ -99,7 +99,7 @@
org.xmlunit
- xmlunit-matchers
+ xmlunit-assertj3
2.10.0
test
diff --git a/src/test/java/fr/insee/lunatic/conversion/data/JsonToXmlDataTest.java b/src/test/java/fr/insee/lunatic/conversion/data/JsonToXmlDataTest.java
new file mode 100644
index 00000000..abf01ab6
--- /dev/null
+++ b/src/test/java/fr/insee/lunatic/conversion/data/JsonToXmlDataTest.java
@@ -0,0 +1,58 @@
+package fr.insee.lunatic.conversion.data;
+
+import org.junit.jupiter.api.Test;
+import org.xmlunit.assertj3.XmlAssert;
+
+class JsonToXmlDataTest {
+
+ /**
+ * Lunatic bug: in some cases pairwise data can be inconsistent.
+ * Yet the data conversion shouldn't fail so as not to break the data extraction of client collection tools
+ * that uses the json to xml conversion.
+ */
+ @Test
+ void convertInconsistentPairwiseData() throws Exception {
+ // Given
+ String jsonInconsistentData = """
+ {
+ "COLLECTED": {
+ "LIENS_MISSING": {
+ "COLLECTED": [
+ null,
+ [null, null]
+ ]
+ }
+ },
+ "CALCULATED": {},
+ "EXTERNAL": {
+ "FOO_EXTERNAL": "some value"
+ }
+ }""";
+ // When
+ JSONLunaticDataToXML converter = new JSONLunaticDataToXML();
+ String result = converter.transform(jsonInconsistentData);
+ // Then
+ String expected = """
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ some value
+
+
+ """;
+ XmlAssert.assertThat(expected).and(result).ignoreWhitespace().areIdentical();
+ }
+
+}