diff options
author | liamfallon <liam.fallon@ericsson.com> | 2018-08-28 14:13:02 +0100 |
---|---|---|
committer | liamfallon <liam.fallon@ericsson.com> | 2018-08-28 14:13:38 +0100 |
commit | 655d6f798878cd69b6c02c54d4bbed83d01fd937 (patch) | |
tree | 9410bfe42f9095efb4f2871fbf08c5e7723f5a2f /common-parameters/src/test/java/org/onap/policy/common/parameters/TestValidationErrors.java | |
parent | f133be23c3fab4609e969a89ad64869bc8a7c38f (diff) |
Improvements to Parameter Srvice
Add proper handling for optional parameters
Add setName() to the parameter group interface to force definition
of that method
Add some convenience metnods to parameter service
Issue-ID: POLICY-1035
Change-Id: Iaa9226f45215b00aff9b78ab5fc120c24a0af46d
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 | 10 |
1 files changed, 10 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 6b781472..a489cc3f 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 @@ -21,6 +21,7 @@ package org.onap.policy.common.parameters; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -31,6 +32,7 @@ import org.onap.policy.common.parameters.testclasses.ParameterGroupWithIllegalMa import org.onap.policy.common.parameters.testclasses.ParameterGroupWithIllegalMapValue; import org.onap.policy.common.parameters.testclasses.ParameterGroupWithNullCollection; import org.onap.policy.common.parameters.testclasses.ParameterGroupWithNullMapValue; +import org.onap.policy.common.parameters.testclasses.ParameterGroupWithNullSubGroup; import org.onap.policy.common.parameters.testclasses.ParameterGroupWithParameterGroupCollection; public class TestValidationErrors { @@ -69,6 +71,14 @@ public class TestValidationErrors { } @Test + public void testMapNullSubGroupValidation() { + ParameterGroupWithNullSubGroup nullSub = new ParameterGroupWithNullSubGroup("Null sub group value"); + + nullSub.isValid(); + assertNull(nullSub.getSubGroup()); + } + + @Test public void testMapNullValueValidation() { ParameterGroupWithNullMapValue nullMap = new ParameterGroupWithNullMapValue("Null Map value"); try { |