diff options
author | liamfallon <liam.fallon@ericsson.com> | 2018-09-07 13:36:41 +0100 |
---|---|---|
committer | liamfallon <liam.fallon@ericsson.com> | 2018-09-07 13:52:35 +0100 |
commit | cf282dd15ce391eed832063aea956a8d55521278 (patch) | |
tree | 698c059484fe7215e6842090f1aff4528b947cb6 /common-parameters/src/test/java/org/onap/policy/common/parameters/TestValidationErrors.java | |
parent | 5b0c195d48031684f44289d05a75d22280ff0508 (diff) |
Remove changing of access on par fields
Parameter handling refactored to remove changing of
access on fields in parameters, new implementation requires
getters to be defined for all fields.
Note: This change causes a knock on into distribution
Change-Id: I172f5d9310caf92d6ea825ff93292019c00a47c3
Issue-ID: POLICY-1095
Signed-off-by: liamfallon <liam.fallon@ericsson.com>
Diffstat (limited to 'common-parameters/src/test/java/org/onap/policy/common/parameters/TestValidationErrors.java')
-rw-r--r-- | common-parameters/src/test/java/org/onap/policy/common/parameters/TestValidationErrors.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/common-parameters/src/test/java/org/onap/policy/common/parameters/TestValidationErrors.java b/common-parameters/src/test/java/org/onap/policy/common/parameters/TestValidationErrors.java index a489cc3f..2c1e2f18 100644 --- a/common-parameters/src/test/java/org/onap/policy/common/parameters/TestValidationErrors.java +++ b/common-parameters/src/test/java/org/onap/policy/common/parameters/TestValidationErrors.java @@ -26,6 +26,8 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import org.junit.Test; +import org.onap.policy.common.parameters.testclasses.ParameterGroupMissingGetter; +import org.onap.policy.common.parameters.testclasses.ParameterGroupPrivateGetter; import org.onap.policy.common.parameters.testclasses.ParameterGroupWithArray; import org.onap.policy.common.parameters.testclasses.ParameterGroupWithCollection; import org.onap.policy.common.parameters.testclasses.ParameterGroupWithIllegalMapKey; @@ -112,4 +114,28 @@ public class TestValidationErrors { + "map \"intMap\" is not a parameter group", e.getMessage()); } } + + @Test + public void testMissingGetter() { + ParameterGroupMissingGetter badGetterName = new ParameterGroupMissingGetter("BGN"); + try { + badGetterName.isValid(); + fail("test should throw an exception"); + } catch (ParameterRuntimeException e) { + assertEquals("could not get getter method for parameter \"value\"", e.getMessage()); + } + + } + + @Test + public void testPrivateGetter() { + ParameterGroupPrivateGetter privateGetter = new ParameterGroupPrivateGetter("privateGetter"); + try { + privateGetter.isValid(); + fail("test should throw an exception"); + } catch (ParameterRuntimeException e) { + assertEquals("could not get getter method for parameter \"value\"", e.getMessage()); + } + + } } |