diff options
Diffstat (limited to 'common-parameters/src/test/java')
2 files changed, 5 insertions, 3 deletions
diff --git a/common-parameters/src/test/java/org/onap/policy/common/parameters/testclasses/TestParametersL00.java b/common-parameters/src/test/java/org/onap/policy/common/parameters/testclasses/TestParametersL00.java index ea5ae853..2b41d0fb 100644 --- a/common-parameters/src/test/java/org/onap/policy/common/parameters/testclasses/TestParametersL00.java +++ b/common-parameters/src/test/java/org/onap/policy/common/parameters/testclasses/TestParametersL00.java @@ -24,6 +24,7 @@ package org.onap.policy.common.parameters.testclasses; import java.util.LinkedHashMap; import java.util.Map; import java.util.Map.Entry; +import org.apache.commons.lang3.StringUtils; import org.onap.policy.common.parameters.GroupValidationResult; import org.onap.policy.common.parameters.ParameterConstants; import org.onap.policy.common.parameters.ParameterGroupImpl; @@ -163,11 +164,11 @@ public class TestParametersL00 extends ParameterGroupImpl { public GroupValidationResult validate() { GroupValidationResult validationResult = super.validate(); - if (getName() == null || getName().trim().length() == 0) { + if (StringUtils.isBlank(getName())) { validationResult.setResult("name", ValidationStatus.INVALID, "name must be a non-blank string"); } - if (l00StringField == null || l00StringField.trim().length() == 0) { + if (StringUtils.isBlank(l00StringField)) { validationResult.setResult(L00_STRING_FIELD, ValidationStatus.INVALID, "l00StringField must be a non-blank string"); } else if (l00StringField.equals(L00_STRING_FIELD)) { diff --git a/common-parameters/src/test/java/org/onap/policy/common/parameters/testclasses/TestParametersL10.java b/common-parameters/src/test/java/org/onap/policy/common/parameters/testclasses/TestParametersL10.java index 2fba9ba2..e1642beb 100644 --- a/common-parameters/src/test/java/org/onap/policy/common/parameters/testclasses/TestParametersL10.java +++ b/common-parameters/src/test/java/org/onap/policy/common/parameters/testclasses/TestParametersL10.java @@ -24,6 +24,7 @@ package org.onap.policy.common.parameters.testclasses; import java.util.LinkedHashMap; import java.util.Map; import java.util.Map.Entry; +import org.apache.commons.lang3.StringUtils; import org.onap.policy.common.parameters.GroupValidationResult; import org.onap.policy.common.parameters.ParameterConstants; import org.onap.policy.common.parameters.ParameterGroupImpl; @@ -146,7 +147,7 @@ public class TestParametersL10 extends ParameterGroupImpl { public GroupValidationResult validate() { GroupValidationResult validationResult = super.validate(); - if (l10StringField == null || l10StringField.trim().length() == 0) { + if (StringUtils.isBlank(l10StringField)) { validationResult.setResult(L10_STRING_FIELD, ValidationStatus.INVALID, "l10StringField must be a non-blank string"); } else if (l10StringField.equals(L10_STRING_FIELD)) { |