From ade1ae3d9f7ec9dbc12206296113a5df5233d22b Mon Sep 17 00:00:00 2001 From: Emmanuel Date: Mon, 2 Dec 2024 09:29:19 +0000 Subject: [PATCH 1/3] feat: add unit test (for testing sonar) --- src/test/java/fr/insee/rmes/utils/DateUtilsTest.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/test/java/fr/insee/rmes/utils/DateUtilsTest.java b/src/test/java/fr/insee/rmes/utils/DateUtilsTest.java index bb8b624e8..d73705cac 100644 --- a/src/test/java/fr/insee/rmes/utils/DateUtilsTest.java +++ b/src/test/java/fr/insee/rmes/utils/DateUtilsTest.java @@ -8,10 +8,15 @@ class DateUtilsTest { @Test - void givenDate_whenGetDate_thenResponseIsClean() throws RmesException { - + void should_return_date_if_good_format() throws RmesException { String date = DateUtils.getDate("2018-12-17"); assertEquals("2018-12-17", date); } + @Test + void should_return_date_if_bad_format() throws RmesException { + String date = DateUtils.getDate("12-17"); + assertEquals("12-17", date); + } + } From 85ccbf9e98db5845f4c7fbff00c18046c764a55b Mon Sep 17 00:00:00 2001 From: Emmanuel Date: Mon, 2 Dec 2024 09:35:14 +0000 Subject: [PATCH 2/3] fix: remove unused exception --- src/test/java/fr/insee/rmes/utils/DateUtilsTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/fr/insee/rmes/utils/DateUtilsTest.java b/src/test/java/fr/insee/rmes/utils/DateUtilsTest.java index d73705cac..4e6c64d7f 100644 --- a/src/test/java/fr/insee/rmes/utils/DateUtilsTest.java +++ b/src/test/java/fr/insee/rmes/utils/DateUtilsTest.java @@ -8,13 +8,13 @@ class DateUtilsTest { @Test - void should_return_date_if_good_format() throws RmesException { + void should_return_date_if_good_format() { String date = DateUtils.getDate("2018-12-17"); assertEquals("2018-12-17", date); } @Test - void should_return_date_if_bad_format() throws RmesException { + void should_return_date_if_bad_format() { String date = DateUtils.getDate("12-17"); assertEquals("12-17", date); } From 8c20ad600a452bca35521f37427fda40a4434c3f Mon Sep 17 00:00:00 2001 From: Emmanuel Date: Mon, 2 Dec 2024 10:03:51 +0000 Subject: [PATCH 3/3] fix: sonar ? --- pom.xml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index 73f7679c9..bbe0a7020 100644 --- a/pom.xml +++ b/pom.xml @@ -78,7 +78,7 @@ 2.3.0 4.3.13 2.0.6 - 0.8.5 + 0.8.12 UTF-8 4.4.0 20240303 @@ -93,7 +93,6 @@ inseefr https://sonarcloud.io InseeFr_Bauhaus-Back-Office - 0.8.5 @@ -274,12 +273,6 @@ prepare-agent - - - surefireArgLine - true - post-unit-test