From 4fdecb037bd2609a6b977adba6d2f263c977d9e1 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Mon, 26 Apr 2021 18:16:36 -0400 Subject: Remove GroupValidationResult 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. Issue-ID: POLICY-2059 Change-Id: I245e4a647fcbb718faa63a7543f9f81c85da958c Signed-off-by: Jim Hahn --- .../main/java/org/onap/policy/models/tosca/utils/ToscaUtils.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'models-tosca') diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/utils/ToscaUtils.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/utils/ToscaUtils.java index 5dda6ecfc..2fa2a557a 100644 --- a/models-tosca/src/main/java/org/onap/policy/models/tosca/utils/ToscaUtils.java +++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/utils/ToscaUtils.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019-2021 Nordix Foundation. - * Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -229,8 +229,8 @@ public final class ToscaUtils { } if (entityType.getKey().equals(parentEntityTypeKey)) { - result.addResult(new ObjectValidationResult("entity type", entityType.getKey().getId(), - ValidationStatus.INVALID, "ancestor of itself")); + result.addResult("entity type", entityType.getKey().getId(), + ValidationStatus.INVALID, "ancestor of itself"); throw new PfModelRuntimeException(Response.Status.CONFLICT, result.getResult()); } @@ -239,8 +239,7 @@ public final class ToscaUtils { .getAll(parentEntityTypeKey.getName(), parentEntityTypeKey.getVersion()); Set> ancestorEntitySetToReturn = new HashSet<>(ancestorEntitySet); if (ancestorEntitySet.isEmpty()) { - result.addResult(new ObjectValidationResult("parent", parentEntityTypeKey.getId(), ValidationStatus.INVALID, - Validated.NOT_FOUND)); + result.addResult("parent", parentEntityTypeKey.getId(), ValidationStatus.INVALID, Validated.NOT_FOUND); } else { for (JpaToscaEntityType filteredEntityType : ancestorEntitySet) { ancestorEntitySetToReturn.addAll(getEntityTypeAncestors(entityTypes, filteredEntityType, result)); -- cgit 1.2.3-korg