aboutsummaryrefslogtreecommitdiffstats
path: root/common-parameters/src/test/java/org/onap/policy/common/parameters/testclasses/TestParametersLGeneric.java
AgeCommit message (Collapse)AuthorFilesLines
2021-04-29Remove GroupValidationResultJim Hahn1-129/+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-14Change getCanonicalName() to getName() in commonJim Hahn1-2/+2
Per javadocs, getName() should generally be used instead of Class.getCanonicalName(). This change only applies to classes; it does not apply to File objects. Change-Id: Iea0995d1167f4837607f194d35f0193eeedeacd7 Issue-ID: POLICY-1646 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-06-12Apply simple sonar fixesJim Hahn1-10/+10
Note: A number of these were identified, by SonarLint, in the Test classes, which are not typically scanned by Sonar. Removed unnecessary imports. Removed unneeded "throws Xxx". Replaced lambda with method references. Replaced duplicate strings with constants. Replaced try-fail-catch with assert-j methods to eliminate sonar complaints about duplicate failure messages. Added missing @Override annotations. Use map.computeIfAbsent() where appropriate. Also fixed some minor checkstyle issues. Removed unneeded "volatile" declarations. Replaced some if-else constructs with "?:" construct, per sonar. Replaced Object.wait() with CountDownLatch.await(); according to sonar (and javadocs), Object.wait() can return due to "spurious wakeups". Fixed issue whereby CryptoUtilsTest wouldn't run in my Eclipse. Change-Id: Ib6b71ed65662cfd6209400dac57ed69279bf29ec Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-03-08Create ParameterGroupImplJim Hahn1-14/+4
Classes that implement ParameterGroup all have to add their own name and validate() fields and methods. Added an "impl" class that provides the standard functionality and modified subclasses to use it. Change-Id: Ic6ee1607fb4fe7164a4e1eeebc480ea7d1e7e4d7 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-03-07Add NotNull and NotBlank parameter validationJim Hahn1-20/+15
Modified the ParameterValidator to support new NotNull and NotBlank annotations indicating that a field should not be null or blank. These annotations can be made at class level or individual field level. Moved annotations to their own subdirectory. Added a comment to a method. Extracted constant strings. Moved one annotation to the subclass level. Added support for "Min" annotation. Propagate validation errors up from nested items. Apply field-level validations, even when field is a ParameterGroup. Change-Id: Ic90df55487dc5db7b7b0be5397624d1957904a81 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-09-07Remove changing of access on par fieldsliamfallon1-0/+8
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>
2018-08-03Fix pom and checkstyle warnings in commonliamfallon1-2/+3
Some dependency versions are now managed in the master POM Checkstyle showed up some warnings in paramters and capabilities. Change-Id: Ifebd8a076bdb3fda626b5b1fda9324801bf58643 Issue-ID: POLICY-716 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-07-31Improve validation, add hierarchical validationliamfallon1-0/+135
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>