From 655d6f798878cd69b6c02c54d4bbed83d01fd937 Mon Sep 17 00:00:00 2001 From: liamfallon Date: Tue, 28 Aug 2018 14:13:02 +0100 Subject: 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 --- .../onap/policy/common/parameters/TestValidationErrors.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'common-parameters/src/test/java/org/onap/policy/common/parameters/TestValidationErrors.java') 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 { @@ -68,6 +70,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"); -- cgit 1.2.3-korg