aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/java/org
diff options
context:
space:
mode:
authorkurczews <krzysztof.kurczewski@nokia.com>2019-03-20 09:52:12 +0100
committerkurczews <krzysztof.kurczewski@nokia.com>2019-03-20 12:03:00 +0100
commitf477d1d59382838c1cbeb3b73b325c7a4d535a3e (patch)
treee35b902b9029de7caaa323dd4d0f71d0c7e08aca /vid-app-common/src/main/java/org
parent03359a5641dfb26f93d630a1b1232c0ffc6ec51c (diff)
Add tests for AaiServiceImpl
Issue-ID: VID-386 Change-Id: Idbed927b9942c93d6b6ed7dd17fccb27a0853153 Signed-off-by: kurczews <krzysztof.kurczewski@nokia.com>
Diffstat (limited to 'vid-app-common/src/main/java/org')
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/services/AaiServiceImpl.java2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/services/WorkflowServiceImpl.java13
2 files changed, 6 insertions, 9 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/services/AaiServiceImpl.java b/vid-app-common/src/main/java/org/onap/vid/services/AaiServiceImpl.java
index 83757f2fb..142bf73ec 100644
--- a/vid-app-common/src/main/java/org/onap/vid/services/AaiServiceImpl.java
+++ b/vid-app-common/src/main/java/org/onap/vid/services/AaiServiceImpl.java
@@ -320,8 +320,6 @@ public class AaiServiceImpl implements AaiService {
return aaiClient.getPNFData(globalCustomerId, serviceType, modelVersionId, modelInvariantId, cloudRegion, equipVendor, equipModel);
}
-
-
@Override
public AaiResponse getServices(RoleValidator roleValidator) {
AaiResponse<GetServicesAAIRespone> subscriberResponse = aaiClient.getServices();
diff --git a/vid-app-common/src/main/java/org/onap/vid/services/WorkflowServiceImpl.java b/vid-app-common/src/main/java/org/onap/vid/services/WorkflowServiceImpl.java
index 097b05e58..cbc79e86f 100644
--- a/vid-app-common/src/main/java/org/onap/vid/services/WorkflowServiceImpl.java
+++ b/vid-app-common/src/main/java/org/onap/vid/services/WorkflowServiceImpl.java
@@ -20,6 +20,7 @@
package org.onap.vid.services;
+import java.util.List;
import org.onap.vid.model.Workflow;
import org.springframework.stereotype.Service;
@@ -31,29 +32,27 @@ import java.util.stream.Collectors;
@Service
public class WorkflowServiceImpl implements WorkflowService {
//TODO: Add the list of workflows hard coded or from DB.
- private ArrayList<Workflow> workflows = new ArrayList<>(Arrays.asList(
+ private List<Workflow> workflows = Arrays.asList(
new Workflow(0, "Upgrade", new ArrayList<>(Arrays.asList("VNF1", "VNF2", "VNF3", "VNF4"))),
new Workflow(1, "Clean", new ArrayList<>(Arrays.asList("VNF1", "VNF2", "VNF3"))),
new Workflow(2, "Reinstall", new ArrayList<>(Arrays.asList("VNF1", "VNF2", "VNF4"))),
new Workflow(3, "Dump", new ArrayList<>(Arrays.asList("VNF1", "VNF3", "VNF4"))),
new Workflow(4, "Flush", new ArrayList<>(Arrays.asList("VNF2", "VNF3", "VNF4")))
- ));
+ );
@Override
public Collection<String> getWorkflowsForVNFs(Collection<String> vnfNames) {
- Collection<String> result = workflows.stream()
+ return workflows.stream()
.filter(workflow -> workflow.getVnfNames().containsAll(vnfNames))
- .map(workflow -> workflow.getWorkflowName())
+ .map(Workflow::getWorkflowName)
.distinct()
.collect(Collectors.toList());
-
- return result;
}
@Override
public Collection<String> getAllWorkflows() {
return workflows.stream()
- .map(workflow -> workflow.getWorkflowName())
+ .map(Workflow::getWorkflowName)
.distinct()
.collect(Collectors.toList());
}