Commit 6e4143e02fe613a8d3f6dddd205b204588693d44

Authored by Ednara Oliveira
1 parent 6878b525
Exists in master

Testes com Map vazio

impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/map/AbstractMapFieldConfig.java
... ... @@ -42,13 +42,19 @@ public abstract class AbstractMapFieldConfig {
42 42  
43 43 private Map<String, String> stringWithDefinedKeyMap;
44 44  
45   - private Map<String, Integer> stringWithUndefinedKeyMap;
  45 + private Map<String, String> stringWithUndefinedKeyMap;
46 46  
47   - public Map<String, Integer> getStringWithUndefinedKeyMap() {
  47 + private Map<String, String> emptyValueMap;
  48 +
  49 + public Map<String, String> getStringWithUndefinedKeyMap() {
48 50 return stringWithUndefinedKeyMap;
49 51 }
50 52  
51 53 public Map<String, String> getStringWithDefinedKeyMap() {
52 54 return stringWithDefinedKeyMap;
53 55 }
  56 +
  57 + public Map<String, String> getEmptyValueMap() {
  58 + return emptyValueMap;
  59 + }
54 60 }
... ...
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/map/ConfigurationMapFieldTest.java
... ... @@ -43,6 +43,7 @@ import java.util.HashMap;
43 43 import java.util.Map;
44 44  
45 45 import javax.inject.Inject;
  46 +import javax.validation.constraints.Size;
46 47  
47 48 import org.jboss.arquillian.container.test.api.Deployment;
48 49 import org.jboss.arquillian.junit.Arquillian;
... ... @@ -86,4 +87,12 @@ public class ConfigurationMapFieldTest extends AbstractConfigurationTest {
86 87  
87 88 assertEquals(expected, propertiesConfig.getStringWithUndefinedKeyMap());
88 89 }
  90 +
  91 + @Test
  92 + public void loadEmptyKeyMapString() {
  93 + Map<String, String> expected = new HashMap<String, String>();
  94 +
  95 + assertEquals(expected, propertiesConfig.getEmptyValueMap());
  96 + }
  97 +
89 98 }
... ...
impl/core/src/test/resources/configuration/field/map/demoiselle.properties
... ... @@ -35,5 +35,7 @@
35 35  
36 36 item1.stringWithDefinedKeyMap=demoiselle
37 37 item2.stringWithDefinedKeyMap=framework
  38 +item1.emptyValueMap=
  39 +item2.emptyValueMap=
38 40  
39 41 stringWithUndefinedKeyMap=undefined
... ...