-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove json-simple and replace by Jackson
- Loading branch information
Showing
13 changed files
with
66 additions
and
252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 0 additions & 26 deletions
26
src/main/java/fr/insee/genesis/infrastructure/utils/JSONUtils.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 10 additions & 5 deletions
15
src/test/java/fr/insee/genesis/domain/dtos/CollectedVariableDtoTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,28 @@ | ||
package fr.insee.genesis.domain.dtos; | ||
|
||
import org.assertj.core.api.Assertions; | ||
import com.fasterxml.jackson.core.JsonProcessingException; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
class CollectedVariableDtoTest { | ||
@Test | ||
void toJSONTest(){ | ||
void toJSONTest() throws JsonProcessingException { | ||
CollectedVariableDto collectedVariableDto = CollectedVariableDto.collectedVariableBuilder() | ||
.idVar("TESTIDVAR") | ||
.idParent("TESTIDPARENT") | ||
.idLoop("TESTIDLOOP") | ||
.values(new ArrayList<>(List.of(new String[]{"V1", "V2"}))) | ||
.build(); | ||
|
||
Assertions.assertThat(collectedVariableDto.toJSONObject().toJSONString()).isEqualTo( | ||
"{\"values\":[\"V1\",\"V2\"],\"idVar\":\"TESTIDVAR\",\"idLoop\":\"TESTIDLOOP\",\"idParent\":\"TESTIDPARENT\"}" | ||
); | ||
ObjectMapper objectMapper = new ObjectMapper(); | ||
objectMapper.findAndRegisterModules(); | ||
|
||
Assertions.assertEquals(objectMapper.readTree(objectMapper.writeValueAsString(collectedVariableDto)), | ||
objectMapper.readTree("{\"values\":[\"V1\",\"V2\"],\"idVar\":\"TESTIDVAR\",\"idLoop\":\"TESTIDLOOP\",\"idParent\":\"TESTIDPARENT\"}")); | ||
|
||
} | ||
} |
Oops, something went wrong.