diff options
Diffstat (limited to 'eaaf_core/src/test')
-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()); + + } +} |