diff options
Diffstat (limited to 'test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity')
3 files changed, 22 insertions, 53 deletions
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/CrudE2E.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/CrudE2E.java index b676b29bda..f3d48bfeff 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/CrudE2E.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/CrudE2E.java @@ -20,42 +20,26 @@ package org.openecomp.sdc.ci.tests.sanity; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; -import java.util.stream.Collectors; - +import fj.data.Either; import org.apache.commons.lang3.tuple.Pair; import org.junit.Rule; import org.junit.rules.TestName; -import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; -import org.openecomp.sdc.be.model.ArtifactDefinition; -import org.openecomp.sdc.be.model.Component; -import org.openecomp.sdc.be.model.ComponentInstance; -import org.openecomp.sdc.be.model.ComponentInstanceProperty; -import org.openecomp.sdc.be.model.Resource; -import org.openecomp.sdc.be.model.Service; -import org.openecomp.sdc.be.model.User; +import org.openecomp.sdc.be.model.*; import org.openecomp.sdc.ci.tests.api.ComponentBaseTest; -import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum; -import org.openecomp.sdc.ci.tests.datatypes.enums.AssocType; -import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum; -import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum; -import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum; -import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum; +import org.openecomp.sdc.ci.tests.datatypes.enums.*; import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils; import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; -import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils; -import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.testng.Assert; import org.testng.annotations.Test; -import fj.data.Either; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.stream.Collectors; public class CrudE2E extends ComponentBaseTest { private static Logger log = LoggerFactory.getLogger(CrudE2E.class.getName()); @@ -196,10 +180,10 @@ public class CrudE2E extends ComponentBaseTest { //////// certify VF1 - failed due to uncertified CP instance //////// - RestResponse changeVfStateFailed = LifecycleRestUtils.changeComponentState(resourceDetailsVF_01, designer, LifeCycleStatesEnum.CERTIFICATIONREQUEST); + /*RestResponse changeVfStateFailed = LifecycleRestUtils.changeComponentState(resourceDetailsVF_01, designer, LifeCycleStatesEnum.CERTIFICATIONREQUEST); Resource resResourceDetailsVF_01 = (Resource) resourceDetailsVF_01; variablesAsList = Arrays.asList(resResourceDetailsVF_01.getResourceType().toString(), resourceDetailsCP_01.getName()); - ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.VALIDATED_RESOURCE_NOT_FOUND.name(), variablesAsList, changeVfStateFailed.getResponse()); + ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.VALIDATED_RESOURCE_NOT_FOUND.name(), variablesAsList, changeVfStateFailed.getResponse());*/ //////// certify resources CP1 //////// resourceDetailsCP_01 = AtomicOperationUtils.changeComponentState(resourceDetailsCP_01, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft(); @@ -226,10 +210,10 @@ public class CrudE2E extends ComponentBaseTest { //////// certify service1 - failed due to uncertified instances //////// designer = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER); - RestResponse changeServicetStateFailed = LifecycleRestUtils.changeComponentState(defaultService1, designer, LifeCycleStatesEnum.CERTIFICATIONREQUEST); + /*RestResponse changeServicetStateFailed = LifecycleRestUtils.changeComponentState(defaultService1, designer, LifeCycleStatesEnum.CERTIFICATIONREQUEST); variablesAsList = Arrays.asList(defaultService1.getComponentType().toString().toLowerCase(), resourceDetailsVF_01.getName()); ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.VALIDATED_RESOURCE_NOT_FOUND.name(), variablesAsList, changeServicetStateFailed.getResponse()); - +*/ ////// change VF1 state to CERTIFIED resourceDetailsVF_01 = AtomicOperationUtils.changeComponentState(resourceDetailsVF_01, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft(); diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/MultipleResourceUpdate.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/MultipleResourceUpdate.java index 33cf6cbb98..e6e96ccba8 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/MultipleResourceUpdate.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/MultipleResourceUpdate.java @@ -20,11 +20,6 @@ package org.openecomp.sdc.ci.tests.sanity; -import static org.testng.AssertJUnit.assertTrue; - -import java.util.ArrayList; -import java.util.List; - import org.junit.Rule; import org.junit.rules.TestName; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; @@ -32,11 +27,7 @@ import org.openecomp.sdc.be.model.ComponentInstance; import org.openecomp.sdc.be.model.Resource; import org.openecomp.sdc.ci.tests.api.ComponentBaseTest; import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails; -import org.openecomp.sdc.ci.tests.datatypes.enums.AssocType; -import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum; -import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum; -import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum; -import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum; +import org.openecomp.sdc.ci.tests.datatypes.enums.*; import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils; import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; @@ -44,6 +35,11 @@ import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ProductRestUtils; import org.testng.annotations.Test; +import java.util.ArrayList; +import java.util.List; + +import static org.testng.AssertJUnit.assertTrue; + public class MultipleResourceUpdate extends ComponentBaseTest { @Rule diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/Onboard.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/Onboard.java index a64c3771c3..99bfad6bbd 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/Onboard.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/Onboard.java @@ -21,9 +21,8 @@ package org.openecomp.sdc.ci.tests.sanity; - - - +import com.aventstack.extentreports.Status; +import fj.data.Either; import org.junit.Rule; import org.junit.rules.TestName; import org.openecomp.sdc.be.model.ComponentInstance; @@ -42,16 +41,7 @@ import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils; import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; import org.openecomp.sdc.ci.tests.utils.general.OnboardingUtillViaApis; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Optional; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import com.aventstack.extentreports.Status; -import com.clearspring.analytics.util.Pair; - -import fj.data.Either; +import org.testng.annotations.*; @@ -108,9 +98,8 @@ public class Onboard extends ComponentBaseTest { ExtentTestActions.log(Status.INFO, String.format("Going to onboard the VNF %s", vnfFile)); User user = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER); ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); - Pair<String, VendorSoftwareProductObject> createVendorSoftwareProduct = OnboardingUtillViaApis.createVspViaApis(resourceReqDetails, filePath, vnfFile, user); - VendorSoftwareProductObject vendorSoftwareProductObject = createVendorSoftwareProduct.right; - vendorSoftwareProductObject.setName(createVendorSoftwareProduct.left); + VendorSoftwareProductObject vendorSoftwareProductObject = OnboardingUtillViaApis.createVspViaApis(resourceReqDetails, filePath, vnfFile, user); +// vendorSoftwareProductObject.setName(vendorSoftwareProductObject.getName()); // create VF base on VNF imported from previous step - have, resourceReqDetails object include part of resource metadata // ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); |