aboutsummaryrefslogtreecommitdiffstats
path: root/workflow-designer-be/src/main
diff options
context:
space:
mode:
authorayalaben <ayala.benzvi@amdocs.com>2018-10-08 14:43:06 +0300
committerOren Kleks <orenkle@amdocs.com>2018-10-14 04:44:15 +0000
commit09bf44f072107e1e0c9dff8cf948b1c589265dd6 (patch)
treece97a42c06ae29ebd517238b2d32d6bf183b561e /workflow-designer-be/src/main
parentbb1a685f4454e87ff5ba3bc55d0d2965ccd2086e (diff)
Unit Test coverage
Change-Id: Icc8453823906f89603862ad60a8dd3273936ebce Issue-ID: SDC-1822 Signed-off-by: ayalaben <ayala.benzvi@amdocs.com>
Diffstat (limited to 'workflow-designer-be/src/main')
-rw-r--r--workflow-designer-be/src/main/java/org/onap/sdc/workflow/persistence/impl/ParameterRepositoryImpl.java6
-rw-r--r--workflow-designer-be/src/main/java/org/onap/sdc/workflow/persistence/types/ParameterEntity.java6
2 files changed, 9 insertions, 3 deletions
diff --git a/workflow-designer-be/src/main/java/org/onap/sdc/workflow/persistence/impl/ParameterRepositoryImpl.java b/workflow-designer-be/src/main/java/org/onap/sdc/workflow/persistence/impl/ParameterRepositoryImpl.java
index 483c7097..00dadead 100644
--- a/workflow-designer-be/src/main/java/org/onap/sdc/workflow/persistence/impl/ParameterRepositoryImpl.java
+++ b/workflow-designer-be/src/main/java/org/onap/sdc/workflow/persistence/impl/ParameterRepositoryImpl.java
@@ -32,11 +32,11 @@ import java.util.Collection;
import java.util.Optional;
import java.util.stream.Collectors;
import org.onap.sdc.workflow.persistence.ParameterRepository;
-import org.onap.sdc.workflow.persistence.types.ParameterEntity;
import org.onap.sdc.workflow.persistence.impl.types.ParameterPropertyName;
+import org.onap.sdc.workflow.persistence.impl.types.WorkflowElementType;
+import org.onap.sdc.workflow.persistence.types.ParameterEntity;
import org.onap.sdc.workflow.persistence.types.ParameterRole;
import org.onap.sdc.workflow.persistence.types.ParameterType;
-import org.onap.sdc.workflow.persistence.impl.types.WorkflowElementType;
import org.openecomp.core.zusammen.api.ZusammenAdaptor;
import org.openecomp.types.ElementPropertyName;
import org.springframework.beans.factory.annotation.Autowired;
@@ -86,7 +86,7 @@ public class ParameterRepositoryImpl implements ParameterRepository {
zusammenAdaptor.getElementInfoByName(context, elementContext, null, getParentElementType(role));
if (!optionalParentElement.isPresent()) {
- return;
+ throw new IllegalStateException(String.format("Missing data for workflow id %s version id %s",id,versionId));
}
ZusammenElement parentElement = buildElement(optionalParentElement.get().getId(), Action.IGNORE);
parentElement.setSubElements(optionalParentElement.get().getSubElements().stream()
diff --git a/workflow-designer-be/src/main/java/org/onap/sdc/workflow/persistence/types/ParameterEntity.java b/workflow-designer-be/src/main/java/org/onap/sdc/workflow/persistence/types/ParameterEntity.java
index 4b57ba71..4dfd1e4f 100644
--- a/workflow-designer-be/src/main/java/org/onap/sdc/workflow/persistence/types/ParameterEntity.java
+++ b/workflow-designer-be/src/main/java/org/onap/sdc/workflow/persistence/types/ParameterEntity.java
@@ -17,12 +17,18 @@
package org.onap.sdc.workflow.persistence.types;
import lombok.Data;
+import lombok.NoArgsConstructor;
@Data
+@NoArgsConstructor
public class ParameterEntity {
private String id;
private String name;
private ParameterType type;
private boolean mandatory;
+
+ public ParameterEntity(String name) {
+ this.name = name;
+ }
}