Skip to content

Commit

Permalink
Merge pull request #822 from InseeFr/feat/ad-unit-test
Browse files Browse the repository at this point in the history
feat: add unit test (for testing sonar)
  • Loading branch information
PierreVasseur authored Dec 2, 2024
2 parents 3d3f989 + 8c20ad6 commit 3acf47f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
9 changes: 1 addition & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<springdoc.version>2.3.0</springdoc.version>
<rdf4j.version>4.3.13</rdf4j.version>
<xdocreport.version>2.0.6</xdocreport.version>
<jacoco.version>0.8.5</jacoco.version>
<jacoco.version>0.8.12</jacoco.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java-jwt.version>4.4.0</java-jwt.version>
<json.version>20240303</json.version>
Expand All @@ -93,7 +93,6 @@
<sonar.organization>inseefr</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<sonar.projectKey>InseeFr_Bauhaus-Back-Office</sonar.projectKey>
<version.maven-jacoco>0.8.5</version.maven-jacoco>
</properties>

<dependencies>
Expand Down Expand Up @@ -274,12 +273,6 @@
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<!-- Set the name of the property containing the settings for JaCoCo
runtime agent. -->
<propertyName>surefireArgLine</propertyName>
<append>true</append>
</configuration>
</execution>
<execution>
<id>post-unit-test</id>
Expand Down
9 changes: 7 additions & 2 deletions src/test/java/fr/insee/rmes/utils/DateUtilsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@
class DateUtilsTest {

@Test
void givenDate_whenGetDate_thenResponseIsClean() 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() {
String date = DateUtils.getDate("12-17");
assertEquals("12-17", date);
}

}

0 comments on commit 3acf47f

Please sign in to comment.