import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
+import org.apache.commons.lang3.StringUtils;
import org.openecomp.sdc.be.components.impl.exceptions.ByActionStatusComponentException;
import org.openecomp.sdc.be.components.impl.exceptions.ComponentException;
import org.openecomp.sdc.be.components.validation.component.ComponentContactIdValidator;
// remove duplicated entries
for (CategoryDefinition cat : categories) {
String catName = cat.getName();
- if (!ValidationUtils.validateStringNotEmpty(catName)) {
+ if (StringUtils.isEmpty(catName)) {
// error missing cat name
log.debug("Missing category name for product: {}", product.getName());
ResponseFormat responseFormat = componentsUtils
}
for (SubCategoryDefinition subcat : subcategories) {
String subCatName = subcat.getName();
- if (!ValidationUtils.validateStringNotEmpty(subCatName)) {
+ if (StringUtils.isEmpty(subCatName)) {
// error missing sub cat name for cat
log.debug("Missing or empty sub-category for category {} in product {}", catName, product.getName());
ResponseFormat responseFormat = componentsUtils.getResponseFormat(ActionStatus.COMPONENT_MISSING_SUBCATEGORY);
List<GroupingDefinition> groupings = subcat.getGroupings();
for (GroupingDefinition group : groupings) {
String groupName = group.getName();
- if (!ValidationUtils.validateStringNotEmpty(groupName)) {
+ if (StringUtils.isEmpty(groupName)) {
// error missing grouping for sub cat name and cat
log.debug("Missing or empty groupng name for sub-category: {} for categor: {} in product: {}", subCatName, catName,
product.getName());
private Either<Boolean, ResponseFormat> validateProductFullNameAndCleanup(User user, Product product, AuditingActionEnum actionEnum) {
String fullName = product.getFullName();
- if (!ValidationUtils.validateStringNotEmpty(fullName)) {
+ if (StringUtils.isEmpty(fullName)) {
ResponseFormat errorResponse = componentsUtils
.getResponseFormat(ActionStatus.MISSING_ONE_OF_COMPONENT_NAMES, ComponentTypeEnum.PRODUCT.getValue(), PRODUCT_FULL_NAME);
componentsUtils.auditComponentAdmin(errorResponse, user, product, actionEnum, ComponentTypeEnum.PRODUCT);
private Either<Boolean, ResponseFormat> validateProductNameAndCleanup(User user, Product product, AuditingActionEnum actionEnum) {
String name = product.getName();
- if (!ValidationUtils.validateStringNotEmpty(name)) {
+ if (StringUtils.isEmpty(name)) {
ResponseFormat responseFormat = componentsUtils
.getResponseFormat(ActionStatus.MISSING_ONE_OF_COMPONENT_NAMES, ComponentTypeEnum.PRODUCT.getValue(), PRODUCT_ABBREVIATED_NAME);
componentsUtils.auditComponentAdmin(responseFormat, user, product, actionEnum, ComponentTypeEnum.PRODUCT);