summaryrefslogtreecommitdiffstats
path: root/controlloop/common/actors/actor.so/src
diff options
context:
space:
mode:
authorvdmeer <sven.van.der.meer@ericsson.com>2018-01-18 12:50:32 +0000
committervdmeer <sven.van.der.meer@ericsson.com>2018-01-18 13:44:16 +0000
commitcef733a2902a600c1b4a95ef11b2f4ffc0fcbf99 (patch)
tree5eaaa6e26b3649d74fb8966cd303b8e8d9898271 /controlloop/common/actors/actor.so/src
parentbdf5640a2c68a0899363503dafa0f7cb1557e4a6 (diff)
Fix Technical Debt, add Unit tests for SO
Converted to POJOs, fixed sona lint errors, added JUnit tests POJOs now have only private members and getters/setters This implicated actors, simulators, and existing tests Issue-ID: POLICY-455 Change-Id: I4b80f729565e8675822a890892b15676908f73b4 Signed-off-by: vdmeer.sven <sven.van.der.meer@ericsson.com>
Diffstat (limited to 'controlloop/common/actors/actor.so/src')
-rw-r--r--controlloop/common/actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/SOActorServiceProvider.java72
1 files changed, 36 insertions, 36 deletions
diff --git a/controlloop/common/actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/SOActorServiceProvider.java b/controlloop/common/actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/SOActorServiceProvider.java
index ad27a0201..64008e7ff 100644
--- a/controlloop/common/actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/SOActorServiceProvider.java
+++ b/controlloop/common/actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/SOActorServiceProvider.java
@@ -334,59 +334,59 @@ public class SOActorServiceProvider implements Actor {
// Construct SO Request
SORequest request = new SORequest();
// request.requestId = onset.requestID;
- request.requestDetails = new SORequestDetails();
- request.requestDetails.modelInfo = new SOModelInfo();
- request.requestDetails.cloudConfiguration = new SOCloudConfiguration();
- request.requestDetails.requestInfo = new SORequestInfo();
- request.requestDetails.requestParameters = new SORequestParameters();
- request.requestDetails.requestParameters.userParams = null;
+ request.setRequestDetails(new SORequestDetails());
+ request.getRequestDetails().setModelInfo(new SOModelInfo());
+ request.getRequestDetails().setCloudConfiguration(new SOCloudConfiguration());
+ request.getRequestDetails().setRequestInfo(new SORequestInfo());
+ request.getRequestDetails().setRequestParameters(new SORequestParameters());
+ request.getRequestDetails().getRequestParameters().setUserParams(null);
//
// cloudConfiguration
//
- request.requestDetails.cloudConfiguration.lcpCloudRegionId = getCloudRegionItemCloudRegionId();
- request.requestDetails.cloudConfiguration.tenantId = getTenantItemTenantId();
+ request.getRequestDetails().getCloudConfiguration().setLcpCloudRegionId(getCloudRegionItemCloudRegionId());
+ request.getRequestDetails().getCloudConfiguration().setTenantId(getTenantItemTenantId());
//
// modelInfo
//
- request.requestDetails.modelInfo.modelType = "vfModule";
- request.requestDetails.modelInfo.modelInvariantId = getVfModuleItemModelInvariantId();
- request.requestDetails.modelInfo.modelVersionId = getVfModuleItemModelNameVersionId();
- request.requestDetails.modelInfo.modelName = getVfModuleItemModelName();
- request.requestDetails.modelInfo.modelVersion = getVfModuleItemModelVersionId();
+ request.getRequestDetails().getModelInfo().setModelType("vfModule");
+ request.getRequestDetails().getModelInfo().setModelInvariantId(getVfModuleItemModelInvariantId());
+ request.getRequestDetails().getModelInfo().setModelVersionId(getVfModuleItemModelNameVersionId());
+ request.getRequestDetails().getModelInfo().setModelName(getVfModuleItemModelName());
+ request.getRequestDetails().getModelInfo().setModelVersion(getVfModuleItemModelVersionId());
//
// requestInfo
//
- request.requestDetails.requestInfo.instanceName = getVfModuleItemVfModuleName();
- request.requestDetails.requestInfo.source = "POLICY";
- request.requestDetails.requestInfo.suppressRollback = false;
- request.requestDetails.requestInfo.requestorId = "policy";
+ request.getRequestDetails().getRequestInfo().setInstanceName(getVfModuleItemVfModuleName());
+ request.getRequestDetails().getRequestInfo().setSource("POLICY");
+ request.getRequestDetails().getRequestInfo().setSuppressRollback(false);
+ request.getRequestDetails().getRequestInfo().setRequestorId("policy");
//
// relatedInstanceList
//
SORelatedInstanceListElement relatedInstanceListElement1 = new SORelatedInstanceListElement();
SORelatedInstanceListElement relatedInstanceListElement2 = new SORelatedInstanceListElement();
- relatedInstanceListElement1.relatedInstance = new SORelatedInstance();
- relatedInstanceListElement2.relatedInstance = new SORelatedInstance();
+ relatedInstanceListElement1.setRelatedInstance(new SORelatedInstance());
+ relatedInstanceListElement2.setRelatedInstance(new SORelatedInstance());
//
- relatedInstanceListElement1.relatedInstance.instanceId = getServiceItemServiceInstanceId();
- relatedInstanceListElement1.relatedInstance.modelInfo = new SOModelInfo();
- relatedInstanceListElement1.relatedInstance.modelInfo.modelType = "service";
- relatedInstanceListElement1.relatedInstance.modelInfo.modelInvariantId = getServiceItemModelInvariantId();
- relatedInstanceListElement1.relatedInstance.modelInfo.modelVersionId = getServiceItemModelNameVersionId();
- relatedInstanceListElement1.relatedInstance.modelInfo.modelName = getServiceItemModelName();
- relatedInstanceListElement1.relatedInstance.modelInfo.modelVersion = getServiceItemModelVersion();
+ relatedInstanceListElement1.getRelatedInstance().setInstanceId(getServiceItemServiceInstanceId());
+ relatedInstanceListElement1.getRelatedInstance().setModelInfo(new SOModelInfo());
+ relatedInstanceListElement1.getRelatedInstance().getModelInfo().setModelType("service");
+ relatedInstanceListElement1.getRelatedInstance().getModelInfo().setModelInvariantId(getServiceItemModelInvariantId());
+ relatedInstanceListElement1.getRelatedInstance().getModelInfo().setModelVersionId(getServiceItemModelNameVersionId());
+ relatedInstanceListElement1.getRelatedInstance().getModelInfo().setModelName(getServiceItemModelName());
+ relatedInstanceListElement1.getRelatedInstance().getModelInfo().setModelVersion(getServiceItemModelVersion());
//
- relatedInstanceListElement2.relatedInstance.instanceId = getVnfItemVnfId();
- relatedInstanceListElement2.relatedInstance.modelInfo = new SOModelInfo();
- relatedInstanceListElement2.relatedInstance.modelInfo.modelType = "vnf";
- relatedInstanceListElement2.relatedInstance.modelInfo.modelInvariantId = getVnfItemModelInvariantId();
- relatedInstanceListElement2.relatedInstance.modelInfo.modelVersionId = getVnfItemModelNameVersionId();
- relatedInstanceListElement2.relatedInstance.modelInfo.modelName = getVnfItemModelName();
- relatedInstanceListElement2.relatedInstance.modelInfo.modelVersion = getVnfItemModelVersion();
- relatedInstanceListElement2.relatedInstance.modelInfo.modelCustomizationName = getVnfItemVnfType();
+ relatedInstanceListElement2.getRelatedInstance().setInstanceId(getVnfItemVnfId());
+ relatedInstanceListElement2.getRelatedInstance().setModelInfo(new SOModelInfo());
+ relatedInstanceListElement2.getRelatedInstance().getModelInfo().setModelType("vnf");
+ relatedInstanceListElement2.getRelatedInstance().getModelInfo().setModelInvariantId(getVnfItemModelInvariantId());
+ relatedInstanceListElement2.getRelatedInstance().getModelInfo().setModelVersionId(getVnfItemModelNameVersionId());
+ relatedInstanceListElement2.getRelatedInstance().getModelInfo().setModelName(getVnfItemModelName());
+ relatedInstanceListElement2.getRelatedInstance().getModelInfo().setModelVersion(getVnfItemModelVersion());
+ relatedInstanceListElement2.getRelatedInstance().getModelInfo().setModelCustomizationName(getVnfItemVnfType());
//
- request.requestDetails.relatedInstanceList.add(relatedInstanceListElement1);
- request.requestDetails.relatedInstanceList.add(relatedInstanceListElement2);
+ request.getRequestDetails().getRelatedInstanceList().add(relatedInstanceListElement1);
+ request.getRequestDetails().getRelatedInstanceList().add(relatedInstanceListElement2);
//
// print SO request for debug
//