Commit 5fefbbf2ae0cee51437c0ded5cd34c8e3d633595

Authored by Ednara Oliveira
1 parent b2eec6e2
Exists in master

Testes de erro de conversão

impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/array/AbstractArrayEmptyFieldConfig.java
@@ -42,6 +42,8 @@ public abstract class AbstractArrayEmptyFieldConfig { @@ -42,6 +42,8 @@ public abstract class AbstractArrayEmptyFieldConfig {
42 42
43 private Integer[] emptyWrapperIntegers; 43 private Integer[] emptyWrapperIntegers;
44 44
  45 + private Integer[] errorTypeWrapperIntegers;
  46 +
45 public Integer[] getEmptyWrapperIntegers() { 47 public Integer[] getEmptyWrapperIntegers() {
46 return emptyWrapperIntegers; 48 return emptyWrapperIntegers;
47 } 49 }
@@ -49,4 +51,8 @@ public abstract class AbstractArrayEmptyFieldConfig { @@ -49,4 +51,8 @@ public abstract class AbstractArrayEmptyFieldConfig {
49 public int[] getEmptyPrimitiveIntegers() { 51 public int[] getEmptyPrimitiveIntegers() {
50 return emptyPrimitiveIntegers; 52 return emptyPrimitiveIntegers;
51 } 53 }
  54 +
  55 + public Integer[] getErrorTypeWrapperIntegers() {
  56 + return errorTypeWrapperIntegers;
  57 + }
52 } 58 }
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/array/ConfigurationArrayFieldTest.java
@@ -146,5 +146,15 @@ public class ConfigurationArrayFieldTest extends AbstractConfigurationTest { @@ -146,5 +146,15 @@ public class ConfigurationArrayFieldTest extends AbstractConfigurationTest {
146 } catch (ConfigurationException cause) { 146 } catch (ConfigurationException cause) {
147 assertEquals(ConversionException.class, cause.getCause().getClass()); 147 assertEquals(ConversionException.class, cause.getCause().getClass());
148 } 148 }
149 - } 149 + }
  150 +
  151 + @Test
  152 + public void loadErrorTypeWrapper() {
  153 + try {
  154 + propertiesNullConfig.getErrorTypeWrapperIntegers();
  155 + Assert.fail();
  156 + } catch (ConfigurationException cause) {
  157 + assertEquals(ConversionException.class, cause.getCause().getClass());
  158 + }
  159 + }
150 } 160 }
impl/core/src/test/resources/configuration/field/array/demoiselle.properties
@@ -62,3 +62,6 @@ emptyWrapperIntegers= @@ -62,3 +62,6 @@ emptyWrapperIntegers=
62 62
63 emptyStrings=demoisele 63 emptyStrings=demoisele
64 emptyStrings= 64 emptyStrings=
  65 +
  66 +errorTypeWrapperIntegers=1
  67 +errorTypeWrapperIntegers=a