From 4d1dac2f69d182ba5ca1f2b34fa9c860c1c26306 Mon Sep 17 00:00:00 2001 From: "Determe, Sebastien (sd378r)" Date: Wed, 4 Apr 2018 14:06:53 +0200 Subject: Fix Checkstyle issues Fix issues reported by checkstyle during build Issue-ID: CLAMP-147 Change-Id: I9d3a1a50b29cd068ecc3f65181ed44d25bcc5503 Signed-off-by: Determe, Sebastien (sd378r) --- .../java/org/onap/clamp/clds/it/CldsDaoItCase.java | 2 +- .../controller/installer/CsarInstallerItCase.java | 30 +++++++++++----------- .../clamp/clds/model/CldsDbServiceCacheTest.java | 14 +++++----- .../sdc/controller/installer/CsarHandlerTest.java | 4 +-- 4 files changed, 25 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/test/java/org/onap/clamp/clds/it/CldsDaoItCase.java b/src/test/java/org/onap/clamp/clds/it/CldsDaoItCase.java index ba37b57f8..788a7ff7c 100644 --- a/src/test/java/org/onap/clamp/clds/it/CldsDaoItCase.java +++ b/src/test/java/org/onap/clamp/clds/it/CldsDaoItCase.java @@ -44,10 +44,10 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.onap.clamp.clds.client.req.sdc.SdcCatalogServices; import org.onap.clamp.clds.dao.CldsDao; -import org.onap.clamp.clds.model.CldsMonitoringDetails; import org.onap.clamp.clds.model.CldsDbServiceCache; import org.onap.clamp.clds.model.CldsEvent; import org.onap.clamp.clds.model.CldsModel; +import org.onap.clamp.clds.model.CldsMonitoringDetails; import org.onap.clamp.clds.model.CldsServiceData; import org.onap.clamp.clds.model.CldsTemplate; import org.onap.clamp.clds.util.ResourceFileUtil; diff --git a/src/test/java/org/onap/clamp/clds/it/sdc/controller/installer/CsarInstallerItCase.java b/src/test/java/org/onap/clamp/clds/it/sdc/controller/installer/CsarInstallerItCase.java index fc5cb040f..92fa59f33 100644 --- a/src/test/java/org/onap/clamp/clds/it/sdc/controller/installer/CsarInstallerItCase.java +++ b/src/test/java/org/onap/clamp/clds/it/sdc/controller/installer/CsarInstallerItCase.java @@ -104,22 +104,22 @@ public class CsarInstallerItCase { String generatedName = RandomStringUtils.randomAlphanumeric(5); csarInstaller.installTheCsar(buildFakeCsarHandler(generatedName)); // Get the template back from DB - CldsTemplate templateFromDB = CldsTemplate.retrieve(cldsDao, + CldsTemplate templateFromDb = CldsTemplate.retrieve(cldsDao, CsarInstallerImpl.TEMPLATE_NAME_PREFIX + generatedName, false); - assertNotNull(templateFromDB); - assertNotNull(templateFromDB.getBpmnText()); - assertNotNull(templateFromDB.getImageText()); - assertNotNull(templateFromDB.getPropText()); - assertTrue(templateFromDB.getPropText().contains("global") - && templateFromDB.getPropText().contains("node_templates:")); - assertEquals(templateFromDB.getName(), CsarInstallerImpl.TEMPLATE_NAME_PREFIX + generatedName); + assertNotNull(templateFromDb); + assertNotNull(templateFromDb.getBpmnText()); + assertNotNull(templateFromDb.getImageText()); + assertNotNull(templateFromDb.getPropText()); + assertTrue(templateFromDb.getPropText().contains("global") + && templateFromDb.getPropText().contains("node_templates:")); + assertEquals(templateFromDb.getName(), CsarInstallerImpl.TEMPLATE_NAME_PREFIX + generatedName); // Get the Model back from DB - CldsModel modelFromDB = CldsModel.retrieve(cldsDao, generatedName, true); - assertNotNull(modelFromDB); - assertNotNull(modelFromDB.getBpmnText()); - assertNotNull(modelFromDB.getImageText()); - assertNotNull(modelFromDB.getPropText()); - assertEquals(modelFromDB.getName(), generatedName); - assertEquals(CsarInstallerImpl.MODEL_NAME_PREFIX, modelFromDB.getControlNamePrefix()); + CldsModel modelFromDb = CldsModel.retrieve(cldsDao, generatedName, true); + assertNotNull(modelFromDb); + assertNotNull(modelFromDb.getBpmnText()); + assertNotNull(modelFromDb.getImageText()); + assertNotNull(modelFromDb.getPropText()); + assertEquals(modelFromDb.getName(), generatedName); + assertEquals(CsarInstallerImpl.MODEL_NAME_PREFIX, modelFromDb.getControlNamePrefix()); } } diff --git a/src/test/java/org/onap/clamp/clds/model/CldsDbServiceCacheTest.java b/src/test/java/org/onap/clamp/clds/model/CldsDbServiceCacheTest.java index 447e25531..033c67d42 100644 --- a/src/test/java/org/onap/clamp/clds/model/CldsDbServiceCacheTest.java +++ b/src/test/java/org/onap/clamp/clds/model/CldsDbServiceCacheTest.java @@ -41,15 +41,15 @@ public class CldsDbServiceCacheTest { cldsServiceData.setServiceUUID("testUUID"); cldsServiceData.setAgeOfRecord(Long.valueOf(100)); cldsServiceData.setServiceInvariantUUID("testInvariantUUID"); - List cldsVfs = new ArrayList<>(); CldsVfData cldsVfData = new CldsVfData(); cldsVfData.setVfName("vf"); - List cldsKPIList = new ArrayList<>(); - CldsVfKPIData cldsVfKPIData = new CldsVfKPIData(); - cldsVfKPIData.setFieldPath("fieldPath"); - cldsVfKPIData.setFieldPathValue("fieldValue"); - cldsKPIList.add(cldsVfKPIData); - cldsVfData.setCldsKPIList(cldsKPIList); + CldsVfKPIData cldsVfKpiData = new CldsVfKPIData(); + cldsVfKpiData.setFieldPath("fieldPath"); + cldsVfKpiData.setFieldPathValue("fieldValue"); + List cldsKpiList = new ArrayList<>(); + cldsKpiList.add(cldsVfKpiData); + cldsVfData.setCldsKPIList(cldsKpiList); + List cldsVfs = new ArrayList<>(); cldsVfs.add(cldsVfData); cldsServiceData.setCldsVfs(cldsVfs); CldsDbServiceCache cldsDbServiceCache = new CldsDbServiceCache(cldsServiceData); diff --git a/src/test/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandlerTest.java b/src/test/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandlerTest.java index c842068d9..5486e652b 100644 --- a/src/test/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandlerTest.java +++ b/src/test/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandlerTest.java @@ -90,8 +90,6 @@ public class CsarHandlerTest { // Build what is needed for UUID Mockito.when(notifData.getServiceInvariantUUID()).thenReturn(SERVICE_UUID); // Build fake resource with one artifact BLUEPRINT - List resourcesList = new ArrayList<>(); - List artifactsListForResource = new ArrayList<>(); IResourceInstance resource1 = Mockito.mock(IResourceInstance.class); Mockito.when(resource1.getResourceType()).thenReturn("VF"); Mockito.when(resource1.getResourceInvariantUUID()).thenReturn(RESOURCE1_UUID); @@ -99,8 +97,10 @@ public class CsarHandlerTest { IArtifactInfo blueprintArtifact = Mockito.mock(IArtifactInfo.class); Mockito.when(blueprintArtifact.getArtifactType()).thenReturn(CsarHandler.BLUEPRINT_TYPE); Mockito.when(blueprintArtifact.getArtifactName()).thenReturn(BLUEPRINT1_NAME); + List artifactsListForResource = new ArrayList<>(); artifactsListForResource.add(blueprintArtifact); Mockito.when(resource1.getArtifacts()).thenReturn(artifactsListForResource); + List resourcesList = new ArrayList<>(); resourcesList.add(resource1); Mockito.when(notifData.getResources()).thenReturn(resourcesList); return notifData; -- cgit 1.2.3-korg