diff options
author | Jim Hahn <jrh3@att.com> | 2019-03-07 14:53:12 -0500 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2019-03-07 16:37:49 -0500 |
commit | 57a2ff2f9b918b4890f2707643342110fe31a2e4 (patch) | |
tree | 43f9e12ff1ce63f0f61e3801a4ebb83005f52456 /common-parameters/src/test/resources | |
parent | 23a3dc4ece2f1533fe1d6b627b5db05e7754a70c (diff) |
Add NotNull and NotBlank parameter validation
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>
Diffstat (limited to 'common-parameters/src/test/resources')
2 files changed, 10 insertions, 10 deletions
diff --git a/common-parameters/src/test/resources/expectedValidationResults/TestParametersL0_2_Invalid.txt b/common-parameters/src/test/resources/expectedValidationResults/TestParametersL0_2_Invalid.txt index 0dec4a61..d9301997 100644 --- a/common-parameters/src/test/resources/expectedValidationResults/TestParametersL0_2_Invalid.txt +++ b/common-parameters/src/test/resources/expectedValidationResults/TestParametersL0_2_Invalid.txt @@ -6,11 +6,11 @@ parameter group "l0Parameters" type "org.onap.policy.common.parameters.testclass field "l10StringField" type "java.lang.String" value "" INVALID, l10StringField must be a non-blank string parameter group "l00LGenericNested" type "org.onap.policy.common.parameters.testclasses.TestParametersLGeneric" INVALID, parameter group has status INVALID field "lgenericIntField" type "int" value "-1" INVALID, lgenericIntField must be a positive integer - field "lgenericStringField" type "java.lang.String" value "" INVALID, lgenericStringField must be a non-blank string + field "lgenericStringField" type "java.lang.String" value "" INVALID, must be a non-blank string parameter group map "l00LGenericNestedMap" INVALID, parameter group has status INVALID parameter group "l00LGenericNestedMapVal0" type "org.onap.policy.common.parameters.testclasses.TestParametersLGeneric" INVALID, parameter group has status INVALID field "lgenericIntField" type "int" value "-1" INVALID, lgenericIntField must be a positive integer - field "lgenericStringField" type "java.lang.String" value "" INVALID, lgenericStringField must be a non-blank string + field "lgenericStringField" type "java.lang.String" value "" INVALID, must be a non-blank string parameter group "l00LGenericNestedMapVal1" type "org.onap.policy.common.parameters.testclasses.TestParametersLGeneric" INVALID, parameter group has status INVALID field "lgenericIntField" type "int" value "-1" INVALID, lgenericIntField must be a positive integer - field "lgenericStringField" type "java.lang.String" value "" INVALID, lgenericStringField must be a non-blank string
\ No newline at end of file + field "lgenericStringField" type "java.lang.String" value "" INVALID, must be a non-blank string
\ No newline at end of file diff --git a/common-parameters/src/test/resources/expectedValidationResults/TestParametersL0_3_Invalid.txt b/common-parameters/src/test/resources/expectedValidationResults/TestParametersL0_3_Invalid.txt index 762ef46c..e45a7a6b 100644 --- a/common-parameters/src/test/resources/expectedValidationResults/TestParametersL0_3_Invalid.txt +++ b/common-parameters/src/test/resources/expectedValidationResults/TestParametersL0_3_Invalid.txt @@ -6,24 +6,24 @@ parameter group "l0Parameters" type "org.onap.policy.common.parameters.testclass field "l10StringField" type "java.lang.String" value "" INVALID, l10StringField must be a non-blank string parameter group "l10LGenericNested0" type "org.onap.policy.common.parameters.testclasses.TestParametersLGeneric" INVALID, parameter group has status INVALID field "lgenericIntField" type "int" value "-1" INVALID, lgenericIntField must be a positive integer - field "lgenericStringField" type "java.lang.String" value "" INVALID, lgenericStringField must be a non-blank string + field "lgenericStringField" type "java.lang.String" value "" INVALID, must be a non-blank string parameter group "l10LGenericNested1" type "org.onap.policy.common.parameters.testclasses.TestParametersLGeneric" INVALID, parameter group has status INVALID field "lgenericIntField" type "int" value "-1" INVALID, lgenericIntField must be a positive integer - field "lgenericStringField" type "java.lang.String" value "" INVALID, lgenericStringField must be a non-blank string + field "lgenericStringField" type "java.lang.String" value "" INVALID, must be a non-blank string parameter group map "l10LGenericNestedMap" INVALID, parameter group has status INVALID parameter group "l10LGenericNestedMapVal0" type "org.onap.policy.common.parameters.testclasses.TestParametersLGeneric" INVALID, parameter group has status INVALID field "lgenericIntField" type "int" value "-1" INVALID, lgenericIntField must be a positive integer - field "lgenericStringField" type "java.lang.String" value "" INVALID, lgenericStringField must be a non-blank string + field "lgenericStringField" type "java.lang.String" value "" INVALID, must be a non-blank string parameter group "l10LGenericNestedMapVal1" type "org.onap.policy.common.parameters.testclasses.TestParametersLGeneric" INVALID, parameter group has status INVALID field "lgenericIntField" type "int" value "-1" INVALID, lgenericIntField must be a positive integer - field "lgenericStringField" type "java.lang.String" value "" INVALID, lgenericStringField must be a non-blank string + field "lgenericStringField" type "java.lang.String" value "" INVALID, must be a non-blank string parameter group "l00LGenericNested" type "org.onap.policy.common.parameters.testclasses.TestParametersLGeneric" INVALID, parameter group has status INVALID field "lgenericIntField" type "int" value "-1" INVALID, lgenericIntField must be a positive integer - field "lgenericStringField" type "java.lang.String" value "" INVALID, lgenericStringField must be a non-blank string + field "lgenericStringField" type "java.lang.String" value "" INVALID, must be a non-blank string parameter group map "l00LGenericNestedMap" INVALID, parameter group has status INVALID parameter group "l00LGenericNestedMapVal0" type "org.onap.policy.common.parameters.testclasses.TestParametersLGeneric" INVALID, parameter group has status INVALID field "lgenericIntField" type "int" value "-1" INVALID, lgenericIntField must be a positive integer - field "lgenericStringField" type "java.lang.String" value "" INVALID, lgenericStringField must be a non-blank string + field "lgenericStringField" type "java.lang.String" value "" INVALID, must be a non-blank string parameter group "l00LGenericNestedMapVal1" type "org.onap.policy.common.parameters.testclasses.TestParametersLGeneric" INVALID, parameter group has status INVALID field "lgenericIntField" type "int" value "-1" INVALID, lgenericIntField must be a positive integer - field "lgenericStringField" type "java.lang.String" value "" INVALID, lgenericStringField must be a non-blank string
\ No newline at end of file + field "lgenericStringField" type "java.lang.String" value "" INVALID, must be a non-blank string
\ No newline at end of file |