diff options
Diffstat (limited to 'test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/data/providers/OnboardingDataProviders.java')
-rw-r--r-- | test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/data/providers/OnboardingDataProviders.java | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/data/providers/OnboardingDataProviders.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/data/providers/OnboardingDataProviders.java index cc33e48530..a2f39b3f0e 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/data/providers/OnboardingDataProviders.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/data/providers/OnboardingDataProviders.java @@ -22,8 +22,10 @@ package org.openecomp.sdc.ci.tests.data.providers; import static org.testng.Assert.fail; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.List; +import java.util.Optional; import org.apache.commons.collections4.CollectionUtils; import org.openecomp.sdc.ci.tests.datatypes.enums.XnfTypeEnum; import org.openecomp.sdc.ci.tests.utils.general.FileHandling; @@ -32,7 +34,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.testng.annotations.DataProvider; -public class OnboardingDataProviders { +public final class OnboardingDataProviders { private static final Logger LOGGER = LoggerFactory.getLogger(OnboardingDataProviders.class); private static final String VNF_FILE_PATH = FileHandling.getXnfRepositoryPath(XnfTypeEnum.VNF); @@ -76,6 +78,27 @@ public class OnboardingDataProviders { return provideData(newList, VNF_FILE_PATH); } + @DataProvider(name = "softwareInformationPnf", parallel = true) + private static Object[][] softwareInformationPnf() { + final List<String> pnfPackageFileNameList = OnboardingUtils.getXnfNamesFileList(XnfTypeEnum.PNF); + if (CollectionUtils.isEmpty(pnfPackageFileNameList)) { + fail("Could not create softwareInformationPnf datasource"); + } + final String pnfPackage = "sample-pnf-1.0.1-SNAPSHOT.csar"; + final Optional<String> softwareInformationPnfPackage = pnfPackageFileNameList.stream() + .filter(pnfPackage::equals).findFirst(); + if (!softwareInformationPnfPackage.isPresent()) { + fail(String.format("Could not create softwareInformationPnf datasource, the package '%s' was not found", + pnfPackage)); + } + + final String folderPath = FileHandling.getXnfRepositoryPath(XnfTypeEnum.PNF); + final Object[][] parametersArray = new Object[1][]; + parametersArray[0] = new Object[]{folderPath, softwareInformationPnfPackage.get(), + Arrays.asList("5gDUv18.05.201", "5gDUv18.06.205")}; + return parametersArray; + } + private static Object[][] provideData(final List<String> fileNamesFromFolder, final String folderPath) { final Object[][] parametersArray = new Object[fileNamesFromFolder.size()][]; int index = 0; |