From f477d1d59382838c1cbeb3b73b325c7a4d535a3e Mon Sep 17 00:00:00 2001 From: kurczews Date: Wed, 20 Mar 2019 09:52:12 +0100 Subject: Add tests for AaiServiceImpl Issue-ID: VID-386 Change-Id: Idbed927b9942c93d6b6ed7dd17fccb27a0853153 Signed-off-by: kurczews --- .../src/main/java/org/onap/vid/services/AaiServiceImpl.java | 2 -- .../java/org/onap/vid/services/WorkflowServiceImpl.java | 13 ++++++------- 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'vid-app-common/src/main/java/org/onap') 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 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 workflows = new ArrayList<>(Arrays.asList( + private List 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 getWorkflowsForVNFs(Collection vnfNames) { - Collection 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 getAllWorkflows() { return workflows.stream() - .map(workflow -> workflow.getWorkflowName()) + .map(Workflow::getWorkflowName) .distinct() .collect(Collectors.toList()); } -- cgit 1.2.3-korg