From 396cb378ab8940b1adb8ba1adc656d0b4ad66f99 Mon Sep 17 00:00:00 2001 From: Divesh Mirchandani Date: Thu, 14 Sep 2017 19:14:21 +0530 Subject: Fixed SONAR issues Fixed blocker, critical, major & minor SONAR issues. Issue-ID: SDC-343 Change-Id: I72e5a3a7fa7d7407a92f98f77e4334827f70f926 Signed-off-by: dd4616 --- .../dao/ServiceModelDaoFactoryTest.java | 9 ++++++--- .../impl/TxtInformationArtifactGeneratorImplTest.java | 13 +++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test') diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ServiceModelDaoFactoryTest.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ServiceModelDaoFactoryTest.java index fe42f6ccd3..39c14e64fd 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ServiceModelDaoFactoryTest.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ServiceModelDaoFactoryTest.java @@ -122,12 +122,15 @@ public class ServiceModelDaoFactoryTest { Assert.assertTrue(model instanceof ToscaServiceModel); if (model instanceof ToscaServiceModel) { - artifact001 = - (String) ((ToscaServiceModel) model).getArtifactFiles().getFileList().toArray()[0]; + setArtifact((ToscaServiceModel) model); } } - + private static void setArtifact(ToscaServiceModel model) + { + artifact001 = + (String) (model).getArtifactFiles().getFileList().toArray()[0]; + } private ToscaServiceModel getToscaServiceModel() { Map serviceTemplates = getServiceTemplates(baseServiceTemplateName); diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/informationArtifact/impl/TxtInformationArtifactGeneratorImplTest.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/informationArtifact/impl/TxtInformationArtifactGeneratorImplTest.java index ab36e8e5a1..9f2f733a64 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/informationArtifact/impl/TxtInformationArtifactGeneratorImplTest.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/informationArtifact/impl/TxtInformationArtifactGeneratorImplTest.java @@ -21,6 +21,11 @@ package org.openecomp.sdc.vendorsoftwareproduct.informationArtifact.impl; +import static org.mockito.Matchers.anyObject; +import static org.mockito.Matchers.anyString; +import static org.openecomp.sdc.vendorsoftwareproduct.informationArtifact.impl.TxtInformationArtifactConstants.HEADER; +import static org.openecomp.sdc.vendorsoftwareproduct.informationArtifact.impl.TxtInformationArtifactConstants.VFC_COMPUTE_CPU_OVER_SUBSCRIPTION; + import org.junit.Assert; import org.mockito.InjectMocks; import org.mockito.Mock; @@ -36,8 +41,6 @@ import org.openecomp.sdc.vendorsoftwareproduct.types.questionnaire.component.com import org.openecomp.sdc.vendorsoftwareproduct.types.questionnaire.component.general.Hypervisor; import org.openecomp.sdc.vendorsoftwareproduct.types.questionnaire.component.general.Recovery; import org.openecomp.sdc.vendorsoftwareproduct.types.questionnaire.component.network.NetworkCapacity; -import org.openecomp.sdc.vendorsoftwareproduct.types.questionnaire.component.storage.Backup; -import org.openecomp.sdc.vendorsoftwareproduct.types.questionnaire.component.storage.Storage; import org.openecomp.sdc.vendorsoftwareproduct.types.questionnaire.nic.IpConfiguration; import org.openecomp.sdc.vendorsoftwareproduct.types.questionnaire.nic.Network; import org.openecomp.sdc.vendorsoftwareproduct.types.questionnaire.nic.NicQuestionnaire; @@ -50,16 +53,10 @@ import org.openecomp.sdc.versioning.dao.types.Version; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; -import javax.annotation.processing.SupportedAnnotationTypes; import java.io.IOException; import java.util.ArrayList; import java.util.List; -import static org.mockito.Matchers.anyObject; -import static org.mockito.Matchers.anyString; -import static org.openecomp.sdc.vendorsoftwareproduct.informationArtifact.impl.TxtInformationArtifactConstants.HEADER; -import static org.openecomp.sdc.vendorsoftwareproduct.informationArtifact.impl.TxtInformationArtifactConstants.VFC_COMPUTE_CPU_OVER_SUBSCRIPTION; - public class TxtInformationArtifactGeneratorImplTest { private static final String NETWORK_DESC = "\"network desc\""; -- cgit 1.2.3-korg