diff options
author | Wojciech Sliwka <wojciech.sliwka@nokia.com> | 2019-03-20 14:09:04 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-03-20 14:09:04 +0000 |
commit | 3c89b3583b66eff7f8fd473027fdc0d31a724268 (patch) | |
tree | ddd50a601edd29645f28c08c8fe861f8cdbb2f19 /vid-app-common/src/main/java/org | |
parent | 9e9f17ce23167e8b5fe85597048d39985d8a5277 (diff) | |
parent | f477d1d59382838c1cbeb3b73b325c7a4d535a3e (diff) |
Merge "Add tests for AaiServiceImpl"
Diffstat (limited to 'vid-app-common/src/main/java/org')
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/services/AaiServiceImpl.java | 2 | ||||
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/services/WorkflowServiceImpl.java | 13 |
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()); } |