From 750d845475d36db59ef8b21da68dd0161e0f75ab Mon Sep 17 00:00:00 2001 From: Christof Rabensteiner Date: Wed, 2 Oct 2019 09:43:14 +0200 Subject: Add Testcase for Parsing Booleans --- src/test/java/at/gv/egiz/moazs/ConfigUtilTest.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/test/java/at/gv/egiz/moazs/ConfigUtilTest.java b/src/test/java/at/gv/egiz/moazs/ConfigUtilTest.java index d7ac0a1..b4398fb 100644 --- a/src/test/java/at/gv/egiz/moazs/ConfigUtilTest.java +++ b/src/test/java/at/gv/egiz/moazs/ConfigUtilTest.java @@ -62,6 +62,22 @@ public class ConfigUtilTest { } + @Test + public void convertBooleanToTrue() { + var prefix = ConfigUtil.TNVZ_REQUEST_KEY; + var map = Map.of(prefix, "true"); + ConfigType config = configUtil.convert(map); + assertThat(config.isPerformQueryPersonRequest()).isTrue(); + } + + @Test + public void convertBooleanToFalse() { + var prefix = ConfigUtil.TNVZ_REQUEST_KEY; + var map = Map.of(prefix, "false"); + ConfigType config = configUtil.convert(map); + assertThat(config.isPerformQueryPersonRequest()).isFalse(); + } + private ConfigType createConfig(Map headerMap) { var headers = configUtil.convertMapToHeaders(headerMap); -- cgit v1.2.3