Commit 7c6c4e7f95b5c99e54f9b8e686e2d860ef0cbe42
1 parent
3dff8089
Exists in
master
Adição de testes para um Map nulo.
Showing
2 changed files
with
13 additions
and
0 deletions
Show diff stats
impl/core/src/test/java/configuration/field/map/AbstractMapFieldConfig.java
@@ -45,6 +45,8 @@ public abstract class AbstractMapFieldConfig { | @@ -45,6 +45,8 @@ public abstract class AbstractMapFieldConfig { | ||
45 | private Map<String, String> stringWithUndefinedKeyMap; | 45 | private Map<String, String> stringWithUndefinedKeyMap; |
46 | 46 | ||
47 | private Map<String, String> emptyValueMap; | 47 | private Map<String, String> emptyValueMap; |
48 | + | ||
49 | + private Map<String, String> NullMapValue; | ||
48 | 50 | ||
49 | public Map<String, String> getStringWithUndefinedKeyMap() { | 51 | public Map<String, String> getStringWithUndefinedKeyMap() { |
50 | return stringWithUndefinedKeyMap; | 52 | return stringWithUndefinedKeyMap; |
@@ -57,4 +59,8 @@ public abstract class AbstractMapFieldConfig { | @@ -57,4 +59,8 @@ public abstract class AbstractMapFieldConfig { | ||
57 | public Map<String, String> getEmptyValueMap() { | 59 | public Map<String, String> getEmptyValueMap() { |
58 | return emptyValueMap; | 60 | return emptyValueMap; |
59 | } | 61 | } |
62 | + | ||
63 | + public Map<String, String> getNullMapValue() { | ||
64 | + return NullMapValue; | ||
65 | + } | ||
60 | } | 66 | } |
impl/core/src/test/java/configuration/field/map/ConfigurationMapFieldTest.java
@@ -37,6 +37,7 @@ | @@ -37,6 +37,7 @@ | ||
37 | package configuration.field.map; | 37 | package configuration.field.map; |
38 | 38 | ||
39 | import static junit.framework.Assert.assertEquals; | 39 | import static junit.framework.Assert.assertEquals; |
40 | +import static junit.framework.Assert.assertNull; | ||
40 | 41 | ||
41 | import java.util.HashMap; | 42 | import java.util.HashMap; |
42 | import java.util.Map; | 43 | import java.util.Map; |
@@ -98,4 +99,10 @@ public class ConfigurationMapFieldTest { | @@ -98,4 +99,10 @@ public class ConfigurationMapFieldTest { | ||
98 | assertEquals(expected, propertiesConfig.getEmptyValueMap()); | 99 | assertEquals(expected, propertiesConfig.getEmptyValueMap()); |
99 | assertEquals(expected, xmlConfig.getEmptyValueMap()); | 100 | assertEquals(expected, xmlConfig.getEmptyValueMap()); |
100 | } | 101 | } |
102 | + | ||
103 | + @Test | ||
104 | + public void loadNullMap(){ | ||
105 | + assertNull(propertiesConfig.getNullMapValue()); | ||
106 | + assertNull(xmlConfig.getNullMapValue()); | ||
107 | + } | ||
101 | } | 108 | } |