diff options
author | michal.banka <michal.banka@nokia.com> | 2019-06-05 08:30:59 +0200 |
---|---|---|
committer | michal.banka <michal.banka@nokia.com> | 2019-06-10 10:51:12 +0200 |
commit | f0ab6c540529dadd0318bb2eb9c012d0c3dcea16 (patch) | |
tree | 645d782126a1182b2a1b85b93ef4f4f341cce871 /vid-app-common/src/main | |
parent | dd3ba9800ec14898f50858ecd67db0f9245ffc01 (diff) |
Rewrite tests for AaiServiceImpl
Issue-ID: VID-386
Change-Id: I3cbcdada18f2813bc8a4cf442f54df297f5ec945
Signed-off-by: michal.banka <michal.banka@nokia.com>
Diffstat (limited to 'vid-app-common/src/main')
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/services/AaiServiceImpl.java | 18 |
1 files changed, 7 insertions, 11 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 83832bfd0..d01f0f7ad 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 @@ -88,17 +88,13 @@ public class AaiServiceImpl implements AaiService { private List<Service> convertModelToService(Model model) { List<Service> services = new ArrayList<>(); - String category = ""; if(validateModel(model)){ - if(model.getModelType() != null) { - category = model.getModelType(); - } - for (ModelVer modelVer: model.getModelVers().getModelVer()) { - Service service = new Service.ServiceBuilder().setUuid(modelVer.getModelVersionId()) + Service service = new Service.ServiceBuilder() + .setUuid(modelVer.getModelVersionId()) .setInvariantUUID(model.getModelInvariantId()) - .setCategory(category) + .setCategory(model.getModelType() != null ? model.getModelType() : "") .setVersion(modelVer.getModelVersion()) .setName( modelVer.getModelName()) .setDistributionStatus(modelVer.getDistributionStatus()) @@ -357,7 +353,7 @@ public class AaiServiceImpl implements AaiService { @Override public AaiResponse<AaiGetVnfResponse> getVNFData(String globalSubscriberId, String serviceType) { - AaiResponse response = aaiClient.getVNFData(globalSubscriberId, serviceType); + AaiResponse<AaiGetVnfResponse> response = aaiClient.getVNFData(globalSubscriberId, serviceType); return filterChangeManagementVNFCandidatesResponse(response); } @@ -375,7 +371,7 @@ public class AaiServiceImpl implements AaiService { return response; } - return new AaiResponse(); + return new AaiResponse<>(); } @Override @@ -474,9 +470,9 @@ public class AaiServiceImpl implements AaiService { public AaiResponse getInstanceGroupsByVnfInstanceId(String vnfInstanceId){ AaiResponse<AaiGetRelatedInstanceGroupsByVnfId> aaiResponse = aaiClient.getInstanceGroupsByVnfInstanceId(vnfInstanceId); if(aaiResponse.getHttpCode() == HttpStatus.SC_OK){ - return new AaiResponse(convertGetInstanceGroupsResponseToSimpleResponse(aaiResponse.getT()), aaiResponse.getErrorMessage(), aaiResponse.getHttpCode()); + return new AaiResponse<>(convertGetInstanceGroupsResponseToSimpleResponse(aaiResponse.getT()), aaiResponse.getErrorMessage(), aaiResponse.getHttpCode()); } - return aaiClient.getInstanceGroupsByVnfInstanceId(vnfInstanceId); + return aaiResponse; } @Override |