From 82f4be203f3623e64b21bb9aad274e2befc13db9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 7 Dec 2024 10:32:47 +0000 Subject: [PATCH 1/3] chore(deps): update all minor dependencies --- pom.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pom.xml b/pom.xml index dbfff36..d364953 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ fr.insee.lunatic lunatic-model - 2.6.4 + 2.6.5 jar Lunatic Model @@ -22,7 +22,7 @@ UTF-8 11 - 12.4 + 12.5 @@ -66,7 +66,7 @@ org.eclipse.persistence eclipselink - 4.0.3 + 4.0.4 org.glassfish @@ -89,12 +89,12 @@ commons-io commons-io - 2.16.1 + 2.18.0 org.slf4j slf4j-api - 2.0.13 + 2.0.16 @@ -118,7 +118,7 @@ org.apache.logging.log4j log4j-slf4j-impl - 2.23.1 + 2.24.2 test @@ -129,7 +129,7 @@ org.junit.jupiter junit-jupiter - 5.10.2 + 5.11.3 test @@ -155,7 +155,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.3.1 + 3.5.2 UTF-8 -Dfile.encoding=UTF-8 @@ -305,7 +305,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.8.0 + 3.11.2 attach-javadocs @@ -330,7 +330,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.2.4 + 3.2.7 sign-artifacts From f7a68f63286dba5530dc3bcabf63b200ed183874 Mon Sep 17 00:00:00 2001 From: Nicolas Senave Date: Tue, 10 Dec 2024 16:55:21 +0100 Subject: [PATCH 2/3] build: java 11 to 17 --- .github/workflows/create-release.yml | 5 ++++- .github/workflows/create-snapshot.yml | 9 ++++++--- .github/workflows/tests.yml | 7 +++++-- pom.xml | 4 ++-- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index d6b083a..ed6d405 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 aeefd74..8412953 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 81846b7..9eb8041 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 dbfff36..d4e1f78 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 From f36a1233f8e480c58b0adf6d1ed78d8ad44648a8 Mon Sep 17 00:00:00 2001 From: Nicolas Senave Date: Tue, 10 Dec 2024 17:17:48 +0100 Subject: [PATCH 3/3] test(data): add test on json to xml data conversion For a weird case in pairwise data. --- pom.xml | 2 +- .../conversion/data/JsonToXmlDataTest.java | 58 +++++++++++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 src/test/java/fr/insee/lunatic/conversion/data/JsonToXmlDataTest.java diff --git a/pom.xml b/pom.xml index d4e1f78..1230ab5 100644 --- a/pom.xml +++ b/pom.xml @@ -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 0000000..abf01ab --- /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(); + } + +}