diff options
author | liamfallon <liam.fallon@ericsson.com> | 2018-03-02 14:24:23 +0000 |
---|---|---|
committer | liamfallon <liam.fallon@ericsson.com> | 2018-03-02 14:29:10 +0000 |
commit | 12db2b732e1e7191c2f48e23f1e14f6d81bf2cee (patch) | |
tree | 69adac9c1141186f00488ae7baf2959637a2b22f /controlloop/common | |
parent | cfe2c6e071f5e43ad01f470a3c87230dd1e1fe13 (diff) |
Reduce Technical Debt on drools-applications
This commit mops up the technical debt issues in
drools-applications that are reaistic to fix witout
major surgery on the code.
note: warnings on non compliant Java class names that are used in
yaml serializaiton and deserailization are ignored.
note: warnings on complexity figures for equals() methods are ignored.
Issue-ID: POLICY-455
Change-Id: I99ccda4bd9932ceb5ccbcfd2778730234b55d7a5
Signed-off-by: liamfallon <liam.fallon@ericsson.com>
Diffstat (limited to 'controlloop/common')
18 files changed, 199 insertions, 193 deletions
diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAIGETVnfResponseTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAIGETVnfResponseTest.java index b5de93ccb..9a4050f1a 100644 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAIGETVnfResponseTest.java +++ b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAIGETVnfResponseTest.java @@ -44,15 +44,15 @@ public class AAIGETVnfResponseTest { response.setIsClosedLoopDisabled("false"); response.setResourceVersion("1494001988835"); response.setModelInvariantId("f18be3cd-d446-456e-9109-121d9b62feaa"); - assertEquals(response.getVnfID(), "83f674e8-7555-44d7-9a39-bdc3770b0491"); - assertEquals(response.getVnfName(), "lll_vnf_010317"); - assertEquals(response.getVnfType(), "Basa-122216-Service/VidVsamp12BaseVolume 1"); - assertEquals(response.getServiceId(), "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"); - assertEquals(response.getOrchestrationStatus(), "Created"); - assertEquals(response.getInMaint(), "false"); - assertEquals(response.getIsClosedLoopDisabled(), "false"); - assertEquals(response.getResourceVersion(), "1494001988835"); - assertEquals(response.getModelInvariantId(), "f18be3cd-d446-456e-9109-121d9b62feaa"); + assertEquals("83f674e8-7555-44d7-9a39-bdc3770b0491", response.getVnfID()); + assertEquals("lll_vnf_010317", response.getVnfName()); + assertEquals("Basa-122216-Service/VidVsamp12BaseVolume 1", response.getVnfType()); + assertEquals("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", response.getServiceId()); + assertEquals("Created", response.getOrchestrationStatus()); + assertEquals("false", response.getInMaint()); + assertEquals("false", response.getIsClosedLoopDisabled()); + assertEquals("1494001988835", response.getResourceVersion()); + assertEquals("f18be3cd-d446-456e-9109-121d9b62feaa", response.getModelInvariantId()); RelationshipList relationshipList = new RelationshipList(); Relationship relationship = new Relationship(); @@ -76,8 +76,8 @@ public class AAIGETVnfResponseTest { item.setPropertyKey("service-instance.service-instance-name"); item.setPropertyValue("lll_svc_010317"); relatedToProperty.getRelatedTo().add(item); - assertEquals(item.getPropertyKey(), "service-instance.service-instance-name"); - assertEquals(item.getPropertyValue(), "lll_svc_010317"); + assertEquals("service-instance.service-instance-name", item.getPropertyKey()); + assertEquals("lll_svc_010317", item.getPropertyValue()); relationship.setRelatedTo("service-instance"); relationship.setRelatedLink("/aai/v11/business/customers/customer/MSO_1610_ST/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/e1e9c97c-02c0-4919-9b4c-eb5d5ef68970"); diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAIGETVserverResponseTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAIGETVserverResponseTest.java index 7cf0696b5..65c2cdc81 100644 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAIGETVserverResponseTest.java +++ b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAIGETVserverResponseTest.java @@ -33,45 +33,47 @@ public class AAIGETVserverResponseTest { @Test public void test() { - AAIGETVserverResponse response = new AAIGETVserverResponse(); + AAIGETVserverResponse response = new AAIGETVserverResponse(); - response.setVserverID("d0668d4f-c25e-4a1b-87c4-83845c01efd8"); - response.setVserverName("USMSO1SX7NJ0103UJZZ01-vjunos0"); - response.setVserverName2("vjunos0"); - response.setVserverSelflink("https://aai-ext1.test.aaa.com:8443/aai/v7/cloud-infrastructure/cloud-regions/cloud-region/aaa-aic/AAIAIC25/tenants/tenant/USMSO1SX7NJ0103UJZZ01%3A%3AuCPE-VMS/vservers/vserver/d0668d4f-c25e-4a1b-87c4-83845c01efd8"); - response.setInMaint("false"); - response.setIsClosedLoopDisabled("false"); - response.setResourceVersion("1494001931513"); + response.setVserverID("d0668d4f-c25e-4a1b-87c4-83845c01efd8"); + response.setVserverName("USMSO1SX7NJ0103UJZZ01-vjunos0"); + response.setVserverName2("vjunos0"); + response.setVserverSelflink("https://aai-ext1.test.aaa.com:8443/aai/v7/cloud-infrastructure/cloud-regions/cloud-region/aaa-aic/AAIAIC25/tenants/tenant/USMSO1SX7NJ0103UJZZ01%3A%3AuCPE-VMS/vservers/vserver/d0668d4f-c25e-4a1b-87c4-83845c01efd8"); + response.setInMaint("false"); + response.setIsClosedLoopDisabled("false"); + response.setResourceVersion("1494001931513"); - assertEquals(response.getVserverID(), "d0668d4f-c25e-4a1b-87c4-83845c01efd8"); - assertEquals(response.getVserverName(), "USMSO1SX7NJ0103UJZZ01-vjunos0"); - assertEquals(response.getVserverName2(), "vjunos0"); - assertEquals(response.getVserverSelflink(), "https://aai-ext1.test.aaa.com:8443/aai/v7/cloud-infrastructure/cloud-regions/cloud-region/aaa-aic/AAIAIC25/tenants/tenant/USMSO1SX7NJ0103UJZZ01%3A%3AuCPE-VMS/vservers/vserver/d0668d4f-c25e-4a1b-87c4-83845c01efd8"); - assertEquals(response.getInMaint(), "false"); - assertEquals(response.getIsClosedLoopDisabled(), "false"); - assertEquals(response.getResourceVersion(), "1494001931513"); + assertEquals("d0668d4f-c25e-4a1b-87c4-83845c01efd8", response.getVserverID()); + assertEquals("USMSO1SX7NJ0103UJZZ01-vjunos0", response.getVserverName()); + assertEquals("vjunos0", response.getVserverName2()); + assertEquals("https://aai-ext1.test.aaa.com:8443/aai/v7/cloud-infrastructure/cloud-regions/cloud-region/" + + "aaa-aic/AAIAIC25/tenants/tenant/USMSO1SX7NJ0103UJZZ01%3A%3AuCPE-VMS/vservers/vserver/d0668d4f-c25e-4a1b-87c4-83845c01efd8", + response.getVserverSelflink()); + assertEquals("false", response.getInMaint()); + assertEquals("false", response.getIsClosedLoopDisabled()); + assertEquals("1494001931513", response.getResourceVersion()); RelationshipList relationshipList = new RelationshipList(); Relationship relationship = new Relationship(); RelationshipData relationshipData = new RelationshipData(); RelationshipDataItem relationshipDataItem = new RelationshipDataItem(); - relationshipDataItem.setRelationshipKey("customer.global-customer-id"); - relationshipDataItem.setRelationshipValue("MSO_1610_ST"); + relationshipDataItem.setRelationshipKey("customer.global-customer-id"); + relationshipDataItem.setRelationshipValue("MSO_1610_ST"); relationshipData.getRelationshipData().add(relationshipDataItem); - relationshipDataItem.setRelationshipKey("service-subscription.service-type"); - relationshipDataItem.setRelationshipValue("MSO-dev-service-type"); + relationshipDataItem.setRelationshipKey("service-subscription.service-type"); + relationshipDataItem.setRelationshipValue("MSO-dev-service-type"); relationshipData.getRelationshipData().add(relationshipDataItem); - relationshipDataItem.setRelationshipKey("service-instance.service-instance-id"); - relationshipDataItem.setRelationshipValue("e1e9c97c-02c0-4919-9b4c-eb5d5ef68970"); + relationshipDataItem.setRelationshipKey("service-instance.service-instance-id"); + relationshipDataItem.setRelationshipValue("e1e9c97c-02c0-4919-9b4c-eb5d5ef68970"); relationshipData.getRelationshipData().add(relationshipDataItem); RelatedToProperty relatedToProperty = new RelatedToProperty(); - RelatedToPropertyItem item = new RelatedToPropertyItem(); - item.setPropertyKey("service-instance.service-instance-name"); - item.setPropertyValue("lll_svc_010317"); + RelatedToPropertyItem item = new RelatedToPropertyItem(); + item.setPropertyKey("service-instance.service-instance-name"); + item.setPropertyValue("lll_svc_010317"); relatedToProperty.getRelatedTo().add(item); relationship.setRelatedTo("service-instance"); @@ -80,12 +82,12 @@ public class AAIGETVserverResponseTest { relationship.setRelatedToProperty(relatedToProperty); relationshipList.getRelationshipList().add(relationship); - response.setRelationshipList(relationshipList); - assertEquals(response.getRelationshipList(), relationshipList); + response.setRelationshipList(relationshipList); + assertEquals(response.getRelationshipList(), relationshipList); response.setRequestError(null); assertNull(response.getRequestError()); logger.info(Serialization.gsonPretty.toJson(response)); } -}
\ No newline at end of file +} diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAINQCloudRegionTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAINQCloudRegionTest.java index f5c594088..5d1fe278c 100644 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAINQCloudRegionTest.java +++ b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAINQCloudRegionTest.java @@ -43,11 +43,11 @@ public class AAINQCloudRegionTest { aaiNQCloudRegion.setCloudRegionVersion("v1"); aaiNQCloudRegion.setComplexName("SharedNode"); aaiNQCloudRegion.setResourceVersion("1504789196021"); - assertNotNull(aaiNQCloudRegion); - assertEquals(aaiNQCloudRegion.getCloudOwner(), "Rackspace"); - assertEquals(aaiNQCloudRegion.getCloudRegionId(), "DFW"); - assertEquals(aaiNQCloudRegion.getCloudRegionVersion(), "v1"); - assertEquals(aaiNQCloudRegion.getComplexName(), "SharedNode"); - assertEquals(aaiNQCloudRegion.getResourceVersion(), "1504789196021"); + assertNotNull(aaiNQCloudRegion); + assertEquals("Rackspace", aaiNQCloudRegion.getCloudOwner()); + assertEquals("DFW", aaiNQCloudRegion.getCloudRegionId()); + assertEquals("v1", aaiNQCloudRegion.getCloudRegionVersion()); + assertEquals("SharedNode", aaiNQCloudRegion.getComplexName()); + assertEquals("1504789196021", aaiNQCloudRegion.getResourceVersion()); } } diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAINQExtraPropertyTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAINQExtraPropertyTest.java index 2b6dc7452..78189c857 100644 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAINQExtraPropertyTest.java +++ b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAINQExtraPropertyTest.java @@ -42,7 +42,7 @@ public class AAINQExtraPropertyTest { aaiNQExtraProperty.setPropertyValue("service-instance"); assertNotNull(aaiNQExtraProperty); - assertEquals(aaiNQExtraProperty.getPropertyName(), "model.model-name"); - assertEquals(aaiNQExtraProperty.getPropertyValue(), "service-instance"); + assertEquals("model.model-name", aaiNQExtraProperty.getPropertyName()); + assertEquals("service-instance", aaiNQExtraProperty.getPropertyValue()); } } diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAINQGenericVNFTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAINQGenericVNFTest.java index 7bd7d0270..fba01bc22 100644 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAINQGenericVNFTest.java +++ b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAINQGenericVNFTest.java @@ -38,42 +38,42 @@ public class AAINQGenericVNFTest { @Test public void test() { AAINQGenericVNF aaiNQGenericVNF = new AAINQGenericVNF(); - aaiNQGenericVNF.setEncrypedAccessFlag(true); - aaiNQGenericVNF.setInMaint(false); - aaiNQGenericVNF.setIpv4Loopback0Address("aa"); - aaiNQGenericVNF.setIpv4OamAddress("oamAddress"); - aaiNQGenericVNF.setIsClosedLoopDisabled(false); - aaiNQGenericVNF.setModelInvariantId("653d2caa-7e47-4614-95b3-26c8d82755b8"); - aaiNQGenericVNF.setModelVersionId("98f410f6-4c63-447b-97d2-42508437cec0"); + aaiNQGenericVNF.setEncrypedAccessFlag(true); + aaiNQGenericVNF.setInMaint(false); + aaiNQGenericVNF.setIpv4Loopback0Address("aa"); + aaiNQGenericVNF.setIpv4OamAddress("oamAddress"); + aaiNQGenericVNF.setIsClosedLoopDisabled(false); + aaiNQGenericVNF.setModelInvariantId("653d2caa-7e47-4614-95b3-26c8d82755b8"); + aaiNQGenericVNF.setModelVersionId("98f410f6-4c63-447b-97d2-42508437cec0"); aaiNQGenericVNF.setOperationalState("active"); aaiNQGenericVNF.setPersonaModelId("653d2caa-7e47-4614-95b3-26c8d82755b8"); aaiNQGenericVNF.setPersonaModelVersion("98f410f6-4c63-447b-97d2-42508437cec0"); aaiNQGenericVNF.setProvStatus("complete"); aaiNQGenericVNF.setResourceVersion("1505056714553"); aaiNQGenericVNF.setServiceId("e8cb8968-5411-478b-906a-f28747de72cd"); - aaiNQGenericVNF.setVnfID("ed8b2bce-6b27-4089-992c-4a2c66024bcd"); + aaiNQGenericVNF.setVnfID("ed8b2bce-6b27-4089-992c-4a2c66024bcd"); aaiNQGenericVNF.setVnfName("vCPEInfraVNF14a"); aaiNQGenericVNF.setVnfName2("malumabb12"); aaiNQGenericVNF.setVnfType("vCPEInfraService10/vCPEInfraService10 0"); - assertNotNull(aaiNQGenericVNF); - - assertEquals(aaiNQGenericVNF.getEncrypedAccessFlag(), true); - assertEquals(aaiNQGenericVNF.getInMaint(), false); - assertEquals(aaiNQGenericVNF.getIpv4Loopback0Address(), "aa"); - assertEquals(aaiNQGenericVNF.getIpv4OamAddress(), "oamAddress"); - assertEquals(aaiNQGenericVNF.getIsClosedLoopDisabled(), false); - assertEquals(aaiNQGenericVNF.getModelInvariantId(), "653d2caa-7e47-4614-95b3-26c8d82755b8"); - assertEquals(aaiNQGenericVNF.getModelVersionId(), "98f410f6-4c63-447b-97d2-42508437cec0"); - assertEquals(aaiNQGenericVNF.getOperationalState(), "active"); - assertEquals(aaiNQGenericVNF.getPersonaModelId(), "653d2caa-7e47-4614-95b3-26c8d82755b8"); - assertEquals(aaiNQGenericVNF.getPersonaModelVersion(), "98f410f6-4c63-447b-97d2-42508437cec0"); - assertEquals(aaiNQGenericVNF.getProvStatus(), "complete"); - assertEquals(aaiNQGenericVNF.getResourceVersion(), "1505056714553"); - assertEquals(aaiNQGenericVNF.getServiceId(), "e8cb8968-5411-478b-906a-f28747de72cd"); - assertEquals(aaiNQGenericVNF.getVnfID(), "ed8b2bce-6b27-4089-992c-4a2c66024bcd"); - assertEquals(aaiNQGenericVNF.getVnfName(), "vCPEInfraVNF14a"); - assertEquals(aaiNQGenericVNF.getVnfName2(), "malumabb12"); - assertEquals(aaiNQGenericVNF.getVnfType(), "vCPEInfraService10/vCPEInfraService10 0"); + assertNotNull(aaiNQGenericVNF); + + assertEquals(true, aaiNQGenericVNF.getEncrypedAccessFlag()); + assertEquals(false, aaiNQGenericVNF.getInMaint()); + assertEquals("aa", aaiNQGenericVNF.getIpv4Loopback0Address()); + assertEquals("oamAddress", aaiNQGenericVNF.getIpv4OamAddress()); + assertEquals(false, aaiNQGenericVNF.getIsClosedLoopDisabled()); + assertEquals("653d2caa-7e47-4614-95b3-26c8d82755b8", aaiNQGenericVNF.getModelInvariantId()); + assertEquals("98f410f6-4c63-447b-97d2-42508437cec0", aaiNQGenericVNF.getModelVersionId()); + assertEquals("active", aaiNQGenericVNF.getOperationalState()); + assertEquals("653d2caa-7e47-4614-95b3-26c8d82755b8", aaiNQGenericVNF.getPersonaModelId()); + assertEquals("98f410f6-4c63-447b-97d2-42508437cec0", aaiNQGenericVNF.getPersonaModelVersion()); + assertEquals("complete", aaiNQGenericVNF.getProvStatus()); + assertEquals("1505056714553", aaiNQGenericVNF.getResourceVersion()); + assertEquals("e8cb8968-5411-478b-906a-f28747de72cd", aaiNQGenericVNF.getServiceId()); + assertEquals("ed8b2bce-6b27-4089-992c-4a2c66024bcd", aaiNQGenericVNF.getVnfID()); + assertEquals("vCPEInfraVNF14a", aaiNQGenericVNF.getVnfName()); + assertEquals("malumabb12", aaiNQGenericVNF.getVnfName2()); + assertEquals("vCPEInfraService10/vCPEInfraService10 0", aaiNQGenericVNF.getVnfType()); } } diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAINQInventoryResponseItemsTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAINQInventoryResponseItemsTest.java index 422824330..caeec7910 100644 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAINQInventoryResponseItemsTest.java +++ b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAINQInventoryResponseItemsTest.java @@ -46,7 +46,7 @@ public class AAINQInventoryResponseItemsTest { AAINQInventoryResponseItems aaiNQInventoryResponseItems = new AAINQInventoryResponseItems(); AAINQInventoryResponseItem serviceItem = new AAINQInventoryResponseItem(); serviceItem.setModelName("service-instance"); - assertEquals(serviceItem.getModelName(), "service-instance"); + assertEquals("service-instance", serviceItem.getModelName()); serviceItem.setServiceInstance(new AAINQServiceInstance()); serviceItem.getServiceInstance().setServiceInstanceID("dhv-test-vhnfportal-service-instance-id"); diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAINQServiceInstanceTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAINQServiceInstanceTest.java index dcb19a4ef..3b3d13c1e 100644 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAINQServiceInstanceTest.java +++ b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAINQServiceInstanceTest.java @@ -51,14 +51,14 @@ public class AAINQServiceInstanceTest { aaiNQServiceInstance.setModelInvariantId("SomeID"); aaiNQServiceInstance.setModelVersionId("SomeVersion"); assertNotNull(aaiNQServiceInstance); - assertEquals(aaiNQServiceInstance.getServiceInstanceID(), "dhv-test-vhnfportal-service-instance-id"); - assertEquals(aaiNQServiceInstance.getServiceInstanceName(), "dhv-test-service-instance-name1"); - assertEquals(aaiNQServiceInstance.getPersonaModelId(), "82194af1-3c2c-485a-8f44-420e22a9eaa4"); - assertEquals(aaiNQServiceInstance.getPersonaModelVersion(), "1.0"); - assertEquals(aaiNQServiceInstance.getServiceInstanceLocationId(), "dhv-test-service-instance-location-id1"); - assertEquals(aaiNQServiceInstance.getResourceVersion(), "1485366092"); - assertEquals(aaiNQServiceInstance.getModelInvariantId(), "SomeID"); - assertEquals(aaiNQServiceInstance.getModelVersionId(), "SomeVersion"); + assertEquals("dhv-test-vhnfportal-service-instance-id", aaiNQServiceInstance.getServiceInstanceID()); + assertEquals("dhv-test-service-instance-name1", aaiNQServiceInstance.getServiceInstanceName()); + assertEquals("82194af1-3c2c-485a-8f44-420e22a9eaa4", aaiNQServiceInstance.getPersonaModelId()); + assertEquals("1.0", aaiNQServiceInstance.getPersonaModelVersion()); + assertEquals("dhv-test-service-instance-location-id1", aaiNQServiceInstance.getServiceInstanceLocationId()); + assertEquals("1485366092", aaiNQServiceInstance.getResourceVersion()); + assertEquals("SomeID", aaiNQServiceInstance.getModelInvariantId()); + assertEquals("SomeVersion", aaiNQServiceInstance.getModelVersionId()); logger.info(Serialization.gsonPretty.toJson(aaiNQServiceInstance)); } diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAINQTenantTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAINQTenantTest.java index c40a46246..b696c7bd4 100644 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAINQTenantTest.java +++ b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAINQTenantTest.java @@ -46,9 +46,9 @@ public class AAINQTenantTest { aaiNQTenant.setTenantName("dhv-test-tenant-name"); aaiNQTenant.setResourceVersion("1485366334"); assertNotNull(aaiNQTenant); - assertEquals(aaiNQTenant.getTenantId(), "dhv-test-tenant"); - assertEquals(aaiNQTenant.getTenantName(), "dhv-test-tenant-name"); - assertEquals(aaiNQTenant.getResourceVersion(), "1485366334"); + assertEquals("dhv-test-tenant", aaiNQTenant.getTenantId()); + assertEquals("dhv-test-tenant-name", aaiNQTenant.getTenantName()); + assertEquals("1485366334", aaiNQTenant.getResourceVersion()); logger.info(Serialization.gsonPretty.toJson(aaiNQTenant)); } diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAINQVServerTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAINQVServerTest.java index b928e86a6..556d82c2e 100644 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAINQVServerTest.java +++ b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAINQVServerTest.java @@ -52,14 +52,14 @@ public class AAINQVServerTest { aaiNQVServer.setIsClosedLoopDisabled(false); aaiNQVServer.setResourceVersion("1485366417"); assertNotNull(aaiNQVServer); - assertEquals(aaiNQVServer.getVserverId(), "dhv-test-vserver"); - assertEquals(aaiNQVServer.getVserverName(), "dhv-test-vserver-name"); - assertEquals(aaiNQVServer.getVserverName2(), "dhv-test-vserver-name2"); - assertEquals(aaiNQVServer.getProvStatus(), "PREPROV"); - assertEquals(aaiNQVServer.getVserverSelflink(), "dhv-test-vserver-selflink"); - assertEquals(aaiNQVServer.getInMaint(), false); - assertEquals(aaiNQVServer.getIsClosedLoopDisabled(), false); - assertEquals(aaiNQVServer.getResourceVersion(), "1485366417"); + assertEquals("dhv-test-vserver", aaiNQVServer.getVserverId()); + assertEquals("dhv-test-vserver-name", aaiNQVServer.getVserverName()); + assertEquals("dhv-test-vserver-name2", aaiNQVServer.getVserverName2()); + assertEquals("PREPROV", aaiNQVServer.getProvStatus()); + assertEquals("dhv-test-vserver-selflink", aaiNQVServer.getVserverSelflink()); + assertEquals(false, aaiNQVServer.getInMaint()); + assertEquals(false, aaiNQVServer.getIsClosedLoopDisabled()); + assertEquals("1485366417", aaiNQVServer.getResourceVersion()); logger.info(Serialization.gsonPretty.toJson(aaiNQVServer)); } diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAINQVfModuleTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAINQVfModuleTest.java index 21f13d5e8..7595f88cd 100644 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAINQVfModuleTest.java +++ b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AAINQVfModuleTest.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. * ============LICENSE_END========================================================= -*/ + */ package org.onap.policy.aai; import static org.junit.Assert.*; @@ -56,21 +56,21 @@ public class AAINQVfModuleTest { aaiNQVfModule.setContrailServiceInstanceFqdn("example-contrail-service-instance-fqdn-val-86796"); aaiNQVfModule.setModelInvariantId("SomeId"); aaiNQVfModule.setModelVersionId("SomeVersion"); - assertNotNull(aaiNQVfModule); - assertEquals(aaiNQVfModule.getVfModuleId(), "example-vf-module-id-val-49261"); - assertEquals(aaiNQVfModule.getVfModuleName(), "example-vf-module-name-val-73074"); - assertEquals(aaiNQVfModule.getHeatStackId(), "example-heat-stack-id-val-86300"); - assertEquals(aaiNQVfModule.getOrchestrationStatus(), "example-orchestration-status-val-56523"); - assertEquals(aaiNQVfModule.getIsBaseVfModule(), true); - assertEquals(aaiNQVfModule.getResourceVersion(), "1485366450"); - assertEquals(aaiNQVfModule.getPersonaModelId(), "ef86f9c5-2165-44f3-8fc3-96018b609ea5"); - assertEquals(aaiNQVfModule.getPersonaModelVersion(), "1.0"); - assertEquals(aaiNQVfModule.getWidgetModelId(), "example-widget-model-id-val-92571"); - assertEquals(aaiNQVfModule.getWidgetModelVersion(), "example-widget-model-version-val-83317"); - assertEquals(aaiNQVfModule.getContrailServiceInstanceFqdn(), "example-contrail-service-instance-fqdn-val-86796"); - assertEquals(aaiNQVfModule.getModelInvariantId(), "SomeId"); - assertEquals(aaiNQVfModule.getModelVersionId(), "SomeVersion"); - logger.info(Serialization.gsonPretty.toJson(aaiNQVfModule)); + assertNotNull(aaiNQVfModule); + assertEquals("example-vf-module-id-val-49261", aaiNQVfModule.getVfModuleId()); + assertEquals("example-vf-module-name-val-73074", aaiNQVfModule.getVfModuleName()); + assertEquals("example-heat-stack-id-val-86300", aaiNQVfModule.getHeatStackId()); + assertEquals("example-orchestration-status-val-56523", aaiNQVfModule.getOrchestrationStatus()); + assertEquals(true, aaiNQVfModule.getIsBaseVfModule()); + assertEquals("1485366450", aaiNQVfModule.getResourceVersion()); + assertEquals("ef86f9c5-2165-44f3-8fc3-96018b609ea5", aaiNQVfModule.getPersonaModelId()); + assertEquals("1.0", aaiNQVfModule.getPersonaModelVersion()); + assertEquals("example-widget-model-id-val-92571", aaiNQVfModule.getWidgetModelId()); + assertEquals("example-widget-model-version-val-83317", aaiNQVfModule.getWidgetModelVersion()); + assertEquals("example-contrail-service-instance-fqdn-val-86796", aaiNQVfModule.getContrailServiceInstanceFqdn()); + assertEquals("SomeId", aaiNQVfModule.getModelInvariantId()); + assertEquals("SomeVersion", aaiNQVfModule.getModelVersionId()); + logger.info(Serialization.gsonPretty.toJson(aaiNQVfModule)); } } diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/PNFInstanceTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/PNFInstanceTest.java index a280f546c..b4a8a51eb 100644 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/PNFInstanceTest.java +++ b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/PNFInstanceTest.java @@ -47,7 +47,7 @@ public class PNFInstanceTest { pnfInstance.setPNFType(PNFType.ENODEB); pnfInstance.setPNFSerial("pnf-serial-test"); assertNotNull(pnfInstance); - assertEquals(pnfInstance.getPNFInstanceName(), "pnf-instance-name-test"); + assertEquals("pnf-instance-name-test", pnfInstance.getPNFInstanceName()); PNFInstance pnfInstanceNull = new PNFInstance(null); assertNotNull(pnfInstanceNull); diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipDataTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipDataTest.java index b25d3e473..6b228f7a0 100644 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipDataTest.java +++ b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipDataTest.java @@ -46,8 +46,8 @@ public class RelationshipDataTest { relationshipDataItem.setRelationshipKey("relationship-key"); relationshipDataItem.setRelationshipValue("relationship-value"); assertNotNull(relationshipDataItem); - assertEquals(relationshipDataItem.getRelationshipKey(), "relationship-key"); - assertEquals(relationshipDataItem.getRelationshipValue(), "relationship-value"); + assertEquals("relationship-key", relationshipDataItem.getRelationshipKey()); + assertEquals("relationship-value", relationshipDataItem.getRelationshipValue()); relationshipData.getRelationshipData().add(relationshipDataItem); RelationshipDataItem relationshipDataItem2 = new RelationshipDataItem(); diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipListTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipListTest.java index a5a7d90d0..7300fb87c 100644 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipListTest.java +++ b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipListTest.java @@ -42,28 +42,28 @@ public class RelationshipListTest { @Test public void test() { RelationshipList relationshipList = new RelationshipList(); - Relationship relationship = new Relationship(); - relationship.setRelatedLink("related-link"); - relationship.setRelatedTo("related-to"); - assertEquals(relationship.getRelatedLink(), "related-link"); - assertEquals(relationship.getRelatedTo(), "related-to"); + Relationship relationship = new Relationship(); + relationship.setRelatedLink("related-link"); + relationship.setRelatedTo("related-to"); + assertEquals("related-link", relationship.getRelatedLink()); + assertEquals("related-to", relationship.getRelatedTo()); RelatedToProperty relatedToProperty = new RelatedToProperty(); - RelatedToPropertyItem relatedToPropertyItem = new RelatedToPropertyItem(); - relatedToPropertyItem.setPropertyKey("model.model-name"); + RelatedToPropertyItem relatedToPropertyItem = new RelatedToPropertyItem(); + relatedToPropertyItem.setPropertyKey("model.model-name"); relatedToPropertyItem.setPropertyValue("service-instance"); - relatedToProperty.getRelatedTo().add(relatedToPropertyItem); - RelatedToPropertyItem relatedToPropertyItem2 = new RelatedToPropertyItem(); - relatedToPropertyItem2.setPropertyKey("model.model-name2"); + relatedToProperty.getRelatedTo().add(relatedToPropertyItem); + RelatedToPropertyItem relatedToPropertyItem2 = new RelatedToPropertyItem(); + relatedToPropertyItem2.setPropertyKey("model.model-name2"); relatedToPropertyItem2.setPropertyValue("service-instance2"); relatedToProperty.getRelatedTo().add(relatedToPropertyItem2); - relationship.setRelatedToProperty(relatedToProperty); - RelationshipDataItem relationshipDataItem = new RelationshipDataItem(); + relationship.setRelatedToProperty(relatedToProperty); + RelationshipDataItem relationshipDataItem = new RelationshipDataItem(); relationshipDataItem.setRelationshipKey("relationship-key"); - relationshipDataItem.setRelationshipValue("relationship-value"); - RelationshipData relationshipData = new RelationshipData(); - relationshipData.getRelationshipData().add(relationshipDataItem); - relationship.setRelationshipData(relationshipData); + relationshipDataItem.setRelationshipValue("relationship-value"); + RelationshipData relationshipData = new RelationshipData(); + relationshipData.getRelationshipData().add(relationshipDataItem); + relationship.setRelationshipData(relationshipData); relationshipList.getRelationshipList().add(relationship); assertNotNull(relationshipList); diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipTest.java index 3f899eb9b..81ba0885c 100644 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipTest.java +++ b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipTest.java @@ -42,30 +42,30 @@ public class RelationshipTest { @Test public void test() { Relationship relationship = new Relationship(); - relationship.setRelatedLink("related-link"); - relationship.setRelatedTo("related-to"); - assertEquals(relationship.getRelatedLink(), "related-link"); - assertEquals(relationship.getRelatedTo(), "related-to"); + relationship.setRelatedLink("related-link"); + relationship.setRelatedTo("related-to"); + assertEquals("related-link", relationship.getRelatedLink()); + assertEquals("related-to", relationship.getRelatedTo()); RelatedToProperty relatedToProperty = new RelatedToProperty(); - RelatedToPropertyItem relatedToPropertyItem = new RelatedToPropertyItem(); - relatedToPropertyItem.setPropertyKey("model.model-name"); + RelatedToPropertyItem relatedToPropertyItem = new RelatedToPropertyItem(); + relatedToPropertyItem.setPropertyKey("model.model-name"); relatedToPropertyItem.setPropertyValue("service-instance"); - relatedToProperty.getRelatedTo().add(relatedToPropertyItem); - RelatedToPropertyItem relatedToPropertyItem2 = new RelatedToPropertyItem(); - relatedToPropertyItem2.setPropertyKey("model.model-name2"); + relatedToProperty.getRelatedTo().add(relatedToPropertyItem); + RelatedToPropertyItem relatedToPropertyItem2 = new RelatedToPropertyItem(); + relatedToPropertyItem2.setPropertyKey("model.model-name2"); relatedToPropertyItem2.setPropertyValue("service-instance2"); relatedToProperty.getRelatedTo().add(relatedToPropertyItem2); - relationship.setRelatedToProperty(relatedToProperty); - assertEquals(relationship.getRelatedToProperty(), relatedToProperty); - RelationshipDataItem relationshipDataItem = new RelationshipDataItem(); + relationship.setRelatedToProperty(relatedToProperty); + assertEquals(relationship.getRelatedToProperty(), relatedToProperty); + RelationshipDataItem relationshipDataItem = new RelationshipDataItem(); relationshipDataItem.setRelationshipKey("relationship-key"); - relationshipDataItem.setRelationshipValue("relationship-value"); - RelationshipData relationshipData = new RelationshipData(); - relationshipData.getRelationshipData().add(relationshipDataItem); - relationship.setRelationshipData(relationshipData); - assertEquals(relationship.getRelationshipData(), relationshipData); - assertNotNull(relationship); + relationshipDataItem.setRelationshipValue("relationship-value"); + RelationshipData relationshipData = new RelationshipData(); + relationshipData.getRelationshipData().add(relationshipDataItem); + relationship.setRelationshipData(relationshipData); + assertEquals(relationship.getRelationshipData(), relationshipData); + assertNotNull(relationship); logger.info(Serialization.gsonPretty.toJson(relationship)); } diff --git a/controlloop/common/model-impl/vfc/src/main/java/org/onap/policy/vfc/VFCResponseDescriptor.java b/controlloop/common/model-impl/vfc/src/main/java/org/onap/policy/vfc/VFCResponseDescriptor.java index 81eb3bc4d..f237554fd 100644 --- a/controlloop/common/model-impl/vfc/src/main/java/org/onap/policy/vfc/VFCResponseDescriptor.java +++ b/controlloop/common/model-impl/vfc/src/main/java/org/onap/policy/vfc/VFCResponseDescriptor.java @@ -42,7 +42,7 @@ public class VFCResponseDescriptor implements Serializable { private String responseId; @SerializedName("responseHistoryList") - public List<VFCResponseDescriptor> responseHistoryList; + private List<VFCResponseDescriptor> responseHistoryList; public VFCResponseDescriptor() { // Default constructor for VFCResponseDescriptor diff --git a/controlloop/common/model-impl/vfc/src/test/java/org/onap/policy/vfc/TestDemo.java b/controlloop/common/model-impl/vfc/src/test/java/org/onap/policy/vfc/TestDemo.java index 96a62bf9f..69d3d5838 100644 --- a/controlloop/common/model-impl/vfc/src/test/java/org/onap/policy/vfc/TestDemo.java +++ b/controlloop/common/model-impl/vfc/src/test/java/org/onap/policy/vfc/TestDemo.java @@ -66,8 +66,8 @@ public class TestDemo { responseDescriptor.setErrorCode(null); responseDescriptor.setResponseId("11"); - response.getResponseDescriptor().responseHistoryList = new LinkedList<>(); - response.getResponseDescriptor().responseHistoryList.add(responseDescriptor); + response.getResponseDescriptor().setResponseHistoryList(new LinkedList<>()); + response.getResponseDescriptor().getResponseHistoryList().add(responseDescriptor); body = Serialization.gsonPretty.toJson(response); System.out.println(body); diff --git a/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java b/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java index e70a88517..eb12362ee 100644 --- a/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java +++ b/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java @@ -34,7 +34,7 @@ public class SoSimulatorJaxRs { @Path("/v5/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules") @Consumes(MediaType.APPLICATION_JSON) @Produces("application/json") - public String SoPostQuery(@PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId) + public String soPostQuery(@PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId) { // the requestID contained in the SO Response is a newly generated requestID diff --git a/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/Util.java b/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/Util.java index cd45d3134..05afd1179 100644 --- a/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/Util.java +++ b/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/Util.java @@ -26,52 +26,56 @@ import org.onap.policy.drools.http.server.HttpServletServer; import org.onap.policy.drools.utils.NetworkUtil; public class Util { - public static final String AAISIM_SERVER_NAME = "aaiSim"; - public static final String SOSIM_SERVER_NAME = "soSim"; - public static final String VFCSIM_SERVER_NAME = "vfcSim"; - public static final String GUARDSIM_SERVER_NAME = "guardSim"; + private Util() { + // Prevent instantiation of thic class + } - public static final int AAISIM_SERVER_PORT = 6666; - public static final int SOSIM_SERVER_PORT = 6667; - public static final int VFCSIM_SERVER_PORT = 6668; - public static final int GUARDSIM_SERVER_PORT = 6669; + public static final String AAISIM_SERVER_NAME = "aaiSim"; + public static final String SOSIM_SERVER_NAME = "soSim"; + public static final String VFCSIM_SERVER_NAME = "vfcSim"; + public static final String GUARDSIM_SERVER_NAME = "guardSim"; - public static HttpServletServer buildAaiSim() throws InterruptedException, IOException { - final HttpServletServer testServer = HttpServletServer.factory.build(AAISIM_SERVER_NAME, - "localhost", AAISIM_SERVER_PORT, "/", false, true); - testServer.addServletClass("/*", AaiSimulatorJaxRs.class.getName()); - testServer.waitedStart(5000); - if (!NetworkUtil.isTcpPortOpen("localhost", testServer.getPort(), 5, 10000L)) - throw new IllegalStateException("cannot connect to port " + testServer.getPort()); - return testServer; - } + public static final int AAISIM_SERVER_PORT = 6666; + public static final int SOSIM_SERVER_PORT = 6667; + public static final int VFCSIM_SERVER_PORT = 6668; + public static final int GUARDSIM_SERVER_PORT = 6669; - public static HttpServletServer buildSoSim() throws InterruptedException, IOException { - final HttpServletServer testServer = HttpServletServer.factory.build(SOSIM_SERVER_NAME, - "localhost", SOSIM_SERVER_PORT, "/", false, true); - testServer.addServletClass("/*", SoSimulatorJaxRs.class.getName()); - testServer.waitedStart(5000); - if (!NetworkUtil.isTcpPortOpen("localhost", testServer.getPort(), 5, 10000L)) - throw new IllegalStateException("cannot connect to port " + testServer.getPort()); - return testServer; - } + public static HttpServletServer buildAaiSim() throws InterruptedException, IOException { + final HttpServletServer testServer = HttpServletServer.factory.build(AAISIM_SERVER_NAME, + "localhost", AAISIM_SERVER_PORT, "/", false, true); + testServer.addServletClass("/*", AaiSimulatorJaxRs.class.getName()); + testServer.waitedStart(5000); + if (!NetworkUtil.isTcpPortOpen("localhost", testServer.getPort(), 5, 10000L)) + throw new IllegalStateException("cannot connect to port " + testServer.getPort()); + return testServer; + } - public static HttpServletServer buildVfcSim() throws InterruptedException, IOException { - final HttpServletServer testServer = HttpServletServer.factory.build(VFCSIM_SERVER_NAME, - "localhost", VFCSIM_SERVER_PORT, "/", false, true); - testServer.addServletClass("/*", VfcSimulatorJaxRs.class.getName()); - testServer.waitedStart(5000); - if (!NetworkUtil.isTcpPortOpen("localhost", testServer.getPort(), 5, 10000L)) - throw new IllegalStateException("cannot connect to port " + testServer.getPort()); - return testServer; - } + public static HttpServletServer buildSoSim() throws InterruptedException, IOException { + final HttpServletServer testServer = HttpServletServer.factory.build(SOSIM_SERVER_NAME, + "localhost", SOSIM_SERVER_PORT, "/", false, true); + testServer.addServletClass("/*", SoSimulatorJaxRs.class.getName()); + testServer.waitedStart(5000); + if (!NetworkUtil.isTcpPortOpen("localhost", testServer.getPort(), 5, 10000L)) + throw new IllegalStateException("cannot connect to port " + testServer.getPort()); + return testServer; + } - public static HttpServletServer buildGuardSim() throws InterruptedException, IOException { - HttpServletServer testServer = HttpServletServer.factory.build(GUARDSIM_SERVER_NAME, "localhost", GUARDSIM_SERVER_PORT, "/", false, true); - testServer.addServletClass("/*", GuardSimulatorJaxRs.class.getName()); - testServer.waitedStart(5000); - if (!NetworkUtil.isTcpPortOpen("localhost", testServer.getPort(), 5, 10000L)) - throw new IllegalStateException("cannot connect to port " + testServer.getPort()); - return testServer; - } + public static HttpServletServer buildVfcSim() throws InterruptedException, IOException { + final HttpServletServer testServer = HttpServletServer.factory.build(VFCSIM_SERVER_NAME, + "localhost", VFCSIM_SERVER_PORT, "/", false, true); + testServer.addServletClass("/*", VfcSimulatorJaxRs.class.getName()); + testServer.waitedStart(5000); + if (!NetworkUtil.isTcpPortOpen("localhost", testServer.getPort(), 5, 10000L)) + throw new IllegalStateException("cannot connect to port " + testServer.getPort()); + return testServer; + } + + public static HttpServletServer buildGuardSim() throws InterruptedException, IOException { + HttpServletServer testServer = HttpServletServer.factory.build(GUARDSIM_SERVER_NAME, "localhost", GUARDSIM_SERVER_PORT, "/", false, true); + testServer.addServletClass("/*", GuardSimulatorJaxRs.class.getName()); + testServer.waitedStart(5000); + if (!NetworkUtil.isTcpPortOpen("localhost", testServer.getPort(), 5, 10000L)) + throw new IllegalStateException("cannot connect to port " + testServer.getPort()); + return testServer; + } } |