From cef733a2902a600c1b4a95ef11b2f4ffc0fcbf99 Mon Sep 17 00:00:00 2001 From: vdmeer Date: Thu, 18 Jan 2018 12:50:32 +0000 Subject: 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 --- .../onap/policy/simulators/SoSimulatorTest.java | 86 +++++++++++----------- 1 file changed, 43 insertions(+), 43 deletions(-) (limited to 'controlloop/common/simulators/src/test/java') diff --git a/controlloop/common/simulators/src/test/java/org/onap/policy/simulators/SoSimulatorTest.java b/controlloop/common/simulators/src/test/java/org/onap/policy/simulators/SoSimulatorTest.java index 8054d214a..8ea0062cc 100644 --- a/controlloop/common/simulators/src/test/java/org/onap/policy/simulators/SoSimulatorTest.java +++ b/controlloop/common/simulators/src/test/java/org/onap/policy/simulators/SoSimulatorTest.java @@ -69,34 +69,34 @@ public class SoSimulatorTest { // Construct SO Request final SORequest request = new SORequest(); - request.requestId = UUID.randomUUID(); - 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.setRequestId(UUID.randomUUID()); + 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 = "DFW"; - request.requestDetails.cloudConfiguration.tenantId = "1015548"; + request.getRequestDetails().getCloudConfiguration().setLcpCloudRegionId("DFW"); + request.getRequestDetails().getCloudConfiguration().setTenantId("1015548"); // // modelInfo // - request.requestDetails.modelInfo.modelType = "vfModule"; - request.requestDetails.modelInfo.modelInvariantId = "f32568ec-2f1c-458a-864b-0593d53d141a"; - request.requestDetails.modelInfo.modelVersionId = "69615025-879d-4f0d-afe3-b7d1a7eeed1f"; - request.requestDetails.modelInfo.modelName = "C15ce9e1E9144c8fB8bb..dnsscaling..module-1"; - request.requestDetails.modelInfo.modelVersion = "1.0"; + request.getRequestDetails().getModelInfo().setModelType("vfModule"); + request.getRequestDetails().getModelInfo().setModelInvariantId("f32568ec-2f1c-458a-864b-0593d53d141a"); + request.getRequestDetails().getModelInfo().setModelVersionId("69615025-879d-4f0d-afe3-b7d1a7eeed1f"); + request.getRequestDetails().getModelInfo().setModelName("C15ce9e1E9144c8fB8bb..dnsscaling..module-1"); + request.getRequestDetails().getModelInfo().setModelVersion("1.0"); // // requestInfo // - request.requestDetails.requestInfo.instanceName = - "vDNS_Ete_Named90e1ab3-dcd5-4877-9edb-eadfc84e32c8"; - request.requestDetails.requestInfo.source = "POLICY"; - request.requestDetails.requestInfo.suppressRollback = false; - request.requestDetails.requestInfo.requestorId = "policy"; + request.getRequestDetails().getRequestInfo().setInstanceName( + "vDNS_Ete_Named90e1ab3-dcd5-4877-9edb-eadfc84e32c8"); + request.getRequestDetails().getRequestInfo().setSource("POLICY"); + request.getRequestDetails().getRequestInfo().setSuppressRollback(false); + request.getRequestDetails().getRequestInfo().setRequestorId("policy"); // // relatedInstanceList // @@ -104,33 +104,33 @@ public class SoSimulatorTest { new SORelatedInstanceListElement(); final SORelatedInstanceListElement relatedInstanceListElement2 = new SORelatedInstanceListElement(); - relatedInstanceListElement1.relatedInstance = new SORelatedInstance(); - relatedInstanceListElement2.relatedInstance = new SORelatedInstance(); + relatedInstanceListElement1.setRelatedInstance(new SORelatedInstance()); + relatedInstanceListElement2.setRelatedInstance(new SORelatedInstance()); // - relatedInstanceListElement1.relatedInstance.instanceId = "cf8426a6-0b53-4e3d-bfa6-4b2f4d5913a5"; - relatedInstanceListElement1.relatedInstance.modelInfo = new SOModelInfo(); - relatedInstanceListElement1.relatedInstance.modelInfo.modelType = "service"; - relatedInstanceListElement1.relatedInstance.modelInfo.modelInvariantId = - "4fcbc1c0-7793-46d8-8aa1-fa1c2ed9ec7b"; - relatedInstanceListElement1.relatedInstance.modelInfo.modelVersionId = - "5c996219-b2e2-4c76-9b43-7e8672a33c1d"; - relatedInstanceListElement1.relatedInstance.modelInfo.modelName = "8330e932-2a23-4943-8606"; - relatedInstanceListElement1.relatedInstance.modelInfo.modelVersion = "1.0"; + relatedInstanceListElement1.getRelatedInstance().setInstanceId("cf8426a6-0b53-4e3d-bfa6-4b2f4d5913a5"); + relatedInstanceListElement1.getRelatedInstance().setModelInfo(new SOModelInfo()); + relatedInstanceListElement1.getRelatedInstance().getModelInfo().setModelType("service"); + relatedInstanceListElement1.getRelatedInstance().getModelInfo().setModelInvariantId( + "4fcbc1c0-7793-46d8-8aa1-fa1c2ed9ec7b"); + relatedInstanceListElement1.getRelatedInstance().getModelInfo().setModelVersionId( + "5c996219-b2e2-4c76-9b43-7e8672a33c1d"); + relatedInstanceListElement1.getRelatedInstance().getModelInfo().setModelName("8330e932-2a23-4943-8606"); + relatedInstanceListElement1.getRelatedInstance().getModelInfo().setModelVersion("1.0"); // - relatedInstanceListElement2.relatedInstance.instanceId = "594e2fe0-48b8-41ff-82e2-3d4bab69b192"; - relatedInstanceListElement2.relatedInstance.modelInfo = new SOModelInfo(); - relatedInstanceListElement2.relatedInstance.modelInfo.modelType = "vnf"; - relatedInstanceListElement2.relatedInstance.modelInfo.modelInvariantId = - "033a32ed-aa65-4764-a736-36f2942f1aa0"; - relatedInstanceListElement2.relatedInstance.modelInfo.modelVersionId = - "d4d072dc-4e21-4a03-9524-628985819a8e"; - relatedInstanceListElement2.relatedInstance.modelInfo.modelName = "c15ce9e1-e914-4c8f-b8bb"; - relatedInstanceListElement2.relatedInstance.modelInfo.modelVersion = "1"; - relatedInstanceListElement2.relatedInstance.modelInfo.modelCustomizationName = - "c15ce9e1-e914-4c8f-b8bb 1"; + relatedInstanceListElement2.getRelatedInstance().setInstanceId("594e2fe0-48b8-41ff-82e2-3d4bab69b192"); + relatedInstanceListElement2.getRelatedInstance().setModelInfo(new SOModelInfo()); + relatedInstanceListElement2.getRelatedInstance().getModelInfo().setModelType("vnf"); + relatedInstanceListElement2.getRelatedInstance().getModelInfo().setModelInvariantId( + "033a32ed-aa65-4764-a736-36f2942f1aa0"); + relatedInstanceListElement2.getRelatedInstance().getModelInfo().setModelVersionId( + "d4d072dc-4e21-4a03-9524-628985819a8e"); + relatedInstanceListElement2.getRelatedInstance().getModelInfo().setModelName("c15ce9e1-e914-4c8f-b8bb"); + relatedInstanceListElement2.getRelatedInstance().getModelInfo().setModelVersion("1"); + relatedInstanceListElement2.getRelatedInstance().getModelInfo().setModelCustomizationName( + "c15ce9e1-e914-4c8f-b8bb 1"); // - request.requestDetails.relatedInstanceList.add(relatedInstanceListElement1); - request.requestDetails.relatedInstanceList.add(relatedInstanceListElement2); + request.getRequestDetails().getRelatedInstanceList().add(relatedInstanceListElement1); + request.getRequestDetails().getRelatedInstanceList().add(relatedInstanceListElement2); return request; } -- cgit 1.2.3-korg