diff options
author | Thomas <> | 2023-05-25 16:37:47 +0200 |
---|---|---|
committer | Thomas <> | 2023-05-25 16:37:47 +0200 |
commit | dc9595c7aea48583d4bd075b398b4ce68b626965 (patch) | |
tree | 3a8c71dedab53d5172b0d1aeeaed53766dda15a3 /eaaf_core/src/test/java/at | |
parent | 89dc6315197f8d0cec79038ef0703d02af30a7a2 (diff) | |
download | EAAF-Components-dc9595c7aea48583d4bd075b398b4ce68b626965.tar.gz EAAF-Components-dc9595c7aea48583d4bd075b398b4ce68b626965.tar.bz2 EAAF-Components-dc9595c7aea48583d4bd075b398b4ce68b626965.zip |
test(core): check JSON serialization for some DAO
Diffstat (limited to 'eaaf_core/src/test/java/at')
-rw-r--r-- | eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/utils/HelperClassesTest.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/utils/HelperClassesTest.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/utils/HelperClassesTest.java new file mode 100644 index 00000000..eb1848f1 --- /dev/null +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/utils/HelperClassesTest.java @@ -0,0 +1,30 @@ +package at.gv.egiz.eaaf.core.impl.utils; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.apache.commons.lang3.RandomStringUtils; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.BlockJUnit4ClassRunner; + +import at.gv.egiz.eaaf.core.impl.data.Pair; +import lombok.SneakyThrows; + +@RunWith(BlockJUnit4ClassRunner.class) +public class HelperClassesTest { + + @Test + @SneakyThrows + public void pairTest() { + Pair<String, String> pair = + Pair.newInstance(RandomStringUtils.randomAlphanumeric(5), RandomStringUtils.randomAlphanumeric(5)); + + String pairJson = DefaultJsonMapper.serialize(pair); + + Pair<?, ?> pairResult = (Pair<?, ?>) DefaultJsonMapper.deserialize(pairJson, Pair.class); + + assertEquals(pair.getFirst(), pairResult.getFirst()); + assertEquals(pair.getSecond(), pairResult.getSecond()); + + } +} |