aboutsummaryrefslogtreecommitdiffstats
path: root/common-parameters/src/main/java/org/onap/policy/common/parameters/GroupMapValidationResult.java
AgeCommit message (Collapse)AuthorFilesLines
2021-04-29Remove GroupValidationResultJim Hahn1-112/+0
Removed GroupValidationResult, replacing it with BeanValidationResult. Modified the ParameterGroup subclasses to use BeanValidator, adding annotations where needed to trigger the validations that had been automatically performed by GroupValidationResult. Added Size annotation, used to verify minimum lengths of maps and collections. Added ClassName annotation, used to verify that a property contains the name of a class that is actually in the classpath. Added another addResult() method to make it easier when replacing calls to GroupValidationResult setResult() method with BeanValidationResult. Issue-ID: POLICY-2059 Change-Id: Id4da24886908723006624c5d53edeb034102299d Signed-off-by: Jim Hahn <jrh3@att.com>
2019-06-13More sonar fixes in policy/commonJim Hahn1-84/+14
Note: this does not increase code coverage, but should fix other code issues. Resolved cyclomatic complexity issue in ParameterValidationResult. Refactored duplicate code in GroupValidationResult. Removed IOException from NetworkUtil "throws". Replaced null/empty string tests with StringUtils.isBlank(). Added @FunctionalInterface where needed. Replaced anonymous classes with lambda expressions. Replaced duplicate strings with a constant. Added private constructors for utility classes. Removed sleep() from tests. Removed unused parameter from method call. Made some protected methods private. Compute integrity monitor's state-transition table once. Use for-loop instead of iterator. Moved constructors. Fixed some checkstyle issues (tabs => spaces, trailing spaces). Change-Id: I9a962ca45c4ff3f212c6014da799d06f07b232ef Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-08-28Improvements to Parameter Srviceliamfallon1-2/+21
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>
2018-08-09Fix bug in common-paramter validation serviceramverma1-1/+1
In GroupValidationResult & GroupMapValidationResult, the setResult method was not setting the actual status that it has recieved from the nested group rather it was setting its own status again. Due to which the validation status of overall ParameterGroup was coming as CLEAN even if a nested child has reported it as INVALID. Changed the expected validation result texts for TestValidation accordingly. Change-Id: I5943decce39574089ca74f9bbccbfbe66d8d542c Issue-ID: POLICY-1035 Signed-off-by: ramverma <ram.krishna.verma@ericsson.com>
2018-07-31Improve validation, add hierarchical validationliamfallon1-0/+163
Parameter validaiton updated to generically support nested groups of parameters, and nested maps of parameters. Unit test showing JSON parameter input added. Unit test showing YAML parameter inout added. Test parameter group classes moved into subdirectory This allows parameters to be unmarshaled seamlessly from JSON and YAML files. Change-Id: I768e11f31ee7f62299c4d5d95ab68a005d1aff16 Issue-ID: POLICY-922 Signed-off-by: liamfallon <liam.fallon@ericsson.com>