summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main/java/org/openecomp/sdc/be/components/validation/ComponentValidations.java
diff options
context:
space:
mode:
authorTomasz Golabek <tomasz.golabek@nokia.com>2019-05-22 16:41:09 +0200
committerYuli Shlosberg <ys9693@att.com>2019-06-10 07:19:18 +0000
commit91a31137b44d034823f72b190fc42539993c6593 (patch)
tree10e12209ec28691d51e85d4c01cd337cc3264bcd /catalog-be/src/main/java/org/openecomp/sdc/be/components/validation/ComponentValidations.java
parent1e744a3293de1598d119c35a5efeb71c97c40159 (diff)
Inheritance in ComponentException
ComponentException was split into ByActionStatus and ByResponseFormat exceptions. Test added for ComponentLockAspectTest in passing Change-Id: I89c9ee966b8b4445e791af897bd60cdb845b845b Issue-ID: SDC-2321 Signed-off-by: Tomasz Golabek <tomasz.golabek@nokia.com>
Diffstat (limited to 'catalog-be/src/main/java/org/openecomp/sdc/be/components/validation/ComponentValidations.java')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/validation/ComponentValidations.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/validation/ComponentValidations.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/validation/ComponentValidations.java
index d5a94c038a..9dbf012653 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/validation/ComponentValidations.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/validation/ComponentValidations.java
@@ -16,12 +16,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
* ============LICENSE_END=========================================================
+ * Modifications copyright (c) 2019 Nokia
+ * ================================================================================
*/
package org.openecomp.sdc.be.components.validation;
import org.apache.commons.collections.CollectionUtils;
-import org.openecomp.sdc.be.components.impl.exceptions.ComponentException;
+import org.openecomp.sdc.be.components.impl.exceptions.ByActionStatusComponentException;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
@@ -108,7 +110,7 @@ public class ComponentValidations {
void validateComponentIsCheckedOutByUser(Component component, String userId) {
if (!ComponentValidationUtils.canWorkOnComponent(component, userId)) {
- throw new ComponentException(ActionStatus.ILLEGAL_COMPONENT_STATE, component.getComponentType().name(), component.getName(), component.getLifecycleState().name());
+ throw new ByActionStatusComponentException(ActionStatus.ILLEGAL_COMPONENT_STATE, component.getComponentType().name(), component.getName(), component.getLifecycleState().name());
}
}
Component validateComponentIsCheckedOutByUser(String componentId, ComponentTypeEnum componentTypeEnum, String userId) {
@@ -129,7 +131,7 @@ public class ComponentValidations {
private void validateComponentType(Component component, ComponentTypeEnum componentType) {
if (componentType!=component.getComponentType()) {
- throw new ComponentException(ActionStatus.INVALID_RESOURCE_TYPE);
+ throw new ByActionStatusComponentException(ActionStatus.INVALID_RESOURCE_TYPE);
}
}