aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulienBe <julien.bertozzi@intl.att.com>2020-09-03 17:09:46 +0200
committerXue Gao <xg353y@intl.att.com>2020-09-07 12:18:23 +0000
commit61663b92910868a4de51c6fe9a7cef7da96da7e9 (patch)
tree86085699100a83f9de49375b635596601b55502d
parentbcee4648917b2442f51a75639708bad4cd0fe4ad (diff)
Optimize Build
Optimize the log output Issue-ID: SDC-3232 Signed-off-by: JulienBe <julien.bertozzi@intl.att.com> Change-Id: I50cfb7119b1e9087d3e2db56a81fe47df4ad6254
-rw-r--r--integration-tests/pom.xml6
-rw-r--r--integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/utils/rest/ResponseParser.java1123
-rw-r--r--integration-tests/src/test/resources/ci/conf/log4j2.properties46
-rw-r--r--integration-tests/src/test/resources/ci/conf/log4j2.xml13
-rw-r--r--integration-tests/src/test/resources/ci/testSuites/backend/CRUDArtifacts.xml2
-rw-r--r--integration-tests/src/test/resources/ci/testSuites/backend/ExternalApiSanity.xml2
-rw-r--r--integration-tests/src/test/resources/ci/testSuites/backend/SearchExternalAPI.xml2
-rw-r--r--integration-tests/src/test/resources/ci/testSuites/backend/ciFull.xml2
-rw-r--r--integration-tests/src/test/resources/ci/testSuites/backend/externalAPIs.xml2
-rw-r--r--integration-tests/src/test/resources/ci/testSuites/backend/onapApiSanity.xml2
-rw-r--r--integration-tests/src/test/resources/ci/testSuites/backend/pass.xml2
-rw-r--r--integration-tests/src/test/resources/ci/testSuites/backend/productAPIs.xml2
-rw-r--r--integration-tests/src/test/resources/ci/testSuites/backend/resource.xml2
-rw-r--r--integration-tests/src/test/resources/ci/testSuites/backend/sanity.xml2
-rw-r--r--integration-tests/src/test/resources/logback.xml44
-rw-r--r--test-apis-ci/.gitignore4
-rw-r--r--test-apis-ci/pom.xml668
-rw-r--r--test-apis-ci/sdc-api-tests/Dockerfile28
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/attributes/default.rb1
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/PNFs/pmDictionary.yml98
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/PNFs/sample-pnf-1.0.1-SNAPSHOT.csarbin24623 -> 0 bytes
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/PNFs/sample-pnf-custom-type.csarbin24874 -> 0 bytes
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/PNFs/sample-signed-pnf-1.0.1-SNAPSHOT.zipbin23905 -> 0 bytes
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/PNFs/sample-signed-pnf-cms-includes-cert-1.0.1-SNAPSHOT.zipbin23568 -> 0 bytes
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/Huawei_vHSS.csarbin3153 -> 0 bytes
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/Huawei_vMME.csarbin2580 -> 0 bytes
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/ZteEpcMmeVf.csarbin4806 -> 0 bytes
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/base_vfw.zipbin3522 -> 0 bytes
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/base_vvg.zipbin944 -> 0 bytes
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/database-substitution-mappings.csarbin1923 -> 0 bytes
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/infra.zipbin4155 -> 0 bytes
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/resource-ZteEpcMmeVf-csar_fix.csarbin4806 -> 0 bytes
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vLB.zipbin6789 -> 0 bytes
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vLBMS.zipbin7218 -> 0 bytes
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vSBC_update_v03.csarbin3369 -> 0 bytes
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vbng.zipbin3704 -> 0 bytes
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vbrgemu.zipbin3325 -> 0 bytes
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vesEvent.yml282
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vfw.zipbin3522 -> 0 bytes
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vgmux.zipbin3536 -> 0 bytes
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vgw.zipbin3469 -> 0 bytes
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vsp-vgw.csarbin3153 -> 0 bytes
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vvg.zipbin944 -> 0 bytes
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/cert/root.cert23
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/conf/attsdc-packages.yaml12
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/conf/credentials.yaml48
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/conf/log4j2.properties49
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/conf/logback.xml25
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/org.onap.sdc.trust.jksbin1413 -> 0 bytes
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/startTest.sh157
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/recipes/sanityApiTests_1_setup_env.rb64
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/recipes/sanityApiTests_2_setup_configuration.rb53
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/recipes/sanityApiTests_3_sanity_execution.rb19
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/templates/default/BE-janusgraph.properties.erb24
-rw-r--r--test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/templates/default/sdc-sanity.yaml.erb98
-rw-r--r--test-apis-ci/sdc-api-tests/chef-solo/LICENSE201
-rw-r--r--test-apis-ci/sdc-api-tests/chef-solo/README.md37
-rw-r--r--test-apis-ci/sdc-api-tests/chef-solo/chefignore11
-rw-r--r--test-apis-ci/sdc-api-tests/chef-solo/cookbooks/README.md54
-rw-r--r--test-apis-ci/sdc-api-tests/chef-solo/data_bags/README.md63
-rw-r--r--test-apis-ci/sdc-api-tests/chef-solo/environments/README.md5
-rw-r--r--test-apis-ci/sdc-api-tests/chef-solo/roles/README.md16
-rw-r--r--test-apis-ci/sdc-api-tests/chef-solo/roles/sanityApiTests.json20
-rw-r--r--test-apis-ci/sdc-api-tests/chef-solo/solo.json6
-rw-r--r--test-apis-ci/sdc-api-tests/chef-solo/solo.rb16
-rw-r--r--test-apis-ci/sdc-api-tests/startup.sh36
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/AttSdcTest.java195
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentBaseTest.java285
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentInstanceBaseTest.java732
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ExtentManager.java161
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ExtentTestActions.java112
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ExtentTestManager.java65
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/SomeInterface.java29
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/Urls.java429
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/capability/CapabilitiesTest.java362
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/config/Config.java736
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/config/InvokedMethodListener.java63
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/config/MainToTest.java81
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/config/UserCredentialsFromFile.java75
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/data/providers/OnboardingDataProviders.java132
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ArtifactAssetStructure.java134
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ArtifactReqDetails.java242
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/AssetStructure.java122
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CapabilityDetails.java69
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ComponentInstanceReqDetails.java149
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ComponentReqDetails.java272
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CsarArtifacts.java59
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/DistributionMonitorObject.java89
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/GroupHeatMetaDefinition.java96
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/HeatMetaFirstLevelDefinition.java75
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ImportReqDetails.java334
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/LicensingData.java59
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/LicensingVersion.java51
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ProductReqDetails.java88
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PropertyHeatMetaDefinition.java63
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PropertyObject.java110
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PropertyReqDetails.java179
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/RequirementDetails.java74
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceAssetStructure.java76
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceDetailedAssetStructure.java71
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceExternalReqDetails.java104
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceInstanceAssetStructure.java116
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceReqDetails.java245
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceRespJavaObject.java368
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceAssetStructure.java49
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceDetailedAssetStructure.java78
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceDistributionStatus.java79
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceFilterDetails.java80
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceReqDetails.java145
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceRespJavaObject.java266
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/TypeHeatMetaDefinition.java57
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/UserCredentials.java58
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/VendorLicenseModel.java58
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/VendorSoftwareProductObject.java88
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/VendorSoftwareProductObjectReqDetails.java178
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ArtifactTypeEnum.java57
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/AssocType.java39
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/AuditEnum.java39
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/AuditJsonKeysEnum.java40
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/CircleSize.java27
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ComponentType.java37
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/CvfcTypeEnum.java39
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/DistributionNotificationStatusEnum.java52
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ErrorInfo.java92
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/EsIndexTypeIdToDelete.java64
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ExceptionEnumType.java36
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/GroupPropertyEnum.java66
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ImportTestTypesEnum.java95
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/LifeCycleStatesEnum.java75
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/MandatoryResourceArtifactTypeEnum.java49
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/MandatoryServiceArtifactTypeEnum.java66
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/NormativeTypesEnum.java45
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/OriginTypeEnum.java74
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/PropertyTypeEnum.java126
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ResourceCategoryEnum.java161
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/RespJsonKeysEnum.java40
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/SearchCriteriaEnum.java38
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ServiceApiArtifactEnum.java35
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ServiceCategoriesEnum.java44
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ServiceInstantiationType.java35
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ToscaKeysEnum.java51
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/UserRoleEnum.java64
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/XnfTypeEnum.java37
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedArtifactAudit.java166
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedAuthenticationAudit.java90
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedCategoryAudit.java151
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedDistDownloadAudit.java79
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedEcomConsumerAudit.java88
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedExternalAudit.java178
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedGetUserListAudit.java88
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedGroupingAudit.java121
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedProductAudit.java142
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedResourceAuditJavaObject.java310
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedUserCRUDAudit.java98
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/HeaderData.java114
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/HeaderValue.java38
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/HttpHeaderEnum.java58
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/HttpRequest.java524
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/MustHeaders.java53
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/RestResponse.java84
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/TODO/ImportCapabilityTypeCITest.java134
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/DownloadComponentArt.java647
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/HeatEnvArtifact.java185
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/PlaceHolderValidations.java673
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/ValidateHeatArtFieldsTypes.java176
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/attribute/ComponentInstanceAttributeTest.java93
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/category/CatalogDataApiTest.java231
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/category/CategoriesBaseTest.java49
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/category/GroupingTest.java1994
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/category/SubCategoriesTest.java1898
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/AndreyTest.java153
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ArtifactFromCsar.java291
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ImportCsarValidateArtifacts.java103
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ToscaGroupInsideVF.java550
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/test1.java89
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/distribution/AuthanticationTests.java186
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/distribution/DistributionDownloadArtifactTest.java529
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/externalapi/DownloadArtifactsTest.java360
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/general/FeProxyTest.java53
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/general/UuidTest.java104
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/globaltypes/InterfaceLifecycleTypesTest.java65
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/groups/GroupsTest.java184
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/CsarUtilsTest.java451
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ExportToscaTest.java430
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportGenericResourceCITest.java586
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportToscaCapabilitiesWithProperties.java411
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/inputs/InputsApiTests.java361
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/interfaceoperation/InterfaceOperationsTest.java401
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/lifecycle/LCSbaseTest.java263
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductBaseTest.java199
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductCheckinTest.java199
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductCheckoutTest.java146
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductCreateWithValidationsTest.java1717
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductGetFollowedTest.java164
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductLifecycleTest.java55
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductTestBase.java135
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductToscaYamlGenerationTest.java82
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductUndoCheckoutTest.java216
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/property/AdditionalInformationServletTest.java2009
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/property/ComponentInstancePropertyTest.java1258
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/property/PropertyApisTest.java367
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/CheckGetResource.java51
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/CreateResourceApiTest.java2194
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/GetAllResourceVersions.java580
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/ResourceApiTest.java368
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/SampleDataProvider.java41
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/SimultaneousApiTest.java124
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/UpdateResourceMetadataTest.java2635
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/VFResourceInstanceNameCRUD.java473
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/ValidateExtendedVfData.java309
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/GetAllServiceVersions.java350
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/GetComponentAuditApiTest.java362
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/user/ActivateDeActivateDeleteUser.java740
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/executeOnUGN/distributionClient/ClientConfiguration.java141
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/preRequisites/ComplexResourceBaseTest.java170
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/preRequisites/DownloadArtifactBaseTest.java121
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/preRequisites/SimpleOneRsrcOneServiceTest.java96
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/requirements/RequirementsTest.java118
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/rules/MyTestWatcher.java82
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/run/StartTest.java278
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/run/StartTest2backup.java411
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/CrudE2E.java271
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/MultipleResourceUpdate.java126
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/Onboard.java130
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/servicefilter/ServiceFilterTests.java143
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ParametersDefinition.java102
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaAnnotationsTypesDefinition.java49
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaCapabilitiesNodeTemplatesDefinition.java25
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaDefinition.java113
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaGroupPropertyDefinition.java170
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaGroupsTopologyTemplateDefinition.java177
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaImportsDefinition.java94
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaInputsAnnotation.java71
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaInputsTopologyTemplateDefinition.java270
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaMetadataDefinition.java196
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaNodeTemplatesTopologyTemplateDefinition.java175
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaNodeTypesDefinition.java142
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaOutputsTopologyTemplateDefinition.java48
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaParameterConstants.java32
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaPoliciesTopologyTemplateDefinition.java67
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaRelationshipTemplatesTopologyTemplateDefinition.java78
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaRequirementsNodeTemplatesDefinition.java72
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaServiceGroupsMetadataDefinition.java106
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaSubstitutionMappingsDefinition.java71
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaTopologyTemplateDefinition.java119
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaTopologyTemplateDefinition2.java77
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaTypeDefinition.java46
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaTypesDefinition.java46
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/VfModuleDefinition.java57
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/model/ToscaMetadataFieldsPresentationEnum.java95
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/AddUserAuditMessageInfo.java113
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/UserAuditJavaObject.java133
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/UserHeaderData.java59
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/UserResponseMessageEnum.java39
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/WebSealUserDetails.java74
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/ArtifactUtils.java43
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/CsarParserUtils.java201
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/CsarToscaTester.java109
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/DbUtils.java278
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/Decoder.java62
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/DistributionUtils.java259
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/ReqCap.java609
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/ToscaParserUtils.java227
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/ToscaTypesDefinitionUtils.java74
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/Utils.java751
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/cassandra/CassandraUtils.java239
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/cassandra/CassandraUtils2.java166
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/AtomicOperationUtils.java1058
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/Convertor.java337
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/ElementFactory.java1051
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/FileHandling.java488
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/FileUtils.java135
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/ImportUtils.java57
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/OnboardingUtillViaApis.java167
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/OnboardingUtils.java241
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/SnmpTypeEnum.java38
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/VendorLicenseModelRestUtils.java309
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/VendorSoftwareProductRestUtils.java744
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ArtifactRestUtils.java918
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/AssetRestUtils.java621
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/AutomationUtils.java118
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/BaseRestUtils.java268
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/CapabilityRestUtils.java77
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/CatalogRestUtils.java92
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/CategoryRestUtils.java308
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ComponentInstanceRestUtils.java282
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ComponentRestUtils.java62
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ConsumerRestUtils.java246
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/EcompUserRestUtils.java250
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/GroupRestUtils.java59
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ImportRestUtils.java392
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/InputsRestUtils.java148
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/InterfaceOperationsRestUtils.java79
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/LifecycleRestUtils.java440
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ProductRestUtils.java195
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/PropertyRestUtils.java383
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/RequirementsUtils.java75
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtils.java668
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtilsExternalAPI.java62
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResponseParser.java698
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ServiceFilterUtils.java73
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ServiceRestUtils.java301
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/UserRestUtils.java298
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ArtifactValidationUtils.java219
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/AuditValidationUtils.java1005
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/BaseValidationUtils.java116
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/CategoryValidationUtils.java124
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/CsarValidationUtils.java444
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/DistributionValidationUtils.java86
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ErrorValidationUtils.java120
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ProductValidationUtils.java238
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ResourceValidationUtils.java351
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ServiceValidationUtils.java131
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/UserValidationUtils.java274
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/AssetLifeCycle.java740
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/CRUDExternalAPI.java2442
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/DeploymentValiditaion.java322
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/GetAssetServlet.java290
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/GetCSARofVF.java235
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/GetFilteredAssetServlet.java587
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/GetSpecificAssetMetadataServlet.java405
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/SearchFilterCategoryExternalAPI.java325
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/UserAPIs.java551
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/VFCMTExternalAPI.java380
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/internalApis/annotations/AnnotationsTest.java221
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/post/Install.java70
-rw-r--r--test-apis-ci/src/main/resources/ci/conf/attsdc-packages.yaml12
-rw-r--r--test-apis-ci/src/main/resources/ci/conf/attsdc.yaml101
-rw-r--r--test-apis-ci/src/main/resources/ci/conf/credentials.yaml48
-rw-r--r--test-apis-ci/src/main/resources/ci/conf/extent-config.xml50
-rw-r--r--test-apis-ci/src/main/resources/ci/conf/janusgraph.properties11
-rw-r--r--test-apis-ci/src/main/resources/ci/conf/log4j2.properties46
-rw-r--r--test-apis-ci/src/main/resources/ci/conf/log4j2.xml13
-rw-r--r--test-apis-ci/src/main/resources/ci/conf/testngLifeCycle.xml9
-rw-r--r--test-apis-ci/src/main/resources/ci/conf/truststorebin971 -> 0 bytes
-rw-r--r--test-apis-ci/src/main/resources/ci/scripts/addUsersFromList_new.sh80
-rw-r--r--test-apis-ci/src/main/resources/ci/scripts/copyToStorage.sh71
-rw-r--r--test-apis-ci/src/main/resources/ci/scripts/sendMail.sh46
-rw-r--r--test-apis-ci/src/main/resources/ci/scripts/startTest.sh153
-rw-r--r--test-apis-ci/src/main/resources/ci/testSuites/CRUDArtifacts.xml42
-rw-r--r--test-apis-ci/src/main/resources/ci/testSuites/ExternalApiSanity.xml68
-rw-r--r--test-apis-ci/src/main/resources/ci/testSuites/SearchExternalAPI.xml23
-rw-r--r--test-apis-ci/src/main/resources/ci/testSuites/artifacts.xml11
-rw-r--r--test-apis-ci/src/main/resources/ci/testSuites/cap_req.xml10
-rw-r--r--test-apis-ci/src/main/resources/ci/testSuites/category.xml10
-rw-r--r--test-apis-ci/src/main/resources/ci/testSuites/ciFull.xml117
-rw-r--r--test-apis-ci/src/main/resources/ci/testSuites/externalAPIs.xml33
-rw-r--r--test-apis-ci/src/main/resources/ci/testSuites/general.xml9
-rw-r--r--test-apis-ci/src/main/resources/ci/testSuites/imports.xml9
-rw-r--r--test-apis-ci/src/main/resources/ci/testSuites/normatives.xml25
-rw-r--r--test-apis-ci/src/main/resources/ci/testSuites/onapApiSanity.xml11
-rw-r--r--test-apis-ci/src/main/resources/ci/testSuites/pass.xml18
-rw-r--r--test-apis-ci/src/main/resources/ci/testSuites/product.xml12
-rw-r--r--test-apis-ci/src/main/resources/ci/testSuites/productAPIs.xml15
-rw-r--r--test-apis-ci/src/main/resources/ci/testSuites/property.xml11
-rw-r--r--test-apis-ci/src/main/resources/ci/testSuites/resource.xml123
-rw-r--r--test-apis-ci/src/main/resources/ci/testSuites/sanity.xml228
-rw-r--r--test-apis-ci/src/main/resources/ci/testSuites/service.xml19
-rw-r--r--test-apis-ci/src/main/resources/ci/testSuites/testngLifeCycle.xml9
-rw-r--r--test-apis-ci/src/main/resources/ci/testSuites/user.xml9
-rw-r--r--test-apis-ci/src/main/resources/log4j2.properties36
-rw-r--r--test-apis-ci/src/main/resources/log4j2.xml13
-rw-r--r--test-apis-ci/src/main/resources/logback.xml25
-rw-r--r--test-apis-ci/src/test/java/org/openecomp/sdc/conf/TestAPIConfDependentTest.java33
-rw-r--r--test-apis-ci/src/test/java/org/openecomp/sdc/cucumber/runners/RunTenantIsolationCucumberCI.java50
-rw-r--r--test-apis-ci/src/test/java/org/openecomp/sdc/cucumber/spring/ImportTableConfig.java39
-rw-r--r--test-apis-ci/src/test/java/org/openecomp/sdc/cucumber/steps/PrecannedTestExpectationCallback.java50
-rw-r--r--test-apis-ci/src/test/java/org/openecomp/sdc/cucumber/steps/StepsTenantIsolationCI.java606
-rw-r--r--test-apis-ci/src/test/java/org/openecomp/sdc/cucumber/utils/RunnerSession.java81
-rw-r--r--test-apis-ci/src/test/resources/CI/csars/VLANTaggingFromAmdox1303_2018.csarbin46918 -> 0 bytes
-rw-r--r--test-apis-ci/src/test/resources/CI/csars/incorrect_cap.csarbin65844 -> 0 bytes
-rw-r--r--test-apis-ci/src/test/resources/CI/csars/with_groups.csarbin65843 -> 0 bytes
-rw-r--r--test-apis-ci/src/test/resources/CI/csars/with_groups_update.csarbin65842 -> 0 bytes
-rw-r--r--test-apis-ci/src/test/resources/CI/csars/without_caps.csarbin65791 -> 0 bytes
-rw-r--r--test-apis-ci/src/test/resources/CI/ecomp-error-configuration.yaml383
-rw-r--r--test-apis-ci/src/test/resources/CI/error-configuration.yaml1784
-rw-r--r--test-apis-ci/src/test/resources/CI/importTypesTest/categoryTypesTest.yml23
-rw-r--r--test-apis-ci/src/test/resources/CI/importTypesTest/categoryTypesTest.zipbin333 -> 0 bytes
-rw-r--r--test-apis-ci/src/test/resources/CI/importTypesTest/myHeatStack1/myHeatStack1.yml13
-rw-r--r--test-apis-ci/src/test/resources/CI/importTypesTest/myHeatStack1/myHeatStack1.zipbin400 -> 0 bytes
-rw-r--r--test-apis-ci/src/test/resources/CI/importTypesTest/myHeatStack2/myHeatStack2.yml14
-rw-r--r--test-apis-ci/src/test/resources/CI/importTypesTest/myHeatStack2/myHeatStack2.zipbin423 -> 0 bytes
-rw-r--r--test-apis-ci/src/test/resources/CI/other/mapping.json182
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/addYangXmlArtifactToResource.xml32
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/asc_heat 0 2.yaml787
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/asc_heat 0 2.zipbin2420 -> 0 bytes
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/asc_heat_net 0 2.yaml787
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/heatEnvfile.env787
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/heatInvalidFormat.yaml9
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/heat_mini.yaml13
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/invalidJson.json11
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/invalidYamlFormat.yaml787
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/invalidYangXml.xml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/jsonArtifact.json22
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/other.txt3
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/bluePrintSampleArtifact.xml3
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/docSampleArtifact.docxbin11307 -> 0 bytes
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/emfSampleArtifact.emf2
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/emfSampleArtifact.xml3
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/eventSampleArtifact.xml3
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/jsonSampleArtifact.json3
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/toscaSampleArtifact.yml5
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/addHeatArtifactToServiceAndSertify/asc_heat 0 2.yaml787
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/downloadResourceArtifactSuccess/org.openstack.Rally.zipbin11590 -> 0 bytes
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/heatArtifactParameters/heatWithParamsMissingDefault.yaml603
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/heatArtifactParameters/heatWithParamsMissingDesc.yaml603
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/heatArtifactParameters/heatWithParamsMissingType.yaml603
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/heatArtifactParameters/heatWithValidParams.yaml787
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/heatEnv/artifact_1.yaml144
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/heatEnv/artifact_2.yaml469
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/heatEnv/yuli.yaml144
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/BindingAsset.yml14
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CPHasNoReqCap.yml9
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CPHasNoReqCap_DerivedFromMyCompute1.yml9
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CPWithAttributes.yml56
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CaseInsensitiveCapTest_1.yml34
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CaseInsensitiveCapTest_2.yml34
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CaseInsensitiveReqTest_1.yml34
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CaseInsensitiveReqTest_2.yml34
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DerivedFromCPWithOwnReq.yml14
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DerivedFromWebApplication_HasNoReqType.yml27
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentCapFromRoot.yml26
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentReqAndCap.yml34
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentReqCapFromCompute1.yml22
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentReqCapFromCompute2.yml25
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentReqFromCompute.yml32
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/FatherHasNoReqCap.yml9
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure01.yml17
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure02.yml17
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure03.yml17
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure04.yml17
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure05.yml17
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure06.yml17
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure07.yml17
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure08.yml17
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure09.yml17
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure10.yml17
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure11.yml17
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure12.yml17
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure13.yml17
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure14.yml18
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure15.yml19
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure16.yml17
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure01.yml17
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure02.yml17
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure03.yml17
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure04.yml17
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure05.yml17
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure06.yml17
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure07.yml17
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure08.yml17
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure09.yml17
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure10.yml17
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure11.yml17
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure12.yml17
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure13.yml17
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure14.yml18
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure15.yml19
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure16.yml17
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MyFatherCompute_NoReqCap.yml17
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/SameCapAsCompute.yml26
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/SameReqAsCompute.yml23
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/SameReqAsCompute_DerivedFromMyCompute1.yml23
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/computeCap11.yml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/computeCap1UNBOUNDED.yml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/derivedFromMyCompute.yml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/derivedFromWebAppDerivedReqCap.yml15
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importAttributeSuccessFlow.yml53
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importCapabilityNameExistsOnParent.yml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importDuplicateCapability.yml42
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importDuplicateRequirements.yml40
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importListPropertyBadDefault.yml17
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importListPropertyGoodDefault.yml17
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importListPropertySuccessFlow.yml198
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importMapPropertySuccessFlow.yml452
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importRequirementNameExistsOnParent.yml34
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importRequirementNameExistsOnParent_DerivedFromMyCompute1.yml34
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/missingCapInCapDefinition.yml37
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/missingCapInReqDefinition.yml25
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myChildCompute_NoReqCap.yml17
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myChildWebApp_DerivedFromContainer.yml15
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myCompute.yml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeDerivedFromNotExists.yml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeIncorrectDefenitionVersionValue.yml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeIncorrectNameSpaceFormat.yml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeNoDefenitionVersion.yml34
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeOccurencySuccess.yml77
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeParssingFalure.yml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeReqNameExistsOnDerived.yml34
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeVF.yml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeWithNodeTypesTwice.yml42
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeWithTopologyTemplate.yml44
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myFatherWebApp_derviedFromDocker.yml16
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myLinkVL.yml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myPortCP.yml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/noContent.yml0
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure01.yml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure02.yml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure03.yml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure04.yml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure05.yml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure06.yml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure07.yml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure08.yml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure09.yml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure10.yml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure11.yml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure31.yml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure32.yml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure33.yml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure34.yml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure35.yml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure36.yml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure37.yml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure38.yml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure39.yml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure40.yml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure41.yml35
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/softwareComponentReq11.yml17
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/softwareComponentReq12.yml17
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/tenantIsolationCI/aai_error.properties10
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/testCsarAPI/topology.txt1
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/testCsarAPI/topologyTemplate.txt1
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool10_false.yaml140
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool11_false.yaml140
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool12_false.yaml140
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool1_true.yaml140
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool2_true.yaml140
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool3_true.yaml140
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool4_true.yaml140
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool5_true.yaml140
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool6_true.yaml140
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool7_false.yaml140
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool8_false.yaml140
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool9_false.yaml140
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_number1.yaml140
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_number2.yaml140
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/artifact_unsupported.yaml140
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_bool1.yaml140
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_bool2.yaml140
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_number1.yaml140
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_number2.yaml140
-rw-r--r--test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_string1.yaml140
-rw-r--r--test-apis-ci/src/test/resources/catalogMgmtTest.properties34
-rw-r--r--test-apis-ci/src/test/resources/catalogMgmtTest.yaml6
-rw-r--r--test-apis-ci/src/test/resources/config.json12
-rw-r--r--test-apis-ci/src/test/resources/config/configuration1.yaml17
-rw-r--r--test-apis-ci/src/test/resources/config/elasticsearch.yml387
-rw-r--r--test-apis-ci/src/test/resources/config/test-apis-ci/DME2preferredRouter.txt0
-rw-r--r--test-apis-ci/src/test/resources/config/test-apis-ci/configuration.yaml415
-rw-r--r--test-apis-ci/src/test/resources/config/test-apis-ci/distribution-engine-configuration.yaml77
-rw-r--r--test-apis-ci/src/test/resources/config/test-apis-ci/ecomp-error-configuration.yaml383
-rw-r--r--test-apis-ci/src/test/resources/config/test-apis-ci/error-configuration.yaml1883
-rw-r--r--test-apis-ci/src/test/resources/config/test-apis-ci/neo4j-errors-configuration.yaml60
-rw-r--r--test-apis-ci/src/test/resources/config/test-apis-ci/users-configuration.yaml2
-rw-r--r--test-apis-ci/src/test/resources/cucumber/tenantIsolation.feature38
-rw-r--r--test-apis-ci/src/test/resources/logback-test.xml13
-rw-r--r--test-apis-ci/src/test/resources/preferredRouter.txt0
-rw-r--r--test-apis-ci/testng.xml13
-rw-r--r--test-apis-ci/testngLifeCycle.xml9
-rw-r--r--test-apis-ci/tmpCSARbin28619 -> 0 bytes
-rw-r--r--ui-ci/.gitignore4
-rw-r--r--ui-ci/pom.xml553
-rw-r--r--ui-ci/sdc-ui-tests/Dockerfile28
-rw-r--r--ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/attributes/default.rb1
-rw-r--r--ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/conf/attsdc-packages.yaml12
-rw-r--r--ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/conf/credentials.yaml48
-rw-r--r--ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/conf/log4j2.properties49
-rw-r--r--ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/conf/logback.xml25
-rw-r--r--ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/org.onap.sdc.trust.jksbin1413 -> 0 bytes
-rw-r--r--ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/startTest.sh147
-rw-r--r--ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/recipes/sanityUiTests_1_setup_env.rb64
-rw-r--r--ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/recipes/sanityUiTests_2_setup_configuration.rb44
-rw-r--r--ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/recipes/sanityUiTests_3_sanity_execution.rb19
-rw-r--r--ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/templates/default/BE-janusgraph.properties.erb21
-rw-r--r--ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/templates/default/sdc-sanity.yaml.erb47
-rw-r--r--ui-ci/sdc-ui-tests/chef-solo/LICENSE201
-rw-r--r--ui-ci/sdc-ui-tests/chef-solo/README.md37
-rw-r--r--ui-ci/sdc-ui-tests/chef-solo/chefignore11
-rw-r--r--ui-ci/sdc-ui-tests/chef-solo/cookbooks/README.md54
-rw-r--r--ui-ci/sdc-ui-tests/chef-solo/data_bags/README.md63
-rw-r--r--ui-ci/sdc-ui-tests/chef-solo/environments/README.md5
-rw-r--r--ui-ci/sdc-ui-tests/chef-solo/roles/README.md16
-rw-r--r--ui-ci/sdc-ui-tests/chef-solo/roles/sanityUiTests.json20
-rw-r--r--ui-ci/sdc-ui-tests/chef-solo/solo.json6
-rw-r--r--ui-ci/sdc-ui-tests/chef-solo/solo.rb16
-rw-r--r--ui-ci/sdc-ui-tests/startup.sh38
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/AddComponentInstancesArtifactsInCsar.java341
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/ImportUpdateInformationalDeploymentArtifacts.java227
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Inputs.java214
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/LocalGeneralUtilities.java102
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/MIBsArtifactsOnResourceInstance.java267
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/MobProxy.java142
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/NewArtifactTypeGuide.java121
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/RemoveRestrictionOfDeploymentArtifacts.java116
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Service_Tests_UI.java106
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Testing.java178
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/VfModule.java165
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Vf_Tests_UI.java71
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/extendNode_TemplatePropertiesWithDefaultValues.java296
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/businesslogic/ArtifactBusinessLogic.java220
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/dataProvider/OnbordingDataProviders.java117
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ArtifactInfo.java105
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CanvasElement.java99
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CanvasManager.java622
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CatalogFilterTitlesEnum.java37
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CheckBoxStatusEnum.java50
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ConnectionWizardPopUpObject.java78
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CreateAndImportButtonsEnum.java27
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/DataTestIdEnum.java840
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ErrorMessageProperties.java53
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/GeneralCanvasItemsEnum.java38
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/HeatAndHeatEnvNamesPair.java62
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/HeatWithParametersDefinition.java101
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/LifeCycleStateEnum.java47
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/MenuOptionsEnum.java37
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PortMirrioringConfigurationObject.java106
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PortMirroringEnum.java68
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PropertyInfo.java76
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceCategoriesNameEnum.java45
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceCategoriesNameEnum.java36
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceContainer.java71
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/TopMenuButtonsEnum.java40
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/TypesEnum.java36
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/UserCredentials.java50
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/UserManagementTab.java118
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/VFCArtifact.java71
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/VendorSoftwareProductObject.java90
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/exception/GeneralUiRuntimeException.java28
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/exception/HomePageRuntimeException.java28
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/exception/PropertiesAssignmentPageException.java28
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/exception/WebDriverThreadRuntimeException.java29
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/CreatePath.java299
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/ElementsChanges.java735
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/OnboardItemObject.java83
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/OnboardItemObjectReqDetails.java60
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/PathName.java136
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/PathUrls.java37
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/PathUtilities.java439
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/PathValidations.java362
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/AdminUserManagment.java265
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Annotation.java80
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ArchiveRestoreTest.java240
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CatalogLeftPanelTest.java245
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CatalogLeftPanelTestWithTime.java295
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Categories.java200
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CustomizationUUID.java332
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/DeploymentViewTests.java290
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/GAB.java126
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ImportDCAE.java682
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ImportVFCAsset.java371
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardViaApis.java142
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardingFlowsThroughAPI.java499
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardingFlowsUi.java626
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PNF.java432
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PortMirroring.java613
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Product.java74
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PropertiesAssignment.java581
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PropertiesAssignmentUpdateFlow.java688
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PropertiesAssignmentUpdateFlow_New.java926
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Service.java784
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ToscaValidationTest.java945
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/UpgradeServices.java459
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VFCArtifacts.java381
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Vf.java526
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VfAPI.java780
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VfArtifacts.java407
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VfDeploymentInformationalArtifacts.java641
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ArtifactsCorrelationManager.java72
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/AttFtpClient.java211
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/DriverFactory.java132
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentManager.java166
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentTestActions.java127
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentTestManager.java70
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/MobProxy.java132
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/OnboardCSVReport.java63
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ReportAfterTestManager.java124
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/Retry.java40
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/SetupCDTest.java527
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/TestFtp.java92
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/WebDriverThread.java160
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/WindowTest.java86
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/WindowTestManager.java50
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/flow/AbstractUiTestFlow.java48
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/flow/CheckSoftwareVersionPropertyFlow.java102
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/flow/CreateResourceFlow.java52
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/flow/CreateVspFlow.java142
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/flow/ImportVspFlow.java91
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/flow/UiTestFlow.java39
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/flow/exception/MissingParameterRuntimeException.java28
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/flow/exception/UiTestFlowRuntimeException.java28
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/AbstractPageObject.java166
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/AdminGeneralPage.java126
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ComponentLeftMenu.java25
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/CompositionPage.java234
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/DeploymentArtifactPage.java312
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/DeploymentPage.java234
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/GeneralPageElements.java271
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/GovernorOperationPage.java63
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/HeatParamNameBuilder.java40
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/HomePage.java231
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/IconPage.java51
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/InformationalArtifactPage.java72
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/InputsPage.java151
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/MainRightContainer.java54
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/OnboardHeaderComponent.java91
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/OnboardHomePage.java87
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/OpsOperationPage.java160
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/PageObject.java34
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ProductGeneralPage.java117
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ProductLeftMenu.java47
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/PropertiesAssignmentPage.java317
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/PropertiesPage.java82
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/PropertyNameBuilder.java121
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/PropertyPopup.java108
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ResourceCreatePage.java99
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ResourceGeneralPage.java188
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ResourceLeftMenu.java71
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ResourceLeftSideMenu.java91
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ResourcePropertiesAssignmentPage.java113
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ServiceGeneralPage.java182
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ServiceLeftMenu.java32
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/SoftwareProductOnboarding.java128
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/TesterOperationPage.java86
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/TopNavComponent.java146
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/TopSearchComponent.java69
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ToscaArtifactsPage.java59
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/UpgradeServicesPopup.java38
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/UploadArtifactPopup.java127
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/VspCommitModal.java108
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/VspCreationModal.java161
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/VspRepositoryModalComponent.java126
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/VspValidationPage.java135
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/VspValidationResultsPage.java51
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/AdditionalConditions.java105
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/AdminWorkspaceUIUtilies.java53
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/ArtifactUIUtils.java370
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/CatalogUIUtilitis.java135
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/DownloadManager.java69
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/FileHandling.java571
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/GeneralUIUtils.java759
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/HomeUtils.java102
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/LoaderHelper.java49
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/NotificationHelper.java96
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/OnboardingUiUtils.java210
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/PortMirroringUtils.java184
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/ProductUIUtils.java90
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/PropertiesUIUtils.java97
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/ResourceUIUtils.java396
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/RestCDUtils.java215
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/ServiceUIUtils.java109
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/CatalogVerificator.java168
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/CustomizationUUIDVerificator.java48
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/DeploymentViewVerificator.java346
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/ErrorMessageUIVerificator.java62
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/PortMirroringVerificator.java101
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/PropertiesAssignmentVerificator.java63
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/PropertyVerificator.java41
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/ServiceVerificator.java360
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/ToscaValidation.java605
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/UserManagementVerificator.java148
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/VFCArtifactVerificator.java347
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/VFCverificator.java40
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/VfModuleVerificator.java155
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/VfVerificator.java284
-rw-r--r--ui-ci/src/main/resources/Downloads/CP_WAN.yml23
-rw-r--r--ui-ci/src/main/resources/Downloads/Fortigate02_vFW_VFC.yml63
-rw-r--r--ui-ci/src/main/resources/META-INF/aop-ajc.xml15
-rw-r--r--ui-ci/src/main/resources/ci/conf/attsdc-packages.yaml2
-rw-r--r--ui-ci/src/main/resources/ci/conf/attsdc.yaml69
-rw-r--r--ui-ci/src/main/resources/ci/conf/extent-config.xml50
-rw-r--r--ui-ci/src/main/resources/ci/conf/janusgraph.properties7
-rw-r--r--ui-ci/src/main/resources/ci/conf/log4j2.properties49
-rw-r--r--ui-ci/src/main/resources/ci/scripts/addUsersFromList_new.sh80
-rw-r--r--ui-ci/src/main/resources/ci/scripts/copyToStorage.sh55
-rw-r--r--ui-ci/src/main/resources/ci/scripts/sendMail.sh50
-rw-r--r--ui-ci/src/main/resources/ci/scripts/startTest.sh181
-rw-r--r--ui-ci/src/main/resources/ci/testSuites/PortMirroring.xml9
-rw-r--r--ui-ci/src/main/resources/ci/testSuites/andreyPara.xml31
-rw-r--r--ui-ci/src/main/resources/ci/testSuites/archiveRestoreSanity.xml15
-rw-r--r--ui-ci/src/main/resources/ci/testSuites/arifactsSanity.xml19
-rw-r--r--ui-ci/src/main/resources/ci/testSuites/complexServiceSanity.xml10
-rw-r--r--ui-ci/src/main/resources/ci/testSuites/devOnboardE2EOneFileSanity.xml14
-rw-r--r--ui-ci/src/main/resources/ci/testSuites/extendedSanity.xml52
-rw-r--r--ui-ci/src/main/resources/ci/testSuites/fullCI.xml34
-rw-r--r--ui-ci/src/main/resources/ci/testSuites/gabSanity.xml13
-rw-r--r--ui-ci/src/main/resources/ci/testSuites/onapUiSanity.xml30
-rw-r--r--ui-ci/src/main/resources/ci/testSuites/onboardVNFWithoutDistribution.xml16
-rw-r--r--ui-ci/src/main/resources/ci/testSuites/onboardingVNFs.xml20
-rw-r--r--ui-ci/src/main/resources/ci/testSuites/onboardingVNFsShortFlow.xml18
-rw-r--r--ui-ci/src/main/resources/ci/testSuites/propertyAssignmentSanity.xml19
-rw-r--r--ui-ci/src/main/resources/ci/testSuites/sanity.xml30
-rw-r--r--ui-ci/src/main/resources/ci/testSuites/toscaValidationSuite.xml24
-rw-r--r--ui-ci/src/main/resources/ci/testSuites/vspValidationAllFlows.xml23
-rw-r--r--ui-ci/src/main/resources/images/gizmorambo.jpgbin16605 -> 0 bytes
-rw-r--r--ui-ci/src/main/resources/log4j2.xml38
-rw-r--r--ui-ci/src/main/resources/reportportal.properties5
-rw-r--r--ui-ci/src/test/Completetheform.js3
798 files changed, 541 insertions, 129767 deletions
diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml
index 7583de400c..addb4519b7 100644
--- a/integration-tests/pom.xml
+++ b/integration-tests/pom.xml
@@ -55,6 +55,12 @@ limitations under the License.
<dependencies>
<dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>${logback.version}</version>
+ </dependency>
+
+ <dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>${snakeyaml.version}</version>
diff --git a/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/utils/rest/ResponseParser.java b/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/utils/rest/ResponseParser.java
index 996abb8e24..437dc684d8 100644
--- a/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/utils/rest/ResponseParser.java
+++ b/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/utils/rest/ResponseParser.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -20,36 +20,6 @@
package org.onap.sdc.backend.ci.tests.utils.rest;
-//import com.fasterxml.jackson.databind.DeserializationFeature;
-//import com.fasterxml.jackson.databind.ObjectMapper;
-//import com.fasterxml.jackson.databind.module.SimpleModule;
-//import com.google.gson.*;
-//import org.apache.commons.codec.binary.Base64;
-//import org.apache.log4j.Logger;
-//import org.codehaus.jackson.JsonNode;
-//
-//import org.json.JSONArray;
-//import org.json.JSONException;
-//import org.json.simple.JSONObject;
-//import org.json.simple.JSONValue;
-//import org.openecomp.sdc.be.model.*;
-//import org.openecomp.sdc.be.model.category.CategoryDefinition;
-//import org.openecomp.sdc.be.model.operations.impl.PropertyOperation.PropertyConstraintJacksonDeserializer;;
-//import ArtifactReqDetails;
-//import ResourceAssetStructure;
-//import ResourceRespJavaObject;
-//import ServiceDistributionStatus;
-//import RestResponse;
-//import VfModuleDefinition;
-//import Utils;
-//import org.yaml.snakeyaml.Yaml;
-//
-//import java.io.ByteArrayInputStream;
-//import java.io.IOException;
-//import java.io.InputStream;
-//import java.text.ParseException;
-//import java.util.*;
-
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.exc.InvalidFormatException;
@@ -80,619 +50,488 @@ import java.io.InputStream;
import java.text.ParseException;
import java.util.*;
-//import org.codehaus.jackson.JsonNode;
public class ResponseParser {
- // comment by Andrey, for test only
- // public static void main(String[] args) {
- // String response =
- // "{\"uniqueId\":\"52eb0139-a855-47b9-a0e6-c90f0a90b1d2\",\"resourceName\":\"importResource4test\",\"resourceVersion\":\"0.1\",\"creatorUserId\":\"jh0003\",\"creatorFullName\":\"Jimmy
- // Hendrix\",\"lastUpdaterUserId\":\"jh0003\",\"lastUpdaterFullName\":\"Jimmy
- // Hendrix\",\"creationDate\":1446742241514,\"lastUpdateDate\":1446742241514,\"description\":\"Represents
- // a generic software component that can be managed and run by a Compute
- // Node
- // Type.\",\"icon\":\"defaulticon\",\"tags\":[\"importResource4test\"],\"category\":\"Generic/Infrastructure\",\"lifecycleState\":\"NOT_CERTIFIED_CHECKOUT\",\"derivedFrom\":[\"tosca.nodes.Root\"],\"artifacts\":{},\"deploymentArtifacts\":{},\"properties\":[{\"uniqueId\":\"52eb0139-a855-47b9-a0e6-c90f0a90b1d2.port\",\"type\":\"integer\",\"required\":false,\"description\":\"the
- // port the DBMS service will listen to for data and
- // requests\",\"password\":false,\"name\":\"port\",\"parentUniqueId\":\"52eb0139-a855-47b9-a0e6-c90f0a90b1d2\",\"definition\":true},{\"uniqueId\":\"52eb0139-a855-47b9-a0e6-c90f0a90b1d2.root_password\",\"type\":\"string\",\"required\":false,\"description\":\"the
- // optional root password for the DBMS
- // service\",\"password\":false,\"name\":\"root_password\",\"parentUniqueId\":\"52eb0139-a855-47b9-a0e6-c90f0a90b1d2\",\"definition\":true}],\"interfaces\":{\"standard\":{\"type\":\"tosca.interfaces.node.lifecycle.Standard\",\"uniqueId\":\"tosca.interfaces.node.lifecycle.standard\",\"operations\":{\"stop\":{\"uniqueId\":\"tosca.interfaces.node.lifecycle.standard.stop\",\"description\":\"Standard
- // lifecycle stop
- // operation.\",\"definition\":false},\"start\":{\"uniqueId\":\"tosca.interfaces.node.lifecycle.standard.start\",\"description\":\"Standard
- // lifecycle start
- // operation.\",\"definition\":false},\"delete\":{\"uniqueId\":\"tosca.interfaces.node.lifecycle.standard.delete\",\"description\":\"Standard
- // lifecycle delete
- // operation.\",\"definition\":false},\"create\":{\"uniqueId\":\"tosca.interfaces.node.lifecycle.standard.create\",\"description\":\"Standard
- // lifecycle create
- // operation.\",\"definition\":false},\"configure\":{\"uniqueId\":\"tosca.interfaces.node.lifecycle.standard.configure\",\"description\":\"Standard
- // lifecycle configure
- // operation.\",\"definition\":false}},\"definition\":false}},\"capabilities\":{\"feature\":{\"uniqueId\":\"capability.8313348e-3623-4f4a-9b8f-d2fbadaf9a31.feature\",\"type\":\"tosca.capabilities.Node\"},\"feature2\":{\"uniqueId\":\"capability.52eb0139-a855-47b9-a0e6-c90f0a90b1d2.feature2\",\"type\":\"tosca.capabilities.Node\"}},\"requirements\":{\"dependency\":{\"uniqueId\":\"8313348e-3623-4f4a-9b8f-d2fbadaf9a31.dependency\",\"capability\":\"tosca.capabilities.Node\",\"node\":\"tosca.nodes.Root\",\"relationship\":\"tosca.relationships.DependsOn\"},\"dependency2\":{\"uniqueId\":\"52eb0139-a855-47b9-a0e6-c90f0a90b1d2.dependency2\",\"capability\":\"tosca.capabilities.Node\",\"node\":\"tosca.nodes.importResource4test\",\"relationship\":\"tosca.relationships.DependsOn\"}},\"vendorName\":\"ATT
- // (Tosca)\",\"vendorRelease\":\"1.0.0.wd03\",\"contactId\":\"jh0003\",\"systemName\":\"Importresource4test\",\"additionalInformation\":[{\"uniqueId\":\"52eb0139-a855-47b9-a0e6-c90f0a90b1d2.additionalinformation\",\"lastCreatedCounter\":0,\"parentUniqueId\":\"52eb0139-a855-47b9-a0e6-c90f0a90b1d2\",\"parameters\":[]}],\"allVersions\":{\"0.1\":\"52eb0139-a855-47b9-a0e6-c90f0a90b1d2\"},\"abstract\":false,\"highestVersion\":true,\"uuid\":\"2e91a2df-b066-49bb-abde-4c1c01e409db\"}";
- // convertResourceResponseToJavaObject(response);
- // }
-
- private static final String INVARIANT_UUID = "invariantUUID";
- public static final String UNIQUE_ID = "uniqueId";
- public static final String VERSION = "version";
- public static final String UUID = "uuid";
- public static final String NAME = "name";
- public static final String ORIGIN_TYPE = "originType";
- public static final String TOSCA_RESOURCE_NAME = "toscaResourceName";
-
- static Logger logger = LogManager.getLogger(ResponseParser.class);
-
- public static String getValueFromJsonResponse(String response, String fieldName) {
- try {
-// JSONObject jsonResp = (JSONObject) JSONValue.parse(response);
- String[] split = fieldName.split(":");
- String fieldValue = response;
-
- for(int i=0; i<split.length; i++) {
- fieldValue = parser(fieldValue, split[i]);
- }
- return fieldValue;
- } catch (Exception e) {
- return null;
- }
-
- }
-
- private static String parser(String response, String field){
- JSONObject fieldValue = (JSONObject) JSONValue.parse(response);
- return fieldValue.get(field).toString();
- }
-
- public static String getUniqueIdFromResponse(RestResponse response) {
- return getValueFromJsonResponse(response.getResponse(), UNIQUE_ID);
- }
-
- public static String getInvariantUuid(RestResponse response) {
- return getValueFromJsonResponse(response.getResponse(), INVARIANT_UUID);
- }
-
- public static String getUuidFromResponse(RestResponse response) {
- return getValueFromJsonResponse(response.getResponse(), UUID);
- }
-
- public static String getNameFromResponse(RestResponse response) {
- return getValueFromJsonResponse(response.getResponse(), NAME);
- }
-
- public static String getVersionFromResponse(RestResponse response) {
- return ResponseParser.getValueFromJsonResponse(response.getResponse(), VERSION);
- }
-
- public static String getComponentTypeFromResponse(RestResponse response) {
- return ResponseParser.getValueFromJsonResponse(response.getResponse(), ORIGIN_TYPE);
- }
-
- public static String getToscaResourceNameFromResponse(RestResponse response) {
- return getValueFromJsonResponse(response.getResponse(), TOSCA_RESOURCE_NAME);
- }
-
- @SuppressWarnings("unchecked")
- public static ResourceRespJavaObject parseJsonListReturnResourceDetailsObj(RestResponse restResponse,
- String resourceType, String searchPattern, String expectedResult) throws Exception {
-
- // Gson gson = new Gson;
-
- JsonElement jElement = new JsonParser().parse(restResponse.getResponse());
- JsonObject jObject = jElement.getAsJsonObject();
- JsonArray arrayOfObjects = (JsonArray) jObject.get(resourceType);
- Gson gson = new Gson();
- Map<String, Object> map = new HashMap<>();
- ResourceRespJavaObject jsonToJavaObject = new ResourceRespJavaObject();
-
- for (int counter = 0; counter < arrayOfObjects.size(); counter++) {
- JsonObject jHitObject = (JsonObject) arrayOfObjects.get(counter);
-
- map = (Map<String, Object>) gson.fromJson(jHitObject.toString(), map.getClass());
- if (map.get(searchPattern).toString().contains(expectedResult)) {
-
- jsonToJavaObject = gson.fromJson(jObject, ResourceRespJavaObject.class);
- break;
- }
- }
- return jsonToJavaObject;
-
- }
-
- private static ObjectMapper newObjectMapper() {
- SimpleModule module = new SimpleModule("customDeserializationModule");
- module.addDeserializer(PropertyConstraint.class, new PropertyOperation.PropertyConstraintJacksonDeserializer());
- return new ObjectMapper()
- .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
- .registerModule(module);
- }
-
- public static Resource convertResourceResponseToJavaObject(String response) {
- ObjectMapper mapper = newObjectMapper();
- Resource resource = null;
- try {
- mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- resource = mapper.readValue(response, Resource.class);
-
- logger.debug(resource.toString());
- } catch (IOException e) {
- try {
- List<Resource> resources = Arrays.asList(mapper.readValue(response.toString(), Resource[].class));
- resource = resources.get(0);
- } catch (Exception e1) {
- e1.printStackTrace();
- }
- }
-
- return resource;
- }
-
- public static ComponentInstanceProperty convertPropertyResponseToJavaObject(String response) {
-
- ObjectMapper mapper = newObjectMapper();
- ComponentInstanceProperty propertyDefinition = null;
- try {
- propertyDefinition = mapper.readValue(response, ComponentInstanceProperty.class);
- logger.debug(propertyDefinition.toString());
- } catch (IOException e) {
- e.printStackTrace();
- }
- return propertyDefinition;
- }
-
- public static GroupDefinition convertPropertyResponseToObject(String response) {
-
- ObjectMapper mapper = newObjectMapper();
- GroupDefinition groupDefinition = null;
- try {
- groupDefinition = mapper.readValue(response, GroupDefinition.class);
- logger.debug(groupDefinition.toString());
- } catch (IOException e) {
- e.printStackTrace();
- }
- return groupDefinition;
- }
-
- public static String toJson(Object object) {
- Gson gson = new Gson();
- return gson.toJson(object);
- }
-
- public static ArtifactDefinition convertArtifactDefinitionResponseToJavaObject(String response) {
- ObjectMapper mapper = new ObjectMapper();
- ArtifactDefinition artifactDefinition = null;
- try {
- mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- artifactDefinition = mapper.readValue(response, ArtifactDefinition.class);
- logger.debug(artifactDefinition.toString());
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- return artifactDefinition;
-
- }
-
- public static ArtifactReqDetails convertArtifactReqDetailsToJavaObject(String response) {
-
- ArtifactReqDetails artifactReqDetails = null;
- Gson gson = new Gson();
- artifactReqDetails = gson.fromJson(response, ArtifactReqDetails.class);
- return artifactReqDetails;
- }
-
- public static <T> T parseToObject(String json, Class<T> clazz) {
- Gson gson = new Gson();
- T object;
- try {
- object = gson.fromJson(json, clazz);
- } catch (Exception e) {
- object = parseToObjectUsingMapper(json, clazz);
- }
- return object;
- }
-
- public static <T> T parseToObjectUsingMapper(String json, Class<T> clazz) {
- // Generic convert
- ObjectMapper mapper = newObjectMapper();
- T object = null;
- try {
- object = mapper.readValue(json, clazz);
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- return object;
- }
-
- public static ArtifactReqDetails convertArtifactDefinitionToArtifactReqDetailsObject(
- ArtifactDefinition artifactDefinition) {
-
- ArtifactReqDetails artifactReqDetails = null;
- Gson gson = new Gson();
- String artDef = gson.toJson(artifactDefinition);
- artifactReqDetails = gson.fromJson(artDef, ArtifactReqDetails.class);
- return artifactReqDetails;
- }
-
- /*public static Service convertServiceResponseToJavaObject(String response) {
-
- ObjectMapper mapper = newObjectMapper();
- Service service = null;
- try {
- service = mapper.readValue(response, Service.class);
- logger.debug(service.toString());
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- return service;
- }*/
- public static Service convertServiceResponseToJavaObject(String response) {
-
- ObjectMapper mapper = newObjectMapper();
- Service service = null;
- try {
- service = mapper.readValue(response, Service.class);
- logger.debug(service.toString());
- //Temporary catch until bug with distribution status fixed
- } catch (InvalidFormatException e) {
- System.out.println("broken service with invalid distribution status : " + response);
- logger.debug("broken service with invalid distribution status : " + response);
- return service;
- } catch(IOException e){
-
- e.printStackTrace();
- }
-
- return service;
-}
-
- public static Product convertProductResponseToJavaObject(String response) {
-
- ObjectMapper mapper = newObjectMapper();
- Product product = null;
- try {
- product = mapper.readValue(response, Product.class);
- logger.debug(product.toString());
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- return product;
- }
-
- public static ComponentInstance convertComponentInstanceResponseToJavaObject(String response) {
-
- ObjectMapper mapper = newObjectMapper();
- ComponentInstance componentInstance = null;
- try {
- componentInstance = mapper.readValue(response, ComponentInstance.class);
- logger.debug(componentInstance.toString());
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- return componentInstance;
- }
-
- public static List<String> getValuesFromJsonArray(RestResponse message) throws Exception {
- List<String> artifactTypesArrayFromApi = new ArrayList<>();
-
- org.json.JSONObject responseObject = new org.json.JSONObject(message.getResponse());
- JSONArray jArr = responseObject.getJSONArray("artifactTypes");
-
- for (int i = 0; i < jArr.length(); i++) {
- org.json.JSONObject jObj = jArr.getJSONObject(i);
- String value = jObj.get("name").toString();
-
- artifactTypesArrayFromApi.add(value);
- }
- return artifactTypesArrayFromApi;
- }
-
- public static String calculateMD5Header(ArtifactReqDetails artifactDetails) {
- Gson gson = new Gson();
- String jsonBody = gson.toJson(artifactDetails);
- // calculate MD5 for json body
- return calculateMD5(jsonBody);
-
- }
-
- public static String calculateMD5(String data) {
- String calculatedMd5 = org.apache.commons.codec.digest.DigestUtils.md5Hex(data);
- // encode base-64 result
- byte[] encodeBase64 = Base64.encodeBase64(calculatedMd5.getBytes());
- String encodeBase64Str = new String(encodeBase64);
- return encodeBase64Str;
-
- }
-
- public static List<Map<String, Object>> getAuditFromMessage(Map<String, Object> auditingMessage) {
- List<Map<String, Object>> auditList = new ArrayList<>();
- auditList.add(auditingMessage);
- return auditList;
- }
-
- public static List<CategoryDefinition> parseCategories(RestResponse getAllCategoriesRest) {
-
- List<CategoryDefinition> categories = new ArrayList<>();
- try {
- JsonElement jElement = new JsonParser().parse(getAllCategoriesRest.getResponse());
- JsonArray cagegories = jElement.getAsJsonArray();
- Iterator<JsonElement> iter = cagegories.iterator();
- while (iter.hasNext()) {
- JsonElement next = iter.next();
- CategoryDefinition category = ResponseParser.parseToObject(next.toString(), CategoryDefinition.class);
- categories.add(category);
- }
-
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- return categories;
- }
-
- public static JSONArray getListFromJson(RestResponse res, String field) throws JSONException {
- String valueFromJsonResponse = getValueFromJsonResponse(res.getResponse(), field);
- JSONArray jArr = new JSONArray(valueFromJsonResponse);
-
- return jArr;
- }
-
- public static List<String> getDerivedListFromJson(RestResponse res) throws JSONException {
- JSONArray listFromJson = getListFromJson(res, "derivedFrom");
- List<String> lst = new ArrayList<>();
- for (int i = 0; i < listFromJson.length(); i++) {
- lst.add(listFromJson.getString(i));
- }
-
- return lst;
- }
-
- public static Map<String, Object> convertStringToMap(String obj) {
- Map<String, Object> object = (Map<String, Object>) JSONValue.parse(obj);
- return object;
- }
-
- public static List<Map<String, Object>> getListOfMapsFromJson(RestResponse res, String field) throws Exception {
- List<Map<String, Object>> list = new ArrayList<>();
- JSONArray listFromJson = getListFromJson(res, field);
- for (int i = 0; i < listFromJson.length(); i++) {
- Map<String, Object> convertStringToMap = convertStringToMap(listFromJson.getString(i));
- list.add(convertStringToMap);
- }
- return list;
-
- }
-
- public static Map<String, Object> getJsonValueAsMap(RestResponse response, String key) {
- String valueField = getValueFromJsonResponse(response.getResponse(), key);
- Map<String, Object> convertToMap = convertStringToMap(valueField);
- return convertToMap;
- }
-
- public static String getJsonObjectValueByKey(String metadata, String key) {
- JsonElement jelement = new JsonParser().parse(metadata);
-
- JsonObject jobject = jelement.getAsJsonObject();
- Object obj = jobject.get(key);
- if (obj == null) {
- return null;
- } else {
- return obj.toString();
- }
- }
-
-// /*public static Map<String, List<Component>> convertCatalogResponseToJavaObject(String response) {
-//
-// // Map<String, ArrayList<Component>> map = new HashMap<String,
-// // ArrayList<Component>>();
-// Map<String, List<Component>> map = new HashMap<>();
-//
-// JsonElement jElement = new JsonParser().parse(response);
-// JsonObject jObject = jElement.getAsJsonObject();
-// JsonArray jArrReousrces = jObject.getAsJsonArray("resources");
-// JsonArray jArrServices = jObject.getAsJsonArray("services");
-// //Product removed
-//// JsonArray jArrProducts = jObject.getAsJsonArray("products");
-// //Product removed
-// if (jArrReousrces != null && jArrServices != null /*&& jArrProducts != null*/){
-//
-//
-// //////// RESOURCE/////////////////////////////
-// ArrayList<Component> restResponseArray = new ArrayList<>();
-// Component component = null;
-// for (int i = 0; i < jArrReousrces.size(); i++) {
-// String resourceString = (String) jArrReousrces.get(i).toString();
-// component = ResponseParser.convertResourceResponseToJavaObject(resourceString);
-// restResponseArray.add(component);
-// }
-//
-// map.put("resources", restResponseArray);
-//
-// ///////// SERVICE/////////////////////////////
-//
-// restResponseArray = new ArrayList<>();
-// component = null;
-// for (int i = 0; i < jArrServices.size(); i++) {
-// String resourceString = (String) jArrServices.get(i).toString();
-// component = ResponseParser.convertServiceResponseToJavaObject(resourceString);
-// restResponseArray.add(component);
-// }
-//
-// map.put("services", restResponseArray);
-////Product removed
-// ///////// PRODUCT/////////////////////////////
-//// restResponseArray = new ArrayList<>();
-//// component = null;
-//// for (int i = 0; i < jArrProducts.size(); i++) {
-//// String resourceString = (String) jArrProducts.get(i).toString();
-//// component = ResponseParser.convertProductResponseToJavaObject(resourceString);
-//// restResponseArray.add(component);
-//// }
-////
-//// map.put("products", restResponseArray);
-////
-// }
-// else {
-// map.put("resources", new ArrayList<>());
-// map.put("services", new ArrayList<>());
-// //Product removed
-//// map.put("products", new ArrayList<>());
-// }
-//
-// return map;
-//
-// }*/
-
- public static Map<String, List<Component>> convertCatalogResponseToJavaObject(String response) {
-
- // Map<String, ArrayList<Component>> map = new HashMap<String,
- // ArrayList<Component>>();
- Map<String, List<Component>> map = new HashMap<>();
-
- JsonElement jElement = new JsonParser().parse(response);
- JsonObject jObject = jElement.getAsJsonObject();
- JsonArray jArrReousrces = jObject.getAsJsonArray("resources");
- JsonArray jArrServices = jObject.getAsJsonArray("services");
- //Product removed
-// JsonArray jArrProducts = jObject.getAsJsonArray("products");
- //Product removed
-
- if (jArrReousrces != null && jArrServices != null /*&& jArrProducts != null*/){
-
-
- //////// RESOURCE/////////////////////////////
- ArrayList<Component> restResponseArray = new ArrayList<>();
- Component component = null;
- for (int i = 0; i < jArrReousrces.size(); i++) {
- String resourceString = (String) jArrReousrces.get(i).toString();
- component = ResponseParser.convertResourceResponseToJavaObject(resourceString);
- restResponseArray.add(component);
- }
-
- map.put("resources", restResponseArray);
-
- ///////// SERVICE/////////////////////////////
-
- restResponseArray = new ArrayList<>();
- component = null;
- for (int i = 0; i < jArrServices.size(); i++) {
- String resourceString = (String) jArrServices.get(i).toString();
- component = ResponseParser.convertServiceResponseToJavaObject(resourceString);
- restResponseArray.add(component);
- }
-
- map.put("services", restResponseArray);
-//Product removed
-
- ///////// PRODUCT/////////////////////////////
-// restResponseArray = new ArrayList<>();
-// component = null;
-// for (int i = 0; i < jArrProducts.size(); i++) {
-// String resourceString = (String) jArrProducts.get(i).toString();
-// component = ResponseParser.convertProductResponseToJavaObject(resourceString);
-// restResponseArray.add(component);
-// }
-//
-
-
-// map.put("products", restResponseArray);
-//
-
- }
- else {
- map.put("resources", new ArrayList<>());
- map.put("services", new ArrayList<>());
- //Product removed
-// map.put("products", new ArrayList<>());
- }
-
- return map;
-
- }
-
- public static Map<Long, ServiceDistributionStatus> convertServiceDistributionStatusToObject(String response) throws ParseException {
-
- Map<Long, ServiceDistributionStatus> serviceDistributionStatusMap = new HashMap<>();
- ServiceDistributionStatus serviceDistributionStatusObject = null;
-
- JsonElement jElement = new JsonParser().parse(response);
- JsonObject jObject = jElement.getAsJsonObject();
- JsonArray jDistrStatusArray = jObject.getAsJsonArray("distributionStatusOfServiceList");
-
- for (int i = 0; i < jDistrStatusArray.size(); i++){
- Gson gson = new Gson();
- String servDistrStatus = gson.toJson(jDistrStatusArray.get(i));
- serviceDistributionStatusObject = gson.fromJson(servDistrStatus, ServiceDistributionStatus.class);
- serviceDistributionStatusMap.put(Utils.getEpochTimeFromUTC(serviceDistributionStatusObject.getTimestamp()), serviceDistributionStatusObject);
- }
-
- return serviceDistributionStatusMap;
-
- }
-
- public static Map<String, String> getPropertiesNameType(RestResponse restResponse)
- throws JSONException {
- Map<String, String> propertiesMap = new HashMap<>();
- JSONArray propertiesList = getListFromJson(restResponse, "properties");
- for (int i = 0; i < propertiesList.length() ; i ++){
- JSONObject prop = (JSONObject) JSONValue.parse(propertiesList.get(i).toString());
- String propName = prop.get("name").toString();
- String propType = prop.get("type").toString();
- propertiesMap.put(propName, propType);
- }
-
- return propertiesMap;
- }
-
- public static ResourceAssetStructure getDataOutOfSearchExternalAPIResponseForResourceName(String response, String resourceName) {
- Gson gson = new Gson();
- JsonElement jsonElement = new JsonParser().parse(response);
- JsonArray jsonArray = jsonElement.getAsJsonArray();
- for(JsonElement jElement: jsonArray) {
- ResourceAssetStructure parsedResponse = gson.fromJson(jElement, ResourceAssetStructure.class);
-
- if(resourceName.contains(parsedResponse.getName()) && parsedResponse.getName().contains(resourceName)) {
- return parsedResponse;
- }
- }
-
- return null;
- }
-
- public static Map<String, VfModuleDefinition> convertVfModuleJsonResponseToJavaObject(String response) {
-
- Yaml yaml = new Yaml();
- InputStream inputStream = null;
- inputStream = new ByteArrayInputStream(response.getBytes());
- List<?> list = (List<?> )yaml.load(inputStream);
- ObjectMapper mapper = new ObjectMapper();
-
- VfModuleDefinition moduleDefinition;
- Map<String, VfModuleDefinition> vfModulesMap = new HashMap<>();
- for (Object obj : list) {
+ private static final String INVARIANT_UUID = "invariantUUID";
+ public static final String UNIQUE_ID = "uniqueId";
+ public static final String VERSION = "version";
+ public static final String UUID = "uuid";
+ public static final String NAME = "name";
+ public static final String ORIGIN_TYPE = "originType";
+ public static final String TOSCA_RESOURCE_NAME = "toscaResourceName";
+
+ static Logger logger = LogManager.getLogger(ResponseParser.class);
+
+ public static String getValueFromJsonResponse(String response, String fieldName) {
+ try {
+ String[] split = fieldName.split(":");
+ String fieldValue = response;
+
+ for (int i = 0; i < split.length; i++) {
+ fieldValue = parser(fieldValue, split[i]);
+ }
+ return fieldValue;
+ } catch (Exception e) {
+ return null;
+ }
+
+ }
+
+ private static String parser(String response, String field) {
+ JSONObject fieldValue = (JSONObject) JSONValue.parse(response);
+ return fieldValue.get(field).toString();
+ }
+
+ public static String getUniqueIdFromResponse(RestResponse response) {
+ return getValueFromJsonResponse(response.getResponse(), UNIQUE_ID);
+ }
+
+ public static String getInvariantUuid(RestResponse response) {
+ return getValueFromJsonResponse(response.getResponse(), INVARIANT_UUID);
+ }
+
+ public static String getUuidFromResponse(RestResponse response) {
+ return getValueFromJsonResponse(response.getResponse(), UUID);
+ }
+
+ public static String getNameFromResponse(RestResponse response) {
+ return getValueFromJsonResponse(response.getResponse(), NAME);
+ }
+
+ public static String getVersionFromResponse(RestResponse response) {
+ return ResponseParser.getValueFromJsonResponse(response.getResponse(), VERSION);
+ }
+
+ public static String getComponentTypeFromResponse(RestResponse response) {
+ return ResponseParser.getValueFromJsonResponse(response.getResponse(), ORIGIN_TYPE);
+ }
+
+ public static String getToscaResourceNameFromResponse(RestResponse response) {
+ return getValueFromJsonResponse(response.getResponse(), TOSCA_RESOURCE_NAME);
+ }
+
+ @SuppressWarnings("unchecked")
+ public static ResourceRespJavaObject parseJsonListReturnResourceDetailsObj(RestResponse restResponse,
+ String resourceType, String searchPattern, String expectedResult) throws Exception {
+
+ // Gson gson = new Gson;
+
+ JsonElement jElement = new JsonParser().parse(restResponse.getResponse());
+ JsonObject jObject = jElement.getAsJsonObject();
+ JsonArray arrayOfObjects = (JsonArray) jObject.get(resourceType);
+ Gson gson = new Gson();
+ Map<String, Object> map = new HashMap<>();
+ ResourceRespJavaObject jsonToJavaObject = new ResourceRespJavaObject();
+
+ for (int counter = 0; counter < arrayOfObjects.size(); counter++) {
+ JsonObject jHitObject = (JsonObject) arrayOfObjects.get(counter);
+
+ map = (Map<String, Object>) gson.fromJson(jHitObject.toString(), map.getClass());
+ if (map.get(searchPattern).toString().contains(expectedResult)) {
+
+ jsonToJavaObject = gson.fromJson(jObject, ResourceRespJavaObject.class);
+ break;
+ }
+ }
+ return jsonToJavaObject;
+
+ }
+
+ private static ObjectMapper newObjectMapper() {
+ SimpleModule module = new SimpleModule("customDeserializationModule");
+ module.addDeserializer(PropertyConstraint.class, new PropertyOperation.PropertyConstraintJacksonDeserializer());
+ return new ObjectMapper()
+ .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
+ .registerModule(module);
+ }
+
+ public static Resource convertResourceResponseToJavaObject(String response) {
+ ObjectMapper mapper = newObjectMapper();
+ Resource resource = null;
+ try {
+ mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+ resource = mapper.readValue(response, Resource.class);
+
+ logger.debug(resource.toString());
+ } catch (IOException e) {
+ try {
+ List<Resource> resources = Arrays.asList(mapper.readValue(response.toString(), Resource[].class));
+ resource = resources.get(0);
+ } catch (Exception e1) {
+ e1.printStackTrace();
+ }
+ }
+
+ return resource;
+ }
+
+ public static ComponentInstanceProperty convertPropertyResponseToJavaObject(String response) {
+
+ ObjectMapper mapper = newObjectMapper();
+ ComponentInstanceProperty propertyDefinition = null;
+ try {
+ propertyDefinition = mapper.readValue(response, ComponentInstanceProperty.class);
+ logger.debug(propertyDefinition.toString());
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return propertyDefinition;
+ }
+
+ public static GroupDefinition convertPropertyResponseToObject(String response) {
+
+ ObjectMapper mapper = newObjectMapper();
+ GroupDefinition groupDefinition = null;
+ try {
+ groupDefinition = mapper.readValue(response, GroupDefinition.class);
+ logger.debug(groupDefinition.toString());
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return groupDefinition;
+ }
+
+ public static String toJson(Object object) {
+ Gson gson = new Gson();
+ return gson.toJson(object);
+ }
+
+ public static ArtifactDefinition convertArtifactDefinitionResponseToJavaObject(String response) {
+ ObjectMapper mapper = new ObjectMapper();
+ ArtifactDefinition artifactDefinition = null;
+ try {
+ mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+ artifactDefinition = mapper.readValue(response, ArtifactDefinition.class);
+ logger.debug(artifactDefinition.toString());
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ return artifactDefinition;
+
+ }
+
+ public static ArtifactReqDetails convertArtifactReqDetailsToJavaObject(String response) {
+
+ ArtifactReqDetails artifactReqDetails = null;
+ Gson gson = new Gson();
+ artifactReqDetails = gson.fromJson(response, ArtifactReqDetails.class);
+ return artifactReqDetails;
+ }
+
+ public static <T> T parseToObject(String json, Class<T> clazz) {
+ Gson gson = new Gson();
+ T object;
+ try {
+ object = gson.fromJson(json, clazz);
+ } catch (Exception e) {
+ object = parseToObjectUsingMapper(json, clazz);
+ }
+ return object;
+ }
+
+ public static <T> T parseToObjectUsingMapper(String json, Class<T> clazz) {
+ // Generic convert
+ ObjectMapper mapper = newObjectMapper();
+ T object = null;
+ try {
+ object = mapper.readValue(json, clazz);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ return object;
+ }
+
+ public static ArtifactReqDetails convertArtifactDefinitionToArtifactReqDetailsObject(
+ ArtifactDefinition artifactDefinition) {
+
+ ArtifactReqDetails artifactReqDetails = null;
+ Gson gson = new Gson();
+ String artDef = gson.toJson(artifactDefinition);
+ artifactReqDetails = gson.fromJson(artDef, ArtifactReqDetails.class);
+ return artifactReqDetails;
+ }
+
+ public static Service convertServiceResponseToJavaObject(String response) {
+
+ ObjectMapper mapper = newObjectMapper();
+ Service service = null;
+ try {
+ service = mapper.readValue(response, Service.class);
+ logger.debug(service.toString());
+ //Temporary catch until bug with distribution status fixed
+ } catch (InvalidFormatException e) {
+ System.out.println("broken service with invalid distribution status : " + response);
+ logger.debug("broken service with invalid distribution status : " + response);
+ return service;
+ } catch (IOException e) {
+
+ e.printStackTrace();
+ }
+
+ return service;
+ }
+
+ public static Product convertProductResponseToJavaObject(String response) {
+
+ ObjectMapper mapper = newObjectMapper();
+ Product product = null;
+ try {
+ product = mapper.readValue(response, Product.class);
+ logger.debug(product.toString());
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ return product;
+ }
+
+ public static ComponentInstance convertComponentInstanceResponseToJavaObject(String response) {
+
+ ObjectMapper mapper = newObjectMapper();
+ ComponentInstance componentInstance = null;
+ try {
+ componentInstance = mapper.readValue(response, ComponentInstance.class);
+ logger.debug(componentInstance.toString());
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ return componentInstance;
+ }
+
+ public static List<String> getValuesFromJsonArray(RestResponse message) throws Exception {
+ List<String> artifactTypesArrayFromApi = new ArrayList<>();
+
+ org.json.JSONObject responseObject = new org.json.JSONObject(message.getResponse());
+ JSONArray jArr = responseObject.getJSONArray("artifactTypes");
+
+ for (int i = 0; i < jArr.length(); i++) {
+ org.json.JSONObject jObj = jArr.getJSONObject(i);
+ String value = jObj.get("name").toString();
+
+ artifactTypesArrayFromApi.add(value);
+ }
+ return artifactTypesArrayFromApi;
+ }
+
+ public static String calculateMD5Header(ArtifactReqDetails artifactDetails) {
+ Gson gson = new Gson();
+ String jsonBody = gson.toJson(artifactDetails);
+ // calculate MD5 for json body
+ return calculateMD5(jsonBody);
+
+ }
+
+ public static String calculateMD5(String data) {
+ String calculatedMd5 = org.apache.commons.codec.digest.DigestUtils.md5Hex(data);
+ // encode base-64 result
+ byte[] encodeBase64 = Base64.encodeBase64(calculatedMd5.getBytes());
+ String encodeBase64Str = new String(encodeBase64);
+ return encodeBase64Str;
+
+ }
+
+ public static List<Map<String, Object>> getAuditFromMessage(Map<String, Object> auditingMessage) {
+ List<Map<String, Object>> auditList = new ArrayList<>();
+ auditList.add(auditingMessage);
+ return auditList;
+ }
+
+ public static List<CategoryDefinition> parseCategories(RestResponse getAllCategoriesRest) {
+
+ List<CategoryDefinition> categories = new ArrayList<>();
+ try {
+ JsonElement jElement = new JsonParser().parse(getAllCategoriesRest.getResponse());
+ JsonArray cagegories = jElement.getAsJsonArray();
+ Iterator<JsonElement> iter = cagegories.iterator();
+ while (iter.hasNext()) {
+ JsonElement next = iter.next();
+ CategoryDefinition category = ResponseParser.parseToObject(next.toString(), CategoryDefinition.class);
+ categories.add(category);
+ }
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ return categories;
+ }
+
+ public static JSONArray getListFromJson(RestResponse res, String field) throws JSONException {
+ String valueFromJsonResponse = getValueFromJsonResponse(res.getResponse(), field);
+ JSONArray jArr = new JSONArray(valueFromJsonResponse);
+
+ return jArr;
+ }
+
+ public static List<String> getDerivedListFromJson(RestResponse res) throws JSONException {
+ JSONArray listFromJson = getListFromJson(res, "derivedFrom");
+ List<String> lst = new ArrayList<>();
+ for (int i = 0; i < listFromJson.length(); i++) {
+ lst.add(listFromJson.getString(i));
+ }
+
+ return lst;
+ }
+
+ public static Map<String, Object> convertStringToMap(String obj) {
+ Map<String, Object> object = (Map<String, Object>) JSONValue.parse(obj);
+ return object;
+ }
+
+ public static List<Map<String, Object>> getListOfMapsFromJson(RestResponse res, String field) throws Exception {
+ List<Map<String, Object>> list = new ArrayList<>();
+ JSONArray listFromJson = getListFromJson(res, field);
+ for (int i = 0; i < listFromJson.length(); i++) {
+ Map<String, Object> convertStringToMap = convertStringToMap(listFromJson.getString(i));
+ list.add(convertStringToMap);
+ }
+ return list;
+
+ }
+
+ public static Map<String, Object> getJsonValueAsMap(RestResponse response, String key) {
+ String valueField = getValueFromJsonResponse(response.getResponse(), key);
+ Map<String, Object> convertToMap = convertStringToMap(valueField);
+ return convertToMap;
+ }
+
+ public static String getJsonObjectValueByKey(String metadata, String key) {
+ JsonElement jelement = new JsonParser().parse(metadata);
+
+ JsonObject jobject = jelement.getAsJsonObject();
+ Object obj = jobject.get(key);
+ if (obj == null) {
+ return null;
+ } else {
+ return obj.toString();
+ }
+ }
+
+ public static Map<String, List<Component>> convertCatalogResponseToJavaObject(String response) {
+ Map<String, List<Component>> map = new HashMap<>();
+
+ JsonElement jElement = new JsonParser().parse(response);
+ JsonObject jObject = jElement.getAsJsonObject();
+ JsonArray jArrReousrces = jObject.getAsJsonArray("resources");
+ JsonArray jArrServices = jObject.getAsJsonArray("services");
+
+ if (jArrReousrces != null && jArrServices != null) {
+ //////// RESOURCE/////////////////////////////
+ ArrayList<Component> restResponseArray = new ArrayList<>();
+ Component component = null;
+ for (int i = 0; i < jArrReousrces.size(); i++) {
+ String resourceString = (String) jArrReousrces.get(i).toString();
+ component = ResponseParser.convertResourceResponseToJavaObject(resourceString);
+ restResponseArray.add(component);
+ }
+
+ map.put("resources", restResponseArray);
+
+ ///////// SERVICE/////////////////////////////
+
+ restResponseArray = new ArrayList<>();
+ component = null;
+ for (int i = 0; i < jArrServices.size(); i++) {
+ String resourceString = (String) jArrServices.get(i).toString();
+ component = ResponseParser.convertServiceResponseToJavaObject(resourceString);
+ restResponseArray.add(component);
+ }
+
+ map.put("services", restResponseArray);
+
+ } else {
+ map.put("resources", new ArrayList<>());
+ map.put("services", new ArrayList<>());
+ }
+
+ return map;
+
+ }
+
+ public static Map<Long, ServiceDistributionStatus> convertServiceDistributionStatusToObject(String response) throws ParseException {
+
+ Map<Long, ServiceDistributionStatus> serviceDistributionStatusMap = new HashMap<>();
+ ServiceDistributionStatus serviceDistributionStatusObject = null;
+
+ JsonElement jElement = new JsonParser().parse(response);
+ JsonObject jObject = jElement.getAsJsonObject();
+ JsonArray jDistrStatusArray = jObject.getAsJsonArray("distributionStatusOfServiceList");
+
+ for (int i = 0; i < jDistrStatusArray.size(); i++) {
+ Gson gson = new Gson();
+ String servDistrStatus = gson.toJson(jDistrStatusArray.get(i));
+ serviceDistributionStatusObject = gson.fromJson(servDistrStatus, ServiceDistributionStatus.class);
+ serviceDistributionStatusMap.put(Utils.getEpochTimeFromUTC(serviceDistributionStatusObject.getTimestamp()), serviceDistributionStatusObject);
+ }
+
+ return serviceDistributionStatusMap;
+
+ }
+
+ public static Map<String, String> getPropertiesNameType(RestResponse restResponse)
+ throws JSONException {
+ Map<String, String> propertiesMap = new HashMap<>();
+ JSONArray propertiesList = getListFromJson(restResponse, "properties");
+ for (int i = 0; i < propertiesList.length(); i++) {
+ JSONObject prop = (JSONObject) JSONValue.parse(propertiesList.get(i).toString());
+ String propName = prop.get("name").toString();
+ String propType = prop.get("type").toString();
+ propertiesMap.put(propName, propType);
+ }
+
+ return propertiesMap;
+ }
+
+ public static ResourceAssetStructure getDataOutOfSearchExternalAPIResponseForResourceName(String response, String resourceName) {
+ Gson gson = new Gson();
+ JsonElement jsonElement = new JsonParser().parse(response);
+ JsonArray jsonArray = jsonElement.getAsJsonArray();
+ for (JsonElement jElement : jsonArray) {
+ ResourceAssetStructure parsedResponse = gson.fromJson(jElement, ResourceAssetStructure.class);
+
+ if (resourceName.contains(parsedResponse.getName()) && parsedResponse.getName().contains(resourceName)) {
+ return parsedResponse;
+ }
+ }
+
+ return null;
+ }
+
+ public static Map<String, VfModuleDefinition> convertVfModuleJsonResponseToJavaObject(String response) {
+
+ Yaml yaml = new Yaml();
+ InputStream inputStream = null;
+ inputStream = new ByteArrayInputStream(response.getBytes());
+ List<?> list = (List<?>) yaml.load(inputStream);
+ ObjectMapper mapper = new ObjectMapper();
+
+ VfModuleDefinition moduleDefinition;
+ Map<String, VfModuleDefinition> vfModulesMap = new HashMap<>();
+ for (Object obj : list) {
// TODO Andrey L. uncomment line below in case to ignore on unknown properties, not recommended
- mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- moduleDefinition = mapper.convertValue(obj, VfModuleDefinition.class);
- vfModulesMap.put(moduleDefinition.vfModuleModelName, moduleDefinition);
- }
- return vfModulesMap;
- }
-
- public static InterfaceDefinition convertInterfaceDefinitionResponseToJavaObject(String response) {
- ObjectMapper mapper = new ObjectMapper();
- InterfaceDefinition interfaceDefinition = null;
- try {
- mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- interfaceDefinition = mapper.readValue(response, InterfaceDefinition.class);
- logger.debug(interfaceDefinition.toString());
- }
- catch (IOException e) {
- logger.debug(e);
- }
- return interfaceDefinition;
- }
+ mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+ moduleDefinition = mapper.convertValue(obj, VfModuleDefinition.class);
+ vfModulesMap.put(moduleDefinition.vfModuleModelName, moduleDefinition);
+ }
+ return vfModulesMap;
+ }
+
+ public static InterfaceDefinition convertInterfaceDefinitionResponseToJavaObject(String response) {
+ ObjectMapper mapper = new ObjectMapper();
+ InterfaceDefinition interfaceDefinition = null;
+ try {
+ mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+ interfaceDefinition = mapper.readValue(response, InterfaceDefinition.class);
+ logger.debug(interfaceDefinition.toString());
+ } catch (IOException e) {
+ logger.debug(e);
+ }
+ return interfaceDefinition;
+ }
}
diff --git a/integration-tests/src/test/resources/ci/conf/log4j2.properties b/integration-tests/src/test/resources/ci/conf/log4j2.properties
deleted file mode 100644
index a8944dba13..0000000000
--- a/integration-tests/src/test/resources/ci/conf/log4j2.properties
+++ /dev/null
@@ -1,46 +0,0 @@
-status = error
-dest = err
-name = PropertiesConfig
-
-property.filename = ${targetlog}logs/ci-log.out
-
-#filter.threshold.type = ThresholdFilter
-#filter.threshold.level = debug
-
-appender.rolling.type = RollingFile
-appender.rolling.name = RollingFile
-appender.rolling.fileName = ${filename}
-appender.rolling.filePattern = ${targetlog}logs/ci-%d{MM-dd-yy-HH-mm-ss}-%i.log.gz
-appender.rolling.layout.type = PatternLayout
-appender.rolling.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %5p [%10c] : %m%n
-appender.rolling.policies.type = Policies
-appender.rolling.policies.size.type = SizeBasedTriggeringPolicy
-appender.rolling.policies.size.size=5MB
-appender.rolling.strategy.type = DefaultRolloverStrategy
-appender.rolling.strategy.max = 10
-
-appender.console.type = Console
-appender.console.name = STDOUT
-appender.console.layout.type = PatternLayout
-appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %5p %10c:%L - %m%n
-appender.console.filter.threshold.type = ThresholdFilter
-appender.console.filter.threshold.level = info
-
-logger.rolling.name = RollingAppender
-logger.rolling.level = info
-logger.rolling.additivity = false
-logger.rolling.appenderRef.rolling.ref = RollingFile
-
-logger.org.apache.cassandra.service.StorageProxy.level=info
-logger.org.janusgraph.diskstorage.cassandra.CassandraTransaction.level =info
-logger.org.janusgraph.diskstorage.cassandra.CassandraTransaction.appendRef.rolling.ref = RollingFile
-logger.org.janusgraph.diskstorage.cassandra.CassandraTransaction.appendRef.stdout.ref = STDOUT
-
-logger.org.openecomp.sdc.ci.tests.utils.level = info
-logger.org.openecomp.sdc.ci.tests.utils.appendRef.rolling.ref = RollingFile
-logger.org.openecomp.sdc.ci.tests.utils.appendRef.stdout.ref = STDOUT
-logger.org.openecomp.sdc.ci.tests.utils.additivity = false
-
-rootLogger.level = info
-rootLogger.appenderRef.stdout.ref = STDOUT
-rootLogger.appenderRef.rolling.ref = RollingFile
diff --git a/integration-tests/src/test/resources/ci/conf/log4j2.xml b/integration-tests/src/test/resources/ci/conf/log4j2.xml
deleted file mode 100644
index 5295d45a47..0000000000
--- a/integration-tests/src/test/resources/ci/conf/log4j2.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="ERROR">
- <Appenders>
- <File name="fileAppender" fileName="logfile.log" append="false">
- <PatternLayout pattern="%d %-5p [%c{1}] %m %n"/>
- </File>
- </Appenders>
- <Loggers>
- <Root level="info">
- <AppenderRef ref="fileAppender"/>
- </Root>
- </Loggers>
-</Configuration> \ No newline at end of file
diff --git a/integration-tests/src/test/resources/ci/testSuites/backend/CRUDArtifacts.xml b/integration-tests/src/test/resources/ci/testSuites/backend/CRUDArtifacts.xml
index 0306e469ea..2dedb4ea64 100644
--- a/integration-tests/src/test/resources/ci/testSuites/backend/CRUDArtifacts.xml
+++ b/integration-tests/src/test/resources/ci/testSuites/backend/CRUDArtifacts.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="CRUDArtifacts" configfailurepolicy="continue" verbose="2" parallel="tests" thread-count="10">
+<suite name="CRUDArtifacts" configfailurepolicy="continue" parallel="tests" thread-count="10">
<test name="Test">
<classes>
diff --git a/integration-tests/src/test/resources/ci/testSuites/backend/ExternalApiSanity.xml b/integration-tests/src/test/resources/ci/testSuites/backend/ExternalApiSanity.xml
index b17a8e69a0..8b86c7ab13 100644
--- a/integration-tests/src/test/resources/ci/testSuites/backend/ExternalApiSanity.xml
+++ b/integration-tests/src/test/resources/ci/testSuites/backend/ExternalApiSanity.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="CRUDArtifacts" configfailurepolicy="continue" verbose="2" parallel="methods" thread-count="2" data-provider-thread-count="2">
+<suite name="CRUDArtifacts" configfailurepolicy="continue" parallel="methods" thread-count="2" data-provider-thread-count="2">
<test name="Test">
<classes>
diff --git a/integration-tests/src/test/resources/ci/testSuites/backend/SearchExternalAPI.xml b/integration-tests/src/test/resources/ci/testSuites/backend/SearchExternalAPI.xml
index b401c281bf..b65db48263 100644
--- a/integration-tests/src/test/resources/ci/testSuites/backend/SearchExternalAPI.xml
+++ b/integration-tests/src/test/resources/ci/testSuites/backend/SearchExternalAPI.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="CRUDArtifacts" configfailurepolicy="continue" verbose="2" parallel="tests" thread-count="10">
+<suite name="CRUDArtifacts" configfailurepolicy="continue" parallel="tests" thread-count="10">
<test name="Test">
<classes>
diff --git a/integration-tests/src/test/resources/ci/testSuites/backend/ciFull.xml b/integration-tests/src/test/resources/ci/testSuites/backend/ciFull.xml
index 963c568a8f..18be6fa488 100644
--- a/integration-tests/src/test/resources/ci/testSuites/backend/ciFull.xml
+++ b/integration-tests/src/test/resources/ci/testSuites/backend/ciFull.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="ciFull" configfailurepolicy="continue" verbose="2">
+<suite name="ciFull" configfailurepolicy="continue">
<test name="Category">
<classes>
<class name="org.onap.sdc.backend.ci.tests.execute.category.CatalogDataApiTest"/>
diff --git a/integration-tests/src/test/resources/ci/testSuites/backend/externalAPIs.xml b/integration-tests/src/test/resources/ci/testSuites/backend/externalAPIs.xml
index 637ec3e4fa..41d6f6ec67 100644
--- a/integration-tests/src/test/resources/ci/testSuites/backend/externalAPIs.xml
+++ b/integration-tests/src/test/resources/ci/testSuites/backend/externalAPIs.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="externalApis" configfailurepolicy="continue" verbose="2" parallel="methods" thread-count="1" data-provider-thread-count="8">
+<suite name="externalApis" configfailurepolicy="continue" parallel="methods" thread-count="1" data-provider-thread-count="8">
<test name="ExternalApis">
<classes>
diff --git a/integration-tests/src/test/resources/ci/testSuites/backend/onapApiSanity.xml b/integration-tests/src/test/resources/ci/testSuites/backend/onapApiSanity.xml
index 9f189107a5..8d5d2b2f08 100644
--- a/integration-tests/src/test/resources/ci/testSuites/backend/onapApiSanity.xml
+++ b/integration-tests/src/test/resources/ci/testSuites/backend/onapApiSanity.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="externalApis" configfailurepolicy="continue" verbose="2" parallel="methods" thread-count="1" data-provider-thread-count="1">
+<suite name="externalApis" configfailurepolicy="continue" parallel="methods" thread-count="1" data-provider-thread-count="1">
<parameter name="makeDistribution" value="false"/>
<parameter name="makeToscaValidation" value="true"/>
<test name="ExternalApis">
diff --git a/integration-tests/src/test/resources/ci/testSuites/backend/pass.xml b/integration-tests/src/test/resources/ci/testSuites/backend/pass.xml
index 00df382cef..c124a4daac 100644
--- a/integration-tests/src/test/resources/ci/testSuites/backend/pass.xml
+++ b/integration-tests/src/test/resources/ci/testSuites/backend/pass.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="externalApis" configfailurepolicy="continue" verbose="2" parallel="methods" thread-count="1" data-provider-thread-count="1">
+<suite name="externalApis" configfailurepolicy="continue" parallel="methods" thread-count="1" data-provider-thread-count="1">
<parameter name="makeDistribution" value="false"/>
<parameter name="makeToscaValidation" value="true"/>
<test name="passTest">
diff --git a/integration-tests/src/test/resources/ci/testSuites/backend/productAPIs.xml b/integration-tests/src/test/resources/ci/testSuites/backend/productAPIs.xml
index bd5f06da15..ac7af87186 100644
--- a/integration-tests/src/test/resources/ci/testSuites/backend/productAPIs.xml
+++ b/integration-tests/src/test/resources/ci/testSuites/backend/productAPIs.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="productAPIs" configfailurepolicy="continue" verbose="2" parallel="tests"
+<suite name="productAPIs" configfailurepolicy="continue" parallel="tests"
thread-count="6">
<test name="Test">
diff --git a/integration-tests/src/test/resources/ci/testSuites/backend/resource.xml b/integration-tests/src/test/resources/ci/testSuites/backend/resource.xml
index c2dd49011c..25fc105811 100644
--- a/integration-tests/src/test/resources/ci/testSuites/backend/resource.xml
+++ b/integration-tests/src/test/resources/ci/testSuites/backend/resource.xml
@@ -2,7 +2,7 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Sanity" configfailurepolicy="continue">
- <test verbose="2" name="Sanity">
+ <test name="Sanity">
<classes>
<class name="org.onap.sdc.backend.ci.tests.execute.category.CatalogDataApiTest"/>
diff --git a/integration-tests/src/test/resources/ci/testSuites/backend/sanity.xml b/integration-tests/src/test/resources/ci/testSuites/backend/sanity.xml
index 09323f2ea2..cc4aeda100 100644
--- a/integration-tests/src/test/resources/ci/testSuites/backend/sanity.xml
+++ b/integration-tests/src/test/resources/ci/testSuites/backend/sanity.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="Sanity" configfailurepolicy="continue" verbose="2">
+<suite name="Sanity" configfailurepolicy="continue">
<test name="sanityE2Eflows">
<classes>
diff --git a/integration-tests/src/test/resources/logback.xml b/integration-tests/src/test/resources/logback.xml
new file mode 100644
index 0000000000..559b69534a
--- /dev/null
+++ b/integration-tests/src/test/resources/logback.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+ <property scope="system" name="ECOMP-component-name" value="SDC"/>
+ <property scope="system" name="ECOMP-subcomponent-name" value="SDC-TOOL"/>
+ <property name="default-log-pattern"
+ value="%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX}|%X{uuid}|%X{serviceInstanceID}|%thread||${ECOMP-subcomponent-name}|%X{userId}|%level|%X{alarmSeverity}|%X{localAddr}|${beFqdn}|%X{remoteAddr}|%logger{35}|%X{timer}|ActivityType=&lt;%M&gt;, Desc=&lt;%msg&gt;%n"/>
+
+
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>${default-log-pattern}</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="DEBUG_ROLLING"
+ class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${HOME}/asdctool/logs/${ECOMP-component-name}/${ECOMP-subcomponent-name}/debug.log</file>
+
+
+ <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
+ <fileNamePattern>${HOME}/asdctool/logs/${ECOMP-component-name}/${ECOMP-subcomponent-name}/debug.log.%i
+ </fileNamePattern>
+ <minIndex>1</minIndex>
+ <maxIndex>10</maxIndex>
+ </rollingPolicy>
+
+ <triggeringPolicy
+ class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+ <maxFileSize>20MB</maxFileSize>
+ </triggeringPolicy>
+ <encoder>
+ <pattern>${default-log-pattern}</pattern>
+ </encoder>
+ </appender>
+
+ <root level="INFO">
+ <appender-ref ref="DEBUG_ROLLING"/>
+ <appender-ref ref="STDOUT"/>
+ </root>
+
+ <logger name="org.openecomp.sdc" level="INFO"/>
+ <logger name="org.openecomp.sdc.asdctool.migration" level="INFO"/>
+
+</configuration>
diff --git a/test-apis-ci/.gitignore b/test-apis-ci/.gitignore
deleted file mode 100644
index 9b563712b6..0000000000
--- a/test-apis-ci/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-/target
-/build/
-/bin/
-/target/
diff --git a/test-apis-ci/pom.xml b/test-apis-ci/pom.xml
index 0037c41eae..e69de29bb2 100644
--- a/test-apis-ci/pom.xml
+++ b/test-apis-ci/pom.xml
@@ -1,668 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <artifactId>test-apis-ci</artifactId>
-
- <parent>
- <groupId>org.openecomp.sdc</groupId>
- <artifactId>sdc-main</artifactId>
- <version>1.7.0-SNAPSHOT</version>
- </parent>
-
- <properties>
- <sonar.skip>true</sonar.skip>
- <mockserver.netty.version>5.5.4</mockserver.netty.version>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- <version>${guava.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${junit.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter</artifactId>
- <version>${junitJupiter.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-junit-jupiter</artifactId>
- <version>${mockitoJupiter.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.assertj</groupId>
- <artifactId>assertj-core</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-all</artifactId>
- <version>${hamcrest-all.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- <version>${testng.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>com.aventstack</groupId>
- <artifactId>extentreports</artifactId>
- <version>3.0.6</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>com.typesafe</groupId>
- <artifactId>config</artifactId>
- <version>1.0.2</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-core</artifactId>
- <version>${log4j.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>com.jcraft.jsch</groupId>
- <artifactId>com.springsource.com.jcraft.jsch</artifactId>
- <version>0.1.41</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.openecomp.sdc</groupId>
- <artifactId>common-app-api</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.openecomp.sdc.be</groupId>
- <artifactId>common-be</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <!-- CHECK CATLOG MODEL -->
- <dependency>
- <groupId>org.openecomp.sdc.be</groupId>
- <artifactId>catalog-model</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <!-- catalog dao -->
- <dependency>
- <groupId>org.openecomp.sdc.be</groupId>
- <artifactId>catalog-dao</artifactId>
- <version>${project.version}</version>
- </dependency>
- <!-- functional java -->
- <dependency>
- <groupId>org.functionaljava</groupId>
- <artifactId>functionaljava</artifactId>
- <version>${functionaljava.version}</version>
- <scope>compile</scope>
- </dependency>
- <!-- CASSANDRA -->
- <dependency>
- <groupId>com.datastax.cassandra</groupId>
- <artifactId>cassandra-driver-core</artifactId>
- <version>${cassandra.driver.version}</version>
- <scope>compile</scope>
- </dependency>
- <!-- CASSANDRA END -->
-
- <!-- slf4j + logback -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>${slf4j-api.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- <version>${logback.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-core</artifactId>
- <version>${logback.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>com.googlecode.json-simple</groupId>
- <artifactId>json-simple</artifactId>
- <version>${json-simple.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <!-- File changes listener -->
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-jci-core</artifactId>
- <version>${commons-jci-core.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>${commons-codec}</version>
- <scope>compile</scope>
- </dependency>
-
- <!-- Gson -->
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <version>${gson.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <!-- Snake Yaml -->
- <dependency>
- <groupId>org.yaml</groupId>
- <artifactId>snakeyaml</artifactId>
- <version>${snakeyaml.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <!-- http client -->
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
- <version>${httpclient.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpmime</artifactId>
- <version>${httpclient.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>2.5</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>${commons-logging}</version>
- <scope>compile</scope>
- </dependency>
-
- <!-- http core -->
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpcore</artifactId>
- <version>${httpcore.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.janusgraph</groupId>
- <artifactId>janusgraph-core</artifactId>
- <version>${janusgraph.version}</version>
- <scope>compile</scope>
- <exclusions>
- <exclusion>
- <artifactId>slf4j-log4j12</artifactId>
- <groupId>org.slf4j</groupId>
- </exclusion>
- <exclusion>
- <artifactId>commons-collections</artifactId>
- <groupId>commons-collections</groupId>
- </exclusion>
- <exclusion>
- <artifactId>groovy</artifactId>
- <groupId>org.codehaus.groovy</groupId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.thrift</groupId>
- <artifactId>libthrift</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>com.clearspring.analytics</groupId>
- <artifactId>stream</artifactId>
- <version>${clearspring.version}</version>
- </dependency>
- <dependency>
- <groupId>org.janusgraph</groupId>
- <artifactId>janusgraph-cql</artifactId>
- <version>${janusgraph.version}</version>
- <scope>compile</scope>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.json</groupId>
- <artifactId>json</artifactId>
- </exclusion>
- <exclusion>
- <artifactId>commons-collections</artifactId>
- <groupId>commons-collections</groupId>
- </exclusion>
- <exclusion>
- <artifactId>groovy</artifactId>
- <groupId>org.codehaus.groovy</groupId>
- </exclusion>
- <exclusion>
- <groupId>io.netty</groupId>
- <artifactId>netty-all</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- <version>${jackson.version}</version>
- <exclusions>
- <exclusion>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- <version>${jackson.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.onap.portal.sdk</groupId>
- <artifactId>epsdk-fw</artifactId>
- <version>${ecomp.version}</version>
- <scope>compile</scope>
- <exclusions>
- <exclusion>
- <artifactId>slf4j-log4j12</artifactId>
- <groupId>org.slf4j</groupId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.json</groupId>
- <artifactId>json</artifactId>
- <version>20131018</version>
- </dependency>
-
- <dependency>
- <groupId>org.onap.sdc.sdc-tosca</groupId>
- <artifactId>sdc-tosca</artifactId>
- <version>${sdc-tosca-parser.version}</version>
- </dependency>
-
- <dependency>
- <groupId>io.cucumber</groupId>
- <artifactId>cucumber-junit</artifactId>
- <version>${cucumber.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>io.cucumber</groupId>
- <artifactId>cucumber-core</artifactId>
- <version>${cucumber.version}</version>
- </dependency>
-
- <dependency>
- <groupId>io.cucumber</groupId>
- <artifactId>gherkin</artifactId>
- <version>13.0.0</version>
- </dependency>
- <dependency>
- <groupId>io.cucumber</groupId>
- <artifactId>cucumber-java</artifactId>
- <version>${cucumber.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>io.cucumber</groupId>
- <artifactId>cucumber-jvm-deps</artifactId>
- <version>1.0.6</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.mock-server</groupId>
- <artifactId>mockserver-netty</artifactId>
- <version>${mockserver.netty.version}</version>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <artifactId>commons-collections</artifactId>
- <groupId>commons-collections</groupId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.openecomp.sdc.sdc-distribution-client</groupId>
- <artifactId>sdc-distribution-client</artifactId>
- <version>1.2.2</version>
- <scope>test</scope>
- </dependency>
-
- <!-- With TestNG -->
- <dependency>
- <groupId>io.cucumber</groupId>
- <artifactId>cucumber-testng</artifactId>
- <version>${cucumber.version}</version>
- </dependency>
-
- <!-- spring -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- <version>${spring.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <!-- CASSANDRA -->
- <dependency>
- <groupId>com.datastax.cassandra</groupId>
- <artifactId>cassandra-driver-mapping</artifactId>
- <version>${cassandra.driver.version}</version>
- <scope>compile</scope>
- </dependency>
- <!-- CASSANDRA END -->
-
- <dependency>
- <groupId>org.codehaus.groovy</groupId>
- <artifactId>groovy</artifactId>
- </dependency>
-
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-all</artifactId>
- </dependency>
-
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-handler</artifactId>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-clean-plugin</artifactId>
- <executions>
- <execution>
- <id>clean.testsuit.folder</id>
- <phase>clean</phase>
- <goals>
- <goal>clean</goal>
- </goals>
- <configuration>
- <filesets>
- <!-- Sanity jar -->
- <fileset>
- <directory>${project.basedir}/sdc-api-tests</directory>
- <followSymlinks>false</followSymlinks>
- <includes>
- <include>*.jar</include>
- </includes>
- </fileset>
- <!-- Sanity test suites -->
- <fileset>
- <directory>
- ${project.basedir}/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/testSuites
- </directory>
- <followSymlinks>false</followSymlinks>
- </fileset>
- </filesets>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-deploy-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
-
- <!-- ============================================= -->
- <!-- Create the JAR file with its dependencies -->
- <!-- ============================================= -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>create.jar.with.dependencies</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- <configuration>
- <archive>
- <manifest>
- <mainClass>org.openecomp.sdc.ci.tests.run.StartTest</mainClass>
- </manifest>
- </archive>
- <descriptorRefs>
- <descriptorRef>jar-with-dependencies</descriptorRef>
- </descriptorRefs>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>com.github.sylvainlaurent.maven</groupId>
- <artifactId>yaml-json-validator-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>validate</id>
- <phase>validate</phase>
- <goals>
- <goal>validate</goal>
- </goals>
- <configuration>
- <validationSets>
- <validationSet>
- <includes>
- <include>src/main/resources/**/*.y*ml</include>
- <include>src/test/resources/**/*.y*ml</include>
- </includes>
- <excludes>
- <exclude>
- src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure*.y*ml
- </exclude>
- <exclude>
- src/test/resources/CI/tests/importToscaResourceByCreateUrl/noContent*.y*ml
- </exclude>
- <exclude>src/test/resources/CI/tests/HeatDeploymentArtifacts/invalid*.y*ml
- </exclude>
- </excludes>
- </validationSet>
- <validationSet>
- <includes>
- <include>src/main/resources/**/*.json</include>
- <include>src/test/resources/**/*.json</include>
- </includes>
- <excludes>
- <exclude>src/test/resources/CI/tests/HeatDeploymentArtifacts/invalid*.json
- </exclude>
- </excludes>
- </validationSet>
- </validationSets>
- <skip>${skipYamlJsonValidator}</skip>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- <profiles>
- <profile>
- <id>docker</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- <executions>
- <execution>
- <id>copy-tests-suites</id>
- <phase>verify</phase>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <configuration>
- <outputDirectory>
- sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/testSuites
- </outputDirectory>
- <resources>
- <resource>
- <directory>
- ${project.parent.basedir}/test-apis-ci/src/main/resources/ci/testSuites
- </directory>
- <includes>
- <include>*</include>
- </includes>
- </resource>
- </resources>
- </configuration>
- </execution>
-
- <execution>
- <id>copy-resources-test-apis-ci</id>
- <phase>verify</phase>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <configuration>
- <outputDirectory>sdc-api-tests</outputDirectory>
- <resources>
- <resource>
- <directory>${project.parent.basedir}/test-apis-ci/target</directory>
- <includes>
- <include>test-apis-ci-${project.version}-jar-with-dependencies.jar</include>
- </includes>
- </resource>
- </resources>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>io.fabric8</groupId>
- <artifactId>docker-maven-plugin</artifactId>
- <configuration>
- <apiVersion>1.23</apiVersion>
- <registry>nexus3.onap.org:10001</registry>
- <authConfig>
- <pull>
- <username>docker</username>
- <password>docker</password>
- </pull>
- </authConfig>
- <images>
- <!-- Build sanity image -->
- <image>
- <name>onap/sdc-api-tests</name>
- <alias>sdc-api-tests</alias>
- <build>
- <cleanup>try</cleanup>
- <dockerFileDir>${project.basedir}/sdc-api-tests</dockerFileDir>
- <tags>
- <tag>${docker.tag}</tag>
- <tag>
- ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-latest
- </tag>
- </tags>
- </build>
- </image>
- </images>
- </configuration>
- <executions>
- <execution>
- <id>clean-images</id>
- <phase>pre-clean</phase>
- <goals>
- <goal>remove</goal>
- </goals>
- <configuration>
- <removeAll>true</removeAll>
- <image>onap/sdc-api-tests</image>
- </configuration>
- </execution>
-
- <execution>
- <id>generate-images</id>
- <phase>install</phase>
- <goals>
- <goal>build</goal>
- </goals>
- </execution>
-
- <execution>
- <id>push-images</id>
- <phase>deploy</phase>
- <goals>
- <goal>push</goal>
- </goals>
- <configuration>
- <image>onap/sdc-api-tests</image>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
diff --git a/test-apis-ci/sdc-api-tests/Dockerfile b/test-apis-ci/sdc-api-tests/Dockerfile
deleted file mode 100644
index 3a232efb5c..0000000000
--- a/test-apis-ci/sdc-api-tests/Dockerfile
+++ /dev/null
@@ -1,28 +0,0 @@
-FROM onap/base_sdc-sanity:1.7.0
-
-# install packages
-RUN \
- apk update \
- && \
- apk add --no-cache \
- jq \
- openssl \
- && \
- rm -rf /var/cache/apk/*
-
-COPY chef-solo /root/chef-solo/
-
-COPY chef-repo/cookbooks/. /root/chef-solo/cookbooks/
-
-
-ENV TESTS_BASE /var/lib/tests
-RUN mkdir -p "$TESTS_BASE"
-WORKDIR $TESTS_BASE
-
-ADD test-apis-ci-*.jar ${TESTS_BASE}/
-
-COPY startup.sh /root/
-
-RUN chmod 770 /root/startup.sh
-
-ENTRYPOINT [ "/root/startup.sh" ]
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/attributes/default.rb b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/attributes/default.rb
deleted file mode 100644
index 4287ca8617..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/attributes/default.rb
+++ /dev/null
@@ -1 +0,0 @@
-# \ No newline at end of file
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/PNFs/pmDictionary.yml b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/PNFs/pmDictionary.yml
deleted file mode 100644
index fa3ed531e7..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/PNFs/pmDictionary.yml
+++ /dev/null
@@ -1,98 +0,0 @@
----
-# PM Dictionary Schema
-pmMetaData: { presence: required, structure: {
- pmHeader: { presence: required, structure: {
- pmDefVsn: { presence: required, comment: “Version of the PM Dictionary artifact that contains this measurement. Vendor defined.”},
- pmDefSchemaVsn: { presence: required, comment: “PM Dictionary schema version from the VES Event Registration specification.”},
- nfType: { presence: required, comment: “NF type to whom this measurement applies. This should match the nfName-vendor string used in the fileReady or perf3gpp eventName.”}
- } } ,
- pmFields: { presence: required, structure: {
- measType: { presence: required, comment: “Measurement name used in PM file, in 3GPP format where specified, else vendor defined. Names for 3GPP-defined 4G measurements are specified in 3GPP TS 32.425 item e). Names for 3GPP-defined 5G measurements are specified in 3GPP TS 28.552 item e). Vendor defined names are preceded with VS.”},
- iMeasType: { presence: required, comment: “Vendor defined integer identifier for the measType, used for efficiency in GPB. Must be combined with measInfoId to identify a specific measurement.”},
- measDescription: { presence: required, comment: “Text description of the purpose of the measurement, what information does the measurement provide.”},
- measCondition: { presence: required, comment: “Text description of the condition that causes the measurement to be updated.”},
- measResultType: { presence: required, value: [integer], comment: “Data type of the measurement result.”},
- measResultRange: { presence: optional, comment: “Range of the measurement result. Only necessary when the range is smaller than the full range of the data type.”},
- measResultUnits: { presence: required, value: [seconds, minutes, nanoseconds, microseconds, dB, number, kilobytes, bytes, ethernetFrames, packets, users], comment: “Units of measure of the measurement result.”},
- measObjClass: { presence: required, comment: “Object class of the measurement.”},
- measCollectionMethod: { presence: required, value: [CC, SI, DER, Gauge, Average], comment: “Measurement collection method of the measurement. CC, SI, DER and Gauge are as defined in 3GPP. Average contains the average value of the measurement during the granularity period.”},
- measLastChange: { presence: required, comment: “Version of the PM Dictionary artifact the last time this measurement was added, modified or deleted.”},
- measChangeType: { presence: required, value: [added, modified, deleted], comment: “Indicates the type of change that occurred during the measLastChange.”},
- measInfoId: { presence: required, comment: “Name for a group of related measurements, in 3GPP format where specified, else vendor defined. Family names for 3GPP-defined 4G measurements are specified in 3GPP TS 32.425 Section 3.1. Family names for 3GPP-defined 5G measurements are specified in 3GPP TS 28.552 Section 3.4.”},
- iMeasInfoId: { presence: required, comment: “Vendor defined integer identifier for the measInfoId, used for efficiency in GPB.”},
- measFamily: { presence: required, comment: “Abbreviation for a family of measurements, in 3GPP format where specified, else vendor defined.”},
- measAdditionalFields: { presence: required, comment: “This section contains vendor specific measurement fields.”, structure: {
- measAggregationLevels: { presence: required, value: [NRBTS, NRCellCU, NRCellDU, IPNO, IPSEC, ETHIF], comment: “A list of one or more aggregations levels that Nokia recommends for this measurement. For example, if the value is NRBTS NRCellCU, then Nokia recommends that this measurement be aggregated on the 5G BTS level and the 5G CU Cell level.”},
- measTriggerType: { presence: optional, value: [Event, Sample], comment: “Indicates whether this measurement is triggered by an event or is sampled.”}
- } }
- } }
-} }
----
-pmMetaData:
- pmHeader:
- nfType: gnb-Nokia
- pmDefSchemaVsn: 2.0
- pmDefVsn: 5G19_1906_002
- pmFields:
- iMeasInfoId: 2204
- iMeasType: 1
- measCollectionMethod: CC
- measCondition: "This measurement is updated when X2AP: SgNB Modification Required message is sent to MeNB with the SCG Change Indication set as PSCellChange."
- measDescription: "This counter indicates the number of intra gNB intra frequency PSCell change attempts."
- measFamily: NINFC
- measInfoId: "NR Intra Frequency PSCell Change"
- measLastChange: 5G18A_1807_003
- measObjClass: NGCELL
- measResultRange: 0-4096
- measResultType: integer
- measResultUnits: number
- measType: VS.NINFC.IntraFrPscelChAttempt
- measAdditionalFields:
- vendorField1: X
- vendorField2: B
----
-pmMetaData:
- pmHeader:
- nfType: gnb-Nokia
- pmDefSchemaVsn: 2.0
- pmDefVsn: 5G19_1906_002
- pmFields:
- iMeasInfoId: 2204
- iMeasType: 2
- measCollectionMethod: CC
- measCondition: "This measurement is updated when the TDCoverall timer has elapsed before gNB receives the X2AP: SgNB Modification Confirm message."
- measDescription: "This measurement the number of intra gNB intra frequency PSCell change failures due to TDCoverall timer expiry."
- measFamily: NINFC
- measInfoId: "NR Intra Frequency PSCell Change"
- measLastChange: 5G18A_1807_003
- measObjClass: NGCELL
- measResultRange: 0-4096
- measResultType: integer
- measResultUnits: number
- measType: VS.NINFC.IntraFrPscelChFailTdcExp
- measAdditionalFields:
- vendorField1: Y
----
-pmMetaData:
- pmHeader:
- nfType: gnb-Nokia
- pmDefSchemaVsn: 2.0
- pmDefVsn: 5G19_1906_002
- pmFields:
- iMeasInfoId: 2206
- iMeasType: 1
- measCollectionMethod: CC
- measCondition: "This measurement is updated when MeNB replies to X2AP: SgNB Modification Required message with the X2AP: SgNB Modification Refuse message."
- measDescription: "This counter indicates the number of intra gNB intra frequency PSCell change failures due to MeNB refusal."
- measFamily: NINFC
- measInfoId: "NR Intra Frequency PSCell Change"
- measLastChange: 5G19_1906_002
- measObjClass: NGCELL
- measResultRange: 0-4096
- measResultType: integer
- measResultUnits: number
- measType: VS.NINFC.IntraFrPscelChFailMenbRef
- measAdditionalFields:
- vendorField1: Z
- vendorField2: A
-...
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/PNFs/sample-pnf-1.0.1-SNAPSHOT.csar b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/PNFs/sample-pnf-1.0.1-SNAPSHOT.csar
deleted file mode 100644
index b4d2b3eda3..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/PNFs/sample-pnf-1.0.1-SNAPSHOT.csar
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/PNFs/sample-pnf-custom-type.csar b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/PNFs/sample-pnf-custom-type.csar
deleted file mode 100644
index e4e60b26d1..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/PNFs/sample-pnf-custom-type.csar
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/PNFs/sample-signed-pnf-1.0.1-SNAPSHOT.zip b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/PNFs/sample-signed-pnf-1.0.1-SNAPSHOT.zip
deleted file mode 100644
index fecb45aaaf..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/PNFs/sample-signed-pnf-1.0.1-SNAPSHOT.zip
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/PNFs/sample-signed-pnf-cms-includes-cert-1.0.1-SNAPSHOT.zip b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/PNFs/sample-signed-pnf-cms-includes-cert-1.0.1-SNAPSHOT.zip
deleted file mode 100644
index 676a9ff777..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/PNFs/sample-signed-pnf-cms-includes-cert-1.0.1-SNAPSHOT.zip
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/Huawei_vHSS.csar b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/Huawei_vHSS.csar
deleted file mode 100644
index 316d5690f5..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/Huawei_vHSS.csar
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/Huawei_vMME.csar b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/Huawei_vMME.csar
deleted file mode 100644
index fe313fff86..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/Huawei_vMME.csar
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/ZteEpcMmeVf.csar b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/ZteEpcMmeVf.csar
deleted file mode 100644
index 184c223ec2..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/ZteEpcMmeVf.csar
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/base_vfw.zip b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/base_vfw.zip
deleted file mode 100644
index b8273defea..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/base_vfw.zip
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/base_vvg.zip b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/base_vvg.zip
deleted file mode 100644
index dc9ef5d823..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/base_vvg.zip
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/database-substitution-mappings.csar b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/database-substitution-mappings.csar
deleted file mode 100644
index 6fbf240977..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/database-substitution-mappings.csar
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/infra.zip b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/infra.zip
deleted file mode 100644
index 09eb9cd648..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/infra.zip
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/resource-ZteEpcMmeVf-csar_fix.csar b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/resource-ZteEpcMmeVf-csar_fix.csar
deleted file mode 100644
index 72d3d0c869..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/resource-ZteEpcMmeVf-csar_fix.csar
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vLB.zip b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vLB.zip
deleted file mode 100644
index b61ca1b83b..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vLB.zip
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vLBMS.zip b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vLBMS.zip
deleted file mode 100644
index c542870bad..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vLBMS.zip
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vSBC_update_v03.csar b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vSBC_update_v03.csar
deleted file mode 100644
index 65d66cd693..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vSBC_update_v03.csar
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vbng.zip b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vbng.zip
deleted file mode 100644
index ab5163d9ed..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vbng.zip
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vbrgemu.zip b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vbrgemu.zip
deleted file mode 100644
index 28c69a570f..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vbrgemu.zip
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vesEvent.yml b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vesEvent.yml
deleted file mode 100644
index ce6a152154..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vesEvent.yml
+++ /dev/null
@@ -1,282 +0,0 @@
----
-event: {
- presence: required,
- action: [ any, any, baseStationSynchronizationProblem,
- contact technical support ],
- structure: {
- commonEventHeader: {
- presence: required,
- structure: {
- domain: {
- presence: required,
- value: fault
- },
- eventName: {
- presence: required,
- value: 'Fault_1'
- },
- eventId: {
- presence: required
- },
- nfNamingCode: {
- value: mrfx
- },
- priority: {
- presence: required,
- value: 'Medium'
- },
- reportingEntityId: {
- presence: required
- },
- reportingEntityName: {
- presence: required
- },
- sequence: {
- presence: required
- },
- sourceId: {
- presence: required
- },
- sourceName: {
- presence: required
- },
- startEpochMicrosec: {
- presence: required
- },
- lastEpochMicrosec: {
- presence: required
- },
- version: {
- presence: required,
- value: 3.0
- }
- }
- },
- faultFields: {
- presence: required,
- structure: {
- eventCategory: {
- presence: optional,
- comment: 'Equipment Alarm'
- },
- alarmCondition: {
- presence: required,
- value: alarm003
- },
- eventSeverity: {
- presence: required,
- value: MAJOR
- },
- eventSourceType: {
- presence: required,
- value: virtualNetworkFunction
- },
- faultFieldsVersion: {
- presence: required,
- value: 2.0
- },
- specificProblem: {
- presence: required,
- value: "Configuration file was corrupt or not present"
- },
- vfStatus: {
- presence: required,
- value: "Requesting Termination"
- },
- alarmAdditionalInformation: {
- required: true,
- comment: "Comment"
- }
- }
- }
- },
- comment: "comment2"
-}
-
----
-
-event: {
- presence: required,
- action: [ any, any, baseStationConnectivityLost,
- contact technical support ],
- structure: {
- commonEventHeader: {
- presence: required,
- structure: {
- domain: {
- presence: required,
- value: fault
- },
- eventName: {
- presence: required,
- value: 'Fault_2'
- },
- eventId: {
- presence: required
- },
- nfNamingCode: {
- value: mrfx
- },
- priority: {
- presence: required,
- value: 'Medium'
- },
- reportingEntityId: {
- presence: required
- },
- reportingEntityName: {
- presence: required
- },
- sequence: {
- presence: required
- },
- sourceId: {
- presence: required
- },
- sourceName: {
- presence: required
- },
- startEpochMicrosec: {
- presence: required
- },
- lastEpochMicrosec: {
- presence: required
- },
- version: {
- presence: required,
- value: 3.0
- }
- }
- },
- faultFields: {
- presence: required,
- structure: {
- eventCategory: {
- presence: optional,
- comment: 'Communications Alarm'
- },
- alarmCondition: {
- presence: required,
- value: 'baseStationConnectivityLost'
- },
- eventSeverity: {
- presence: required
- },
- eventSourceType: {
- presence: required,
- value: 'virtualNetworkFunction'
- },
- faultFieldsVersion: {
- presence: required,
- value: 2.0
- },
- specificProblem: {
- presence: required
- },
- vfStatus: {
- presence: required,
- value: "Active"
- },
- alarmAdditionalInformation: {
- required: true,
- comment: "comment'
- "
- }
- }
- }
- },
- comment: "comment2
- ",
-}
-
----
-event: {
- presence: required,
- action: [ any, any, baseStationSoftwareManagementProblem,
- contact technical support ],
- structure: {
- commonEventHeader: {
- presence: required,
- structure: {
- domain: {
- presence: required,
- value: fault
- },
- eventName: {
- presence: required,
- value: 'Fault_3'
- },
- eventId: {
- presence: required
- },
- nfNamingCode: {
- value: mrfx
- },
- priority: {
- presence: required,
- value: 'Medium'
- },
- reportingEntityId: {
- presence: required
- },
- reportingEntityName: {
- presence: required
- },
- sequence: {
- presence: required
- },
- sourceId: {
- presence: required
- },
- sourceName: {
- presence: required
- },
- startEpochMicrosec: {
- presence: required
- },
- lastEpochMicrosec: {
- presence: required
- },
- version: {
- presence: required,
- value: 3.0
- }
- }
- },
- faultFields: {
- presence: required,
- structure: {
- eventCategory: {
- presence: optional,
- comment: 'Processing Error'
- },
- alarmCondition: {
- presence: required,
- value: 'baseStationsoftwareManagementProblem'
- },
- eventSeverity: {
- presence: required
- },
- eventSourceType: {
- presence: required
- },
- faultFieldsVersion: {
- presence: required,
- value: 3.0
- },
- specificProblem: {
- presence: required
- },
- vfStatus: {
- presence: required,
- value: "Active"
- },
- alarmAdditionalInformation: {
- required: true,
- comment: "comment"
- }
- }
- }
- },
- comment: "comment2"
-} \ No newline at end of file
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vfw.zip b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vfw.zip
deleted file mode 100644
index b8273defea..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vfw.zip
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vgmux.zip b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vgmux.zip
deleted file mode 100644
index 56de952150..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vgmux.zip
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vgw.zip b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vgw.zip
deleted file mode 100644
index 7a14718c2c..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vgw.zip
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vsp-vgw.csar b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vsp-vgw.csar
deleted file mode 100644
index 316d5690f5..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vsp-vgw.csar
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vvg.zip b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vvg.zip
deleted file mode 100644
index dc9ef5d823..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files/VNFs/vvg.zip
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/cert/root.cert b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/cert/root.cert
deleted file mode 100644
index 11c827ac6f..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/cert/root.cert
+++ /dev/null
@@ -1,23 +0,0 @@
------BEGIN CERTIFICATE-----
-MIID3zCCAsegAwIBAgIUQ7qc+oRcxS9++2Vd+ufBuSRzITkwDQYJKoZIhvcNAQEL
-BQAwfzELMAkGA1UEBhMCSVIxDTALBgNVBAgMBE9OQVAxDDAKBgNVBAcMA1NEQzER
-MA8GA1UECgwIT05BUC1TREMxGDAWBgNVBAMMD29yZy5vbmFwLnNkYy5jYTEmMCQG
-CSqGSIb3DQEJARYXb25hcC1zZGNAbGlzdHMub25hcC5vcmcwHhcNMTkxMDI5MTE0
-MzU3WhcNMzkxMDI0MTE0MzU3WjB/MQswCQYDVQQGEwJJUjENMAsGA1UECAwET05B
-UDEMMAoGA1UEBwwDU0RDMREwDwYDVQQKDAhPTkFQLVNEQzEYMBYGA1UEAwwPb3Jn
-Lm9uYXAuc2RjLmNhMSYwJAYJKoZIhvcNAQkBFhdvbmFwLXNkY0BsaXN0cy5vbmFw
-Lm9yZzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANkzC40LeZGiN07u
-Sy3crOkJBwulOIXHyWfWbiTbdgd0SebPccYRke3W4IQok/X/j1pNJtgdHHVcqznn
-wVLcDoHjfy+wIX5EBv4zCDMAXDJ+NQE0HXOCiGGReUXVmnrZDDx30D0wgtZyvZlB
-ziMhshjhVsX2OlJL4Dr33ztLnNq8NvCxsTqCVoL4N5ax7Vfi8v9JQOPletdxRfpS
-UOECdpOzua+6DxWsglqKbWb0F9SWfnYRgKEqqotLDHGPKSIK9nduMLTpihqdukTN
-Ud68Jp+TvhpIX47VTW5J0n9rYvjh7pTzICKjEygWcQBIUIuAsg8e9JQoyzbPV0mp
-nQL4DwMCAwEAAaNTMFEwHQYDVR0OBBYEFLEM1nLbWBpDorCskxldxIXY3u2rMB8G
-A1UdIwQYMBaAFLEM1nLbWBpDorCskxldxIXY3u2rMA8GA1UdEwEB/wQFMAMBAf8w
-DQYJKoZIhvcNAQELBQADggEBADkYWsK8mayXAmMWll7A2VY7PIBSsoqiPAN/Vr5Y
-BUD0wnAI55CN38iD6Yg1q5u380oc7OsbonwwVE1iIgf1ptg9GOMoNqGFPXGSqobE
-JfYiFBCeXZHjbv9ZpF8/YnI2iqMV0dQGJ27uOYkFPv41HYLBYrtw+oULpcU+Bd18
-lK7JVvyKj7vn9oFZn880Jdrcm+u0FD35usCO090a1hXnmAftaBRqXK2F0fttit5n
-yu4UU9oc/e0Z24ScXBcYRorEYc7U88D6oRTz8zPp1LIcTqxIsJigbNRTGArTJLLW
-pvB8br2xl31PJ3KFTswpT8SzJN8OnuCID6Cuc4QcEzbYU7U=
------END CERTIFICATE-----
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/conf/attsdc-packages.yaml b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/conf/attsdc-packages.yaml
deleted file mode 100644
index 5d1a3e1537..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/conf/attsdc-packages.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-packages:
- - org.openecomp.sdc.ci.tests.execute.general
- - org.openecomp.sdc.ci.tests.execute.user
- - org.openecomp.sdc.ci.tests.execute.property
- - org.openecomp.sdc.ci.tests.execute.lifecycle
- - org.openecomp.sdc.ci.tests.execute.resource
- - org.openecomp.sdc.ci.tests.execute.service
- - org.openecomp.sdc.ci.tests.execute.artifacts
- - org.openecomp.sdc.ci.tests.execute.imports
- - org.openecomp.sdc.ci.tests.execute.category
- - org.openecomp.sdc.ci.tests.execute.distribution
- - org.openecomp.sdc.ci.tests.execute.product \ No newline at end of file
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/conf/credentials.yaml b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/conf/credentials.yaml
deleted file mode 100644
index 05f9a71c5c..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/conf/credentials.yaml
+++ /dev/null
@@ -1,48 +0,0 @@
- designer: {
- username: cs0008,
- password: 123123a,
- firstname: SDC,
- lastname: SDC2
- }
- admin: {
- username: jh0003,
- password: 123123a,
- firstname: SDC,
- lastname: SDC2
- }
- ops: {
- username: op0001,
- password: 123123a,
- firstname: SDC,
- lastname: SDC2
- }
- tester: {
- username: jm0007,
- password: 123123a,
- firstname: SDC,
- lastname: SDC2
- }
- governor: {
- username: gv0001,
- password: 123123a,
- firstname: SDC,
- lastname: SDC2
- }
- product_strategist: {
- username: m99126,
- password: 123123a,
- firstname: SDC,
- lastname: SDC2
- }
- product_manager: {
- username: m99127,
- password: 123123a,
- firstname: SDC,
- lastname: SDC2
- }
- product_local: {
- username: pm0001,
- password: 123123a,
- firstname: SDC,
- lastname: SDC2
- } \ No newline at end of file
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/conf/log4j2.properties b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/conf/log4j2.properties
deleted file mode 100644
index ec22601d6a..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/conf/log4j2.properties
+++ /dev/null
@@ -1,49 +0,0 @@
-status = error
-dest = err
-name = PropertiesConfig
-
-property.filename = ${targetlog}logs/ci-log.out
-
-#filter.threshold.type = ThresholdFilter
-#filter.threshold.level = debug
-
-appender.rolling.type = RollingFile
-appender.rolling.name = RollingFile
-appender.rolling.fileName = ${filename}
-appender.rolling.filePattern = ${targetlog}logs/ci-%d{MM-dd-yy-HH-mm-ss}-%i.log.gz
-appender.rolling.layout.type = PatternLayout
-appender.rolling.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %5p [%10c] : %m%n
-appender.rolling.policies.type = Policies
-appender.rolling.policies.size.type = SizeBasedTriggeringPolicy
-appender.rolling.policies.size.size=5MB
-appender.rolling.strategy.type = DefaultRolloverStrategy
-appender.rolling.strategy.max = 10
-
-appender.console.type = Console
-appender.console.name = STDOUT
-appender.console.layout.type = PatternLayout
-appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %5p %10c:%L - %m%n
-appender.console.filter.threshold.type = ThresholdFilter
-appender.console.filter.threshold.level = info
-
-loggers=org.apache.cassandra.service.StorageProxy,org.janusgraph.diskstorage.cassandra.CassandraTransaction,org.openecomp.sdc.ci.tests.utils
-
-logger.org.apache.cassandra.service.StorageProxy.name = org.apache.cassandra.service.StorageProxy
-logger.org.apache.cassandra.service.StorageProxy.level=info
-logger.org.apache.cassandra.service.StorageProxy.appendRef.rolling.ref = RollingFile
-logger.org.apache.cassandra.service.StorageProxy.appendRef.stdout.ref = STDOUT
-
-logger.org.janusgraph.diskstorage.cassandra.CassandraTransaction.name = org.janusgraph.diskstorage.cassandra.CassandraTransaction
-logger.org.janusgraph.diskstorage.cassandra.CassandraTransaction.level =info
-logger.org.janusgraph.diskstorage.cassandra.CassandraTransaction.appendRef.rolling.ref = RollingFile
-logger.org.janusgraph.diskstorage.cassandra.CassandraTransaction.appendRef.stdout.ref = STDOUT
-
-logger.org.openecomp.sdc.ci.tests.utils.name = org.openecomp.sdc.ci.tests.utils
-logger.org.openecomp.sdc.ci.tests.utils.level = info
-logger.org.openecomp.sdc.ci.tests.utils.appendRef.rolling.ref = RollingFile
-logger.org.openecomp.sdc.ci.tests.utils.appendRef.stdout.ref = STDOUT
-logger.org.openecomp.sdc.ci.tests.utils.additivity = false
-
-rootLogger.level = info
-rootLogger.appenderRef.stdout.ref = STDOUT
-rootLogger.appenderRef.rolling.ref = RollingFile \ No newline at end of file
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/conf/logback.xml b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/conf/logback.xml
deleted file mode 100644
index b41ee12695..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/conf/logback.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<configuration scan="true" scanPeriod="5 seconds">
-
- <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
- <encoder>
- <pattern>%d{yyyy-MM-dd HH:mm:ss} | %-5p | [%thread] %logger{5}:%L - %msg%n</pattern>
- </encoder>
- </appender>
-
- <appender name="FILE" class="ch.qos.logback.core.FileAppender">
- <file>logFile.log</file>
- <append>true</append>
- <encoder>
- <pattern>%d{yyyy-MM-dd HH:mm:ss} | %-5p | [%thread] %logger{5}:%L - %msg%n</pattern>
- </encoder>
- </appender>
-
- <logger name="com.memorynotfound" level="INFO"/>
-
- <root level="INFO">
- <appender-ref ref="STDOUT" />
- <appender-ref ref="FILE" />
- </root>
-
-</configuration> \ No newline at end of file
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/org.onap.sdc.trust.jks b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/org.onap.sdc.trust.jks
deleted file mode 100644
index e6686cc08c..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/org.onap.sdc.trust.jks
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/startTest.sh b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/startTest.sh
deleted file mode 100644
index 32f927ddb0..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/startTest.sh
+++ /dev/null
@@ -1,157 +0,0 @@
-#!/bin/bash
-REMOTE_DEBUG=false
-RERUN=false
-debug_port=8000
-TEST_SUITES=testSuites
-fileName=testng-failed.xml
-JAVA_OPTIONS="${JAVA_OPTIONS} \
- -Djavax.net.ssl.trustStore=/var/lib/tests/etc/org.onap.sdc.trust.jks \
- -Dtestng.show.stack.frames=true \
- "
-
-function help_usage ()
-{
- echo
- echo "$0 (<jar_file_name> <suite file name>) [-r/rerun <true/false> -d/debug <true/false>]"
- echo "nohup ./startTest.sh ui-ci-1707.0.5-SNAPSHOT-jar-with-dependencies.jar extendedSanity.xml -r false -d true &"
- echo "by default rerun is true and remote debug is false."
- echo
- exit 2
-}
-
-function isBoolean ()
-{
- PARAM_NAME=$1
- VALUE=$2
- if [[ ${VALUE} != "true" ]] && [[ ${VALUE} != "false" ]]; then
- echo "Valid parameter" ${PARAM_NAME} "values are: true/false"
- help_usage
- fi
-}
-
-function prepareFailedXmlFile ()
-{
- echo "1="$1 "2="$2 "fileName="${fileName}
- PATTERN=`grep -w "test name=" ${FULL_PATH}/${TEST_SUITES}/$2 | awk -F'"' '{print $2}'`
- sed '/<test name="'${PATTERN}'"/,/<!-- '${PATTERN}' --/d' $1 > ${FULL_PATH}/${TEST_SUITES}/${fileName}
- sed -i 's/thread-count="[0-9]\+"/thread-count="1"/g' ${FULL_PATH}/${TEST_SUITES}/${fileName}
- if [ -s "ExtentReport/ShortReport.csv" ]
- then
- SKIP_TESTS_LIST=$(cat ExtentReport/ShortReport.csv |awk -F, '{print $2}' | sed 's/&.*//g' | uniq)
- for SKIP_TEST in ${SKIP_TESTS_LIST}; do
- sed -i "s/.*\"${SKIP_TEST}\".*//g" ${FULL_PATH}/${TEST_SUITES}/${fileName};
- done;
- fi
-}
-
-function setUpdatedTimeToReport ()
-{
- LINE_NUMBER_OF_START_REPORT_DATE=`grep -A1 -nw "Start" ExtentReport/SDC_UI_Extent_Report.html | tail -1 | awk '{print $1}' | tr -d -`
- END_REPORT_DATE=`grep -A1 -nw "End" ExtentReport/SDC_UI_Extent_Report.html | tail -1 | awk -F'[>|<]' '{print $3}'`
- EPOCH_START_REPORT_DATE=`date --date="${1}" +%s`
- EPOCH_END_REPORT_DATE=`date --date="${END_REPORT_DATE}" +%s`
- let DIFF_EPOCH_TIME=${EPOCH_END_REPORT_DATE}-${EPOCH_START_REPORT_DATE}
- TAKEN_TIME_IN_MINUTES=`echo $((${DIFF_EPOCH_TIME}/60))`
- LINE_NUMBER_OF_TAKEN_REPORT_TIME=`grep -A1 -nw "Time Taken" ExtentReport/SDC_UI_Extent_Report.html | tail -1 | awk '{print $1}' | tr -d -`
- PATTERN="div class='panel-lead'>";
- sed -i "${LINE_NUMBER_OF_START_REPORT_DATE}s/${PATTERN}.*\</${PATTERN}$1\<\//1" ExtentReport/SDC_UI_Extent_Report.html
- sed -i "${LINE_NUMBER_OF_TAKEN_REPORT_TIME}s/${PATTERN}.*\</${PATTERN}${TAKEN_TIME_IN_MINUTES} min\<\//1" ExtentReport/SDC_UI_Extent_Report.html
-}
-
-#main
-[ $# -lt 2 ] && help_usage
-
-JAR_FILE=$1
-SUITE_FILE=$2
-
-while [ $# -ne 0 ]; do
- case $1 in
- -r|rerun)
- RERUN=$2
- isBoolean $1 ${RERUN}
- shift 1
- shift 1
- ;;
- -d|debug)
- REMOTE_DEBUG=$2
- isBoolean $1 ${REMOTE_DEBUG}
- shift 1
- shift 1
- ;;
- *)
- shift 1
- ;;
- esac
-done
-
-CURRENT_DIR=`pwd`
-BASEDIR=$(dirname $0)
-if [ ${BASEDIR:0:1} = "/" ]
-then
- FULL_PATH=$BASEDIR
-else
- FULL_PATH=$CURRENT_DIR/$BASEDIR
-fi
-LOGS_PROP_FILE=conf/log4j2.properties
-#############################################
-TARGET_DIR=${FULL_PATH}/target
-CONF_FILE=${FULL_PATH}/conf/sdc.yaml
-
-DEBUG=true
-MainClass=org.openecomp.sdc.ci.tests.run.StartTest
-
-TESTS_DIR=/opt/app/sdc/ci/resources/tests
-COMPONENTS_DIR=/opt/app/sdc/ci/resources/components
-
-
-TARGET_LOG_DIR="${TARGET_DIR}/"
-
-
-######ADD USERS################
-
-BE_IP=`cat conf/attsdc.yaml | grep catalogBeHost| awk '{print $2}'`
-
-
-
-
-
-
-if [ ${REMOTE_DEBUG} == "true" ]; then
- echo "Debug mode, Listen on port $debug_port";
- JAVA_OPTION="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=${debug_port}" ;
-fi
-
-cmd="java $JAVA_OPTIONS -DdisplayException=true -Dtargetlog=${TARGET_LOG_DIR} -DfilePath=${FILES_TEST} -Dconfig.resource=${CONF_FILE} -Ddebug=${DEBUG} -Dlog4j.configuration=${LOGS_PROP_FILE} -cp $JAR_FILE ${MainClass} $SUITE_FILE &"
-
-
-if [ $DEBUG == "true" ]
-then
- $cmd
-else
- $cmd >> /dev/null
-fi
-
-if [ ${RERUN} == "true" ]; then
- if [ -f ${TARGET_DIR}/${fileName} ]; then
- echo "Prepare" ${TARGET_DIR}/${fileName} "file to rerun all failed tests ...";
- prepareFailedXmlFile ${TARGET_DIR}/${fileName} $SUITE_FILE;
- SUITE_FILE=${fileName};
- cmd="java $JAVA_OPTIONS -DdisplayException=true -Dtargetlog=${TARGET_LOG_DIR} -DfilePath=${FILES_TEST} -Dconfig.resource=${CONF_FILE} -Ddebug=${DEBUG} -Dlog4j.configuration=${LOGS_PROP_FILE} -cp $JAR_FILE ${MainClass} $SUITE_FILE &"
- $cmd;
- fi
-fi
-
-status=`echo $?`
-
-source ExtentReport/versions.info
-now=$(date +'%Y-%m-%d_%H_%M')
-REPORT_NAME=${now}
-VERSION=${osVersion}
-
-
-
-echo "##################################################"
-echo "################# status is ${status} #################"
-echo "##################################################"
-
-exit $status
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/recipes/sanityApiTests_1_setup_env.rb b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/recipes/sanityApiTests_1_setup_env.rb
deleted file mode 100644
index 61d0133888..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/recipes/sanityApiTests_1_setup_env.rb
+++ /dev/null
@@ -1,64 +0,0 @@
-tests_base="/var/lib/tests"
-
- remote_directory '/var/lib/tests/testSuites' do
- source 'testSuites'
- owner 'root'
- group 'root'
- mode '0755'
- action :create
- end
-
- remote_directory '/var/lib/tests/Files' do
- source 'Files'
- owner 'root'
- group 'root'
- mode '0755'
- action :create
- end
-
- remote_directory '/var/lib/tests/conf' do
- source 'conf'
- owner 'root'
- group 'root'
- mode '0755'
- action :create
- end
-
- directory "create_target_dir" do
- path "/var/lib/tests/target"
- owner 'root'
- group 'root'
- mode '0755'
- action :create
- end
-
- directory "create_ExtentReport_dir" do
- path "/var/lib/tests/ExtentReport"
- owner 'root'
- group 'root'
- mode '0755'
- action :create
- end
-
- cookbook_file '/var/lib/tests/startTest.sh' do
- source 'startTest.sh'
- owner 'root'
- group 'root'
- mode '0755'
- action :create
- end
-
- directory "create_etc_dir" do
- path "/var/lib/tests/etc"
- owner 'root'
- group 'root'
- mode '0755'
- action :create
- end
-
-cookbook_file "/var/lib/tests/etc/org.onap.sdc.trust.jks" do
- source "org.onap.sdc.trust.jks"
- owner "root"
- group "root"
- mode 0644
-end \ No newline at end of file
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/recipes/sanityApiTests_2_setup_configuration.rb b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/recipes/sanityApiTests_2_setup_configuration.rb
deleted file mode 100644
index c47d1dc95c..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/recipes/sanityApiTests_2_setup_configuration.rb
+++ /dev/null
@@ -1,53 +0,0 @@
-tests_base="/var/lib/tests"
-
-template "sdc-yaml-config" do
- path "#{tests_base}/conf/sdc.yaml"
- source "sdc-sanity.yaml.erb"
- owner "root"
- group "root"
- mode "0755"
- variables ({
- :target_path => "#{tests_base}/target",
- :catalogBE_host => node['Nodes']['BE'],
- :catalogBE_port => node['BE'][:http_port],
- :webportal_host => node['Nodes']['FE'],
- :webportal_port => node['FE'][:http_port],
- :janusgraph_file => "#{tests_base}/conf/janusgraph.properties",
- :tests_base_ci => "#{tests_base}/CI/tests",
- :components_path => "#{tests_base}/CI/components",
- :importResourceConfigDir => "#{tests_base}/CI/importResource",
- :importTypesDir => "#{tests_base}/CI/importTypesTest",
- :importResourceTestsConfigDir => "#{tests_base}/CI/importResourceTests",
- :ConfigurationFile => "#{tests_base}/conf/configuration.yaml",
- :errorConfigurationFile => "#{tests_base}/conf/error-configuration.yaml",
- :CASSANDRA_IP => node['Nodes']['CS'][0],
- :CASSANDRA_PORT => node['cassandra'][:cassandra_port],
- :CASSANDRA_PWD => node['cassandra'][:cassandra_password],
- :CASSANDRA_USR => node['cassandra'][:cassandra_user]
- })
-end
-
-template "janusgraph.properties" do
- path "/#{tests_base}/conf/janusgraph.properties"
- source "BE-janusgraph.properties.erb"
- owner "root"
- group "root"
- mode "0755"
- variables({
- :CASSANDRA_IP => node['Nodes']['CS'].join(",").gsub(/[|]/,''),
- :CASSANDRA_PORT => node['cassandra'][:cassandra_port],
- :CASSANDRA_PWD => node['cassandra'][:cassandra_password],
- :CASSANDRA_USR => node['cassandra'][:cassandra_user],
- :rep_factor => node['cassandra']['replication_factor'],
- :DC_NAME => node['cassandra']['datacenter_name']
- })
-end
-
-bash "Make root cert file available" do
-cwd "#{tests_base}"
-code <<-EOH
- cp /root/chef-solo/cookbooks/sdc-api-tests/files/default/cert/root.cert /var/lib/tests/cert/root.cert
- echo "root.cert file made available for tests."
-EOH
-end
-
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/recipes/sanityApiTests_3_sanity_execution.rb b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/recipes/sanityApiTests_3_sanity_execution.rb
deleted file mode 100644
index 4e6a5e19f6..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/recipes/sanityApiTests_3_sanity_execution.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-tests_base="/var/lib/tests"
-ci_test_suite="#{ENV['SUITE_NAME']}.xml"
-
-bash "echo status" do
- code <<-EOH
- echo "DOCKER STARTED"
- EOH
-end
-
-bash "run asdc ci sanity tests" do
-cwd "#{tests_base}"
-code <<-EOH
- cd "#{tests_base}"
- jar_file=`ls test-apis*-jar-with-dependencies.jar`
- ./startTest.sh $jar_file #{ci_test_suite} > #{tests_base}/target/startTest.log 2>&1
- echo "return code from startTest.sh = [$?]"
- echo "DOCKER STARTED"
-EOH
-end
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/templates/default/BE-janusgraph.properties.erb b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/templates/default/BE-janusgraph.properties.erb
deleted file mode 100644
index d333242710..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/templates/default/BE-janusgraph.properties.erb
+++ /dev/null
@@ -1,24 +0,0 @@
-storage.backend=cql
-storage.hostname=<%= @CASSANDRA_IP %>
-storage.port=<%= @CASSANDRA_PORT %>
-storage.username=<%= @CASSANDRA_USR %>
-storage.password=<%= @CASSANDRA_PWD %>
-storage.connection-timeout=10000
-storage.cql.keyspace=sdctitan
-
-storage.cql.ssl.enabled=false
-storage.cql.ssl.truststore.location=/var/lib/jetty/config/.truststore
-storage.cql.ssl.truststore.password=Aa123456
-
-cache.db-cache = false
-cache.db-cache-clean-wait = 20
-cache.db-cache-time = 180000
-cache.db-cache-size = 0.5
-
-storage.cql.read-consistency-level=LOCAL_QUORUM
-storage.cql.write-consistency-level=LOCAL_QUORUM
-storage.cql.replication-strategy-class=NetworkTopologyStrategy
-storage.cql.replication-strategy-options=<%= @DC_NAME %>,<%= @rep_factor %>
-
-storage.lock.retries=5
-storage.lock.wait-time=500
diff --git a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/templates/default/sdc-sanity.yaml.erb b/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/templates/default/sdc-sanity.yaml.erb
deleted file mode 100644
index 4185e3fee9..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/templates/default/sdc-sanity.yaml.erb
+++ /dev/null
@@ -1,98 +0,0 @@
-outputFolder: <%= @target_path %>
-reportName: index.html
-esHost: eshost
-disributionClientHost: disClient
-<% if node[:disableHttp] -%>
-sdcHttpMethod: https
-onboardingBePort: <%= node['ONBOARDING_BE'][:https_port] %>
-onboardingBeHost: <%= node['ONBOARDING_BE'][:domain_name] %>
-catalogBeHost: <%= node['BE'][:domain_name] %>
-catalogBePort: <%= node['BE'][:https_port] %>
-catalogFeHost: <%= node['FE'][:domain_name] %>
-catalogFePort: <%= node['FE'][:https_port] %>
-<% else %>
-sdcHttpMethod: http
-onboardingBePort: <%= node['ONBOARDING_BE'][:http_port] %>
-onboardingBeHost: <%= node['ONBOARDING_BE_VIP'] %>
-catalogFeHost: <%= @webportal_host %>
-catalogFePort: <%= @webportal_port %>
-catalogBeHost: <%= @catalogBE_host %>
-catalogBePort: <%= @catalogBE_port %>
-<% end -%>
-disributionClientPort: 8181
-esPort: 9200
-
-
-resourceConfigDir: <%= @tests_path_ci %>
-componentsConfigDir: <%= @components_path %>
-importResourceConfigDir: <%= @importResourceConfigDir %>
-importResourceTestsConfigDir: <%= @importResourceTestsConfigDir %>
-errorConfigurationFile: <%= @errorConfigurationFile %>
-configurationFile: <%= @ConfigurationFile %>
-importTypesConfigDir: <%= @importTypesDir %>
-janusGraphPropertiesFile: <%= @janusgraph_file %>
-systemUnderDebug: true
-
-cassandraHost: <%= @CASSANDRA_IP %>
-cassandraAuthenticate: true
-cassandraUsername: <%= @CASSANDRA_USR %>
-cassandraPassword: <%= @CASSANDRA_PWD %>
-cassandraSsl: false
-cassandraTruststorePath : /tmp/.truststore
-cassandraTruststorePassword : Aa123456
-cassandraAuditKeySpace: sdcAudit
-cassandraArtifactKeySpace: sdcArtifact
-
-localDataCenter: DC-Automate01
-
-stopOnClassFailure: false
-
-#List of non-abstract resources to keep during JanusGraph cleanup between tests
-#Only 1.0 version will be kept
-resourcesNotToDelete:
- - Compute
- - Database
- - ObjectStorage
- - BlockStorage
- - LoadBalancer
- - Port
- - Network
- - Root
- - ContainerApplication
- - ContainerRuntime
- - DBMS
- - SoftwareComponent
- - WebApplication
- - WebServer
- - CinderVolume
- - ContrailVirtualNetwork
- - NeutronNet
- - NeutronPort
- - NovaServer
- - AbstractSubstitute
- - ContrailAbstractSubstitute
- - ContrailCompute
- - ContrailNetworkRules
- - ContrailPort
- - ContrailV2NetworkRules
- - ContrailV2VirtualMachineInterface
- - ContrailV2VirtualNetwork
- - ContrailVirtualNetwork
- - VL ELINE
- - SecurityRules
- - VL
-#Resource categories to keep (including all their subcategories)
-resourceCategoriesNotToDelete:
- - Generic
- - Network L2-3
- - Network L4+
- - Application L4+
- - Network Connectivity
- - DcaeComponent
-
-#Service categories to keep
-serviceCategoriesNotToDelete:
- - Mobility
- - Network L1-3
- - Network L4+
- - VoIP Call Control
diff --git a/test-apis-ci/sdc-api-tests/chef-solo/LICENSE b/test-apis-ci/sdc-api-tests/chef-solo/LICENSE
deleted file mode 100644
index 11069edd79..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-solo/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
-2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
-3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
-4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
-5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
-6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
-8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
-
-APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
-Copyright [yyyy] [name of copyright owner]
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
diff --git a/test-apis-ci/sdc-api-tests/chef-solo/README.md b/test-apis-ci/sdc-api-tests/chef-solo/README.md
deleted file mode 100644
index ddb0fda830..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-solo/README.md
+++ /dev/null
@@ -1,37 +0,0 @@
-Deprecated
-==========
-
-Use of this repository is deprecated. We recommend using the `chef generate repo` command that comes with [ChefDK](http://downloads.chef.io/chef-dk/).
-
-Overview
-========
-
-Every Chef installation needs a Chef Repository. This is the place where cookbooks, roles, config files and other artifacts for managing systems with Chef will live. We strongly recommend storing this repository in a version control system such as Git and treat it like source code.
-
-While we prefer Git, and make this repository available via GitHub, you are welcome to download a tar or zip archive and use your favorite version control system to manage the code.
-
-Repository Directories
-======================
-
-This repository contains several directories, and each directory contains a README file that describes what it is for in greater detail, and how to use it for managing your systems with Chef.
-
-* `cookbooks/` - Cookbooks you download or create.
-* `data_bags/` - Store data bags and items in .json in the repository.
-* `roles/` - Store roles in .rb or .json in the repository.
-* `environments/` - Store environments in .rb or .json in the repository.
-
-Configuration
-=============
-
-The repository contains a knife configuration file.
-
-* .chef/knife.rb
-
-The knife configuration file `.chef/knife.rb` is a repository specific configuration file for knife. If you're using Hosted Chef, you can download one for your organization from the management console. If you're using the Open Source Chef Server, you can generate a new one with `knife configure`. For more information about configuring Knife, see the Knife documentation.
-
-https://docs.chef.io/knife.html
-
-Next Steps
-==========
-
-Read the README file in each of the subdirectories for more information about what goes in those directories.
diff --git a/test-apis-ci/sdc-api-tests/chef-solo/chefignore b/test-apis-ci/sdc-api-tests/chef-solo/chefignore
deleted file mode 100644
index ba30af6cff..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-solo/chefignore
+++ /dev/null
@@ -1,11 +0,0 @@
-# Put files/directories that should be ignored in this file.
-# Lines that start with '# ' are comments.
-
-# emacs
-*~
-
-# vim
-*.sw[a-z]
-
-# subversion
-*/.svn/*
diff --git a/test-apis-ci/sdc-api-tests/chef-solo/cookbooks/README.md b/test-apis-ci/sdc-api-tests/chef-solo/cookbooks/README.md
deleted file mode 100644
index 86ea46bfbb..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-solo/cookbooks/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-This directory contains the cookbooks used to configure systems in your infrastructure with Chef.
-
-Knife needs to be configured to know where the cookbooks are located with the `cookbook_path` setting. If this is not set, then several cookbook operations will fail to work properly.
-
- cookbook_path ["./cookbooks"]
-
-This setting tells knife to look for the cookbooks directory in the present working directory. This means the knife cookbook subcommands need to be run in the `chef-repo` directory itself. To make sure that the cookbooks can be found elsewhere inside the repository, use an absolute path. This is a Ruby file, so something like the following can be used:
-
- current_dir = File.dirname(__FILE__)
- cookbook_path ["#{current_dir}/../cookbooks"]
-
-Which will set `current_dir` to the location of the knife.rb file itself (e.g. `~/chef-repo/.chef/knife.rb`).
-
-Configure knife to use your preferred copyright holder, email contact and license. Add the following lines to `.chef/knife.rb`.
-
- cookbook_copyright "Example, Com."
- cookbook_email "cookbooks@example.com"
- cookbook_license "apachev2"
-
-Supported values for `cookbook_license` are "apachev2", "mit","gplv2","gplv3", or "none". These settings are used to prefill comments in the default recipe, and the corresponding values in the metadata.rb. You are free to change the the comments in those files.
-
-Create new cookbooks in this directory with Knife.
-
- knife cookbook create COOKBOOK
-
-This will create all the cookbook directory components. You don't need to use them all, and can delete the ones you don't need. It also creates a README file, metadata.rb and default recipe.
-
-You can also download cookbooks directly from the Opscode Cookbook Site. There are two subcommands to help with this depending on what your preference is.
-
-The first and recommended method is to use a vendor branch if you're using Git. This is automatically handled with Knife.
-
- knife cookbook site install COOKBOOK
-
-This will:
-
-* Download the cookbook tarball from cookbooks.opscode.com.
-* Ensure its on the git master branch.
-* Checks for an existing vendor branch, and creates if it doesn't.
-* Checks out the vendor branch (chef-vendor-COOKBOOK).
-* Removes the existing (old) version.
-* Untars the cookbook tarball it downloaded in the first step.
-* Adds the cookbook files to the git index and commits.
-* Creates a tag for the version downloaded.
-* Checks out the master branch again.
-* Merges the cookbook into master.
-* Repeats the above for all the cookbooks dependencies, downloading them from the community site
-
-The last step will ensure that any local changes or modifications you have made to the cookbook are preserved, so you can keep your changes through upstream updates.
-
-If you're not using Git, use the site download subcommand to download the tarball.
-
- knife cookbook site download COOKBOOK
-
-This creates the COOKBOOK.tar.gz from in the current directory (e.g., `~/chef-repo`). We recommend following a workflow similar to the above for your version control tool.
diff --git a/test-apis-ci/sdc-api-tests/chef-solo/data_bags/README.md b/test-apis-ci/sdc-api-tests/chef-solo/data_bags/README.md
deleted file mode 100644
index 0c15a391fa..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-solo/data_bags/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-Data Bags
----------
-
-This directory contains directories of the various data bags you create for your infrastructure. Each subdirectory corresponds to a data bag on the Chef Server, and contains JSON files of the items that go in the bag.
-
-First, create a directory for the data bag.
-
- mkdir data_bags/BAG
-
-Then create the JSON files for items that will go into that bag.
-
- $EDITOR data_bags/BAG/ITEM.json
-
-The JSON for the ITEM must contain a key named "id" with a value equal to "ITEM". For example,
-
- {
- "id": "foo"
- }
-
-Next, create the data bag on the Chef Server.
-
- knife data bag create BAG
-
-Then upload the items in the data bag's directory to the Chef Server.
-
- knife data bag from file BAG ITEM.json
-
-
-Encrypted Data Bags
--------------------
-
-Added in Chef 0.10, encrypted data bags allow you to encrypt the contents of your data bags. The content of attributes will no longer be searchable. To use encrypted data bags, first you must have or create a secret key.
-
- openssl rand -base64 512 > secret_key
-
-You may use this secret_key to add items to a data bag during a create.
-
- knife data bag create --secret-file secret_key passwords mysql
-
-You may also use it when adding ITEMs from files,
-
- knife data bag create passwords
- knife data bag from file passwords data_bags/passwords/mysql.json --secret-file secret_key
-
-The JSON for the ITEM must contain a key named "id" with a value equal to "ITEM" and the contents will be encrypted when uploaded. For example,
-
- {
- "id": "mysql",
- "password": "abc123"
- }
-
-Without the secret_key, the contents are encrypted.
-
- knife data bag show passwords mysql
- id: mysql
- password: 2I0XUUve1TXEojEyeGsjhw==
-
-Use the secret_key to view the contents.
-
- knife data bag show passwords mysql --secret-file secret_key
- id: mysql
- password: abc123
-
diff --git a/test-apis-ci/sdc-api-tests/chef-solo/environments/README.md b/test-apis-ci/sdc-api-tests/chef-solo/environments/README.md
deleted file mode 100644
index 50ac48db2b..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-solo/environments/README.md
+++ /dev/null
@@ -1,5 +0,0 @@
-Requires Chef 0.10.0+.
-
-This directory is for Ruby DSL and JSON files for environments. For more information see the Chef wiki page:
-
-http://docs.chef.io/environments.html
diff --git a/test-apis-ci/sdc-api-tests/chef-solo/roles/README.md b/test-apis-ci/sdc-api-tests/chef-solo/roles/README.md
deleted file mode 100644
index b0ee0b4d21..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-solo/roles/README.md
+++ /dev/null
@@ -1,16 +0,0 @@
-Create roles here, in either the Role Ruby DSL (.rb) or JSON (.json) files. To install roles on the server, use knife.
-
-For example, create `roles/base_example.rb`:
-
- name "base_example"
- description "Example base role applied to all nodes."
- # List of recipes and roles to apply. Requires Chef 0.8, earlier versions use 'recipes()'.
- #run_list()
- # Attributes applied if the node doesn't have it set already.
- #default_attributes()
- # Attributes applied no matter what the node has set already.
- #override_attributes()
-
-Then upload it to the Chef Server:
-
- knife role from file roles/base_example.rb
diff --git a/test-apis-ci/sdc-api-tests/chef-solo/roles/sanityApiTests.json b/test-apis-ci/sdc-api-tests/chef-solo/roles/sanityApiTests.json
deleted file mode 100644
index 1f2b4605ce..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-solo/roles/sanityApiTests.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "name": "sanityApiTests",
- "description": "Execute sanity api tests",
- "json_class": "Chef::Role",
- "default_attributes": {
-
- },
- "override_attributes": {
-
- },
- "chef_type": "role",
- "run_list": [
- "recipe[sdc-api-tests::sanityApiTests_1_setup_env]",
- "recipe[sdc-api-tests::sanityApiTests_2_setup_configuration]",
- "recipe[sdc-api-tests::sanityApiTests_3_sanity_execution]"
- ],
- "env_run_lists": {
- }
-}
-
diff --git a/test-apis-ci/sdc-api-tests/chef-solo/solo.json b/test-apis-ci/sdc-api-tests/chef-solo/solo.json
deleted file mode 100644
index cca880430a..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-solo/solo.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "run_list": [
- "role[sanityApiTests]"
- ]
-}
-
diff --git a/test-apis-ci/sdc-api-tests/chef-solo/solo.rb b/test-apis-ci/sdc-api-tests/chef-solo/solo.rb
deleted file mode 100644
index 06c1af4592..0000000000
--- a/test-apis-ci/sdc-api-tests/chef-solo/solo.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-root = File.absolute_path(File.dirname(__FILE__))
-file_cache_path root
-cookbook_path root + '/cookbooks'
-json_attribs root + '/solo.json'
-checksum_path root + '/checksums'
-data_bag_path root + '/data_bags'
-environment_path root + '/environments'
-file_backup_path root + '/backup'
-file_cache_path root + '/cache'
-log_level :info
-log_location STDOUT
-rest_timeout 300
-role_path root + '/roles'
-syntax_check_cache_path
-umask 0022
-verbose_logging nil
diff --git a/test-apis-ci/sdc-api-tests/startup.sh b/test-apis-ci/sdc-api-tests/startup.sh
deleted file mode 100644
index 7b102cadfd..0000000000
--- a/test-apis-ci/sdc-api-tests/startup.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/bash
-
-# prepare env for HTTPS if used
-
-is_https=$(cat /root/chef-solo/environments/${ENVNAME}.json | \
- jq -cr '.default_attributes.disableHttp' | \
- tr '[:upper:]' '[:lower:]')
-
-if [ "$is_https" = true ] ; then
- # setup /etc/hosts
- SDC_FE_IP=$(cat /root/chef-solo/environments/${ENVNAME}.json | \
- jq -cr '.default_attributes.Nodes.FE')
- SDC_FE_HOSTNAME=$(cat /root/chef-solo/environments/${ENVNAME}.json | \
- jq -cr '.override_attributes.FE.domain_name')
- if ! grep -q "^[[:space:]]*${SDC_FE_IP}[[:space:]]" ; then
- echo "${SDC_FE_IP}" "${SDC_FE_HOSTNAME}" >> /etc/hosts
- fi
-fi
-
-# run tests
-
-cd /root/chef-solo
-chef-solo -c solo.rb -E ${ENVNAME}
-
-rc=$?
-
-if [[ $rc != 0 ]]; then
- echo "Startup failed !!!"
- exit $rc
-else
-# Note that the output below is monitored in CSIT by
-# sdc/sdc-os-chef/scripts/docker_run.sh
-# If this text is changed, docker_run.sh check for sdc-api-tests docker
-# startup must be adjusted accordingly!
- echo "Startup completed successfully"
-fi
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/AttSdcTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/AttSdcTest.java
deleted file mode 100644
index e675676191..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/AttSdcTest.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.api;
-
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import org.junit.*;
-import org.junit.rules.TestName;
-import org.junit.rules.TestWatcher;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.rules.MyTestWatcher;
-import org.openecomp.sdc.ci.tests.run.StartTest;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.ci.tests.utils.general.FileUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.List;
-
-import static org.junit.Assert.assertTrue;
-
-public abstract class AttSdcTest {
-
- public static StringBuilder doc = new StringBuilder();
- public static String file = null;
- public static Config config = null;
- // protected Gson gson = new Gson();
- protected Gson prettyGson = new GsonBuilder().setPrettyPrinting().create();
-
- protected TestName testName = null;
- protected Logger logger = null;
-
- protected static boolean displayException = false;
-
- public AttSdcTest(TestName testName, String className) {
- super();
-
- StartTest.enableLogger();
-
- this.testName = testName;
- this.logger = LoggerFactory.getLogger(className);
-
- String displayEx = System.getProperty("displayException");
- if (displayEx != null && Boolean.valueOf(displayEx).booleanValue()) {
- displayException = true;
- }
-
- }
-
- @Rule
- public TestWatcher tw = new MyTestWatcher(this);
-
- @BeforeClass
- public static void beforeClass() {
- doc = new StringBuilder();
- doc.append(
- "<Html><head><style>th{background-color: gray;color: white;height: 30px;}td {color: black;height: 30px;}.fail {background-color: #FF5555;width: 100px;text-align: center;}.success {background-color: #00FF00;width: 100px;text-align: center;}.name {width: 200px;background-color: #F0F0F0;}.message {width: 300px;background-color: #F0F0F0;}</style>");
-
- doc.append("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">");
- doc.append(
- "<link rel=\"stylesheet\" href=\"http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css\">");
-
- doc.append("</head><body>");
-
- doc.append("<script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js\"></script>");
- doc.append("<script src=\"http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js\"></script>");
-
- doc.append("<table>");
-
- doc.append("<tr>");
- doc.append("<th>").append("Test Name").append("</th>");
- doc.append("<th>").append("Status").append("</th>");
- doc.append("<th>").append("Message").append("</th>");
-
- if (displayException) {
- doc.append("<th>").append("Exception").append("</th>");
- }
- doc.append("</tr>");
- }
-
- @AfterClass
- public static void afterClass() {
- doc.append("<table>");
- // writeToFile("./" + ConfigAttOdlIt.REPORT_FILE , doc.toString());
- FileUtils.writeToFile(
- Config.instance().getOutputFolder() + File.separator + file + StartTest.timeOfTest + ".html",
- doc.toString());
-
- }
-
- @Before
- public void beforeTest() throws FileNotFoundException {
- file = FileUtils.getFileName(this.getClass().getName());
- config = Utils.getConfig();
- assertTrue(config != null);
- }
-
- @After
- public void afterTest() throws FileNotFoundException {
-
- }
-
- public void addTestSummary(String testName, boolean isSuccess) {
- addTestSummary(testName, isSuccess, null);
- }
-
- public void addTestSummary(String testName, boolean isSuccess, Throwable exception) {
-
- String message = exception == null ? "" : exception.getMessage();
-
- String result = (isSuccess) ? "success" : "fail";
- doc.append("<tr>");
- doc.append("<td class=\"name\">").append(testName).append("</td>");
- doc.append("<td class=\"" + result + "\">").append(result).append("</td>");
- doc.append("<td class=\"message\">").append(message).append("</td>");
-
- if (displayException) {
- // doc.append("<td
- // class=\"message\">").append(convertExceptionToString(exception)).append("</td>");
- doc.append("<td class=\"message\">");
-
- doc.append("<button type=\"button\" class=\"btn btn-info\" data-toggle=\"collapse\" data-target=\"#demo"
- + testName + "\">Simple collapsible</button>");
- doc.append("<div id=\"demo" + testName + "\" class=\"collapse out\">");
-
- doc.append(convertExceptionToString(exception));
-
- doc.append("</div>");
- doc.append("</td>");
- }
-
- doc.append("</tr>");
-
- if (isSuccess) {
- logger.debug("Test {} {}",testName,(isSuccess ? " SUCCEEDED " : " FAILED with error " + message));
- } else {
- logger.error("Test {} {}",testName,(isSuccess ? " SUCCEEDED " : " FAILED with error " + message));
- }
- }
-
- private String convertExceptionToString(Throwable exception) {
-
- if (exception == null) {
- return "";
- }
-
- StringWriter sw = new StringWriter();
- exception.printStackTrace(new PrintWriter(sw));
- String exceptionAsString = sw.toString();
-
- return exceptionAsString;
- }
-
- public Logger getLogger() {
- return logger;
- }
-
- protected boolean ignoreDueToBug(String bug) {
-
- List<String> bugs = config.getBugs();
-
- if (bugs != null && bugs.size() > 0) {
- for (String bugNumber : bugs) {
- if (bugNumber.startsWith(bug)) {
- return true;
- }
- }
- }
-
- return false;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentBaseTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentBaseTest.java
deleted file mode 100644
index beef13afc6..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentBaseTest.java
+++ /dev/null
@@ -1,285 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.api;
-
-import ch.qos.logback.classic.Level;
-import ch.qos.logback.classic.LoggerContext;
-import com.aventstack.extentreports.ExtentTest;
-import com.aventstack.extentreports.Status;
-import org.janusgraph.core.JanusGraph;
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.*;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-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.FileHandling;
-import org.openecomp.sdc.ci.tests.utils.rest.*;
-import org.slf4j.LoggerFactory;
-import org.testng.ITestContext;
-import org.testng.ITestResult;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.AfterSuite;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.BeforeSuite;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertNotNull;
-
-public abstract class ComponentBaseTest {
-
- protected static Logger logger = LogManager.getLogger(ComponentBaseTest.class);
-
- protected static final String REPORT_FOLDER = "." + File.separator + "ExtentReport" + File.separator;
- private static final String VERSIONS_INFO_FILE_NAME = "versions.info";
- private static final String REPORT_FILE_NAME = "SDC_CI_Extent_Report.html";
- protected static JanusGraph janusGraph;
- public static Config config;
- protected static ITestContext myContext;
-
-
- /**************** METHODS ****************/
- public static ExtentTest getExtendTest() {
- SomeInterface testManager = new ExtentTestManager();
- return testManager.getTest();
- }
-
- public static enum ComponentOperationEnum {
- CREATE_COMPONENT, UPDATE_COMPONENT, GET_COMPONENT, DELETE_COMPONENT, CHANGE_STATE_CHECKIN, CHANGE_STATE_CHECKOUT, CHANGE_STATE_UNDO_CHECKOUT
- }
-
- public ComponentBaseTest(TestName name, String name2) {
- LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
- lc.getLogger("com.thinkaurelius").setLevel(Level.INFO);
- lc.getLogger("com.datastax").setLevel(Level.INFO);
- lc.getLogger("io.netty").setLevel(Level.INFO);
- lc.getLogger("c.d").setLevel(Level.INFO);
- }
-
- public static String getReportFolder() {
- return REPORT_FOLDER;
- }
-
- @BeforeSuite(alwaysRun = true)
- public void setupBeforeSuite(ITestContext context) throws Exception {
- config = Utils.getConfig();
- myContext = context;
- ExtentManager.initReporter(getReportFolder(), REPORT_FILE_NAME, context);
- AtomicOperationUtils.createDefaultConsumer(true);
- performClean();
- }
-
- @BeforeMethod(alwaysRun = true)
- public void setupBeforeTest(java.lang.reflect.Method method, ITestContext context) throws Exception {
-
- System.out.println(" method.getName() " + method.getName());
- if (!"onboardVNFShotFlow".equals(method.getName()) &&
- !"onboardPNFFlow".equals(method.getName()) ) {
- logger.info("ExtentReport instance started from BeforeMethod...");
- ExtentTestManager.startTest(method.getName());
- ExtentTestManager.assignCategory(this.getClass());
-
- } else {
- logger.debug("ExtentReport instance started from Test...");
- }
-
- }
-
- @AfterMethod(alwaysRun = true)
- public void quitAfterTest(ITestResult result, ITestContext context) throws Exception {
-
- String testName = result.getName();
- Throwable throwable = result.getThrowable();
- int status = result.getStatus();
-
- switch (status) {
- case ITestResult.SUCCESS:
- getExtendTest().log(Status.PASS, "Test Result : <span class='label success'>Success</span>");
- break;
-
- case ITestResult.FAILURE:
- getExtendTest().log(Status.ERROR, "ERROR - The following exepction occured");
- getExtendTest().log(Status.ERROR, result.getThrowable());
- getExtendTest().log(Status.FAIL, "<span class='label failure'>Failure</span>");
- break;
-
- case ITestResult.SKIP:
- getExtendTest().log(Status.SKIP, "SKIP - The following exepction occured");
- break;
- default:
- break;
- }
-
-
- ExtentTestManager.endTest();
-
-
- }
-
- @AfterSuite(alwaysRun = true)
- public static void shutdownJanusGraph() throws Exception {
- performClean();
- }
-
- public void setLog(String fromDataProvider) {
-
- String suiteName = ExtentManager.getSuiteName(myContext);
- ExtentTestManager.startTest(Thread.currentThread().getStackTrace()[2].getMethodName() + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + fromDataProvider);
- ExtentTestManager.assignCategory(this.getClass());
-
- }
-
- protected static void performClean() throws Exception, FileNotFoundException {
- if (!config.getSystemUnderDebug()) {
- deleteCreatedComponents(getCatalogAsMap());
- FileHandling.overWriteExistindDir("outputCsar");
- } else {
- System.out.println("Accordindig to configuration components will not be deleted, in case to unable option to delete, please change systemUnderDebug parameter value to false ...");
- }
- }
-
- public void verifyErrorCode(RestResponse response, String action, int expectedCode) {
- assertNotNull("check response object is not null after " + action, response);
- assertNotNull("check error code exists in response after " + action, response.getErrorCode());
- assertEquals("Check response code after + action" + action, expectedCode, response.getErrorCode().intValue());
- }
-
- private static void deleteCreatedComponents(Map<String, List<Component>> convertCatalogResponseToJavaObject) throws IOException {
- final String userId = UserRoleEnum.DESIGNER.getUserId();
-
- /* List<Component> resourcesArrayList = convertCatalogResponseToJavaObject.get(ComponentTypeEnum.PRODUCT_PARAM_NAME);
- if (resourcesArrayList.size() > 0) {
- List<String> collect = buildCollectionUniqueId(resourcesArrayList);
- for (String uId : collect) {
- ProductRestUtils.deleteProduct(uId, userId);
- }
- }*/
-
- List<Component> resourcesArrayList = convertCatalogResponseToJavaObject.get(ComponentTypeEnum.RESOURCE_PARAM_NAME);
- if (!CollectionUtils.isEmpty(resourcesArrayList)) {
- List<String> collect = buildCollectionUniqueId(resourcesArrayList);
- for (String uId : collect) {
- ResourceRestUtils.markResourceToDelete(uId, userId);
- }
- ResourceRestUtils.deleteMarkedResources(userId);
- }
-
- resourcesArrayList = convertCatalogResponseToJavaObject.get(ComponentTypeEnum.SERVICE_PARAM_NAME);
- if (resourcesArrayList.size() > 0) {
- List<String> collect = buildCollectionUniqueId(resourcesArrayList);
- for (String uId : collect) {
- ServiceRestUtils.markServiceToDelete(uId, userId);
- }
- ServiceRestUtils.deleteMarkedServices(userId);
- }
- }
-
- protected static List<String> buildCollectionUniqueId(List<Component> resourcesArrayList) {
-
-
- List<String> genericCollection = new ArrayList<>();
- if(resourcesArrayList.get(0) != null) {
- ComponentTypeEnum componentTypeEnum = resourcesArrayList.get(0).getComponentType();
- resourcesArrayList.stream().filter(a -> a != null).
- filter(s -> s.getName().toLowerCase().startsWith("ci") && !s.getName().toLowerCase().equals("cindervolume")).
- filter(f -> f.getUniqueId() != null).
- map(e -> e.getUniqueId()).
- collect(Collectors.toList()).
- forEach((i) -> {
- buildCollectionBaseOnComponentType(componentTypeEnum, genericCollection, i);
- });
- }
- return genericCollection;
- }
-
- public static void buildCollectionBaseOnComponentType(ComponentTypeEnum componentTypeEnum,
- List<String> genericCollection, String i) {
- try {
- switch (componentTypeEnum) {
- case RESOURCE:
- RestResponse resource = ResourceRestUtils.getResource(i);
- Resource convertResourceResponseToJavaObject = ResponseParser.convertResourceResponseToJavaObject(resource.getResponse());
- Map<String, String> allVersions = convertResourceResponseToJavaObject.getAllVersions();
- Collection<String> values = allVersions.values();
- genericCollection.addAll(values);
-
- break;
- case SERVICE:
- RestResponse service = ServiceRestUtils.getService(i);
- Service convertServiceResponseToJavaObject = ResponseParser.convertServiceResponseToJavaObject(service.getResponse());
- allVersions = convertServiceResponseToJavaObject.getAllVersions();
- values = allVersions.values();
- genericCollection.addAll(values);
-
- break;
-
-
- case PRODUCT:
- RestResponse product = ProductRestUtils.getProduct(i);
- Product convertProductResponseToJavaObject = ResponseParser.convertProductResponseToJavaObject(product.getResponse());
- allVersions = convertProductResponseToJavaObject.getAllVersions();
- values = allVersions.values();
- genericCollection.addAll(values);
-
- break;
- }
- } catch (Exception e1) {
- e1.printStackTrace();
- }
- }
-
- protected static Map<String, List<Component>> getCatalogAsMap() throws Exception {
- RestResponse catalog = CatalogRestUtils.getCatalog(UserRoleEnum.DESIGNER.getUserId());
- Map<String, List<Component>> convertCatalogResponseToJavaObject = ResponseParser.convertCatalogResponseToJavaObject(catalog.getResponse());
- return convertCatalogResponseToJavaObject;
- }
-
- protected Resource createVfFromCSAR(User sdncModifierDetails, String csarId) throws Exception {
- // create new resource from Csar
- ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
-
- resourceDetails.setCsarUUID(csarId);
- resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
- RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
- BaseRestUtils.checkCreateResponse(createResource);
- Resource createdResource = ResponseParser.convertResourceResponseToJavaObject(createResource.getResponse());
- return createdResource;
- }
-
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentInstanceBaseTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentInstanceBaseTest.java
deleted file mode 100644
index 87b4c77ec6..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentInstanceBaseTest.java
+++ /dev/null
@@ -1,732 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.api;
-
-import org.apache.commons.lang3.tuple.ImmutablePair;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.*;
-import org.openecomp.sdc.ci.tests.datatypes.*;
-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.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.*;
-import org.testng.Assert;
-
-import java.io.IOException;
-import java.util.*;
-import java.util.Map.Entry;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-
-import static org.testng.AssertJUnit.*;
-
-public class ComponentInstanceBaseTest extends ComponentBaseTest {
- public static final String acceptHeaderData = "application/json";
- // Req/cap of container component
- protected Map<String, List<CapabilityDefinition>> expectedContainerCapabilities;
- protected Map<String, List<RequirementDefinition>> expectedContainerRequirements;
- protected Map<String, Map<String, List<RequirementDefinition>>> removedRequirements;
- protected Map<String, ImmutablePair<Map<String, List<CapabilityDefinition>>, Map<String, List<RequirementDefinition>>>> expectedContInstReqCap;
-
- protected User sdncPsDetails1;
- protected User sdncPsDetails2;
- protected User sdncPmDetails1;
- protected User sdncPmDetails2;
- protected User sdncDesignerDetails;
- protected User sdncAdminDetails;
- protected User sdncTesterDetails;
- protected ResourceReqDetails resourceDetailsVFC_01;
- protected ResourceReqDetails resourceDetailsVFC_02;
- protected ResourceReqDetails resourceDetailsVF_01;
- protected ResourceReqDetails resourceDetailsVF_02;
- protected ResourceReqDetails resourceDetailsCP_01;
- protected ResourceReqDetails resourceDetailsCP_02;
- protected ResourceReqDetails resourceDetailsVL_01;
- protected ResourceReqDetails resourceDetailsVL_02;
- protected ServiceReqDetails serviceDetails_01;
- protected ServiceReqDetails serviceDetails_02;
- protected ServiceReqDetails serviceDetails_03;
- protected ProductReqDetails productDetails_01;
- protected ProductReqDetails productDetails_02;
-
- public void init() {
- // Req/caps of inner componentInstances
- expectedContainerCapabilities = new LinkedHashMap<String, List<CapabilityDefinition>>();
- expectedContainerRequirements = new LinkedHashMap<String, List<RequirementDefinition>>();
- removedRequirements = new HashMap<>();
- expectedContInstReqCap = new HashMap<>();
-
- sdncPsDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST1);
- sdncPsDetails2 = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST2);
- sdncPmDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1);
- sdncPmDetails2 = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER2);
- sdncDesignerDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- sdncAdminDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- sdncTesterDetails = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
- resourceDetailsVFC_01 = ElementFactory.getDefaultResourceByType("ciVFC100", NormativeTypesEnum.SOFTWARE_COMPONENT, ResourceCategoryEnum.GENERIC_DATABASE, sdncDesignerDetails.getUserId(), ResourceTypeEnum.VFC.toString()); // resourceType = VFC
- resourceDetailsVFC_02 = ElementFactory.getDefaultResourceByType("ciVFC200", NormativeTypesEnum.COMPUTE, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, sdncDesignerDetails.getUserId(), ResourceTypeEnum.VFC.toString());
- resourceDetailsVF_01 = ElementFactory.getDefaultResourceByType("ciVF100", NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, sdncDesignerDetails.getUserId(), ResourceTypeEnum.VF.toString());
- resourceDetailsVF_02 = ElementFactory.getDefaultResourceByType("ciVF200", NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, sdncDesignerDetails.getUserId(), ResourceTypeEnum.VF.toString());
- resourceDetailsCP_01 = ElementFactory.getDefaultResourceByType("ciCP100", NormativeTypesEnum.PORT, ResourceCategoryEnum.GENERIC_NETWORK_ELEMENTS, sdncDesignerDetails.getUserId(), ResourceTypeEnum.CP.toString());
- resourceDetailsCP_02 = ElementFactory.getDefaultResourceByType("ciCP200", NormativeTypesEnum.PORT, ResourceCategoryEnum.GENERIC_DATABASE, sdncDesignerDetails.getUserId(), ResourceTypeEnum.CP.toString());
- resourceDetailsVL_01 = ElementFactory.getDefaultResourceByType("ciVL100", NormativeTypesEnum.NETWORK, ResourceCategoryEnum.GENERIC_NETWORK_ELEMENTS, sdncDesignerDetails.getUserId(), ResourceTypeEnum.VL.toString());
- resourceDetailsVL_02 = ElementFactory.getDefaultResourceByType("ciVL200", NormativeTypesEnum.NETWORK, ResourceCategoryEnum.GENERIC_NETWORK_ELEMENTS, sdncDesignerDetails.getUserId(), ResourceTypeEnum.VL.toString());
- serviceDetails_01 = ElementFactory.getDefaultService("ciNewtestservice1", ServiceCategoriesEnum.MOBILITY, sdncDesignerDetails.getUserId(), ServiceInstantiationType.A_LA_CARTE.getValue());
- serviceDetails_02 = ElementFactory.getDefaultService("ciNewtestservice2", ServiceCategoriesEnum.MOBILITY, sdncDesignerDetails.getUserId(), ServiceInstantiationType.A_LA_CARTE.getValue());
- serviceDetails_03 = ElementFactory.getDefaultService("ciNewtestservice3", ServiceCategoriesEnum.MOBILITY, sdncDesignerDetails.getUserId(), ServiceInstantiationType.A_LA_CARTE.getValue());
- productDetails_01 = ElementFactory.getDefaultProduct("ciProduct01");
- productDetails_02 = ElementFactory.getDefaultProduct("ciProduct02");
- }
-
- public ComponentInstanceBaseTest(TestName testName, String className) {
- super(testName, className);
- }
-
- public void verifyVFReqCap(String componentId) throws Exception {
- RestResponse restResponse = ResourceRestUtils.getResource(componentId);
- Resource resource = ResponseParser.parseToObject(restResponse.getResponse(), Resource.class);
- verifyReqCap(resource);
- }
-
- public void verifyServiceReqCap(String componentId) throws Exception {
- RestResponse restResponse = ServiceRestUtils.getService(componentId, sdncDesignerDetails);
- Service service = ResponseParser.parseToObject(restResponse.getResponse(), Service.class);
- verifyReqCap(service);
- }
-
- public void verifyProductReqCap(String componentId) throws Exception {
- RestResponse restResponse = ProductRestUtils.getProduct(componentId, sdncPsDetails1.getUserId());
- Product product = ResponseParser.parseToObject(restResponse.getResponse(), Product.class);
- verifyReqCap(product);
- }
-
- public void verifyReqCap(Component actualComponent) {
- verifyContainerReqCap(actualComponent);
- verifyCompInstReqCap(actualComponent);
- }
-
- public RestResponse changeServiceInstanceVersion(String componentUniqueId, String serviceInstanceToReplaceUniqueId, String serviceUniqueId, User sdncModifierDetails, ComponentTypeEnum componentType, boolean isHighestLevel) throws Exception {
- RestResponse changeResourceInstanceVersion = ProductRestUtils.changeServiceInstanceVersion(componentUniqueId, serviceInstanceToReplaceUniqueId, serviceUniqueId, sdncModifierDetails, componentType);
- if (changeResourceInstanceVersion.getErrorCode().equals(BaseRestUtils.STATUS_CODE_SUCCESS) && isHighestLevel) {
- /*
- * // Add RI Capabilities and Requirements to expected MAP --> expectedVfCapabilities and expectedVfRequirements
- *
- * ComponentInstance componentInstance = ResponseParser.parseToObjectUsingMapper( changeResourceInstanceVersion.getResponse(), ComponentInstance.class); addCompInstReqCapToExpected(componentInstance, componentType);
- */
- }
- return changeResourceInstanceVersion;
- }
-
- protected void updateExpectedReqCapAfterChangeLifecycleState(String oldContainerUniqueIdToReplace, String newContainerUniqueId) {
-
- // Update of container req/cap
-
- Set<String> compInstKeysToChange = new HashSet<>();
-
- for (String expKey : expectedContainerCapabilities.keySet()) {
- List<CapabilityDefinition> expCapList = expectedContainerCapabilities.get(expKey);
- for (CapabilityDefinition cap : expCapList) {
- String ownerId = cap.getOwnerId();
-
- if (ownerId.contains(oldContainerUniqueIdToReplace)) {
- compInstKeysToChange.add(ownerId);
- cap.setOwnerId(cap.getOwnerId().replaceAll(oldContainerUniqueIdToReplace, newContainerUniqueId));
- }
- }
- }
-
- for (String expKey : expectedContainerRequirements.keySet()) {
- List<RequirementDefinition> expCapList = expectedContainerRequirements.get(expKey);
- for (RequirementDefinition cap : expCapList) {
- String ownerId = cap.getOwnerId();
- if (ownerId.contains(oldContainerUniqueIdToReplace)) {
- compInstKeysToChange.add(ownerId);
- cap.setOwnerId(cap.getOwnerId().replaceAll(oldContainerUniqueIdToReplace, newContainerUniqueId));
- }
- }
- }
-
- // Update of internal comp instances req/cap
- for (String oldKey : compInstKeysToChange) {
- ImmutablePair<Map<String, List<CapabilityDefinition>>, Map<String, List<RequirementDefinition>>> immutablePair = expectedContInstReqCap.get(oldKey);
- if (immutablePair != null) {
- expectedContInstReqCap.remove(oldKey);
- String newKey = oldKey.replaceAll(oldContainerUniqueIdToReplace, newContainerUniqueId);
- expectedContInstReqCap.put(newKey, immutablePair);
- }
- }
-
- // Update of removed req
- for (String oldKey : compInstKeysToChange) {
- Map<String, List<RequirementDefinition>> map = removedRequirements.get(oldKey);
- if (map != null) {
- removedRequirements.remove(oldKey);
- String newKey = oldKey.replaceAll(oldContainerUniqueIdToReplace, newContainerUniqueId);
- Collection<List<RequirementDefinition>> values = map.values();
- if (values != null) {
- for (List<RequirementDefinition> list : values) {
- for (RequirementDefinition reqDef : list) {
- reqDef.setOwnerId(reqDef.getOwnerId().replaceAll(oldContainerUniqueIdToReplace, newContainerUniqueId));
- }
- }
- }
- removedRequirements.put(newKey, map);
- }
- }
- }
-
- private void verifyCompInstReqCap(Component actualComponent) {
- List<ComponentInstance> componentInstances = actualComponent.getComponentInstances();
- if (componentInstances != null) {
- assertEquals(expectedContInstReqCap.size(), componentInstances.size());
- for (ComponentInstance compInst : componentInstances) {
- String uniqueId = compInst.getUniqueId();
- // System.out.println("Verifying req/cap of component instance
- // "+ uniqueId);
- Map<String, List<RequirementDefinition>> actualCompInstReq = compInst.getRequirements();
- if (actualCompInstReq == null) {
- actualCompInstReq = new HashMap<>();
- }
- Map<String, List<CapabilityDefinition>> actualCompInstCap = compInst.getCapabilities();
- if (actualCompInstCap == null) {
- actualCompInstCap = new HashMap<>();
- }
- ImmutablePair<Map<String, List<CapabilityDefinition>>, Map<String, List<RequirementDefinition>>> expReqCap = expectedContInstReqCap.get(uniqueId);
- assertNotNull(expReqCap);
- // System.out.println("expected instance requirements:
- // "+expReqCap.right);
- // System.out.println("expected instance capabilities:
- // "+expReqCap.left);
- // System.out.println("actual instance requirements:
- // "+actualCompInstReq);
- // System.out.println("actual instance capabilities:
- // "+actualCompInstCap);
-
- // REQ comparison
- compareReqCapMaps(expReqCap.right, actualCompInstReq);
-
- // CAP comparison
- compareReqCapMaps(expReqCap.left, actualCompInstCap);
- }
-
- } else {
- assertTrue(expectedContInstReqCap.isEmpty());
- }
- }
-
- private void verifyContainerReqCap(Component actualComponent) {
- Map<String, List<RequirementDefinition>> actualContainerRequirements = actualComponent.getRequirements();
- if (actualContainerRequirements == null) {
- actualContainerRequirements = new HashMap<>();
- }
- Map<String, List<CapabilityDefinition>> actualContainerCapabilities = actualComponent.getCapabilities();
- if (actualContainerCapabilities == null) {
- actualContainerCapabilities = new HashMap<>();
- }
- // System.out.println("Verifying req/cap of container component "+
- // actualComponent.getUniqueId());
- // System.out.println("expected container requirements:
- // "+expectedContainerRequirements);
- // System.out.println("expected container capabilities:
- // "+expectedContainerCapabilities);
- // System.out.println("actual container requirements:
- // "+actualContainerRequirements);
- // System.out.println("actual container capabilities:
- // "+actualContainerCapabilities);
-
- // REQ comparison
- compareReqCapMaps(expectedContainerRequirements, actualContainerRequirements);
-
- // CAP comparison
- compareReqCapMaps(expectedContainerCapabilities, actualContainerCapabilities);
- }
-
- private <T> void compareReqCapMaps(Map<String, List<T>> expectedMap, Map<String, List<T>> actualMap) {
- assertEquals(expectedMap.size(), actualMap.size());
- for (String expKey : expectedMap.keySet()) {
- List<?> expCapList = expectedMap.get(expKey);
- List<?> actCapList = actualMap.get(expKey);
- assertEquals(expCapList.size(), actCapList.size());
- assertEquals(new HashSet<>(expCapList), new HashSet<>(actCapList));
- }
- }
-
- public void addCompInstReqCapToExpected(ComponentInstance componentInstance, ComponentTypeEnum containerComponentType) throws Exception {
- String uniqueId = componentInstance.getUniqueId();
- String name = componentInstance.getName();
- String originComponentId = componentInstance.getComponentUid();
- RestResponse getResponse = null;
- ComponentTypeEnum compInstType = getCompInstTypeByContainerType(containerComponentType);
- Component component = null;
- if (compInstType == ComponentTypeEnum.RESOURCE) {
- getResponse = ResourceRestUtils.getResource(sdncDesignerDetails, originComponentId);
- ResourceRestUtils.checkSuccess(getResponse);
- component = ResponseParser.parseToObjectUsingMapper(getResponse.getResponse(), Resource.class);
- } else if (compInstType == ComponentTypeEnum.SERVICE) {
- getResponse = ServiceRestUtils.getService(originComponentId, sdncDesignerDetails);
- ResourceRestUtils.checkSuccess(getResponse);
- component = ResponseParser.parseToObjectUsingMapper(getResponse.getResponse(), Service.class);
- } else {
- Assert.fail("Unsupported type - " + containerComponentType);
- }
-
- Map<String, List<RequirementDefinition>> resourceRequirements = component.getRequirements();
- if (resourceRequirements == null) {
- resourceRequirements = new HashMap<>();
- }
-
- Function<Entry<String, List<RequirementDefinition>>, List<RequirementDefinition>> requirementDefinitionMapper = e -> new ArrayList<>(e.getValue().stream().map(item -> new RequirementDefinition(item)).collect(Collectors.toList()));
- Map<String, List<RequirementDefinition>> reqCopy = resourceRequirements.entrySet().stream().collect(Collectors.toMap(e -> e.getKey(), requirementDefinitionMapper));
-
- Map<String, List<CapabilityDefinition>> resourceCapabilities = component.getCapabilities();
- if (resourceCapabilities == null) {
- resourceCapabilities = new HashMap<>();
- }
-
- Function<? super Entry<String, List<CapabilityDefinition>>, List<CapabilityDefinition>> capabilityDefinitionMapper = e -> new ArrayList<>(e.getValue().stream().map(item -> new CapabilityDefinition(item)).collect(Collectors.toList()));
- Map<String, List<CapabilityDefinition>> capCopy = resourceCapabilities.entrySet().stream().collect(Collectors.toMap(e -> e.getKey(), capabilityDefinitionMapper));
-
- setupContainerExpectedReqCap(uniqueId, name, resourceRequirements, resourceCapabilities);
- if (component.getComponentType().equals(ComponentTypeEnum.RESOURCE) && ((Resource) component).getResourceType() != ResourceTypeEnum.VF) {
- setupConstInstExpectedReqCap(uniqueId, name, reqCopy, capCopy);
- }
-
- // adding entry for expected componentInstance
- ImmutablePair<Map<String, List<CapabilityDefinition>>, Map<String, List<RequirementDefinition>>> compInstReqCapPair = new ImmutablePair<Map<String, List<CapabilityDefinition>>, Map<String, List<RequirementDefinition>>>(capCopy, reqCopy);
- expectedContInstReqCap.put(uniqueId, compInstReqCapPair);
- }
-
- private void setupContainerExpectedReqCap(String uniqueId, String name, Map<String, List<RequirementDefinition>> componentRequirements, Map<String, List<CapabilityDefinition>> componentCapabilities) {
- for (Entry<String, List<RequirementDefinition>> resReq : componentRequirements.entrySet()) {
- List<RequirementDefinition> reqListToAdd = resReq.getValue();
- for (RequirementDefinition requirementDefinition : reqListToAdd) {
- requirementDefinition.setOwnerId(uniqueId);
- requirementDefinition.setOwnerName(name);
- }
- List<RequirementDefinition> expectedReqList = expectedContainerRequirements.get(resReq.getKey());
- if (expectedReqList == null) {
- expectedReqList = reqListToAdd;
- } else {
- expectedReqList.addAll(reqListToAdd);
- }
- expectedContainerRequirements.put(resReq.getKey(), expectedReqList);
- }
-
- for (Entry<String, List<CapabilityDefinition>> resCap : componentCapabilities.entrySet()) {
- List<CapabilityDefinition> capListToAdd = resCap.getValue();
- for (CapabilityDefinition capDefinition : capListToAdd) {
- capDefinition.setOwnerId(uniqueId);
- capDefinition.setOwnerName(name);
- }
- List<CapabilityDefinition> expectedCapList = expectedContainerCapabilities.get(resCap.getKey());
- if (expectedCapList == null) {
- expectedCapList = capListToAdd;
- } else {
- expectedCapList.addAll(capListToAdd);
- }
- expectedContainerCapabilities.put(resCap.getKey(), expectedCapList);
- }
- }
-
- private void setupConstInstExpectedReqCap(String uniqueId, String name, Map<String, List<RequirementDefinition>> componentRequirements, Map<String, List<CapabilityDefinition>> componentCapabilities) {
- for (Entry<String, List<RequirementDefinition>> resReq : componentRequirements.entrySet()) {
- List<RequirementDefinition> reqListToAdd = resReq.getValue();
- for (RequirementDefinition requirementDefinition : reqListToAdd) {
- requirementDefinition.setOwnerId(uniqueId);
- requirementDefinition.setOwnerName(name);
- }
- }
-
- for (Entry<String, List<CapabilityDefinition>> resCap : componentCapabilities.entrySet()) {
- List<CapabilityDefinition> capListToAdd = resCap.getValue();
- for (CapabilityDefinition capDefinition : capListToAdd) {
- capDefinition.setOwnerId(uniqueId);
- capDefinition.setOwnerName(name);
- }
- }
- }
-
- private ComponentTypeEnum getCompInstTypeByContainerType(ComponentTypeEnum componentType) {
- switch (componentType) {
- case RESOURCE:
- return ComponentTypeEnum.RESOURCE;
- case SERVICE:
- return ComponentTypeEnum.RESOURCE;
- case PRODUCT:
- return ComponentTypeEnum.SERVICE;
- default:
- break;
- }
- return null;
- }
-
- public void deleteCompInstReqCapFromExpected(String componentInstanceId) {
- List<String> entriesRequirementsToRemove = new ArrayList<>();
- List<String> entriesCapabilitiesToRemove = new ArrayList<>();
- for (Entry<String, List<RequirementDefinition>> reqEntry : expectedContainerRequirements.entrySet()) {
- List<RequirementDefinition> reqList = reqEntry.getValue();
- List<RequirementDefinition> reqListToDelete = new ArrayList<>();
- for (RequirementDefinition requirementDefinition : reqList) {
- if (requirementDefinition.getOwnerId().equals(componentInstanceId)) {
- reqListToDelete.add(requirementDefinition);
- }
- }
- reqList.removeAll(reqListToDelete);
- if (reqList.isEmpty()) {
- entriesRequirementsToRemove.add(reqEntry.getKey());
- }
- }
-
- for (String ekey : entriesRequirementsToRemove) {
- expectedContainerRequirements.remove(ekey);
- }
-
- for (Entry<String, List<CapabilityDefinition>> capEntry : expectedContainerCapabilities.entrySet()) {
- List<CapabilityDefinition> capList = capEntry.getValue();
- List<CapabilityDefinition> capListToDelete = new ArrayList<>();
- for (CapabilityDefinition capabilityDefinition : capList) {
- if (capabilityDefinition.getOwnerId().equals(componentInstanceId)) {
- capListToDelete.add(capabilityDefinition);
- }
- }
- capList.removeAll(capListToDelete);
- if (capList.isEmpty()) {
- entriesCapabilitiesToRemove.add(capEntry.getKey());
- }
- }
- for (String ekey : entriesCapabilitiesToRemove) {
- expectedContainerCapabilities.remove(ekey);
- }
-
- expectedContInstReqCap.remove(componentInstanceId);
-
- }
-
- // Automatically updates the expected req/cap of the container
- protected RestResponse createAtomicInstanceForVF(ResourceReqDetails containerDetails, ResourceReqDetails compInstOriginDetails, User modifier) throws Exception {
- return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.RESOURCE, true);
- }
-
- // Automatically updates the expected req/cap of the container
- protected RestResponse createAtomicInstanceForService(ServiceReqDetails containerDetails, ResourceReqDetails compInstOriginDetails, User modifier) throws Exception {
- return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.SERVICE, true);
- }
-
- // Automatically updates the expected req/cap of the container
- protected RestResponse createVFInstance(ServiceReqDetails containerDetails, ResourceReqDetails compInstOriginDetails, User modifier) throws Exception {
- return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.SERVICE, true);
- }
-
- // Automatically updates the expected req/cap of the container
- protected RestResponse createServiceInstance(ProductReqDetails containerDetails, ServiceReqDetails compInstOriginDetails, User modifier) throws Exception {
- return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.PRODUCT, true);
- }
-
- // Automatically updates the expected req/cap of the container
- protected RestResponse deleteAtomicInstanceForVF(String compInstUniqueId, ResourceReqDetails containerDetails, User modifier) throws IOException, Exception {
- return deleteComponentInstance(compInstUniqueId, containerDetails, modifier, ComponentTypeEnum.RESOURCE, true);
- }
-
- // Automatically updates the expected req/cap of the container
- protected RestResponse deleteAtomicInstanceForService(String compInstUniqueId, ServiceReqDetails containerDetails, User modifier) throws IOException, Exception {
- return deleteComponentInstance(compInstUniqueId, containerDetails, modifier, ComponentTypeEnum.SERVICE, true);
- }
-
- // Automatically updates the expected req/cap of the container
- protected RestResponse deleteVFInstance(String compInstUniqueId, ServiceReqDetails containerDetails, User modifier) throws IOException, Exception {
- return deleteComponentInstance(compInstUniqueId, containerDetails, modifier, ComponentTypeEnum.SERVICE, true);
-
- }
-
- // Automatically updates the expected req/cap of the container
- protected RestResponse deleteServiceInstance(String compInstUniqueId, ProductReqDetails containerDetails, User modifier) throws IOException, Exception {
- return deleteComponentInstance(compInstUniqueId, containerDetails, modifier, ComponentTypeEnum.PRODUCT, true);
- }
-
- // Setup of lower components - Doesn't affect req/cap of the container (for
- // example, setup of VF for testing a Product)
- protected RestResponse createAtomicInstanceForVFDuringSetup(ResourceReqDetails containerDetails, ResourceReqDetails compInstOriginDetails, User modifier) throws Exception {
- return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.RESOURCE, false);
- }
-
- // Setup of lower components - Doesn't affect req/cap of the container (for
- // example, setup of VF for testing a Product)
- protected RestResponse createAtomicInstanceForServiceDuringSetup(ServiceReqDetails containerDetails, ResourceReqDetails compInstOriginDetails, User modifier) throws Exception {
- return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.SERVICE, false);
- }
-
- // Setup of lower components - Doesn't affect req/cap of the container (for
- // example, setup of VF for testing a Product)
- protected RestResponse createVFInstanceDuringSetup(ServiceReqDetails containerDetails, ResourceReqDetails compInstOriginDetails, User modifier) throws Exception {
- return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.SERVICE, false);
- }
-
- // Setup of lower components - Doesn't affect req/cap of the container (for
- // example, setup of VF for testing a Product)
- protected RestResponse createServiceInstanceDuringSetup(ProductReqDetails containerDetails, ServiceReqDetails compInstOriginDetails, User modifier) throws Exception {
- return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.PRODUCT, false);
- }
-
- // Setup of lower components - Doesn't affect req/cap of the container (for
- // example, setup of VF for testing a Product)
- protected RestResponse deleteAtomicInstanceForVFDuringSetup(String compInstUniqueId, ResourceReqDetails containerDetails, User modifier) throws IOException, Exception {
- return deleteComponentInstance(compInstUniqueId, containerDetails, modifier, ComponentTypeEnum.RESOURCE, false);
- }
-
- // Setup of lower components - Doesn't affect req/cap of the container (for
- // example, setup of VF for testing a Product)
- protected RestResponse deleteAtomicInstanceForServiceDuringSetup(String compInstUniqueId, ServiceReqDetails containerDetails, User modifier) throws IOException, Exception {
- return deleteComponentInstance(compInstUniqueId, containerDetails, modifier, ComponentTypeEnum.SERVICE, false);
- }
-
- // Setup of lower components - Doesn't affect req/cap of the container (for
- // example, setup of VF for testing a Product)
- protected RestResponse deleteVFInstanceDuringSetup(String compInstUniqueId, ServiceReqDetails containerDetails, User modifier) throws IOException, Exception {
- return deleteComponentInstance(compInstUniqueId, containerDetails, modifier, ComponentTypeEnum.SERVICE, false);
-
- }
-
- // Setup of lower components - Doesn't affect req/cap of the container (for
- // example, setup of VF for testing a Product)
- protected RestResponse deleteServiceInstanceDuringSetup(String compInstUniqueId, ProductReqDetails containerDetails, User modifier) throws IOException, Exception {
- return deleteComponentInstance(compInstUniqueId, containerDetails, modifier, ComponentTypeEnum.PRODUCT, false);
- }
-
- protected Component getComponentAndValidateRIs(ComponentReqDetails componentDetails, int numberOfRIs, int numberOfRelations) throws IOException, Exception {
-
- RestResponse getResponse = null;
- Component component = null;
- if (componentDetails instanceof ResourceReqDetails) {
- getResponse = ResourceRestUtils.getResource(sdncAdminDetails, componentDetails.getUniqueId());
- component = ResponseParser.parseToObjectUsingMapper(getResponse.getResponse(), Resource.class);
- } else if (componentDetails instanceof ServiceReqDetails) {
- getResponse = ServiceRestUtils.getService((ServiceReqDetails) componentDetails, sdncAdminDetails);
- component = ResponseParser.parseToObjectUsingMapper(getResponse.getResponse(), Service.class);
- } else if (componentDetails instanceof ProductReqDetails) {
- getResponse = ProductRestUtils.getProduct(componentDetails.getUniqueId(), sdncAdminDetails.getUserId());
- component = ResponseParser.parseToObjectUsingMapper(getResponse.getResponse(), Product.class);
- } else {
- Assert.fail("Unsupported type of componentDetails - " + componentDetails.getClass().getSimpleName());
- }
- ResourceRestUtils.checkSuccess(getResponse);
- int numberOfActualRIs = component.getComponentInstances() != null ? component.getComponentInstances().size() : 0;
- int numberOfActualRelations = component.getComponentInstancesRelations() != null ? component.getComponentInstancesRelations().size() : 0;
- assertEquals("Check number of RIs meet the expected number", numberOfRIs, numberOfActualRIs);
- assertEquals("Check number of RI relations meet the expected number", numberOfRelations, numberOfActualRelations);
- verifyReqCap(component);
-
- return component;
- }
-
- protected void getComponentAndValidateRIsAfterChangeLifecycleState(String oldComponentUniqueIdToReplace, ComponentReqDetails componentDetails, int numOfRIs, int numOfRelations) throws IOException, Exception {
- updateExpectedReqCapAfterChangeLifecycleState(oldComponentUniqueIdToReplace, componentDetails.getUniqueId());
- getComponentAndValidateRIs(componentDetails, numOfRIs, numOfRelations);
- }
-
- private RestResponse createComponentInstance(ComponentReqDetails containerDetails, ComponentReqDetails compInstOriginDetails, User modifier, ComponentTypeEnum containerComponentTypeEnum, boolean isHighestLevel) throws IOException, Exception {
- ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory.getComponentResourceInstance(compInstOriginDetails);
- RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(resourceInstanceReqDetails, modifier, containerDetails.getUniqueId(), containerComponentTypeEnum);
- if (createResourceInstanceResponse.getErrorCode().equals(BaseRestUtils.STATUS_CODE_CREATED) && isHighestLevel) {
- // Add RI Capabilities and Requirements to expected MAP -->
- // expectedVfCapabilities and expectedVfRequirements
- ComponentInstance componentInstance = ResponseParser.parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
- addCompInstReqCapToExpected(componentInstance, containerComponentTypeEnum);
- }
- return createResourceInstanceResponse;
- }
-
- private RestResponse deleteComponentInstance(String compInstUniqueId, ComponentReqDetails containerDetails, User modifier, ComponentTypeEnum componentTypeEnum, boolean isHighestLevel) throws Exception {
- RestResponse deleteResourceInstanceResponse = ComponentInstanceRestUtils.deleteComponentInstance(modifier, containerDetails.getUniqueId(), compInstUniqueId, componentTypeEnum);
- if (deleteResourceInstanceResponse.getErrorCode().equals(BaseRestUtils.STATUS_CODE_DELETE) && isHighestLevel) {
- deleteCompInstReqCapFromExpected(compInstUniqueId);
- }
- return deleteResourceInstanceResponse;
- }
-
- // Create Atomic resource ( VFC/CP/VL)
- protected void createAtomicResource(ResourceReqDetails resourceDetails) throws Exception {
- RestResponse createResourceResponse = ResourceRestUtils.createResource(resourceDetails, sdncDesignerDetails);
- ResourceRestUtils.checkCreateResponse(createResourceResponse);
-
- }
-
- protected void createVF(ResourceReqDetails resourceDetails) throws Exception {
- createVF(resourceDetails, sdncDesignerDetails);
-
- }
-
- protected void createVF(ResourceReqDetails resourceDetails, User sdncModifier) throws Exception {
- RestResponse createVfResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifier);
- ResourceRestUtils.checkCreateResponse(createVfResponse);
- }
-
- protected void createService(ServiceReqDetails serviceDetails) throws Exception {
- createService(serviceDetails, sdncDesignerDetails);
- }
-
- protected void createService(ServiceReqDetails serviceDetails, User sdncModifier) throws Exception {
- RestResponse createServiceResponse = ServiceRestUtils.createService(serviceDetails, sdncModifier);
- ResourceRestUtils.checkCreateResponse(createServiceResponse);
- }
-
- protected void createProduct(ProductReqDetails productDetails) throws Exception {
- createProduct(productDetails, sdncPmDetails1);
- }
-
- protected void createProduct(ProductReqDetails productDetails, User sdncModifier) throws Exception {
- RestResponse createProductResponse = ProductRestUtils.createProduct(productDetails, sdncModifier);
- ResourceRestUtils.checkCreateResponse(createProductResponse);
- }
-
- protected RestResponse associateComponentInstancesForService(RequirementCapabilityRelDef requirementDef, ComponentReqDetails containerDetails, User user) throws IOException {
-
- RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, user, containerDetails.getUniqueId(), ComponentTypeEnum.SERVICE);
- ResourceRestUtils.checkSuccess(associateInstances);
- deleteAssociatedFromExpected(requirementDef);
-
- return associateInstances;
- }
-
- private void deleteAssociatedFromExpected(RequirementCapabilityRelDef requirementDef) {
- // removing from requirements
- RelationshipInfo relationship = requirementDef.getRelationships().get(0).getRelation();
- String type = relationship.getRelationship().getType();
- String fromId = requirementDef.getFromNode();
- List<RequirementDefinition> reqList = expectedContainerRequirements.get(type);
- List<CapabilityDefinition> capList = expectedContainerCapabilities.get(type);
- RequirementDefinition toDelete = null;
- if (reqList != null) {
- for (RequirementDefinition reqDef : reqList) {
- if (reqDef.getOwnerId().equals(fromId)) {
- toDelete = reqDef;
- }
- }
- if (toDelete != null) {
- reqList.remove(toDelete);
- if (reqList.isEmpty()) {
- expectedContainerRequirements.remove(type);
- }
- String ownerId = toDelete.getOwnerId();
- Map<String, List<RequirementDefinition>> map = removedRequirements.get(ownerId);
- if (map == null) {
- map = new HashMap<>();
- removedRequirements.put(ownerId, map);
- }
- List<RequirementDefinition> list = map.get(type);
- if (list == null) {
- list = new ArrayList<>();
- map.put(type, list);
- }
- list.add(toDelete);
- }
- }
-
- for (CapabilityDefinition capabilityDefinition : capList) {
- if (capabilityDefinition.getType().equals(type)) {
- int minOccurrences = Integer.parseInt(capabilityDefinition.getMinOccurrences()) - 1;
- if (minOccurrences < 0)
- minOccurrences = 0;
- String minOccurrencesString = Integer.toString(minOccurrences);
- capabilityDefinition.setMinOccurrences(minOccurrencesString);
- if (!capabilityDefinition.getMaxOccurrences().equals("UNBOUNDED")) {
- int maxOccurrences = Integer.parseInt(capabilityDefinition.getMaxOccurrences()) - 1;
- if (maxOccurrences < 0)
- maxOccurrences = 0;
- String maxOccurrencesString = Integer.toString(maxOccurrences);
- capabilityDefinition.setMaxOccurrences(maxOccurrencesString);
- }
- }
- }
- expectedContainerCapabilities.put(type, capList);
- }
-
- protected void dissociateComponentInstancesForService(RequirementCapabilityRelDef requirementDef, ComponentReqDetails containerDetails, User user) throws IOException {
-
- RestResponse dissociateInstances = ComponentInstanceRestUtils.dissociateInstances(requirementDef, user, containerDetails.getUniqueId(), ComponentTypeEnum.SERVICE);
- ResourceRestUtils.checkSuccess(dissociateInstances);
- addDissociatedToExpected(requirementDef);
- }
-
- protected void fulfillCpRequirement(ComponentReqDetails component, String cpCompInstId, String cpReqFulfillerCompInstId, String cpReqFulfillerOwnerId, User user, ComponentTypeEnum containerCompType) throws IOException {
- // Fulfilling cp's "binding" requirement - US626240
- String requirementName = "binding";
- String capType = "tosca.capabilities.network.Bindable";
- RestResponse getResourceResponse = ComponentRestUtils.getComponentRequirmentsCapabilities(user, component);
- ResourceRestUtils.checkSuccess(getResourceResponse);
- CapReqDef capReqDef = ResponseParser.parseToObject(getResourceResponse.getResponse(), CapReqDef.class);
- List<CapabilityDefinition> capList = capReqDef.getCapabilities().get(capType);
- List<RequirementDefinition> reqList = capReqDef.getRequirements().get(capType);
- RequirementCapabilityRelDef reqCapRelation = ElementFactory.getReqCapRelation(cpCompInstId, cpReqFulfillerCompInstId, cpCompInstId, cpReqFulfillerOwnerId, capType, requirementName, capList, reqList);
- RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(reqCapRelation, user, component.getUniqueId(), containerCompType);
- ResourceRestUtils.checkSuccess(associateInstances);
- }
-
- protected void consumeVlCapability(ComponentReqDetails component, String vlCapConsumerCompInstId, String vlCompInstId, String vlCapConsumerOwnerId, User user, ComponentTypeEnum containerCompType) throws IOException {
- // Consuming vl's "link" capability - US626240
- String requirementName = "link";
- String capType = "tosca.capabilities.network.Linkable";
- RestResponse getResourceResponse = ComponentRestUtils.getComponentRequirmentsCapabilities(user, component);
- ResourceRestUtils.checkSuccess(getResourceResponse);
- CapReqDef capReqDef = ResponseParser.parseToObject(getResourceResponse.getResponse(), CapReqDef.class);
- List<CapabilityDefinition> capList = capReqDef.getCapabilities().get(capType);
- List<RequirementDefinition> reqList = capReqDef.getRequirements().get(capType);
- RequirementCapabilityRelDef reqCapRelation = ElementFactory.getReqCapRelation(vlCapConsumerCompInstId, vlCompInstId, vlCapConsumerOwnerId, vlCompInstId, capType, requirementName, capList, reqList);
- RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(reqCapRelation, user, component.getUniqueId(), containerCompType);
- ResourceRestUtils.checkSuccess(associateInstances);
- }
-
- private void addDissociatedToExpected(RequirementCapabilityRelDef requirementDef) {
- // adding to requirements
- RelationshipInfo relationship = requirementDef.getRelationships().get(0).getRelation();
- String type = relationship.getRelationship().getType();
- String fromId = requirementDef.getFromNode();
- Map<String, List<RequirementDefinition>> map = removedRequirements.get(fromId);
- if (map != null) {
- List<RequirementDefinition> list = map.get(type);
- if (list != null && !list.isEmpty()) {
- List<RequirementDefinition> reqList = expectedContainerRequirements.get(type);
- if (reqList == null) {
- reqList = new ArrayList<>();
- expectedContainerRequirements.put(type, reqList);
- }
- reqList.add(list.remove(0));
- }
- }
-
- List<CapabilityDefinition> capList = expectedContainerCapabilities.get(type);
-
- for (CapabilityDefinition capabilityDefinition : capList) {
- if (capabilityDefinition.getType().equals(type)) {
- int minOccurrences = Integer.parseInt(capabilityDefinition.getMinOccurrences()) + 1;
- String minOccurrencesString = Integer.toString(minOccurrences);
- capabilityDefinition.setMinOccurrences(minOccurrencesString);
- if (!capabilityDefinition.getMaxOccurrences().equals("UNBOUNDED")) {
- int maxOccurrences = Integer.parseInt(capabilityDefinition.getMaxOccurrences()) + 1;
- String maxOccurrencesString = Integer.toString(maxOccurrences);
- capabilityDefinition.setMaxOccurrences(maxOccurrencesString);
- }
- }
- }
- expectedContainerCapabilities.put(type, capList);
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ExtentManager.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ExtentManager.java
deleted file mode 100644
index 194966d699..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ExtentManager.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.api;
-
-import com.aventstack.extentreports.ExtentReports;
-import com.aventstack.extentreports.reporter.ExtentHtmlReporter;
-import com.aventstack.extentreports.reporter.ExtentXReporter;
-import com.aventstack.extentreports.reporter.configuration.Protocol;
-import com.aventstack.extentreports.reporter.configuration.Theme;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.ci.tests.utils.general.FileHandling;
-import org.openecomp.sdc.ci.tests.utils.rest.AutomationUtils;
-import org.testng.ITestContext;
-
-import java.io.File;
-
-public class ExtentManager {
-
- private static final String VERSIONS_INFO_FILE_NAME = "versions.info";
- private static ExtentReports extent;
- private static ExtentHtmlReporter htmlReporter;
- private static ExtentXReporter extentxReporter;
-
- public enum suiteNameXml {
-
- TESTNG_FAILED_XML_NAME("testng-failed.xml");
-
- suiteNameXml(String value) {
- this.value = value;
- }
-
- private String value;
-
- public String getValue() {
- return value;
- }
-
- }
-
- public synchronized static ExtentReports setReporter(String filePath, String htmlFile, Boolean isAppend) throws Exception {
- String dbIp = Utils.getConfig().getReportDBhost();
- int dbPort = Utils.getConfig().getReportDBport();
-
- if (extent == null) {
- extentxReporter = new ExtentXReporter(dbIp, dbPort);
- extent = new ExtentReports();
- initAndSetExtentHtmlReporter(filePath, htmlFile, isAppend);
-
- if(extentxReporter.config().getReportObjectId() != null){
- setExtentXReporter(isAppend);
- }else{
- extentxReporter.stop();
- }
- }
- return extent;
- }
-
- public synchronized static void setExtentXReporter(Boolean isAppend){
- extentxReporter.setAppendExisting(isAppend);
- extent.attachReporter(extentxReporter);
- }
-
- public synchronized static void initAndSetExtentHtmlReporter(String filePath, String htmlFile, Boolean isAppend) throws Exception{
- htmlReporter = new ExtentHtmlReporter(filePath + htmlFile);
- setConfiguration(htmlReporter);
- htmlReporter.setAppendExisting(isAppend);
- extent.attachReporter(htmlReporter);
- }
-
- public synchronized static ExtentReports getReporter() {
- return extent;
- }
-
- public static void initReporter(String filepath, String htmlFile, ITestContext context) throws Exception {
-
- String onboardVersion = AutomationUtils.getOnboardVersion();
- String osVersion = AutomationUtils.getOSVersion();
- Config config = Utils.getConfig();
- String envData = config.getUrl();
- String suiteName = getSuiteName(context);
-
- if(suiteName.equals(suiteNameXml.TESTNG_FAILED_XML_NAME.getValue())){
- if (config.getUseBrowserMobProxy())
- setTrafficCaptue(config);
-
- setReporter(filepath, htmlFile, true);
- String suiteNameFromVersionInfoFile = FileHandling.getKeyByValueFromPropertyFormatFile(filepath + VERSIONS_INFO_FILE_NAME, "suiteName");
- reporterDataDefinition(onboardVersion, osVersion, envData, suiteNameFromVersionInfoFile);
- }else{
- FileHandling.deleteDirectory(ComponentBaseTest.getReportFolder());
- FileHandling.createDirectory(filepath);
- setReporter(filepath, htmlFile, false);
- reporterDataDefinition(onboardVersion, osVersion, envData, suiteName);
- AutomationUtils.createVersionsInfoFile(filepath + VERSIONS_INFO_FILE_NAME, onboardVersion, osVersion, envData, suiteName);
- }
-
- }
-
- public static void reporterDataDefinition(String onboardVersion, String osVersion, String envData, String suiteNameFromVersionInfoFile) throws Exception {
- extent.setSystemInfo("Onboard Version", onboardVersion);
- extent.setSystemInfo("OS Version", osVersion);
-// extent.setSystemInfo("Host Name Address", RestCDUtils.getExecutionHostAddress());
- extent.setSystemInfo("ExecutedOn", envData);
- extent.setSystemInfo("SuiteName", suiteNameFromVersionInfoFile);
- }
-
- public static String getSuiteName(ITestContext context) {
- String suitePath = context.getSuite().getXmlSuite().getFileName();
- if(suitePath != null){
- File file = new File(suitePath);
- String suiteName = file.getName();
- return suiteName;
- }
- return null;
- }
-
- public synchronized static ExtentHtmlReporter setConfiguration(ExtentHtmlReporter htmlReporter) throws Exception {
-
- htmlReporter.config().setTheme(Theme.STANDARD);
- htmlReporter.config().setEncoding("UTF-8");
- htmlReporter.config().setProtocol(Protocol.HTTPS);
- htmlReporter.config().setDocumentTitle("SDC Automation Report");
- htmlReporter.config().setChartVisibilityOnOpen(true);
-// htmlReporter.config().setReportName(AutomationUtils.getATTVersion());
- htmlReporter.config().setReportName("SDC Automation Report");
- htmlReporter.config().setChartVisibilityOnOpen(false);
-// htmlReporter.config().setJS(icon);
- return htmlReporter;
- }
-
- public static void closeReporter(){
- extent.flush();
- }
-
- public static void setTrafficCaptue(Config config) {
- boolean mobProxyStatus = config.getUseBrowserMobProxy();
- if (mobProxyStatus){
- config.setCaptureTraffic(true);;
- }
- }
-}
-
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ExtentTestActions.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ExtentTestActions.java
deleted file mode 100644
index 5cb5a5b442..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ExtentTestActions.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.api;
-
-import com.aventstack.extentreports.ExtentTest;
-import com.aventstack.extentreports.Status;
-import com.aventstack.extentreports.markuputils.ExtentColor;
-import com.aventstack.extentreports.markuputils.Markup;
-import com.aventstack.extentreports.markuputils.MarkupHelper;
-
-import java.io.File;
-
-
-public class ExtentTestActions {
-
- public static SomeInterface testManager = new ExtentTestManager();
-
- public static void log(Status logStatus, Markup mark){
- ExtentTest test = testManager.getTest();
- test.log(logStatus, mark);
- }
-
- public static void log(Status logStatus, String message){
- ExtentTest test = testManager.getTest();
- test.log(logStatus, message);
- }
-
- public static void log(Status logStatus, String message, String duration){
- log(logStatus, message + addDurationTag(duration));
- }
-
- public static void log(Status logStatus, Throwable throwabel){
- ExtentTest test = testManager.getTest();
- test.log(logStatus, throwabel);
- }
-
- public static void addTag(Status logStatus, String message){
- Markup m = null;
- switch(logStatus){
- case PASS:
- m = MarkupHelper.createLabel(message, ExtentColor.GREEN);
- break;
- case FAIL:
- m = MarkupHelper.createLabel(message, ExtentColor.RED);
- break;
- case SKIP:
- m = MarkupHelper.createLabel(message, ExtentColor.BLUE);
- break;
- case FATAL:
- m = MarkupHelper.createLabel(message, ExtentColor.BROWN);
- break;
- default:
- break;
- }
-
- if (m != null){
- log(logStatus, m);
- }
- }
-
-// public static String addScreenshot(Status logStatus, String screenshotName, String message) throws IOException{
-// String imageFilePath = null;
-// String uuid = UUID.randomUUID().toString();
-// String[] stringArray = uuid.split("-");
-// screenshotName = screenshotName + "-" + stringArray[stringArray.length - 1];
-// try {
-// File imageFile = GeneralUIUtils.takeScreenshot(screenshotName, SetupCDTest.getScreenshotFolder());
-// imageFilePath = new File(SetupCDTest.getReportFolder()).toURI().relativize(imageFile.toURI()).getPath();
-// } catch (IOException e) {
-// e.printStackTrace();
-// }
-//
-// ExtentTest test = ExtentTestManager.getTest();
-// test.log(logStatus, message, MediaEntityBuilder.createScreenCaptureFromPath(imageFilePath).build());
-// return imageFilePath;
-// }
-
- private static String addDurationTag(String duration){
- return "<td width=\"80px\">" + duration + "</td>";
- }
-
- public static String addLinkTag(String fileName, String pathToFile){
- return String.format("<a download=\"%s\" href=\"%s\">HAR file</a>", fileName, pathToFile);
- }
-
- public static void addFileToReportAsLink(File harFile, String pathToFileFromReportDirectory, String message) {
- log(Status.INFO, message, addLinkTag(harFile.getName(), pathToFileFromReportDirectory));
- }
-
-
-
-
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ExtentTestManager.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ExtentTestManager.java
deleted file mode 100644
index 810f6a6543..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ExtentTestManager.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.api;
-
-import com.aventstack.extentreports.ExtentReports;
-import com.aventstack.extentreports.ExtentTest;
-
-import java.util.HashMap;
-public class ExtentTestManager implements SomeInterface{
-
- private static HashMap<Long, ExtentTest> extentTestMap = new HashMap<Long, ExtentTest>();
- private static ExtentReports extent = ExtentManager.getReporter();
-
- public ExtentTestManager(){
- }
-
- @Override
- public synchronized ExtentTest getTest() {
- return extentTestMap.get(Thread.currentThread().getId());
- }
-
- public static synchronized void endTest() {
-// extent.endTest(extentTestMap.get(Thread.currentThread().getId()));
- extent.flush();
- }
-
- public static synchronized ExtentTest startTest(String testName) {
- return startTest(testName, "");
- }
-
- public static synchronized ExtentTest startTest(String testName, String desc) {
- ExtentTest test = extent.createTest(testName, desc);
- extentTestMap.put(Thread.currentThread().getId(), test);
-
- return test;
- }
-
- public static synchronized <T> void assignCategory(Class<T> clazz){
- String[] parts = clazz.getName().split("\\.");
- String lastOne1 = parts[parts.length-1];
- String lastOne2 = parts[parts.length-2];
- extentTestMap.get(Thread.currentThread().getId()).assignCategory(lastOne2 + "-" + lastOne1);
- }
-
-
-}
-
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/SomeInterface.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/SomeInterface.java
deleted file mode 100644
index ce679a9f87..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/SomeInterface.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.api;
-
-import com.aventstack.extentreports.ExtentTest;
-
-public interface SomeInterface {
-
- abstract ExtentTest getTest();
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/Urls.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/Urls.java
deleted file mode 100644
index 956d9b1d8f..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/Urls.java
+++ /dev/null
@@ -1,429 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.api;
-
-
-import org.openecomp.sdc.ci.tests.utils.Utils;
-
-public interface Urls {
-
-
- final static String SDC_HTTP_METHOD = Utils.getConfigHandleException() == null ? "http" : Utils.getConfigHandleException().getSdcHttpMethod();
- final String AMDOCS_HTTP_METHOD = SDC_HTTP_METHOD;
-
-
- final String UPLOAD_ZIP_URL = SDC_HTTP_METHOD + "://%s:%s/sdc1/rest/v1/catalog/resources";
- final String GET_IMAGE_DATA_FROM_ES = SDC_HTTP_METHOD + "://%s:%s/resources/imagedata/_search?q=resourceName:%s&pretty=true&size=1000";
- final String GET_SCRIPT_DATA_FROM_ES = SDC_HTTP_METHOD + "://%s:%s/resources/artifactdata/_search?q=resourceName:%s&pretty=true&size=1000";
- final String GET_ID_LIST_BY_INDEX_FROM_ES = SDC_HTTP_METHOD + "://%s:%s/%s/%s/_search?fields=_id&size=1000";
-
- final String ES_URL = SDC_HTTP_METHOD + "://%s:%s";
- final String GET_SERVICE_CSAR_API1 = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/services/%s/%s";
- final String GET_SERVICE_CSAR_API2 = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/services/%s/%s/csar";
-
- final String GET_SERVICE_CSAR_FE_PROXY_API1 = SDC_HTTP_METHOD + "://%s:%s/sdc1/portal/rest/services/%s/%s";
- final String GET_CSAR_USING_SIMULATOR = SDC_HTTP_METHOD + "://%s:%s/onboardingci/onbrest/onboarding-api/v1.0/vendor-software-products/packages/%s";
- final String COPY_CSAR_USING_SIMULATOR = SDC_HTTP_METHOD + "://%s:%s/onboardingci/onbrest/onboarding-api/v1.0/vendor-software-products/packages/%s/%s";
-
- final String GET_HEALTH_CHECK_VIA_PROXY = SDC_HTTP_METHOD + "://%s:%s/sdc1/rest/healthCheck";
-
- // Get back-end config http://172.20.43.132:8080/sdc2/rest/configmgr/get
- final String GET_CONFIG_MANAGER = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/configmgr/get";
-
- // Get latest version of all non-abstract resources
- final String GET_RESOURCE_lATEST_VERSION = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources/latestversion/notabstract";
-
- final String GET_SERVICE_lATEST_VERSION = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/latestversion/notabstract";
-
- // Get resource artifact list:
- // http://172.20.43.124:8080/sdc2/rest/v1/catalog/resources/alien.nodes.Apache/2.0.0-SNAPSHOT/artifacts
- final String GET_RESOURCE_ARTIFACTS_LIST = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources/%s/%s/artifacts";
-
- // get resource artifact metadata (creation, MD5, etc):
- // http://172.20.43.124:8080/sdc2/rest/v1/catalog/resources/alien.nodes.Apache/2.0.0-SNAPSHOT/artifacts/install_apache.sh/metadata
- final String GET_RESOURCE_ARTIFACT_METADATA = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources/%s/%s/artifacts/%s/metadata";
-
- // resource artifact payload:
- // http://172.20.43.124:8080/sdc2/rest/v1/catalog/resources/alien.nodes.Apache/2.0.0-SNAPSHOT/artifacts/install_apache.sh
- final String GET_RESOURCE_ARTIFACT_PAYLOAD = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources/%s/%s/artifacts/%s";
-
- final String GET_RESOURCE_ARTIFACT_PAYLOAD_FE_PROXY = SDC_HTTP_METHOD + "://%s:%s/sdc1/portal/rest/v1/catalog/resources/%s/%s/artifacts/%s";
-
- // Get service artifact list:
- // http://172.20.43.124:8080/sdc2/rest/v1/catalog/services/alien.nodes.Apache/0.0.1/artifacts
- final String GET_SERVICE_ARTIFACTS_LIST = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/%s/%s/artifacts";
-
- // get service artifact metadata (creation, MD5, etc):
- // http://172.20.43.124:8080/sdc2/rest/v1/catalog/services/alien.nodes.Apache/0.0.1/artifacts/install_apache.sh/metadata
- final String GET_SERVICE_METADATA = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/%s/%s/artifacts/%s/metadata";
-
- // service artifact payload:
- // http://172.20.43.124:8080/sdc2/rest/v1/catalog/services/alien.nodes.Apache/0.0.1/artifacts/install_apache.sh
- final String GET_SERVICE_ARTIFACT_PAYLOAD = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/%s/%s/artifacts/%s";
-
- final String GET_SEARCH_DATA_FROM_ES = SDC_HTTP_METHOD + "://%s:%s/%s";
-
- // ****************************************************USER
- // URLs********************************************************
- final String GET_USER = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/user/%s";
-
- final String GET_USER_ROLE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/user/%s/role";
-
- final String CREATE_USER = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/user";
-
- final String UPDATE_USER = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/user/%s";
-
- final String UPDATE_USER_ROLE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/user/%s/role";
-
- String DELETE_USER = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/user/%s";
-
- String GET_ALL_ADMIN_USERS = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/user/admins";
-
- final String AUTHORIZE_USER = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/user/authorize";
-
- final String GET_ALL_TAGS = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/tags";
-
- final String AUTH_USER = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/user/authorize";
-
- final String GET_ALL_NOT_ABSTRACT_RESOURCES = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources/certified/notabstract";
-
- final String GET_ALL_ABSTRACT_RESOURCES = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources/certified/abstract";
-
- final String QUERY_NEO4J = SDC_HTTP_METHOD + "://%s:%s/db/data/transaction";
- final String CHANGE_IN_NEO4J = SDC_HTTP_METHOD + "://%s:%s/db/data/transaction/commit";
-
- final String GET_ALL_ADMINS = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/user/admins";
-
- final String GET_USERS_BY_ROLES = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/user/users?roles=%s";
-
- final String GET_ALL_USERS = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/user/users?roles/";
-
- // *****************************************ECOMP User
- // URL's*****************************************************
- final String ECOMP_PUSH_USER = SDC_HTTP_METHOD + "://%s:%s/api/v2/user";
-
- final String ECOMP_EDIT_USER = SDC_HTTP_METHOD + "://%s:%s/api/v2/user/%s";
-
- final String ECOMP_GET_USER = SDC_HTTP_METHOD + "://%s:%s/api/v2/user/%s";
-
- final String ECOMP_GET_ALL_USERS = SDC_HTTP_METHOD + "://%s:%s/api/v2/users";
-
- final String ECOMP_GET_ALL_AVAILABLE_ROLES = SDC_HTTP_METHOD + "://%s:%s/api/v2/roles";
-
- final String ECOMP_PUSH_USER_ROLES = SDC_HTTP_METHOD + "://%s:%s/api/v2/user/%s/roles";
-
- final String ECOMP_GET_USER_ROLES = SDC_HTTP_METHOD + "://%s:%s/api/v2/user/%s/roles";
-
- // *****************************************Elements*************************************************************
- final String GET_TAGS_LIST = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/tags";
-
- final String GET_PROPERTY_SCOPES_LIST = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/propertyScopes";
-
- final String GET_CONFIGURATION = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/configuration/ui";
-
- final String GET_ALL_ARTIFACTS = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/artifactTypes";
-
- final String GET_FOLLWED_LIST = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/followed";
-
- final String GET_CATALOG_DATA = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/screen/?excludeTypes=VFCMT&excludeTypes=Configuration";
-
- // *****************************************Resources
- // **********************************************************************
- final String GET_LIST_CERTIFIED_RESOURCE_TEMPLATES = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/resoourceTemplates";
-
- final String CREATE_RESOURCE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources";
- final String UPDATE_RESOURCE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources/%s";
-
- final String IMPORT_RESOURCE_NORMATIVE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/upload/multipart";
-
- final String IMPORT_USER_RESOURCE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/upload/user-resource";
-
- final String IMPORT_CAPABILITY_TYPE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/uploadType/capability";
- final String IMPORT_CATEGORIES = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/uploadType/categories";
- final String IMPORT_GROUP_TYPE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/uploadType/grouptypes";
-
- // last %s is resourceId, resourceId = resourceName.resourceVersion
- final String GET_RESOURCE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources/%s";
- final String GET_RESOURCE_BY_NAME_AND_VERSION = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources/resourceName/%s/resourceVersion/%s";
- final String GET_RESOURCE_BY_CSAR_UUID = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources/csar/%s";
- final String GET_COMPONENT_REQUIRMENTS_CAPABILITIES = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/requirmentsCapabilities";
-
- final String DELETE_RESOURCE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources/%s";
- final String DELETE_RESOURCE_BY_NAME_AND_VERSION = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources/%s/%s";
- final String DELETE_SERVICE_BY_NAME_AND_VERSION = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/%s/%s";
-
- final String DELETE_MARKED_RESOURCES = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/inactiveComponents/resource";
- final String DELETE_MARKED_SERVICES = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/inactiveComponents/service";
-
- final String GET_FOLLOWED_RESOURCES = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/followed/resources/%s";
- final String CHANGE_RESOURCE_LIFECYCLE_STATE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources/%s/lifecycleState/%s";
- final String CHANGE_SERVICE_LIFECYCLE_STATE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/%s/lifecycleState/%s";
- final String CHANGE_PRODUCT_LIFECYCLE_STATE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/products/%s/lifecycleState/%s";
- final String CHANGE_COMPONENT_LIFECYCLE_STATE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/lifecycleState/%s";
-
- final String CREATE_PROPERTY = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources/%s/properties";
- String CREATE_SERVICE_PROPERTY = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/%s/properties";
- final String DECLARE_PROPERTIES = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/create/inputs";
- final String UPDATE_INPUT = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources/%s/update/inputs";
-
- final String UPDATE_RESOURCE_METADATA = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources/%s/metadata";
-
- // ***********************************External API's
- // (AssetData)****************************************
-
- final String DELETE_EXTRNAL_API_DELETE_ARTIFACT_OF_ASSET = SDC_HTTP_METHOD + "://%s:%s/sdc/v1/catalog/%s/%s/artifacts/%s";
- final String DELETE_EXTRNAL_API_DELETE_ARTIFACT_OF_COMPONENTINSTANCE_ON_ASSET = SDC_HTTP_METHOD + "://%s:%s/sdc/v1/catalog/%s/%s/resourceInstances/%s/artifacts/%s";
-
- final String POST_EXTERNAL_API_UPDATE_ARTIFACT_OF_ASSET = SDC_HTTP_METHOD + "://%s:%s/sdc/v1/catalog/%s/%s/artifacts/%s";
- final String POST_EXTERNAL_API_UPDATE_ARTIFACT_OF_COMPONENTINSTANCE_ON_ASSET = SDC_HTTP_METHOD + "://%s:%s/sdc/v1/catalog/%s/%s/resourceInstances/%s/artifacts/%s";
-
- final String POST_EXTERNAL_API_UPLOAD_ARTIFACT_OF_ASSET = SDC_HTTP_METHOD + "://%s:%s/sdc/v1/catalog/%s/%s/artifacts";
- final String POST_EXTERNAL_API_UPLOAD_ARTIFACT_OF_COMPONENTINSTANCE_ON_ASSET = SDC_HTTP_METHOD + "://%s:%s/sdc/v1/catalog/%s/%s/resourceInstances/%s/artifacts";
-
- final String GET_DOWNLOAD_RESOURCE_ARTIFACT_OF_ASSET = SDC_HTTP_METHOD + "://%s:%s/sdc/v1/catalog/resources/%s/artifacts/%s";
- final String GET_DOWNLOAD_SERVICE_ARTIFACT_OF_ASSET = SDC_HTTP_METHOD + "://%s:%s/sdc/v1/catalog/services/%s/artifacts/%s";
-
- final String GET_DOWNLOAD_RESOURCE_ARTIFACT_OF_COMPONENT_INSTANCE = SDC_HTTP_METHOD + "://%s:%s/sdc/v1/catalog/resources/%s/resourceInstances/%s/artifacts/%s";
- final String GET_DOWNLOAD_SERVICE_ARTIFACT_OF_COMPONENT_INSTANCE = SDC_HTTP_METHOD + "://%s:%s/sdc/v1/catalog/services/%s/resourceInstances/%s/artifacts/%s";
-
- final String GET_ASSET_LIST = SDC_HTTP_METHOD + "://%s:%s/sdc/v1/catalog/%s";
- final String GET_FILTERED_ASSET_LIST = SDC_HTTP_METHOD + "://%s:%s/sdc/v1/catalog/%s?%s";
- final String GET_TOSCA_MODEL = SDC_HTTP_METHOD + "://%s:%s/sdc/v1/catalog/%s/%s/toscaModel";
- // https://{serverRoot}/sdc/v1/catalog/{assetType}/{uuid}/metadata, where
- // assetType in {resources, services}
- final String GET_ASSET_METADATA = SDC_HTTP_METHOD + "://%s:%s/sdc/v1/catalog/%s/%s/metadata";
- final String POST_AUTHORIZATION = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/consumers";
- final String GET_DOWNLOAD_SERVICE_RI_ARTIFACT = SDC_HTTP_METHOD + "://%s:%s/sdc/v1/catalog/services/%s/resourceInstances/%s/artifacts/%s";
- final String GET_DOWNLOAD_SERVICE_ARTIFACT = SDC_HTTP_METHOD + "://%s:%s/sdc/v1/catalog/services/%s/artifacts/%s";
-
- final String POST_EXTERNAL_API_CREATE_RESOURCE = SDC_HTTP_METHOD + "://%s:%s/sdc/v1/catalog/resources";
-
- // Change LifeCycle of Resource
- // https://{serverRoot}:{port}/sdc/v1/catalog/{resources|services}/{uuid}/lifecycleState/{lifecycle state}
- final String POST_EXTERNAL_API_CHANGE_LIFE_CYCLE_OF_ASSET = SDC_HTTP_METHOD + "://%s:%s/sdc/v1/catalog/%s/%s/lifecycleState/%s";
-
-
- // *****************************************************************************************************
-
- final String ADD_ARTIFACT_TO_RESOURCE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources/%s/artifacts";
- final String UPDATE_OR_DELETE_ARTIFACT_OF_RESOURCE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources/%s/artifacts/%s";
- final String ADD_ARTIFACT_TO_SERVICE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/%s/artifacts";
- final String UPDATE_OR_DELETE_ARTIFACT_OF_SERVICE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/%s/artifacts/%s";
-
- final String UPLOAD_DELETE_ARTIFACT_OF_COMPONENT = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/artifacts";
- final String UPDATE_ARTIFACT_OF_COMPONENT = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/artifacts/%s";
- final String UPLOAD_HEAT_ENV_ARTIFACT = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/resourceInstance/%s/artifacts/%s";
- // *****************************************************************************************************
- final String UPLOAD_ARTIFACT_BY_INTERFACE_TO_RESOURCE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources/%s/%s/%s/artifacts/";
- final String UPDATE_OR_DELETE_ARTIFACT_BY_INTERFACE_TO_RESOURCE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources/%s/%s/%s/artifacts/%s";
-
- final String UPLOAD_ARTIFACT_BY_INTERFACE_TO_COMPONENT = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources/%s/%s/%s/artifacts/";
- final String UPDATE_OR_DELETE_ARTIFACT_BY_INTERFACE_TO_COMPONENT = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources/%s/%s/%s/artifacts/%s";
-
- // *****************************************************************************************************
- // "/sdc2/v1/services/<serviceName>/<0.1>/artifacts/aaa.hh"
- final String DISTRIB_DOWNLOAD_SERVICE_ARTIFACT = "/sdc2/rest/v1/catalog/services/%s/%s/artifacts/%s";
- // "/sdc2/v1/services/<serviceName>/<0.1>/resources/{resourceName}/{resourceVersion}/artifacts/<opeartion_name>_aaa.hh"
- final String DISTRIB_DOWNLOAD_RESOURCE_ARTIFACT = "/sdc2/rest/v1/catalog/services/%s/%s/resources/%s/%s/artifacts/%s";
- final String DISTRIB_DOWNLOAD_SERVICE_ARTIFACT_RELATIVE_URL = "/sdc/v1/catalog/services/%s/%s/artifacts/%s";
- final String DISTRIB_DOWNLOAD_RESOURCE_ARTIFACT_RELATIVE_URL = "/sdc/v1/catalog/services/%s/%s/resources/%s/%s/artifacts/%s";
- final String DOWNLOAD_SERVICE_ARTIFACT_FULL_URL = SDC_HTTP_METHOD + "://%s:%s%s";
- final String DOWNLOAD_RESOURCE_ARTIFACT_FULL_URL = SDC_HTTP_METHOD + "://%s:%s%s";
- // **********************************************************************************
- final String UI_DOWNLOAD_RESOURCE_ARTIFACT = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources/%s/artifacts/%s";
- final String UI_DOWNLOAD_SERVICE_ARTIFACT = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/%s/artifacts/%s";
-
- // **********************************************************************************************************
- final String UPDATE_PROPERTY = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources/%s/properties/%s";
-
- final String DELETE_PROPERTY = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources/%s/properties/%s";
-
- final String GET_PROPERTY = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources/%s/properties/%s";
-
- // *****************************************************************************************************
-
- final String VALIDATE_RESOURCE_NAME = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources/validate-name/%s";
-
- final String CREATE_SERVICE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services";
- final String DELETE_SERVICE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/%s";
- final String GET_SERVICE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/%s";
- final String GET_SERVICE_BY_NAME_AND_VERSION = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/serviceName/%s/serviceVersion/%s";
-
- final String GET_SERVICES_REQUIRMENTS_CAPABILITIES = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/requirmentsCapabilities/services/%s";
- final String GET_INSTANCE_REQUIRMENTS_CAPABILITIES = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/filteredDataByParams?include=requirements&include=capabilities";
-
- final String CREATE_COMPONENT_INSTANCE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/resourceInstance";
- final String DELETE_COMPONENT_INSTANCE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/resourceInstance/%s";
- final String UPDATE_COMPONENT_INSTANCE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/resourceInstance/%s";
- final String GET_COMPONENT_INSTANCES = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/componentInstances";
- // Tal New API
- final String UPDATE_MULTIPLE_COMPONENT_INSTANCE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/resourceInstance/multipleComponentInstance";
-
- final String CHANGE__RESOURCE_INSTANCE_VERSION = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/resourceInstance/%s/changeVersion";
-
- final String CREATE_AND_ASSOCIATE_RESOURCE_INSTANCE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/%s/resourceInstance/createAndAssociate";
- final String ASSOCIATE__RESOURCE_INSTANCE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/resourceInstance/associate";
- final String DISSOCIATE__RESOURCE_INSTANCE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/resourceInstance/dissociate";
-
- final String DISTRIBUTION_INIT = SDC_HTTP_METHOD + "://%s:%s/init";
- final String DISTRIBUTION_INIT_RESET = SDC_HTTP_METHOD + "://%s:%s/initReset";
- final String APPROVE_DISTRIBUTION = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/%s/distribution-state/approve";
- final String REJECT_DISTRIBUTION = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/%s/distribution-state/reject";
- final String DISTRIBUTION_DOWNLOAD_ARTIFACT = SDC_HTTP_METHOD + "://%s:%s/download";
- final String ACTIVATE_DISTRIBUTION = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/%s/distribution/%s/activate";
- final String DISTRIBUTION_SERVICE_LIST = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/%s/distribution";
- final String DISTRIBUTION_SERVICE_MONITOR = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/distribution/%s";
-
- final String DEPLOY_SERVICE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/%s/distribution/%s/markDeployed";
- final String UPDATE_SERVICE_METADATA = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/%s/metadata";
-
- // Andrey changed name from ADD_PROPERTY_TO_RESOURCE_INSTANCE to
- // UPDATE_PROPERTY_TO_RESOURCE_INSTANCE
- final String UPDATE_PROPERTY_TO_RESOURCE_INSTANCE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/resourceInstance/%s/property";
- final String DELETE_PROPERTY_FROM_RESOURCE_INSTANCE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/%s/resourceInstance/%s/property/%s";
- final String UPDATE_RESOURCE_INSTANCE_HEAT_ENV_PARAMS = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/%s/resourceInstance/%s/artifacts/%s/heatParams";
-
- // Actions on artifact in resource instance
- final String ADD_RESOURCE_INSTANCE_ARTIFACT = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/%s/resourceInstance/%s/artifacts";
- final String UPDATE_RESOURCE_INSTANCE_ARTIFACT = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/%s/resourceInstance/%s/artifacts/%s";
- final String DELETE_RESOURCE_INSTANCE_ARTIFACT = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/%s/resourceInstance/%s/artifacts/%s";
-
- // Attributes On Resource instance
- public static final String UPDATE_ATTRIBUTE_ON_RESOURCE_INSTANCE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/resourceInstance/%s/attribute";
-
- // ("/services/{serviceId}/resourceInstances/{resourceInstanceId}/artifacts/{artifactId}")
- final String DOWNLOAD_COMPONENT_INSTANCE_ARTIFACT = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/%s/resourceInstances/%s/artifacts/%s";
-
- // -------------------------------service api
- // artifact-----------------------------------------------------
- final String UPDATE_DELETE_SERVICE_API_ARTIFACT = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/%s/artifacts/api/%s";
-
- final String CREATE_ADDITIONAL_INFORMATION_RESOURCE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources/%s/additionalinfo";
- final String UPDATE_ADDITIONAL_INFORMATION_RESOURCE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources/%s/additionalinfo/%s";
- final String DELETE_ADDITIONAL_INFORMATION_RESOURCE = UPDATE_ADDITIONAL_INFORMATION_RESOURCE;
- final String GET_ADDITIONAL_INFORMATION_RESOURCE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources/%s/additionalinfo/%s";
- final String GET_ALL_ADDITIONAL_INFORMATION_RESOURCE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources/%s/additionalinfo";
-
- final String CREATE_ADDITIONAL_INFORMATION_SERVICE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/%s/additionalinfo";
- final String UPDATE_ADDITIONAL_INFORMATION_SERVICE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/%s/additionalinfo/%s";
- final String DELETE_ADDITIONAL_INFORMATION_SERVICE = UPDATE_ADDITIONAL_INFORMATION_SERVICE;
- final String GET_ADDITIONAL_INFORMATION_SERVICE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/%s/additionalinfo/%s";
- final String GET_ALL_ADDITIONAL_INFORMATION_SERVICE = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/%s/additionalinfo";
-
- final String GET_COMPONENT_AUDIT_RECORDS = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/audit-records/%s/%s";
-
- // CONSUMER
- final String CREATE_CONSUMER = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/consumers";
- final String GET_CONSUMER = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/consumers/%s";
- final String DELETE_CONSUMER = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/consumers/%s";
-
- // Categories
- final String CREATE_CATEGORY = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/category/%s";
- final String GET_ALL_CATEGORIES = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/categories/%s";
- final String GET_ALL_CATEGORIES_FE = SDC_HTTP_METHOD + "://%s:%s/sdc1/feProxy/rest/v1/categories/%s";
- final String DELETE_CATEGORY = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/category/%s/%s";
- final String CREATE_SUB_CATEGORY = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/category/%s/%s/subCategory";
- final String DELETE_SUB_CATEGORY = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/category/%s/%s/subCategory/%s";
- final String CREATE_GROUPING = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/category/%s/%s/subCategory/%s/grouping";
- final String DELETE_GROUPING = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/category/%s/%s/subCategory/%s/grouping/%s";
-
- // product
- final String CREATE_PRODUCT = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/products";
- final String DELETE_PRODUCT = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/products/%s";
- // last %s is resourceId, productId
- final String GET_PRODUCT = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/products/%s";
- final String UPDATE_PRODUCT = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/products/%s/metadata";
- final String GET_PRODUCT_BY_NAME_AND_VERSION = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/products/productName/%s/productVersion/%s";
-
- // groups
- final String GET_GROUP_BY_ID = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/groups/%s";
- //module property
- final String RESOURCE_GROUP_PROPERTY = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources/%s/groups/%s/properties";
- // modules
- final String GET_MODULE_BY_ID = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources/%s/groups/%s";
-
- // inputs
- final String UPDATE_INPUTS = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/update/inputs";
- final String ADD_INPUTS = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/create/inputs"; //{componentType}/{componentId}/create/inputs
- final String DELETE_INPUT_BY_ID = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/delete/%s/input"; //{componentType}/{componentId}/delete/{inputId}/input
- final String GET_COMPONENT_INPUTS = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/%s/inputs"; //services/{componentId}/inputs
- final String GET_COMPONENT_INSTANCE_INPUTS = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/componentInstances/%s/%s/inputs"; //{componentType}/{componentId}/componentInstances/{instanceId}/{originComonentUid}/inputs
- final String GET_INPUTS_FOR_COMPONENT_INPUT = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/resources/%s/groups/%s"; //{componentType}/{componentId}/inputs/{inputId}/inputs
-
- // check version
- final String ONBOARD_VERSION = SDC_HTTP_METHOD + "://%s:%s/onboarding-api/docs/build-info.json";
- final String OS_VERSION = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/version";
-
-// amdocs APIs
- final String GET_VENDOR_SOFTWARE_PRODUCT = SDC_HTTP_METHOD + "://%s:%s/onboarding-api/v1.0/vendor-software-products/packages/%s";
- final String UPLOAD_SNMP_POLL_ARTIFACT = SDC_HTTP_METHOD + "://%s:%s/onboarding-api/v1.0/vendor-software-products/%s/versions/%s/components/%s/uploads/types/SNMP_POLL";
- final String UPLOAD_SNMP_TRAP_ARTIFACT = SDC_HTTP_METHOD + "://%s:%s/onboarding-api/v1.0/vendor-software-products/%s/versions/%s/components/%s/uploads/types/SNMP_TRAP";
- final String UPLOAD_VES_EVENTS_ARTIFACT = SDC_HTTP_METHOD + "://%s:%s/onboarding-api/v1.0/vendor-software-products/%s/versions/%s/components/%s/uploads/types/VES_EVENTS";
- final String UPLOAD_AMDOCS_ARTIFACT = SDC_HTTP_METHOD + "://%s:%s/onboarding-api/v1.0/vendor-software-products/%s/versions/%s/components/%s/uploads/types/%s";
- final String DELETE_AMDOCS_ARTIFACT_BY_TYPE = SDC_HTTP_METHOD + "://%s:%s/onboarding-api/v1.0/vendor-software-products/%s/versions/%s/components/%s/monitors/%s";
- final String GET_VSP_COMPONENTS = SDC_HTTP_METHOD + "://%s:%s/onboarding-api/v1.0/vendor-software-products/%s/versions/%s/components";
- final String CREATE_VENDOR_LISENCE_MODELS = SDC_HTTP_METHOD + "://%s:%s/onboarding-api/v1.0/vendor-license-models";
- final String CREATE_VENDOR_LISENCE_AGREEMENT = SDC_HTTP_METHOD + "://%s:%s/onboarding-api/v1.0/vendor-license-models/%s/versions/%s/license-agreements";
- final String CREATE_VENDOR_LISENCE_FEATURE_GROUPS = SDC_HTTP_METHOD + "://%s:%s/onboarding-api/v1.0/vendor-license-models/%s/versions/%s/feature-groups";
- final String CREATE_VENDOR_LISENCE_ENTITLEMENT_POOL = SDC_HTTP_METHOD + "://%s:%s/onboarding-api/v1.0/vendor-license-models/%s/versions/%s/entitlement-pools";
- final String CREATE_VENDOR_LISENCE_KEY_GROUPS = SDC_HTTP_METHOD + "://%s:%s/onboarding-api/v1.0/vendor-license-models/%s/versions/%s/license-key-groups";
- final String CREATE_METHOD = SDC_HTTP_METHOD + "://%s:%s/onboarding-api/v1.0/%s/%s/versions/%s/";
- final String CREATE_VENDOR_SOFTWARE_PRODUCT = SDC_HTTP_METHOD + "://%s:%s/onboarding-api/v1.0/vendor-software-products";
- final String VALIDATE_UPLOAD = SDC_HTTP_METHOD + "://%s:%s/onboarding-api/v1.0/vendor-software-products/%s/versions/%s/orchestration-template-candidate/process";
- final String UPLOAD_HEAT_PACKAGE = SDC_HTTP_METHOD + "://%s:%s/onboarding-api/v1.0/vendor-software-products/%s/versions/%s/orchestration-template-candidate";
- final String ACTION_ON_COMPONENT = SDC_HTTP_METHOD + "://%s:%s/onboarding-api/v1.0/%s/%s/versions/%s/actions";
- final String UPDATE_VSP = SDC_HTTP_METHOD + "://%s:%s/onboarding-api/v1.0/vendor-software-products/%s/versions/%s";
- final String GET_VSP_COMPONENT_BY_VERSION = SDC_HTTP_METHOD + "://%s:%s/onboarding-api/v1.0/vendor-software-products/%s/versions/%s";
- final String GET_VLM_COMPONENT_BY_VERSION = SDC_HTTP_METHOD + "://%s:%s/onboarding-api/v1.0/vendor-license-models/%s/versions/%s";
- final String ACTION_ARCHIVE_RESTORE_COMPONENT = SDC_HTTP_METHOD + "://%s:%s/onboarding-api/v1.0/%s/%s/actions";
- String CREATE_SERVICE_FILTER = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/%s/resourceInstances/%s/nodeFilter";
- String UPDATE_SERVICE_FILTER = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/%s"
- + "/resourceInstances/%s/nodeFilter/";
- String DELETE_SERVICE_FILTER = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/services/%s"
- + "/resourceInstances/%s/nodeFilter/%s";
- String MARK_AS_DEPENDENT = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/resourceInstance/%s";
-
- // Interface Lifecycle Types
- final String GET_All_INTERFACE_LIFECYCLE_TYPES = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/interfaceLifecycleTypes";
-
- // Interface Operation
- final String ADD_INTERFACE_OPERATIONS = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/interfaceOperations";
- final String UPDATE_INTERFACE_OPERATIONS = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/interfaceOperations";
- final String GET_INTERFACE_OPERATIONS = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/interfaces/%s/operations/%s";
- final String DELETE_INTERFACE_OPERATIONS = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/interfaces/%s/operations/%s";
- final String UPLOAD_INTERFACE_OPERATION_ARTIFACT = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/interfaces/%s/operations/%s/artifacts/%s";
-
- //Requirements
- String CREATE_REQUIREMENT = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/requirements";
- String UPDATE_REQUIREMENT = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/requirements";
- String DELETE_REQUIREMENT = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/requirements/%s";
- String GET_REQUIREMENT = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/requirements/%s";
- //Capabilities
- String CREATE_CAPABILITY = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/capabilities";
- String UPDATE_CAPABILITY = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/capabilities";
- String DELETE_CAPABILITY = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/capabilities/%s";
- String GET_CAPABILITY = SDC_HTTP_METHOD + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/capabilities/%s";
-
- //VSP Validation Operation
- final String VSP_VALIDATION_CONFIGURATION = SDC_HTTP_METHOD + "://%s:%s/onboarding-api/v1.0/externaltesting/config";
- final String GET_INSTANCE_TOSCA_ARTIFACTS = SDC_HTTP_METHOD
- + "://%s:%s/sdc2/rest/v1/catalog/%s/%s/filteredDataByParams?include=toscaArtifacts";
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/capability/CapabilitiesTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/capability/CapabilitiesTest.java
deleted file mode 100644
index 18e3997bab..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/capability/CapabilitiesTest.java
+++ /dev/null
@@ -1,362 +0,0 @@
-/*
- * Copyright © 2016-2018 European Support Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openecomp.sdc.ci.tests.capability;
-
-import fj.data.Either;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.datatypes.elements.SchemaDefinition;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-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.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.datatypes.CapabilityDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-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.BaseRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.CapabilityRestUtils;
-import org.testng.Assert;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Test;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import static org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils.getResourceObject;
-import static org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils.getServiceObject;
-import static org.testng.AssertJUnit.fail;
-
-public class CapabilitiesTest extends ComponentBaseTest {
- @Rule
- public static TestName name = new TestName();
-
- private static User user = null;
- private static Service service;
- private static Resource resource;
- private static Resource pnfResource;
-
- public CapabilitiesTest() {
- super(name, CapabilitiesTest.class.getName());
- }
-
- @BeforeTest
- public void init() throws Exception {
- user = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
-
- // Create default service
- Either<Service, RestResponse> createDefaultServiceEither =
- AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true);
- if (createDefaultServiceEither.isRight()) {
- fail("Error creating default service");
- }
- service = createDefaultServiceEither.left().value();
-
- // Create default resource
- Either<Resource, RestResponse> createDefaultResourceEither =
- AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true);
- if (createDefaultResourceEither.isRight()) {
- fail("Error creating default resource");
- }
- resource = createDefaultResourceEither.left().value();
-
- // Create default PNF resource
- Either<Resource, RestResponse> createDefaultPNFResourceEither =
- AtomicOperationUtils.createResourceByType(ResourceTypeEnum.PNF, UserRoleEnum.DESIGNER, true);
- if (createDefaultPNFResourceEither.isRight()) {
- fail("Error creating default pnf resource");
- }
- pnfResource = createDefaultPNFResourceEither.left().value();
- }
-
- @Test
- public void createCapabilityOnServiceTest() throws Exception {
-
- CapabilityDetails capability = createCapability();
- RestResponse restResponse = CapabilityRestUtils.createCapability(service, Collections.singletonList(capability),
- user);
- logger.info("createCapability On Service Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- @Test(dependsOnMethods = "createCapabilityOnServiceTest")
- public void updateCapabilityOnServiceTest() throws Exception {
-
- CapabilityDetails capability = createCapability();
- capability.setMaxOccurrences("10");
- capability.setMinOccurrences("4");
- RestResponse restResponse = CapabilityRestUtils.updateCapability(service, Collections.singletonList(capability),
- user);
- logger.info("updateCapability On Service Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- @Test(dependsOnMethods = "updateCapabilityOnServiceTest")
- public void getCapabilityFromServiceTest() throws Exception {
- Service serviceObject = getServiceObject(service.getUniqueId());
-
- List<org.openecomp.sdc.be.model.CapabilityDefinition> capabilityDefinitionList = serviceObject.getCapabilities()
- .values().stream().flatMap(Collection::stream).collect(Collectors.toList());
-
- RestResponse restResponse = CapabilityRestUtils.getCapability(service,
- capabilityDefinitionList.get(0).getUniqueId(), user);
- logger.info("getCapabilityTest from Service Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- @Test(dependsOnMethods = "getCapabilityFromServiceTest")
- public void deleteCapabilityFromServiceTest() throws Exception {
- Service serviceObject = getServiceObject(service.getUniqueId());
-
- List<org.openecomp.sdc.be.model.CapabilityDefinition> capabilityDefinitionList = serviceObject.getCapabilities()
- .values().stream().flatMap(Collection::stream).collect(Collectors.toList());
-
- RestResponse restResponse = CapabilityRestUtils.deleteCapability(service,
- capabilityDefinitionList.get(0).getUniqueId(), user);
- logger.info("deleteCapabilityTest from Service Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- @Test
- public void createCapabilityWithPropertiesOnServiceTest() throws Exception {
-
- CapabilityDetails capability = createCapability();
- List<ComponentInstanceProperty> properties = new ArrayList<>();
- ComponentInstanceProperty instanceProperty = new ComponentInstanceProperty();
- instanceProperty.setType("prop_type");
- instanceProperty.setName("prop_name");
- instanceProperty.setDescription("prop_description");
- instanceProperty.setSchema(new SchemaDefinition());
- properties.add(instanceProperty);
- capability.setProperties(properties);
- RestResponse restResponse = CapabilityRestUtils.createCapability(service, Collections.singletonList(capability),
- user);
- logger.info("createCapability On Service Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- @Test(dependsOnMethods = "createCapabilityWithPropertiesOnServiceTest")
- public void updateCapabilityWithPropertiesOnServiceTest() throws Exception {
-
- CapabilityDetails capability = createCapability();
- capability.setMaxOccurrences("10");
- capability.setMinOccurrences("4");
-
- List<ComponentInstanceProperty> properties = new ArrayList<>();
- ComponentInstanceProperty instanceProperty = new ComponentInstanceProperty();
- instanceProperty.setType("prop_type_updated");
- instanceProperty.setName("prop_name_updated");
- instanceProperty.setDescription("prop_description_prop_desc");
- instanceProperty.setSchema(new SchemaDefinition());
- properties.add(instanceProperty);
- capability.setProperties(properties);
- RestResponse restResponse = CapabilityRestUtils.updateCapability(service, Collections.singletonList(capability),
- user);
- logger.info("updateCapability On Service Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- @Test
- public void createCapabilityOnVfTest() throws Exception {
-
- CapabilityDetails capability = createCapability();
- RestResponse restResponse = CapabilityRestUtils.createCapability(resource, Collections.singletonList(capability),
- user);
- logger.info("createCapability On Vf Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- @Test(dependsOnMethods = "createCapabilityOnVfTest")
- public void updateCapabilityOnVfTest() throws Exception {
-
- CapabilityDetails capability = createCapability();
- capability.setMaxOccurrences("10");
- capability.setMinOccurrences("4");
- RestResponse restResponse = CapabilityRestUtils.updateCapability(resource, Collections.singletonList(capability),
- user);
- logger.info("updateCapability On Vf Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- @Test(dependsOnMethods = "updateCapabilityOnVfTest")
- public void getCapabilityFromVfTest() throws Exception {
- Resource resourceObject = getResourceObject(resource.getUniqueId());
-
- List<org.openecomp.sdc.be.model.CapabilityDefinition> capabilityDefinitionList = resourceObject.getCapabilities()
- .values().stream().flatMap(Collection::stream).collect(Collectors.toList());
-
- RestResponse restResponse = CapabilityRestUtils.getCapability(resource,
- capabilityDefinitionList.get(0).getUniqueId(), user);
- logger.info("getCapabilityTest from Vf Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- @Test(dependsOnMethods = "getCapabilityFromVfTest")
- public void deleteCapabilityFromVfTest() throws Exception {
- Resource resourceObject = getResourceObject(resource.getUniqueId());
-
- List<org.openecomp.sdc.be.model.CapabilityDefinition> capabilityDefinitionList = resourceObject.getCapabilities()
- .values().stream().flatMap(Collection::stream).collect(Collectors.toList());
-
- RestResponse restResponse = CapabilityRestUtils.deleteCapability(resource,
- capabilityDefinitionList.get(0).getUniqueId(), user);
- logger.info("deleteCapabilityTest from Vf Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- @Test
- public void createCapabilityWithPropertiesOnVfTest() throws Exception {
-
- CapabilityDetails capability = createCapability();
- List<ComponentInstanceProperty> properties = new ArrayList<>();
- ComponentInstanceProperty instanceProperty = new ComponentInstanceProperty();
- instanceProperty.setType("prop_type");
- instanceProperty.setName("prop_name");
- instanceProperty.setDescription("prop_description");
- instanceProperty.setSchema(new SchemaDefinition());
- properties.add(instanceProperty);
- capability.setProperties(properties);
- RestResponse restResponse = CapabilityRestUtils.createCapability(resource, Collections.singletonList(capability),
- user);
- logger.info("createCapability On Vf Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- @Test(dependsOnMethods = "createCapabilityWithPropertiesOnVfTest")
- public void updateCapabilityWithPropertiesOnVfTest() throws Exception {
-
- CapabilityDetails capability = createCapability();
- capability.setMaxOccurrences("10");
- capability.setMinOccurrences("4");
-
- List<ComponentInstanceProperty> properties = new ArrayList<>();
- ComponentInstanceProperty instanceProperty = new ComponentInstanceProperty();
- instanceProperty.setType("prop_type_updated");
- instanceProperty.setName("prop_name_updated");
- instanceProperty.setDescription("prop_description_prop_desc");
- instanceProperty.setSchema(new SchemaDefinition());
- properties.add(instanceProperty);
- capability.setProperties(properties);
- RestResponse restResponse = CapabilityRestUtils.updateCapability(resource, Collections.singletonList(capability),
- user);
- logger.info("updateCapability On Vf Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
-
- @Test
- public void createCapabilityOnPnfTest() throws Exception {
-
- CapabilityDetails capability = createCapability();
- RestResponse restResponse = CapabilityRestUtils.createCapability(pnfResource, Collections.singletonList(capability),
- user);
- logger.info("createCapability On Pnf Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- @Test(dependsOnMethods = "createCapabilityOnPnfTest")
- public void updateCapabilityOnPnfTest() throws Exception {
-
- CapabilityDetails capability = createCapability();
- capability.setMaxOccurrences("10");
- capability.setMinOccurrences("4");
- RestResponse restResponse = CapabilityRestUtils.updateCapability(pnfResource, Collections.singletonList(capability),
- user);
- logger.info("updateCapability On Pnf Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- @Test(dependsOnMethods = "updateCapabilityOnPnfTest")
- public void getCapabilityFromPnfTest() throws Exception {
- Resource pnfResourceObject = getResourceObject(pnfResource.getUniqueId());
-
- List<org.openecomp.sdc.be.model.CapabilityDefinition> capabilityDefinitionList = pnfResourceObject.getCapabilities()
- .values().stream().flatMap(Collection::stream).collect(Collectors.toList());
-
- RestResponse restResponse = CapabilityRestUtils.getCapability(pnfResource,
- capabilityDefinitionList.get(0).getUniqueId(), user);
- logger.info("getCapabilityTest from Pnf Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- @Test(dependsOnMethods = "getCapabilityFromPnfTest")
- public void deleteCapabilityFromPnfTest() throws Exception {
- Resource pnfResourceObject = getResourceObject(pnfResource.getUniqueId());
-
- List<org.openecomp.sdc.be.model.CapabilityDefinition> capabilityDefinitionList = pnfResourceObject.getCapabilities()
- .values().stream().flatMap(Collection::stream).collect(Collectors.toList());
-
- RestResponse restResponse = CapabilityRestUtils.deleteCapability(pnfResource,
- capabilityDefinitionList.get(0).getUniqueId(), user);
- logger.info("deleteCapabilityTest from Pnf Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- @Test
- public void createCapabilityWithPropertiesOnPnfTest() throws Exception {
-
- CapabilityDetails capability = createCapability();
- List<ComponentInstanceProperty> properties = new ArrayList<>();
- ComponentInstanceProperty instanceProperty = new ComponentInstanceProperty();
- instanceProperty.setType("prop_type");
- instanceProperty.setName("prop_name");
- instanceProperty.setDescription("prop_description");
- instanceProperty.setSchema(new SchemaDefinition());
- properties.add(instanceProperty);
- capability.setProperties(properties);
- RestResponse restResponse = CapabilityRestUtils.createCapability(pnfResource, Collections.singletonList(capability),
- user);
- logger.info("createCapability On Pnf Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- @Test(dependsOnMethods = "createCapabilityWithPropertiesOnPnfTest")
- public void updateCapabilityWithPropertiesOnPnfTest() throws Exception {
-
- CapabilityDetails capability = createCapability();
- capability.setMaxOccurrences("10");
- capability.setMinOccurrences("4");
-
- List<ComponentInstanceProperty> properties = new ArrayList<>();
- ComponentInstanceProperty instanceProperty = new ComponentInstanceProperty();
- instanceProperty.setType("prop_type_updated");
- instanceProperty.setName("prop_name_updated");
- instanceProperty.setDescription("prop_description_prop_desc");
- instanceProperty.setSchema(new SchemaDefinition());
- properties.add(instanceProperty);
- capability.setProperties(properties);
- RestResponse restResponse = CapabilityRestUtils.updateCapability(pnfResource,
- Collections.singletonList(capability), user);
- logger.info("updateCapability On Pnf Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
-
- private CapabilityDetails createCapability() {
- CapabilityDetails capabilityDetails = new CapabilityDetails();
- capabilityDetails.setName("cap" + Math.random());
- capabilityDetails.setType("tosca.capabilities.network.Bindable");
-
- return capabilityDetails;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/config/Config.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/config/Config.java
deleted file mode 100644
index 82fdde4b84..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/config/Config.java
+++ /dev/null
@@ -1,736 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.config;
-
-import org.yaml.snakeyaml.Yaml;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.util.List;
-
-public class Config {
-
- private static String WINDOWS_CONFIG_FILE = "src/main/resources/ci/conf/attsdc.yaml";
- private boolean systemUnderDebug;
- private boolean rerun;
- private String reportDBhost;
- private int reportDBport;
-
- private String browser;
- private String catalogBeHost;
- private String esHost;
- private String esPort;
- private String neoHost;
- private String neoPort;
- private String disributionClientHost;
- private String disributionClientPort;
- private boolean isDistributionClientRunning;
-
-
- private String errorConfigurationFile;
- private String resourceConfigDir;
- private String componentsConfigDir;
- private String importResourceConfigDir;
- private String importResourceTestsConfigDir;
- private String importTypesConfigDir;
-
- private String testSuites;
-
- private String catalogFeHost;
- private String catalogFePort;
- private String catalogBePort;
- private String catalogBeTlsPort;
-
- private String onboardingBeHost;
- private String onboardingBePort;
-
- private String neoDBusername;
- private String neoDBpassword;
-
- private String janusGraphPropertiesFile;
- private List<String> packages;
- private List<String> bugs;
- private List<String> resourcesNotToDelete;
- private List<String> resourceCategoriesNotToDelete;
- private List<String> serviceCategoriesNotToDelete;
- private boolean stopOnClassFailure = false;
-
- private String outputFolder;
- private String reportName;
- private String url;
- private String remoteTestingMachineIP;
- private String remoteTestingMachinePort;
- private boolean remoteTesting;
-
- private String cassandraHost;
- private String cassandraAuditKeySpace;
- private String cassandraArtifactKeySpace;
- private boolean cassandraAuthenticate;
- private String cassandraUsername;
- private String cassandraPassword;
- private boolean cassandraSsl;
- private String cassandraTruststorePath;
- private String cassandraTruststorePassword;
- private String windowsDownloadDirectory;
- private boolean captureTraffic;
- private boolean useBrowserMobProxy;
- private String sdcHttpMethod;
- private String localDataCenter;
- private boolean uiSimulator;
-
- public String getLocalDataCenter() {
- return localDataCenter;
- }
-
- public void setLocalDataCenter(String localDataCenter) {
- this.localDataCenter = localDataCenter;
- }
-
- private static Config configIt = null;
-
- private static Yaml yaml = new Yaml();
-
-
- private Config() {
- super();
- }
-
- public String getOnboardingBePort() {
- return onboardingBePort;
- }
-
- public void setOnboardingBePort(String onboardingBePort) {
- this.onboardingBePort = onboardingBePort;
- }
-
- public String getOnboardingBeHost() {
- return onboardingBeHost;
- }
-
- public void setOnboardingBeHost(String onboardingBeHost) {
- this.onboardingBeHost = onboardingBeHost;
- }
-
- public static class TestPackages {
-
- List<String> packages;
- List<String> bugs;
-
- public List<String> getPackages() {
- return packages;
- }
-
- public void setPackages(List<String> packages) {
- this.packages = packages;
- }
-
- public List<String> getBugs() {
- return bugs;
- }
-
- public void setBugs(List<String> bugs) {
- this.bugs = bugs;
- }
-
- @Override
- public String toString() {
- return "TestPackages [packages=" + packages + ", bugs=" + bugs + "]";
- }
-
- }
-
- public synchronized static Config instance() {
- if (configIt == null) {
- try {
- configIt = init();
- } catch (IOException e) {
- e.printStackTrace();
- return null;
- }
- }
- return configIt;
- }
-
- private static Config init() throws IOException {
-
- Config config = null;
-
- String configFile = System.getProperty("config.resource");
- if (configFile == null) {
- configFile = WINDOWS_CONFIG_FILE;
- }
-
- File file = new File(configFile);
- if (false == file.exists()) {
- throw new RuntimeException("The config file " + configFile + " cannot be found.");
- }
-
- InputStream in = null;
- try {
-
- in = Files.newInputStream(Paths.get(configFile));
-
- config = yaml.loadAs(in, Config.class);
-
- setPackagesAndBugs(configFile, config);
-
- } finally {
- if (in != null) {
- try {
- in.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
-
- // JsonReader jsonReader = new JsonReader(new FileReader(configFile));
- // Config configAttOdlIt = new Gson().fromJson(jsonReader,
- // Config.class);
-
- return config;
- }
-
- public boolean isUiSimulator() {
- return uiSimulator;
- }
-
- public void setUiSimulator(boolean uiSimulator) {
- this.uiSimulator = uiSimulator;
- }
-
- private static void setPackagesAndBugs(String path, Config config) throws IOException {
-
- int separator = Math.max(path.lastIndexOf("\\"), path.lastIndexOf("/"));
- String dirPath = path.substring(0, separator + 1);
- String packagesFile = dirPath + File.separator + "attsdc-packages.yaml";
- File file = new File(packagesFile);
- if (false == file.exists()) {
- throw new RuntimeException("The config file " + packagesFile + " cannot be found.");
- }
-
- TestPackages testPackages = null;
- InputStream in = null;
- try {
-
- in = Files.newInputStream(Paths.get(packagesFile));
-
- testPackages = yaml.loadAs(in, TestPackages.class);
-
- List<String> bugs = testPackages.getBugs();
- List<String> packages = testPackages.getPackages();
-
- config.setBugs(bugs);
- config.setPackages(packages);
-
- } finally {
- if (in != null) {
- try {
- in.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
-
- }
-
- // public Config(String catalogBeHost, String esHost, String esPort, String
- // resourceConfigDir, String componentsConfigDir, String catalogFeHost,
- // String catalogFePort, String catalogBePort) {
- // super();
- // this.catalogBeHost = catalogBeHost;
- // this.esHost = esHost;
- // this.esPort = esPort;
- // this.resourceConfigDir = resourceConfigDir;
- // this.componentsConfigDir = componentsConfigDir;
- // this.catalogFeHost = catalogFeHost;
- // this.catalogFePort = catalogFePort;
- // this.catalogBePort = catalogBePort;
- // }
-
- String configurationFile;
-
- public boolean getSystemUnderDebug() {
- return systemUnderDebug;
- }
-
- public void setSystemUnderDebug(boolean systemUnderDebug) {
- this.systemUnderDebug = systemUnderDebug;
- }
-
- public String getSdcHttpMethod() {
- return sdcHttpMethod;
- }
-
- public void setSdcHttpMethod(String sdcHttpMethod) {
- this.sdcHttpMethod = sdcHttpMethod;
- }
-
- public boolean getRerun() {
- return rerun;
- }
-
- public void setRerun(boolean rerun) {
- this.rerun = rerun;
- }
-
- public String getReportDBhost() {
- return reportDBhost;
- }
-
- public void setReportDBhost(String reportDBhost) {
- this.reportDBhost = reportDBhost;
- }
-
- public int getReportDBport() {
- return reportDBport;
- }
-
- public void setReportDBport(int reportDBport) {
- this.reportDBport = reportDBport;
- }
-// public boolean isUsingBrowserMobProxy() {
-// return useBrowserMobProxy;
-// }
-//
-// public void setUsingBrowserMobProxy(boolean usingBrowserMobProxy) {
-// this.useBrowserMobProxy = usingBrowserMobProxy;
-// }
-
-
-
-
- public String getBrowser() {
- return browser;
- }
-
- public boolean getUseBrowserMobProxy() {
- return useBrowserMobProxy;
- }
-
- public void setUseBrowserMobProxy(boolean useBrowserMobProxy) {
- this.useBrowserMobProxy = useBrowserMobProxy;
- }
-
-
-
- public boolean getCaptureTraffic() {
- return captureTraffic;
- }
-
- public void setCaptureTraffic(boolean captureTraffic) {
- this.captureTraffic = captureTraffic;
- }
-
- public void setBrowser(String browser) {
- this.browser = browser;
- }
-
- public String getConfigurationFile() {
- return configurationFile;
- }
-
- public void setConfigurationFile(String configurationFile) {
- this.configurationFile = configurationFile;
- }
-
- public boolean getIsDistributionClientRunning() {
- return isDistributionClientRunning;
- }
-
- public void setIsDistributionClientRunning(boolean isDistributionClientRunning) {
- this.isDistributionClientRunning = isDistributionClientRunning;
- }
-
- public String getCatalogBePort() {
- return catalogBePort;
- }
-
- public String getDisributionClientHost() {
- return disributionClientHost;
- }
-
- public void setDisributionClientHost(String disributionClientHost) {
- this.disributionClientHost = disributionClientHost;
- }
-
- public String getDisributionClientPort() {
- return disributionClientPort;
- }
-
- public void setDisributionClientPort(String disributionClientPort) {
- this.disributionClientPort = disributionClientPort;
- }
-
- public void setCatalogBePort(String catalogBePort) {
- this.catalogBePort = catalogBePort;
- }
-
- public String getCatalogFeHost() {
- return catalogFeHost;
- }
-
- public void setCatalogFeHost(String catalogFeHost) {
- this.catalogFeHost = catalogFeHost;
- }
-
- public String getCatalogFePort() {
- return catalogFePort;
- }
-
- public void setCatalogFePort(String catalogFePort) {
- this.catalogFePort = catalogFePort;
- }
-
- public String getCatalogBeHost() {
- return catalogBeHost;
- }
-
- public void setCatalogBeHost(String catalogBeHost) {
- this.catalogBeHost = catalogBeHost;
- }
-
- public String getEsHost() {
- return esHost;
- }
-
- public void setEsHost(String esHost) {
- this.esHost = esHost;
- }
-
- public String getEsPort() {
- return esPort;
- }
-
- public void setEsPort(String esPort) {
- this.esPort = esPort;
- }
-
- public String getResourceConfigDir() {
- return resourceConfigDir;
- }
-
- public void setResourceConfigDir(String resourceConfigDir) {
- this.resourceConfigDir = resourceConfigDir;
- }
-
- public String getComponentsConfigDir() {
- return componentsConfigDir;
- }
-
- public void setComponentsConfigDir(String componentsConfigDir) {
- this.componentsConfigDir = componentsConfigDir;
- }
-
- public String getOutputFolder() {
- return outputFolder;
- }
-
- public void setOutputFolder(String outputFolder) {
- this.outputFolder = outputFolder;
- }
-
- public String getReportName() {
- return reportName;
- }
-
- public void setReportName(String reportName) {
- this.reportName = reportName;
- }
-
- public String getNeoPort() {
- return neoPort;
- }
-
- public void setNeoPort(String neoPort) {
- this.neoPort = neoPort;
- }
-
- public String getNeoHost() {
- return neoHost;
- }
-
- public void setNeoHost(String neoHost) {
- this.neoHost = neoHost;
- }
-
- public String getNeoDBpassword() {
- return neoDBpassword;
- }
-
- public String getNeoDBusername() {
- return neoDBusername;
- }
-
- public void setNeoDBusername(String neoDBusername) {
- this.neoDBusername = neoDBusername;
- }
-
- public void setNeoDBpassword(String neoDBpassword) {
- this.neoDBpassword = neoDBpassword;
- }
-
- public String getjanusGraphPropertiesFile() {
- return janusGraphPropertiesFile;
- }
-
- public void setjanusGraphPropertiesFile(String janusGraphPropertiesFile) {
- this.janusGraphPropertiesFile = janusGraphPropertiesFile;
- }
-
- public List<String> getPackages() {
- return packages;
- }
-
- public void setPackages(List<String> packages) {
- this.packages = packages;
- }
-
- public List<String> getBugs() {
- return bugs;
- }
-
- public void setBugs(List<String> bugs) {
- this.bugs = bugs;
- }
-
- public boolean isStopOnClassFailure() {
- return stopOnClassFailure;
- }
-
- public void setStopOnClassFailure(boolean stopOnClassFailure) {
- this.stopOnClassFailure = stopOnClassFailure;
- }
-
- public String getImportResourceConfigDir() {
- return importResourceConfigDir;
- }
-
- public void setImportResourceConfigDir(String importResourceConfigDir) {
- this.importResourceConfigDir = importResourceConfigDir;
- }
-
- public String getImportResourceTestsConfigDir() {
- return importResourceTestsConfigDir;
- }
-
- public void setImportResourceTestsConfigDir(String importResourceTestsConfigDir) {
- this.importResourceTestsConfigDir = importResourceTestsConfigDir;
- }
-
- public String getErrorConfigurationFile() {
- return errorConfigurationFile;
- }
-
- public void setErrorConfigurationFile(String errorConfigurationFile) {
- this.errorConfigurationFile = errorConfigurationFile;
- }
-
- public String getCatalogBeTlsPort() {
- return catalogBeTlsPort;
- }
-
- public void setCatalogBeTlsPort(String catalogBeTlsPort) {
- this.catalogBeTlsPort = catalogBeTlsPort;
- }
-
- public List<String> getResourcesNotToDelete() {
- return resourcesNotToDelete;
- }
-
- public void setResourcesNotToDelete(List<String> resourcesNotToDelete) {
- this.resourcesNotToDelete = resourcesNotToDelete;
- }
-
- public List<String> getResourceCategoriesNotToDelete() {
- return resourceCategoriesNotToDelete;
- }
-
- public void setResourceCategoriesNotToDelete(List<String> resourceCategoriesNotToDelete) {
- this.resourceCategoriesNotToDelete = resourceCategoriesNotToDelete;
- }
-
- public List<String> getServiceCategoriesNotToDelete() {
- return serviceCategoriesNotToDelete;
- }
-
- public void setServiceCategoriesNotToDelete(List<String> serviceCategoriesNotToDelete) {
- this.serviceCategoriesNotToDelete = serviceCategoriesNotToDelete;
- }
-
- public String getImportTypesConfigDir() {
- return importTypesConfigDir;
- }
-
- public void setImportTypesConfigDir(String importTypesConfigDir) {
- this.importTypesConfigDir = importTypesConfigDir;
- }
-
- public String getCassandraHost() {
- return cassandraHost;
- }
-
- public void setCassandraHost(String cassandraHost) {
- this.cassandraHost = cassandraHost;
- }
-
- public String getCassandraAuditKeySpace() {
- return cassandraAuditKeySpace;
- }
-
- public void setCassandraAuditKeySpace(String cassandraAuditKeySpace) {
- this.cassandraAuditKeySpace = cassandraAuditKeySpace;
- }
-
- public String getCassandraArtifactKeySpace() {
- return cassandraArtifactKeySpace;
- }
-
- public void setCassandraArtifactKeySpace(String cassandraArtifactKeySpace) {
- this.cassandraArtifactKeySpace = cassandraArtifactKeySpace;
- }
-
-
- public String getWindowsDownloadDirectory() {
- return windowsDownloadDirectory;
- }
-
- public void setWindowsDownloadDirectory(String windowsDownloadDirectory) {
- this.windowsDownloadDirectory = windowsDownloadDirectory;
- }
-
- @Override
- public String toString() {
- return "Config [systemUnderDebug=" + systemUnderDebug + ", rerun=" + rerun + ", reportDBhost=" + reportDBhost
- + ", reportDBport=" + reportDBport + ", browser=" + browser + ", catalogBeHost=" + catalogBeHost
- + ", esHost=" + esHost + ", esPort=" + esPort + ", neoHost=" + neoHost + ", neoPort=" + neoPort
- + ", disributionClientHost=" + disributionClientHost + ", disributionClientPort="
- + disributionClientPort + ", isDistributionClientRunning=" + isDistributionClientRunning
- + ", errorConfigurationFile=" + errorConfigurationFile + ", resourceConfigDir=" + resourceConfigDir
- + ", componentsConfigDir=" + componentsConfigDir + ", importResourceConfigDir="
- + importResourceConfigDir + ", importResourceTestsConfigDir=" + importResourceTestsConfigDir
- + ", importTypesConfigDir=" + importTypesConfigDir + ", testSuites=" + testSuites + ", catalogFeHost="
- + catalogFeHost + ", catalogFePort=" + catalogFePort + ", catalogBePort=" + catalogBePort
- + ", catalogBeTlsPort=" + catalogBeTlsPort + ", neoDBusername=" + neoDBusername + ", neoDBpassword="
- + neoDBpassword + ", janusGraphPropertiesFile=" + janusGraphPropertiesFile + ", packages=" + packages + ", bugs="
- + bugs + ", resourcesNotToDelete=" + resourcesNotToDelete + ", resourceCategoriesNotToDelete="
- + resourceCategoriesNotToDelete + ", serviceCategoriesNotToDelete=" + serviceCategoriesNotToDelete
- + ", stopOnClassFailure=" + stopOnClassFailure + ", outputFolder=" + outputFolder + ", reportName="
- + reportName + ", url=" + url + ", remoteTestingMachineIP=" + remoteTestingMachineIP
- + ", remoteTestingMachinePort=" + remoteTestingMachinePort + ", remoteTesting=" + remoteTesting
- + ", cassandraHost=" + cassandraHost + ", cassandraAuditKeySpace=" + cassandraAuditKeySpace
- + ", cassandraArtifactKeySpace=" + cassandraArtifactKeySpace + ", cassandraAuthenticate="
- + cassandraAuthenticate + ", cassandraUsername=" + cassandraUsername + ", cassandraPassword="
- + cassandraPassword + ", cassandraSsl=" + cassandraSsl + ", cassandraTruststorePath="
- + cassandraTruststorePath + ", cassandraTruststorePassword=" + cassandraTruststorePassword
- + ", windowsDownloadDirectory=" + windowsDownloadDirectory + ", captureTraffic=" + captureTraffic
- + ", useBrowserMobProxy=" + useBrowserMobProxy + ", configurationFile=" + configurationFile + "]";
- }
-
- public boolean isRemoteTesting() {
- return remoteTesting;
- }
-
- public void setRemoteTesting(boolean remoteTesting) {
- this.remoteTesting = remoteTesting;
- }
-
- public String getUrl() {
- try {
- return url;
- } catch (Exception e) {
- return null;
- }
- }
-
- public void setUrl(String url) {
- this.url = url;
- }
-
- public String getRemoteTestingMachineIP() {
- return remoteTestingMachineIP;
- }
-
- public void setRemoteTestingMachineIP(String remoteTestingMachineIP) {
- this.remoteTestingMachineIP = remoteTestingMachineIP;
- }
-
- public String getRemoteTestingMachinePort() {
- return remoteTestingMachinePort;
- }
-
- public void setRemoteTestingMachinePort(String remoteTestingMachinePort) {
- this.remoteTestingMachinePort = remoteTestingMachinePort;
- }
-
- public boolean getCassandraAuthenticate() {
- return cassandraAuthenticate;
- }
-
- public void setCassandraAuthenticate(boolean cassandraAuthenticate) {
- this.cassandraAuthenticate = cassandraAuthenticate;
- }
-
- public String getCassandraUsername() {
- return cassandraUsername;
- }
-
- public void setCassandraUsername(String cassandraUsername) {
- this.cassandraUsername = cassandraUsername;
- }
-
- public String getCassandraPassword() {
- return cassandraPassword;
- }
-
- public void setCassandraPassword(String cassandraPassword) {
- this.cassandraPassword = cassandraPassword;
- }
-
- public boolean getCassandraSsl() {
- return cassandraSsl;
- }
-
- public void setCassandraSsl(boolean cassandraSsl) {
- this.cassandraSsl = cassandraSsl;
- }
-
- public String getCassandraTruststorePath() {
- return cassandraTruststorePath;
- }
-
- public void setCassandraTruststorePath(String cassandraTruststorePath) {
- this.cassandraTruststorePath = cassandraTruststorePath;
- }
-
- public String getCassandraTruststorePassword() {
- return cassandraTruststorePassword;
- }
-
- public void setCassandraTruststorePassword(String cassandraTruststorePassword) {
- this.cassandraTruststorePassword = cassandraTruststorePassword;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/config/InvokedMethodListener.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/config/InvokedMethodListener.java
deleted file mode 100644
index bfed5dc90d..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/config/InvokedMethodListener.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.config;
-
-import org.testng.IInvokedMethod;
-import org.testng.IInvokedMethodListener;
-import org.testng.ITestResult;
-import org.testng.SkipException;
-import org.testng.internal.TestResult;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class InvokedMethodListener implements IInvokedMethodListener {
-
- static Map<String, Integer> methodFailCount = new HashMap<String, Integer>();
-
- @Override
-
- public void beforeInvocation(IInvokedMethod method, ITestResult testResult) {
-
- if (methodFailCount.get(method.getTestMethod().getMethodName()) != null
- && methodFailCount.get(method.getTestMethod().getMethodName()) > 1)
- throw new SkipException("Skipped due to failure count > 1");
- ;
-
- }
-
- @Override
-
- public void afterInvocation(IInvokedMethod method, ITestResult testResult) {
-
- if (testResult.getStatus() == TestResult.FAILURE) {
- if (methodFailCount.get(method.getTestMethod().getMethodName()) == null)
- methodFailCount.put(method.getTestMethod().getMethodName(), 1);
- else {
- methodFailCount.put(method.getTestMethod().getMethodName(),
- methodFailCount.get(method.getTestMethod().getMethodName()) + 1);
- }
-
- }
-
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/config/MainToTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/config/MainToTest.java
deleted file mode 100644
index 36f97bd5e6..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/config/MainToTest.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.config;
-
-
-import org.apache.commons.io.IOUtils;
-import org.json.JSONObject;
-import org.openecomp.sdc.ci.tests.utils.general.FileHandling;
-import org.yaml.snakeyaml.Yaml;
-
-import java.io.*;
-import java.nio.charset.Charset;
-import java.util.Map;
-
-public class MainToTest {
-
- private static final String CREDENTIALS_FILE = "credentials.yaml";
-
-// public static void main(String[] args) throws Exception {
-// System.out.println("Hello World!"); // Display the string.
-// System.out.println("user.dir: " + System.getProperty("user.dir"));
-// System.out.println(UserRoleEnum.DESIGNER.getFirstName());
-// String file = readFile();
-// convertToJson(file);
-// Either<Service, RestResponse> createDefaultService1e = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true);
-//
-//
-//
-// }
-
- private static String convertToJson(String yamlString) {
- Yaml yaml = new Yaml();
- Map<String, Object> map = (Map<String, Object>) yaml.load(yamlString);
-
- JSONObject jsonObject = new JSONObject(map);
- return jsonObject.toString();
- }
-
- private static String readFile() {
-
- File credentialsFileLocal = new File(FileHandling.getSdcVnfsPath() + File.separator + "conf"
- + File.separator + CREDENTIALS_FILE);
-
- InputStream inputStream = null;
- try {
- inputStream = new FileInputStream(credentialsFileLocal);
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- }
- finally {
- try {
- String mystr = IOUtils.toString(inputStream, Charset.forName("UTF-8"));
- inputStream.close();
- return mystr;
- } catch(IOException e) {
- }
- }
-
- return null;
- }
-
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/config/UserCredentialsFromFile.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/config/UserCredentialsFromFile.java
deleted file mode 100644
index 8317703b99..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/config/UserCredentialsFromFile.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.config;
-
-import org.openecomp.sdc.ci.tests.datatypes.UserCredentials;
-import org.openecomp.sdc.ci.tests.utils.general.FileHandling;
-import org.yaml.snakeyaml.Yaml;
-
-import java.io.File;
-import java.util.Map;
-
-public class UserCredentialsFromFile {
-
- private static final String CREDENTIALS_FILE = "credentials.yaml";
- private static Map<String, UserCredentials> credentials;
- private static Yaml yaml = new Yaml();
-
- private static final UserCredentialsFromFile instance = new UserCredentialsFromFile();
-
- public static UserCredentialsFromFile getInstance(){
- return instance;
- }
-
- private UserCredentialsFromFile() {
-
- credentials = null;
-
- File credentialsFileRemote = new File(FileHandling.getBasePath() + File.separator + "conf" + File.separator + CREDENTIALS_FILE);
-// File credentialsFileLocal = new File(FileHandling.getConfFilesPath() + CREDENTIALS_FILE);
- File credentialsFileLocal = new File(FileHandling.getSdcVnfsPath() + File.separator + "conf"
- + File.separator + CREDENTIALS_FILE);
- File[] credentialFiles = {credentialsFileRemote, credentialsFileLocal};
- for (File credentialsFile : credentialFiles){
- if (credentialsFile.exists()){
- try {
- credentials = (Map<String, UserCredentials>) FileHandling.parseYamlFile(credentialsFile.getAbsolutePath());
- } catch (Exception e) {
- e.printStackTrace();
- }
- break;
- }
- }
-
-
- }
-
- public UserCredentials getUserCredentialsByRole(String userRole) {
- Map<String, String> credentialsMap = (Map<String, String>) credentials.get(userRole);
- UserCredentials userCredentials = new UserCredentials();
- userCredentials.setUserId(credentialsMap.get("username"));
- userCredentials.setFirstName(credentialsMap.get("firstname"));
- userCredentials.setLastName(credentialsMap.get("lastname"));
- userCredentials.setPassword(credentialsMap.get("password"));
- return userCredentials;
- }
-
-}
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
deleted file mode 100644
index a2f39b3f0e..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/data/providers/OnboardingDataProviders.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-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;
-import org.openecomp.sdc.ci.tests.utils.general.OnboardingUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.annotations.DataProvider;
-
-public final class OnboardingDataProviders {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(OnboardingDataProviders.class);
- private static final String VNF_FILE_PATH = FileHandling.getXnfRepositoryPath(XnfTypeEnum.VNF);
-
- private OnboardingDataProviders() {
-
- }
-
- @DataProvider(name = "randomVNF_List")
- private static Object[][] randomVnfList() {
- final int randomElementNumber = 3; //how many VNFs to onboard randomly
- final List<String> fileNamesFromFolder = OnboardingUtils.getVnfNamesFileListExcludeToscaParserFailure();
- final List<String> newRandomFileNamesFromFolder = getRandomElements(randomElementNumber, fileNamesFromFolder);
- if (CollectionUtils.isEmpty(newRandomFileNamesFromFolder)) {
- fail("Required number of VNF files not exists under " + VNF_FILE_PATH);
- return new Object[0][];
- }
- LOGGER.debug(String.format("There are %s zip file(s) to test", newRandomFileNamesFromFolder.size()));
- return provideData(newRandomFileNamesFromFolder, VNF_FILE_PATH);
- }
-
- @DataProvider(name = "VNF_List", parallel = true)
- private static Object[][] vnfList() {
- final List<String> fileNamesFromFolder = OnboardingUtils.getXnfNamesFileList(XnfTypeEnum.VNF);
- LOGGER.debug(String.format("There are %s package file(s) to test", fileNamesFromFolder.size()));
- return provideData(fileNamesFromFolder, VNF_FILE_PATH);
- }
-
- @DataProvider(name = "PNF_List", parallel = true)
- private static Object[][] pnfList() {
- return provideData(OnboardingUtils.getXnfNamesFileList(XnfTypeEnum.PNF),
- FileHandling.getXnfRepositoryPath(XnfTypeEnum.PNF));
- }
-
- @DataProvider(name = "Single_VNF", parallel = true)
- private static Object[][] singleVNF() {
- final List<String> fileNamesFromFolder = OnboardingUtils.getXnfNamesFileList(XnfTypeEnum.VNF);
- final List<String> newList = new ArrayList<>();
- newList.add(fileNamesFromFolder.get(0));
- LOGGER.debug(String.format("There are %s zip file(s) to test", fileNamesFromFolder.size()));
- 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;
- for (final Object obj : fileNamesFromFolder) {
- parametersArray[index++] = new Object[]{folderPath, obj};
- }
- return parametersArray;
- }
-
- public static List<String> getRandomElements(final int randomElementNumber,
- final List<String> fileNamesFromFolder) {
- if (fileNamesFromFolder.isEmpty() || fileNamesFromFolder.size() < randomElementNumber) {
- return Collections.emptyList();
- } else {
- final List<Integer> indexList = new ArrayList<>();
- final List<String> newRandomFileNamesFromFolder = new ArrayList<>();
- for (int i = 0; i < fileNamesFromFolder.size(); i++) {
- indexList.add(i);
- }
- Collections.shuffle(indexList);
- final Integer[] randomArray = indexList.subList(0, randomElementNumber)
- .toArray(new Integer[randomElementNumber]);
- for (final Integer randomNumber : randomArray) {
- newRandomFileNamesFromFolder.add(fileNamesFromFolder.get(randomNumber));
- }
- return newRandomFileNamesFromFolder;
- }
- }
-
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ArtifactAssetStructure.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ArtifactAssetStructure.java
deleted file mode 100644
index 37f6243f96..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ArtifactAssetStructure.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-public class ArtifactAssetStructure {
-
- String artifactName;
- String artifactType;
- String artifactURL;
- String artifactDescription;
- int artifactTimeout;// optional
- String artifactChecksum;
- String artifactUUID;
- String artifactVersion;
- String generatedFromUUID;// optional
-
- public ArtifactAssetStructure(String artifactName, String artifactType, String artifactURL,
- String artifactDescription, int artifactTimeout, String artifactChecksum, String artifactUUID,
- String artifactVersion, String generatedFromUUID) {
- super();
- this.artifactName = artifactName;
- this.artifactType = artifactType;
- this.artifactURL = artifactURL;
- this.artifactDescription = artifactDescription;
- this.artifactTimeout = artifactTimeout;
- this.artifactChecksum = artifactChecksum;
- this.artifactUUID = artifactUUID;
- this.artifactVersion = artifactVersion;
- this.generatedFromUUID = generatedFromUUID;
- }
-
- public ArtifactAssetStructure() {
- super();
- }
-
- public String getArtifactName() {
- return artifactName;
- }
-
- public void setArtifactName(String artifactName) {
- this.artifactName = artifactName;
- }
-
- public String getArtifactType() {
- return artifactType;
- }
-
- public void setArtifactType(String artifactType) {
- this.artifactType = artifactType;
- }
-
- public String getArtifactURL() {
- return artifactURL;
- }
-
- public void setArtifactURL(String artifactURL) {
- this.artifactURL = artifactURL;
- }
-
- public String getArtifactDescription() {
- return artifactDescription;
- }
-
- public void setArtifactDescription(String artifactDescription) {
- this.artifactDescription = artifactDescription;
- }
-
- public int getArtifactTimeout() {
- return artifactTimeout;
- }
-
- public void setArtifactTimeout(int artifactTimeout) {
- this.artifactTimeout = artifactTimeout;
- }
-
- public String getArtifactChecksum() {
- return artifactChecksum;
- }
-
- public void setArtifactChecksum(String artifactChecksum) {
- this.artifactChecksum = artifactChecksum;
- }
-
- public String getArtifactUUID() {
- return artifactUUID;
- }
-
- public void setArtifactUUID(String artifactUUID) {
- this.artifactUUID = artifactUUID;
- }
-
- public String getArtifactVersion() {
- return artifactVersion;
- }
-
- public void setArtifactVersion(String artifactVersion) {
- this.artifactVersion = artifactVersion;
- }
-
- public String getGeneratedFromUUID() {
- return generatedFromUUID;
- }
-
- public void setGeneratedFromUUID(String generatedFromUUID) {
- this.generatedFromUUID = generatedFromUUID;
- }
-
- @Override
- public String toString() {
- return "ArtifactAssetStructure [artifactName=" + artifactName + ", artifactType=" + artifactType
- + ", artifactURL=" + artifactURL + ", artifactDescription=" + artifactDescription + ", artifactTimeout="
- + artifactTimeout + ", artifactChecksum=" + artifactChecksum + ", artifactUUID=" + artifactUUID
- + ", artifactVersion=" + artifactVersion + ", generatedFromUUID=" + generatedFromUUID + "]";
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ArtifactReqDetails.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ArtifactReqDetails.java
deleted file mode 100644
index 4217a0ea39..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ArtifactReqDetails.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-import org.openecomp.sdc.be.model.HeatParameterDefinition;
-
-import java.util.List;
-
-public class ArtifactReqDetails {
-
- public ArtifactReqDetails() {
-
- }
-
- public ArtifactReqDetails(String artifactName, String artifactType, String artifactDescription, String payloadData,
- String artifactLabel) {
- super();
- this.artifactName = artifactName;
- this.artifactType = artifactType;
- this.description = artifactDescription;
- this.payloadData = payloadData;
- this.artifactLabel = artifactLabel;
- }
-
- public ArtifactReqDetails(String artifactLabel, ArtifactReqDetails a) {
- super();
- this.artifactName = a.getArtifactName();
- this.artifactType = a.getArtifactType();
- this.description = a.getArtifactType();
- this.payloadData = a.getPayload();
- this.artifactLabel = artifactLabel;
- }
-
- private String uniqueId;
- private String artifactName;
- private String artifactType;
- private String description;
- private String payloadData;
- private String artifactLabel;
- private String apiUrl;
- private String artifactGroupType;
- private Integer timeout;
- private String userIdLastUpdater;
- private String creatorFullName;
- private String updaterFullName;
- private String artifactChecksum;
- private String artifactDisplayName;
- private List<HeatParameterDefinition> heatParameters;
-
- private boolean mandatory;
- private boolean serviceApi;
-
- public boolean isServiceApi() {
- return serviceApi;
- }
-
- public void setServiceApi(boolean serviceApi) {
- this.serviceApi = serviceApi;
- }
-
- public String getArtifactLabel() {
- return artifactLabel;
- }
-
- public void setArtifactLabel(String artifactLabel) {
- this.artifactLabel = artifactLabel;
- }
-
- public String getArtifactName() {
- return artifactName;
- }
-
- public void setArtifactName(String artifactName) {
- this.artifactName = artifactName;
- }
-
- public String getArtifactType() {
- return artifactType;
- }
-
- public void setArtifactType(String artifactType) {
- this.artifactType = artifactType;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public String getPayload() {
- return payloadData;
- }
-
- public void setPayload(String payload) {
- this.payloadData = payload;
- }
-
- public void setPayloadData(String payloadData) {
- this.payloadData = payloadData;
- }
-
- public String getArtifactGroupType() {
- return artifactGroupType;
- }
-
- public void setArtifactGroupType(String artifactGroupType) {
- this.artifactGroupType = artifactGroupType;
- }
-
- public Integer getTimeout() {
- return timeout;
- }
-
- public void setTimeout(Integer timeout) {
- this.timeout = timeout;
- }
-
- public boolean isMandatory() {
- return mandatory;
- }
-
- public void setMandatory(boolean mandatory) {
- this.mandatory = mandatory;
- }
-
- public String getUrl() {
- return apiUrl;
- }
-
- public void setUrl(String url) {
- this.apiUrl = url;
- }
-
- @Override
- public String toString() {
- if (!apiUrl.isEmpty()) {
- return "ArtifactReqDetails [artifactName=" + artifactName + ", artifactType=" + artifactType
- + ", description=" + description + ", payloadData=" + payloadData + ", artifactLabel="
- + artifactLabel + ", mandatory=" + mandatory + ", url=" + apiUrl + "]";
- }
-
- return "ArtifactReqDetails [artifactName=" + artifactName + ", artifactType=" + artifactType + ", description="
- + description + ", payloadData=" + payloadData + ", artifactLabel=" + artifactLabel
- + ", artifactUniqueId=" + uniqueId + ", mandatory=" + mandatory + ", serviceApi=" + serviceApi + "]";
-
- }
-
- // public String getPayloadData() {
- // return payloadData;
- // }
- //
- // public void setPayloadData(String payloadData) {
- // this.payloadData = payloadData;
- // }
-
- // public String getUserIdCreator() {
- // return userIdCreator;
- // }
- //
- // public void setUserIdCreator(String userIdCreator) {
- // this.userIdCreator = userIdCreator;
- // }
- //
- public String getArtifactDisplayName() {
-
- return artifactDisplayName;
- }
-
- public void setArtifactDisplayName(String artifactDisplayName) {
- this.artifactDisplayName = artifactDisplayName;
- }
-
- public String getUserIdLastUpdater() {
- return userIdLastUpdater;
- }
-
- public void setUserIdLastUpdater(String userIdLastUpdater) {
- this.userIdLastUpdater = userIdLastUpdater;
- }
-
- public String getCreatorFullName() {
- return creatorFullName;
- }
-
- public void setCreatorFullName(String creatorFullName) {
- this.creatorFullName = creatorFullName;
- }
-
- public String getUpdaterFullName() {
- return updaterFullName;
- }
-
- public void setUpdaterFullName(String updaterFullName) {
- this.updaterFullName = updaterFullName;
- }
-
- public String getArtifactChecksum() {
- return artifactChecksum;
- }
-
- public void setArtifactChecksum(String artifactChecksum) {
- this.artifactChecksum = artifactChecksum;
- }
-
- public String getUniqueId() {
- return uniqueId;
- }
-
- public void setUniqueId(String artifactUniqueId) {
- this.uniqueId = artifactUniqueId;
- }
-
- public List<HeatParameterDefinition> getHeatParameters() {
- return heatParameters;
- }
-
- public void setHeatParameters(List<HeatParameterDefinition> heatParameters) {
- this.heatParameters = heatParameters;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/AssetStructure.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/AssetStructure.java
deleted file mode 100644
index 8820b05772..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/AssetStructure.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-public class AssetStructure {
-
- private String uuid;
- private String invariantUUID;
- private String name;
- private String version;
- private String toscaModelURL;
- private String category;
- private String lifecycleState;
- private String lastUpdaterUserId;
-
- public AssetStructure() {
- super();
- }
-
- public AssetStructure(String uuid, String invariantUUID, String name, String version, String toscaModelURL,
- String category, String lifecycleState, String lastUpdaterUserId) {
- super();
- this.uuid = uuid;
- this.invariantUUID = invariantUUID;
- this.name = name;
- this.version = version;
- this.toscaModelURL = toscaModelURL;
- this.category = category;
- this.lifecycleState = lifecycleState;
- this.lastUpdaterUserId = lastUpdaterUserId;
- }
-
- @Override
- public String toString() {
- return "AssetStructure [uuid=" + uuid + ", invariantUUID=" + invariantUUID + ", name=" + name + ", version="
- + version + ", toscaModelURL=" + toscaModelURL + ", category=" + category + ", lifecycleState="
- + lifecycleState + ", lastUpdaterUserId=" + lastUpdaterUserId + "]";
- }
-
- public String getUuid() {
- return uuid;
- }
-
- public void setUuid(String uuid) {
- this.uuid = uuid;
- }
-
- public String getInvariantUUID() {
- return invariantUUID;
- }
-
- public void setInvariantUUID(String invariantUUID) {
- this.invariantUUID = invariantUUID;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getVersion() {
- return version;
- }
-
- public void setVersion(String version) {
- this.version = version;
- }
-
- public String getToscaModelURL() {
- return toscaModelURL;
- }
-
- public void setToscaModelURL(String toscaModelURL) {
- this.toscaModelURL = toscaModelURL;
- }
-
- public String getCategory() {
- return category;
- }
-
- public void setCategory(String category) {
- this.category = category;
- }
-
- public String getLifecycleState() {
- return lifecycleState;
- }
-
- public void setLifecycleState(String lifecycleState) {
- this.lifecycleState = lifecycleState;
- }
-
- public String getLastUpdaterUserId() {
- return lastUpdaterUserId;
- }
-
- public void setLastUpdaterUserId(String lastUpdaterUserId) {
- this.lastUpdaterUserId = lastUpdaterUserId;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CapabilityDetails.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CapabilityDetails.java
deleted file mode 100644
index bbed28b654..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CapabilityDetails.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright © 2016-2018 European Support Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-import org.openecomp.sdc.be.model.ComponentInstanceProperty;
-
-import java.util.List;
-
-public class CapabilityDetails {
- private String name;
- private String type;
- private String maxOccurrences;
- private String minOccurrences;
- private List<ComponentInstanceProperty> properties;
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getMaxOccurrences() {
- return maxOccurrences;
- }
-
- public void setMaxOccurrences(String maxOccurrences) {
- this.maxOccurrences = maxOccurrences;
- }
-
- public String getMinOccurrences() {
- return minOccurrences;
- }
-
- public void setMinOccurrences(String minOccurrences) {
- this.minOccurrences = minOccurrences;
- }
-
- public List<ComponentInstanceProperty> getProperties() {
- return properties;
- }
-
- public void setProperties(List<ComponentInstanceProperty> properties) {
- this.properties = properties;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ComponentInstanceReqDetails.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ComponentInstanceReqDetails.java
deleted file mode 100644
index b2768501d8..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ComponentInstanceReqDetails.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-import java.util.List;
-
-import org.openecomp.sdc.be.model.ComponentInstance;
-
-public class ComponentInstanceReqDetails {
-
- String componentUid;
- String description;
- String posX;
- String posY;
- String name;
- String uniqueId;
- String originType;
- List<String> directives;
-
- public ComponentInstanceReqDetails() {
- super();
- }
-
- public ComponentInstanceReqDetails(ComponentInstance componentInstance) {
- super();
- this.setUniqueId(componentInstance.getUniqueId());
- this.description = componentInstance.getDescription();
- this.posX = componentInstance.getPosX();
- this.posY = componentInstance.getPosY();
- // this.name = "myResourceInstance";
- this.name = componentInstance.getName();
- this.originType = componentInstance.getOriginType().name();
- }
-
- public ComponentInstanceReqDetails(String resourceUid, String description, String posX, String posY, String name, String originType) {
- super();
- this.componentUid = resourceUid;
- this.description = description;
- this.posX = posX;
- this.posY = posY;
- // this.name = "myResourceInstance";
- this.name = name;
- this.originType = originType;
- }
-
- public ComponentInstanceReqDetails(String resourceUid, String description, String posX, String posY) {
- super();
- this.componentUid = resourceUid;
- this.description = description;
- this.posX = posX;
- this.posY = posY;
- }
-
- public String getComponentUid() {
- return componentUid;
- }
-
- public void setComponentUid(String resourceUid) {
- this.componentUid = resourceUid;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public String getPosX() {
- return posX;
- }
-
- public void setPosX(String posX) {
- this.posX = posX;
- }
-
- public String getPosY() {
- return posY;
- }
-
- public void setPosY(String posY) {
- this.posY = posY;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getUniqueId() {
- return uniqueId;
- }
-
- public void setUniqueId(String uniqueId) {
- this.uniqueId = uniqueId;
- }
-
- public String getOriginType() {
- return originType;
- }
-
- public void setOriginType(String originType) {
- this.originType = originType;
- }
-
- public List<String> getDirectives() {
- return directives;
- }
-
- public void setDirectives(List<String> directives) {
- this.directives = directives;
- }
-
- @Override
- public String toString() {
- return "ComponentInstanceReqDetails{" +
- "componentUid='" + componentUid + '\'' +
- ", description='" + description + '\'' +
- ", posX='" + posX + '\'' +
- ", posY='" + posY + '\'' +
- ", name='" + name + '\'' +
- ", uniqueId='" + uniqueId + '\'' +
- ", originType='" + originType + '\'' +
- ", directives=" + directives +
- '}';
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ComponentReqDetails.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ComponentReqDetails.java
deleted file mode 100644
index 36c9fc8cd7..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ComponentReqDetails.java
+++ /dev/null
@@ -1,272 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-import org.openecomp.sdc.be.model.LifecycleStateEnum;
-import org.openecomp.sdc.be.model.category.CategoryDefinition;
-import org.openecomp.sdc.be.model.category.SubCategoryDefinition;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public abstract class ComponentReqDetails {
-
- protected String name;
- protected String description;
- protected List<String> tags = new ArrayList<>();
- protected String contactId;
- protected String icon;
- protected String uniqueId;
- protected String creatorUserId;
- protected String creatorFullName;
- protected String lastUpdaterUserId;
- protected String lastUpdaterFullName;
- protected Long creationDate;
- protected Long lastUpdateDate;
- protected LifecycleStateEnum lifecycleState;
- protected String version;
- protected String UUID;
- protected List<CategoryDefinition> categories;
- protected String projectCode;
- protected String csarUUID;
- protected String csarVersion;
- protected String importedToscaChecksum;
- protected String invariantUUID;
-
- public String getCsarVersion() {
- return csarVersion;
- }
-
- public void setCsarVersion(String csarVersion) {
- this.csarVersion = csarVersion;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- tags.add(name);
- }
-
- public List<String> getTags() {
- return tags;
- }
-
- public void setTags(List<String> tags) {
- this.tags = tags;
- }
-
- // public String getCategory() {
- // return category;
- // }
- //
- public String getContactId() {
- return contactId;
- }
-
- public void setContactId(String contactId) {
- this.contactId = contactId;
- }
-
- public String getIcon() {
- return icon;
- }
-
- public void setIcon(String icon) {
- this.icon = icon;
- }
-
- public String getUniqueId() {
- return uniqueId;
- }
-
- public void setUniqueId(String uniqueId) {
- this.uniqueId = uniqueId;
- }
-
- public void setCreatorUserId(String creatorUserId) {
- this.creatorUserId = creatorUserId;
- }
-
- public void setCreatorFullName(String creatorFullName) {
- this.creatorFullName = creatorFullName;
- }
-
- public void setLastUpdaterUserId(String lastUpdaterUserId) {
- this.lastUpdaterUserId = lastUpdaterUserId;
- }
-
- public void setLastUpdaterFullName(String lastUpdaterFullName) {
- this.lastUpdaterFullName = lastUpdaterFullName;
- }
-
- public void setCreationDate(Long creationDate) {
- this.creationDate = creationDate;
- }
-
- public void setLastUpdateDate(Long lastUpdateDate) {
- this.lastUpdateDate = lastUpdateDate;
- }
-
- public void setLifecycleState(LifecycleStateEnum lifecycleState) {
- this.lifecycleState = lifecycleState;
- }
-
- public void setUUID(String uUID) {
- this.UUID = uUID;
- }
-
- public String getCreatorUserId() {
- return creatorUserId;
- }
-
- public String getCreatorFullName() {
- return creatorFullName;
- }
-
- public String getLastUpdaterUserId() {
- return lastUpdaterUserId;
- }
-
- public String getLastUpdaterFullName() {
- return lastUpdaterFullName;
- }
-
- public Long getCreationDate() {
- return creationDate;
- }
-
- public Long getLastUpdateDate() {
- return lastUpdateDate;
- }
-
- public LifecycleStateEnum getLifecycleState() {
- return lifecycleState;
- }
-
- public String getUUID() {
- return UUID;
- }
-
- public String getVersion() {
- return version;
- }
-
- public void setVersion(String version) {
- this.version = version;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public List<CategoryDefinition> getCategories() {
- return categories;
- }
-
- public void setCategories(List<CategoryDefinition> categories) {
- this.categories = categories;
- }
-
- public void removeAllCategories() {
- this.categories = new ArrayList<>();
- }
-
- public void addCategoryChain(String category, String subCategory) {
- if (category != null || subCategory != null) {
- if (categories == null) {
- categories = new ArrayList<>();
- }
- CategoryDefinition selectedCategory = null;
- for (CategoryDefinition categoryDef : categories) {
- if (categoryDef.getName().equals(category)) {
- selectedCategory = categoryDef;
- }
- }
- if (selectedCategory == null) {
- selectedCategory = new CategoryDefinition();
- selectedCategory.setName(category);
- categories.add(selectedCategory);
- }
- if (subCategory != null) {
- List<SubCategoryDefinition> subcategories = selectedCategory.getSubcategories();
- if (subcategories == null) {
- subcategories = new ArrayList<>();
- selectedCategory.setSubcategories(subcategories);
- }
- SubCategoryDefinition selectedSubcategory = null;
- for (SubCategoryDefinition subcategory : subcategories) {
- if (subcategory.getName().equals(subCategory)) {
- selectedSubcategory = subcategory;
- }
- }
- if (selectedSubcategory == null) {
- selectedSubcategory = new SubCategoryDefinition();
- selectedSubcategory.setName(subCategory);
- subcategories.add(selectedSubcategory);
- }
- }
- }
- }
-
- public void addCategory(String category) {
- addCategoryChain(category, null);
- }
-
- public String getProjectCode() {
- return projectCode;
- }
-
- public void setProjectCode(String projectCode) {
- this.projectCode = projectCode;
- }
-
- public String getCsarUUID() {
- return csarUUID;
- }
-
- public void setCsarUUID(String csarUUID) {
- this.csarUUID = csarUUID;
- }
-
- public String getImportedToscaChecksum() {
- return importedToscaChecksum;
- }
-
- public void setImportedToscaChecksum(String importedToscaChecksum) {
- this.importedToscaChecksum = importedToscaChecksum;
- }
-
- public String getInvariantUUID() {
- return invariantUUID;
- }
-
- public void setInvariantUUID(String invariantUUID) {
- this.invariantUUID = invariantUUID;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CsarArtifacts.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CsarArtifacts.java
deleted file mode 100644
index f3379766e2..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CsarArtifacts.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-public class CsarArtifacts {
-
- private String artifactType;
- private String artifactName;
-
- public CsarArtifacts() {
- super();
- }
-
- public CsarArtifacts(String artifactName, String artifactType) {
- super();
- this.artifactName = artifactName;
- this.artifactType = artifactType;
- }
-
- @Override
- public String toString() {
- return "AssetStructure [artifactName=" + artifactName + ", artifactType=" + artifactType + "]";
- }
-
- public String getArtifactType() {
- return artifactType;
- }
-
- public void setArtifactType(String artifactType) {
- this.artifactType = artifactType;
- }
-
- public String getArtifactName() {
- return artifactName;
- }
-
- public void setArtifactName(String artifactName) {
- this.artifactName = artifactName;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/DistributionMonitorObject.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/DistributionMonitorObject.java
deleted file mode 100644
index 7dfbcd4c67..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/DistributionMonitorObject.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-public class DistributionMonitorObject {
-
- private String omfComponentID;
- private String timestamp;
- private String url;
- private String status;
- private String errorReason;
-
- public DistributionMonitorObject() {
- super();
- }
-
- public DistributionMonitorObject(String omfComponentID, String timestamp, String url, String status, String errorReason) {
- super();
- this.omfComponentID = omfComponentID;
- this.timestamp = timestamp;
- this.url = url;
- this.status = status;
- this.errorReason = errorReason;
- }
-
- public String getOmfComponentID() {
- return omfComponentID;
- }
-
- public void setOmfComponentID(String omfComponentID) {
- this.omfComponentID = omfComponentID;
- }
-
- public String getTimestamp() {
- return timestamp;
- }
-
- public void setTimestamp(String timestamp) {
- this.timestamp = timestamp;
- }
-
- public String getUrl() {
- return url;
- }
-
- public void setUrl(String url) {
- this.url = url;
- }
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
- public String getErrorReason() {
- return errorReason;
- }
-
- public void setErrorReason(String errorReason) {
- this.errorReason = errorReason;
- }
-
- @Override
- public String toString() {
- return "DistributionMonitorObject [omfComponentID=" + omfComponentID + ", timestamp=" + timestamp + ", url=" + url + ", status=" + status + ", errorReason=" + errorReason + "]";
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/GroupHeatMetaDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/GroupHeatMetaDefinition.java
deleted file mode 100644
index 5ebb2608b7..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/GroupHeatMetaDefinition.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class GroupHeatMetaDefinition {
-
- private int group = 0;
- private String groupName;
-
-// private List<String> artifactList = new ArrayList<String>();
- private List<HeatMetaFirstLevelDefinition> artifactList = new ArrayList<HeatMetaFirstLevelDefinition>();
- @Override
- public String toString() {
- return "GroupHeatMetaDefinition [group=" + group + ", artifactList=" + artifactList + ", artifactMap=" + artifactMap + ", propertyHeatMetaDefinition=" + propertyHeatMetaDefinition + "]";
- }
-
- public List<HeatMetaFirstLevelDefinition> getArtifactList() {
- return artifactList;
- }
-
- public void setArtifactList(List<HeatMetaFirstLevelDefinition> artifactList) {
- this.artifactList = artifactList;
- }
-
- private Map<String, String> artifactMap = new HashMap<>();
- PropertyHeatMetaDefinition propertyHeatMetaDefinition;
-
- public Map<String, String> getArtifactMap() {
- return artifactMap;
- }
-
- public void setArtifactMap(Map<String, String> artifactMap) {
- this.artifactMap = artifactMap;
- }
-
-
- public PropertyHeatMetaDefinition getPropertyHeatMetaDefinition() {
- return propertyHeatMetaDefinition;
- }
-
- public void setPropertyHeatMetaDefinition(PropertyHeatMetaDefinition propertyHeatMetaDefinition) {
- this.propertyHeatMetaDefinition = propertyHeatMetaDefinition;
- }
-
- public GroupHeatMetaDefinition() {
- super();
- }
-
- public int getGroup() {
- return group;
- }
-
- public void setGroup(int group) {
- this.group = group;
- }
-
- public String getGroupName() {
- return groupName;
- }
-
- public void setGroupName(String groupName) {
- this.groupName = groupName;
- }
-
- // public List<String> getArtifactList() {
-// return artifactList;
-// }
-//
-// public void setArtifactList(List<String> artifactList) {
-// this.artifactList = artifactList;
-// }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/HeatMetaFirstLevelDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/HeatMetaFirstLevelDefinition.java
deleted file mode 100644
index 88033024d5..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/HeatMetaFirstLevelDefinition.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-public class HeatMetaFirstLevelDefinition {
-
- public HeatMetaFirstLevelDefinition(String fileName, String type, String checkSum) {
- super();
- this.fileName = fileName;
- this.type = type;
- this.checkSum = checkSum;
-
- }
-
- private String fileName;
- private String type;
- private String checkSum;
-
- public HeatMetaFirstLevelDefinition() {
- super();
- }
-
- public String getFileName() {
- return fileName;
- }
-
- public void setFileName(String fileName) {
- this.fileName = fileName;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
-
- public String getCheckSum() {
- return checkSum;
- }
-
- public void setCheckSum(String checkSum) {
- this.checkSum = checkSum;
- }
-
- @Override
- public String toString() {
- return "HeatMetaFirstLevelDefinition [fileName=" + fileName + ", type=" + type + ", checkSum=" + checkSum + "]";
- }
-
-
-
-
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ImportReqDetails.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ImportReqDetails.java
deleted file mode 100644
index d877150ceb..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ImportReqDetails.java
+++ /dev/null
@@ -1,334 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.codehaus.jettison.json.JSONArray;
-import org.codehaus.jettison.json.JSONException;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.yaml.snakeyaml.Yaml;
-
-import java.io.*;
-import java.util.*;
-
-import static org.testng.AssertJUnit.*;
-
-public class ImportReqDetails extends ResourceReqDetails {
-
- private static final String CAPS = "capabilities";
- private String payloadName;
- private String payloadData;
-
- private Map<String, Object> requirements;
- private Map<String, Object> capabilities;
-
- private List<String> derivedList;
- private String derivedFromField;
-
- public ImportReqDetails(String resourceName, String description, List<String> tags, List<String> derivedFrom,
- String vendorName, String vendorRelease, String contactId, String icon) {
- super(resourceName, description, tags, null, derivedFrom, vendorName, vendorRelease, contactId, icon);
- }
-
- public ImportReqDetails(Resource resource, String payloadName, String payloadData){
- super(resource);
- this.payloadData = payloadData;
- this.payloadName = payloadName;
- }
-
- public String getPayloadName() {
- return payloadName;
- }
-
- public void setPayloadName(String payloadName) {
- this.payloadName = payloadName;
- }
-
- public String getPayloadData() {
- return payloadData;
- }
-
- public void setPayloadData(String payloadData) {
- this.payloadData = payloadData;
- }
-
- @Override
- public String toString() {
- return "ImportReqDetails [payloadName=" + payloadName + ", payloadData=" + payloadData + "]";
- }
-
- public void setReqirementsAndCapabilities(String path, String fileName, User user, String derivedFromSource) throws IOException, JSONException{
- setRequirements(path, fileName, user, derivedFromSource);
- setCapabilities(path, fileName, user, derivedFromSource);
- }
-
- public List<String> getDerivedList() {
- return derivedList;
- }
-
- public void setDerivedList(List<String> derivedList) {
- this.derivedList = derivedList;
- }
-
- public String getDerivedFromField() {
- return derivedFromField;
- }
-
- public void setDerivedFromField(String derivedFromField) {
- this.derivedFromField = derivedFromField;
- }
-
- public Map<String, Object> getRequirements() {
- return requirements;
- }
-
- public void setRequirements(String path, String fileName, User user, String derivedFromSource) throws IOException, JSONException {
- Map<String, Object> requirementsFromFile = getRequirementsMapFromFile(path + File.separator + fileName,
- toscaResourceName, "requirements");
- Map<String, Object> reqs = organizeRequirementsMap(requirementsFromFile);
- getDerivedReqCap(user, reqs, "requirements", derivedFromSource);
- this.requirements = reqs;
- }
-
- @SuppressWarnings("unchecked")
- private void getDerivedReqCap(User user, Map<String, Object> reqCapMap, String field, String derivedFromResource)
- throws IOException, JSONException {
-
- if (derivedFromResource == null) {
- derivedFromResource = "Root";
- }
-
- RestResponse rest = getResourceSource(user, derivedFromResource);
- Map<String, Object> parsedFieldFromResponseAsMap = ResponseParser.getJsonValueAsMap(rest, field);
- Iterator<String> iterator = parsedFieldFromResponseAsMap.keySet().iterator();
- Map<String, Object> convertListToMap = null;
- while (iterator.hasNext()) {
- String type = iterator.next();
- List<Object> lst = (List<Object>) parsedFieldFromResponseAsMap.get(type);
- convertListToMap = convertListToMap(lst);
-
- if (field.equals(CAPS)) {
- convertListToMap.replace("capabilitySources", derivedList);
- lst = new ArrayList<>(Arrays.asList(convertListToMap));
- }
-
- Object existingValue = reqCapMap.get(type);
- if (existingValue != null) {
- Map<String, Object> convertedExistingValue = convertListToMap((List<Object>) existingValue);
- if (convertedExistingValue.get("name").toString().equalsIgnoreCase(convertListToMap.get("name").toString())) {
- lst = new ArrayList<>(Arrays.asList(convertedExistingValue));
- } else {
- lst.add(convertedExistingValue);
- }
- }
-
- reqCapMap.put(type, lst);
- }
- }
-
- private RestResponse getResourceSource(User user, String source) throws IOException, JSONException {
- org.codehaus.jettison.json.JSONObject getResourceJSONObject = null;
- RestResponse rest = ResourceRestUtils.getResourceByNameAndVersion(user.getUserId(), source, "1.0");
- if (rest.getErrorCode().intValue() == 200) {
- JSONArray jArray = new JSONArray(rest.getResponse());
- for (int i = 0; i < jArray.length(); i++) {
- getResourceJSONObject = jArray.getJSONObject(i);
- String resourceType = getResourceJSONObject.get("resourceType").toString();
- if (!resourceType.equals("VF")) {
- rest.setResponse(getResourceJSONObject.toString());
- }
- }
- }
- return rest;
- }
-
- public Map<String, Object> getCapabilities() {
- return capabilities;
- }
-
- public void setCapabilities(String path, String fileName, User user, String derivedFromSource) throws IOException, JSONException {
- Map<String, Object> capabilitiesFromFile = getCapabilitiesMapFromFile(path + File.separator + fileName,
- toscaResourceName, CAPS);
- Map<String, Object> caps = organizeCapabilitiesMap(capabilitiesFromFile);
- getDerivedReqCap(user, caps, CAPS, derivedFromSource);
- this.capabilities = caps;
- }
-
- @SuppressWarnings("unchecked")
- private Map<String, Object> organizeCapabilitiesMap(Map<String, Object> capabilitiesFromFile) {
- Iterator<String> iterator = capabilitiesFromFile.keySet().iterator();
- Map<String, Object> capMap = new HashMap<>();
- while (iterator.hasNext()) {
- List<Object> valueList = new ArrayList<>();
- String next = iterator.next();
- Map<String, Object> valuesMap = (Map<String, Object>) capabilitiesFromFile.get(next);
- String key = valuesMap.remove("type").toString();
- valuesMap.put("name", next);
- valuesMap.put("capabilitySources", derivedList);
- valuesMap.put("type", key);
-
- if (!valuesMap.containsKey("occurrences")) {
- valuesMap.put("minOccurrences", "1");
- valuesMap.put("maxOccurrences", "UNBOUNDED");
- }
-
- Object tempValue = capMap.get(key);
- if (tempValue == null) {
- valueList.add(valuesMap);
- } else {
- Map<String, Object> convertValue = convertListToMap((List<Object>) tempValue);
- valueList = new ArrayList<>(Arrays.asList(convertValue, valuesMap));
- }
- capMap.put(key, valueList);
- }
- return capMap;
- }
-
- @SuppressWarnings("unchecked")
- private Map<String, Object> getCapabilitiesMapFromFile(String fileName, String toscaResourceName,
- String fieldToTest) throws FileNotFoundException {
- Map<String, Object> resourceToscaMap = getToscaResourceFromFile(fileName, toscaResourceName);
- Object capMap = resourceToscaMap.get(fieldToTest);
- if (capMap == null) {
- return new HashMap<>();
- }
- return (Map<String, Object>) capMap;
- }
-
- @SuppressWarnings("unchecked")
- private Map<String, Object> organizeRequirementsMap(Map<String, Object> requirementsFromFile) {
- Map<String, Object> reqMap = new HashMap<>();
- List<Object> valueList = new ArrayList<>();
- Iterator<String> iterator = requirementsFromFile.keySet().iterator();
- while (iterator.hasNext()) {
- String key = iterator.next();
- Map<String, Object> valuesMap = (Map<String, Object>) requirementsFromFile.get(key);
- valuesMap.put("name", key);
- String capability = valuesMap.get("capability").toString();
-
- List<Object> occurencesList = (List<Object>) valuesMap.remove("occurrences");
- if (occurencesList != null) {
- valuesMap.put("minOccurrences", occurencesList.get(0).toString());
- valuesMap.put("maxOccurrences", occurencesList.get(1).toString());
- }
-
- valueList.add(valuesMap);
- reqMap.put(capability, valueList);
- }
-
- return reqMap;
- }
-
- @SuppressWarnings("unchecked")
- private Map<String, Object> getRequirementsMapFromFile(String fileName, String toscaResourceName,
- String fieldToTest) throws FileNotFoundException {
- Map<String, Object> resourceToscaMap = getToscaResourceFromFile(fileName, toscaResourceName);
- List<Object> reqListFromFile = (List<Object>) resourceToscaMap.get(fieldToTest);
- if (reqListFromFile == null) {
- return new HashMap<>();
- }
- return convertListToMap(reqListFromFile);
- }
-
- @SuppressWarnings("unchecked")
- private Map<String, Object> getToscaResourceFromFile(String fullFileName, String toscaResourceName) throws FileNotFoundException{
- Map<String, Object> nodesTypesMap = getNodesTypesMapFromFile(fullFileName);
- Map<String, Object> resourceToscaMap = (Map<String, Object>) nodesTypesMap.get(toscaResourceName);
-
- derivedFromField = resourceToscaMap.get("derived_from").toString();
-
- return resourceToscaMap;
- }
-
- @SuppressWarnings("unchecked")
- private Map<String, Object> getNodesTypesMapFromFile(String fullFileName) throws FileNotFoundException {
- Yaml yaml = new Yaml();
- File file = new File(fullFileName);
- InputStream inputStream = new FileInputStream(file);
- Map<?, ?> mapFromFile = (Map<?, ?>) yaml.load(inputStream);
- return (Map<String, Object>) mapFromFile.get("node_types");
- }
-
- @SuppressWarnings("unchecked")
- private Map<String, Object> convertListToMap(List<Object> testedListFromFile) {
- Map<String, Object> testedMapFromFile = new HashMap<>();
- for (int i = 0; i < testedListFromFile.size(); i++) {
- Object req = testedListFromFile.get(i);
- ObjectMapper m = new ObjectMapper();
- Map<? extends String, ? extends String> mappedObject = m.convertValue(req, Map.class);
- testedMapFromFile.putAll(mappedObject);
- }
- return testedMapFromFile;
- }
-
- @SuppressWarnings("unchecked")
- public void compareRequirementsOrCapabilities(Map<String, Object> exepectedReq, Map<String, Object> actualReq) {
- Iterator<String> iterator = exepectedReq.keySet().iterator();
- while (iterator.hasNext()) {
- String key = iterator.next();
- List<Object> expectedValues = (List<Object>) exepectedReq.get(key);
- List<Object> actualValues = (List<Object>) actualReq.get(key);
- assertNotNull(actualValues);
-
- List<Map<String, Object>> expectedMapsList = convertListToMapList(expectedValues);
- List<Map<String, Object>> actualMapsList = convertListToMapList(actualValues);
- assertEquals(expectedMapsList.size(), actualMapsList.size());
-
- for (int i = 0; i < expectedMapsList.size(); i++) {
- Map<String, Object> expectedMap = expectedMapsList.get(i);
- Map<String, Object> actualdMap = actualMapsList.get(i);
- if (expectedMap.get("name").equals(actualdMap.get("name"))) {
- Iterator<String> iterator2 = expectedMap.keySet().iterator();
- while (iterator2.hasNext()) {
- String innerKey = iterator2.next();
- assertTrue(
- "check " + innerKey + " in " + key + ":\nexpected: "
- + expectedMap.get(innerKey).toString() + "\nactual: "
- + actualdMap.get(innerKey).toString(),
- expectedMap.get(innerKey).equals(actualdMap.get(innerKey)));
-
- }
-
- }
- }
- }
- }
-
- @SuppressWarnings("unchecked")
- private List<Map<String, Object>> convertListToMapList(List<Object> testedListFromFile) {
- List<Map<String, Object>> listOfMaps = new ArrayList<>();
- for (int i = 0; i < testedListFromFile.size(); i++) {
- Object req = testedListFromFile.get(i);
- ObjectMapper m = new ObjectMapper();
- Map<? extends String, ? extends String> mappedObject = m.convertValue(req, Map.class);
- mappedObject.remove("uniqueId");
- Map<String, Object> testedMapFromFile = new HashMap<>();
- testedMapFromFile.putAll(mappedObject);
- listOfMaps.add(testedMapFromFile);
- }
- return listOfMaps;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/LicensingData.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/LicensingData.java
deleted file mode 100644
index 788d609f7d..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/LicensingData.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-import java.util.List;
-
-public class LicensingData {
- private String licenseAgreement;
- private List<String> featureGroups = null;
-
- public LicensingData() {
- }
-
- public LicensingData(String licenseAgreement, List<String> featureGroups) {
- this.licenseAgreement = licenseAgreement;
- this.featureGroups = featureGroups;
- }
-
- public String getLicenseAgreement() {
- return licenseAgreement;
- }
-
- public void setLicenseAgreement(String licenseAgreement) {
- this.licenseAgreement = licenseAgreement;
- }
-
- public List<String> getFeatureGroups() {
- return featureGroups;
- }
-
- public void setFeatureGroups(List<String> featureGroups) {
- this.featureGroups = featureGroups;
- }
-
- @Override
- public String toString() {
- return "LicensingData{" +
- "licenseAgreement='" + licenseAgreement + '\'' +
- ", featureGroups=" + featureGroups +
- '}';
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/LicensingVersion.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/LicensingVersion.java
deleted file mode 100644
index 073bdacce5..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/LicensingVersion.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-public class LicensingVersion {
-
- private String id;
- private String label;
-
- public LicensingVersion(String id, String label) {
- this.id = id;
- this.label = label;
- }
-
- public LicensingVersion() {
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- @Override
- public String toString() {
- return "LicensingVersion{" +
- "id='" + id + '\'' +
- ", label='" + label + '\'' +
- '}';
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ProductReqDetails.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ProductReqDetails.java
deleted file mode 100644
index 61d923e6c4..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ProductReqDetails.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-import org.openecomp.sdc.be.model.category.CategoryDefinition;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class ProductReqDetails extends ComponentReqDetails {
-
- private String fullName;
- private List<String> contacts;
- private String isActive;
-
- public ProductReqDetails(String name, List<CategoryDefinition> category) {
- this.categories = category;
- this.name = name;
- }
-
- public ProductReqDetails(String name) {
- this.name = name;
- }
-
- public void addCategory(CategoryDefinition category) {
- if (categories == null) {
- categories = new ArrayList<>();
- }
- categories.add(category);
- }
-
- public void addContact(String contactUserId) {
- if (contacts == null) {
- contacts = new ArrayList<>();
- }
- contacts.add(contactUserId);
- }
-
- public List<String> getContacts() {
- return contacts;
- }
-
- public void setContacts(List<String> contacts) {
- this.contacts = contacts;
- }
-
- public List<CategoryDefinition> getCategories() {
- return categories;
- }
-
- public void setCategories(List<CategoryDefinition> categories) {
- this.categories = categories;
- }
-
- public String getFullName() {
- return fullName;
- }
-
- public void setFullName(String fullName) {
- this.fullName = fullName;
- }
-
- public String getActive() {
- return isActive;
- }
-
- public void setActive(String isActive) {
- this.isActive = isActive;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PropertyHeatMetaDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PropertyHeatMetaDefinition.java
deleted file mode 100644
index 5c9083d757..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PropertyHeatMetaDefinition.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-public class PropertyHeatMetaDefinition {
-
- String name;
- boolean value;
-
- public PropertyHeatMetaDefinition() {
- super();
- }
-
-
-
- public String getName() {
- return name;
- }
-
-
-
- public void setName(String name) {
- this.name = name;
- }
-
-
-
- public boolean getValue() {
- return value;
- }
-
-
-
- public void setValue(boolean value) {
- this.value = value;
- }
-
-
-
- @Override
- public String toString() {
- return "PropertyHeatMetaDefinition [name=" + name + ", value=" + value + "]";
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PropertyObject.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PropertyObject.java
deleted file mode 100644
index b969d4d6a1..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PropertyObject.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class PropertyObject {
-
- private String defaultValue;
- private String name;
- private String parentUniqueId;
- private boolean password;
- private boolean required;
- private List<Schema> Schema;
- private String type;
- private String uniqueId;
- private boolean definition;
- private Object value = null;
-
-
- public PropertyObject() {
- }
-
- public Object getValue() {
- return value;
- }
-
- public void setValue(Object value) {
- this.value = value;
- }
-
- public PropertyObject(String defaultValue, String name, String parentUniqueId, String uniqueId) {
- this.defaultValue = defaultValue;
- this.name = name;
- this.parentUniqueId = parentUniqueId;
- this.uniqueId = uniqueId;
- this.password = false;
- this.required = false;
- this.type = "String";
- this.definition = false;
- this.Schema = new ArrayList<Schema>();
- }
-
- public String getDefaultValue() {
- return defaultValue;
- }
-
- public void setDefaultValue(String defaultValue) {
- this.defaultValue = defaultValue;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getParentUniqueId() {
- return parentUniqueId;
- }
-
- public void setParentUniqueId(String parentUniqueId) {
- this.parentUniqueId = parentUniqueId;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getUniqueId() {
- return uniqueId;
- }
-
- public void setUniqueId(String uniqueId) {
- this.uniqueId = uniqueId;
- }
-}
-
-class Schema {
-
- private List<Property> property;
-}
-
-class Property {}
-
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PropertyReqDetails.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PropertyReqDetails.java
deleted file mode 100644
index 64086884fa..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PropertyReqDetails.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-import org.openecomp.sdc.be.datatypes.elements.SchemaDefinition;
-
-public class PropertyReqDetails {
-
- String name;
- String type;
- Boolean required = false;
- String defaultValue;
- String description;
- String propertyRangeMin;
- String propertyRangeMax;
- Boolean isPassword = false;
- SchemaDefinition schema;
- String uniqueId;
- String parentUniqueId;
- String value;
-
- public PropertyReqDetails() {
- super();
- }
-
- public PropertyReqDetails(String propertyName, String propertyType, Boolean propertyRequired,
- String propertyDefaultValue, String propertyDescription, String propertyRangeMin,
- String propertyRangeMax,
- Boolean propertyPassword) {
- super();
- this.name = propertyName;
- this.type = propertyType;
- this.required = propertyRequired;
- this.defaultValue = propertyDefaultValue;
- this.description = propertyDescription;
- this.propertyRangeMin = propertyRangeMin;
- this.propertyRangeMax = propertyRangeMax;
- this.isPassword = propertyPassword;
- }
-
- public PropertyReqDetails(String propertyName, String propertyType, String propertyDefaultValue,
- String propertyDescription, SchemaDefinition schema) {
- super();
- this.name = propertyName;
- this.type = propertyType;
- this.defaultValue = propertyDefaultValue;
- this.description = propertyDescription;
- this.schema = schema;
- }
-
- public SchemaDefinition getSchema() {
- return schema;
- }
-
- public void setSchema(SchemaDefinition schema) {
- this.schema = schema;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String propertyName) {
- this.name = propertyName;
- }
-
- public String getPropertyType() {
- return type;
- }
-
- public void setPropertyType(String propertyType) {
- this.type = propertyType;
- }
-
- public Boolean getPropertyRequired() {
- return required;
- }
-
- public void setPropertyRequired(Boolean propertyRequired) {
- this.required = propertyRequired;
- }
-
- public String getPropertyDefaultValue() {
- return defaultValue;
- }
-
- public void setPropertyDefaultValue(String propertyDefaultValue) {
- this.defaultValue = propertyDefaultValue;
- }
-
- public String getPropertyDescription() {
- return description;
- }
-
- public void setPropertyDescription(String propertyDescription) {
- this.description = propertyDescription;
- }
-
- public String getPropertyRangeMin() {
- return propertyRangeMin;
- }
-
- public void setPropertyRangeMin(String propertyRangeMin) {
- this.propertyRangeMin = propertyRangeMin;
- }
-
- public String getPropertyRangeMax() {
- return propertyRangeMax;
- }
-
- public void setPropertyRangeMax(String propertyRangeMax) {
- this.propertyRangeMax = propertyRangeMax;
- }
-
- public Boolean getPropertyPassword() {
- return isPassword;
- }
-
- public void setPropertyPassword(Boolean propertyPassword) {
- this.isPassword = propertyPassword;
- }
-
- public String getUniqueId() {
- return uniqueId;
- }
-
- public void setUniqueId(String uniqueId) {
- this.uniqueId = uniqueId;
- }
-
- public String getParentUniqueId() {
- return parentUniqueId;
- }
-
- public void setParentUniqueId(String parentUniqueId) {
- this.parentUniqueId = parentUniqueId;
- }
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-
- public String propertyToJsonString() {
- String jsonString;
- jsonString =
- "{\"" + this.getName() + "\":{" + "\"name\":\"" + this.getName() + "\"," + "\"type\":\"" + this
- .getPropertyType() + "\"," + "\"required\":"
- + this.getPropertyRequired() + "," + "\"defaultValue\":\"" + this.getPropertyDefaultValue()
- + "\","
- + "\"description\":\"" + this.getPropertyDescription() + "\","
- + "\"constraints\":[{\"inRange\":[\""
- + this.getPropertyRangeMin() + "\",\"" + this.getPropertyRangeMax() + "\"]}],"
- + "\"isPassword\":"
- + this.getPropertyPassword() + "}}";
- return jsonString;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/RequirementDetails.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/RequirementDetails.java
deleted file mode 100644
index a720786d83..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/RequirementDetails.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright © 2016-2018 European Support Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-public class RequirementDetails {
- private String capability;
- private String name;
- private String node;
- private String relationship;
- private String maxOccurrences;
- private String minOccurrences;
-
- public String getCapability() {
- return capability;
- }
-
- public void setCapability(String capability) {
- this.capability = capability;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getNode() {
- return node;
- }
-
- public void setNode(String node) {
- this.node = node;
- }
-
- public String getRelationship() {
- return relationship;
- }
-
- public void setRelationship(String relationship) {
- this.relationship = relationship;
- }
-
- public String getMaxOccurrences() {
- return maxOccurrences;
- }
-
- public void setMaxOccurrences(String maxOccurrences) {
- this.maxOccurrences = maxOccurrences;
- }
-
- public String getMinOccurrences() {
- return minOccurrences;
- }
-
- public void setMinOccurrences(String minOccurrences) {
- this.minOccurrences = minOccurrences;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceAssetStructure.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceAssetStructure.java
deleted file mode 100644
index 62f5e0c8f0..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceAssetStructure.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-public class ResourceAssetStructure extends AssetStructure {
-
- private String subCategory;
- private String resourceType;
- protected String lastUpdaterFullName;
- protected String toscaResourceName;
-
- public ResourceAssetStructure() {
- super();
- }
-
- public ResourceAssetStructure(String uuid, String invariantUUID, String name, String version, String toscaModelURL,
- String category, String lifecycleState, String lastUpdaterUserId) {
- super(uuid, invariantUUID, name, version, toscaModelURL, category, lifecycleState, lastUpdaterUserId);
- }
-
- @Override
- public String toString() {
- return "ResourceAssetStructure [subCategory=" + subCategory + ", resourceType=" + resourceType + "]";
- }
-
- public String getLastUpdaterFullName() {
- return lastUpdaterFullName;
- }
-
- public void setLastUpdaterFullName(String lastUpdaterFullName) {
- this.lastUpdaterFullName = lastUpdaterFullName;
- }
-
- public String getToscaResourceName() {
- return toscaResourceName;
- }
-
- public void setToscaResourceName(String toscaResourceName) {
- this.toscaResourceName = toscaResourceName;
- }
-
- public String getSubCategory() {
- return subCategory;
- }
-
- public void setSubCategory(String subCategory) {
- this.subCategory = subCategory;
- }
-
- public String getResourceType() {
- return resourceType;
- }
-
- public void setResourceType(String resourceType) {
- this.resourceType = resourceType;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceDetailedAssetStructure.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceDetailedAssetStructure.java
deleted file mode 100644
index b521b4bf08..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceDetailedAssetStructure.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-import java.util.List;
-
-public class ResourceDetailedAssetStructure extends ResourceAssetStructure {
-
- private List<ResourceInstanceAssetStructure> resources;
- private List<ArtifactAssetStructure> artifacts;
-
- public ResourceDetailedAssetStructure() {
- super();
- }
-
- public ResourceDetailedAssetStructure(String lastUpdaterFullName, String toscaResourceName,
- List<ResourceInstanceAssetStructure> resources, List<ArtifactAssetStructure> artifacts) {
- super();
- this.lastUpdaterFullName = lastUpdaterFullName;
- this.toscaResourceName = toscaResourceName;
- this.resources = resources;
- this.artifacts = artifacts;
- }
-
- public List<ResourceInstanceAssetStructure> getResources() {
- return resources;
- }
-
- public void setResources(List<ResourceInstanceAssetStructure> resources) {
- this.resources = resources;
- }
-
- public List<ArtifactAssetStructure> getArtifacts() {
- return artifacts;
- }
-
- public void setArtifacts(List<ArtifactAssetStructure> artifacts) {
- this.artifacts = artifacts;
- }
-
- @Override
- public String toString() {
- return "ResourceDetailedAssetStructure [lastUpdaterFullName=" + lastUpdaterFullName + ", toscaResourceName="
- + toscaResourceName + ", resources=" + resources + ", artifacts=" + artifacts + ", toString()="
- + super.toString() + ", getSubCategory()=" + getSubCategory() + ", getResourceType()="
- + getResourceType() + ", getUuid()=" + getUuid() + ", getInvariantUUID()=" + getInvariantUUID()
- + ", getName()=" + getName() + ", getVersion()=" + getVersion() + ", getToscaModelURL()="
- + getToscaModelURL() + ", getCategory()=" + getCategory() + ", getLifecycleState()="
- + getLifecycleState() + ", getLastUpdaterUserId()=" + getLastUpdaterUserId() + ", getClass()="
- + getClass() + ", hashCode()=" + hashCode() + "]";
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceExternalReqDetails.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceExternalReqDetails.java
deleted file mode 100644
index 5a968fdcd4..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceExternalReqDetails.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-
-import java.util.List;
-
-public class ResourceExternalReqDetails extends ComponentReqDetails {
- String vendorName;
- String vendorRelease;
- String category;
- String subcategory;
-
- private String resourceType = ResourceTypeEnum.VFC.toString(); // Default
- // value
- public ResourceExternalReqDetails() {
- super();
- }
-
-
- public ResourceExternalReqDetails(String resourceName, String description, List<String> tags,
- String vendorName, String vendorRelease, String contactId, String icon,
- String resourceType, String resourceCategory, String resourceSubcategory) {
- super();
- this.resourceType = resourceType;
- this.name = resourceName;
- this.description = description;
- this.tags = tags;
- this.vendorName = vendorName;
- this.vendorRelease = vendorRelease;
- this.contactId = contactId;
- this.icon = icon;
- this.category = resourceCategory;
- this.subcategory = resourceSubcategory;
- }
-
- public String getVendorName() {
- return vendorName;
- }
-
- public void setVendorName(String vendorName) {
- this.vendorName = vendorName;
- }
-
- public String getVendorRelease() {
- return vendorRelease;
- }
-
- public void setVendorRelease(String vendorRelease) {
- this.vendorRelease = vendorRelease;
- }
-
- public String getResourceType() {
- return resourceType;
- }
-
- public void setResourceType(String resourceType) {
- this.resourceType = resourceType;
- }
-
- public String getCategory() {
- return category;
- }
-
- public void setCategory(String category) {
- this.category = category;
- }
-
- public String getSubcategory() {
- return subcategory;
- }
-
- public void setSubcategory(String subcategory) {
- this.subcategory = subcategory;
- }
-
-
- @Override
- public String toString() {
- return "ResourceReqDetails [name=" + name + ", vendorName=" + vendorName
- + ", vendorRelease=" + vendorRelease + ", version=" + version
- + ", resourceType=" + resourceType + ", category=" + category + ", subcategory=" + subcategory +"]";
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceInstanceAssetStructure.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceInstanceAssetStructure.java
deleted file mode 100644
index 6a69120a05..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceInstanceAssetStructure.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-import java.util.List;
-
-public class ResourceInstanceAssetStructure {
-
- String resourceInstanceName;
- String resourceName;
- String resourceInvariantUUID;
- String resourceVersion;
- String resoucreType;
- String resourceUUID;
- List<ArtifactAssetStructure> artifacts;
-
- public ResourceInstanceAssetStructure() {
- super();
- }
-
- public ResourceInstanceAssetStructure(String resourceInstanceName, String resourceName,
- String resourceInvariantUUID, String resourceVersion, String resoucreType, String resourceUUID,
- List<ArtifactAssetStructure> artifacts) {
- super();
- this.resourceInstanceName = resourceInstanceName;
- this.resourceName = resourceName;
- this.resourceInvariantUUID = resourceInvariantUUID;
- this.resourceVersion = resourceVersion;
- this.resoucreType = resoucreType;
- this.resourceUUID = resourceUUID;
- this.artifacts = artifacts;
- }
-
- public String getResourceInstanceName() {
- return resourceInstanceName;
- }
-
- public void setResourceInstanceName(String resourceInstanceName) {
- this.resourceInstanceName = resourceInstanceName;
- }
-
- public String getResourceName() {
- return resourceName;
- }
-
- public void setResourceName(String resourceName) {
- this.resourceName = resourceName;
- }
-
- public String getResourceInvariantUUID() {
- return resourceInvariantUUID;
- }
-
- public void setResourceInvariantUUID(String resourceInvariantUUID) {
- this.resourceInvariantUUID = resourceInvariantUUID;
- }
-
- public String getResourceVersion() {
- return resourceVersion;
- }
-
- public void setResourceVersion(String resourceVersion) {
- this.resourceVersion = resourceVersion;
- }
-
- public String getResoucreType() {
- return resoucreType;
- }
-
- public void setResoucreType(String resoucreType) {
- this.resoucreType = resoucreType;
- }
-
- public String getResourceUUID() {
- return resourceUUID;
- }
-
- public void setResourceUUID(String resourceUUID) {
- this.resourceUUID = resourceUUID;
- }
-
- public List<ArtifactAssetStructure> getArtifacts() {
- return artifacts;
- }
-
- public void setArtifacts(List<ArtifactAssetStructure> artifacts) {
- this.artifacts = artifacts;
- }
-
- @Override
- public String toString() {
- return "ResourceInstanceAssetStructure [resourceInstanceName=" + resourceInstanceName + ", resourceName="
- + resourceName + ", resourceInvariantUUID=" + resourceInvariantUUID + ", resourceVersion="
- + resourceVersion + ", resoucreType=" + resoucreType + ", resourceUUID=" + resourceUUID + ", artifacts="
- + artifacts + "]";
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceReqDetails.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceReqDetails.java
deleted file mode 100644
index cfb7845c63..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceReqDetails.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.Resource;
-
-import java.util.List;
-
-public class ResourceReqDetails extends ComponentReqDetails {
- List<String> derivedFrom;
- String vendorName;
- String vendorRelease;
- String componentType = "RESOURCE";
-
- public String getComponentType() {
- return componentType;
- }
- // Unsettable/unupdatable fields
-
- Boolean isAbstract;
- Boolean isHighestVersion;
- String cost;
-
- String licenseType;
- String toscaResourceName;
- String resourceVendorModelNumber;
-
- private String resourceType = ResourceTypeEnum.VFC.toString(); // Default
- // value
-
- public ResourceReqDetails() {
- super();
- }
-
- public ResourceReqDetails(List<String> derivedFrom, String vendorName, String vendorRelease, Boolean isAbstract, Boolean isHighestVersion, String cost, String licenseType, String toscaResourceName, String resourceVendorModelNumber,
- String resourceType) {
- super();
- this.derivedFrom = derivedFrom;
- this.vendorName = vendorName;
- this.vendorRelease = vendorRelease;
- this.isAbstract = isAbstract;
- this.isHighestVersion = isHighestVersion;
- this.cost = cost;
- this.licenseType = licenseType;
- this.toscaResourceName = toscaResourceName;
- this.resourceVendorModelNumber = resourceVendorModelNumber;
- this.resourceType = resourceType;
- }
-
- public ResourceReqDetails(Resource resource) {
- super();
- this.resourceType = resource.getResourceType().toString();
- this.name = resource.getName();
- this.description = resource.getDescription();
- this.tags = resource.getTags();
- this.derivedFrom = resource.getDerivedFrom();
- this.vendorName = resource.getVendorName();
- this.vendorRelease = resource.getVendorRelease();
- this.contactId = resource.getContactId();
- this.icon = resource.getIcon();
- this.toscaResourceName = resource.getToscaResourceName();
- this.uniqueId = resource.getUniqueId();
- this.creatorUserId = resource.getCreatorUserId();
- this.creatorFullName = resource.getCreatorFullName();
- this.lastUpdaterUserId = resource.getLastUpdaterUserId();
- this.lastUpdaterFullName = resource.getLastUpdaterFullName();
- this.lifecycleState = resource.getLifecycleState();
- this.version = resource.getVersion();
- this.UUID = resource.getUUID();
- this.categories = resource.getCategories();
- this.importedToscaChecksum = resource.getImportedToscaChecksum();
- this.resourceVendorModelNumber = resource.getResourceVendorModelNumber();
-
- }
-
- public ResourceReqDetails(String resourceName, String description, List<String> tags, String category,
- List<String> derivedFrom, String vendorName, String vendorRelease, String contactId, String icon) {
- this(resourceName, description, tags, category, derivedFrom, vendorName, vendorRelease, contactId, icon,
- ResourceTypeEnum.VFC.toString());
- }
-
- public ResourceReqDetails(String resourceName, String description, List<String> tags, String category,
- List<String> derivedFrom, String vendorName, String vendorRelease, String contactId, String icon,
- String resourceType) {
- super();
- this.resourceType = resourceType;
- this.name = resourceName;
- this.description = description;
- this.tags = tags;
- this.derivedFrom = derivedFrom;
- this.vendorName = vendorName;
- this.vendorRelease = vendorRelease;
- this.contactId = contactId;
- this.icon = icon;
- if (category != null) {
- String[] arr = category.split("/");
- if (arr.length == 2) {
- addCategoryChain(arr[0], arr[1]);
- }
- }
- this.toscaResourceName = resourceName;
- }
-
- public ResourceReqDetails(ResourceReqDetails originalResource, String version) {
- super();
- this.name = originalResource.getName();
- this.description = originalResource.getDescription();
- this.tags = originalResource.getTags();
- this.derivedFrom = originalResource.getDerivedFrom();
- this.vendorName = originalResource.getVendorName();
- this.vendorRelease = originalResource.getVendorRelease();
- this.contactId = originalResource.getContactId();
- this.icon = originalResource.getIcon();
- this.version = version;
- this.uniqueId = originalResource.getUniqueId();
- this.categories = originalResource.getCategories();
- this.toscaResourceName = originalResource.getToscaResourceName();
- this.resourceType = originalResource.getResourceType();
- }
-
- public ResourceReqDetails(String resourceName, List<String> derivedFrom, String vendorName, String vendorRelease,
- String resourceVersion, Boolean isAbstract, Boolean isHighestVersion, String cost, String licenseType,
- String resourceType) {
- super();
- this.name = resourceName;
- this.derivedFrom = derivedFrom;
- this.vendorName = vendorName;
- this.vendorRelease = vendorRelease;
- this.version = resourceVersion;
- this.isAbstract = isAbstract;
- this.isHighestVersion = isHighestVersion;
- this.cost = cost;
- this.licenseType = licenseType;
- this.resourceType = resourceType;
- this.toscaResourceName = resourceName;
- }
-
- public String getResourceVendorModelNumber() {
- return resourceVendorModelNumber;
- }
-
- public void setResourceVendorModelNumber(String resourceVendorModelNumber) {
- this.resourceVendorModelNumber = resourceVendorModelNumber;
- }
- public String getToscaResourceName() {
- return toscaResourceName;
- }
-
- public void setToscaResourceName(String toscaResourceName) {
- this.toscaResourceName = toscaResourceName;
- }
-
- public List<String> getDerivedFrom() {
- return derivedFrom;
- }
-
- public void setDerivedFrom(List<String> derivedFrom) {
- this.derivedFrom = derivedFrom;
- }
-
- public String getVendorName() {
- return vendorName;
- }
-
- public void setVendorName(String vendorName) {
- this.vendorName = vendorName;
- }
-
- public String getVendorRelease() {
- return vendorRelease;
- }
-
- public void setVendorRelease(String vendorRelease) {
- this.vendorRelease = vendorRelease;
- }
-
- public String getCost() {
- return cost;
- }
-
- public void setCost(String cost) {
- this.cost = cost;
- }
-
- public String getLicenseType() {
- return licenseType;
- }
-
- public void setLicenseType(String licenseType) {
- this.licenseType = licenseType;
- }
-
- // Unupdatable fields - to check that they are not updated
- public void setIsAbstract(Boolean isAbstract) {
- this.isAbstract = isAbstract;
- }
-
- public void setIsHighestVersion(Boolean isHighestVersion) {
- this.isHighestVersion = isHighestVersion;
- }
-
- public Boolean getIsAbstract() {
- return isAbstract;
- }
-
- public Boolean getIsHighestVersion() {
- return isHighestVersion;
- }
-
- public String getResourceType() {
- return resourceType;
- }
-
- public void setResourceType(String resourceType) {
- this.resourceType = resourceType;
- }
-
- @Override
- public String toString() {
- return "ResourceReqDetails [name=" + name + ", derivedFrom=" + derivedFrom + ", vendorName=" + vendorName
- + ", vendorRelease=" + vendorRelease + ", version=" + version + ", isAbstract=" + isAbstract
- + ", isHighestVersion=" + isHighestVersion + ", cost=" + cost + ", licenseType=" + licenseType
- + ", resourceType=" + resourceType + "]";
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceRespJavaObject.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceRespJavaObject.java
deleted file mode 100644
index 78408bd3ed..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceRespJavaObject.java
+++ /dev/null
@@ -1,368 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-import org.openecomp.sdc.be.model.category.CategoryDefinition;
-
-import java.util.List;
-
-public class ResourceRespJavaObject {
- String uniqueId;
- String name;
- String version;
- String creatorUserId;
- String creatorFullName;
- String lastUpdaterUserId;
- String lastUpdaterFullName;
- String description;
- String icon;
- List<String> tags;
- String isHighestVersion;
- String creationDate;
- String lastUpdateDate;
- // String category;
- String lifecycleState;
- List<String> derivedFrom;
- String vendorName;
- String vendorRelease;
- String contactId;
- String abstractt;
- String highestVersion;
- List<String> artifacts;
- List<String> interfaces;
- String uuid;
- String cost;
- String licenseType;
- String resourceType;
- List<CategoryDefinition> categories;
-
- public String getResourceType() {
- return resourceType;
- }
-
- public void setResourceType(String resourceType) {
- this.resourceType = resourceType;
- }
-
- public ResourceRespJavaObject(String uniqueId, String resourceName, String resourceVersion, String creatorUserId,
- String creatorFullName, String lastUpdaterUserId, String lastUpdaterFullName, String description,
- String icon, List<String> tags, String isHighestVersion, String creationDate, String lastUpdateDate,
- String category, String lifecycleState, List<String> derivedFrom, String vendorName, String vendorRelease,
- String contactId, String abstractt, String highestVersion, List<String> artifacts, List<String> interfaces,
- String uuid, String cost, String licenseType, String resourceType) {
- super();
- this.uniqueId = uniqueId;
- this.name = resourceName;
- this.version = resourceVersion;
- this.creatorUserId = creatorUserId;
- this.creatorFullName = creatorFullName;
- this.lastUpdaterUserId = lastUpdaterUserId;
- this.lastUpdaterFullName = lastUpdaterFullName;
- this.description = description;
- this.icon = icon;
- this.tags = tags;
- this.isHighestVersion = isHighestVersion;
- this.creationDate = creationDate;
- this.lastUpdateDate = lastUpdateDate;
- // this.category = category;
- this.lifecycleState = lifecycleState;
- this.derivedFrom = derivedFrom;
- this.vendorName = vendorName;
- this.vendorRelease = vendorRelease;
- this.contactId = contactId;
- this.abstractt = abstractt;
- this.highestVersion = highestVersion;
- this.artifacts = artifacts;
- this.interfaces = interfaces;
- this.uuid = uuid;
- this.cost = cost;
- this.licenseType = licenseType;
- this.resourceType = resourceType;
- }
-
- public void setUuid(String uuid) {
- this.uuid = uuid;
- }
-
- public String getCost() {
- return cost;
- }
-
- public void setCost(String cost) {
- this.cost = cost;
- }
-
- public String getLicenseType() {
- return licenseType;
- }
-
- public void setLicenseType(String licenseType) {
- this.licenseType = licenseType;
- }
-
- public String getUuid() {
- return uuid;
- }
-
- public String setUuid() {
- return uuid;
- }
-
- public List<String> getInterfaces() {
- return interfaces;
- }
-
- public void setInterfaces(List<String> interfaces) {
- this.interfaces = interfaces;
- }
-
- public List<String> getArtifacts() {
- return artifacts;
- }
-
- public void setArtifacts(List<String> artifacts) {
- this.artifacts = artifacts;
- }
-
- public ResourceRespJavaObject() {
- super();
- }
-
- // public ResourceRespJavaObject(String uniqueId, String resourceName,
- // String resourceVersion, String creatorUserId,
- // String creatorFullName, String lastUpdaterUserId,
- // String lastUpdaterFullName, String description, String icon,
- // List<String> tags, String isHighestVersion, String creationDate,
- // String lastUpdateDate, String category, String lifecycleState,
- // List<String> derivedFrom, String vendorName, String vendorRelease,
- // String contactId, String abstractt, String highestVersion) {
- // super();
- // this.uniqueId = uniqueId;
- // this.resourceName = resourceName;
- // this.resourceVersion = resourceVersion;
- // this.creatorUserId = creatorUserId;
- // this.creatorFullName = creatorFullName;
- // this.lastUpdaterUserId = lastUpdaterUserId;
- // this.lastUpdaterFullName = lastUpdaterFullName;
- // this.description = description;
- // this.icon = icon;
- // this.tags = tags;
- // this.isHighestVersion = isHighestVersion;
- // this.creationDate = creationDate;
- // this.lastUpdateDate = lastUpdateDate;
- // this.category = category;
- // this.lifecycleState = lifecycleState;
- // this.derivedFrom = derivedFrom;
- // this.vendorName = vendorName;
- // this.vendorRelease = vendorRelease;
- // this.contactId = contactId;
- // this.abstractt = abstractt;
- // this.highestVersion = highestVersion;
- // }
- public String getUniqueId() {
- return uniqueId;
- }
-
- public void setUniqueId(String uniqueId) {
- this.uniqueId = uniqueId;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String resourceName) {
- this.name = resourceName;
- }
-
- public String getVersion() {
- return version;
- }
-
- public void setVersion(String resourceVersion) {
- this.version = resourceVersion;
- }
-
- public String getCreatorUserId() {
- return creatorUserId;
- }
-
- public void setCreatorUserId(String creatorUserId) {
- this.creatorUserId = creatorUserId;
- }
-
- public String getCreatorFullName() {
- return creatorFullName;
- }
-
- public void setCreatorFullName(String creatorFullName) {
- this.creatorFullName = creatorFullName;
- }
-
- public String getLastUpdaterUserId() {
- return lastUpdaterUserId;
- }
-
- public void setLastUpdaterUserId(String lastUpdaterUserId) {
- this.lastUpdaterUserId = lastUpdaterUserId;
- }
-
- public String getLastUpdaterFullName() {
- return lastUpdaterFullName;
- }
-
- public void setLastUpdaterFullName(String lastUpdaterFullName) {
- this.lastUpdaterFullName = lastUpdaterFullName;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public String getIcon() {
- return icon;
- }
-
- public void setIcon(String icon) {
- this.icon = icon;
- }
-
- public List<String> getTags() {
- return tags;
- }
-
- public void setTags(List<String> tags) {
- this.tags = tags;
- }
-
- public String getIsHighestVersion() {
- return isHighestVersion;
- }
-
- public void setIsHighestVersion(String isHighestVersion) {
- this.isHighestVersion = isHighestVersion;
- }
-
- public String getCreationDate() {
- return creationDate;
- }
-
- public void setCreationDate(String creationDate) {
- this.creationDate = creationDate;
- }
-
- public String getLastUpdateDate() {
- return lastUpdateDate;
- }
-
- public void setLastUpdateDate(String lastUpdateDate) {
- this.lastUpdateDate = lastUpdateDate;
- }
-
- // public String getCategory() {
- // return category;
- // }
- // public void setCategory(String category) {
- // this.category = category;
- // }
- public String getLifecycleState() {
- return lifecycleState;
- }
-
- public void setLifecycleState(String lifecycleState) {
- this.lifecycleState = lifecycleState;
- }
-
- public List<String> getDerivedFrom() {
- return derivedFrom;
- }
-
- public void setDerivedFrom(List<String> derivedFrom) {
- this.derivedFrom = derivedFrom;
- }
-
- public String getVendorName() {
- return vendorName;
- }
-
- public void setVendorName(String vendorName) {
- this.vendorName = vendorName;
- }
-
- public String getVendorRelease() {
- return vendorRelease;
- }
-
- public void setVendorRelease(String vendorRelease) {
- this.vendorRelease = vendorRelease;
- }
-
- public String getContactId() {
- return contactId;
- }
-
- public void setContactId(String contactId) {
- this.contactId = contactId;
- }
-
- public String getAbstractt() {
- return abstractt;
- }
-
- public void setAbstractt(String abstractt) {
- this.abstractt = abstractt;
- }
-
- public String getHighestVersion() {
- return highestVersion;
- }
-
- public void setHighestVersion(String highestVersion) {
- this.highestVersion = highestVersion;
- }
-
- public List<CategoryDefinition> getCategories() {
- return categories;
- }
-
- public void setCategories(List<CategoryDefinition> categories) {
- this.categories = categories;
- }
-
- @Override
- public String toString() {
- return "ResourceRespJavaObject [uniqueId=" + uniqueId + ", resourceName=" + name + ", resourceVersion="
- + version + ", creatorUserId=" + creatorUserId + ", creatorFullName=" + creatorFullName
- + ", lastUpdaterUserId=" + lastUpdaterUserId + ", lastUpdaterFullName=" + lastUpdaterFullName
- + ", description=" + description + ", icon=" + icon + ", tags=" + tags + ", isHighestVersion="
- + isHighestVersion + ", creationDate=" + creationDate + ", lastUpdateDate=" + lastUpdateDate
- + ", lifecycleState=" + lifecycleState + ", derivedFrom=" + derivedFrom + ", vendorName=" + vendorName
- + ", vendorRelease=" + vendorRelease + ", contactId=" + contactId + ", abstractt=" + abstractt
- + ", highestVersion=" + highestVersion + ", artifacts=" + artifacts + ", interfaces=" + interfaces
- + ", uuid=" + uuid + ", cost=" + cost + ", licenseType=" + licenseType + ", resourceType="
- + resourceType + "]";
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceAssetStructure.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceAssetStructure.java
deleted file mode 100644
index 015d228acf..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceAssetStructure.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-public class ServiceAssetStructure extends AssetStructure {
-
- private String distributionStatus;
-
- public ServiceAssetStructure() {
- super();
- }
-
- public ServiceAssetStructure(String uuid, String invariantUUID, String name, String version, String toscaModelURL,
- String category, String lifecycleState, String lastUpdaterUserId) {
- super(uuid, invariantUUID, name, version, toscaModelURL, category, lifecycleState, lastUpdaterUserId);
- }
-
- @Override
- public String toString() {
- return "ServiceAssetStructure [distributionStatus=" + distributionStatus + "]";
- }
-
- public String getDistributionStatus() {
- return distributionStatus;
- }
-
- public void setDistributionStatus(String distributionStatus) {
- this.distributionStatus = distributionStatus;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceDetailedAssetStructure.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceDetailedAssetStructure.java
deleted file mode 100644
index cc283a3169..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceDetailedAssetStructure.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-import java.util.List;
-
-public class ServiceDetailedAssetStructure extends ServiceAssetStructure {
-
- String lastUpdaterFullName;
- List<ResourceInstanceAssetStructure> resources;
- List<ArtifactAssetStructure> artifacts;
-
- public ServiceDetailedAssetStructure() {
- super();
- }
-
- public ServiceDetailedAssetStructure(String uuid, String invariantUUID, String name, String version,
- String toscaModelURL, String category, String lifecycleState, String lastUpdaterUserId) {
- super(uuid, invariantUUID, name, version, toscaModelURL, category, lifecycleState, lastUpdaterUserId);
- }
-
- public ServiceDetailedAssetStructure(String lastUpdaterFullName, List<ResourceInstanceAssetStructure> resources,
- List<ArtifactAssetStructure> artifacts) {
- super();
- this.lastUpdaterFullName = lastUpdaterFullName;
- this.resources = resources;
- this.artifacts = artifacts;
- }
-
- public String getLastUpdaterFullName() {
- return lastUpdaterFullName;
- }
-
- public void setLastUpdaterFullName(String lastUpdaterFullName) {
- this.lastUpdaterFullName = lastUpdaterFullName;
- }
-
- public List<ResourceInstanceAssetStructure> getResources() {
- return resources;
- }
-
- public void setResources(List<ResourceInstanceAssetStructure> resources) {
- this.resources = resources;
- }
-
- public List<ArtifactAssetStructure> getArtifacts() {
- return artifacts;
- }
-
- public void setArtifacts(List<ArtifactAssetStructure> artifacts) {
- this.artifacts = artifacts;
- }
-
- @Override
- public String toString() {
- return "ServiceDetailedAssetStructure [lastUpdaterFullName=" + lastUpdaterFullName + ", resources=" + resources
- + ", artifacts=" + artifacts + "]";
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceDistributionStatus.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceDistributionStatus.java
deleted file mode 100644
index fa80999bb3..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceDistributionStatus.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-public class ServiceDistributionStatus {
-
- private String distributionID;
- private String timestamp;
- private String userId;
- private String deployementStatus;
-
- public ServiceDistributionStatus() {
- super();
- }
-
- public ServiceDistributionStatus(String distributionID, String timestamp, String userId, String deployementStatus) {
- super();
- this.distributionID = distributionID;
- this.timestamp = timestamp;
- this.userId = userId;
- this.deployementStatus = deployementStatus;
- }
-
- @Override
- public String toString() {
- return "ServiceDistributionStatus [distributionID=" + distributionID + ", timestamp=" + timestamp + ", userId=" + userId + ", deployementStatus=" + deployementStatus + "]";
- }
-
- public String getDistributionID() {
- return distributionID;
- }
-
- public void setDistributionID(String distributionID) {
- this.distributionID = distributionID;
- }
-
- public String getTimestamp() {
- return timestamp;
- }
-
- public void setTimestamp(String timestamp) {
- this.timestamp = timestamp;
- }
-
- public String getUserId() {
- return userId;
- }
-
- public void setUserId(String userId) {
- this.userId = userId;
- }
-
- public String getDeployementStatus() {
- return deployementStatus;
- }
-
- public void setDeployementStatus(String deployementStatus) {
- this.deployementStatus = deployementStatus;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceFilterDetails.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceFilterDetails.java
deleted file mode 100644
index caeae85a15..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceFilterDetails.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-public class ServiceFilterDetails {
- private String servicePropertyName;
- private String constraintOperator;
- private String sourceType;
- private String sourceName;
- private Object value;
-
- public ServiceFilterDetails() {}
-
- public ServiceFilterDetails(String servicePropertyName, String constraintOperator, String sourceType, String sourceName,
- Object value) {
- this.servicePropertyName = servicePropertyName;
- this.constraintOperator = constraintOperator;
- this.sourceType = sourceType;
- this.sourceName = sourceName;
- this.value = value;
- }
-
- public String getServicePropertyName() {
- return servicePropertyName;
- }
-
- public void setServicePropertyName(String servicePropertyName) {
- this.servicePropertyName = servicePropertyName;
- }
-
- public String getConstraintOperator() {
- return constraintOperator;
- }
-
- public void setConstraintOperator(String constraintOperator) {
- this.constraintOperator = constraintOperator;
- }
-
- public String getSourceType() {
- return sourceType;
- }
-
- public void setSourceType(String sourceType) {
- this.sourceType = sourceType;
- }
-
- public Object getValue() {
- return value;
- }
-
- public void setValue(Object value) {
- this.value = value;
- }
-
- public String getSourceName() {
- return sourceName;
- }
-
- public void setSourceName(String sourceName) {
- this.sourceName = sourceName;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceReqDetails.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceReqDetails.java
deleted file mode 100644
index 85e7cf6b29..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceReqDetails.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-import org.openecomp.sdc.be.model.Service;
-import org.openecomp.sdc.be.model.category.CategoryDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceInstantiationType;
-
-import java.util.ArrayList;
-import java.util.Collections;
-
-public class ServiceReqDetails extends ComponentReqDetails {
-
- protected String serviceType = "MyServiceType";
- protected String serviceRole = "MyServiceRole";
- protected String namingPolicy = "MyServiceNamingPolicy";
- protected Boolean ecompGeneratedNaming = true;
- protected String instantiationType = ServiceInstantiationType.A_LA_CARTE.getValue();
- protected String serviceFunction = "";
-
- public String getServiceType() {
- return serviceType;
- }
-
- public void setServiceType(String serviceType) {
- this.serviceType = serviceType;
- }
-
- public String getInstantiationType() {
- return instantiationType;
- }
-
- public String getServiceRole() {
- return serviceRole;
- }
-
- public void setServiceRole(String serviceRole) {
- this.serviceRole = serviceRole;
- }
-
- public String getNamingPolicy() {
- return namingPolicy;
- }
-
- public void setNamingPolicy(String namingPolicy) {
- this.namingPolicy = namingPolicy;
- }
-
- public Boolean getEcompGeneratedNaming() {
- return ecompGeneratedNaming;
- }
-
- public void setEcompGeneratedNaming(Boolean ecompGeneratedNaming) {
- this.ecompGeneratedNaming = ecompGeneratedNaming;
- }
-
- public String getServiceFunction() {
- return serviceFunction;
- }
-
- public void setServiceFunction(String serviceFunction) {
- this.serviceFunction = serviceFunction;
- }
-
- public ServiceReqDetails(String serviceName, String category, ArrayList<String> tags, String description,
- String contactId, String icon, String instantiationType) {
- this.name = serviceName;
- this.tags = tags;
- this.description = description;
- this.contactId = contactId;
- this.icon = icon;
- projectCode = "12345";
- serviceFunction = "serviceFunction name";
- CategoryDefinition categoryDefinition = new CategoryDefinition();
- categoryDefinition.setName(category);
- categoryDefinition.setIcons(Collections.singletonList(icon));
- categories = new ArrayList<>();
- categories.add(categoryDefinition);
-
- }
-
- public ServiceReqDetails(Service service) {
- this.contactId = service.getContactId();
- this.categories = service.getCategories();
- this.creatorUserId = service.getCreatorUserId();
- this.creatorFullName = service.getCreatorFullName();
- this.description = service.getDescription();
- this.icon = service.getIcon();
- this.name = service.getName();
- this.projectCode = service.getProjectCode();
- this.tags = service.getTags();
- this.uniqueId = service.getUniqueId();
- this.UUID = service.getUUID();
- this.version = service.getVersion();
-
- }
-
- public ServiceReqDetails() {
- contactId = "aa1234";
- projectCode = "12345";
- }
-
- public ServiceReqDetails(ServiceReqDetails a, String newServiceName) {
- a.setName(newServiceName);
- }
-
- @Override
- public String toString() {
- return "ServiceDetails [name = " + name + ", category = " + getCategory() + ", tags = " + tags + ", description = "
- + description + ", contactId = " + contactId + ", icon = " + icon + ", instantiation type = " + getInstantiationType() + "]";
- }
-
- public ServiceReqDetails(ServiceReqDetails aService) {
- this(aService.getName(), aService.getCategory(), (ArrayList<String>) aService.getTags(),
- aService.getDescription(), aService.getContactId(), aService.getIcon(), aService.getInstantiationType());
- uniqueId = aService.getUniqueId();
- version = aService.getVersion();
- }
-
- public String getCategory() {
- if (categories != null && categories.size() >= 1) {
- return categories.get(0).getName();
- }
- return null;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceRespJavaObject.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceRespJavaObject.java
deleted file mode 100644
index 7bec221ef1..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceRespJavaObject.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-import java.util.ArrayList;
-
-public class ServiceRespJavaObject {
-
- String category;
- String creatorUserId;
- String creatorFullName;
- String lastUpdaterUserId;
- String lastUpdaterFullName;
- String serviceName;
- String version;
- String creationDate;
- String icon;
- String name;
- String description;
- ArrayList<String> tags;
- String uniqueId;
- String lastUpdateDate;
- String contactId;
- String vendorName;
- String vendorRelease;
- String lifecycleState;
- String highestVersion;
- ArrayList<String> artifacts;
- ArrayList<String> ResourceInstances;
- ArrayList<String> ResourceInstancesRelations;
-
- public ServiceRespJavaObject() {
- super();
- }
-
- public ServiceRespJavaObject(String category, String creatorUserId, String creatorFullName,
- String lastUpdaterUserId, String lastUpdaterFullName, String serviceName, String version,
- String creationDate, String icon, String name, String description, ArrayList<String> tags, String uniqueId,
- String lastUpdateDate, String contactId, String vendorName, String vendorRelease, String lifecycleState,
- String highestVersion, ArrayList<String> artifacts, ArrayList<String> resourceInstances,
- ArrayList<String> resourceInstancesRelations) {
- super();
- this.category = category;
- this.creatorUserId = creatorUserId;
- this.creatorFullName = creatorFullName;
- this.lastUpdaterUserId = lastUpdaterUserId;
- this.lastUpdaterFullName = lastUpdaterFullName;
- this.serviceName = serviceName;
- this.version = version;
- this.creationDate = creationDate;
- this.icon = icon;
- this.name = name;
- this.description = description;
- this.tags = tags;
- this.uniqueId = uniqueId;
- this.lastUpdateDate = lastUpdateDate;
- this.contactId = contactId;
- this.vendorName = vendorName;
- this.vendorRelease = vendorRelease;
- this.lifecycleState = lifecycleState;
- this.highestVersion = highestVersion;
- this.artifacts = artifacts;
- ResourceInstances = resourceInstances;
- ResourceInstancesRelations = resourceInstancesRelations;
- }
-
- public String getCategory() {
- return category;
- }
-
- public void setCategory(String category) {
- this.category = category;
- }
-
- public String getCreatorUserId() {
- return creatorUserId;
- }
-
- public void setCreatorUserId(String creatorUserId) {
- this.creatorUserId = creatorUserId;
- }
-
- public String getCreatorFullName() {
- return creatorFullName;
- }
-
- public void setCreatorFullName(String creatorFullName) {
- this.creatorFullName = creatorFullName;
- }
-
- public String getLastUpdaterUserId() {
- return lastUpdaterUserId;
- }
-
- public void setLastUpdaterUserId(String lastUpdaterUserId) {
- this.lastUpdaterUserId = lastUpdaterUserId;
- }
-
- public String getLastUpdaterFullName() {
- return lastUpdaterFullName;
- }
-
- public void setLastUpdaterFullName(String lastUpdaterFullName) {
- this.lastUpdaterFullName = lastUpdaterFullName;
- }
-
- public String getVersion() {
- return version;
- }
-
- public void setVersion(String version) {
- this.version = version;
- }
-
- public String getCreationDate() {
- return creationDate;
- }
-
- public void setCreationDate(String creationDate) {
- this.creationDate = creationDate;
- }
-
- public String getIcon() {
- return icon;
- }
-
- public void setIcon(String icon) {
- this.icon = icon;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public ArrayList<String> getTags() {
- return tags;
- }
-
- public void setTags(ArrayList<String> tags) {
- this.tags = tags;
- }
-
- public String getUniqueId() {
- return uniqueId;
- }
-
- public void setUniqueId(String uniqueId) {
- this.uniqueId = uniqueId;
- }
-
- public String getLastUpdateDate() {
- return lastUpdateDate;
- }
-
- public void setLastUpdateDate(String lastUpdateDate) {
- this.lastUpdateDate = lastUpdateDate;
- }
-
- public String getContactId() {
- return contactId;
- }
-
- public void setContactId(String contactId) {
- this.contactId = contactId;
- }
-
- public String getVendorName() {
- return vendorName;
- }
-
- public void setVendorName(String vendorName) {
- this.vendorName = vendorName;
- }
-
- public String getVendorRelease() {
- return vendorRelease;
- }
-
- public void setVendorRelease(String vendorRelease) {
- this.vendorRelease = vendorRelease;
- }
-
- public String getLifecycleState() {
- return lifecycleState;
- }
-
- public void setLifecycleState(String lifecycleState) {
- this.lifecycleState = lifecycleState;
- }
-
- public String getHighestVersion() {
- return highestVersion;
- }
-
- public void setHighestVersion(String highest) {
- this.highestVersion = highest;
- }
-
- public ArrayList<String> getArtifacts() {
- return artifacts;
- }
-
- public void setArtifacts(ArrayList<String> artifacts) {
- this.artifacts = artifacts;
- }
-
- public ArrayList<String> getResourceInstances() {
- return ResourceInstances;
- }
-
- public void setResourceInstances(ArrayList<String> resourceInstances) {
- ResourceInstances = resourceInstances;
- }
-
- public ArrayList<String> getResourceInstancesRelations() {
- return ResourceInstancesRelations;
- }
-
- public void setResourceInstancesRelations(ArrayList<String> resourceInstancesRelations) {
- ResourceInstancesRelations = resourceInstancesRelations;
- }
-
- @Override
- public String toString() {
- return "ServiceRespJavaObject [category=" + category + ", creatorUserId=" + creatorUserId + ", creatorFullName="
- + creatorFullName + ", lastUpdaterUserId=" + lastUpdaterUserId + ", lastUpdaterFullName="
- + lastUpdaterFullName + ", serviceName=" + serviceName + ", version=" + version + ", creationDate="
- + creationDate + ", icon=" + icon + ", name=" + name + ", description=" + description + ", tags=" + tags
- + ", uniqueId=" + uniqueId + ", lastUpdateDate=" + lastUpdateDate + ", contactId=" + contactId
- + ", vendorName=" + vendorName + ", vendorRelease=" + vendorRelease + ", lifecycleState="
- + lifecycleState + ", lifecycleState=" + lifecycleState + ", artifacts=" + artifacts
- + ", ResourceInstances=" + ResourceInstances + ", ResourceInstancesRelations="
- + ResourceInstancesRelations + "]";
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/TypeHeatMetaDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/TypeHeatMetaDefinition.java
deleted file mode 100644
index d0f029242f..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/TypeHeatMetaDefinition.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-import java.util.List;
-
-public class TypeHeatMetaDefinition {
-
- String typeName;
-
- List<GroupHeatMetaDefinition> groupHeatMetaDefinition;
-
- public TypeHeatMetaDefinition() {
- super();
- }
-
- public String getTypeName() {
- return typeName;
- }
-
- public void setTypeName(String typeName) {
- this.typeName = typeName;
- }
-
- public List<GroupHeatMetaDefinition> getGroupHeatMetaDefinition() {
- return groupHeatMetaDefinition;
- }
-
- public void setGroupHeatMetaDefinition(List<GroupHeatMetaDefinition> groupHeatMetaDefinition) {
- this.groupHeatMetaDefinition = groupHeatMetaDefinition;
- }
-
- @Override
- public String toString() {
- return "TypeHeatMetaDefinition [typeName=" + typeName + ", groupHeatMetaDefinition=" + groupHeatMetaDefinition
- + "]";
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/UserCredentials.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/UserCredentials.java
deleted file mode 100644
index 2de872504f..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/UserCredentials.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-import org.openecomp.sdc.be.model.User;
-
-public class UserCredentials extends User {
-
- // private String userName;
- private String password;
-
- public UserCredentials(String userId, String password, String firstname, String lastname, String role) {
- super();
- setUserId(userId);
- // this.userName = userName;
- this.password = password;
- setFirstName(firstname);
- setLastName(lastname);
- setRole(role);
- }
-
- public UserCredentials() {
- super();
- }
-
- // public String getUserName() {
- // return userName;
- // }
- // public void setUserName(String userName) {
- // this.userName = userName;
- // }
- public String getPassword() {
- return password;
- }
-
- public void setPassword(String password) {
- this.password = password;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/VendorLicenseModel.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/VendorLicenseModel.java
deleted file mode 100644
index 4ed0e83179..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/VendorLicenseModel.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-import lombok.Getter;
-import lombok.Setter;
-import lombok.ToString;
-
-@ToString
-@Getter
-public class VendorLicenseModel {
-
- private final String vendorId;
- private final String vendorLicenseName;
- private final String vendorLicenseAgreementId;
- private final String featureGroupId;
- private String licenseVersionId;
- private String licenseVersionLabel;
- @Setter
- private String version;
-
- public VendorLicenseModel(final String vendorId, final String vendorLicenseName,
- final String vendorLicenseAgreementId, final String featureGroupId,
- final String licenseVersionId, final String licenseVersionLabel) {
- this.vendorId = vendorId;
- this.vendorLicenseName = vendorLicenseName;
- this.vendorLicenseAgreementId = vendorLicenseAgreementId;
- this.featureGroupId = featureGroupId;
- this.licenseVersionId = licenseVersionId;
- this.licenseVersionLabel = licenseVersionLabel;
- }
-
- public VendorLicenseModel(String vendorId, String vendorLicenseName, String vendorLicenseAgreementId, String featureGroupId) {
- this.vendorId = vendorId;
- this.vendorLicenseName = vendorLicenseName;
- this.vendorLicenseAgreementId = vendorLicenseAgreementId;
- this.featureGroupId = featureGroupId;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/VendorSoftwareProductObject.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/VendorSoftwareProductObject.java
deleted file mode 100644
index 96308b3e54..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/VendorSoftwareProductObject.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-public class VendorSoftwareProductObject extends VendorSoftwareProductObjectReqDetails {
-
- private String vspId;
- private String componentId;
- private String attContact;
- private String version;
-
- public VendorSoftwareProductObject(){super();}
-
- public VendorSoftwareProductObject(String vspId, String componentId, String attContact, String version) {
- this.vspId = vspId;
- this.componentId = componentId;
- this.attContact = attContact;
- this.version = version;
- }
-
- public VendorSoftwareProductObject(String name, String description, String category, String subCategory, String vendorId, String vendorName, String licensingVersion, LicensingData licensingData, String onboardingMethod, String networkPackageName, String onboardingOrigin, String icon, String vspId, String componentId, String attContact, String version) {
- super(name, description, category, subCategory, vendorId, vendorName, licensingVersion, licensingData, onboardingMethod, networkPackageName, onboardingOrigin, icon);
- this.vspId = vspId;
- this.componentId = componentId;
- this.attContact = attContact;
- this.version = version;
- }
-
- public String getVspId() {
- return vspId;
- }
-
- public void setVspId(String vspId) {
- this.vspId = vspId;
- }
-
- public String getComponentId() {
- return componentId;
- }
-
- public void setComponentId(String componentId) {
- this.componentId = componentId;
- }
-
- public String getAttContact() {
- return attContact;
- }
-
- public void setAttContact(String attContact) {
- this.attContact = attContact;
- }
-
- public String getVersion() {
- return version;
- }
-
- public void setVersion(String version) {
- this.version = version;
- }
-
- @Override
- public String toString() {
- return "VendorSoftwareProductObject{" +
- "vspId='" + vspId + '\'' +
- ", componentId='" + componentId + '\'' +
- ", attContact='" + attContact + '\'' +
- ", version='" + version + '\'' +
- '}';
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/VendorSoftwareProductObjectReqDetails.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/VendorSoftwareProductObjectReqDetails.java
deleted file mode 100644
index d69f14ff4f..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/VendorSoftwareProductObjectReqDetails.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-public class VendorSoftwareProductObjectReqDetails {
-
- private String name;
- private String description;
- private String category;
- private String subCategory;
- private String vendorId;
- private String vendorName;
-// private LicensingVersion licensingVersion;
- private String licensingVersion;
- private LicensingData licensingData;
- private String onboardingMethod;
- private String networkPackageName;
- private String onboardingOrigin;
- private String icon;
-
-
- public String getIcon() {
- return icon;
- }
-
- public void setIcon(String icon) {
- this.icon = icon;
- }
-
- public VendorSoftwareProductObjectReqDetails() {
- }
-
- public VendorSoftwareProductObjectReqDetails(String name, String description, String category, String subCategory, String vendorId, String vendorName, String licensingVersion, LicensingData licensingData, String onboardingMethod, String networkPackageName, String onboardingOrigin, String icon) {
- this.name = name;
- this.description = description;
- this.category = category;
- this.subCategory = subCategory;
- this.vendorId = vendorId;
- this.vendorName = vendorName;
- this.licensingVersion = licensingVersion;
- this.licensingData = licensingData;
- this.onboardingMethod = onboardingMethod;
- this.networkPackageName = networkPackageName;
- this.onboardingOrigin = onboardingOrigin;
- this.icon = icon;
- }
-
- public String getLicensingVersion() {
- return licensingVersion;
- }
-
- public void setLicensingVersion(String licensingVersion) {
- this.licensingVersion = licensingVersion;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public String getCategory() {
- return category;
- }
-
- public void setCategory(String category) {
- this.category = category;
- }
-
- public String getSubCategory() {
- return subCategory;
- }
-
- public void setSubCategory(String subCategory) {
- this.subCategory = subCategory;
- }
-
- public String getVendorId() {
- return vendorId;
- }
-
- public void setVendorId(String vendorId) {
- this.vendorId = vendorId;
- }
-
- public String getVendorName() {
- return vendorName;
- }
-
- public void setVendorName(String vendorName) {
- this.vendorName = vendorName;
- }
-
-// public LicensingVersion getLicensingVersion() {
-// return licensingVersion;
-// }
-//
-// public void setLicensingVersion(LicensingVersion licensingVersion) {
-// this.licensingVersion = licensingVersion;
-// }
-
- public LicensingData getLicensingData() {
- return licensingData;
- }
-
- public void setLicensingData(LicensingData licensingData) {
- this.licensingData = licensingData;
- }
-
- public String getOnboardingMethod() {
- return onboardingMethod;
- }
-
- public void setOnboardingMethod(String onboardingMethod) {
- this.onboardingMethod = onboardingMethod;
- }
-
- public String getNetworkPackageName() {
- return networkPackageName;
- }
-
- public void setNetworkPackageName(String networkPackageName) {
- this.networkPackageName = networkPackageName;
- }
-
- public String getOnboardingOrigin() {
- return onboardingOrigin;
- }
-
- public void setOnboardingOrigin(String onboardingOrigin) {
- this.onboardingOrigin = onboardingOrigin;
- }
-
- @Override
- public String toString() {
- return "VendorSoftwareProductObjectReqDetails{" +
- "name='" + name + '\'' +
- ", description='" + description + '\'' +
- ", category='" + category + '\'' +
- ", subCategory='" + subCategory + '\'' +
- ", vendorId='" + vendorId + '\'' +
- ", vendorName='" + vendorName + '\'' +
- ", licensingVersion=" + licensingVersion +
- ", licensingData=" + licensingData +
- ", onboardingMethod='" + onboardingMethod + '\'' +
- ", networkPackageName='" + networkPackageName + '\'' +
- ", onboardingOrigin='" + onboardingOrigin + '\'' +
- '}';
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ArtifactTypeEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ArtifactTypeEnum.java
deleted file mode 100644
index 17be9334fa..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ArtifactTypeEnum.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.enums;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-/**
- * Enum That Represents possible Artifacts Types.
- *
- */
-@Getter
-@AllArgsConstructor
-public enum ArtifactTypeEnum {
- CHEF("CHEF"), PUPPET("PUPPET"), YANG("YANG"), SHELL_SCRIPT("SHELL_SCRIPT"), ICON("ICON"), UNKNOWN("UNKNOWN"), HEAT("HEAT"), DG_XML("DG_XML"), MURANO_PKG("MURANO_PKG"),
- HEAT_ENV("HEAT_ENV"), YANG_XML("YANG_XML"), HEAT_VOL("HEAT_VOL"), HEAT_NET("HEAT_NET"), OTHER("OTHER"), WORKFLOW("WORKFLOW"), NETWORK_CALL_FLOW("NETWORK_CALL_FLOW"),
- TOSCA_TEMPLATE("TOSCA_TEMPLATE"), TOSCA_CSAR("TOSCA_CSAR"), VNF_CATALOG("VNF_CATALOG"), VF_LICENSE("VF_LICENSE"), VENDOR_LICENSE("VENDOR_LICENSE"),
- MODEL_INVENTORY_PROFILE("MODEL_INVENTORY_PROFILE"), MODEL_QUERY_SPEC("MODEL_QUERY_SPEC"), APPC_CONFIG("APPC_CONFIG"), HEAT_NESTED("HEAT_NESTED"),
- HEAT_ARTIFACT("HEAT_ARTIFACT"), VF_MODULES_METADATA("VF_MODULES_METADATA"), PNF_SW_INFORMATION("PNF_SW_INFORMATION"),
- // DCAE Artifacts
- DCAE_TOSCA("DCAE_TOSCA"), DCAE_JSON("DCAE_JSON"), DCAE_POLICY("DCAE_POLICY"), DCAE_DOC("DCAE_DOC"), DCAE_EVENT("DCAE_EVENT"), DCAE_INVENTORY_TOSCA("DCAE_INVENTORY_TOSCA"),
- DCAE_INVENTORY_JSON("DCAE_INVENTORY_JSON"), DCAE_INVENTORY_POLICY("DCAE_INVENTORY_POLICY"), DCAE_INVENTORY_DOC("DCAE_INVENTORY_DOC"),
- DCAE_INVENTORY_BLUEPRINT("DCAE_INVENTORY_BLUEPRINT"), DCAE_INVENTORY_EVENT("DCAE_INVENTORY_EVENT"),
- // AAI Artifacts
- AAI_SERVICE_MODEL("AAI_SERVICE_MODEL"), AAI_VF_MODEL("AAI_VF_MODEL"), AAI_VF_MODULE_MODEL("AAI_VF_MODULE_MODEL"), AAI_VF_INSTANCE_MODEL("AAI_VF_INSTANCE_MODEL"),
- // MIB artifacts
- SNMP_POLL ("SNMP_POLL"), SNMP_TRAP("SNMP_TRAP"), GUIDE("GUIDE");
-
- private final String type;
-
- public static ArtifactTypeEnum findType(final String type) {
- for (final ArtifactTypeEnum ate : ArtifactTypeEnum.values()) {
- if (ate.getType().equalsIgnoreCase(type)) {
- return ate;
- }
- }
- return null;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/AssocType.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/AssocType.java
deleted file mode 100644
index 82e9a36780..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/AssocType.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.enums;
-
-public enum AssocType {
-
- BINDABLE("tosca.capabilities.network.Bindable"), HOSTEDON("tosca.relationships.HostedOn"), LINKABLE("tosca.capabilities.network.Linkable"),
- CONTAINER("tosca.capabilities.Container"), NODE("tosca.capabilities.Node");
-
- private String assocType;
-
- private AssocType(String assocType) {
- this.assocType = assocType;
-
- }
-
- public String getAssocType() {
- return assocType;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/AuditEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/AuditEnum.java
deleted file mode 100644
index a713d5089f..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/AuditEnum.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.enums;
-
-public enum AuditEnum {
-
- ACTION("ACTION"), RESOURCE_NAME("RESOURCE_NAME"), RESOURCE_TYPE("RESOURCE_TYPE"), PREV_VERSION("PREV_VERSION"), CURR_VERSION("CURR_VERSION"), MODIFIER("MODIFIER"), PREV_STATE("PREV_STATE"),
- CURR_STATE("CURR_STATE"), STATUS("STATUS-Type"), DESC("DESC"), URL("URL"), USER("USER"), AUTH_STATUS("AUTH_STATUS"), REALM("REALM");
-
- String value;
-
- private AuditEnum(String value) {
- this.value = value;
- }
-
- public String getValue() {
-
- return value.toLowerCase();
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/AuditJsonKeysEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/AuditJsonKeysEnum.java
deleted file mode 100644
index 308ea5c990..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/AuditJsonKeysEnum.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.enums;
-
-public enum AuditJsonKeysEnum {
-
- ACTION("ACTION"), RESOURCE_NAME("RESOURCE_NAME"), RESOURCE_TYPE("RESOURCE_TYPE"), PREV_VERSION("PREV_VERSION"), CURR_VERSION("CURR_VERSION"), PREV_STATE("PREV_STATE"), CURR_STATE("CURR_STATE"),
- DPREV_STATUS("DPREV_STATUS"), DCURR_STATUS("DCURR_STATUS"), STATUS("STATUS"), DESCRIPTION("DESCRIPTION"), ARTIFACT_DATA("ARTIFACT_DATA"), CONSUMER_ID("CONSUMER_ID"), RESOURCE_URL("RESOURCE_URL"),
- COMMENT("COMMENT"), DID("DID"), TOPIC_NAME("TOPIC_NAME"), TOSCA_NODE_TYPE("TOSCA_NODE_TYPE"), CURR_ARTIFACT_UUID("CURR_ARTIFACT_UUID"), PREV_ARTIFACT_UUID("PREV_ARTIFACT_UUID"), DETAILS("DETAILS"),
- MODIFIER("MODIFIER"), SERVICE_INSTANCE_ID("SERVICE_INSTANCE_ID"), INVARIANT_UUID("INVARIANT_UUID");
-
- private String auditJsonKeyName;
-
- private AuditJsonKeysEnum(String auditJsonKeyName) {
- this.auditJsonKeyName = auditJsonKeyName;
- }
-
- public String getAuditJsonKeyName() {
- return auditJsonKeyName.toLowerCase();
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/CircleSize.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/CircleSize.java
deleted file mode 100644
index 82142db220..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/CircleSize.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.enums;
-
-public enum CircleSize {
- VF(),
- SERVICE(),
- NORMATIVE();
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ComponentType.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ComponentType.java
deleted file mode 100644
index 3d242e8c52..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ComponentType.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.enums;
-
-public enum ComponentType {
-
- RESOURCE("Resource"), SERVICE("Service"), ARTIFACT("Artifact");
-
- String value;
-
- private ComponentType(String value) {
- this.value = value;
- }
-
- public String getValue() {
-
- return value;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/CvfcTypeEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/CvfcTypeEnum.java
deleted file mode 100644
index 0e623aa8cd..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/CvfcTypeEnum.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.enums;
-
-public enum CvfcTypeEnum {
-
- SNMP_POLL ("SNMP_POLL"),
- SNMP_TRAP ("SNMP_TRAP"),
- VES_EVENTS ("VES_EVENTS");
-
- private String value;
-
- public String getValue() {
- return value;
- }
-
- private CvfcTypeEnum(String value) {
- this.value = value;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/DistributionNotificationStatusEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/DistributionNotificationStatusEnum.java
deleted file mode 100644
index 7042a954e7..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/DistributionNotificationStatusEnum.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.enums;
-
-public enum DistributionNotificationStatusEnum {
-
-
- DEPLOY_OK("DEPLOY_OK"),
- DOWNLOAD_OK("DOWNLOAD_OK"),
- NOTIFIED("NOTIFIED"),
- NOT_NOTIFIED("NOT_NOTIFIED");
-
- private String value;
-
- private DistributionNotificationStatusEnum(String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
-
- public static DistributionNotificationStatusEnum findState(String state) {
-
- for (DistributionNotificationStatusEnum distributionStatus : DistributionNotificationStatusEnum.values()) {
- if (distributionStatus.name().equalsIgnoreCase(state)
- || distributionStatus.getValue().equalsIgnoreCase(state)) {
- return distributionStatus;
- }
- }
- return null;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ErrorInfo.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ErrorInfo.java
deleted file mode 100644
index 2d5075e6c7..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ErrorInfo.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.enums;
-
-public class ErrorInfo {
-
- private Integer code;
- private String message;
- private String messageId;
-
- public ErrorInfo() {
- super();
- }
-
- public ErrorInfo(Integer code, String message, String messageId) {
- super();
- this.code = code;
- this.message = message;
- this.messageId = messageId;
- }
-
- public ErrorInfo(Integer code, String message) {
- super();
- this.code = code;
- this.message = message;
- }
-
- public Integer getCode() {
- return code;
- }
-
- public void setCode(Integer code) {
- this.code = code;
- }
-
- public String getMessage() {
- return message;
- }
-
- public String getMessageAndReplaceVariables(Object... variables) {
- String formatReadyString = message.replaceAll("%[\\d]+", "%s");
- formatReadyString = String.format(formatReadyString, variables);
- return formatReadyString;
- }
-
- public String getAuditDesc(Object... variables) {
- String messageAndReplaceVariables = getMessageAndReplaceVariables(variables);
- String res;
- if (messageId != null) {
- res = messageId + ": " + messageAndReplaceVariables;
- } else {
- res = messageAndReplaceVariables;
- }
- return res;
- }
-
- public void setMessage(String message) {
- this.message = message;
- }
-
- public String getMessageId() {
- return messageId;
- }
-
- public void setMessageId(String messageId) {
- this.messageId = messageId;
- }
-
- @Override
- public String toString() {
- return "ErrorInfo [code=" + code + ", message=" + message + ", messageId=" + messageId + "]";
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/EsIndexTypeIdToDelete.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/EsIndexTypeIdToDelete.java
deleted file mode 100644
index 6bfbd8af7d..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/EsIndexTypeIdToDelete.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.enums;
-
-public class EsIndexTypeIdToDelete {
-
- String index;
- String type;
- String id;
-
- public EsIndexTypeIdToDelete() {
- super();
- }
-
- public EsIndexTypeIdToDelete(String index, String type, String id) {
- super();
- this.index = index;
- this.type = type;
- this.id = id;
- }
-
- public String getIndex() {
- return index;
- }
-
- public void setIndex(String index) {
- this.index = index;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ExceptionEnumType.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ExceptionEnumType.java
deleted file mode 100644
index 59d1dec453..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ExceptionEnumType.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.enums;
-
-public enum ExceptionEnumType {
-
- SERVICE_EXCEPTION("serviceException"), POLICY_EXCPTION("policyException");
-
- String value;
-
- private ExceptionEnumType(String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/GroupPropertyEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/GroupPropertyEnum.java
deleted file mode 100644
index 24538b7414..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/GroupPropertyEnum.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.enums;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public enum GroupPropertyEnum {
-
- IS_BASE("isBase"),
- MIN_VF_MODULE_INSTANCES("min_vf_module_instances"),
- MAX_VF_MODULE_INSTANCES("max_vf_module_instances"),
- VF_MODULE_LABEL("vf_module_label"),
- VFC_LIST("vfc_list"),
- VF_MODULE_TYPE("vf_module_type"),
- VF_MODULE_DESCRIPTION("vf_module_description"),
- INITIAL_COUNT("initial_count"),
- VOLUME_GROUP("volume_group"),
- AVAILABILITY_ZONE_COUNT("availability_zone_count");
-
- private String propertyName;
-
- GroupPropertyEnum(String propertyName) {
- this.propertyName = propertyName;
- }
-
- public String getPropertyName() {
- return propertyName;
- }
-
- public static List<String> getGroupPropertyNamesWithoutIsbase(){
- List<String> groupPropertyNames = new ArrayList<>();
-
- for(GroupPropertyEnum groupProperty : GroupPropertyEnum.values()) {
- if (!groupProperty.getPropertyName().equals(GroupPropertyEnum.IS_BASE)){
- groupPropertyNames.add(groupProperty.getPropertyName());
- }
- }
- return groupPropertyNames;
- }
-
- public static List<String> getGroupPropertyNames(){
- List<String> groupPropertyNames = GroupPropertyEnum.getGroupPropertyNamesWithoutIsbase();
- groupPropertyNames.add(GroupPropertyEnum.IS_BASE.getPropertyName());
- return groupPropertyNames;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ImportTestTypesEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ImportTestTypesEnum.java
deleted file mode 100644
index ed71faa8ce..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ImportTestTypesEnum.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.enums;
-
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-
-import java.util.Arrays;
-import java.util.List;
-
-public enum ImportTestTypesEnum {
-
- MISSING_CONTACT("tosca.nodes.missing_contact", "missing_contact", ActionStatus.COMPONENT_MISSING_CONTACT, Arrays.asList("Resource"), true),
- MISSING_RESOURCE_NAME("tosca.nodes.missing_resource_name", "missing_resource_name", ActionStatus.MISSING_COMPONENT_NAME, Arrays.asList("Resource"), true),
- MISSING_DESC("tosca.nodes.missing_desc", "missing_desc", ActionStatus.COMPONENT_MISSING_DESCRIPTION, Arrays.asList("Resource"), true),
- MISSING_ICON("tosca.nodes.missing_icon", "missing_icon", ActionStatus.COMPONENT_MISSING_ICON, Arrays.asList("Resource"), true),
- MISSING_TAGS("tosca.nodes.missing_tags", "missing_tags", ActionStatus.COMPONENT_MISSING_TAGS, null, true),
- MISSING_CATEGORY("tosca.nodes.missing_category", "missing_category", ActionStatus.COMPONENT_MISSING_CATEGORY, Arrays.asList("Resource"), true),
- // MISSING_PAYLOADNAME("tosca.nodes.missing_payloadName",
- // "missing_payloadName", ActionStatus.INVALID_TOSCA_FILE_EXTENSION, null,
- // true),
-
- EMPTY_RESOURCE_NAME("tosca.nodes.empty_resource_name", "missing_resource_name"/* "empty_resource_name" */, ActionStatus.MISSING_COMPONENT_NAME, Arrays.asList("Resource"), false),
- EMPTY_CONTACT("tosca.nodes.empty_contact", "missing_contact"/* "empty_contact" */, ActionStatus.COMPONENT_MISSING_CONTACT, Arrays.asList("Resource"), false),
- EMPTY_CATEGORY("tosca.nodes.empty_category", "missing_category"/* "empty_category" */, ActionStatus.COMPONENT_MISSING_CATEGORY, Arrays.asList("Resource"), false),
- EMPTY_DESC("tosca.nodes.empty_desc", "missing_desc"/* "empty_desc" */, ActionStatus.COMPONENT_MISSING_DESCRIPTION, Arrays.asList("Resource"), false),
- EMPTY_ICON("tosca.nodes.empty_icon", "missing_icon"/* "empty_icon" */, ActionStatus.COMPONENT_MISSING_ICON, Arrays.asList("Resource"), false),
- EMPTY_PAYLOADNAME("tosca.nodes.empty_payloadName", "missing_payloadName"/* "empty_payloadName" */, ActionStatus.INVALID_TOSCA_FILE_EXTENSION, null, false),
- EMPTY_TAG("tosca.nodes.empty_tag", "empty_tag", ActionStatus.INVALID_FIELD_FORMAT, Arrays.asList("Resource", "tag"), false),
- VALIDATE_PROPORTIES_1("tosca.nodes.validateProporties_typeBoolean_valueInit", "validateProporties_typeBoolean_valueInit", ActionStatus.INVALID_DEFAULT_VALUE, Arrays.asList("validation_test", "boolean", "123456"), false),
- VALIDATE_PROPORTIES_2("tosca.nodes.validateProporties_typeBoolean_valueString", "validateProporties_typeBoolean_valueString", ActionStatus.INVALID_DEFAULT_VALUE, Arrays.asList("validation_test", "boolean", "abcd"), false),
- VALIDATE_PROPORTIES_3("tosca.nodes.validateProporties_typeFloat_valueBoolean", "validateProporties_typeFloat_valueBoolean", ActionStatus.INVALID_DEFAULT_VALUE, Arrays.asList("validation_test", "float", "true"), false),
- VALIDATE_PROPORTIES_4("tosca.nodes.validateProporties_typeFloat_valueString", "validateProporties_typeFloat_valueString", ActionStatus.INVALID_DEFAULT_VALUE, Arrays.asList("validation_test", "float", "abcd"), false),
- VALIDATE_PROPORTIES_5("tosca.nodes.validateProporties_typeInit_valueBoolean", "validateProporties_typeInit_valueBoolean", ActionStatus.INVALID_DEFAULT_VALUE, Arrays.asList("validation_test", "integer", "true"), false),
- VALIDATE_PROPORTIES_6("tosca.nodes.validateProporties_typeInit_valueFloat", "validateProporties_typeInit_valueFloat", ActionStatus.INVALID_DEFAULT_VALUE, Arrays.asList("validation_test", "integer", "0.123"), false),
- VALIDATE_PROPORTIES_7("tosca.nodes.validateProporties_typeInit_valueString", "validateProporties_typeInit_valueString", ActionStatus.INVALID_DEFAULT_VALUE, Arrays.asList("validation_test", "integer", "abcd"), false);
- // VALIDATE_PROPORTIES_8("tosca.nodes.validateProporties_happyScenarios","validateProporties_happyScenarios", ActionStatus.OK, null, false);
-
- private String normativeName;
- private String folderName;
- private ActionStatus actionStatus;
- private Boolean validateAudit;
- private List<String> errorParams;
- private Boolean validateYaml;
-
- // private enum ActionStatus;
-
- private ImportTestTypesEnum(String resourceName, String folderName, ActionStatus actionStatus,
- List<String> errorParams, Boolean validateAudit) {
- this.normativeName = resourceName;
- this.folderName = folderName;
- this.actionStatus = actionStatus;
- this.errorParams = errorParams;
- this.validateAudit = validateAudit;
-
- }
-
- public String getNormativeName() {
- return normativeName;
- }
-
- public String getFolderName() {
- return folderName;
- }
-
- public ActionStatus getActionStatus() {
- return actionStatus;
- }
-
- public Boolean getvalidateAudit() {
- return validateAudit;
- }
-
- public List<String> getErrorParams() {
- return errorParams;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/LifeCycleStatesEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/LifeCycleStatesEnum.java
deleted file mode 100644
index 7c330a3d10..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/LifeCycleStatesEnum.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.enums;
-
-public enum LifeCycleStatesEnum {
-
- CHECKOUT("checkout", "NOT_CERTIFIED_CHECKOUT"),
- CHECKIN("checkin", "NOT_CERTIFIED_CHECKIN"),
- CERTIFICATIONREQUEST("certificationRequest", "READY_FOR_CERTIFICATION"),
- UNDOCHECKOUT("undoCheckout", ""),
- CANCELCERTIFICATION("cancelCertification", ""),
- STARTCERTIFICATION("startCertification", "CERTIFICATION_IN_PROGRESS"),
- FAILCERTIFICATION("failCertification", ""),
- CERTIFY("certify", "CERTIFIED");
-
- private String state;
- private String componentState;
-
- private LifeCycleStatesEnum(String state, String componentState) {
- this.state = state;
- this.componentState = componentState;
-
- }
-
- public String getState() {
- return state;
- }
-
- public String getComponentState() {
- return componentState;
- }
-
- public static LifeCycleStatesEnum findByCompState(String compState) {
-
- for (LifeCycleStatesEnum lifeCycleStatesEnum : LifeCycleStatesEnum.values()) {
- if (lifeCycleStatesEnum.getComponentState().equals(compState)) {
- return lifeCycleStatesEnum;
- }
- }
-
- return null;
-
- }
-
- public static LifeCycleStatesEnum findByState(String state) {
-
- for (LifeCycleStatesEnum lifeCycleStatesEnum : LifeCycleStatesEnum.values()) {
- if (lifeCycleStatesEnum.name().equals(state)) {
- return lifeCycleStatesEnum;
- }
- }
-
- return null;
-
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/MandatoryResourceArtifactTypeEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/MandatoryResourceArtifactTypeEnum.java
deleted file mode 100644
index 58892439b0..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/MandatoryResourceArtifactTypeEnum.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.enums;
-
-import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
-
-public enum MandatoryResourceArtifactTypeEnum {
-
- TEST_SCRIPTS(null, "testscripts"), FEATURES(null, "features"), CAPACITY(null, "capacity"), VENDOR_TEST_RESULT(null, "vendortestresult"), CLOUD_QUESTIONNAIRE(null, "cloudQuestionnaire");
-
- String artifactName;
- String logicalName;
-
- private MandatoryResourceArtifactTypeEnum(String artifactName, String logicalName) {
- this.artifactName = artifactName;
- this.logicalName = logicalName;
- }
-
- public String getArtifactName() {
- return artifactName;
- }
-
- public String getLogicalName() {
- return logicalName;
- }
-
- public ArtifactGroupTypeEnum getGroupType() {
- return ArtifactGroupTypeEnum.INFORMATIONAL;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/MandatoryServiceArtifactTypeEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/MandatoryServiceArtifactTypeEnum.java
deleted file mode 100644
index b73d5a8fee..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/MandatoryServiceArtifactTypeEnum.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.enums;
-
-public enum MandatoryServiceArtifactTypeEnum {
-
- MESSAGE_FLOWS(null, "messageflows".toLowerCase(), "Message Flows"),
- INSTANT_FLOWS(null, "instantiationflows".toLowerCase(), "Management Flows"),
- SERVICE_ART_PLAN(null, "serviceartifactplan".toLowerCase(), "Service Artifact Plan"),
- SUM_OF_ELEMENTS(null, "summaryofimpactstoecompelements".toLowerCase(), "Summary of impacts to ECOMP elements,OSSs, BSSs"),
- CONTROL_LOOP_FUN(null, "controlloopfunctions".toLowerCase(), "Control Loop Functions"),
- DIMENSIONNING_INFO(null, "dimensioninginfo".toLowerCase(), "Dimensioning Info"),
- AFFINITY_RULES(null, "affinityrules".toLowerCase(), "Affinity Rules"),
- OPERATIONAL_POLICIES(null, "operationalpolicies".toLowerCase(), "Operational Policies"),
- SERVICE_SPECIFIC_POLICIES(null, "servicespecificpolicies".toLowerCase(), "Service-specific Policies"),
- ENGINEERING_RULES(null, "engineeringrules".toLowerCase(), "Engineering Rules (ERD)"),
- DISTRIB_INSTRUCTIONS(null, "distributioninstructions".toLowerCase(), "Distribution Instructions"),
- DEPLOYMENT_VOTING_REC(null, "deploymentvotingrecord".toLowerCase(), "Deployment Voting Record"),
- CERTIFICATION_TEST_RESULT(null, "certificationtestresults".toLowerCase(), "TD Certification Test Results");
- // SERVICE_QUESTIONNAIRE(null, "serviceQuestionnaire".toLowerCase());
-
- String artifactName;
- String logicalName;
- String artifactDisplayName;
-
- private MandatoryServiceArtifactTypeEnum(String artifactName, String logicalName, String artifactDisplayName) {
- this.artifactName = artifactName;
- this.logicalName = logicalName;
- this.artifactDisplayName = artifactDisplayName;
- }
-
- public String getArtifactName() {
- return artifactName;
- }
-
- public String getLogicalName() {
- return logicalName;
- }
-
- public String getArtifactDisplayName() {
- return artifactDisplayName;
- }
-
- public void setArtifactDisplayName(String artifactDisplayName) {
- this.artifactDisplayName = artifactDisplayName;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/NormativeTypesEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/NormativeTypesEnum.java
deleted file mode 100644
index 389b962f1c..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/NormativeTypesEnum.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.enums;
-
-public enum NormativeTypesEnum {
- ROOT("tosca.nodes.Root", "root"), COMPUTE("tosca.nodes.Compute", "compute"), BLOCK_STORAGE("tosca.nodes.BlockStorage", "blockStorage"), CONTAINER_APPLICATION("tosca.nodes.Container.Application", "containerApplication"),
- CONTAINER_RUNTIME("tosca.nodes.Container.Runtime","containerRuntime"), DATABASE("tosca.nodes.Database", "database"), DBMS("tosca.nodes.DBMS", "DBMS"), LOAD_BALANCER("tosca.nodes.LoadBalancer", "loadBalancer"),
- OBJECT_STORAGE("tosca.nodes.ObjectStorage", "objectStorage"), NETWORK("tosca.nodes.network.Network", "network"), PORT("tosca.nodes.network.Port", "port"), SOFTWARE_COMPONENT("tosca.nodes.SoftwareComponent", "softwareComponent"),
- WEB_APPLICATION("tosca.nodes.webapplication","webApplication"), WEB_SERVER("tosca.nodes.WebServer", "webServer");
-
- public String normativeName;
- private String folderName;
-
- private NormativeTypesEnum(String resourceName, String folderName) {
- this.normativeName = resourceName;
- this.folderName = folderName;
- }
-
- public String getNormativeName() {
- return normativeName;
- }
-
- public String getFolderName() {
- return folderName;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/OriginTypeEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/OriginTypeEnum.java
deleted file mode 100644
index d85a496241..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/OriginTypeEnum.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.enums;
-
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-
-public enum OriginTypeEnum {
- PRODUCT("Product", "Product", "product instance", ComponentTypeEnum.PRODUCT),
- SERVICE("Service", "Service", "service instance", ComponentTypeEnum.SERVICE),
- VF("VF", "VF (Virtual Function)", "resource instance", ComponentTypeEnum.RESOURCE),
- VFC("VFC", "VFC (Virtual Function Component)", "resource instance", ComponentTypeEnum.RESOURCE),
- CP("CP", "CP (Connection Point)", "resource instance", ComponentTypeEnum.RESOURCE),
- VL("VL", "VL (Virtual Link)", "resource instance", ComponentTypeEnum.RESOURCE),
- VFCMT("VFCMT", "VFCMT (VFC Monitoring Template)", "resource instance", ComponentTypeEnum.RESOURCE),
- VFi("VFi", "VFi (Virtual Function Instance)", "resource instance", ComponentTypeEnum.RESOURCE_INSTANCE);
-
-
- private String value;
- private String displayValue;
- private String instanceType;
- private ComponentTypeEnum componentType;
-
- private OriginTypeEnum(String value, String displayValue, String instanceType, ComponentTypeEnum componentType) {
- this.value = value;
- this.displayValue = displayValue;
- this.instanceType = instanceType;
- this.componentType = componentType;
- }
-
- public String getValue() {
- return value;
- }
-
- public String getDisplayValue() {
- return displayValue;
- }
-
- public String getInstanceType() {
- return instanceType;
- }
-
- public ComponentTypeEnum getComponentType() {
- return componentType;
- }
-
- public static OriginTypeEnum findByValue(String value) {
- OriginTypeEnum ret = null;
- for (OriginTypeEnum curr : OriginTypeEnum.values()) {
- if (curr.getValue().equals(value)) {
- ret = curr;
- break;
- }
- }
- return ret;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/PropertyTypeEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/PropertyTypeEnum.java
deleted file mode 100644
index b5550fcdd3..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/PropertyTypeEnum.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.enums;
-
-import org.openecomp.sdc.be.datatypes.elements.SchemaDefinition;
-import org.openecomp.sdc.be.model.PropertyDefinition;
-import org.openecomp.sdc.be.model.tosca.ToscaPropertyType;
-
-public enum PropertyTypeEnum {
- INTEGER("defaultIntegerPropName1", "integer", "125", "346", "default integer type property description", "updated integer type property description",null),
- STRING("defaultStringPropName1", "string", "string", "updated string","default string type property description", "updated string type property description",null),
- BOOLEAN("defaultBooleanPropName1", "boolean", "true", "false","default boolean type property description", "updated boolean type property description",null),
- FLOAT("defaultFloatPropName1", "float", "1.2", "3.4","default float type property description", "updated float type property description",null),
- STRING_LIST("defaultStringListPropName", "list", "[a,b]", "[c,d]","outer description", "updated outer description", getDefaultStringSchema(ToscaPropertyType.STRING.getType())),
- INTEGER_LIST("defaultIntegerListPropName", "list", "[1,2]", "[3,4]","outer description", "updated outer description", getDefaultStringSchema(ToscaPropertyType.INTEGER.getType())),
- BOOLEAN_LIST("defaultBooleanListPropName", "list", "[true,false]", "[false,true]","outer description", "updated outer description", getDefaultStringSchema(ToscaPropertyType.BOOLEAN.getType())),
- FLOAT_LIST("defaultFloatMapPropName", "list", "[1.0,2.0]", "[3.0,4.0]","outer description", "updated outer description", getDefaultStringSchema(ToscaPropertyType.FLOAT.getType())),
- STRING_MAP("defaultStringMapPropName", "map", "{\"key1\":val1 , \"key2\":val2}", "{\"key1\":val11 , \"key2\":val22}", "outer description", "updated outer description",getDefaultStringSchema(ToscaPropertyType.STRING.getType())),
- INTEGER_MAP("defaultIntegerMapPropName", "map", "{\"key1\":123 , \"key2\":-456}", "{\"key1\":456 , \"key2\":-789}", "outer description", "updated outer description", getDefaultStringSchema(ToscaPropertyType.INTEGER.getType())),
- BOOLEAN_MAP("defaultBooleanMapPropName", "map", "{\"key1\":true , \"key2\":false}", "{\"key1\":false , \"key2\":true}", "outer description", "updated outer description",getDefaultStringSchema(ToscaPropertyType.BOOLEAN.getType())),
- FLOAT_MAP("defaultFloatMapPropName", "map", "{\"key1\":0.2123 , \"key2\":43.545f}", "{\"key1\":0.5678 , \"key2\":12.789f}","outer description", "updated outer description", getDefaultStringSchema(ToscaPropertyType.FLOAT.getType()));
-
- private String name;
- private String type;
- private String value;
- private String updateValue;
- private String description;
- private String updateDescription;
- private SchemaDefinition schemaDefinition;
-
- private PropertyTypeEnum(String name, String type, String value, String updateValue,String description,String updateDescription,
- SchemaDefinition schemaDefinition) {
- this.name = name;
- this.type = type;
- this.value = value;
- this.updateValue = updateValue;
- this.description = description;
- this.updateDescription = updateDescription;
- this.schemaDefinition = schemaDefinition;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-
- public String getUpdateValue() {
- return updateValue;
- }
-
- public void setUpdateValue(String updateValue) {
- this.updateValue = updateValue;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public String getUpdateDescription() {
- return updateDescription;
- }
-
- public void setUpdateDescription(String updateDescription) {
- this.updateDescription = updateDescription;
- }
-
- public SchemaDefinition getSchemaDefinition() {
- return schemaDefinition;
- }
-
- public void setSchemaDefinition(SchemaDefinition schemaDefinition) {
- this.schemaDefinition = schemaDefinition;
- }
-
- private static SchemaDefinition getDefaultStringSchema(String innerType) {
- SchemaDefinition schema = new SchemaDefinition();
- String description = "inner description";
- PropertyDefinition property = new PropertyDefinition();
- property.setType(innerType);
- property.setDescription(description);
- schema.setProperty(property);
- return schema;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ResourceCategoryEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ResourceCategoryEnum.java
deleted file mode 100644
index 1ba6c5c7f1..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ResourceCategoryEnum.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.enums;
-
-import java.util.Random;
-
-public enum ResourceCategoryEnum {
-
- NETWORK_L2_3_ROUTERS("Network L2-3", "Router", "resourceNewCategory.network l2-3", "resourceNewCategory.network l2-3.router"),
- NETWORK_L2_3_GETEWAY("Network L2-3","Gateway", "resourceNewCategory.network l2-3", "resourceNewCategory.network l2-3.gateway"),
- NETWORK_L2_3_WAN_CONNECTORS("Network L2-3", "WAN Connectors", "resourceNewCategory.network l2-3", "resourceNewCategory.network l2-3.lan connectors"),
- NETWORK_L2_3_LAN_CONNECTORS("Network L2-3", "LAN Connectors", "resourceNewCategory.network l2-3", "resourceNewCategory.network l2-3.wan connectors"),
- NETWORK_L2_3_INFRASTRUCTURE("Network L2-3", "Infrastructure", "resourceNewCategory.network l2-3", "resourceNewCategory.network l2-3.infrastructure"),
-
- NETWORK_L4("Network L4+", "Common Network Resources", "resourceNewCategory.network l4+", "resourceNewCategory.network l4+.common network resources"),
-
- APPLICATION_L4_BORDER("Application L4+", "Border Element", "resourceNewCategory.application l4+", "resourceNewCategory.application l4+.border element"),
- APPLICATION_L4_APP_SERVER("Application L4+", "Application Server", "resourceNewCategory.application l4+", "resourceNewCategory.application l4+.application server"),
- APPLICATION_L4_WEB_SERVERS("Application L4+", "Web Server", "resourceNewCategory.application l4+", "resourceNewCategory.application l4+.web server"),
- APPLICATION_L4_CALL_CONTROL("Application L4+","Call Control", "resourceNewCategory.application l4+", "resourceNewCategory.application l4+.call control"),
- APPLICATION_L4_MEDIA_SERVER("Application L4+", "Media Servers", "resourceNewCategory.application l4+", "resourceNewCategory.application l4+.media servers"),
- APPLICATION_L4_LOAD_BALANCER("Application L4+", "Load Balancer", "resourceNewCategory.application l4+", "resourceNewCategory.application l4+.load balancer"),
- APPLICATION_L4_DATABASE("Application L4+","Database", "resourceNewCategory.application l4+", "resourceNewCategory.application l4+.database"),
- APPLICATION_L4_FIREWALL("Application L4+", "Firewall", "resourceNewCategory.application l4+", "resourceNewCategory.application l4+.firewall"),
-
- GENERIC_INFRASTRUCTURE("Generic", "Infrastructure", "resourceNewCategory.generic", "resourceNewCategory.generic.infrastructure"),
- GENERIC_ABSTRACT("Generic", "Abstract", "resourceNewCategory.generic", "resourceNewCategory.generic.abstract"),
- GENERIC_NETWORK_ELEMENTS("Generic","Network Elements", "resourceNewCategory.generic", "resourceNewCategory.generic.network elements"),
- GENERIC_DATABASE("Generic", "Database", "resourceNewCategory.generic", "resourceNewCategory.generic.database"),
- GENERIC_RULES("Generic", "Rules", "resourceNewCategory.generic", "resourceNewCategory.generic.rules"),
-
- NETWORK_CONNECTIVITY_CON_POINT("Network Connectivity", "Connection Points", "resourceNewCategory.network connectivity", "resourceNewCategory.network connectivity.connection points"),
- NETWORK_CONNECTIVITY_VIRTUAL_LINK("Network Connectivity","Virtual Links", "resourceNewCategory.network connectivity", "resourceNewCategory.network connectivity.virtual links"),
-
- TEMPLATE_MONITORING_TEMPLATE("Template", "Monitoring Template", "resourceNewCategory.template", "resourceNewCategory.template.monitoring template"),
-
- ALLOTTED_RESOURCE("Allotted Resource", "Allotted Resource", "resourceNewCategory.allotted resource", "resourceNewCategory.allotted resource.allotted resource"),
- ALLOTTED_RESOURCE_SERVICE_ADMIN("Allotted Resource", "Service Admin", "resourceNewCategory.allotted resource", "resourceNewCategory.allotted resource.service admin"),
- ALLOTTED_RESOURCE_CONTRAIL_ROUTE("Allotted Resource", "Contrail Route", "resourceNewCategory.allotted resource", "resourceNewCategory.allotted resource.contrail route"),
- ALLOTTED_RESOURCE_TUNNEL_XCONNECT("Allotted Resource", "Tunnel XConnect", "resourceNewCategory.allotted resource", "resourceNewCategory.allotted resource.tunnel xconnect"),
- ALLOTTED_RESOURCE_IP_MUX_DEMUX("Allotted Resource", "IP Mux Demux", "resourceNewCategory.allotted resource", "resourceNewCategory.allotted resource.ip mux demux"),
- ALLOTTED_RESOURCE_SECURITY_ZONE("Allotted Resource", "Security Zone", "resourceNewCategory.allotted resource", "resourceNewCategory.allotted resource.security zone"),
-
- DCAE_COMPONENT_MICROSERVICE("DCAE Component", "Microservice", "resourceNewCategory.dcae component", "resourceNewCategory.dcae component.microservice"),
- DCAE_COMPONENT_DATABASE("DCAE Component", "Database", "resourceNewCategory.dcae component", "resourceNewCategory.dcae component.database"),
- DCAE_COMPONENT_POLICY("DCAE Component", "policy", "resourceNewCategory.dcae component", "resourceNewCategory.dcae component.policy"),
- DCAE_COMPONENT_SOURCE("DCAE Component", "Source", "resourceNewCategory.dcae component", "resourceNewCategory.dcae component.source"),
- DCAE_COMPONENT_ANALYSTICS("DCAE Component", "Analytics", "resourceNewCategory.dcae component", "resourceNewCategory.dcae component.analytics"),
- DCAE_COMPONENT_UTILITY("DCAE Component", "Utility", "resourceNewCategory.dcae component", "resourceNewCategory.dcae component.utility"),
- DCAE_COMPONENT_COLLECTOR("DCAE Component", "Collector", "resourceNewCategory.dcae component", "resourceNewCategory.dcae component.collector"),
- ;
-
- private String category;
- private String subCategory;
- private String categoryUniqeId;
- private String subCategoryUniqeId;
-
- ResourceCategoryEnum(String category, String subCategory) {
- this.category = category;
- this.subCategory = subCategory;
- }
-
- private ResourceCategoryEnum(String category, String subCategory, String categoryUniqeId, String subCategoryUniqeId) {
- this.category = category;
- this.subCategory = subCategory;
- this.categoryUniqeId = categoryUniqeId;
- this.subCategoryUniqeId = subCategoryUniqeId;
- }
-
- public String getCategoryUniqeId() {
- return categoryUniqeId;
- }
-
- public void setCategoryUniqeId(String categoryUniqeId) {
- this.categoryUniqeId = categoryUniqeId;
- }
-
- public String getSubCategoryUniqeId() {
- return subCategoryUniqeId;
- }
-
- public void setSubCategoryUniqeId(String subCategoryUniqeId) {
- this.subCategoryUniqeId = subCategoryUniqeId;
- }
-
-
- public String getCategory() {
- return category;
- }
-
- public void setCategory(String category) {
- this.category = category;
- }
-
- public String getSubCategory() {
- return subCategory;
- }
-
- public void setSubCategory(String subCategory) {
- this.subCategory = subCategory;
- }
-
-
- public static ResourceCategoryEnum findEnumNameByValues(String category, String subCategory){
- for(ResourceCategoryEnum resourceCategoryEnum : ResourceCategoryEnum.values()) {
- if(resourceCategoryEnum.getCategory().equals(category) && resourceCategoryEnum.getSubCategory().equals(subCategory)){
- return resourceCategoryEnum;
- }
- }
- return null;
- }
-
-
- /**
- * @return random category enum except allotted category
- */
- public static ResourceCategoryEnum getRandomElement() {
- Random random = new Random();
- ResourceCategoryEnum resourceCategoryEnum = ResourceCategoryEnum.values()[random.nextInt(ResourceCategoryEnum.values().length)];
-
- if(!resourceCategoryEnum.toString().startsWith("ALLOTTED")){
- return resourceCategoryEnum;
- }else{
- return getRandomElement();
- }
- }
-
-
- /**
- * @return random allotted category enum
- */
- public static ResourceCategoryEnum getRandomAllottedElement() {
- Random random = new Random();
- ResourceCategoryEnum resourceCategoryEnum = ResourceCategoryEnum.values()[random.nextInt(ResourceCategoryEnum.values().length)];
-
- if(resourceCategoryEnum.toString().startsWith("ALLOTTED")){
- return resourceCategoryEnum;
- }else{
- return getRandomAllottedElement();
- }
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/RespJsonKeysEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/RespJsonKeysEnum.java
deleted file mode 100644
index a977e38fe2..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/RespJsonKeysEnum.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.enums;
-
-public enum RespJsonKeysEnum {
-
- IS_ABSTRACT("abstract"), UNIQUE_ID("uniqueId"), RESOURCE_NAME("name"), RESOURCE_VERSION("version"), TAGS("tags"), LIFE_CYCLE_STATE("lifecycleState"), DERIVED_FROM("derivedFrom"), RESOURCE_DESC("description"),
- VENDOR_NAME("vendorName"), VENDOR_RELEASE("vendorRelease"), CONTACT_ID("contactId"), ICON("icon"), HIGHEST_VERSION("highestVersion"), CREATOR_ATT_UID("creatorUserId"), CREATOR_FULL_NAME("creatorFullName"),
- LAST_UPDATER_ATT_UID("lastUpdaterUserId"), LAST_UPDATER_FULL_NAME("lastUpdaterFullName"), ARTIFACTS("artifacts"), DESCRIPTION("description"), UUID("uuid"), COST("cost"), LICENSE_TYPE("licenseType"),
- RESOURCE_TYPE("resourceType"), CATEGORIES("categories");
-
- private String respJsonKeyName;
-
- private RespJsonKeysEnum(String respJsonKeyName) {
- this.respJsonKeyName = respJsonKeyName;
- }
-
- public String getRespJsonKeyName() {
- return respJsonKeyName;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/SearchCriteriaEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/SearchCriteriaEnum.java
deleted file mode 100644
index f26423a35d..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/SearchCriteriaEnum.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.enums;
-
-
-
-public enum SearchCriteriaEnum {
-
- RESOURCE_TYPE("resourceType"), CATEGORY("category"), SUBCATEGORY("subCategory");
-
- private String value;
-
- private SearchCriteriaEnum(String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ServiceApiArtifactEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ServiceApiArtifactEnum.java
deleted file mode 100644
index 4cfcc8a558..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ServiceApiArtifactEnum.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.enums;
-
-public enum ServiceApiArtifactEnum {
- CONFIGURATION("Configuration".toLowerCase()), INSTANTIATION("Instantiation".toLowerCase()), MONITORING("Monitoring".toLowerCase()), REPORTING("Reporting".toLowerCase()), LOGGING("Logging".toLowerCase()), TESTING("Testing".toLowerCase());
-
- String logicalName;
-
- private ServiceApiArtifactEnum(String logicalName) {
- this.logicalName = logicalName;
- }
-
- public String getLogicalName() {
- return logicalName;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ServiceCategoriesEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ServiceCategoriesEnum.java
deleted file mode 100644
index 959315acff..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ServiceCategoriesEnum.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.enums;
-
-import java.util.Random;
-
-public enum ServiceCategoriesEnum {
-
- VOIP("VoIP Call Control"), MOBILITY("Mobility"), NETWORK_L4("Network L4+"), NETWORK_L3("Network L1-3"),
- PARTNERSERVICE("Partner Domain Service");
- String value;
-
- private ServiceCategoriesEnum(String value) {
- this.value = value;
- }
-
- public String getValue() {
-
- return value;
- }
-
- public static ServiceCategoriesEnum getRandomElement() {
- Random random = new Random();
- return ServiceCategoriesEnum.values()[random.nextInt(ServiceCategoriesEnum.values().length)];
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ServiceInstantiationType.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ServiceInstantiationType.java
deleted file mode 100644
index bba2fe6187..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ServiceInstantiationType.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.enums;
-
-public enum ServiceInstantiationType {
- A_LA_CARTE("A-la-carte"), MACRO("Macro");
-
- private String value;
-
- public String getValue() {
- return value;
- }
-
- private ServiceInstantiationType(String value) {
- this.value = value;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ToscaKeysEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ToscaKeysEnum.java
deleted file mode 100644
index 24adc49ebe..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/ToscaKeysEnum.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.enums;
-
-public enum ToscaKeysEnum {
-
- TOSCA_DEFINITION_VERSION("tosca_definitions_version"),
- METADATA("metadata"),
- IMPORTS("imports"),
- NODE_TYPES("node_types"),
- TOPOLOGY_TEMPLATE("topology_template"),
- ANNOTATION_TYPES("annotation_types");
-
- private String toscaKey;
-
- public String getToscaKey() {
- return toscaKey;
- }
-
- private ToscaKeysEnum(String toscaKey) {
- this.toscaKey = toscaKey;
- }
-
- public static ToscaKeysEnum findToscaKey(final String toscaKey) {
- for (ToscaKeysEnum toscaKeyEnum : ToscaKeysEnum.values()) {
- if (toscaKeyEnum.getToscaKey().equalsIgnoreCase(toscaKey)) {
- return toscaKeyEnum;
- }
- }
- return null;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/UserRoleEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/UserRoleEnum.java
deleted file mode 100644
index 65c7f9e206..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/UserRoleEnum.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.enums;
-
-import lombok.Getter;
-import lombok.Setter;
-import org.openecomp.sdc.ci.tests.config.UserCredentialsFromFile;
-import org.openecomp.sdc.ci.tests.datatypes.UserCredentials;
-
-@Getter
-public enum UserRoleEnum {
-
- ADMIN("admin"),
- ADMIN2("admin"),
- DESIGNER("designer"),
- DESIGNER2("designer"),
- TESTER("tester"),
- GOVERNOR("governor"),
- OPS("ops"),
- PRODUCT_STRATEGIST1("ops"),
- PRODUCT_STRATEGIST2("ops"),
- PRODUCT_STRATEGIST3("ops"),
- PRODUCT_MANAGER1("ops"),
- PRODUCT_MANAGER2("ops");
-
- private String userName;
- private UserCredentials credentials;
- private String password;
- @Setter
- private String userId;
- private String firstName;
- private String lastName;
- private String userRole;
-
- UserRoleEnum(final String userRole) {
- final UserCredentialsFromFile instance = UserCredentialsFromFile.getInstance();
- this.credentials = instance.getUserCredentialsByRole(userRole);
- this.userId = this.credentials.getUserId();
- this.firstName = this.credentials.getFirstName();
- this.lastName = this.credentials.getLastName();
- this.password = this.credentials.getPassword();
- this.userName = this.firstName + " " + this.lastName;
- this.userRole = userRole;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/XnfTypeEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/XnfTypeEnum.java
deleted file mode 100644
index db94817537..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/XnfTypeEnum.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.enums;
-
-public enum XnfTypeEnum {
-
- VNF ("VNF"),
- PNF ("PNF");
-
- private String value;
-
- private XnfTypeEnum(String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedArtifactAudit.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedArtifactAudit.java
deleted file mode 100644
index 344f353348..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedArtifactAudit.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.expected;
-
-public class ExpectedArtifactAudit {
-
- private String action;
- private String resourceName;
- private String resourceType;
- private String prevVersion;
- private String currVersion;
- private String modifier;
- private String prevState;
- private String currState;
- private String prevArtifactUuid;
- private String currArtifactUuid;
- private String artifactData;
- private String status;
- private String desc;
-
- public ExpectedArtifactAudit(String action, String resourceName, String resourceType, String prevVersion,
- String currVersion, String modifier, String prevState, String currState, String prevArtifactUuid,
- String currArtifactUuid, String artifactData, String status, String desc) {
- super();
- this.action = action;
- this.resourceName = resourceName;
- this.resourceType = resourceType;
- this.prevVersion = prevVersion;
- this.currVersion = currVersion;
- this.modifier = modifier;
- this.prevState = prevState;
- this.currState = currState;
- this.prevArtifactUuid = prevArtifactUuid;
- this.currArtifactUuid = currArtifactUuid;
- this.artifactData = artifactData;
- this.status = status;
- this.desc = desc;
- }
-
- public ExpectedArtifactAudit() {
- super();
- }
-
- public String getAction() {
- return action;
- }
-
- public void setAction(String action) {
- this.action = action;
- }
-
- public String getResourceName() {
- return resourceName;
- }
-
- public void setResourceName(String resourceName) {
- this.resourceName = resourceName;
- }
-
- public String getResourceType() {
- return resourceType;
- }
-
- public void setResourceType(String resourceType) {
- this.resourceType = resourceType;
- }
-
- public String getPrevVersion() {
- return prevVersion;
- }
-
- public void setPrevVersion(String prevVersion) {
- this.prevVersion = prevVersion;
- }
-
- public String getCurrVersion() {
- return currVersion;
- }
-
- public void setCurrVersion(String currVersion) {
- this.currVersion = currVersion;
- }
-
- public String getModifier() {
- return modifier;
- }
-
- public void setModifier(String modifier) {
- this.modifier = modifier;
- }
-
- public String getPrevState() {
- return prevState;
- }
-
- public void setPrevState(String prevState) {
- this.prevState = prevState;
- }
-
- public String getCurrState() {
- return currState;
- }
-
- public void setCurrState(String currState) {
- this.currState = currState;
- }
-
- public String getPrevArtifactUuid() {
- return prevArtifactUuid;
- }
-
- public void setPrevArtifactUuid(String prevArtifactUuid) {
- this.prevArtifactUuid = prevArtifactUuid;
- }
-
- public String getCurrArtifactUuid() {
- return currArtifactUuid;
- }
-
- public void setCurrArtifactUuid(String currArtifactUuid) {
- this.currArtifactUuid = currArtifactUuid;
- }
-
- public String getArtifactData() {
- return artifactData;
- }
-
- public void setArtifactData(String artifactData) {
- this.artifactData = artifactData;
- }
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
- public String getDesc() {
- return desc;
- }
-
- public void setDesc(String desc) {
- this.desc = desc;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedAuthenticationAudit.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedAuthenticationAudit.java
deleted file mode 100644
index 0d6a5f3b3c..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedAuthenticationAudit.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.expected;
-
-public class ExpectedAuthenticationAudit {
-
- private String url;
- private String realm;
- private String user;
- private String action;
- private String authStatus;
-
- public ExpectedAuthenticationAudit(String url, String user, String action, String authStatus) {
- super();
- this.url = url;
- this.user = user;
- this.action = action;
- this.authStatus = authStatus;
- this.realm = "ASDC";
- }
-
- public ExpectedAuthenticationAudit() {
-
- }
-
- public String getUrl() {
- return url;
- }
-
- public void setUrl(String url) {
- this.url = url;
- }
-
- public String getRealm() {
- return realm;
- }
-
- public void setRealm(String realm) {
- this.realm = realm;
- }
-
- public String getUser() {
- return user;
- }
-
- public void setUser(String user) {
- this.user = user;
- }
-
- public String getAction() {
- return action;
- }
-
- public void setAction(String action) {
- this.action = action;
- }
-
- public String getAuthStatus() {
- return authStatus;
- }
-
- public void setAuthStatus(String authStatus) {
- this.authStatus = authStatus;
- }
-
- @Override
- public String toString() {
- return "ExpectedAuthenticationAudit [url=" + url + ", realm=" + realm + ", user=" + user + ", action=" + action
- + ", authStatus=" + authStatus + "]";
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedCategoryAudit.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedCategoryAudit.java
deleted file mode 100644
index b11f7f585a..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedCategoryAudit.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.expected;
-
-public class ExpectedCategoryAudit {
- String action;
- String modifier;
- String modifierUid;
- String modifierName;
- String categoryName;
- String subCategoryName;
- String groupingName;
- String resourceType;
- String status;
- String desc;
- String details;
-
- public ExpectedCategoryAudit(String action, String modifier, String categoryName, String subCategoryName,
- String groupingName, String resourceType, String status, String desc) {
- super();
- this.action = action;
- this.modifier = modifier;
- this.categoryName = categoryName;
- this.subCategoryName = subCategoryName;
- this.groupingName = groupingName;
- this.resourceType = resourceType;
- this.status = status;
- this.desc = desc;
- }
-
- public ExpectedCategoryAudit() {
- action = null;
- modifier = null;
- categoryName = null;
- subCategoryName = null;
- groupingName = null;
- resourceType = null;
- status = null;
- desc = null;
- details = null;
- modifierName = null;
- modifierUid = null;
- }
-
- public String getAction() {
- return action;
- }
-
- public void setAction(String action) {
- this.action = action;
- }
-
- public String getModifier() {
- return modifier;
- }
-
- public void setModifier(String modifier) {
- this.modifier = modifier;
- }
-
- public String getCategoryName() {
- return categoryName;
- }
-
- public void setCategoryName(String categoryName) {
- this.categoryName = categoryName;
- }
-
- public String getSubCategoryName() {
- return subCategoryName;
- }
-
- public void setSubCategoryName(String subCategoryName) {
- this.subCategoryName = subCategoryName;
- }
-
- public String getGroupingName() {
- return groupingName;
- }
-
- public void setGroupingName(String groupingName) {
- this.groupingName = groupingName;
- }
-
- public String getResourceType() {
- return resourceType;
- }
-
- public void setResourceType(String resourceType) {
- this.resourceType = resourceType;
- }
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
- public String getDesc() {
- return desc;
- }
-
- public void setDesc(String desc) {
- this.desc = desc;
- }
-
- public String getDetails() {
- return details;
- }
-
- public void setDetails(String details) {
- this.details = details;
- }
-
- public String getModifierUid() {
- return modifierUid;
- }
-
- public void setModifierUid(String modifierUid) {
- this.modifierUid = modifierUid;
- }
-
- public String getModifierName() {
- return modifierName;
- }
-
- public void setModifierName(String modifierName) {
- this.modifierName = modifierName;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedDistDownloadAudit.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedDistDownloadAudit.java
deleted file mode 100644
index 4b135f66f6..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedDistDownloadAudit.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.expected;
-
-public class ExpectedDistDownloadAudit {
-
- String action;
- String consumerId;
- String resourceUrl;
- String status;
- String desc;
-
- public ExpectedDistDownloadAudit(String action, String consumerId, String resourceUrl, String status, String desc) {
- super();
- this.action = action;
- this.consumerId = consumerId;
- this.resourceUrl = resourceUrl;
- this.status = status;
- this.desc = desc;
- }
-
- public String getAction() {
- return action;
- }
-
- public void setAction(String action) {
- this.action = action;
- }
-
- public String getConsumerId() {
- return consumerId;
- }
-
- public void setConsumerId(String consumerId) {
- this.consumerId = consumerId;
- }
-
- public String getResourceUrl() {
- return resourceUrl;
- }
-
- public void setResourceUrl(String resourceUrl) {
- this.resourceUrl = resourceUrl;
- }
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
- public String getDesc() {
- return desc;
- }
-
- public void setDesc(String desc) {
- this.desc = desc;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedEcomConsumerAudit.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedEcomConsumerAudit.java
deleted file mode 100644
index 1414742423..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedEcomConsumerAudit.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.expected;
-
-public class ExpectedEcomConsumerAudit {
-
- String action;
- String modifier;
- String ecomUser;
- String status;
- String desc;
-
- public ExpectedEcomConsumerAudit(String action, String modifier, String ecomUser, String status, String desc) {
- super();
- this.action = action;
- this.modifier = modifier;
- this.ecomUser = ecomUser;
- this.status = status;
- this.desc = desc;
- }
-
- public ExpectedEcomConsumerAudit() {
- action = null;
- modifier = null;
- ecomUser = null;
- status = null;
- desc = null;
- }
-
- public String getAction() {
- return action;
- }
-
- public void setAction(String action) {
- this.action = action;
- }
-
- public String getModifier() {
- return modifier;
- }
-
- public void setModifier(String modifier) {
- this.modifier = modifier;
- }
-
- public String getEcomUser() {
- return ecomUser;
- }
-
- public void setEcomUser(String ecomUser) {
- this.ecomUser = ecomUser;
- }
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
- public String getDesc() {
- return desc;
- }
-
- public void setDesc(String desc) {
- this.desc = desc;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedExternalAudit.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedExternalAudit.java
deleted file mode 100644
index bc15a0e983..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedExternalAudit.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.expected;
-
-public class ExpectedExternalAudit {
-
- String ACTION;
- String CONSUMER_ID;
- String RESOURCE_URL;
- String STATUS;
- String DESC;
- String RESOURCE_NAME;
- String RESOURCE_TYPE;
- String SERVICE_INSTANCE_ID;// resource/ service UUID
- String MODIFIER;
- String PREV_ARTIFACT_UUID;
- String CURR_ARTIFACT_UUID;
- String ARTIFACT_DATA;
-
- public ExpectedExternalAudit() {
- super();
- }
-
- public String getRESOURCE_NAME() {
- return RESOURCE_NAME;
- }
-
- public void setRESOURCE_NAME(String rESOURCE_NAME) {
- RESOURCE_NAME = rESOURCE_NAME;
- }
-
- public String getRESOURCE_TYPE() {
- return RESOURCE_TYPE;
- }
-
- public void setRESOURCE_TYPE(String rESOURCE_TYPE) {
- RESOURCE_TYPE = rESOURCE_TYPE;
- }
-
- public String getSERVICE_INSTANCE_ID() {
- return SERVICE_INSTANCE_ID;
- }
-
- public void setSERVICE_INSTANCE_ID(String sERVICE_INSTANCE_ID) {
- SERVICE_INSTANCE_ID = sERVICE_INSTANCE_ID;
- }
-
- public ExpectedExternalAudit(String aCTION, String cONSUMER_ID, String rESOURCE_URL, String sTATUS, String dESC,
- String rESOURCE_NAME, String rESOURCE_TYPE, String sERVICE_INSTANCE_ID) {
- super();
- ACTION = aCTION;
- CONSUMER_ID = cONSUMER_ID;
- RESOURCE_URL = rESOURCE_URL;
- STATUS = sTATUS;
- DESC = dESC;
- RESOURCE_NAME = rESOURCE_NAME;
- RESOURCE_TYPE = rESOURCE_TYPE;
- SERVICE_INSTANCE_ID = sERVICE_INSTANCE_ID;
- }
-
- public ExpectedExternalAudit(String aCTION, String cONSUMER_ID, String rESOURCE_URL, String sTATUS, String dESC) {
- super();
- ACTION = aCTION;
- CONSUMER_ID = cONSUMER_ID;
- RESOURCE_URL = rESOURCE_URL;
- STATUS = sTATUS;
- DESC = dESC;
- }
-
- public ExpectedExternalAudit(String aCTION, String cONSUMER_ID, String rESOURCE_URL, String sTATUS, String dESC,
- String rESOURCE_NAME, String rESOURCE_TYPE, String sERVICE_INSTANCE_ID, String mODIFIER,
- String pREV_ARTIFACT_UUID, String cURR_ARTIFACT_UUID, String aRTIFACT_DATA) {
- super();
- ACTION = aCTION;
- CONSUMER_ID = cONSUMER_ID;
- RESOURCE_URL = rESOURCE_URL;
- STATUS = sTATUS;
- DESC = dESC;
- RESOURCE_NAME = rESOURCE_NAME;
- RESOURCE_TYPE = rESOURCE_TYPE;
- SERVICE_INSTANCE_ID = sERVICE_INSTANCE_ID;
- MODIFIER = mODIFIER;
- PREV_ARTIFACT_UUID = pREV_ARTIFACT_UUID;
- CURR_ARTIFACT_UUID = cURR_ARTIFACT_UUID;
- ARTIFACT_DATA = aRTIFACT_DATA;
- }
-
- public String getACTION() {
- return ACTION;
- }
-
- public void setACTION(String aCTION) {
- ACTION = aCTION;
- }
-
- public String getCONSUMER_ID() {
- return CONSUMER_ID;
- }
-
- public void setCONSUMER_ID(String cONSUMER_ID) {
- CONSUMER_ID = cONSUMER_ID;
- }
-
- public String getRESOURCE_URL() {
- return RESOURCE_URL;
- }
-
- public void setRESOURCE_URL(String rESOURCE_URL) {
- RESOURCE_URL = rESOURCE_URL;
- }
-
- public String getSTATUS() {
- return STATUS;
- }
-
- public void setSTATUS(String sTATUS) {
- STATUS = sTATUS;
- }
-
- public String getDESC() {
- return DESC;
- }
-
- public void setDESC(String dESC) {
- DESC = dESC;
- }
-
- public String getMODIFIER() {
- return MODIFIER;
- }
-
- public void setMODIFIER(String mODIFIER) {
- MODIFIER = mODIFIER;
- }
-
- public String getPREV_ARTIFACT_UUID() {
- return PREV_ARTIFACT_UUID;
- }
-
- public void setPREV_ARTIFACT_UUID(String pREV_ARTIFACT_UUID) {
- PREV_ARTIFACT_UUID = pREV_ARTIFACT_UUID;
- }
-
- public String getCURR_ARTIFACT_UUID() {
- return CURR_ARTIFACT_UUID;
- }
-
- public void setCURR_ARTIFACT_UUID(String cURR_ARTIFACT_UUID) {
- CURR_ARTIFACT_UUID = cURR_ARTIFACT_UUID;
- }
-
- public String getARTIFACT_DATA() {
- return ARTIFACT_DATA;
- }
-
- public void setARTIFACT_DATA(String aRTIFACT_DATA) {
- ARTIFACT_DATA = aRTIFACT_DATA;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedGetUserListAudit.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedGetUserListAudit.java
deleted file mode 100644
index 561b92a317..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedGetUserListAudit.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.expected;
-
-public class ExpectedGetUserListAudit {
-
- String action;
- String modifier;
- String status;
- String desc;
- String details;
-
- public ExpectedGetUserListAudit(String action, String modifier, String status, String desc, String details) {
- super();
- this.action = action;
- this.modifier = modifier;
- this.status = status;
- this.desc = desc;
- this.details = details;
- }
-
- public ExpectedGetUserListAudit() {
- action = null;
- modifier = null;
- details = null;
- status = null;
- desc = null;
- }
-
- public String getAction() {
- return action;
- }
-
- public void setAction(String action) {
- this.action = action;
- }
-
- public String getModifier() {
- return modifier;
- }
-
- public void setModifier(String modifier) {
- this.modifier = modifier;
- }
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
- public String getDesc() {
- return desc;
- }
-
- public void setDesc(String desc) {
- this.desc = desc;
- }
-
- public String getDetails() {
- return details;
- }
-
- public void setDetails(String details) {
- this.details = details;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedGroupingAudit.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedGroupingAudit.java
deleted file mode 100644
index b481cb77af..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedGroupingAudit.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.expected;
-
-public class ExpectedGroupingAudit {
- String action;
- String modifier;
- String categoryName;
- String subCategoryName;
- String groupingName;
- String resourceType;
- String status;
- String desc;
-
- public ExpectedGroupingAudit(String action, String modifier, String categoryName, String subCategoryName,
- String groupingName, String resourceType, String status, String desc) {
- super();
- this.action = action;
- this.modifier = modifier;
- this.categoryName = categoryName;
- this.subCategoryName = subCategoryName;
- this.groupingName = groupingName;
- this.resourceType = resourceType;
- this.status = status;
- this.desc = desc;
- }
-
- public ExpectedGroupingAudit() {
- action = null;
- modifier = null;
- categoryName = null;
- subCategoryName = null;
- groupingName = null;
- resourceType = null;
- status = null;
- desc = null;
- }
-
- public String getAction() {
- return action;
- }
-
- public void setAction(String action) {
- this.action = action;
- }
-
- public String getModifier() {
- return modifier;
- }
-
- public void setModifier(String modifier) {
- this.modifier = modifier;
- }
-
- public String getCategoryName() {
- return categoryName;
- }
-
- public void setCategoryName(String categoryName) {
- this.categoryName = categoryName;
- }
-
- public String getSubCategoryName() {
- return subCategoryName;
- }
-
- public void setSubCategoryName(String subCategoryName) {
- this.subCategoryName = subCategoryName;
- }
-
- public String getGroupingName() {
- return groupingName;
- }
-
- public void setGroupingName(String groupingName) {
- this.groupingName = groupingName;
- }
-
- public String getResourceType() {
- return resourceType;
- }
-
- public void setResourceType(String resourceType) {
- this.resourceType = resourceType;
- }
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
- public String getDesc() {
- return desc;
- }
-
- public void setDesc(String desc) {
- this.desc = desc;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedProductAudit.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedProductAudit.java
deleted file mode 100644
index 40b86fa528..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedProductAudit.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.expected;
-
-public class ExpectedProductAudit {
-
- String ACTION;
- String MODIFIER;
- String STATUS;
- String DESC;
- String RESOURCE_NAME;
- String RESOURCE_TYPE;
- String PREV_VERSION;
- String CURR_VERSION;
- String PREV_STATE;
- String CURR_STATE;
- String TIMESTAMP;
- String SERVICE_INSTANCE_ID;
- String COMMENT;
-
- public String getCOMMENT() {
- return COMMENT;
- }
-
- public void setCOMMENT(String cOMMENT) {
- COMMENT = cOMMENT;
- }
-
- public String getSERVICE_INSTANCE_ID() {
- return SERVICE_INSTANCE_ID;
- }
-
- public void setSERVICE_INSTANCE_ID(String sERVICE_INSTANCE_ID) {
- SERVICE_INSTANCE_ID = sERVICE_INSTANCE_ID;
- }
-
- public String getACTION() {
- return ACTION;
- }
-
- public void setACTION(String aCTION) {
- ACTION = aCTION;
- }
-
- public String getMODIFIER() {
- return MODIFIER;
- }
-
- public void setMODIFIER(String mODIFIER) {
- MODIFIER = mODIFIER;
- }
-
- public String getSTATUS() {
- return STATUS;
- }
-
- public void setSTATUS(String sTATUS) {
- STATUS = sTATUS;
- }
-
- public String getDESC() {
- return DESC;
- }
-
- public void setDESC(String dESC) {
- DESC = dESC;
- }
-
- public String getRESOURCE_NAME() {
- return RESOURCE_NAME;
- }
-
- public void setRESOURCE_NAME(String rESOURCE_NAME) {
- RESOURCE_NAME = rESOURCE_NAME;
- }
-
- public String getRESOURCE_TYPE() {
- return RESOURCE_TYPE;
- }
-
- public void setRESOURCE_TYPE(String rESOURCE_TYPE) {
- RESOURCE_TYPE = rESOURCE_TYPE;
- }
-
- public String getPREV_VERSION() {
- return PREV_VERSION;
- }
-
- public void setPREV_VERSION(String pREV_VERSION) {
- PREV_VERSION = pREV_VERSION;
- }
-
- public String getCURR_VERSION() {
- return CURR_VERSION;
- }
-
- public void setCURR_VERSION(String cURR_VERSION) {
- CURR_VERSION = cURR_VERSION;
- }
-
- public String getPREV_STATE() {
- return PREV_STATE;
- }
-
- public void setPREV_STATE(String pREV_STATE) {
- PREV_STATE = pREV_STATE;
- }
-
- public String getCURR_STATE() {
- return CURR_STATE;
- }
-
- public void setCURR_STATE(String cURR_STATE) {
- CURR_STATE = cURR_STATE;
- }
-
- public String getTIMESTAMP() {
- return TIMESTAMP;
- }
-
- public void setTIMESTAMP(String tIMESTAMP) {
- TIMESTAMP = tIMESTAMP;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedResourceAuditJavaObject.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedResourceAuditJavaObject.java
deleted file mode 100644
index 59ca7bbf7e..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedResourceAuditJavaObject.java
+++ /dev/null
@@ -1,310 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.expected;
-
-public class ExpectedResourceAuditJavaObject {
-
- String ACTION;
- String MODIFIER_NAME;
- String MODIFIER_UID;
- String STATUS;
- String DESC;
- String RESOURCE_NAME;
- String RESOURCE_TYPE;
- String PREV_VERSION;
- String CURR_VERSION;
- String PREV_STATE;
- String CURR_STATE;
- String TIMESTAMP;
- String ARTIFACT_DATA;
- String DPREV_STATUS;
- String DCURR_STATUS;
- String COMMENT;
- String DID;
- String TOPIC_NAME;
- String TOSCA_NODE_TYPE;
- String CURR_ARTIFACT_UUID;
- String PREV_ARTIFACT_UUID;
- String ARTIFACT_TIMEOUT;
- String MODIFIER;
- String SERVICE_INSTANCE_ID;
- String CONSUMER_ID;
- String RESOURCE_URL;
-
- // TODO: Remove comment
-// String INVARIANT_UUID;
-//
-// public String getINVARIANT_UUID() {
-// return INVARIANT_UUID;
-// }
-//
-// public void setINVARIANT_UUID(String invariant_uuid) {
-// INVARIANT_UUID = invariant_uuid;
-// }
-
- public String getCONSUMER_ID() {
- return CONSUMER_ID;
- }
-
- public void setCONSUMER_ID(String consumer_id) {
- CONSUMER_ID = consumer_id;
- }
-
- public String getRESOURCE_URL() {
- return RESOURCE_URL;
- }
-
- public void setRESOURCE_URL(String resource_url) {
- RESOURCE_URL = resource_url;
- }
-
- public String getSERVICE_INSTANCE_ID() {
- return SERVICE_INSTANCE_ID;
- }
-
- public void setSERVICE_INSTANCE_ID(String sERVICE_INSTANCE_ID) {
- SERVICE_INSTANCE_ID = sERVICE_INSTANCE_ID;
- }
-
- public String getMODIFIER() {
- return MODIFIER;
- }
-
- public void setMODIFIER(String mODIFIER) {
- MODIFIER = mODIFIER;
- }
-
- public String getArtifactTimeout() {
- return ARTIFACT_TIMEOUT;
- }
-
- public void setArtifactTimeout(String artifactTimeout) {
- this.ARTIFACT_TIMEOUT = artifactTimeout;
- }
-
- public String getCurrArtifactUuid() {
- return CURR_ARTIFACT_UUID;
- }
-
- public void setCurrArtifactUuid(String currArtifactUuid) {
- this.CURR_ARTIFACT_UUID = currArtifactUuid;
- }
-
- public String getPrevArtifactUuid() {
- return PREV_ARTIFACT_UUID;
- }
-
- public void setPrevArtifactUuid(String prevArtifactUuid) {
- this.PREV_ARTIFACT_UUID = prevArtifactUuid;
- }
-
- public String getToscaNodeType() {
- return TOSCA_NODE_TYPE;
- }
-
- public void setToscaNodeType(String ToscaNodeType) {
- this.TOSCA_NODE_TYPE = ToscaNodeType;
- }
-
- public String getTopicName() {
- return TOPIC_NAME;
- }
-
- public void setTopicName(String topicName) {
- this.TOPIC_NAME = topicName;
- }
-
- public String getDistributionId() {
- return DID;
- }
-
- public void setDistributionId(String did) {
- this.DID = did;
- }
-
- public ExpectedResourceAuditJavaObject() {
- super();
- }
-
- public ExpectedResourceAuditJavaObject(String action, String modifierName, String modifierUid, String status,
- String desc, String resourceName, String resourceType, String prevVersion, String currVersion,
- String prevState, String currState, String timestamp, String toscaNodesType, String timeout,
- String modifier, String serviceInstanceId) {
- super();
- this.ACTION = action;
- this.MODIFIER_NAME = modifierName;
- this.MODIFIER_UID = modifierUid;
- this.STATUS = status;
- this.DESC = desc;
- this.RESOURCE_NAME = resourceName;
- this.RESOURCE_TYPE = resourceType;
- this.PREV_VERSION = prevVersion;
- this.CURR_VERSION = currVersion;
- this.PREV_STATE = prevState;
- this.CURR_STATE = currState;
- this.TIMESTAMP = timestamp;
- this.TOSCA_NODE_TYPE = toscaNodesType;
- this.ARTIFACT_TIMEOUT = timeout;
- this.MODIFIER = modifier;
- this.SERVICE_INSTANCE_ID = serviceInstanceId;
- }
-
- public String getAction() {
- return ACTION;
- }
-
- public void setAction(String action) {
- this.ACTION = action;
- }
-
- public String getModifierName() {
- return MODIFIER_NAME;
- }
-
- public void setModifierName(String modifierName) {
- this.MODIFIER_NAME = modifierName;
- }
-
- public String getModifierUid() {
- return MODIFIER_UID;
- }
-
- public void setModifierUid(String modifierUid) {
- this.MODIFIER_UID = modifierUid;
- }
-
- public String getStatus() {
- return STATUS;
- }
-
- public void setStatus(String status) {
- this.STATUS = status;
- }
-
- public String getDesc() {
- return DESC;
- }
-
- public void setDesc(String desc) {
- this.DESC = desc;
- }
-
- public String getResourceName() {
- return RESOURCE_NAME;
- }
-
- public void setResourceName(String resourceName) {
- this.RESOURCE_NAME = resourceName;
- }
-
- public String getResourceType() {
- return RESOURCE_TYPE;
- }
-
- public void setResourceType(String resourceType) {
- this.RESOURCE_TYPE = resourceType;
- }
-
- public String getPrevVersion() {
- return PREV_VERSION;
- }
-
- public void setPrevVersion(String prevVersion) {
- this.PREV_VERSION = prevVersion;
- }
-
- public String getCurrVersion() {
- return CURR_VERSION;
- }
-
- public void setCurrVersion(String currVersion) {
- this.CURR_VERSION = currVersion;
- }
-
- public String getPrevState() {
- return PREV_STATE;
- }
-
- public void setPrevState(String prevState) {
- this.PREV_STATE = prevState;
- }
-
- public String getCurrState() {
- return CURR_STATE;
- }
-
- public void setCurrState(String currState) {
- this.CURR_STATE = currState;
- }
-
- public String getTimestamp() {
- return TIMESTAMP;
- }
-
- public void setTimestamp(String timestamp) {
- this.TIMESTAMP = timestamp;
- }
-
- public String getArtifactData() {
- return ARTIFACT_DATA;
- }
-
- public void setArtifactData(String artifactData) {
- this.ARTIFACT_DATA = artifactData;
- }
-
- public String getDprevStatus() {
- return DPREV_STATUS;
- }
-
- public void setDprevStatus(String dprevStatus) {
- this.DPREV_STATUS = dprevStatus;
- }
-
- public String getDcurrStatus() {
- return DCURR_STATUS;
- }
-
- public void setDcurrStatus(String dcurrStatus) {
- this.DCURR_STATUS = dcurrStatus;
- }
-
- public String getComment() {
- return COMMENT;
- }
-
- public void setComment(String comment) {
- this.COMMENT = comment;
- }
-
- @Override
- public String toString() {
- return "ExpectedResourceAuditJavaObject [ACTION=" + ACTION + ", STATUS=" + STATUS + ", DESC=" + DESC
- + ", RESOURCE_NAME=" + RESOURCE_NAME + ", RESOURCE_TYPE=" + RESOURCE_TYPE + ", PREV_VERSION="
- + PREV_VERSION + ", CURR_VERSION=" + CURR_VERSION + ", PREV_STATE=" + PREV_STATE + ", CURR_STATE="
- + CURR_STATE + ", TIMESTAMP=" + TIMESTAMP + ", ARTIFACT_DATA=" + ARTIFACT_DATA + ", DPREV_STATUS="
- + DPREV_STATUS + ", DCURR_STATUS=" + DCURR_STATUS + ", COMMENT=" + COMMENT + ", DID=" + DID
- + ", TOPIC_NAME=" + TOPIC_NAME + ", TOSCA_NODE_TYPE=" + TOSCA_NODE_TYPE + ", CURR_ARTIFACT_UUID="
- + CURR_ARTIFACT_UUID + ", PREV_ARTIFACT_UUID=" + PREV_ARTIFACT_UUID + ", ARTIFACT_TIMEOUT="
- + ARTIFACT_TIMEOUT + ", MODIFIER=" + MODIFIER + ", SERVICE_INSTANCE_ID=" + SERVICE_INSTANCE_ID + "]";
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedUserCRUDAudit.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedUserCRUDAudit.java
deleted file mode 100644
index 2bc8625057..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/expected/ExpectedUserCRUDAudit.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.expected;
-
-public class ExpectedUserCRUDAudit {
- String action;
- String modifier;
- String status;
- String desc;
- String userBefore;
- String userAfter;
-
- public ExpectedUserCRUDAudit(String action, String modifier, String status, String desc, String userBefore,
- String userAfter) {
- super();
- this.action = action;
- this.modifier = modifier;
- this.status = status;
- this.desc = desc;
- this.userBefore = userBefore;
- this.userAfter = userAfter;
- }
-
- public ExpectedUserCRUDAudit() {
- action = null;
- modifier = null;
- userBefore = null;
- userAfter = null;
- status = null;
- desc = null;
- }
-
- public String getAction() {
- return action;
- }
-
- public void setAction(String action) {
- this.action = action;
- }
-
- public String getModifier() {
- return modifier;
- }
-
- public void setModifier(String modifier) {
- this.modifier = modifier;
- }
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
- public String getDesc() {
- return desc;
- }
-
- public void setDesc(String desc) {
- this.desc = desc;
- }
-
- public String getUserBefore() {
- return userBefore;
- }
-
- public void setUserBefore(String userBefore) {
- this.userBefore = userBefore;
- }
-
- public String getUserAfter() {
- return userAfter;
- }
-
- public void setUserAfter(String userAfter) {
- this.userAfter = userAfter;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/HeaderData.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/HeaderData.java
deleted file mode 100644
index 2c23b08717..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/HeaderData.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.http;
-
-public class HeaderData {
- String contentMd5;
- String contentType;
- String HttpCspUserId;
- String HttpCspFirstName;
- String HttpCspLastName;
- String HttpCspWsType;
- String HttpIvRemoteAddress;
- String HttpIvUser;
-
- public HeaderData() {
- super();
- }
-
- public HeaderData(String contentMd5, String contentType, String httpCspUserId, String httpCspFirstName,
- String httpCspLastName, String httpCspWsType, String httpIvRemoteAddress, String httpIvUser) {
- super();
- this.contentMd5 = contentMd5;
- this.contentType = contentType;
- HttpCspUserId = httpCspUserId;
- HttpCspFirstName = httpCspFirstName;
- HttpCspLastName = httpCspLastName;
- HttpCspWsType = httpCspWsType;
- HttpIvRemoteAddress = httpIvRemoteAddress;
- HttpIvUser = httpIvUser;
- }
-
- public String getContentMd5() {
- return contentMd5;
- }
-
- public void setContentMd5(String contentMd5) {
- this.contentMd5 = contentMd5;
- }
-
- public String getContentType() {
- return contentType;
- }
-
- public void setContentType(String contentType) {
- this.contentType = contentType;
- }
-
- public String getHttpCspUserId() {
- return HttpCspUserId;
- }
-
- public void setHttpCspUserId(String httpCspUserId) {
- HttpCspUserId = httpCspUserId;
- }
-
- public String getHttpCspFirstName() {
- return HttpCspFirstName;
- }
-
- public void setHttpCspFirstName(String httpCspFirstName) {
- HttpCspFirstName = httpCspFirstName;
- }
-
- public String getHttpCspLastName() {
- return HttpCspLastName;
- }
-
- public void setHttpCspLastName(String httpCspLastName) {
- HttpCspLastName = httpCspLastName;
- }
-
- public String getHttpCspWsType() {
- return HttpCspWsType;
- }
-
- public void setHttpCspWsType(String httpCspWsType) {
- HttpCspWsType = httpCspWsType;
- }
-
- public String getHttpIvRemoteAddress() {
- return HttpIvRemoteAddress;
- }
-
- public void setHttpIvRemoteAddress(String httpIvRemoteAddress) {
- HttpIvRemoteAddress = httpIvRemoteAddress;
- }
-
- public String getHttpIvUser() {
- return HttpIvUser;
- }
-
- public void setHttpIvUser(String httpIvUser) {
- HttpIvUser = httpIvUser;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/HeaderValue.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/HeaderValue.java
deleted file mode 100644
index 4a2ad9ab82..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/HeaderValue.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.http;
-
-public enum HeaderValue {
-
- APPLICATION_JSON("application/json");
-
- String value;
-
- private HeaderValue(String value) {
- this.value = value;
- }
-
- public String getValue() {
-
- return value;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/HttpHeaderEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/HttpHeaderEnum.java
deleted file mode 100644
index cd3beee150..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/HttpHeaderEnum.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.http;
-
-public enum HttpHeaderEnum {
-
- Content_MD5("Content-MD5"),
- USER_ID("USER_ID"),
- HTTP_CSP_FIRSTNAME("HTTP_CSP_FIRSTNAME"),
- HTTP_CSP_LASTNAME("HTTP_CSP_LASTNAME"),
- HTTP_CSP_WSTYPE("HTTP_CSP_WSTYPE"),
- HTTP_IV_REMOTE_ADDRESS("HTTP_IV_REMOTE_ADDRESS"),
- HTTP_IV_USER("HTTP_IV_USER"),
- HTTP_CSP_EMAIL("HTTP_CSP_EMAIL"),
- CONTENT_TYPE("Content-Type"),
- ACCEPT("Accept"),
- X_ECOMP_REQUEST_ID_HEADER("X-ECOMP-RequestID"),
- CACHE_CONTROL("Cache-Control"),
- X_ECOMP_INSTANCE_ID("X-ECOMP-InstanceID"),
- AUTHORIZATION("Authorization"),
- CONTENT_LENGTH("Content-Length"),
- CONTENT_DISPOSITION("Content-Disposition"),
- HOST("Host"),
- X_ECOMP_SERVICE_ID_HEADER("X-ECOMP-ServiceID"),
- WWW_AUTHENTICATE("WWW-Authenticate"),
- ECOMP_PASSWORD("password"),
- ECOMP_USERNAME("username");
-
- String value;
-
- private HttpHeaderEnum(String value) {
- this.value = value;
- }
-
- public String getValue() {
-
- return value;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/HttpRequest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/HttpRequest.java
deleted file mode 100644
index ff01e7d999..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/HttpRequest.java
+++ /dev/null
@@ -1,524 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.http;
-
-import org.apache.commons.io.IOUtils;
-import org.apache.http.HttpEntity;
-import org.apache.http.annotation.NotThreadSafe;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClients;
-import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.net.ssl.HttpsURLConnection;
-import java.io.*;
-import java.net.HttpURLConnection;
-import java.net.URI;
-import java.net.URL;
-import java.nio.charset.Charset;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-public class HttpRequest {
- static Logger logger = LoggerFactory.getLogger(HttpRequest.class.getName());
-
-// -----------------------------Http------------------------------------------------------------------------
- public RestResponse httpSendGetInternal(String url, Map<String, String> headers) throws IOException {
-
- RestResponse restResponse = new RestResponse();
- url = url.replaceAll("\\s", "%20");
- URL obj = new URL(url);
- HttpURLConnection con = (HttpURLConnection) obj.openConnection();
- // optional default is GET
- con.setRequestMethod("GET");
- addHttpRequestHEaders(headers, con);
-
- int responseCode = con.getResponseCode();
- logger.debug("Send GET http request, url: {}",url);
- logger.debug("Response Code: {}",responseCode);
-
- StringBuffer response = new StringBuffer();
- String result;
- try {
-
- result = IOUtils.toString(con.getInputStream());
- response.append(result);
- } catch (Exception e) {
- logger.debug("Fail with exception", e);
- }
- try {
- result = IOUtils.toString(con.getErrorStream());
- response.append(result);
- } catch (Exception e) {
-// logger.debug("Fail with exception", e);
- }
-
- logger.debug("Response body: {}" ,response);
-
- // print result
- setHttpResponseToObject(restResponse, con, responseCode, response);
- con.disconnect();
-
- return restResponse;
- }
-
- public RestResponse httpSendByMethodInternal(String url, String method, String body, Map<String, String> headers) throws IOException {
-
- RestResponse restResponse = new RestResponse();
- URL obj = new URL(url);
- HttpURLConnection con = (HttpURLConnection) obj.openConnection();
-// add request method
- con.setRequestMethod(method);
-// add request headers
- addHttpRequestHEaders(headers, con);
- if (body != null && !body.isEmpty() && !method.equals("DELETE")) {
-// Send post request
- con.setDoOutput(true);
- DataOutputStream wr = new DataOutputStream(con.getOutputStream());
- wr.writeBytes(body);
- wr.flush();
- wr.close();
- }
-
- int responseCode = con.getResponseCode();
- logger.debug("Send {} http request, url: {}",method,url);
- logger.debug("Response Code: {}",responseCode);
-
- StringBuffer response = generateHttpResponse(con, false);
- String result;
- try {
- result = IOUtils.toString(con.getErrorStream());
- response.append(result);
- } catch (Exception e) {
-// logger.debug("Fail with exception", e);
- }
- logger.debug("Response body: {}",response);
-// print result
- setHttpResponseToObject(restResponse, con, responseCode, response);
- con.disconnect();
-
- return restResponse;
- }
-
- public RestResponse httpSendDelete(String url, Map<String, String> headers) throws IOException {
- if (url.matches("^(https)://.*$")){
- return httpsSendDelete(url, headers);
- }
- return httpSendDeleteInternal(url, headers);
- }
-
- public RestResponse httpSendGet(String url, Map<String, String> headers) throws IOException {
- if (url.matches("^(https)://.*$")){
- return httpsSendGet(url, headers);
- }
- return httpSendGetInternal(url, headers);
- }
-
- public RestResponse httpSendByMethod(String url, String method, String body, Map<String, String> headers) throws IOException {
- if (url.matches("^(https)://.*$")){
- return httpsSendByMethod(url, method, body, headers);
- }
- return httpSendByMethodInternal(url, method, body, headers);
- }
-
- public RestResponse httpSendPost(String url, String body, Map<String, String> headers) throws IOException {
- if (url.matches("^(https)://.*$")){
- return httpsSendByMethod(url, "POST", body, headers);
- }
- return httpSendByMethod(url, "POST", body, headers);
- }
-
- public RestResponse httpSendPut(String url, String body, Map<String, String> headers) throws IOException {
- if (url.matches("^(https)://.*$")){
- return httpsSendByMethod(url, "PUT", body, headers);
- }
- return httpSendByMethod(url, "PUT", body, headers);
- }
-
-
- public RestResponse httpSendDeleteInternal(String url, Map<String, String> headers) throws IOException {
-
- RestResponse restResponse = new RestResponse();
- URL obj = new URL(url);
- HttpURLConnection con = (HttpURLConnection) obj.openConnection();
-
- addHttpRequestHEaders(headers, con);
-
- con.setDoOutput(true);
- con.setRequestMethod("DELETE");
- int responseCode = con.getResponseCode();
- logger.debug("Send DELETE http request, url: {}",url);
- logger.debug("Response Code: {}",responseCode);
-
- StringBuffer response = generateHttpResponse(con, false);
- String result;
- try {
- result = IOUtils.toString(con.getErrorStream());
- response.append(result);
- } catch (Exception e) {
-// logger.debug("Fail with exception", e);
- }
- logger.debug("Response body: {}",response);
-
-// print result
- setHttpResponseToObject(restResponse, con, responseCode, response);
- con.disconnect();
-
- return restResponse;
- }
-
- public static RestResponse sendHttpPostWithEntity(HttpEntity requestEntity, String url, Map<String, String> headers) throws IOException {
- CloseableHttpResponse response = null;
- CloseableHttpClient client = HttpClients.createDefault();
- try {
- HttpPost httpPost = new HttpPost(url);
- RestResponse restResponse = new RestResponse();
- for (Entry<String, String> entry : headers.entrySet()) {
- httpPost.addHeader(entry.getKey(), entry.getValue());
- }
-
- httpPost.setEntity(requestEntity);
- response = client.execute(httpPost);
- HttpEntity responseEntity = response.getEntity();
- String responseBody = null;
- if (responseEntity != null) {
- InputStream instream = responseEntity.getContent();
- StringWriter writer = new StringWriter();
- IOUtils.copy(instream, writer);
- responseBody = writer.toString();
- try {
-
- } finally {
- instream.close();
- }
- }
-
- restResponse.setErrorCode(response.getStatusLine().getStatusCode());
- restResponse.setResponse(responseBody);
-
- return restResponse;
-
- } finally {
- closeResponse(response);
- closeHttpClient(client);
-
- }
- }
-
- private static void closeHttpClient(CloseableHttpClient client) {
- try {
- if (client != null) {
- client.close();
- }
- } catch (IOException e) {
- logger.debug("failed to close client or response: ", e);
- }
- }
-
- private static void closeResponse(CloseableHttpResponse response) {
- try {
- if (response != null) {
- response.close();
- }
- } catch (IOException e) {
- logger.debug("failed to close client or response: ", e);
- }
- }
-
-
- // -----------------------------Https------------------------------------------------------------------------
- public RestResponse httpsSendGet(String url, Map<String, String> headers) throws IOException {
-
- RestResponse restResponse = new RestResponse();
- url = url.replaceAll("\\s", "%20");
- URL obj = new URL(null, url);
- HttpsURLConnection con = (HttpsURLConnection)obj.openConnection();
-// optional default is GET
- con.setRequestMethod("GET");
- addHttpsRequestHeaders(headers, con);
- Boolean multiPart = false;
- if(headers.get(HttpHeaderEnum.ACCEPT.getValue()) != null) {
- if (headers.get(HttpHeaderEnum.ACCEPT.getValue()).equals(BaseRestUtils.acceptMultipartHeader)) {
- multiPart = true;
- }
- }
- int responseCode = con.getResponseCode();
- logger.debug("Send GET http request, url: {}",url);
- logger.debug("Response Code: {}",responseCode);
-
- StringBuffer response = generateHttpsResponse(con, multiPart);
- String result;
- try {
- if(con.getErrorStream()!=null) {
- result = IOUtils.toString(con.getErrorStream());
- response.append(result);
- }
- } catch (Exception e) {
-// logger.debug("Fail with exception", e);
- }
- logger.debug("Response body: {}",response);
-// print result
- setHttpsResponseToObject(restResponse, con, responseCode, response);
- con.disconnect();
-
- return restResponse;
- }
-
-
- public RestResponse httpsSendPost(String url, String body, Map<String, String> headers) throws IOException {
-
- RestResponse restResponse = new RestResponse();
- URL obj = new URL(null, url);
- HttpsURLConnection con = (HttpsURLConnection)obj.openConnection();
-// add request method
- con.setRequestMethod("POST");
-// add request headers
- addHttpRequestHEaders(headers, con);
-// Send post request
- if (body != null) {
- con.setDoOutput(true);
- DataOutputStream wr = new DataOutputStream(con.getOutputStream());
- wr.writeBytes(body);
- wr.flush();
- wr.close();
- }
- int responseCode = con.getResponseCode();
- logger.debug("Send POST http request, url: {}",url);
- logger.debug("Response Code: {}",responseCode);
-
- StringBuffer response = generateHttpsResponse(con, false);
- String result;
- try {
- if(con.getErrorStream()!=null) {
- result = IOUtils.toString(con.getErrorStream());
- response.append(result);
- }
- } catch (Exception e) {
-// logger.debug("Fail with exception", e);
- }
- logger.debug("Response body: {}",response);
-// print result
- setHttpResponseToObject(restResponse, con, responseCode, response);
- con.disconnect();
-
- return restResponse;
- }
-
- public RestResponse httpsSendByMethod(String url, String method, String body, Map<String, String> headers) throws IOException {
-
- RestResponse restResponse = new RestResponse();
- URL obj = new URL(null, url);
- HttpsURLConnection con = (HttpsURLConnection)obj.openConnection();
-// add request method
- con.setRequestMethod(method);
-// add request headers
- addHttpRequestHEaders(headers, con);
- if (body != null && !body.isEmpty() && !method.equals("DELETE")) {
-// Send post request
- con.setDoOutput(true);
- DataOutputStream wr = new DataOutputStream(con.getOutputStream());
- wr.writeBytes(body);
- wr.flush();
- wr.close();
- }
-
- int responseCode = con.getResponseCode();
- logger.debug("Send {} http request, url: {}",method,url);
- logger.debug("Response Code: {}",responseCode);
-
- StringBuffer response = generateHttpResponse(con, false);
- String result;
- try {
- if(con.getErrorStream()!=null) {
- result = IOUtils.toString(con.getErrorStream());
- response.append(result);
- }
- } catch (Exception e) {
-// logger.debug("Fail with exception", e);
- }
- logger.debug("Response body: {}",response);
-// print result
- setHttpResponseToObject(restResponse, con, responseCode, response);
- con.disconnect();
-
- return restResponse;
- }
-
-
- public RestResponse httpsSendDelete(String url, Map<String, String> headers) throws IOException {
-
- RestResponse restResponse = new RestResponse();
- URL obj = new URL(null, url);
- HttpsURLConnection con = (HttpsURLConnection)obj.openConnection();
-// add request headers
- addHttpRequestHEaders(headers, con);
-
- con.setDoOutput(true);
- con.setRequestMethod("DELETE");
- int responseCode = con.getResponseCode();
- logger.debug("Send DELETE http request, url: {}",url);
- logger.debug("Response Code: {}",responseCode);
-
- StringBuffer response = generateHttpsResponse(con, false);
- String result;
- try {
- if(con.getErrorStream()!=null) {
- result = IOUtils.toString(con.getErrorStream());
- response.append(result);
- }
- } catch (Exception e) {
-// logger.debug("Fail with exception", e);
- }
- logger.debug("Response body: {}",response);
-// print result
- setHttpResponseToObject(restResponse, con, responseCode, response);
- con.disconnect();
-
- return restResponse;
- }
-
- // ---------------------------------------
- private void addHttpsRequestHeaders(Map<String, String> headers, HttpsURLConnection con) {
- // add request header
- if (headers != null) {
- for (Entry<String, String> header : headers.entrySet()) {
- String key = header.getKey();
- String value = header.getValue();
- con.setRequestProperty(key, value);
- }
-
- }
- }
-
- private void addHttpRequestHEaders(Map<String, String> headers, HttpURLConnection con) {
- // add request header
- if (headers != null) {
- for (Entry<String, String> header : headers.entrySet()) {
- String key = header.getKey();
- String value = header.getValue();
- con.setRequestProperty(key, value);
- }
-
- }
- }
-
- private void setHttpResponseToObject(RestResponse restResponse, HttpURLConnection con, int responseCode, StringBuffer response) throws IOException {
- restResponse.setErrorCode(responseCode);
-
- if (response != null) {
- restResponse.setResponse(response.toString());
- }
-
- Map<String, List<String>> headerFields = con.getHeaderFields();
- restResponse.setHeaderFields(headerFields);
- String responseMessage = con.getResponseMessage();
- restResponse.setResponseMessage(responseMessage);
- }
-
- private StringBuffer generateHttpResponse(HttpURLConnection con, Boolean isMultiPart) {
- StringBuffer response = new StringBuffer();
- StringWriter writer = new StringWriter();
- try {
- if(isMultiPart) {
- IOUtils.copy((con.getInputStream()), writer, Charset.forName("UTF-8"));
- response = writer.getBuffer();
- }else {
-
- BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
- String inputLine;
- while ((inputLine = in.readLine()) != null) {
- response.append(inputLine);
- }
- in.close();
- }
- } catch (Exception e) {
- logger.debug("response body is null");
- }
-
- return response;
- }
-
- private void setHttpsResponseToObject(RestResponse restResponse, HttpsURLConnection con, int responseCode, StringBuffer response) throws IOException {
- if (response != null) {
- restResponse.setResponse(response.toString());
- }
-
- restResponse.setErrorCode(responseCode);
- // restResponse.setResponse(result);
- Map<String, List<String>> headerFields = con.getHeaderFields();
- restResponse.setHeaderFields(headerFields);
- String responseMessage = con.getResponseMessage();
- restResponse.setResponseMessage(responseMessage);
- }
-
- private StringBuffer generateHttpsResponse(HttpsURLConnection con, Boolean isMultiPart) {
- StringBuffer response = new StringBuffer();
- StringWriter writer = new StringWriter();
- try {
- if(isMultiPart) {
- IOUtils.copy((con.getInputStream()), writer, Charset.forName("UTF-8"));
- response = writer.getBuffer();
- }else {
-
- BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
- String inputLine;
- while ((inputLine = in.readLine()) != null) {
- response.append(inputLine);
- }
- in.close();
- }
- } catch (Exception e) {
- logger.debug("response body is null");
- }
-
- return response;
- }
-
-
- @NotThreadSafe
- class HttpDeleteWithBody extends HttpEntityEnclosingRequestBase {
- public static final String METHOD_NAME = "DELETE";
-
- public String getMethod() {
- return METHOD_NAME;
- }
-
- public HttpDeleteWithBody(final String uri) {
- super();
- setURI(URI.create(uri));
- }
-
- public HttpDeleteWithBody(final URI uri) {
- super();
- setURI(uri);
- }
-
- public HttpDeleteWithBody() {
- super();
- }
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/MustHeaders.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/MustHeaders.java
deleted file mode 100644
index 6937608d2a..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/MustHeaders.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.http;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class MustHeaders {
-
- private Map<String, String> headers = new HashMap<String, String>();
-
- public MustHeaders(HeaderData headerData) {
-
- super();
- headers.put(HttpHeaderEnum.Content_MD5.getValue(), headerData.getContentMd5());
- headers.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), headerData.getContentType());
- headers.put(HttpHeaderEnum.ACCEPT.getValue(), headerData.getContentType());
- headers.put(HttpHeaderEnum.USER_ID.getValue(), headerData.getHttpCspUserId());
- headers.put(HttpHeaderEnum.HTTP_CSP_FIRSTNAME.getValue(), headerData.getHttpCspFirstName());
- headers.put(HttpHeaderEnum.HTTP_CSP_LASTNAME.getValue(), headerData.getHttpCspLastName());
- headers.put(HttpHeaderEnum.HTTP_CSP_WSTYPE.getValue(), headerData.getHttpCspWsType());
- headers.put(HttpHeaderEnum.HTTP_IV_REMOTE_ADDRESS.getValue(), headerData.getHttpIvRemoteAddress());
- headers.put(HttpHeaderEnum.HTTP_IV_USER.getValue(), headerData.getHttpIvUser());
-
- }
-
- public MustHeaders() {
- super();
- }
-
- public Map<String, String> getMap() {
- return headers;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/RestResponse.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/RestResponse.java
deleted file mode 100644
index f11d35a646..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/http/RestResponse.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes.http;
-
-import java.util.List;
-import java.util.Map;
-
-public class RestResponse {
-
- Integer errorCode;
- String response;
- Map<String, List<String>> headerFields;
- String responseMessage;
-
- public RestResponse() {
- super();
- }
-
- public RestResponse(Integer errorCode, String response, Map<String, List<String>> headerFields,
- String responseMessage) {
- super();
- this.errorCode = errorCode;
- this.response = response;
- this.headerFields = headerFields;
- this.responseMessage = responseMessage;
- }
-
- public Integer getErrorCode() {
- return errorCode;
- }
-
- public void setErrorCode(Integer errorCode) {
- this.errorCode = errorCode;
- }
-
- public String getResponse() {
- return response;
- }
-
- public void setResponse(String response) {
- this.response = response;
- }
-
- public Map<String, List<String>> getHeaderFields() {
- return headerFields;
- }
-
- public void setHeaderFields(Map<String, List<String>> headerFields) {
- this.headerFields = headerFields;
- }
-
- public String getResponseMessage() {
- return responseMessage;
- }
-
- public void setResponseMessage(String responseMessage) {
- this.responseMessage = responseMessage;
- }
-
- @Override
- public String toString() {
- return "RestResponse [errorCode=" + errorCode + ", response=" + response + ", headerFields=" + headerFields
- + ", responseMessage=" + responseMessage + "]";
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/TODO/ImportCapabilityTypeCITest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/TODO/ImportCapabilityTypeCITest.java
deleted file mode 100644
index bcd00a10b7..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/TODO/ImportCapabilityTypeCITest.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.TODO;
-
-import fj.data.Either;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.entity.mime.MultipartEntityBuilder;
-import org.apache.http.entity.mime.content.FileBody;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClients;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.utils.DbUtils;
-import org.openecomp.sdc.ci.tests.utils.DbUtils.JanusGraphState;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.testng.AssertJUnit;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.Test;
-
-import java.io.File;
-import java.io.IOException;
-
-public class ImportCapabilityTypeCITest {
- public static final DbUtils DbUtils = new DbUtils();
-
- @AfterClass
- public static void afterClass() {
- DbUtils.shutDownJanusGraph();
- }
-
- static Config config = Config.instance();
-
- // private final String IMPORT_CAPABILITY_TYPES_PATH =
- // "src/test/resources/CI/importResourceTests/import_capabilitiesTypes/";
-
- @Test
- public void testAddingCapabilityTypes() throws IOException {
- JanusGraphState originalState = DbUtils.getCurrentJanusGraphState();
-
- String importResourceDir = config.getImportResourceConfigDir();
-
- String capabilityTypes = importResourceDir + File.separator + "capabilityTypesCi.zip";
- // importCapabilityType("src/test/resources/CI/importResource/capabilityTypesCi.zip");
- importCapabilityType(capabilityTypes);
- Either<Vertex, Boolean> eitherVertex = DbUtils.getVertexByUId("tosca.capabilities.Test.Ci");
- AssertJUnit.assertTrue(eitherVertex.isLeft());
- DbUtils.restoreToJanusGraphState(originalState);
- eitherVertex = DbUtils.getVertexByUId("tosca.capabilities.Test.Ci");
- AssertJUnit.assertTrue(eitherVertex.isRight());
- }
-
- @Test
- public void AddingCapabilityNotFound() throws IOException {
- JanusGraphState originalState = DbUtils.getCurrentJanusGraphState();
- String importResourceTestsDir = config.getImportResourceTestsConfigDir();
- String capabilitiesTests = importResourceTestsDir + File.separator + "capabilityTypesCi.zip";
- importCapabilityType(capabilitiesTests);
- Either<Vertex, Boolean> eitherVertex = DbUtils.getVertexByUId("tosca.capabilities.NonExsitingCapability");
- AssertJUnit.assertTrue(eitherVertex.isRight());
- DbUtils.restoreToJanusGraphState(originalState);
- }
-
- public static Integer importAllCapabilityTypes() throws IOException {
-
- String importResourceDir = config.getImportResourceConfigDir() + File.separator + "capabilityTypes.zip";
- // return
- // importCapabilityType("src/test/resources/CI/importResource/capabilityTypes.zip");
- return importCapabilityType(importResourceDir);
- }
-
- private static Integer importCapabilityType(String filePath) throws IOException {
- Config config = Utils.getConfig();
- CloseableHttpResponse response = null;
- MultipartEntityBuilder mpBuilder = MultipartEntityBuilder.create();
-
- mpBuilder.addPart("capabilityTypeZip", new FileBody(new File(filePath)));
-
- String url = String.format(Urls.IMPORT_CAPABILITY_TYPE, config.getCatalogBeHost(), config.getCatalogBePort());
-
- CloseableHttpClient client = HttpClients.createDefault();
- try {
- HttpPost httpPost = new HttpPost(url);
- httpPost.addHeader("USER_ID", "jh0003");
- httpPost.setEntity(mpBuilder.build());
- response = client.execute(httpPost);
- return response.getStatusLine().getStatusCode();
- } finally {
- closeResponse(response);
- closeHttpClient(client);
-
- }
- }
-
- private static void closeHttpClient(CloseableHttpClient client) {
- try {
- if (client != null) {
- client.close();
- }
- } catch (IOException e) {
- System.out.println("failed to close client or response: " + e.getMessage());
- }
- }
-
- private static void closeResponse(CloseableHttpResponse response) {
- try {
- if (response != null) {
- response.close();
- }
- } catch (IOException e) {
- System.out.println("failed to close client or response: " + e.getMessage());
- }
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/DownloadComponentArt.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/DownloadComponentArt.java
deleted file mode 100644
index 02bf110c8d..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/DownloadComponentArt.java
+++ /dev/null
@@ -1,647 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.artifacts;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.gson.Gson;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import fj.data.Either;
-import org.apache.commons.io.IOUtils;
-import org.apache.http.HttpEntity;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.HttpResponseException;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpDelete;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.client.BasicResponseHandler;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClients;
-import org.apache.http.util.EntityUtils;
-import org.json.simple.JSONObject;
-import org.json.simple.parser.JSONParser;
-import org.json.simple.parser.ParseException;
-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.*;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.*;
-import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedResourceAuditJavaObject;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.Decoder;
-import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
-import org.openecomp.sdc.ci.tests.utils.general.Convertor;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
-import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
-import org.openecomp.sdc.ci.tests.utils.validation.ServiceValidationUtils;
-import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
-import org.openecomp.sdc.common.api.Constants;
-import org.openecomp.sdc.common.util.GeneralUtility;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.Assert;
-import org.testng.AssertJUnit;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.util.HashMap;
-import java.util.Map;
-
-public class DownloadComponentArt extends ComponentBaseTest {
-
- private static Logger log = LoggerFactory.getLogger(DownloadComponentArt.class.getName());
- protected static final String UPLOAD_ARTIFACT_PAYLOAD = "UHVUVFktVXNlci1LZXktRmlsZS0yOiBzc2gtcnNhDQpFbmNyeXB0aW9uOiBhZXMyNTYtY2JjDQpDb21tZW5wOA0K";
- protected static final String UPLOAD_ARTIFACT_NAME = "TLV_prv.ppk";
-
- protected Config config = Config.instance();
- protected String contentTypeHeaderData = "application/json";
- protected String acceptHeaderDate = "application/json";
-
-
-
- protected Gson gson = new Gson();
- protected JSONParser jsonParser = new JSONParser();
-
-
- protected String serviceVersion;
- protected ResourceReqDetails resourceDetails;
- protected User sdncUserDetails;
- protected ServiceReqDetails serviceDetails;
-
-
- @BeforeMethod
- public void init() throws Exception{
- sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- Resource resourceObj = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
- Service serviceObj = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
-
-
- resourceDetails = new ResourceReqDetails(resourceObj);
- serviceDetails = new ServiceReqDetails(serviceObj);
- }
-
- @Rule
- public static TestName name = new TestName();
-
- public DownloadComponentArt() {
- super(name, DownloadComponentArt.class.getName());
-
- }
-
-
-
- // External API - Download artifact for resource
- @Test
- public void downloadArtifactFromResourceViaExternalAPI() throws Exception {
- Resource resourceDetailsVF;
- Either<Resource, RestResponse> createdResource = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, UserRoleEnum.DESIGNER, true);
- resourceDetailsVF = createdResource.left().value();
- ArtifactDefinition heatArtifact = AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT, resourceDetailsVF, UserRoleEnum.DESIGNER, true, true).left().value();
- resourceDetails = new ResourceReqDetails(resourceDetailsVF);
-
- String resourceUUID = resourceDetailsVF.getUUID();
- String artifactUUID = heatArtifact.getArtifactUUID();
-
- System.out.println("Resource UUID: " + resourceUUID);
- System.out.println("Artifact UUID: " + artifactUUID);
-
- RestResponse restResponse = ArtifactRestUtils.getResourceDeploymentArtifactExternalAPI(resourceUUID, artifactUUID, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), "Resource");
-
- Integer responseCode = restResponse.getErrorCode();
- Integer expectedCode = 200;
- Assert.assertEquals(responseCode,expectedCode, "Response code is not correct.");
-
- String response = restResponse.getResponse();
-
- String payloadData = "aGVhdF90ZW1wbGF0ZV92ZXJzaW9uOiAyMDEzLTA1LTIzDQoNCmRlc2NyaXB0aW9uOiBTaW1wbGUgdGVtcGxhdGUgdG8gZGVwbG95IGEgc3RhY2sgd2l0aCB0d28gdmlydHVhbCBtYWNoaW5lIGluc3RhbmNlcw0KDQpwYXJhbWV0ZXJzOg0KICBpbWFnZV9uYW1lXzE6DQogICAgdHlwZTogc3RyaW5nDQogICAgbGFiZWw6IEltYWdlIE5hbWUNCiAgICBkZXNjcmlwdGlvbjogU0NPSU1BR0UgU3BlY2lmeSBhbiBpbWFnZSBuYW1lIGZvciBpbnN0YW5jZTENCiAgICBkZWZhdWx0OiBjaXJyb3MtMC4zLjEteDg2XzY0DQogIGltYWdlX25hbWVfMjoNCiAgICB0eXBlOiBzdHJpbmcNCiAgICBsYWJlbDogSW1hZ2UgTmFtZQ0KICAgIGRlc2NyaXB0aW9uOiBTQ09JTUFHRSBTcGVjaWZ5IGFuIGltYWdlIG5hbWUgZm9yIGluc3RhbmNlMg0KICAgIGRlZmF1bHQ6IGNpcnJvcy0wLjMuMS14ODZfNjQNCiAgbmV0d29ya19pZDoNCiAgICB0eXBlOiBzdHJpbmcNCiAgICBsYWJlbDogTmV0d29yayBJRA0KICAgIGRlc2NyaXB0aW9uOiBTQ09ORVRXT1JLIE5ldHdvcmsgdG8gYmUgdXNlZCBmb3IgdGhlIGNvbXB1dGUgaW5zdGFuY2UNCiAgICBoaWRkZW46IHRydWUNCiAgICBjb25zdHJhaW50czoNCiAgICAgIC0gbGVuZ3RoOiB7IG1pbjogNiwgbWF4OiA4IH0NCiAgICAgICAgZGVzY3JpcHRpb246IFBhc3N3b3JkIGxlbmd0aCBtdXN0IGJlIGJldHdlZW4gNiBhbmQgOCBjaGFyYWN0ZXJzLg0KICAgICAgLSByYW5nZTogeyBtaW46IDYsIG1heDogOCB9DQogICAgICAgIGRlc2NyaXB0aW9uOiBSYW5nZSBkZXNjcmlwdGlvbg0KICAgICAgLSBhbGxvd2VkX3ZhbHVlczoNCiAgICAgICAgLSBtMS5zbWFsbA0KICAgICAgICAtIG0xLm1lZGl1bQ0KICAgICAgICAtIG0xLmxhcmdlDQogICAgICAgIGRlc2NyaXB0aW9uOiBBbGxvd2VkIHZhbHVlcyBkZXNjcmlwdGlvbg0KICAgICAgLSBhbGxvd2VkX3BhdHRlcm46ICJbYS16QS1aMC05XSsiDQogICAgICAgIGRlc2NyaXB0aW9uOiBQYXNzd29yZCBtdXN0IGNvbnNpc3Qgb2YgY2hhcmFjdGVycyBhbmQgbnVtYmVycyBvbmx5Lg0KICAgICAgLSBhbGxvd2VkX3BhdHRlcm46ICJbQS1aXStbYS16QS1aMC05XSoiDQogICAgICAgIGRlc2NyaXB0aW9uOiBQYXNzd29yZCBtdXN0IHN0YXJ0IHdpdGggYW4gdXBwZXJjYXNlIGNoYXJhY3Rlci4NCiAgICAgIC0gY3VzdG9tX2NvbnN0cmFpbnQ6IG5vdmEua2V5cGFpcg0KICAgICAgICBkZXNjcmlwdGlvbjogQ3VzdG9tIGRlc2NyaXB0aW9uDQoNCnJlc291cmNlczoNCiAgbXlfaW5zdGFuY2UxOg0KICAgIHR5cGU6IE9TOjpOb3ZhOjpTZXJ2ZXINCiAgICBwcm9wZXJ0aWVzOg0KICAgICAgaW1hZ2U6IHsgZ2V0X3BhcmFtOiBpbWFnZV9uYW1lXzEgfQ0KICAgICAgZmxhdm9yOiBtMS5zbWFsbA0KICAgICAgbmV0d29ya3M6DQogICAgICAgIC0gbmV0d29yayA6IHsgZ2V0X3BhcmFtIDogbmV0d29ya19pZCB9DQogIG15X2luc3RhbmNlMjoNCiAgICB0eXBlOiBPUzo6Tm92YTo6U2VydmVyDQogICAgcHJvcGVydGllczoNCiAgICAgIGltYWdlOiB7IGdldF9wYXJhbTogaW1hZ2VfbmFtZV8yIH0NCiAgICAgIGZsYXZvcjogbTEudGlueQ0KICAgICAgbmV0d29ya3M6DQogICAgICAgIC0gbmV0d29yayA6IHsgZ2V0X3BhcmFtIDogbmV0d29ya19pZCB9";
- String decodedPaypload = Decoder.decode(payloadData);
-
- Assert.assertEquals(response, decodedPaypload, "Response deployment artifact not correct.");
-
- String auditAction = "DownloadArtifact";
-
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
- expectedResourceAuditJavaObject.setAction(auditAction);
- expectedResourceAuditJavaObject.setResourceName(resourceDetails.getName());
- expectedResourceAuditJavaObject.setResourceType("Resource");
- expectedResourceAuditJavaObject.setStatus("200");
- expectedResourceAuditJavaObject.setDesc("OK");
-
- expectedResourceAuditJavaObject.setCONSUMER_ID("ci");
- String resource_url = String.format("/sdc/v1/catalog/resources/%s/artifacts/%s", resourceUUID, artifactUUID);
- expectedResourceAuditJavaObject.setRESOURCE_URL(resource_url);
-
- AuditValidationUtils.validateAuditDownloadExternalAPI(expectedResourceAuditJavaObject, auditAction, null, false);
- }
-
-
- // External API - Download artifact for resource - negative test
- @Test
- public void downloadArtifactFromResourceViaExternalAPINegativeTest() throws Exception {
- Resource resourceDetailsVF;
- Either<Resource, RestResponse> createdResource = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, UserRoleEnum.DESIGNER, true);
- resourceDetailsVF = createdResource.left().value();
- ArtifactDefinition heatArtifact = AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT, resourceDetailsVF, UserRoleEnum.DESIGNER, true, true).left().value();
- resourceDetails = new ResourceReqDetails(resourceDetailsVF);
-
- String resourceUUID = resourceDetailsVF.getUUID();
- String artifactUUID = heatArtifact.getArtifactUUID();
-
- System.out.println("Resource UUID: " + resourceUUID);
- System.out.println("Artifact UUID: " + artifactUUID);
-
- RestResponse restResponse = ArtifactRestUtils.getResourceDeploymentArtifactExternalAPI(resourceUUID, "dfsgfdsg324", ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), "Resource");
-
- Integer responseCode = restResponse.getErrorCode();
- Integer expectedCode = 200;
- Assert.assertEquals(responseCode,expectedCode, "Response code is not correct.");
- }
-
-
-
-
-
- // External API - Download artifact for service - negative test
- @Test
- public void downloadArtifactFromServiceViaExternalAPI() throws Exception {
-
- Service resourceDetailsService;
- Either<Service, RestResponse> createdResource = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true);
- resourceDetailsService = createdResource.left().value();
-
- ArtifactDefinition heatArtifact = AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.OTHER, resourceDetailsService, UserRoleEnum.DESIGNER, true, true).left().value();
-
- String resourceUUID = resourceDetailsService.getUUID();
- String artifactUUID = heatArtifact.getArtifactUUID();
-
- System.out.println("Resource UUID: " + resourceUUID);
- System.out.println("Artifact UUID: " + artifactUUID);
-
- RestResponse restResponse = ArtifactRestUtils.getResourceDeploymentArtifactExternalAPI(resourceUUID, artifactUUID, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), "Service");
-
- Integer responseCode = restResponse.getErrorCode();
- Integer expectedCode = 200;
- Assert.assertEquals(responseCode,expectedCode, "Response code is not correct.");
-
- String response = restResponse.getResponse();
-
- String payloadData = "aGVhdF90ZW1wbGF0ZV92ZXJzaW9uOiAyMDEzLTA1LTIzDQoNCmRlc2NyaXB0aW9uOiBTaW1wbGUgdGVtcGxhdGUgdG8gZGVwbG95IGEgc3RhY2sgd2l0aCB0d28gdmlydHVhbCBtYWNoaW5lIGluc3RhbmNlcw0KDQpwYXJhbWV0ZXJzOg0KICBpbWFnZV9uYW1lXzE6DQogICAgdHlwZTogc3RyaW5nDQogICAgbGFiZWw6IEltYWdlIE5hbWUNCiAgICBkZXNjcmlwdGlvbjogU0NPSU1BR0UgU3BlY2lmeSBhbiBpbWFnZSBuYW1lIGZvciBpbnN0YW5jZTENCiAgICBkZWZhdWx0OiBjaXJyb3MtMC4zLjEteDg2XzY0DQogIGltYWdlX25hbWVfMjoNCiAgICB0eXBlOiBzdHJpbmcNCiAgICBsYWJlbDogSW1hZ2UgTmFtZQ0KICAgIGRlc2NyaXB0aW9uOiBTQ09JTUFHRSBTcGVjaWZ5IGFuIGltYWdlIG5hbWUgZm9yIGluc3RhbmNlMg0KICAgIGRlZmF1bHQ6IGNpcnJvcy0wLjMuMS14ODZfNjQNCiAgbmV0d29ya19pZDoNCiAgICB0eXBlOiBzdHJpbmcNCiAgICBsYWJlbDogTmV0d29yayBJRA0KICAgIGRlc2NyaXB0aW9uOiBTQ09ORVRXT1JLIE5ldHdvcmsgdG8gYmUgdXNlZCBmb3IgdGhlIGNvbXB1dGUgaW5zdGFuY2UNCiAgICBoaWRkZW46IHRydWUNCiAgICBjb25zdHJhaW50czoNCiAgICAgIC0gbGVuZ3RoOiB7IG1pbjogNiwgbWF4OiA4IH0NCiAgICAgICAgZGVzY3JpcHRpb246IFBhc3N3b3JkIGxlbmd0aCBtdXN0IGJlIGJldHdlZW4gNiBhbmQgOCBjaGFyYWN0ZXJzLg0KICAgICAgLSByYW5nZTogeyBtaW46IDYsIG1heDogOCB9DQogICAgICAgIGRlc2NyaXB0aW9uOiBSYW5nZSBkZXNjcmlwdGlvbg0KICAgICAgLSBhbGxvd2VkX3ZhbHVlczoNCiAgICAgICAgLSBtMS5zbWFsbA0KICAgICAgICAtIG0xLm1lZGl1bQ0KICAgICAgICAtIG0xLmxhcmdlDQogICAgICAgIGRlc2NyaXB0aW9uOiBBbGxvd2VkIHZhbHVlcyBkZXNjcmlwdGlvbg0KICAgICAgLSBhbGxvd2VkX3BhdHRlcm46ICJbYS16QS1aMC05XSsiDQogICAgICAgIGRlc2NyaXB0aW9uOiBQYXNzd29yZCBtdXN0IGNvbnNpc3Qgb2YgY2hhcmFjdGVycyBhbmQgbnVtYmVycyBvbmx5Lg0KICAgICAgLSBhbGxvd2VkX3BhdHRlcm46ICJbQS1aXStbYS16QS1aMC05XSoiDQogICAgICAgIGRlc2NyaXB0aW9uOiBQYXNzd29yZCBtdXN0IHN0YXJ0IHdpdGggYW4gdXBwZXJjYXNlIGNoYXJhY3Rlci4NCiAgICAgIC0gY3VzdG9tX2NvbnN0cmFpbnQ6IG5vdmEua2V5cGFpcg0KICAgICAgICBkZXNjcmlwdGlvbjogQ3VzdG9tIGRlc2NyaXB0aW9uDQoNCnJlc291cmNlczoNCiAgbXlfaW5zdGFuY2UxOg0KICAgIHR5cGU6IE9TOjpOb3ZhOjpTZXJ2ZXINCiAgICBwcm9wZXJ0aWVzOg0KICAgICAgaW1hZ2U6IHsgZ2V0X3BhcmFtOiBpbWFnZV9uYW1lXzEgfQ0KICAgICAgZmxhdm9yOiBtMS5zbWFsbA0KICAgICAgbmV0d29ya3M6DQogICAgICAgIC0gbmV0d29yayA6IHsgZ2V0X3BhcmFtIDogbmV0d29ya19pZCB9DQogIG15X2luc3RhbmNlMjoNCiAgICB0eXBlOiBPUzo6Tm92YTo6U2VydmVyDQogICAgcHJvcGVydGllczoNCiAgICAgIGltYWdlOiB7IGdldF9wYXJhbTogaW1hZ2VfbmFtZV8yIH0NCiAgICAgIGZsYXZvcjogbTEudGlueQ0KICAgICAgbmV0d29ya3M6DQogICAgICAgIC0gbmV0d29yayA6IHsgZ2V0X3BhcmFtIDogbmV0d29ya19pZCB9";
- String decodedPaypload = Decoder.decode(payloadData);
-
- Assert.assertEquals(response, decodedPaypload, "Response deployment artifact not correct.");
-
- String auditAction = "DownloadArtifact";
-
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
- expectedResourceAuditJavaObject.setAction(auditAction);
- expectedResourceAuditJavaObject.setResourceName(resourceDetailsService.getName());
- expectedResourceAuditJavaObject.setResourceType("Service");
- expectedResourceAuditJavaObject.setStatus("200");
- expectedResourceAuditJavaObject.setDesc("OK");
-
- expectedResourceAuditJavaObject.setCONSUMER_ID("ci");
- String resource_url = String.format("/sdc/v1/catalog/services/%s/artifacts/%s", resourceUUID, artifactUUID);
- expectedResourceAuditJavaObject.setRESOURCE_URL(resource_url);
-
- AuditValidationUtils.validateAuditDownloadExternalAPI(expectedResourceAuditJavaObject, auditAction, null, false);
- }
-
-
-
-
-
-
- // External API - Download ComponentInstance artifact of service - negative test
- @Test
- public void downloadArtifactOfComponentInstanceFromServiceViaExternalAPI() throws Exception {
-
- Either<Resource, RestResponse> resourceDetailsVF_01e = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, UserRoleEnum.DESIGNER, true);
- Component resourceDetailsVF_01 = resourceDetailsVF_01e.left().value();
- ArtifactDefinition heatArtifact = AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT, resourceDetailsVF_01, UserRoleEnum.DESIGNER, true, true).left().value();
-
- resourceDetailsVF_01 = AtomicOperationUtils.changeComponentState(resourceDetailsVF_01, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
-
- Service resourceDetailsService;
- Either<Service, RestResponse> createdResource = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true);
- resourceDetailsService = createdResource.left().value();
-
-
- ComponentInstance resourceDetailsVF1ins_01 = AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceDetailsVF_01, resourceDetailsService, UserRoleEnum.DESIGNER, true).left().value();
-
-
- System.out.println("-----");
-
-
- String resourceUUID = resourceDetailsService.getUUID();
- String componentNormalizedName = resourceDetailsVF1ins_01.getNormalizedName();
- String artifactUUID = heatArtifact.getArtifactUUID();
-
- System.out.println("Resource UUID: " + resourceUUID);
- System.out.println("Component NormalizedName: " + componentNormalizedName);
- System.out.println("Artifact UUID: " + artifactUUID);
-
- RestResponse restResponse = ArtifactRestUtils.getComponentInstanceDeploymentArtifactExternalAPI(resourceUUID, componentNormalizedName, artifactUUID, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), "Service");
-//
- Integer responseCode = restResponse.getErrorCode();
- Integer expectedCode = 200;
- Assert.assertEquals(responseCode,expectedCode, "Response code is not correct.");
-
- String response = restResponse.getResponse();
-
- String payloadData = "aGVhdF90ZW1wbGF0ZV92ZXJzaW9uOiAyMDEzLTA1LTIzDQoNCmRlc2NyaXB0aW9uOiBTaW1wbGUgdGVtcGxhdGUgdG8gZGVwbG95IGEgc3RhY2sgd2l0aCB0d28gdmlydHVhbCBtYWNoaW5lIGluc3RhbmNlcw0KDQpwYXJhbWV0ZXJzOg0KICBpbWFnZV9uYW1lXzE6DQogICAgdHlwZTogc3RyaW5nDQogICAgbGFiZWw6IEltYWdlIE5hbWUNCiAgICBkZXNjcmlwdGlvbjogU0NPSU1BR0UgU3BlY2lmeSBhbiBpbWFnZSBuYW1lIGZvciBpbnN0YW5jZTENCiAgICBkZWZhdWx0OiBjaXJyb3MtMC4zLjEteDg2XzY0DQogIGltYWdlX25hbWVfMjoNCiAgICB0eXBlOiBzdHJpbmcNCiAgICBsYWJlbDogSW1hZ2UgTmFtZQ0KICAgIGRlc2NyaXB0aW9uOiBTQ09JTUFHRSBTcGVjaWZ5IGFuIGltYWdlIG5hbWUgZm9yIGluc3RhbmNlMg0KICAgIGRlZmF1bHQ6IGNpcnJvcy0wLjMuMS14ODZfNjQNCiAgbmV0d29ya19pZDoNCiAgICB0eXBlOiBzdHJpbmcNCiAgICBsYWJlbDogTmV0d29yayBJRA0KICAgIGRlc2NyaXB0aW9uOiBTQ09ORVRXT1JLIE5ldHdvcmsgdG8gYmUgdXNlZCBmb3IgdGhlIGNvbXB1dGUgaW5zdGFuY2UNCiAgICBoaWRkZW46IHRydWUNCiAgICBjb25zdHJhaW50czoNCiAgICAgIC0gbGVuZ3RoOiB7IG1pbjogNiwgbWF4OiA4IH0NCiAgICAgICAgZGVzY3JpcHRpb246IFBhc3N3b3JkIGxlbmd0aCBtdXN0IGJlIGJldHdlZW4gNiBhbmQgOCBjaGFyYWN0ZXJzLg0KICAgICAgLSByYW5nZTogeyBtaW46IDYsIG1heDogOCB9DQogICAgICAgIGRlc2NyaXB0aW9uOiBSYW5nZSBkZXNjcmlwdGlvbg0KICAgICAgLSBhbGxvd2VkX3ZhbHVlczoNCiAgICAgICAgLSBtMS5zbWFsbA0KICAgICAgICAtIG0xLm1lZGl1bQ0KICAgICAgICAtIG0xLmxhcmdlDQogICAgICAgIGRlc2NyaXB0aW9uOiBBbGxvd2VkIHZhbHVlcyBkZXNjcmlwdGlvbg0KICAgICAgLSBhbGxvd2VkX3BhdHRlcm46ICJbYS16QS1aMC05XSsiDQogICAgICAgIGRlc2NyaXB0aW9uOiBQYXNzd29yZCBtdXN0IGNvbnNpc3Qgb2YgY2hhcmFjdGVycyBhbmQgbnVtYmVycyBvbmx5Lg0KICAgICAgLSBhbGxvd2VkX3BhdHRlcm46ICJbQS1aXStbYS16QS1aMC05XSoiDQogICAgICAgIGRlc2NyaXB0aW9uOiBQYXNzd29yZCBtdXN0IHN0YXJ0IHdpdGggYW4gdXBwZXJjYXNlIGNoYXJhY3Rlci4NCiAgICAgIC0gY3VzdG9tX2NvbnN0cmFpbnQ6IG5vdmEua2V5cGFpcg0KICAgICAgICBkZXNjcmlwdGlvbjogQ3VzdG9tIGRlc2NyaXB0aW9uDQoNCnJlc291cmNlczoNCiAgbXlfaW5zdGFuY2UxOg0KICAgIHR5cGU6IE9TOjpOb3ZhOjpTZXJ2ZXINCiAgICBwcm9wZXJ0aWVzOg0KICAgICAgaW1hZ2U6IHsgZ2V0X3BhcmFtOiBpbWFnZV9uYW1lXzEgfQ0KICAgICAgZmxhdm9yOiBtMS5zbWFsbA0KICAgICAgbmV0d29ya3M6DQogICAgICAgIC0gbmV0d29yayA6IHsgZ2V0X3BhcmFtIDogbmV0d29ya19pZCB9DQogIG15X2luc3RhbmNlMjoNCiAgICB0eXBlOiBPUzo6Tm92YTo6U2VydmVyDQogICAgcHJvcGVydGllczoNCiAgICAgIGltYWdlOiB7IGdldF9wYXJhbTogaW1hZ2VfbmFtZV8yIH0NCiAgICAgIGZsYXZvcjogbTEudGlueQ0KICAgICAgbmV0d29ya3M6DQogICAgICAgIC0gbmV0d29yayA6IHsgZ2V0X3BhcmFtIDogbmV0d29ya19pZCB9";
- String decodedPaypload = Decoder.decode(payloadData);
-
- Assert.assertEquals(response, decodedPaypload, "Response deployment artifact not correct.");
-
- String auditAction = "DownloadArtifact";
-
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
- expectedResourceAuditJavaObject.setAction(auditAction);
- expectedResourceAuditJavaObject.setResourceName(resourceDetailsVF1ins_01.getName());
- expectedResourceAuditJavaObject.setResourceType("Service");
- expectedResourceAuditJavaObject.setStatus("200");
- expectedResourceAuditJavaObject.setDesc("OK");
-
- expectedResourceAuditJavaObject.setCONSUMER_ID("ci");
- String resource_url = String.format("/sdc/v1/catalog/services/%s/resourceInstances/%s/artifacts/%s", resourceUUID, componentNormalizedName, artifactUUID);
- expectedResourceAuditJavaObject.setRESOURCE_URL(resource_url);
-
-// AuditValidationUtils.validateAuditDownloadExternalAPI(expectedResourceAuditJavaObject, auditAction, null, false);
- }
-
-
-
-
-
-
-
-
-
- @Test
- public void downloadArtifactFromResourceTest() throws Exception {
-
- CloseableHttpClient httpclient = HttpClients.createDefault();
- try {
- String jsonBody = createUploadArtifactBodyJson();
-
- String resourceId = resourceDetails.getUniqueId();
- String url = String.format(Urls.ADD_ARTIFACT_TO_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceId);
- HttpPost httppost = createPostAddArtifactRequeast(jsonBody, url, true);
- HttpResponse response = httpclient.execute(httppost);
- int status = response.getStatusLine().getStatusCode();
- AssertJUnit.assertEquals("failed to add artifact", 200, status);
-
- ArtifactDefinition origArtifact = getArtifactDataFromJson(jsonBody);
- addArtifactDataFromResponse(response, origArtifact);
- String artifactId = origArtifact.getUniqueId();
-
- url = String.format(Urls.UI_DOWNLOAD_RESOURCE_ARTIFACT, config.getCatalogBeHost(), config.getCatalogBePort(), resourceId, artifactId);
- HttpGet httpGet = createGetRequest(url);
- response = httpclient.execute(httpGet);
- status = response.getStatusLine().getStatusCode();
- AssertJUnit.assertEquals("failed to download artifact", 200, status);
-
- InputStream inputStream = response.getEntity().getContent();
- ArtifactUiDownloadData artifactUiDownloadData = getArtifactUiDownloadData(IOUtils.toString(inputStream));
- AssertJUnit.assertEquals("Downloaded payload is different from uploaded one", UPLOAD_ARTIFACT_PAYLOAD, artifactUiDownloadData.getBase64Contents());
- AssertJUnit.assertEquals("Downloaded artifact name is different from uploaded one", UPLOAD_ARTIFACT_NAME, artifactUiDownloadData.getArtifactName());
-
- // validate audit
-
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor.constructFieldsForAuditValidation(resourceDetails, resourceDetails.getVersion(), sdncUserDetails);
- String auditAction = "ArtifactDownload";
- expectedResourceAuditJavaObject.setAction(auditAction);
- expectedResourceAuditJavaObject.setPrevState("");
- expectedResourceAuditJavaObject.setPrevVersion("");
- expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
- expectedResourceAuditJavaObject.setStatus("200");
- expectedResourceAuditJavaObject.setDesc("OK");
- expectedResourceAuditJavaObject.setArtifactData(AuditValidationUtils.buildArtifactDataAudit(origArtifact));
- expectedResourceAuditJavaObject.setCurrArtifactUuid(origArtifact.getUniqueId());
- expectedResourceAuditJavaObject.setPrevArtifactUuid("");
- AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
-
- } finally {
- httpclient.close();
- }
-
- }
-
- @Test
- public void downloadArtifactFromServiceTest() throws Exception {
-
- CloseableHttpClient httpclient = HttpClients.createDefault();
-
- try {
-
- String jsonStr = createUploadArtifactBodyJson();
-
- String url = String.format(Urls.ADD_ARTIFACT_TO_SERVICE, config.getCatalogBeHost(), config.getCatalogBePort(), serviceDetails.getUniqueId());
- HttpPost httpPost = createPostAddArtifactRequeast(jsonStr, url, true);
- CloseableHttpResponse result = httpclient.execute(httpPost);
- int status = result.getStatusLine().getStatusCode();
- AssertJUnit.assertEquals("failed to add artifact", 200, status);
-
- ArtifactDefinition origArtifact = getArtifactDataFromJson(jsonStr);
- addArtifactDataFromResponse(result, origArtifact);
- String artifactId = origArtifact.getUniqueId();
-
- url = String.format(Urls.UI_DOWNLOAD_SERVICE_ARTIFACT, config.getCatalogBeHost(), config.getCatalogBePort(), serviceDetails.getUniqueId(), artifactId);
- HttpGet httpGet = createGetRequest(url);
- CloseableHttpResponse response2 = httpclient.execute(httpGet);
- status = response2.getStatusLine().getStatusCode();
- AssertJUnit.assertEquals("failed to download artifact", 200, status);
- InputStream inputStream = response2.getEntity().getContent();
- ArtifactUiDownloadData artifactUiDownloadData = getArtifactUiDownloadData(IOUtils.toString(inputStream));
- AssertJUnit.assertEquals("Downloaded payload is different from uploaded one", UPLOAD_ARTIFACT_PAYLOAD, artifactUiDownloadData.getBase64Contents());
- AssertJUnit.assertEquals("Downloaded artifact name is different from uploaded one", UPLOAD_ARTIFACT_NAME, artifactUiDownloadData.getArtifactName());
-
- // validate audit
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = AuditValidationUtils.constructFieldsForAuditValidation(serviceDetails, serviceDetails.getVersion(), sdncUserDetails);
- String auditAction = "ArtifactDownload";
- expectedResourceAuditJavaObject.setAction(auditAction);
- expectedResourceAuditJavaObject.setPrevState("");
- expectedResourceAuditJavaObject.setPrevVersion("");
- expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
- expectedResourceAuditJavaObject.setStatus("200");
- expectedResourceAuditJavaObject.setDesc("OK");
- expectedResourceAuditJavaObject.setArtifactData(AuditValidationUtils.buildArtifactDataAudit(origArtifact));
- expectedResourceAuditJavaObject.setCurrArtifactUuid(origArtifact.getUniqueId());
- expectedResourceAuditJavaObject.setPrevArtifactUuid("");
-
- AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
-
- } finally {
-// RestResponse response = ServiceRestUtils.deleteService(serviceDetails, serviceVersion, sdncUserDetails );
-// checkDeleteResponse(response);
- httpclient.close();
- }
- }
-
- @Test
- public void downloadArtifactFromResourceNotFound() throws Exception {
-
- CloseableHttpClient httpclient = HttpClients.createDefault();
- try {
-
- String resourceId = resourceDetails.getUniqueId();
- String artifactIdNotFound = "11111";
-
- ArtifactDefinition origArtifact = new ArtifactDefinition();
- origArtifact.setUniqueId(artifactIdNotFound);
-
- String url = String.format(Urls.UI_DOWNLOAD_RESOURCE_ARTIFACT, config.getCatalogBeHost(), config.getCatalogBePort(), resourceId, artifactIdNotFound);
- HttpGet httpGet = createGetRequest(url);
- CloseableHttpResponse response = httpclient.execute(httpGet);
- int status = response.getStatusLine().getStatusCode();
- AssertJUnit.assertEquals("expected 404 not found", 404, status);
-
- // validate audit
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.ARTIFACT_NOT_FOUND.name());
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor.constructFieldsForAuditValidation(resourceDetails, resourceDetails.getVersion(), sdncUserDetails);
- String auditAction = "ArtifactDownload";
- expectedResourceAuditJavaObject.setAction(auditAction);
- expectedResourceAuditJavaObject.setPrevState("");
- expectedResourceAuditJavaObject.setPrevVersion("");
- expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
- expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
- expectedResourceAuditJavaObject.setDesc(errorInfo.getAuditDesc(""));
- expectedResourceAuditJavaObject.setArtifactData("");
- expectedResourceAuditJavaObject.setCurrArtifactUuid(origArtifact.getUniqueId());
- expectedResourceAuditJavaObject.setPrevArtifactUuid("");
- AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
- expectedResourceAuditJavaObject.setPrevArtifactUuid(null);
- } finally {
- httpclient.close();
- }
-
- }
-
- @Test
- public void downloadArtifactFromServiceNotFound() throws Exception {
-
- CloseableHttpClient httpclient = HttpClients.createDefault();
- try {
-
- String artifactIdNotFound = "11111";
- ArtifactDefinition origArtifact = new ArtifactDefinition();
- origArtifact.setUniqueId(artifactIdNotFound);
-
- String url = String.format(Urls.UI_DOWNLOAD_SERVICE_ARTIFACT, config.getCatalogBeHost(), config.getCatalogBePort(), serviceDetails.getUniqueId(), artifactIdNotFound);
- HttpGet httpGet = createGetRequest(url);
- CloseableHttpResponse response2 = httpclient.execute(httpGet);
- int status = response2.getStatusLine().getStatusCode();
- AssertJUnit.assertEquals("expected 404 not found", 404, status);
-
- // validate audit
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.ARTIFACT_NOT_FOUND.name());
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ServiceValidationUtils.constructFieldsForAuditValidation(serviceDetails, serviceDetails.getVersion(), sdncUserDetails);
- String auditAction = "ArtifactDownload";
- expectedResourceAuditJavaObject.setAction(auditAction);
- expectedResourceAuditJavaObject.setPrevState("");
- expectedResourceAuditJavaObject.setPrevVersion("");
- expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
- expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
- expectedResourceAuditJavaObject.setDesc(errorInfo.getAuditDesc(""));
- expectedResourceAuditJavaObject.setArtifactData("");
- expectedResourceAuditJavaObject.setCurrArtifactUuid(origArtifact.getUniqueId());
- expectedResourceAuditJavaObject.setPrevArtifactUuid("");
- AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
-
- } finally {
- httpclient.close();
- }
-
- }
-
- @Test
- public void addArtifactToResourceTest() throws Exception {
-
- ArtifactReqDetails defaultArtifact = ElementFactory.getDefaultArtifact();
-
- RestResponse response = ArtifactRestUtils.addInformationalArtifactToResource(defaultArtifact, sdncUserDetails, resourceDetails.getUniqueId());
- int status = response.getErrorCode();
- AssertJUnit.assertEquals("add informational artifact request returned status: " + response.getErrorCode(), 200, status);
-
- RestResponse resourceResp = ResourceRestUtils.getResource(resourceDetails.getUniqueId());
- Resource resource = ResponseParser.convertResourceResponseToJavaObject(resourceResp.getResponse());
- AssertJUnit.assertNotNull(resource);
-
- Map<String, ArtifactDefinition> artifacts = resource.getArtifacts();
- boolean isExist = false;
- for (Map.Entry<String, ArtifactDefinition> entry : artifacts.entrySet()) {
- if (entry.getKey().equals(defaultArtifact.getArtifactLabel())) {
- isExist = true;
-
- }
- }
- AssertJUnit.assertTrue(isExist);
- }
-
-
- protected String createUploadArtifactBodyJson() {
- Map<String, Object> jsonBody = new HashMap<String, Object>();
- jsonBody.put("artifactName", UPLOAD_ARTIFACT_NAME);
- jsonBody.put("artifactDisplayName", "configure");
- jsonBody.put("artifactType", "SHELL");
- jsonBody.put("mandatory", "false");
- jsonBody.put("description", "ff");
- jsonBody.put("payloadData", UPLOAD_ARTIFACT_PAYLOAD);
- jsonBody.put("artifactLabel", "configure");
- return gson.toJson(jsonBody);
- }
-
- protected ArtifactDefinition getArtifactDataFromJson(String json) {
- Gson gson = new Gson();
- JsonObject jsonElement = new JsonObject();
- jsonElement = gson.fromJson(json, jsonElement.getClass());
- ArtifactDefinition artifact = new ArtifactDefinition();
- String payload = null;
- JsonElement artifactPayload = jsonElement.get(Constants.ARTIFACT_PAYLOAD_DATA);
- if (artifactPayload != null && !artifactPayload.isJsonNull()) {
- payload = artifactPayload.getAsString();
- }
- jsonElement.remove(Constants.ARTIFACT_PAYLOAD_DATA);
- artifact = gson.fromJson(jsonElement, ArtifactDefinition.class);
- artifact.setPayloadData(payload);
-
- /*atifact.setArtifactName(UPLOAD_ARTIFACT_NAME);
-artifact.setArtifactDisplayName("configure");
-artifact.setArtifactType("SHELL");
-artifact.setMandatory(false);
-artifact.setDescription("ff");
-artifact.setPayloadData(UPLOAD_ARTIFACT_PAYLOAD);
-artifact.setArtifactLabel("configure");*/
- return artifact;
- }
-
- protected HttpGet createGetRequest(String url) {
- HttpGet httpGet = new HttpGet(url);
- httpGet.addHeader(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- httpGet.addHeader(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
- httpGet.addHeader(HttpHeaderEnum.USER_ID.getValue(), sdncUserDetails.getUserId());
- return httpGet;
- }
-
- protected String getArtifactUid(HttpResponse response) throws HttpResponseException, IOException, ParseException {
- String responseString = new BasicResponseHandler().handleResponse(response);
- JSONObject responseMap = (JSONObject) jsonParser.parse(responseString);
- String artifactId = (String) responseMap.get("uniqueId");
- return artifactId;
- }
-
- protected String getArtifactEsId(HttpResponse response) throws HttpResponseException, IOException, ParseException {
- String responseString = new BasicResponseHandler().handleResponse(response);
- JSONObject responseMap = (JSONObject) jsonParser.parse(responseString);
- String esId = (String) responseMap.get("EsId");
- return esId;
- }
-
- protected ArtifactDefinition addArtifactDataFromResponse(HttpResponse response, ArtifactDefinition artifact) throws HttpResponseException, IOException, ParseException {
- //String responseString = new BasicResponseHandler().handleResponse(response);
- HttpEntity entity = response.getEntity();
- String responseString = EntityUtils.toString(entity);
- JSONObject responseMap = (JSONObject) jsonParser.parse(responseString);
- artifact.setEsId((String)responseMap.get("esId"));
- artifact.setUniqueId((String) responseMap.get("uniqueId"));
- artifact.setArtifactGroupType(ArtifactGroupTypeEnum.findType((String) responseMap.get("artifactGroupType")));
- artifact.setTimeout(((Long) responseMap.get("timeout")).intValue());
- return artifact;
- }
-
- protected String getLifecycleArtifactUid(CloseableHttpResponse response) throws HttpResponseException, IOException, ParseException {
- String responseString = new BasicResponseHandler().handleResponse(response);
- JSONObject responseMap = (JSONObject) jsonParser.parse(responseString);
- responseMap = (JSONObject) responseMap.get("implementation");
- String artifactId = (String) responseMap.get("uniqueId");
- return artifactId;
- }
-
- protected HttpDelete createDeleteArtifactRequest(String url) {
- HttpDelete httpDelete = new HttpDelete(url);
- httpDelete.addHeader(HttpHeaderEnum.USER_ID.getValue(), sdncUserDetails.getUserId());
- httpDelete.addHeader(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
- return httpDelete;
- }
-
- protected HttpPost createPostAddArtifactRequeast(String jsonBody, String url, boolean addMd5Header) throws UnsupportedEncodingException {
- HttpPost httppost = new HttpPost(url);
- httppost.addHeader(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- httppost.addHeader(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
- httppost.addHeader(HttpHeaderEnum.USER_ID.getValue(), sdncUserDetails.getUserId());
- if (addMd5Header) {
- httppost.addHeader(HttpHeaderEnum.Content_MD5.getValue(), GeneralUtility.calculateMD5Base64EncodedByString(jsonBody));
- }
- StringEntity input = new StringEntity(jsonBody);
- input.setContentType("application/json");
- httppost.setEntity(input);
- log.debug("Executing request {}" , httppost.getRequestLine());
- return httppost;
- }
-
- protected String createLoadArtifactBody() {
- Map<String, Object> json = new HashMap<String, Object>();
- json.put("artifactName", "install_apache2.sh");
- json.put("artifactType", "SHELL");
- json.put("description", "ddd");
- json.put("payloadData", "UEsDBAoAAAAIAAeLb0bDQz");
- json.put("artifactLabel", "name123");
-
- String jsonStr = gson.toJson(json);
- return jsonStr;
- }
-
- protected void checkDeleteResponse(RestResponse response) {
- BaseRestUtils.checkStatusCode(response, "delete request failed", false, 204, 404);
- }
-
- protected ArtifactUiDownloadData getArtifactUiDownloadData(String artifactUiDownloadDataStr) throws Exception {
-
- ObjectMapper mapper = new ObjectMapper();
- try {
- ArtifactUiDownloadData artifactUiDownloadData = mapper.readValue(artifactUiDownloadDataStr, ArtifactUiDownloadData.class);
- return artifactUiDownloadData;
- } catch (Exception e) {
- e.printStackTrace();
- }
- return null;
- }
-
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/HeatEnvArtifact.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/HeatEnvArtifact.java
deleted file mode 100644
index 80e0a54ee4..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/HeatEnvArtifact.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.artifacts;
-
-import org.apache.commons.codec.binary.Base64;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.datatypes.elements.HeatParameterDataDefinition;
-import org.openecomp.sdc.be.model.*;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceInstantiationType;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.*;
-import org.testng.annotations.Test;
-import org.yaml.snakeyaml.Yaml;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.util.List;
-import java.util.Map;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-public class HeatEnvArtifact extends ComponentBaseTest {
-
- @Rule
- public static TestName name = new TestName();
-
- public HeatEnvArtifact() {
- super(name, HeatEnvArtifact.class.getName());
- }
-
- @Test(enabled = true)
- public void heatEnvOnResourceFormatTest() throws Exception {
-
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
-
- Resource createdResource = createVfFromCSAR(sdncModifierDetails, "csarHeatEnv.csar");
- assertNotNull(createdResource);
-
- RestResponse certifyState = LifecycleRestUtils.changeComponentState(createdResource, sdncModifierDetails, LifeCycleStatesEnum.CHECKIN);
- BaseRestUtils.checkSuccess(certifyState);
-
- Resource certifiedResource = ResponseParser.parseToObjectUsingMapper(certifyState.getResponse(), Resource.class);
-
- ServiceReqDetails serviceDetails = ElementFactory.getDefaultService(
- "ciNewtestservice1", ServiceCategoriesEnum.MOBILITY, sdncModifierDetails.getUserId(),
- ServiceInstantiationType.A_LA_CARTE.getValue());
-
- // 2 create service
- RestResponse createServiceResponse = ServiceRestUtils.createService(serviceDetails, sdncModifierDetails);
- ResourceRestUtils.checkCreateResponse(createServiceResponse);
- Service service = ResponseParser.parseToObjectUsingMapper(createServiceResponse.getResponse(), Service.class);
-
- // 3 create vf instance in service
- ComponentInstanceReqDetails componentInstanceDetails = ElementFactory.getComponentInstance(certifiedResource);
- RestResponse createComponentInstance = ComponentInstanceRestUtils.createComponentInstance(componentInstanceDetails, sdncModifierDetails, service);
- ResourceRestUtils.checkCreateResponse(createComponentInstance);
-
- RestResponse getService = ServiceRestUtils.getService(service.getUniqueId());
- BaseRestUtils.checkSuccess(getService);
- service = ResponseParser.parseToObjectUsingMapper(getService.getResponse(), Service.class);
-
- List<ComponentInstance> componentInstances = service.getComponentInstances();
- assertNotNull(componentInstances);
- assertEquals(1, componentInstances.size());
-
- ComponentInstance vfi = componentInstances.get(0);
- Map<String, ArtifactDefinition> deploymentArtifacts = vfi.getDeploymentArtifacts();
- assertNotNull(deploymentArtifacts);
- assertEquals(4, deploymentArtifacts.size());
- ArtifactDefinition heatEnv = deploymentArtifacts.get("heat0env");
- assertNotNull(heatEnv);
-
- Map<String, Object> yaml = downloadComponentInstanceYamlFile(service.getUniqueId(), vfi.getUniqueId(), sdncModifierDetails, heatEnv.getUniqueId());
- assertNotNull(yaml);
- Map<String, Object> paramters = (Map<String, Object>)yaml.get("parameters");
- assertNotNull(paramters);
- assertEquals(8, paramters.size());
- assertEquals(null, paramters.get("param8"));
- List<HeatParameterDataDefinition> heatParameters = heatEnv.getHeatParameters();
- heatParameters.forEach(p -> {
- assertEquals(p.getCurrentValue(), paramters.get(p.getName()));
- });
- }
- @Test(enabled = true)
- public void noHeatEnvOnResourceFormatTest() throws Exception {
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
-
- Resource createdResource = createVfFromCSAR(sdncModifierDetails, "csarHeatNoEnv.csar");
- assertNotNull(createdResource);
-
- RestResponse certifyState = LifecycleRestUtils.changeComponentState(createdResource, sdncModifierDetails, LifeCycleStatesEnum.CHECKIN);
- BaseRestUtils.checkSuccess(certifyState);
-
- Resource certifiedResource = ResponseParser.parseToObjectUsingMapper(certifyState.getResponse(), Resource.class);
-
- ServiceReqDetails serviceDetails = ElementFactory.getDefaultService(
- "ciNewtestservice1", ServiceCategoriesEnum.MOBILITY, sdncModifierDetails.getUserId(),
- ServiceInstantiationType.A_LA_CARTE.getValue());
-
- // 2 create service
- RestResponse createServiceResponse = ServiceRestUtils.createService(serviceDetails, sdncModifierDetails);
- ResourceRestUtils.checkCreateResponse(createServiceResponse);
- Service service = ResponseParser.parseToObjectUsingMapper(createServiceResponse.getResponse(), Service.class);
-
- // 3 create vf instance in service
- ComponentInstanceReqDetails componentInstanceDetails = ElementFactory.getComponentInstance(certifiedResource);
- RestResponse createComponentInstance = ComponentInstanceRestUtils.createComponentInstance(componentInstanceDetails, sdncModifierDetails, service);
- ResourceRestUtils.checkCreateResponse(createComponentInstance);
-
- RestResponse getService = ServiceRestUtils.getService(service.getUniqueId());
- BaseRestUtils.checkSuccess(getService);
- service = ResponseParser.parseToObjectUsingMapper(getService.getResponse(), Service.class);
-
- List<ComponentInstance> componentInstances = service.getComponentInstances();
- assertNotNull(componentInstances);
- assertEquals(1, componentInstances.size());
-
- ComponentInstance vfi = componentInstances.get(0);
- Map<String, ArtifactDefinition> deploymentArtifacts = vfi.getDeploymentArtifacts();
- assertNotNull(deploymentArtifacts);
- assertEquals(4, deploymentArtifacts.size());
- ArtifactDefinition heatEnv = deploymentArtifacts.get("heat0env");
- assertNotNull(heatEnv);
-
- Map<String, Object> yaml = downloadComponentInstanceYamlFile(service.getUniqueId(), vfi.getUniqueId(), sdncModifierDetails, heatEnv.getUniqueId());
- assertNotNull(yaml);
- Map<String, Object> paramters = (Map<String, Object>)yaml.get("parameters");
- assertNotNull(paramters);
- assertEquals(8, paramters.size());
- assertEquals(null, paramters.get("param1"));
- assertEquals(null, paramters.get("param2"));
- assertEquals(null, paramters.get("param4"));
- assertEquals(null, paramters.get("param5"));
- assertEquals(null, paramters.get("param7"));
- assertEquals(null, paramters.get("param8"));
- List<HeatParameterDataDefinition> heatParameters = heatEnv.getHeatParameters();
- heatParameters.forEach(p -> {
- assertEquals(p.getCurrentValue(), paramters.get(p.getName()));
- });
-
- }
- //****************************************
- private Map<String, Object> downloadComponentInstanceYamlFile(String serviceUniqueId, String resourceInstanceId, User user, String artifactUniqeId) throws Exception {
- RestResponse heatEnvDownloadResponse = ArtifactRestUtils.downloadResourceInstanceArtifact(serviceUniqueId, resourceInstanceId, user, artifactUniqeId);
- BaseRestUtils.checkSuccess(heatEnvDownloadResponse);
-
- ArtifactUiDownloadData artifactUiDownloadData = ResponseParser.parseToObject(heatEnvDownloadResponse.getResponse(), ArtifactUiDownloadData.class);
- byte[] fromUiDownload = artifactUiDownloadData.getBase64Contents().getBytes();
- byte[] decodeBase64 = Base64.decodeBase64(fromUiDownload);
- Yaml yaml = new Yaml();
-
- InputStream inputStream = new ByteArrayInputStream(decodeBase64);
-
- Map<String, Object> load = (Map<String, Object>) yaml.load(inputStream);
-
- return load;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/PlaceHolderValidations.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/PlaceHolderValidations.java
deleted file mode 100644
index b15da07139..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/PlaceHolderValidations.java
+++ /dev/null
@@ -1,673 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.artifacts;
-
-//import static org.junit.Assert.assertTrue;
-
-import fj.data.Either;
-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.*;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.*;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-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.FileUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.*;
-import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
-import static org.testng.AssertJUnit.*;
-
-public class PlaceHolderValidations extends ComponentBaseTest {
- private static Logger logger = LoggerFactory.getLogger(PlaceHolderValidations.class.getName());
- private static final String heatExtension = "yaml";
- // private static final String yangXmlExtension = "xml";
- // private static final String muranoPkgExtension = "zip";
- private final String folderName = "addHeatArtifactToServiceAndSertify";
- private Resource resource;
- private final int timeOut = 60;
- private ArtifactReqDetails updateArtifactReqDetails = null;
- protected User sdncDesignerDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- protected User sdncDesignerDetails2 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER2);
- protected ResourceReqDetails resourceDetails1;
- protected ResourceReqDetails resourceVF;
- protected ResourceReqDetails resourceCP;
- protected ResourceReqDetails resourceVL;
-
- protected ArtifactReqDetails heatArtifactDetails;
- protected ArtifactReqDetails heatVolArtifactDetails;
- protected ArtifactReqDetails heatNetArtifactDetails;
-
- public PlaceHolderValidations() {
- super(name, PlaceHolderValidations.class.getName());
- }
-
- @Rule
- public static TestName name = new TestName();
-
- @BeforeMethod
- public void init() throws IOException, Exception {
-
- heatArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
- heatNetArtifactDetails = ElementFactory
- .getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT_NET.getType());
- heatVolArtifactDetails = ElementFactory
- .getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT_VOL.getType());
- Resource resourceObject = AtomicOperationUtils
- .createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
- resourceDetails1 = new ResourceReqDetails(resourceObject);
- resourceObject = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true)
- .left().value();
- resourceVF = new ResourceReqDetails(resourceObject);
- resourceObject = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.CP, UserRoleEnum.DESIGNER, true)
- .left().value();
- resourceCP = new ResourceReqDetails(resourceObject);
- resourceObject = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VL, UserRoleEnum.DESIGNER, true)
- .left().value();
- resourceVL = new ResourceReqDetails(resourceObject);
- }
-
- @Test
- public void validateDeploymentPlaceHoldersByConfig() throws IOException {
- RestResponse resourceGetResponse = ResourceRestUtils.getResource(resourceDetails1, sdncDesignerDetails1);
- Resource resourceObject = ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
- Map<String, ArtifactDefinition> deploymentArtifacts = resourceObject.getDeploymentArtifacts();
- assertNotNull("deploymentArtifacts list is null", deploymentArtifacts);
- List<String> listOfResDepArtTypesFromConfig = Utils.getListOfDepResArtLabels(true);
- assertNotNull("deployment artifact types list is null", listOfResDepArtTypesFromConfig);
- for (String resDepArtType : listOfResDepArtTypesFromConfig) {
- assertNotNull("placeholder of " + resDepArtType + " type doesn't exist",
- deploymentArtifacts.get(resDepArtType));
- }
- }
-
- /*private void validateToscaArtifactsBeforeAndAfterSFT(ResourceReqDetails resourceDetails)
- throws IOException, Exception {
- RestResponse componentResponse = ResourceRestUtils.getResource(resourceDetails, sdncDesignerDetails1);
- Component component = ResponseParser.convertResourceResponseToJavaObject(componentResponse.getResponse());
- Map<String, ArtifactDefinition> toscaArtifacts = component.getToscaArtifacts();
- for (ArtifactDefinition artifact : toscaArtifacts.values()) {
- assertNull(artifact.getEsId());
- }
-
- componentResponse = LifecycleRestUtils.changeResourceState(resourceDetails, sdncDesignerDetails1,
- LifeCycleStatesEnum.CERTIFICATIONREQUEST);
- component = ResponseParser.convertResourceResponseToJavaObject(componentResponse.getResponse());
- toscaArtifacts = component.getToscaArtifacts();
-
- for (ArtifactDefinition artifact : toscaArtifacts.values()) {
- assertEquals(artifact.getEsId(), artifact.getUniqueId());
- List<Pair<String, String>> fields = new ArrayList();
- fields.add(new Pair<String, String>("id", artifact.getEsId()));
- List<Row> fetchFromTable = CassandraUtils.fetchFromTableQuery("sdcartifact", "resources", fields);
- assertTrue(1 == fetchFromTable.size());
- }
- }*/
-
- /*@Test
- public void validateToscaArtifactsBeforeAndAfterSFT() throws IOException, Exception {
- // TODO ADD VF and Service
- validateToscaArtifactsBeforeAndAfterSFT(resourceDetails1);
- validateToscaArtifactsBeforeAndAfterSFT(resourceCP);
- validateToscaArtifactsBeforeAndAfterSFT(resourceVL);
- }*/
-
- @Test
- public void validateToscaPlaceHoldersByConfig() throws IOException, Exception {
- List<Component> components = new ArrayList<>();
- RestResponse componentGetResponse = ResourceRestUtils.getResource(resourceDetails1, sdncDesignerDetails1);
- components.add(ResponseParser.convertResourceResponseToJavaObject(componentGetResponse.getResponse()));
-
- componentGetResponse = ResourceRestUtils.getResource(resourceCP, sdncDesignerDetails1);
- components.add(ResponseParser.convertResourceResponseToJavaObject(componentGetResponse.getResponse()));
-
- componentGetResponse = ResourceRestUtils.getResource(resourceVF, sdncDesignerDetails1);
- components.add(ResponseParser.convertResourceResponseToJavaObject(componentGetResponse.getResponse()));
-
- componentGetResponse = ResourceRestUtils.getResource(resourceVL, sdncDesignerDetails1);
- components.add(ResponseParser.convertResourceResponseToJavaObject(componentGetResponse.getResponse()));
-
- Service service = AtomicOperationUtils
- .createServiceByCategory(ServiceCategoriesEnum.MOBILITY, UserRoleEnum.DESIGNER, true).left().value();
- componentGetResponse = ServiceRestUtils.getService(service.getUniqueId(),
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- components.add(ResponseParser.parseToObjectUsingMapper(componentGetResponse.getResponse(), Service.class));
-
- for (Component component : components) {
- Map<String, ArtifactDefinition> toscaArtifacts = component.getToscaArtifacts();
- assertNotNull("toscaArtifacts list is null", toscaArtifacts);
- List<String> listOfToscaArtTypesFromConfig = Utils.getListOfToscaArtLabels(true);
- assertNotNull("tosca artifact types list is null", listOfToscaArtTypesFromConfig);
- for (String toscaArtType : listOfToscaArtTypesFromConfig) {
- assertNotNull("placeholder of " + toscaArtType + " type doesn't exist",
- toscaArtifacts.get(toscaArtType));
- }
- }
-
- }
-
- // test check configuration of "displayName" field for "heat" type
- // deployment artifact
- @Test
- public void validateDeploymentPlaceHoldersDescriptionOfHeatByConfig() throws IOException {
-
- Map<String, Object> mapOfDepResArtTypesObjects = getMapOfDepResArtTypesObjects();
- assertNotNull("deployment artifact types list is null", mapOfDepResArtTypesObjects);
- Object object = mapOfDepResArtTypesObjects.get("heat");
- if (object instanceof Map<?, ?>) {
- Map<String, Object> map = (Map<String, Object>) object;
- assertTrue(map.get("displayName").equals("Base HEAT Template"));
- } else {
- assertTrue("return object does not instance of map", false);
- }
- }
-
- @Test
- public void addDepResArtEachType() throws Exception {
-
- String artType;
-
- addDeploymentArtifactByTypeToResource(resourceDetails1, heatArtifactDetails);
- addDeploymentArtifactByTypeToResource(resourceDetails1, heatVolArtifactDetails);
- addDeploymentArtifactByTypeToResource(resourceDetails1, heatNetArtifactDetails);
- RestResponse response = ResourceRestUtils.getResource(resourceDetails1.getUniqueId());
- resource = ResponseParser.convertResourceResponseToJavaObject(response.getResponse());
- List<String> listOfResDepArtTypesFromConfig = Utils.getListOfDepResArtLabels(true);
- assertNotNull("deployment artifact types list is null", listOfResDepArtTypesFromConfig);
- for (String iter : listOfResDepArtTypesFromConfig) {
- artType = iter;
- verifyDepArtPlaceHoldersByType(artType);
- }
- }
-
- @Test
- public void checkHeatParametersExistingForEachType() throws Exception {
-
- String artType;
-
- addDeploymentArtifactByTypeToResource(resourceDetails1, heatArtifactDetails);
- addDeploymentArtifactByTypeToResource(resourceDetails1, heatVolArtifactDetails);
- addDeploymentArtifactByTypeToResource(resourceDetails1, heatNetArtifactDetails);
- RestResponse response = ResourceRestUtils.getResource(resourceDetails1.getUniqueId());
- resource = ResponseParser.convertResourceResponseToJavaObject(response.getResponse());
- List<String> listOfResDepArtTypesFromConfig = Utils.getListOfDepResArtLabels(true);
- assertNotNull("deployment artifact types list is null", listOfResDepArtTypesFromConfig);
- for (String iter : listOfResDepArtTypesFromConfig) {
- artType = iter;
- verifyDepArtPlaceHoldersByType(artType);
- verifyHeatParametersExistance(artType, false);
- }
- }
-
- @Test
- public void checkHeatParametersExistingForSpecificType() throws Exception {
-
- String artType;
-
- addDeploymentArtifactByTypeToResource(resourceDetails1, heatVolArtifactDetails);
- addDeploymentArtifactByTypeToResource(resourceDetails1, heatNetArtifactDetails);
- RestResponse response = ResourceRestUtils.getResource(resourceDetails1.getUniqueId());
- resource = ResponseParser.convertResourceResponseToJavaObject(response.getResponse());
- List<String> listOfResDepArtTypesFromConfig = Utils.getListOfDepResArtLabels(true);
- assertNotNull("deployment artifact types list is null", listOfResDepArtTypesFromConfig);
- for (String iter : listOfResDepArtTypesFromConfig) {
- artType = iter;
- if (heatArtifactDetails.getArtifactLabel().equals(iter)) {
- verifyHeatParametersExistance(artType, true);
- } else {
- verifyHeatParametersExistance(artType, false);
- }
- }
- }
-
- @Test
- public void addAndDeleteDepResArtEachType() throws Exception {
-
- String artType;
-
- addDeploymentArtifactByTypeToResource(resourceDetails1, heatArtifactDetails);
- addDeploymentArtifactByTypeToResource(resourceDetails1, heatVolArtifactDetails);
- addDeploymentArtifactByTypeToResource(resourceDetails1, heatNetArtifactDetails);
- RestResponse response = ResourceRestUtils.getResource(resourceDetails1.getUniqueId());
- resource = ResponseParser.convertResourceResponseToJavaObject(response.getResponse());
- List<String> listOfResDepArtTypesFromConfig = Utils.getListOfDepResArtLabels(true);
- assertNotNull("deployment artifact types list is null", listOfResDepArtTypesFromConfig);
- for (String iter : listOfResDepArtTypesFromConfig) {
- artType = iter;
- verifyDepArtPlaceHoldersByType(artType);
- }
- RestResponse restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails1,
- sdncDesignerDetails1, LifeCycleStatesEnum.CHECKIN);
- assertTrue("expected response code in CHECKIN 200", restResponseResource.getErrorCode() == 200);
- restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails1, sdncDesignerDetails1,
- LifeCycleStatesEnum.CHECKOUT);
- assertTrue("expected response code in CHECKOUT 200", restResponseResource.getErrorCode() == 200);
-
- // delete all deployment artifacts
- deleteDeploymentArtifactByTypeToResource(resourceDetails1, heatArtifactDetails);
- deleteDeploymentArtifactByTypeToResource(resourceDetails1, heatVolArtifactDetails);
- deleteDeploymentArtifactByTypeToResource(resourceDetails1, heatNetArtifactDetails);
- response = ResourceRestUtils.getResource(resourceDetails1.getUniqueId());
- resource = ResponseParser.convertResourceResponseToJavaObject(response.getResponse());
- listOfResDepArtTypesFromConfig = Utils.getListOfDepResArtLabels(true);
- assertNotNull("deployment artifact types list is null", listOfResDepArtTypesFromConfig);
- for (String iter : listOfResDepArtTypesFromConfig) {
- artType = iter;
- verifyDepArtPlaceHoldersByType(artType);
- }
- }
-
- @Test
- public void addRemoveAddAgainArtifact() throws Exception {
-
- // get MAP before upload artifact
- RestResponse resourceGetResponse = ResourceRestUtils.getResource(resourceDetails1, sdncDesignerDetails1);
- Resource resourceRespJavaObject = ResponseParser
- .convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
- Map<String, ArtifactDefinition> deploymentArtifacts = resourceRespJavaObject.getDeploymentArtifacts();
-
- ArtifactDefinition artifactDefinition = deploymentArtifacts.get("heat");
-
- // validate place holder exist
- assertNotNull(artifactDefinition);
-
- // add artifact
- updateArtifactReqDetails = getUpdateArtifactDetails(ArtifactTypeEnum.HEAT.getType());
-
- RestResponse addInformationalArtifactToResource = ArtifactRestUtils.updateInformationalArtifactToResource(
- updateArtifactReqDetails, sdncDesignerDetails1, resourceDetails1.getUniqueId());
- logger.debug("addInformationalArtifactToResource response: "
- + addInformationalArtifactToResource.getResponseMessage());
- assertTrue("response code is not 200, returned :" + addInformationalArtifactToResource.getErrorCode(),
- addInformationalArtifactToResource.getErrorCode() == 200);
-
- ArtifactDefinition artifactDefinitionResponseJavaObject = ResponseParser
- .convertArtifactDefinitionResponseToJavaObject(addInformationalArtifactToResource.getResponse());
- ArtifactDefinition artDef1 = fillArtDefFromResponse(artifactDefinitionResponseJavaObject);
-
- // remove artifact
- RestResponse deleteArtifactFromResource = ArtifactRestUtils.deleteInformationalArtifactFromResource(
- resourceDetails1.getUniqueId(), updateArtifactReqDetails, sdncDesignerDetails1);
- logger.debug(
- "addInformationalArtifactToResource response: " + deleteArtifactFromResource.getResponseMessage());
- assertTrue("response code is not 200, returned :" + deleteArtifactFromResource.getErrorCode(),
- deleteArtifactFromResource.getErrorCode() == 200);
-
- RestResponse getResourceResp = ResourceRestUtils.getResource(resourceDetails1, sdncDesignerDetails1);
-
- artifactDefinitionResponseJavaObject = ResponseParser
- .convertArtifactDefinitionResponseToJavaObject(deleteArtifactFromResource.getResponse());
- assertTrue(artifactDefinitionResponseJavaObject.getArtifactName().isEmpty());
- assertTrue(artifactDefinitionResponseJavaObject.getDescription().isEmpty());
- assertTrue(artifactDefinitionResponseJavaObject.getArtifactChecksum().isEmpty());
- assertTrue(artifactDefinitionResponseJavaObject.getEsId().isEmpty());
- assertTrue(artifactDefinitionResponseJavaObject.getArtifactUUID().isEmpty());
- assertNull(artifactDefinitionResponseJavaObject.getHeatParameters());
-
- // add artifact again with different user
- addInformationalArtifactToResource = ArtifactRestUtils.updateInformationalArtifactToResource(
- heatArtifactDetails, sdncDesignerDetails1, resourceDetails1.getUniqueId());
- logger.debug("addInformationalArtifactToResource response: "
- + addInformationalArtifactToResource.getResponseMessage());
- assertTrue("response code is not 200, returned :" + addInformationalArtifactToResource.getErrorCode(),
- addInformationalArtifactToResource.getErrorCode() == 200);
-
- artifactDefinitionResponseJavaObject = ResponseParser
- .convertArtifactDefinitionResponseToJavaObject(addInformationalArtifactToResource.getResponse());
- ArtifactDefinition artDef2 = fillArtDefFromResponse(artifactDefinitionResponseJavaObject);
-
- assertFalse("check artifact checksum", artDef1.getArtifactChecksum().equals(artDef2.getArtifactChecksum()));
- assertTrue("check artifact EsId", artDef1.getEsId().equals(artDef2.getEsId()));
- assertFalse("check artifact UUID", artDef1.getArtifactUUID().equals(artDef2.getArtifactUUID()));
- assertTrue("check UserIdCreator", artDef1.getUserIdCreator().equals(artDef2.getUserIdCreator()));
- assertTrue("check UserIdLastUpdater", artDef1.getUserIdLastUpdater().equals(artDef2.getUserIdLastUpdater()));
- }
-
- @Test
- public void addUpdateArtifactByType() throws Exception {
-
- // get MAP before upload artifact
- RestResponse resourceGetResponse = ResourceRestUtils.getResource(resourceDetails1, sdncDesignerDetails1);
- Resource resourceRespJavaObject = ResponseParser
- .convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
- Map<String, ArtifactDefinition> deploymentArtifacts = resourceRespJavaObject.getDeploymentArtifacts();
-
- ArtifactDefinition artifactDefinition = deploymentArtifacts.get("heat");
-
- // validate place holder exist
- assertNotNull(artifactDefinition);
-
- // add artifact
- updateArtifactReqDetails = getUpdateArtifactDetails(ArtifactTypeEnum.HEAT.getType());
-
- RestResponse addInformationalArtifactToResource = ArtifactRestUtils.updateInformationalArtifactToResource(
- updateArtifactReqDetails, sdncDesignerDetails1, resourceDetails1.getUniqueId());
- logger.debug("addInformationalArtifactToResource response: "
- + addInformationalArtifactToResource.getResponseMessage());
- assertTrue("response code is not 200, returned :" + addInformationalArtifactToResource.getErrorCode(),
- addInformationalArtifactToResource.getErrorCode() == 200);
-
- ArtifactDefinition artifactDefinitionResponseJavaObject = ResponseParser
- .convertArtifactDefinitionResponseToJavaObject(addInformationalArtifactToResource.getResponse());
- ArtifactDefinition artDef1 = fillArtDefFromResponse(artifactDefinitionResponseJavaObject);
-
- RestResponse restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails1,
- sdncDesignerDetails1, LifeCycleStatesEnum.CHECKIN);
- restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails1, sdncDesignerDetails2,
- LifeCycleStatesEnum.CHECKOUT);
-
- // update with different user artifact
- heatArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
- heatArtifactDetails.setUniqueId(artifactDefinition.getUniqueId());
- heatArtifactDetails.setArtifactName("2.yaml");
- heatArtifactDetails.setArtifactLabel(artifactDefinition.getArtifactLabel());
-
- addInformationalArtifactToResource = ArtifactRestUtils.updateInformationalArtifactToResource(
- heatArtifactDetails, sdncDesignerDetails2, resourceDetails1.getUniqueId(), "heat");
- logger.debug("addInformationalArtifactToResource response: "
- + addInformationalArtifactToResource.getResponseMessage());
- assertTrue("response code is not 200, returned :" + addInformationalArtifactToResource.getErrorCode(),
- addInformationalArtifactToResource.getErrorCode() == 200);
-
- artifactDefinitionResponseJavaObject = ResponseParser
- .convertArtifactDefinitionResponseToJavaObject(addInformationalArtifactToResource.getResponse());
- ArtifactDefinition artDef2 = fillArtDefFromResponse(artifactDefinitionResponseJavaObject);
- verifyArtDefFields(artDef1, artDef2);
-
- }
-
- @Test
- public void addUpdateDeleteArtifact() throws Exception {
-
- // get MAP before upload artifact
- RestResponse resourceGetResponse = ResourceRestUtils.getResource(resourceDetails1, sdncDesignerDetails1);
- Resource resourceRespJavaObject = ResponseParser
- .convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
- Map<String, ArtifactDefinition> deploymentArtifacts = resourceRespJavaObject.getDeploymentArtifacts();
-
- ArtifactDefinition artifactDefinition = deploymentArtifacts.get("heat");
-
- // validate place holder exist
- assertNotNull(artifactDefinition);
-
- updateArtifactReqDetails = getUpdateArtifactDetails(ArtifactTypeEnum.HEAT.getType());
-
- RestResponse addInformationalArtifactToResource = ArtifactRestUtils.updateInformationalArtifactToResource(
- updateArtifactReqDetails, sdncDesignerDetails1, resourceDetails1.getUniqueId());
- logger.debug("addInformationalArtifactToResource response: "
- + addInformationalArtifactToResource.getResponseMessage());
- assertTrue("response code is not 200, returned :" + addInformationalArtifactToResource.getErrorCode(),
- addInformationalArtifactToResource.getErrorCode() == 200);
-
- ArtifactDefinition artifactDefinitionResponseJavaObject = ResponseParser
- .convertArtifactDefinitionResponseToJavaObject(addInformationalArtifactToResource.getResponse());
- ArtifactDefinition artDef1 = fillArtDefFromResponse(artifactDefinitionResponseJavaObject);
-
- RestResponse restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails1,
- sdncDesignerDetails1, LifeCycleStatesEnum.CHECKIN);
- restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails1, sdncDesignerDetails2,
- LifeCycleStatesEnum.CHECKOUT);
-
- // update with different user artifact
- heatArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
- heatArtifactDetails.setArtifactName("2.yaml");
-
- addInformationalArtifactToResource = ArtifactRestUtils.updateInformationalArtifactToResource(
- heatArtifactDetails, sdncDesignerDetails2, resourceDetails1.getUniqueId(), "heat");
- logger.debug("addInformationalArtifactToResource response: "
- + addInformationalArtifactToResource.getResponseMessage());
- assertTrue("response code is not 200, returned :" + addInformationalArtifactToResource.getErrorCode(),
- addInformationalArtifactToResource.getErrorCode() == 200);
-
- artifactDefinitionResponseJavaObject = ResponseParser
- .convertArtifactDefinitionResponseToJavaObject(addInformationalArtifactToResource.getResponse());
- ArtifactDefinition artDef2 = fillArtDefFromResponse(artifactDefinitionResponseJavaObject);
-
- verifyArtDefFields(artDef1, artDef2);
-
- RestResponse delteArtifactFromResource = ArtifactRestUtils.deleteInformationalArtifactFromResource(
- resourceDetails1.getUniqueId(), heatArtifactDetails, sdncDesignerDetails2);
- logger.debug("addInformationalArtifactToResource response: {}", delteArtifactFromResource.getResponseMessage());
- assertTrue("response code is not 200, returned :" + delteArtifactFromResource.getErrorCode(),
- delteArtifactFromResource.getErrorCode() == 200);
-
- }
-
- @Test
- public void addHeatVolArtInvalidExtension() throws Exception {
-
- heatVolArtifactDetails.setArtifactName("heatVol.txt");
- RestResponse response = getResponseOnAddDeploymentArtifactByTypeToResource(resourceDetails1,
- heatVolArtifactDetails);
- ErrorInfo errorInfo = ErrorValidationUtils
- .parseErrorConfigYaml(ActionStatus.WRONG_ARTIFACT_FILE_EXTENSION.name());
- assertEquals("Check response code after upload artifact", errorInfo.getCode(), response.getErrorCode());
- List<String> variables = Arrays.asList(ArtifactTypeEnum.HEAT_VOL.getType());
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.WRONG_ARTIFACT_FILE_EXTENSION.name(), variables,
- response.getResponse());
- }
-
- @Test
- public void addHeatNetArtInvalidExtension() throws Exception {
-
- heatNetArtifactDetails.setArtifactName("yaml");
- RestResponse response = getResponseOnAddDeploymentArtifactByTypeToResource(resourceDetails1,
- heatNetArtifactDetails);
- ErrorInfo errorInfo = ErrorValidationUtils
- .parseErrorConfigYaml(ActionStatus.WRONG_ARTIFACT_FILE_EXTENSION.name());
- assertEquals("Check response code after upload artifact", errorInfo.getCode(), response.getErrorCode());
- List<String> variables = Arrays.asList(ArtifactTypeEnum.HEAT_NET.getType());
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.WRONG_ARTIFACT_FILE_EXTENSION.name(), variables,
- response.getResponse());
- }
-
- @Test
- public void checkServiceSecurityTemplateInformationalArtifactsCreation() throws IOException, Exception {
-
- Either<Service, RestResponse> createServiceResponse = AtomicOperationUtils
- .createServiceByCategory(ServiceCategoriesEnum.MOBILITY, UserRoleEnum.DESIGNER, true);
- Map<String, ArtifactDefinition> artifacts = null;
- ArtifactDefinition securitytemplate = null;
- if (createServiceResponse.isLeft()) {
- Component component = createServiceResponse.left().value();
- artifacts = component.getArtifacts();
- securitytemplate = artifacts.get("servicesecuritytemplate");
- assertNotNull(securitytemplate);
- assertEquals("Service Security Template", securitytemplate.getArtifactDisplayName());
- } else {
- logger.debug("checkSecurityTemplateInformationalArtifactsCreation service creation response: "
- + createServiceResponse.right().value().getResponseMessage());
- }
- }
-
- @Test
- public void checkResourceSecurityTemplateInformationalArtifactsCreation() throws IOException, Exception {
-
- Resource resource = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
- NormativeTypesEnum.CONTAINER_APPLICATION, ResourceCategoryEnum.APPLICATION_L4_BORDER,
- UserRoleEnum.DESIGNER, true).left().value();
- Map<String, ArtifactDefinition> artifacts = resource.getArtifacts();
- ArtifactDefinition securitytemplate = artifacts.get("resourcesecuritytemplate");
- assertNotNull(securitytemplate);
- assertEquals("Resource Security Template", securitytemplate.getArtifactDisplayName());
- }
-
- // Benny
- @Test
- public void serviceSecurityTemplateInformationalArtifact() throws IOException, Exception {
- String artifactPlaceHolder = "servicesecuritytemplate";
- Service service = AtomicOperationUtils
- .createServiceByCategory(ServiceCategoriesEnum.MOBILITY, UserRoleEnum.DESIGNER, true).left().value();
- Map<String, ArtifactDefinition> artifacts = service.getArtifacts();
- ArtifactDefinition securitytemplate = artifacts.get(artifactPlaceHolder);
- assertNotNull(securitytemplate);
- assertEquals("Service Security Template", securitytemplate.getArtifactDisplayName());
- assertEquals("OTHER", securitytemplate.getArtifactType());
- assertEquals(artifactPlaceHolder, securitytemplate.getArtifactLabel());
- // Get service
- RestResponse getService = ServiceRestUtils.getService(service.getUniqueId(),
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- assertEquals(BaseRestUtils.STATUS_CODE_SUCCESS, getService.getErrorCode().intValue());
- service = ResponseParser.parseToObjectUsingMapper(getService.getResponse(), Service.class);
- artifacts = service.getArtifacts();
- securitytemplate = artifacts.get(artifactPlaceHolder);
- assertNotNull(securitytemplate);
- assertEquals("Service Security Template", securitytemplate.getArtifactDisplayName());
- assertEquals("OTHER", securitytemplate.getArtifactType());
- assertEquals(artifactPlaceHolder, securitytemplate.getArtifactLabel());
- }
-
- @Test
- public void resourceSecurityTemplateInformationalArtifacts() throws IOException, Exception {
- String artifactPlaceHolder = "resourcesecuritytemplate";
- Resource resource = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
- NormativeTypesEnum.CONTAINER_APPLICATION, ResourceCategoryEnum.APPLICATION_L4_BORDER,
- UserRoleEnum.DESIGNER, true).left().value();
- Map<String, ArtifactDefinition> artifacts = resource.getArtifacts();
- ArtifactDefinition securitytemplate = artifacts.get("resourcesecuritytemplate");
- assertNotNull(securitytemplate);
- assertEquals("Resource Security Template", securitytemplate.getArtifactDisplayName());
- assertEquals("OTHER", securitytemplate.getArtifactType());
- assertEquals(artifactPlaceHolder, securitytemplate.getArtifactLabel());
- // Get resource
- RestResponse getresource = ResourceRestUtils.getResource(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- resource.getUniqueId());
- assertEquals(BaseRestUtils.STATUS_CODE_SUCCESS, getresource.getErrorCode().intValue());
- resource = ResponseParser.parseToObjectUsingMapper(getresource.getResponse(), Resource.class);
- artifacts = resource.getArtifacts();
- securitytemplate = artifacts.get(artifactPlaceHolder);
- assertNotNull(securitytemplate);
- assertEquals("Resource Security Template", securitytemplate.getArtifactDisplayName());
- assertEquals("OTHER", securitytemplate.getArtifactType());
- assertEquals(artifactPlaceHolder, securitytemplate.getArtifactLabel());
- }
-
- // ================================================
-
- @SuppressWarnings("unchecked")
- private Map<String, Object> getMapOfDepResArtTypesObjects() throws FileNotFoundException {
-
- return (Map<String, Object>) Utils.parseYamlConfig("deploymentResourceArtifacts");
-
- }
-
- private void addDeploymentArtifactByTypeToResource(ResourceReqDetails resourceReqDetails,
- ArtifactReqDetails artReqDetails) throws IOException, Exception {
-
- RestResponse response = ArtifactRestUtils.addInformationalArtifactToResource(artReqDetails,
- sdncDesignerDetails1, resourceReqDetails.getUniqueId());
- assertTrue("add" + artReqDetails.getArtifactLabel() + " artifact to resource request returned status:"
- + response.getErrorCode(), response.getErrorCode() == 200);
- }
-
- private RestResponse getResponseOnAddDeploymentArtifactByTypeToResource(ResourceReqDetails resourceReqDetails,
- ArtifactReqDetails artReqDetails) throws IOException, Exception {
-
- return ArtifactRestUtils.addInformationalArtifactToResource(artReqDetails, sdncDesignerDetails1,
- resourceReqDetails.getUniqueId());
- }
-
- private void deleteDeploymentArtifactByTypeToResource(ResourceReqDetails resourceReqDetails,
- ArtifactReqDetails artReqDetails) throws IOException, Exception {
-
- RestResponse response = ArtifactRestUtils.deleteInformationalArtifactFromResource(
- resourceReqDetails.getUniqueId(), artReqDetails, sdncDesignerDetails1);
- assertTrue("delete" + artReqDetails.getArtifactLabel() + " artifact to resource request returned status:"
- + response.getErrorCode(), response.getErrorCode() == 200);
- }
-
- private void verifyDepArtPlaceHoldersByType(String artType) {
-
- Map<String, ArtifactDefinition> deploymentArtifacts = resource.getDeploymentArtifacts();
- assertNotNull("deployment artifact data is null", deploymentArtifacts.get(artType));
- assertNotNull("deployment artifact data is null", deploymentArtifacts.get(artType).getEsId());
- assertNotNull("deployment artifact data is null", deploymentArtifacts.get(artType).getDescription());
- assertTrue(
- "deployment artifact timeout does not equal to default value " + timeOut + " expected " + timeOut
- + ", actual - " + deploymentArtifacts.get(artType).getTimeout(),
- deploymentArtifacts.get(artType).getTimeout() == timeOut);
- assertTrue("deployment artifact label value ",
- deploymentArtifacts.get(artType).getArtifactLabel().equals(artType));
- }
-
- private void verifyHeatParametersExistance(String artType, Boolean isNull) {
- Map<String, ArtifactDefinition> deploymentArtifacts = resource.getDeploymentArtifacts();
- if (isNull) {
- assertNull("heatParameters list for type " + artType + " is not null",
- deploymentArtifacts.get(artType).getHeatParameters());
- } else {
- assertNotNull("heatParameters list for type " + artType + " is null",
- deploymentArtifacts.get(artType).getHeatParameters());
- }
- }
-
- private void verifyArtDefFields(ArtifactDefinition artDef1, ArtifactDefinition artDef2) {
-
- assertFalse("check artifact checksum", artDef1.getArtifactChecksum().equals(artDef2.getArtifactChecksum()));
- assertFalse("check artifact EsId", artDef1.getEsId().equals(artDef2.getEsId()));
- assertFalse("check artifact UUID", artDef1.getArtifactUUID().equals(artDef2.getArtifactUUID()));
- assertTrue("check UserIdCreator", artDef1.getUserIdCreator().equals(artDef2.getUserIdCreator()));
- assertFalse("check UserIdLastUpdater", artDef1.getUserIdLastUpdater().equals(artDef2.getUserIdLastUpdater()));
-
- }
-
- private ArtifactDefinition fillArtDefFromResponse(ArtifactDefinition artifactDefinitionResponseJavaObject) {
- ArtifactDefinition artDef = new ArtifactDefinition();
- artDef.setArtifactChecksum(artifactDefinitionResponseJavaObject.getArtifactChecksum());
- artDef.setEsId(artifactDefinitionResponseJavaObject.getEsId());
- artDef.setArtifactUUID(artifactDefinitionResponseJavaObject.getArtifactUUID());
- artDef.setUserIdCreator(artifactDefinitionResponseJavaObject.getUserIdCreator());
- artDef.setUserIdLastUpdater(artifactDefinitionResponseJavaObject.getUserIdLastUpdater());
- return artDef;
- }
-
- private ArtifactReqDetails getUpdateArtifactDetails(String artType) throws IOException, Exception {
- String ext = heatExtension;
- String sourceDir = config.getResourceConfigDir();
- String testResourcesPath = sourceDir + File.separator + folderName;
- List<String> listFileName = FileUtils.getFileListFromBaseDirectoryByTestName(testResourcesPath);
- logger.debug("listFileName: {}", listFileName.toString());
-
- String payload = FileUtils.loadPayloadFile(listFileName, ext, true);
- ArtifactReqDetails updateArtifactReqDetails = ElementFactory.getDefaultDeploymentArtifactForType(artType);
- updateArtifactReqDetails.setPayload(payload);
- updateArtifactReqDetails.setArtifactName("1.yaml");
- return updateArtifactReqDetails;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/ValidateHeatArtFieldsTypes.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/ValidateHeatArtFieldsTypes.java
deleted file mode 100644
index 09c4d387a2..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/ValidateHeatArtFieldsTypes.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.artifacts;
-
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.datatypes.elements.HeatParameterDataDefinition;
-import org.openecomp.sdc.be.model.ArtifactDefinition;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.RespJsonKeysEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.openecomp.sdc.ci.tests.utils.validation.ArtifactValidationUtils;
-import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
-import org.testng.AssertJUnit;
-import org.testng.annotations.Test;
-
-import java.util.Arrays;
-import java.util.List;
-
-public class ValidateHeatArtFieldsTypes extends ComponentBaseTest {
-
- protected User sdncDesignerDetails;
- protected ResourceReqDetails resourceDetails;
- protected ServiceReqDetails serviceDetails;
-
- private static final String heatExtension = "yaml";
- private static final String yangXmlExtension = "xml";
- private static final String muranoPkgExtension = "zip";
- private final String folderName = "yamlFieldsValidation";
-
- private final String uuidString = RespJsonKeysEnum.UUID.getRespJsonKeyName().toString();
-
- public ValidateHeatArtFieldsTypes() {
- super(name, ValidateHeatArtFieldsTypes.class.getName());
- }
-
- @Rule
- public static TestName name = new TestName();
-
- @Test
- public void validateHeatArtFiledTypes() throws Exception {
-
- // get relevant resource and service
-
- sdncDesignerDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- resourceDetails = ElementFactory.getDefaultResource();
-
- RestResponse response = ResourceRestUtils.createResource(resourceDetails, sdncDesignerDetails);
- AssertJUnit.assertTrue("create request returned status:" + response.getErrorCode(),
- response.getErrorCode() == 201);
-
- // add artifact to resource1
-
- ArtifactReqDetails heatArtifactDetails = ElementFactory
- .getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
- List<String> listOfArtifactFromFolder = ArtifactValidationUtils.getListOfArtifactFromFolder(folderName);
- for (int i = 0; i < listOfArtifactFromFolder.size(); i++) {
- heatArtifactDetails = ArtifactValidationUtils.replaceDefaultArtWithArtFromList(heatArtifactDetails,
- heatExtension, folderName, i);
- response = ArtifactRestUtils.addInformationalArtifactToResource(heatArtifactDetails, sdncDesignerDetails,
- resourceDetails.getUniqueId());
-
- if (heatArtifactDetails.getArtifactName().contains("bool")) {
- if (heatArtifactDetails.getArtifactName().contains("negative")) {
- // validate negative response
- List<String> variables = Arrays.asList("HEAT", "boolean", "city_name");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_HEAT_PARAMETER_VALUE.name(),
- variables, response.getResponse());
- }
- if (heatArtifactDetails.getArtifactName().contains("positive")) {
- AssertJUnit.assertTrue(
- "add HEAT artifact to resource request returned status:" + response.getErrorCode()
- + " fileName: " + heatArtifactDetails.getArtifactName(),
- response.getErrorCode() == 200);
- ArtifactDefinition artifactDefinitionJavaObject = ResponseParser
- .convertArtifactDefinitionResponseToJavaObject(response.getResponse());
- List<HeatParameterDataDefinition> heatParameters = artifactDefinitionJavaObject.getHeatParameters();
- String currentValue = null;
- for (HeatParameterDataDefinition heatParameterDefinition : heatParameters) {
- if (heatParameterDefinition.getName().equals("city_name")) {
- currentValue = heatParameterDefinition.getCurrentValue();
- }
- }
- if (heatArtifactDetails.getArtifactName().contains("true")) {
- AssertJUnit.assertTrue(currentValue.equals("true"));
- }
- if (heatArtifactDetails.getArtifactName().contains("false")) {
- AssertJUnit.assertTrue(currentValue.equals("false"));
- }
- RestResponse deleteInformationalArtifactFromResource = ArtifactRestUtils
- .deleteInformationalArtifactFromResource(resourceDetails.getUniqueId(), heatArtifactDetails,
- sdncDesignerDetails);
- AssertJUnit.assertTrue(
- "delete HEAT artifact from resource request returned status:"
- + deleteInformationalArtifactFromResource.getErrorCode(),
- deleteInformationalArtifactFromResource.getErrorCode() == 200);
- }
-
- } else if (heatArtifactDetails.getArtifactName().contains("number")) {
- if (heatArtifactDetails.getArtifactName().contains("negative")) {
- // validate negative response
- List<String> variables = Arrays.asList("HEAT", "number", "city_name");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_HEAT_PARAMETER_VALUE.name(),
- variables, response.getResponse());
- }
- if (heatArtifactDetails.getArtifactName().contains("positive")) {
- AssertJUnit.assertTrue(
- "add HEAT artifact to resource request returned status:" + response.getErrorCode()
- + " fileName: " + heatArtifactDetails.getArtifactName(),
- response.getErrorCode() == 200);
- }
-
- } else if (heatArtifactDetails.getArtifactName().contains("string")) {
- if (heatArtifactDetails.getArtifactName().contains("negative")) {
- // validate negative response
- List<String> variables = Arrays.asList("HEAT", "string", "city_name");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_HEAT_PARAMETER_VALUE.name(),
- variables, response.getResponse());
- }
- if (heatArtifactDetails.getArtifactName().contains("positive")) {
- AssertJUnit.assertTrue(
- "add HEAT artifact to resource request returned status:" + response.getErrorCode()
- + " fileName: " + heatArtifactDetails.getArtifactName(),
- response.getErrorCode() == 200);
- }
-
- }
-
- else if (heatArtifactDetails.getArtifactName().contains("unsupported")) {
-
- // validate negative response
- List<String> variables = Arrays.asList("HEAT", "number123");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_HEAT_PARAMETER_TYPE.name(),
- variables, response.getResponse());
-
- }
-
- else {
- AssertJUnit.assertTrue(
- "add HEAT artifact to resource request returned status:" + response.getErrorCode(),
- response.getErrorCode() == 200);
- }
- }
-
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/attribute/ComponentInstanceAttributeTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/attribute/ComponentInstanceAttributeTest.java
deleted file mode 100644
index 89d629d36c..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/attribute/ComponentInstanceAttributeTest.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.attribute;
-
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.ComponentInstance;
-import org.openecomp.sdc.be.model.ComponentInstanceAttribute;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
-import org.testng.annotations.Test;
-
-import java.io.File;
-import java.util.function.Function;
-
-import static org.junit.Assert.assertEquals;
-import static org.openecomp.sdc.common.datastructure.FunctionalInterfaces.swallowException;
-
-public class ComponentInstanceAttributeTest extends ComponentBaseTest {
-
- public static Gson gson = new GsonBuilder().setPrettyPrinting().create();
-
- @Rule
- public static TestName name = new TestName();
-
- public ComponentInstanceAttributeTest() {
- super(name, ComponentInstanceAttributeTest.class.getName());
- }
-
- @Test
- public void testUpdateAttributeOnResourceInstance() {
- // Prepare VF with vfc instance with Attributes
- String testResourcesPath = config.getResourceConfigDir() + File.separator + "importToscaResourceByCreateUrl";
- final Resource vfcWithAttributes = AtomicOperationUtils
- .importResource(testResourcesPath, "CPWithAttributes.yml").left().value();
- swallowException(() -> AtomicOperationUtils.changeComponentState(vfcWithAttributes, UserRoleEnum.DESIGNER,
- LifeCycleStatesEnum.CHECKIN, false));
- Resource vf = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, false)
- .left().value();
- ComponentInstance vfcInstance = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfcWithAttributes, vf).left().value();
-
- // util method to get the specific attribute from the vf
- Function<Resource, ComponentInstanceAttribute> attributeGetter = resourceVf -> resourceVf
- .getComponentInstancesAttributes().values().iterator().next().stream()
- .filter(att -> att.getName().equals("private_address")).findAny().get();
- // update attribute on vfc instance
- final Resource vfWithInsatncePreUpdate = swallowException(
- () -> (Resource) AtomicOperationUtils.getComponentObject(vf, UserRoleEnum.DESIGNER));
- ComponentInstanceAttribute attributeOfRI = attributeGetter.apply(vfWithInsatncePreUpdate);
- final String newAttValue = "NewValue";
- attributeOfRI.setValueUniqueUid(newAttValue);
- String body = gson.toJson(attributeOfRI);
- String url = String.format(Urls.UPDATE_ATTRIBUTE_ON_RESOURCE_INSTANCE, config.getCatalogBeHost(),
- config.getCatalogBePort(), ComponentTypeEnum.findParamByType(ComponentTypeEnum.RESOURCE),
- vf.getUniqueId(), vfcInstance.getUniqueId());
- swallowException(() -> BaseRestUtils.sendPost(url, body, UserRoleEnum.DESIGNER.getUserId(),
- BaseRestUtils.acceptHeaderData));
- // Retrieve updated vf and verify attribute was updated
- final Resource vfWithInsatncePostUpdate = swallowException(
- () -> (Resource) AtomicOperationUtils.getComponentObject(vf, UserRoleEnum.DESIGNER));
- ComponentInstanceAttribute updatedAttribute = attributeGetter.apply(vfWithInsatncePostUpdate);
- assertEquals(updatedAttribute.getValueUniqueUid(), newAttValue);
-
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/category/CatalogDataApiTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/category/CatalogDataApiTest.java
deleted file mode 100644
index 0385bbc23f..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/category/CatalogDataApiTest.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.category;
-
-import com.google.gson.Gson;
-import org.json.simple.JSONArray;
-import org.json.simple.JSONObject;
-import org.json.simple.JSONValue;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.*;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.CatalogRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.testng.AssertJUnit;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-
-public class CatalogDataApiTest extends ComponentBaseTest {
-
- protected Config config = Config.instance();
- protected String contentTypeHeaderData = "application/json";
- protected String acceptHeaderDate = "application/json";
-
- @Rule
- public static TestName name = new TestName();
- protected User user;
- protected RestResponse res1;
- protected RestResponse res2;
- protected RestResponse svc1;
- protected ResourceReqDetails resourceDetails1;
- protected ResourceReqDetails resourceDetails2;
- protected ServiceReqDetails svcDetails1;
-
- public CatalogDataApiTest() {
- super(name, CatalogDataApiTest.class.getName());
- }
-
- @BeforeMethod
- public void setUp() throws Exception {
- user = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- resourceDetails1 = buildResourceDetails(user, "TestResource1");
- resourceDetails2 = buildResourceDetails(user, "TestResource2");
- svcDetails1 = buildServiceDetails("TestService1");
-
- res1 = createResource(user, resourceDetails1);
- AssertJUnit.assertEquals("create resorce failed", 201, res1.getErrorCode().intValue());
- resourceDetails1.setUniqueId(ResponseParser.getUniqueIdFromResponse(res1));
- resourceDetails2.setVersion(ResponseParser.getVersionFromResponse(res1));
-
- res2 = createResource(user, resourceDetails2);
- AssertJUnit.assertEquals("create resorce failed", 201, res2.getErrorCode().intValue());
- resourceDetails2.setUniqueId(ResponseParser.getUniqueIdFromResponse(res2));
- resourceDetails2.setVersion(ResponseParser.getVersionFromResponse(res2));
-
- svc1 = createService(user, svcDetails1);
- AssertJUnit.assertEquals("create resorce failed", 201, svc1.getErrorCode().intValue());
- svcDetails1.setUniqueId(ResponseParser.convertServiceResponseToJavaObject(svc1.getResponse()).getUniqueId());
- svcDetails1.setVersion(ResponseParser.convertServiceResponseToJavaObject(svc1.getResponse()).getVersion());
- }
-
- @AfterMethod
- public void tearDown() throws Exception {
- deleteResource(resourceDetails1.getUniqueId(), user.getUserId());
- deleteResource(resourceDetails2.getUniqueId(), user.getUserId());
- deleteService(svcDetails1.getUniqueId(), user);
- }
-
- // Keep 1
- @Test
- public void getCatalogData() throws Exception {
-
- RestResponse checkInResponse = LifecycleRestUtils.changeResourceState(resourceDetails1, user, "0.1",
- LifeCycleStatesEnum.CHECKIN);
- AssertJUnit.assertEquals("check in operation failed", 200, checkInResponse.getErrorCode().intValue());
-
- RestResponse res = CatalogRestUtils.getCatalog(user.getUserId());
- String json = res.getResponse();
- JSONObject jsonResp = (JSONObject) JSONValue.parse(json);
- JSONArray resources = (JSONArray) jsonResp.get("resources");
- JSONArray services = (JSONArray) jsonResp.get("services");
-
- // Verify all the expected resources received.
- AssertJUnit.assertTrue("check resource1 is in response",
- isComponentInArray(resourceDetails1.getUniqueId(), resources));
- AssertJUnit.assertTrue("check resource2 is in response",
- isComponentInArray(resourceDetails2.getUniqueId(), resources));
- AssertJUnit.assertTrue("check service1 is in response",
- isComponentInArray(svcDetails1.getUniqueId(), services));
-
- }
-
- protected void deleteResource(String resourceUniqueId, String httpCspUserId) throws Exception {
- RestResponse deleteResourceResponse = ResourceRestUtils.deleteResource(resourceUniqueId, httpCspUserId);
-
- }
-
- protected RestResponse createResource(User user, ResourceReqDetails resourceDetails) throws Exception {
- deleteResource(resourceDetails.getName(), user.getUserId());
- return ResourceRestUtils.createResource(resourceDetails, user);
- }
-
- protected ResourceReqDetails buildResourceDetails(User user, String resourceName) {
- String description = "description";
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add(resourceName);
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add("tosca.nodes.Root");
- String vendorName = "Oracle";
- String vendorRelease = "1.0";
- String contactId = user.getUserId();
- String icon = "myICON";
-
- ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, null,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
- resourceDetails.addCategoryChain(ResourceCategoryEnum.GENERIC_DATABASE.getCategory(),
- ResourceCategoryEnum.GENERIC_DATABASE.getSubCategory());
- return resourceDetails;
- }
-
- protected boolean isComponentInArray(String id, JSONArray component) {
- for (int i = 0; i < component.size(); i++) {
- JSONObject jobject = (JSONObject) component.get(i);
- if (jobject.get("uniqueId").toString().equals(id.toLowerCase())) {
- return true;
- }
- }
- return false;
- }
-
- protected RestResponse createService(User user, ServiceReqDetails svcDetails) throws Exception {
-
- Config config = Utils.getConfig();
-
- Map<String, String> headersMap = getHeadersMap(user);
-
- Gson gson = new Gson();
- String body = gson.toJson(svcDetails);
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.CREATE_SERVICE, config.getCatalogBeHost(), config.getCatalogBePort());
- RestResponse res = http.httpSendPost(url, body, headersMap);
- // System.out.println("Create service was finished with response:
- // "+res.getErrorCode());
- return res;
- }
-
- protected Map<String, String> getHeadersMap(User user) {
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
- headersMap.put("USER_ID", user.getUserId());
- return headersMap;
- }
-
- protected ServiceReqDetails buildServiceDetails(String serviceName) {
- String description = "description";
- ArrayList<String> serviceTags = new ArrayList<String>();
- serviceTags.add("tag1");
- serviceTags.add(serviceName);
- String category = ServiceCategoriesEnum.MOBILITY.getValue();
- String vendorName = "Oracle";
- String vendorRelease = "0.1";
- String contactId = "al1976";
- String icon = "myIcon";
- String instantiationType = ServiceInstantiationType.A_LA_CARTE.getValue();
-
- ServiceReqDetails svcdetails = new ServiceReqDetails(serviceName, category, serviceTags, description,
- contactId, icon, instantiationType);
- return svcdetails;
- }
-
- public RestResponse deleteService(String serviceId, User user) throws Exception {
- HttpRequest httpRequest = new HttpRequest();
- String url = String.format(Urls.DELETE_SERVICE, config.getCatalogBeHost(), config.getCatalogBePort(),
- serviceId);
-
- Map<String, String> headersMap = getHeadersMap(user);
- RestResponse res = httpRequest.httpSendDelete(url, headersMap);
- // System.out.println("Delete service was finished with response:
- // "+res.getErrorCode());
- return res;
- }
-
- public class NewObject {
- private String _name;
-
- public String getName() {
- return _name;
- }
-
- public void setName(String name) {
- this._name = name;
- }
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/category/CategoriesBaseTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/category/CategoriesBaseTest.java
deleted file mode 100644
index d68f3f5582..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/category/CategoriesBaseTest.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.category;
-
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-
-public abstract class CategoriesBaseTest extends ComponentBaseTest {
-
- public CategoriesBaseTest(TestName testName, String className) {
- super(testName, className);
- }
-
- protected static final String AUDIT_SERVICE_TYPE = "Service";
- protected static final String AUDIT_RESOURCE_TYPE = "Resource";
- protected static final String AUDIT_PRODUCT_TYPE = "Product";
- protected static final String GET_CATEGORY_HIERARCHY = "GetCategoryHierarchy";
- protected static User sdncAdminUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- protected static User sdncAdminUserDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- protected static User sdncDesignerUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- protected static User sdncTesterUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
- protected static User sdncGovernorUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR);
- protected static User sdncOpsUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.OPS);
- protected static User sdncProductManagerUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1);
- protected static User sdncProductStrategistUserDetails = ElementFactory
- .getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST1);
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/category/GroupingTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/category/GroupingTest.java
deleted file mode 100644
index b0e7bd3eff..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/category/GroupingTest.java
+++ /dev/null
@@ -1,1994 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.category;
-
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.be.model.category.CategoryDefinition;
-import org.openecomp.sdc.be.model.category.GroupingDefinition;
-import org.openecomp.sdc.be.model.category.SubCategoryDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedCategoryAudit;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.DbUtils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.CategoryRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
-import org.openecomp.sdc.ci.tests.utils.validation.CategoryValidationUtils;
-import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
-import org.testng.SkipException;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.*;
-import static org.testng.AssertJUnit.assertEquals;
-
-public class GroupingTest extends CategoriesBaseTest {
-
- protected static final String ADD_GROUPING = "AddGrouping";
- protected static final String CATEGORY = "category";
- protected static final String SUB_CATEGORY = "sub-category";
- protected static final String GROUPING = "grouping";
-
- public GroupingTest() {
- super(name, GroupingTest.class.getName());
- }
-
- @Rule
- public static TestName name = new TestName();
-
- private CategoryDefinition productCategoryDefinition;
- private CategoryDefinition productCategoryDefinition2;
-
- private SubCategoryDefinition productSubCategoryDefinition;
- private SubCategoryDefinition productSubCategoryDefinition2;
- private SubCategoryDefinition productSubCategoryDefinition3;
-
- private GroupingDefinition productGroupingDefinition;
- private GroupingDefinition productGroupingDefinition2;
- private GroupingDefinition productGroupingDefinition3;
-
- @BeforeMethod
- public void init() throws Exception {
-
- // Category setup
- productCategoryDefinition = new CategoryDefinition();
- productCategoryDefinition.setName("Category1");
- productCategoryDefinition2 = new CategoryDefinition();
- productCategoryDefinition2.setName("Category2");
-
- // Subcategory setup
- productSubCategoryDefinition = new SubCategoryDefinition();
- productSubCategoryDefinition.setName("SubCategory1");
-
- productSubCategoryDefinition2 = new SubCategoryDefinition();
- productSubCategoryDefinition2.setName("SubCategory2");
-
- productSubCategoryDefinition3 = new SubCategoryDefinition();
- productSubCategoryDefinition3.setName("SubCategory1");
-
- // Group setup
- productGroupingDefinition = new GroupingDefinition();
- productGroupingDefinition.setName("Grouping1");
-
- productGroupingDefinition2 = new GroupingDefinition();
- productGroupingDefinition2.setName("Grouping2");
-
- productGroupingDefinition3 = new GroupingDefinition();
- productGroupingDefinition3.setName("Grouping1");
-
- // Init product category
- RestResponse createCategory = CategoryRestUtils.createCategory(productCategoryDefinition,
- sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create category", STATUS_CODE_CREATED,
- createCategory.getErrorCode().intValue());
- CategoryDefinition category = ResponseParser.parseToObject(createCategory.getResponse(),
- CategoryDefinition.class);
- assertEquals("Check category name after creating category ", productCategoryDefinition.getName(),
- category.getName());
- productCategoryDefinition = category;
-
- // Init product category1
- createCategory = CategoryRestUtils.createCategory(productCategoryDefinition2, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create category", STATUS_CODE_CREATED,
- createCategory.getErrorCode().intValue());
- category = ResponseParser.parseToObject(createCategory.getResponse(), CategoryDefinition.class);
- assertEquals("Check category name after creating category ", productCategoryDefinition2.getName(),
- category.getName());
- productCategoryDefinition2 = category;
-
- // Init product productSubCategoryDefinition to
- // productCategoryDefinition
- RestResponse createSubCategory = CategoryRestUtils.createSubCategory(productSubCategoryDefinition,
- productCategoryDefinition, sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create category", STATUS_CODE_CREATED,
- createSubCategory.getErrorCode().intValue());
- SubCategoryDefinition subCategory = ResponseParser.parseToObject(createSubCategory.getResponse(),
- SubCategoryDefinition.class);
- assertEquals("Check category name after creating category ", productSubCategoryDefinition.getName(),
- subCategory.getName());
- productSubCategoryDefinition = subCategory;
- productCategoryDefinition.addSubCategory(productSubCategoryDefinition);
-
- // Init product productSubCategoryDefinition1 to
- // productCategoryDefinition
- createSubCategory = CategoryRestUtils.createSubCategory(productSubCategoryDefinition2,
- productCategoryDefinition, sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create category", STATUS_CODE_CREATED,
- createSubCategory.getErrorCode().intValue());
- subCategory = ResponseParser.parseToObject(createSubCategory.getResponse(), SubCategoryDefinition.class);
- assertEquals("Check category name after creating category ", productSubCategoryDefinition2.getName(),
- subCategory.getName());
- productSubCategoryDefinition2 = subCategory;
- productCategoryDefinition.addSubCategory(productSubCategoryDefinition2);
-
- // Init product productSubCategoryDefinition3 to
- // productCategoryDefinition2
- createSubCategory = CategoryRestUtils.createSubCategory(productSubCategoryDefinition3,
- productCategoryDefinition2, sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create category", STATUS_CODE_CREATED,
- createSubCategory.getErrorCode().intValue());
- subCategory = ResponseParser.parseToObject(createSubCategory.getResponse(), SubCategoryDefinition.class);
- assertEquals("Check category name after creating category ", productSubCategoryDefinition3.getName(),
- subCategory.getName());
- productSubCategoryDefinition3 = subCategory;
- productCategoryDefinition2.addSubCategory(productSubCategoryDefinition3);
- }
-
- @Test
- public void createProductGroupCategorySuccess() throws Exception {
- createGroupingSuccess(productGroupingDefinition, productSubCategoryDefinition, productCategoryDefinition,
- sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE, AUDIT_PRODUCT_TYPE);
- }
-
- private void createGroupingSuccess(GroupingDefinition groupingDefinition,
- SubCategoryDefinition subCategoryDefinition, CategoryDefinition categoryDefinition,
- User sdncProductStrategistUserDetails, String productComponentType, String auditType) throws Exception {
-
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(groupingDefinition, subCategoryDefinition,
- categoryDefinition, sdncProductStrategistUserDetails, productComponentType);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("grouping1");
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- productComponentType);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest, categoryDefinition.getUniqueId(),
- subCategoryDefinition.getUniqueId(), groupingDefinition);
-
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, categoryDefinition, subCategoryDefinition,
- groupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, auditType);
- }
-
- //// Benny
-
- @Test
- public void createProductGroupByProductStrategist() throws Exception {
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("grouping1");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void createProductGroupAlreadyExistInSameCategorySubCategory() throws Exception {
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("grouping1");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- // Create Same Group already exist on same Category/SubCategory
- DbUtils.deleteFromEsDbByPattern("_all");
- createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition, productSubCategoryDefinition,
- productCategoryDefinition, sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_ALREADY_EXISTS,
- createGroupingRest.getErrorCode().intValue());
- AuditValidationUtils.groupingAuditFailure(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails,
- ActionStatus.COMPONENT_GROUPING_EXISTS_FOR_SUB_CATEGORY, STATUS_CODE_ALREADY_EXISTS, AUDIT_PRODUCT_TYPE,
- AUDIT_PRODUCT_TYPE, productGroupingDefinition.getName(), productSubCategoryDefinition.getName());
- }
-
- @Test
- public void createProductGroupUnderSameCategoryButDifferentSubCategory() throws Exception {
- // Setting : Category-A, Sub-category-B , group : aBcd (display-Name :
- // ABcd, normalized: abcd)  [A, B, ABcd]
- // Action : Category-A, Sub-category-C, group : abcD (display-Name :
- // ABcd, normalized: abcd)  [A, C, ABcd]
- productGroupingDefinition.setName("ABCd");
- productGroupingDefinition2.setName("abcD");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("abcd");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
-
- DbUtils.deleteFromEsDbByPattern("_all");
- createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition2, productSubCategoryDefinition2,
- productCategoryDefinition, sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition2.setName("ABCd");
- productGroupingDefinition2.setNormalizedName("abcd");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition2);
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition,
- productSubCategoryDefinition2, productGroupingDefinition2, sdncProductStrategistUserDetails,
- STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition2.getUniqueId(),
- productGroupingDefinition2);
- }
-
- @Test
- public void createProductGroupUnderSameSubCategoryButDifferentCategory() throws Exception {
- // Setting : Category-A, Sub-category-B , group : aBcd (display-Name :
- // ABcd, normalized: abcd)  [A, B, ABcd]
- // : Category-A, Sub-category-C, group : abcD (display-Name : ABcd,
- // normalized: abcd)  [A, C, ABcd]
- // : Category-K, Sub-category-B, group : abcD (display-Name : ABcd,
- // normalized: abcd)  [K, B, ABcd]
- productGroupingDefinition.setName("ABCd");
- productGroupingDefinition2.setName("abcD");
- productGroupingDefinition3.setName("aBCd");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("abcd");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
-
- DbUtils.deleteFromEsDbByPattern("_all");
- createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition2, productSubCategoryDefinition2,
- productCategoryDefinition, sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition2.setName("ABCd");
- productGroupingDefinition2.setNormalizedName("abcd");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition2);
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition,
- productSubCategoryDefinition2, productGroupingDefinition2, sdncProductStrategistUserDetails,
- STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- DbUtils.deleteFromEsDbByPattern("_all");
- createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition3, productSubCategoryDefinition3,
- productCategoryDefinition2, sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition3.setName("ABCd");
- productGroupingDefinition3.setNormalizedName("abcd");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition3);
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition2,
- productSubCategoryDefinition3, productGroupingDefinition3, sdncProductStrategistUserDetails,
- STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition2.getUniqueId(),
- productGroupingDefinition2);
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition2.getUniqueId(), productSubCategoryDefinition3.getUniqueId(),
- productGroupingDefinition3);
-
- }
-
- @Test
- public void createProductGroupsOnSameCategorySubCategory() throws Exception {
- // Setting : Category-A, Sub-category-B , group : ABcd (display-Name :
- // ABcd, normalized: abcd) [A ,B, ABcd]
- // Action : Category-A, Sub-category-B, group : ZXcv (display-Name :
- // ZXcv, normalized: zxcv) [A, B, ZXcv]
- productGroupingDefinition.setName("ABcd");
- productGroupingDefinition2.setName("ZXcv");
- productGroupingDefinition2.setNormalizedName("zxcv");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("abcd");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
-
- DbUtils.deleteFromEsDbByPattern("_all");
- createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition2, productSubCategoryDefinition,
- productCategoryDefinition, sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition2);
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition2, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition2);
- }
-
- @Test
- public void createProductGroupUnderDifferentCategory() throws Exception {
- // Setting : Category-A, Sub-category-B , group : aBcd (display-Name :
- // ABcd, normalized: abcd) [A ,B, ABcd]
- // Action : Category-K, Sub-category-B, group : abcD (display-Name :
- // ABcd, normalized: abcd) [K, B, ABcd]
- // productGroupingDefinition.setName("ABCd");
- productGroupingDefinition.setName("ABcD");
- productGroupingDefinition2.setName("abcD");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("abcd");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
-
- DbUtils.deleteFromEsDbByPattern("_all");
- createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition2, productSubCategoryDefinition3,
- productCategoryDefinition2, sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition2.setNormalizedName("abcd");
- productGroupingDefinition2.setName("ABcD");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition2);
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition2,
- productSubCategoryDefinition3, productGroupingDefinition2, sdncProductStrategistUserDetails,
- STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition2.getUniqueId(), productSubCategoryDefinition3.getUniqueId(),
- productGroupingDefinition2);
- }
-
- ///////////
- @Test
- public void createProductGroupByNonProductStrategist() throws Exception {
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncAdminUserDetails, PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_RESTRICTED_OPERATION,
- createGroupingRest.getErrorCode().intValue());
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingNotExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- productCategoryDefinition.setName(productCategoryDefinition.getUniqueId());
- productSubCategoryDefinition.setName(productSubCategoryDefinition.getUniqueId());
- AuditValidationUtils.groupingAuditFailure(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncAdminUserDetails, ActionStatus.RESTRICTED_OPERATION,
- STATUS_CODE_RESTRICTED_OPERATION, AUDIT_PRODUCT_TYPE);
- }
-
- // @Ignore("DE176245")
- @Test
- public void createProductGroupForNonExistingComponentType() throws Exception {
- String nonSupportedComponentType = "NonExistingComponentType"; // instead
- // resource/product
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- nonSupportedComponentType);
- assertEquals("Check response code after create Sub category", STATUS_CODE_INVALID_CONTENT,
- createGroupingRest.getErrorCode().intValue());
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingNotExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- productCategoryDefinition.setName(productCategoryDefinition.getUniqueId());
- productSubCategoryDefinition.setName(productSubCategoryDefinition.getUniqueId());
- AuditValidationUtils.groupingAuditFailure(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, ActionStatus.INVALID_CONTENT,
- STATUS_CODE_INVALID_CONTENT, nonSupportedComponentType);
- }
-
- // @Ignore("DE176245")
- @Test
- public void createResourceGroup() throws Exception {
- // Resource doesn't have group
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_INVALID_CONTENT,
- createGroupingRest.getErrorCode().intValue());
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingNotExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- productCategoryDefinition.setName(productCategoryDefinition.getUniqueId());
- productSubCategoryDefinition.setName(productSubCategoryDefinition.getUniqueId());
- AuditValidationUtils.groupingAuditFailure(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, ActionStatus.INVALID_CONTENT,
- STATUS_CODE_INVALID_CONTENT, AUDIT_RESOURCE_TYPE);
- }
-
- // @Ignore("DE176245")
- @Test
- public void createServiceGroup() throws Exception {
- // Service doesn't have group
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- SERVICE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_INVALID_CONTENT,
- createGroupingRest.getErrorCode().intValue());
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingNotExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- productCategoryDefinition.setName(productCategoryDefinition.getUniqueId());
- productSubCategoryDefinition.setName(productSubCategoryDefinition.getUniqueId());
- AuditValidationUtils.groupingAuditFailure(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, ActionStatus.INVALID_CONTENT,
- STATUS_CODE_INVALID_CONTENT, AUDIT_SERVICE_TYPE);
- }
-
- @Test
- public void createProductGroupForNonExistingCategory() throws Exception {
-
- CategoryDefinition productCategoryDefinition100 = new CategoryDefinition();
- productCategoryDefinition100.setName("category.nonexistingCategory");
- productCategoryDefinition100.setUniqueId("category.nonexistingCategory");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition100, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_NOT_FOUND,
- createGroupingRest.getErrorCode().intValue());
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingNotExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- productSubCategoryDefinition.setName(productSubCategoryDefinition.getUniqueId());
- AuditValidationUtils.groupingAuditFailure(ADD_GROUPING, productCategoryDefinition100,
- productSubCategoryDefinition, productGroupingDefinition, sdncProductStrategistUserDetails,
- ActionStatus.COMPONENT_CATEGORY_NOT_FOUND, STATUS_CODE_NOT_FOUND, AUDIT_PRODUCT_TYPE,
- PRODUCT_COMPONENT_TYPE, CATEGORY, "");
- }
-
- @Test
- public void createProductGroupForNonExistingSunCategory() throws Exception {
- throw new SkipException(
- "Skipping - failed in audit validation expected \"products\" actual result was \"product\" ");
- // SubCategoryDefinition productSubCategoryDefinition100 = new
- // SubCategoryDefinition();
- // productSubCategoryDefinition100.setUniqueId("category.nonexistingSubCategory");
- // RestResponse createGroupingRest =
- // CategoryRestUtils.createGrouping(productGroupingDefinition,
- // productSubCategoryDefinition100, productCategoryDefinition,
- // sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
- // assertEquals("Check response code after create Sub category",
- // STATUS_CODE_NOT_FOUND, createGroupingRest.getErrorCode().intValue());
- // RestResponse getAllCategoriesRest =
- // CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- // PRODUCT_COMPONENT_TYPE);
- // assertEquals("Check response code after get all categories ",
- // STATUS_CODE_SUCCESS, getAllCategoriesRest.getErrorCode().intValue());
- // CategoryValidationUtils.verifyGroupingNotExistInGetResponse(getAllCategoriesRest,
- // productCategoryDefinition.getUniqueId(),
- // productSubCategoryDefinition.getUniqueId(),
- // productGroupingDefinition);
- // //Audit validation
- // productSubCategoryDefinition100.setName(productSubCategoryDefinition100.getUniqueId());
- // AuditValidationUtils.groupingAuditFailure(ADD_GROUPING ,
- // productCategoryDefinition, productSubCategoryDefinition100,
- // productGroupingDefinition, sdncProductStrategistUserDetails,
- // ActionStatus.COMPONENT_CATEGORY_NOT_FOUND,
- // STATUS_CODE_NOT_FOUND,AUDIT_PRODUCT_TYPE, PRODUCT_COMPONENT_TYPE,
- // SUB_CATEGORY, "");
- }
-
- @Test
- public void ProductGroupAllowedcharacters_01() throws Exception {
- productGroupingDefinition.setName("1234AbcdE-");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("1234abcde-");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void ProductGroupAllowedcharacters_02() throws Exception {
- productGroupingDefinition.setName("1234AbcdE+");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("1234abcde+");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void ProductGroupAllowedcharacters_03() throws Exception {
- productGroupingDefinition.setName("1234AbcdE&");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("1234abcde&");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void ProductGroupAllowedcharacters_04() throws Exception {
- productGroupingDefinition.setName("1234AbcdE-");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("1234abcde-");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void ProductGroupAllowedcharacters_05() throws Exception {
- productGroupingDefinition.setName("1234AbcdE+");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("1234abcde+");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void ProductGroupAllowedcharacters_06() throws Exception {
- productGroupingDefinition.setName("1234AbcdE.");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("1234abcde.");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void ProductGroupAllowedcharacters_07() throws Exception {
- productGroupingDefinition.setName("1234AbcdE'");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("1234abcde'");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void ProductGroupAllowedcharacters_08() throws Exception {
- productGroupingDefinition.setName("1234AbcdE=");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("1234abcde=");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void ProductGroupAllowedcharacters_09() throws Exception {
- productGroupingDefinition.setName("1234AbcdE:");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("1234abcde:");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void ProductGroupAllowedcharacters_10() throws Exception {
- productGroupingDefinition.setName("1234AbcdE@");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("1234abcde@");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void ProductGroupAllowedcharacters_11() throws Exception {
- productGroupingDefinition.setName("1234AbcdE_");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("1234abcde_");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void ProductGroupAllowedcharacters_12() throws Exception {
- productGroupingDefinition.setName("1234AbcdE#");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("1234abcde#");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void ProductGroupAllowedcharacters_13() throws Exception {
- productGroupingDefinition.setName("1234AbcdE d");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setName("1234AbcdE D");
- productGroupingDefinition.setNormalizedName("1234abcde d");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidation_RemoveSpaceFromBeginning() throws Exception {
- productGroupingDefinition.setName(" Category01");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("category01");
- productGroupingDefinition.setName("Category01");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidation_RemoveSpaceFromEnd() throws Exception {
- productGroupingDefinition.setName("Category01 ");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("category01");
- productGroupingDefinition.setName("Category01");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidation_RemoveExtraSpace() throws Exception {
- productGroupingDefinition.setName("Category 02");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("category 02");
- productGroupingDefinition.setName("Category 02");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidation_RemoveExtraAmpersand() throws Exception {
- productGroupingDefinition.setName("Category&& &02");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("category& &02");
- productGroupingDefinition.setName("Category& &02");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidation_RemoveExtraDash() throws Exception {
- productGroupingDefinition.setName("CategorY-- --02");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("category- -02");
- productGroupingDefinition.setName("CategorY- -02");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidation_RemoveExtraPlus() throws Exception {
- productGroupingDefinition.setName("CateGory++++ +02");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setName("CateGory+ +02");
- productGroupingDefinition.setNormalizedName("category+ +02");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidation_RemoveExtraPeriod() throws Exception {
- productGroupingDefinition.setName("Category.... .02");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setName("Category. .02");
- productGroupingDefinition.setNormalizedName("category. .02");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidation_RemoveExtraApostrophe() throws Exception {
- productGroupingDefinition.setName("CaTegory''' '02");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setName("CaTegory' '02");
- productGroupingDefinition.setNormalizedName("category' '02");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidation_RemoveExtraHashtag() throws Exception {
- productGroupingDefinition.setName("Category### #02");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setName("Category# #02");
- productGroupingDefinition.setNormalizedName("category# #02");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidation_RemoveExtrEequal() throws Exception {
- productGroupingDefinition.setName("Category=== =02");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setName("Category= =02");
- productGroupingDefinition.setNormalizedName("category= =02");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidation_RemoveExtrColon() throws Exception {
- productGroupingDefinition.setName("Category::: :02");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setName("Category: :02");
- productGroupingDefinition.setNormalizedName("category: :02");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidation_RemoveExtrAt() throws Exception {
- productGroupingDefinition.setName("Category@@@ @a2");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setName("Category@ @a2");
- productGroupingDefinition.setNormalizedName("category@ @a2");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidation_RemoveExtraUnderscore() throws Exception {
- productGroupingDefinition.setName("Category___ _22");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setName("Category_ _22");
- productGroupingDefinition.setNormalizedName("category_ _22");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidation_FirstWordStartWithNumber() throws Exception {
- productGroupingDefinition.setName("1Category one");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setName("1Category One");
- productGroupingDefinition.setNormalizedName("1category one");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidation_FirstWordStartWithNonAlphaNumeric() throws Exception { // The
- // first
- // word
- // must
- // start
- // with
- // an
- // alpha-numeric
- // character
- // [a-Z
- // A..Z,
- // 0..9]
- char invalidChars[] = { '&', '-', '+', '.', '\'', '#', '=', ':', '@', '_' };
- RestResponse createGroupingRest;
- RestResponse getAllCategoriesRest;
- for (int i = 0; i < invalidChars.length; i++) {
- DbUtils.deleteFromEsDbByPattern("_all");
- productGroupingDefinition.setName(invalidChars[i] + "AbcD123");
- productGroupingDefinition.setNormalizedName((invalidChars[i] + "AbcD123").toLowerCase());
- createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create Category", STATUS_CODE_INVALID_CONTENT,
- createGroupingRest.getErrorCode().intValue());
-
- getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails, PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingNotExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- }
- }
-
- @Test
- public void groupNameValidation_ReplaceAndWithAmpersand_01() throws Exception {
- productGroupingDefinition.setName("At and T");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setName("At & T");
- productGroupingDefinition.setNormalizedName("at & t");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidation_ReplaceAndWithAmpersand_02() throws Exception {
- productGroupingDefinition.setName("At and t");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setName("At & T");
- productGroupingDefinition.setNormalizedName("at & t");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidation_ReplaceAndWithAmpersand_03() throws Exception {
- productGroupingDefinition.setName("Atand T");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("atand t");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidation_ReplaceAndWithAmpersand_04() throws Exception {
- productGroupingDefinition.setName("At andT");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("at andt");
- productGroupingDefinition.setName("At AndT");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidation_ReplaceAndWithAmpersand_05() throws Exception {
- productGroupingDefinition.setName(" and AttT");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("and attt");
- productGroupingDefinition.setName("And AttT");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidation_ReplaceAndWithAmpersand_06() throws Exception {
- productGroupingDefinition.setName("AttT and ");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("attt and");
- productGroupingDefinition.setName("AttT And");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidation_ReplaceAndWithAmpersand_07() throws Exception {
- productGroupingDefinition.setName(" and a");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("and a");
- productGroupingDefinition.setName("And a");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidationMaxLength() throws Exception {
- productGroupingDefinition.setName("AsdfghjQ234567890@#.&:+-_");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("asdfghjq234567890@#.&:+-_");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidationMaxLengthAfterNormalization() throws Exception {
- productGroupingDefinition.setName(" A jQ234 @@@___ +++ At and T and and ");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("a jq234 @_ + at & t & and");
- productGroupingDefinition.setName("A JQ234 @_ + At & T & And");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidationExceedMaxLengthAfterNormalization() throws Exception {
- productGroupingDefinition.setName(" AbdfghBCVa jQ234 @@___ +++ At and T ");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_INVALID_CONTENT,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("abdfghbcva jq234 @_ + at&t");
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingNotExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditFailure(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails,
- ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_LENGTH, STATUS_CODE_INVALID_CONTENT, AUDIT_PRODUCT_TYPE,
- AUDIT_PRODUCT_TYPE, GROUPING);
- }
-
- @Test
- public void groupNameValidationMinLengthAfterNormalization() throws Exception {
- productGroupingDefinition.setName(" At&&&&&&&&&&&&t ");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("at&t");
- productGroupingDefinition.setName("At&t");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidationLessThanMinLengthAfterNormalization() throws Exception {
- productGroupingDefinition.setName(" A&&&&&&&&&&&&T ");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_INVALID_CONTENT,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("a&t");
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingNotExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditFailure(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails,
- ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_LENGTH, STATUS_CODE_INVALID_CONTENT, AUDIT_PRODUCT_TYPE,
- AUDIT_PRODUCT_TYPE, GROUPING);
- }
-
- @Test
- public void groupNameValidationIsEmpty() throws Exception {
- productGroupingDefinition.setName("");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_INVALID_CONTENT,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("");
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingNotExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditFailure(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails,
- ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_FORMAT, STATUS_CODE_INVALID_CONTENT, AUDIT_PRODUCT_TYPE,
- AUDIT_PRODUCT_TYPE, GROUPING);
- }
-
- @Test
- public void groupNameValidationInvalidCharacters() throws Exception {
- RestResponse createGroupingRest;
- RestResponse getAllCategoriesRest;
- char invalidChars[] = { '~', '!', '$', '%', '^', '*', '(', ')', '"', '{', '}', '[', ']', '?', '>', '<', '/',
- '|', '\\', ',' };
- for (int i = 0; i < invalidChars.length; i++) {
- DbUtils.deleteFromEsDbByPattern("_all");
- productGroupingDefinition.setName("AbcD123" + invalidChars[i]);
- createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_INVALID_CONTENT,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("");
- getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails, PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingNotExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditFailure(ADD_GROUPING, productCategoryDefinition,
- productSubCategoryDefinition, productGroupingDefinition, sdncProductStrategistUserDetails,
- ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_FORMAT, STATUS_CODE_INVALID_CONTENT, AUDIT_PRODUCT_TYPE,
- AUDIT_PRODUCT_TYPE, GROUPING);
- }
- }
-
- @Test
- public void groupNameValidationConjunctions_01() throws Exception {
- // Normalize the grouping name conjunctions ('of', 'to', 'for', 'as',
- // 'a', 'an' , 'the') are lower case.
- productGroupingDefinition.setName(" bank OF america ");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setNormalizedName("bank of america");
- productGroupingDefinition.setName("Bank of America");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidationConjunctions_02() throws Exception {
- // Normalize the grouping name conjunctions ('of', 'to', 'for', 'as',
- // 'a', 'an' , 'the') are lower case.
- productGroupingDefinition.setName("THE america bank ");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setName("THE America Bank");
- productGroupingDefinition.setNormalizedName("the america bank");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidationConjunctions_03() throws Exception {
- // Normalize the grouping name conjunctions ('of', 'to', 'for', 'as',
- // 'a', 'an' , 'the') are lower case.
- productGroupingDefinition.setName(" A bank OF america ");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setName("A Bank of America");
- productGroupingDefinition.setNormalizedName("a bank of america");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidationConjunctions_04() throws Exception {
- // Normalize the grouping name conjunctions ('of', 'to', 'for', 'as',
- // 'a', 'an' , 'the') are lower case.
- productGroupingDefinition.setName(" bank america is A big ban ");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setName("Bank America Is a Big Ban");
- productGroupingDefinition.setNormalizedName("bank america is a big ban");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidationConjunctions_05() throws Exception {
- // Normalize the grouping name conjunctions ('of', 'to', 'for', 'as',
- // 'a', 'an' , 'the') are lower case.
- productGroupingDefinition.setName(" aN apple comPany inC ");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setName("AN Apple ComPany InC");
- productGroupingDefinition.setNormalizedName("an apple company inc");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidationConjunctions_06() throws Exception {
- // Normalize the grouping name conjunctions ('of', 'to', 'for', 'as',
- // 'a', 'an' , 'the') are lower case.
- productGroupingDefinition.setName(" eat AN apple ANAN");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setName("Eat an Apple ANAN");
- productGroupingDefinition.setNormalizedName("eat an apple anan");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidationConjunctions_07() throws Exception {
- // Normalize the grouping name conjunctions ('of', 'to', 'for', 'as',
- // 'a', 'an' , 'the') are lower case.
- productGroupingDefinition.setName(" united states OF americA ");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setName("United States of AmericA");
- productGroupingDefinition.setNormalizedName("united states of america");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidationConjunctions_08() throws Exception {
- // Normalize the grouping name conjunctions ('of', 'to', 'for', 'as',
- // 'a', 'an' , 'the') are lower case.
- productGroupingDefinition.setName(" oF united states OF amer ");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setName("OF United States of Amer");
- productGroupingDefinition.setNormalizedName("of united states of amer");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidationConjunctions_09() throws Exception {
- // Normalize the grouping name conjunctions ('of', 'to', 'for', 'as',
- // 'a', 'an' , 'the') are lower case.
- productGroupingDefinition.setName(" to Apple TO at&T TOO ");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setName("To Apple to At&T TOO");
- productGroupingDefinition.setNormalizedName("to apple to at&t too");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidationConjunctions_10() throws Exception {
- // Normalize the grouping name conjunctions ('of', 'to', 'for', 'as',
- // 'a', 'an' , 'the') are lower case.
- productGroupingDefinition.setName(" eat apple AS you liiikeas ");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setName("Eat Apple as You Liiikeas");
- productGroupingDefinition.setNormalizedName("eat apple as you liiikeas");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidationConjunctions_11() throws Exception {
- // Normalize the grouping name conjunctions ('of', 'to', 'for', 'as',
- // 'a', 'an' , 'the') are lower case.
- productGroupingDefinition.setName(" as you may want ");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setName("As You May Want");
- productGroupingDefinition.setNormalizedName("as you may want");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidationConjunctions_12() throws Exception {
- // Normalize the grouping name conjunctions ('of', 'to', 'for', 'as',
- // 'a', 'an' , 'the') are lower case.
- productGroupingDefinition.setName(" the bank OF america ");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setName("The Bank of America");
- productGroupingDefinition.setNormalizedName("the bank of america");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidationConjunctions_13() throws Exception {
- // Normalize the grouping name conjunctions ('of', 'to', 'for', 'as',
- // 'a', 'an' , 'the') are lower case.
- productGroupingDefinition.setName(" To tel-toto ");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setName("To Tel-toto");
- productGroupingDefinition.setNormalizedName("to tel-toto");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void groupNameValidationConjunctions_14() throws Exception {
- // Normalize the grouping name conjunctions ('of', 'to', 'for', 'as',
- // 'a', 'an' , 'the') are lower case.
- productGroupingDefinition.setName(" tel-aviv To la ");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create product group", STATUS_CODE_CREATED,
- createGroupingRest.getErrorCode().intValue());
- productGroupingDefinition.setName("Tel-aviv to La");
- productGroupingDefinition.setNormalizedName("tel-aviv to la");
- CategoryValidationUtils.validateCreateGroupResponse(createGroupingRest, productGroupingDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- AuditValidationUtils.groupingAuditSuccess(ADD_GROUPING, productCategoryDefinition, productSubCategoryDefinition,
- productGroupingDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void createProductGroupHttpCspUserIdIsEmpty() throws Exception {
- User sdncPS = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST1);
- sdncPS.setUserId("");
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncPS, PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create Consumer", STATUS_CODE_MISSING_INFORMATION,
- createGroupingRest.getErrorCode().intValue());
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingNotExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_INFORMATION.name());
- ExpectedCategoryAudit expectedCatrgoryAuditJavaObject = new ExpectedCategoryAudit();
- expectedCatrgoryAuditJavaObject.setAction(ADD_GROUPING);
- expectedCatrgoryAuditJavaObject.setModifier("");
- expectedCatrgoryAuditJavaObject.setCategoryName(productCategoryDefinition.getUniqueId());
- expectedCatrgoryAuditJavaObject.setSubCategoryName(productSubCategoryDefinition.getUniqueId());
- expectedCatrgoryAuditJavaObject.setGroupingName(productGroupingDefinition.getName());
- expectedCatrgoryAuditJavaObject.setResourceType(AUDIT_PRODUCT_TYPE);
- expectedCatrgoryAuditJavaObject.setStatus(String.valueOf(STATUS_CODE_MISSING_INFORMATION));
- expectedCatrgoryAuditJavaObject.setDesc(errorInfo.getAuditDesc());
- AuditValidationUtils.validateCategoryAudit(expectedCatrgoryAuditJavaObject, ADD_GROUPING);
- }
-
- @Test
- public void createProductGroupHttpCspUserIdIsNull() throws Exception {
- User sdncPS = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST1);
- sdncPS.setUserId(null);
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(productGroupingDefinition,
- productSubCategoryDefinition, productCategoryDefinition, sdncPS, PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create Consumer", STATUS_CODE_MISSING_INFORMATION,
- createGroupingRest.getErrorCode().intValue());
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifyGroupingNotExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition.getUniqueId(),
- productGroupingDefinition);
- // Audit validation
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_INFORMATION.name());
- ExpectedCategoryAudit expectedCatrgoryAuditJavaObject = new ExpectedCategoryAudit();
- expectedCatrgoryAuditJavaObject.setAction(ADD_GROUPING);
- expectedCatrgoryAuditJavaObject.setModifier("");
- expectedCatrgoryAuditJavaObject.setCategoryName(productCategoryDefinition.getUniqueId());
- expectedCatrgoryAuditJavaObject.setSubCategoryName(productSubCategoryDefinition.getUniqueId());
- expectedCatrgoryAuditJavaObject.setGroupingName(productGroupingDefinition.getName());
- expectedCatrgoryAuditJavaObject.setResourceType(AUDIT_PRODUCT_TYPE);
- expectedCatrgoryAuditJavaObject.setStatus(String.valueOf(STATUS_CODE_MISSING_INFORMATION));
- expectedCatrgoryAuditJavaObject.setDesc(errorInfo.getAuditDesc());
- AuditValidationUtils.validateCategoryAudit(expectedCatrgoryAuditJavaObject, ADD_GROUPING);
- }
-
- ////////////////////////////////////////////////
- ///////////////////////////////////////////////
- @Test
- public void getProductCategoryHierarchySuccessFlow() throws Exception {
- throw new SkipException(
- "Skipping - failed in audit validation expected \"products\" actual result was \"product\" ");
- // int numOfGrouping = 3;
- // List<GroupingDefinition> groupingList = new ArrayList<>();
- // RestResponse restResponse;
- // GroupingDefinition grouping;
- // String groupingName = productGroupingDefinition.getName();
- // for (int i = 0; i < numOfGrouping; i++) {
- // productGroupingDefinition.setName(groupingName+i);
- // restResponse =
- // CategoryRestUtils.createGrouping(productGroupingDefinition,
- // productSubCategoryDefinition, productCategoryDefinition,
- // sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
- // grouping = ResponseParser.parseToObject(restResponse.getResponse(),
- // GroupingDefinition.class);
- // groupingList.add(grouping);
- // }
- // RestResponse getAllCategoriesRest =
- // CategoryRestUtils.getAllCategories(sdncProductStrategistUserDetails,
- // PRODUCT_COMPONENT_TYPE);
- // assertEquals("Check response code after get all categories ",
- // STATUS_CODE_SUCCESS, getAllCategoriesRest.getErrorCode().intValue());
- // AuditValidationUtils.GetCategoryHierarchyAuditSuccess(GET_CATEGORY_HIERARCHY,
- // AUDIT_PRODUCT_TYPE, sdncProductStrategistUserDetails,
- // STATUS_CODE_SUCCESS);
- //
- // for (GroupingDefinition group : groupingList) {
- // CategoryValidationUtils.verifyGroupingExistInGetResponse(getAllCategoriesRest,
- // productCategoryDefinition.getUniqueId(),
- // productSubCategoryDefinition.getUniqueId(), group);
- // }
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/category/SubCategoriesTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/category/SubCategoriesTest.java
deleted file mode 100644
index eada2b43b1..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/category/SubCategoriesTest.java
+++ /dev/null
@@ -1,1898 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.category;
-
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.be.model.category.CategoryDefinition;
-import org.openecomp.sdc.be.model.category.SubCategoryDefinition;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedCategoryAudit;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.DbUtils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.CategoryRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
-import org.openecomp.sdc.ci.tests.utils.validation.CategoryValidationUtils;
-import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.*;
-import static org.testng.AssertJUnit.assertEquals;
-
-public class SubCategoriesTest extends ComponentBaseTest {
-
- protected static final String ADD_SUB_CATEGORY = "AddSubCategory";
- protected static final String CATEGORY = "category";
- protected static final String SUB_CATEGORY = "sub-category";
-
- protected static final String AUDIT_SERVICE_TYPE = "Service";
- protected static final String AUDIT_RESOURCE_TYPE = "Resource";
- protected static final String AUDIT_PRODUCT_TYPE = "Product";
- protected static final String GET_CATEGORY_HIERARCHY = "GetCategoryHierarchy";
- protected static User sdncAdminUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- protected static User sdncAdminUserDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- protected static User sdncDesignerUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- protected static User sdncTesterUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
- protected static User sdncGovernorUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR);
- protected static User sdncOpsUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.OPS);
- protected static User sdncProductManagerUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1);
- protected static User sdncProductStrategistUserDetails = ElementFactory
- .getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST1);
-
- public SubCategoriesTest() {
- super(name, SubCategoriesTest.class.getName());
- }
-
- @Rule
- public static TestName name = new TestName();
-
- private CategoryDefinition resourceCategoryDefinition;
- private CategoryDefinition resourceCategoryDefinition1;
- private CategoryDefinition serviceCategoryDefinition;
- private CategoryDefinition productCategoryDefinition;
- private CategoryDefinition productCategoryDefinition1;
- private CategoryDefinition resourceCategoryDefinition100;
- private CategoryDefinition productCategoryDefinition200;
-
- private SubCategoryDefinition resourceSubCategoryDefinition;
- private SubCategoryDefinition resourceSubCategoryDefinition1;
- private SubCategoryDefinition serviceSubCategoryDefinition;
- private SubCategoryDefinition productSubCategoryDefinition;
- private SubCategoryDefinition productSubCategoryDefinition1;
-
- @BeforeMethod
- public void init() throws Exception {
-
- // Category setup
- resourceCategoryDefinition = new CategoryDefinition();
- resourceCategoryDefinition1 = new CategoryDefinition();
- serviceCategoryDefinition = new CategoryDefinition();
- productCategoryDefinition = new CategoryDefinition();
- productCategoryDefinition1 = new CategoryDefinition();
- resourceCategoryDefinition100 = new CategoryDefinition(); // for
- // negative
- // tests
- productCategoryDefinition200 = new CategoryDefinition(); // for negative
- // tests
-
- resourceCategoryDefinition.setName("Category1");
- resourceCategoryDefinition1.setName("Category2");
- serviceCategoryDefinition.setName("Category1");
- productCategoryDefinition.setName("Category2");
- productCategoryDefinition1.setName("Category3");
- resourceCategoryDefinition100.setName("Category100");
- productCategoryDefinition200.setName("Category100");
-
- // Subcategory setup
- resourceSubCategoryDefinition = new SubCategoryDefinition();
- resourceSubCategoryDefinition1 = new SubCategoryDefinition();
- serviceSubCategoryDefinition = new SubCategoryDefinition();
- productSubCategoryDefinition = new SubCategoryDefinition();
- productSubCategoryDefinition1 = new SubCategoryDefinition();
-
- resourceSubCategoryDefinition.setName("Resource-subcat");
- // Service sub - for negative testing since it's not allowed
- serviceSubCategoryDefinition.setName("Service-subcat");
- productSubCategoryDefinition.setName("Product-subcat");
-
- // Init resource category
- RestResponse createCategory = CategoryRestUtils.createCategory(resourceCategoryDefinition, sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create category", STATUS_CODE_CREATED,
- createCategory.getErrorCode().intValue());
- CategoryDefinition category = ResponseParser.parseToObject(createCategory.getResponse(),
- CategoryDefinition.class);
- assertEquals("Check category name after creating category ", resourceCategoryDefinition.getName(),
- category.getName());
- resourceCategoryDefinition = category;
-
- // Init resource category1
- createCategory = CategoryRestUtils.createCategory(resourceCategoryDefinition1, sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create category", STATUS_CODE_CREATED,
- createCategory.getErrorCode().intValue());
- category = ResponseParser.parseToObject(createCategory.getResponse(), CategoryDefinition.class);
- assertEquals("Check category name after creating category ", resourceCategoryDefinition1.getName(),
- category.getName());
- resourceCategoryDefinition1 = category;
-
- // Init service category
- createCategory = CategoryRestUtils.createCategory(serviceCategoryDefinition, sdncAdminUserDetails,
- SERVICE_COMPONENT_TYPE);
- assertEquals("Check response code after create category", STATUS_CODE_CREATED,
- createCategory.getErrorCode().intValue());
- category = ResponseParser.parseToObject(createCategory.getResponse(), CategoryDefinition.class);
- assertEquals("Check category name after creating category ", serviceCategoryDefinition.getName(),
- category.getName());
- serviceCategoryDefinition = category;
-
- // Init product category
- createCategory = CategoryRestUtils.createCategory(productCategoryDefinition, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create category", STATUS_CODE_CREATED,
- createCategory.getErrorCode().intValue());
- category = ResponseParser.parseToObject(createCategory.getResponse(), CategoryDefinition.class);
- assertEquals("Check category name after creating category ", productCategoryDefinition.getName(),
- category.getName());
- productCategoryDefinition = category;
-
- // Init product category1
- createCategory = CategoryRestUtils.createCategory(productCategoryDefinition1, sdncProductStrategistUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create category", STATUS_CODE_CREATED,
- createCategory.getErrorCode().intValue());
- category = ResponseParser.parseToObject(createCategory.getResponse(), CategoryDefinition.class);
- assertEquals("Check category name after creating category ", productCategoryDefinition1.getName(),
- category.getName());
- productCategoryDefinition1 = category;
-
- }
-
- @Test
- public void createResourceSubCategorySuccess() throws Exception {
- createSubCategorySuccess(resourceCategoryDefinition, resourceSubCategoryDefinition, sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void createProductSubCategorySuccess() throws Exception {
- createSubCategorySuccess(productCategoryDefinition, productSubCategoryDefinition,
- sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void createProductSubCategoryTwoCategoriesCaseInsensitive() throws Exception {
- String componentType = PRODUCT_COMPONENT_TYPE;
- String auditType = AUDIT_PRODUCT_TYPE;
- User user = sdncProductStrategistUserDetails;
- // Create product sub Category2-->Product-subcat
- createSubCategorySuccess(productCategoryDefinition, productSubCategoryDefinition, user, componentType,
- auditType);
- DbUtils.deleteFromEsDbByPattern("_all");
-
- // Create product sub Category3-->PRoDUCT-SUBcat
- // Should be created Category3-->Product-subcat
- productSubCategoryDefinition1.setName("PRoDUCT-SUBcat");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(productSubCategoryDefinition1,
- productCategoryDefinition1, user, componentType);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(user, componentType);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- productSubCategoryDefinition1.setName(productSubCategoryDefinition.getName());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition1.getUniqueId(), productSubCategoryDefinition1);
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, productCategoryDefinition1,
- productSubCategoryDefinition1, user, STATUS_CODE_CREATED, auditType);
- }
-
- // Benny
- @Test
- public void createResourceSubCategoryAlreadyExistInDifferentResourceCategory() throws Exception {
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- DbUtils.deleteFromEsDbByPattern("_all");
- resourceSubCategoryDefinition1.setName("ResourcE-subCat");
- createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition1,
- resourceCategoryDefinition1, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- resourceSubCategoryDefinition1.setName(resourceSubCategoryDefinition.getName());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition1.getUniqueId(), resourceSubCategoryDefinition1); // also
- // set
- // catalog
- // uniqeId
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition1,
- resourceSubCategoryDefinition1, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void createProductSubCategoryAlreadyExistInDifferentProductCategory() throws Exception {
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(productSubCategoryDefinition,
- productCategoryDefinition, sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, productCategoryDefinition,
- productSubCategoryDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED,
- AUDIT_PRODUCT_TYPE);
- DbUtils.deleteFromEsDbByPattern("_all");
- productSubCategoryDefinition1.setName("PRoDUCT-SUBcat");
- createSubCategoryRest = CategoryRestUtils.createSubCategory(productSubCategoryDefinition1,
- productCategoryDefinition1, sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails, PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- productSubCategoryDefinition1.setName(productSubCategoryDefinition.getName());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition1.getUniqueId(), productSubCategoryDefinition1); // also
- // set
- // catalog
- // uniqeId
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, productCategoryDefinition1,
- productSubCategoryDefinition1, sdncProductStrategistUserDetails, STATUS_CODE_CREATED,
- AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void createResourceSubCategoryAlreadyExistInCategory() throws Exception {
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- DbUtils.deleteFromEsDbByPattern("_all");
- resourceSubCategoryDefinition1.setName("ResourcE-subCat");
- createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition1,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_ALREADY_EXISTS,
- createSubCategoryRest.getErrorCode().intValue());
- getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- AuditValidationUtils.subCategoryAuditFailure(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition1, sdncAdminUserDetails,
- ActionStatus.COMPONENT_SUB_CATEGORY_EXISTS_FOR_CATEGORY, STATUS_CODE_ALREADY_EXISTS,
- AUDIT_RESOURCE_TYPE, AUDIT_RESOURCE_TYPE, resourceSubCategoryDefinition1.getName(),
- resourceCategoryDefinition.getName());
- }
-
- @Test
- public void createProductSubCategoryAlreadyExistInCategory() throws Exception {
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(productSubCategoryDefinition,
- productCategoryDefinition, sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, productCategoryDefinition,
- productSubCategoryDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED,
- AUDIT_PRODUCT_TYPE);
- DbUtils.deleteFromEsDbByPattern("_all");
- productSubCategoryDefinition1.setName("ProducT-subCat");
- createSubCategoryRest = CategoryRestUtils.createSubCategory(productSubCategoryDefinition1,
- productCategoryDefinition, sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_ALREADY_EXISTS,
- createSubCategoryRest.getErrorCode().intValue());
- getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails, PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition);
- AuditValidationUtils.subCategoryAuditFailure(ADD_SUB_CATEGORY, productCategoryDefinition,
- productSubCategoryDefinition1, sdncProductStrategistUserDetails,
- ActionStatus.COMPONENT_SUB_CATEGORY_EXISTS_FOR_CATEGORY, STATUS_CODE_ALREADY_EXISTS, AUDIT_PRODUCT_TYPE,
- AUDIT_PRODUCT_TYPE, productSubCategoryDefinition1.getName(), productCategoryDefinition.getName());
- }
-
- @Test
- public void addSameNormalizedSubCategoryNameForRecourceAndProductCategory() throws Exception {
- // add sub-categoty name "SubCaT" to resource category
- // add sub-categoty name "SUbcAt" to product category
- resourceSubCategoryDefinition.setName("SubCaT"); // normalized 'subcat'
- productSubCategoryDefinition.setName("SUbcAt"); // normalized 'subcat'
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
-
- DbUtils.deleteFromEsDbByPattern("_all");
- createSubCategoryRest = CategoryRestUtils.createSubCategory(productSubCategoryDefinition,
- productCategoryDefinition, sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails, PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, productCategoryDefinition,
- productSubCategoryDefinition, sdncProductStrategistUserDetails, STATUS_CODE_CREATED,
- AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void createResourceSubCategoryByNonAdminUser() throws Exception {
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncTesterUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_RESTRICTED_OPERATION,
- createSubCategoryRest.getErrorCode().intValue());
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryNotExistsInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- resourceCategoryDefinition.setName(resourceCategoryDefinition.getUniqueId());
- AuditValidationUtils.subCategoryAuditFailure(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncTesterUserDetails, ActionStatus.RESTRICTED_OPERATION,
- STATUS_CODE_RESTRICTED_OPERATION, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void createResourceSubCategoryByProducStrategistUser() throws Exception {
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncProductStrategistUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_RESTRICTED_OPERATION,
- createSubCategoryRest.getErrorCode().intValue());
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryNotExistsInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- resourceCategoryDefinition.setName(resourceCategoryDefinition.getUniqueId());
- AuditValidationUtils.subCategoryAuditFailure(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncProductStrategistUserDetails, ActionStatus.RESTRICTED_OPERATION,
- STATUS_CODE_RESTRICTED_OPERATION, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void createProductSubCategoryByNonProducStrategistUser() throws Exception {
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(productSubCategoryDefinition,
- productCategoryDefinition, sdncDesignerUserDetails, PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_RESTRICTED_OPERATION,
- createSubCategoryRest.getErrorCode().intValue());
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryNotExistsInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition);
- // Audit validation
- productCategoryDefinition.setName(productCategoryDefinition.getUniqueId());
- AuditValidationUtils.subCategoryAuditFailure(ADD_SUB_CATEGORY, productCategoryDefinition,
- productSubCategoryDefinition, sdncDesignerUserDetails, ActionStatus.RESTRICTED_OPERATION,
- STATUS_CODE_RESTRICTED_OPERATION, AUDIT_PRODUCT_TYPE);
- }
-
- @Test
- public void createProductSubCategoryByAdminUser() throws Exception {
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(productSubCategoryDefinition,
- productCategoryDefinition, sdncAdminUserDetails, PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_RESTRICTED_OPERATION,
- createSubCategoryRest.getErrorCode().intValue());
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryNotExistsInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition);
- // Audit validation
- productCategoryDefinition.setName(productCategoryDefinition.getUniqueId());
- AuditValidationUtils.subCategoryAuditFailure(ADD_SUB_CATEGORY, productCategoryDefinition,
- productSubCategoryDefinition, sdncAdminUserDetails, ActionStatus.RESTRICTED_OPERATION,
- STATUS_CODE_RESTRICTED_OPERATION, AUDIT_PRODUCT_TYPE);
- }
-
- // @Ignore("DE176245")
- @Test
- public void createResourceSubCategoryForNonExistingComponentType() throws Exception {
- String nonSupportedComponentType = "NonExistingComponentType"; // instead
- // resource/product
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, nonSupportedComponentType);
- assertEquals("Check response code after create Sub category", STATUS_CODE_INVALID_CONTENT,
- createSubCategoryRest.getErrorCode().intValue());
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryNotExistsInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- resourceCategoryDefinition.setName(resourceCategoryDefinition.getUniqueId());
- AuditValidationUtils.subCategoryAuditFailure(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, ActionStatus.INVALID_CONTENT,
- STATUS_CODE_INVALID_CONTENT, nonSupportedComponentType);
- }
-
- // @Ignore("DE176245")
- @Test
- public void createProductSubCategoryForNonExistingComponentType() throws Exception {
- String nonSupportedComponentType = "NonExistingComponentType"; // instead
- // resource/product
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(productSubCategoryDefinition,
- productCategoryDefinition, sdncProductStrategistUserDetails, nonSupportedComponentType);
- assertEquals("Check response code after create Sub category", STATUS_CODE_INVALID_CONTENT,
- createSubCategoryRest.getErrorCode().intValue());
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryNotExistsInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition);
- // Audit validation
- productCategoryDefinition.setName(productCategoryDefinition.getUniqueId());
- AuditValidationUtils.subCategoryAuditFailure(ADD_SUB_CATEGORY, productCategoryDefinition,
- productSubCategoryDefinition, sdncProductStrategistUserDetails, ActionStatus.INVALID_CONTENT,
- STATUS_CODE_INVALID_CONTENT, nonSupportedComponentType);
- }
-
- @Test
- public void createServiceSubCategoryByAdmin() throws Exception {
- // Service doesn't have sub-category
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, SERVICE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_INVALID_CONTENT,
- createSubCategoryRest.getErrorCode().intValue());
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryNotExistsInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- resourceCategoryDefinition.setName(resourceCategoryDefinition.getUniqueId());
- AuditValidationUtils.subCategoryAuditFailure(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, ActionStatus.INVALID_CONTENT,
- STATUS_CODE_INVALID_CONTENT, AUDIT_SERVICE_TYPE);
- }
-
- @Test
- public void createServiceSubCategoryByProductStrategist() throws Exception {
- // Service doesn't have sub-category
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(productSubCategoryDefinition,
- productCategoryDefinition, sdncProductStrategistUserDetails, SERVICE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_INVALID_CONTENT,
- createSubCategoryRest.getErrorCode().intValue());
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryNotExistsInGetResponse(getAllCategoriesRest,
- productCategoryDefinition.getUniqueId(), productSubCategoryDefinition);
- // Audit validation
- productCategoryDefinition.setName(productCategoryDefinition.getUniqueId());
- AuditValidationUtils.subCategoryAuditFailure(ADD_SUB_CATEGORY, productCategoryDefinition,
- productSubCategoryDefinition, sdncProductStrategistUserDetails, ActionStatus.INVALID_CONTENT,
- STATUS_CODE_INVALID_CONTENT, AUDIT_SERVICE_TYPE);
- }
-
- @Test
- public void createResourceSubCategoryForNonExistingCategory() throws Exception {
- resourceCategoryDefinition100.setUniqueId(resourceCategoryDefinition100.getName());
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition100, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_NOT_FOUND,
- createSubCategoryRest.getErrorCode().intValue());
- AuditValidationUtils.subCategoryAuditFailure(ADD_SUB_CATEGORY, resourceCategoryDefinition100,
- resourceSubCategoryDefinition, sdncAdminUserDetails, ActionStatus.COMPONENT_CATEGORY_NOT_FOUND,
- STATUS_CODE_NOT_FOUND, AUDIT_RESOURCE_TYPE, RESOURCE_COMPONENT_TYPE, CATEGORY, "");
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryNotExistsInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition100.getUniqueId(), resourceSubCategoryDefinition);
- }
-
- @Test
- public void createProductSubCategoryForNonExistingCategory() throws Exception {
- productCategoryDefinition200.setUniqueId(productCategoryDefinition200.getName());
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(productSubCategoryDefinition,
- productCategoryDefinition200, sdncProductStrategistUserDetails, PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_NOT_FOUND,
- createSubCategoryRest.getErrorCode().intValue());
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- PRODUCT_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryNotExistsInGetResponse(getAllCategoriesRest,
- productCategoryDefinition200.getUniqueId(), productSubCategoryDefinition);
- // Audit validation // need to change ActionStatus
- AuditValidationUtils.subCategoryAuditFailure(ADD_SUB_CATEGORY, productCategoryDefinition200,
- productSubCategoryDefinition, sdncProductStrategistUserDetails,
- ActionStatus.COMPONENT_CATEGORY_NOT_FOUND, STATUS_CODE_NOT_FOUND, AUDIT_PRODUCT_TYPE,
- PRODUCT_COMPONENT_TYPE, CATEGORY, "");
- }
-
- // pass
- @Test
- public void subCategoryAllowedcharacters_01() throws Exception {
- resourceSubCategoryDefinition.setName("1234AbcdE-");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition); // also
- // set
- // catalog
- // uniqeId
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- // pass
- @Test
- public void subCategoryAllowedcharacters_02() throws Exception {
- resourceSubCategoryDefinition.setName("1234AbcdE+");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryAllowedcharacters_03() throws Exception {
- resourceSubCategoryDefinition.setName("1234AbcdE&");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryAllowedcharacters_04() throws Exception {
- resourceSubCategoryDefinition.setName("1234AbcdE.");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryAllowedcharacters_05() throws Exception {
- resourceSubCategoryDefinition.setName("1234AbcdE'");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryAllowedcharacters_06() throws Exception {
- resourceSubCategoryDefinition.setName("1234AbcdE=");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryAllowedcharacters_07() throws Exception {
- resourceSubCategoryDefinition.setName("1234AbcdE:");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryAllowedcharacters_08() throws Exception {
- resourceSubCategoryDefinition.setName("1234AbcdE@");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryAllowedcharacters_09() throws Exception {
- resourceSubCategoryDefinition.setName("1234AbcdE_");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryAllowedcharacters_10() throws Exception {
- resourceSubCategoryDefinition.setName("1234AbcdE#");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryAllowedcharacters_11() throws Exception {
- resourceSubCategoryDefinition.setName("1234AbcdE d");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("1234AbcdE D");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryAllowedcharacters_12() throws Exception {
- resourceSubCategoryDefinition.setName("1234AbcdE &_=+.-'#:@ d");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("1234AbcdE &_=+.-'#:@ D");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryRemoveSpaceFromBeginning() throws Exception {
- resourceSubCategoryDefinition.setName(" Category01");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("Category01");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryRemoveSpaceFromEnd() throws Exception {
- resourceSubCategoryDefinition.setName("Category01 ");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("Category01");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryRemoveExtraSpace() throws Exception {
- resourceSubCategoryDefinition.setName("Category 02");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("Category 02");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryRemoveExtraAmpersand() throws Exception {
- resourceSubCategoryDefinition.setName("Category&& &02");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("Category& &02");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryRemoveExtraDash() throws Exception {
- resourceSubCategoryDefinition.setName("CategorY-- --02");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("CategorY- -02");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryRemoveExtraPlus() throws Exception {
- resourceSubCategoryDefinition.setName("CateGory++++ +02");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("CateGory+ +02");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryRemoveExtraPeriod() throws Exception {
- resourceSubCategoryDefinition.setName("Category.... .02");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("Category. .02");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryRemoveExtraApostrophe() throws Exception {
- resourceSubCategoryDefinition.setName("CaTegory''' '02");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("CaTegory' '02");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryRemoveExtraHashtag() throws Exception {
- resourceSubCategoryDefinition.setName("Category### #02");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("Category# #02");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryRemoveExtrEequal() throws Exception {
- resourceSubCategoryDefinition.setName("Category=== =02");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("Category= =02");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryRemoveExtrColon() throws Exception {
- resourceSubCategoryDefinition.setName("Category::: :02");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("Category: :02");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryRemoveExtrAt() throws Exception {
- resourceSubCategoryDefinition.setName("Category@@@ @a2");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("Category@ @a2");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryRemoveExtraUnderscore() throws Exception {
- resourceSubCategoryDefinition.setName("Category___ _22");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("Category_ _22");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryFirstWordStartWithNumber() throws Exception {
- resourceSubCategoryDefinition.setName("1Category one");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("1Category One");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- // Bug
- // Desc=<ACTION = "AddSubCategory" MODIFIER = "Jimmy Hendrix(jh0003)"
- // CATEGORY_NAME = "Category1" SUB_CATEGORY_NAME = "&AbcD123" GROUPING_NAME
- // = "" RESOURCE_TYPE = "Resource" STATUS = "400" DESC = "SVC4556: Error:
- // Invalid Resource sub-category name format.">
- // DESC=SVC4556: Error: InvalidResourcesub-categorynameformat.,
- // @Ignore
- @Test
- public void subCategoryFirstWordStartWithNonAlphaNumeric() throws Exception {
- // The first word must start with an alpha-numeric character [a-Z A..Z,
- // 0..9]
- char invalidChars[] = { '&', '-', '+', '.', '\'', '#', '=', ':', '@', '_' };
- for (int i = 0; i < invalidChars.length; i++) {
- DbUtils.deleteFromEsDbByPattern("_all");
- resourceSubCategoryDefinition.setName(invalidChars[i] + "AbcD123");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Category", STATUS_CODE_INVALID_CONTENT,
- createSubCategoryRest.getErrorCode().intValue());
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryNotExistsInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditFailure(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails,
- ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_FORMAT, STATUS_CODE_INVALID_CONTENT,
- AUDIT_RESOURCE_TYPE, AUDIT_RESOURCE_TYPE, SUB_CATEGORY);
-
- }
- }
-
- @Test
- public void subCategoryReplaceAndWithAmpersand_01() throws Exception {
- resourceSubCategoryDefinition.setName("At and T");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("At & T");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryReplaceAndWithAmpersand_02() throws Exception {
- resourceSubCategoryDefinition.setName("At and t");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("At & T");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryReplaceAndWithAmpersand_03() throws Exception {
- resourceSubCategoryDefinition.setName("Atand T");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryReplaceAndWithAmpersand_04() throws Exception {
- resourceSubCategoryDefinition.setName("At andT");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("At AndT");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryReplaceAndWithAmpersand_05() throws Exception {
- resourceSubCategoryDefinition.setName(" and AttT");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("And AttT");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryReplaceAndWithAmpersand_06() throws Exception {
- resourceSubCategoryDefinition.setName("AttT and ");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("AttT And");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryReplaceAndWithAmpersand_07() throws Exception {
- resourceSubCategoryDefinition.setName(" and a");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("And a");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryNameValidationMaxLength() throws Exception {
- resourceSubCategoryDefinition.setName("AsdfghjQ234567890@#.&:+-_");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryNameValidationMaxLengthAfterNormalization() throws Exception {
- resourceSubCategoryDefinition.setName(" A jQ234 @@@___ +++ At and T and and ");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("A JQ234 @_ + At & T & And");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- // bug :
- // Desc=<ACTION = "AddSubCategory" MODIFIER = "Jimmy Hendrix(jh0003)"
- // CATEGORY_NAME = "Category1" SUB_CATEGORY_NAME = " AbdfghBCVa jQ234 @@___
- // +++ At and T " GROUPING_NAME = "" RESOURCE_TYPE = "Resource" STATUS =
- // "400" DESC = "SVC4555: Error: Invalid Resource sub-category name
- // length.">
- @Test
- public void subCategoryNameValidationExceedMaxLengthAfterNormalization() throws Exception {
- resourceSubCategoryDefinition.setName(" AbdfghBCVa jQ234 @@___ +++ At and T ");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_INVALID_CONTENT,
- createSubCategoryRest.getErrorCode().intValue());
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryNotExistsInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditFailure(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_LENGTH,
- STATUS_CODE_INVALID_CONTENT, AUDIT_RESOURCE_TYPE, AUDIT_RESOURCE_TYPE, SUB_CATEGORY);
- }
-
- @Test
- public void subCategoryNameValidationMinLengthAfterNormalization() throws Exception {
- resourceSubCategoryDefinition.setName(" AT&&&&&&&&&T ");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("AT&T");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- // bug
- // Desc=<ACTION = "AddSubCategory" MODIFIER = "Jimmy Hendrix(jh0003)"
- // CATEGORY_NAME = "Category1" SUB_CATEGORY_NAME = " A and T " GROUPING_NAME
- // = "" RESOURCE_TYPE = "Resource" STATUS = "400" DESC = "SVC4555: Error:
- // Invalid Resource sub-category name length.">
- @Test
- public void subCategoryNameValidationLessThanMinLengthAfterNormalization() throws Exception {
- resourceSubCategoryDefinition.setName(" A&&&T ");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_INVALID_CONTENT,
- createSubCategoryRest.getErrorCode().intValue());
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryNotExistsInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditFailure(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_LENGTH,
- STATUS_CODE_INVALID_CONTENT, AUDIT_RESOURCE_TYPE, AUDIT_RESOURCE_TYPE, SUB_CATEGORY);
- }
-
- @Test
- public void subCategoryNameIsEmpty() throws Exception {
- resourceSubCategoryDefinition.setName("");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_INVALID_CONTENT,
- createSubCategoryRest.getErrorCode().intValue());
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryNotExistsInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditFailure(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_FORMAT,
- STATUS_CODE_INVALID_CONTENT, AUDIT_RESOURCE_TYPE, AUDIT_RESOURCE_TYPE, SUB_CATEGORY);
- }
-
- // bug
- // Desc=<ACTION = "AddSubCategory" MODIFIER = "Jimmy Hendrix(jh0003)"
- // CATEGORY_NAME = "Category1" SUB_CATEGORY_NAME = "AbcD123~" GROUPING_NAME
- // = "" RESOURCE_TYPE = "Resource" STATUS = "400" DESC = "SVC4556: Error:
- // Invalid Resource sub-category name format.">
- @Test
- public void subCategoryNameValidationInvalidCharacters() throws Exception {
- char invalidChars[] = { '~', '!', '$', '%', '^', '*', '(', ')', '"', '{', '}', '[', ']', '?', '>', '<', '/',
- '|', '\\', ',' };
- for (int i = 0; i < invalidChars.length; i++) {
- DbUtils.deleteFromEsDbByPattern("_all");
- resourceSubCategoryDefinition.setName("AbcD123" + invalidChars[i]);
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_INVALID_CONTENT,
- createSubCategoryRest.getErrorCode().intValue());
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryNotExistsInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditFailure(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails,
- ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_FORMAT, STATUS_CODE_INVALID_CONTENT,
- AUDIT_RESOURCE_TYPE, AUDIT_RESOURCE_TYPE, SUB_CATEGORY);
- }
- }
-
- @Test
- public void subCategoryNameValidationFirstLetterOfKeyWordsCapitalized() throws Exception {
- resourceSubCategoryDefinition.setName("beNNy shaY michEl");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("BeNNy ShaY MichEl");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryNameValidationConjunctions_01() throws Exception {
- resourceSubCategoryDefinition.setName(" bank OF america ");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("Bank of America");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryNameValidationConjunctions_02() throws Exception {
- resourceSubCategoryDefinition.setName("THE america bank ");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("THE America Bank");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryNameValidationConjunctions_03() throws Exception {
- resourceSubCategoryDefinition.setName(" A bank OF america ");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("A Bank of America");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryNameValidationConjunctions_04() throws Exception {
- resourceSubCategoryDefinition.setName(" bank america is A big ban ");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("Bank America Is a Big Ban");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryNameValidationConjunctions_05() throws Exception {
- resourceSubCategoryDefinition.setName(" aN apple comPany inC ");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("AN Apple ComPany InC");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryNameValidationConjunctions_06() throws Exception {
- resourceSubCategoryDefinition.setName(" eat AN apple ANAN");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("Eat an Apple ANAN");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryNameValidationConjunctions_07() throws Exception {
- resourceSubCategoryDefinition.setName(" united states OF americA ");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("United States of AmericA");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryNameValidationConjunctions_08() throws Exception {
- resourceSubCategoryDefinition.setName(" oF united states OF amer ");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("OF United States of Amer");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryNameValidationConjunctions_09() throws Exception {
- resourceSubCategoryDefinition.setName(" to Apple TO at&T TOO ");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("To Apple to At&T TOO");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryNameValidationConjunctions_10() throws Exception {
- resourceSubCategoryDefinition.setName(" eat apple AS you liiikeas ");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("Eat Apple as You Liiikeas");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryNameValidationConjunctions_11() throws Exception {
- resourceSubCategoryDefinition.setName(" as you may want ");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("As You May Want");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryNameValidationConjunctions_12() throws Exception {
- resourceSubCategoryDefinition.setName(" the bank OF america ");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("The Bank of America");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryNameValidationConjunctions_13() throws Exception {
- resourceSubCategoryDefinition.setName(" To tel-toto ");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("To Tel-toto");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void subCategoryNameValidationConjunctions_14() throws Exception {
- resourceSubCategoryDefinition.setName(" tel-aviv To la ");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- resourceSubCategoryDefinition.setName("Tel-aviv to La");
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, resourceSubCategoryDefinition);
-
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, resourceCategoryDefinition,
- resourceSubCategoryDefinition, sdncAdminUserDetails, STATUS_CODE_CREATED, AUDIT_RESOURCE_TYPE);
- }
-
- @Test
- public void createSubCategoryHttpCspUserIdHeaderIsMissing() throws Exception {
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategoryHttpCspAtuUidIsMissing(
- resourceSubCategoryDefinition, resourceCategoryDefinition, sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_MISSING_INFORMATION,
- createSubCategoryRest.getErrorCode().intValue());
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryNotExistsInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_INFORMATION.name());
- ExpectedCategoryAudit expectedCatrgoryAuditJavaObject = new ExpectedCategoryAudit();
- expectedCatrgoryAuditJavaObject.setAction(ADD_SUB_CATEGORY);
- expectedCatrgoryAuditJavaObject.setModifier("");
- expectedCatrgoryAuditJavaObject.setCategoryName(resourceCategoryDefinition.getUniqueId());
- // String subCategoryName = (resourceSubCategoryDefinition != null ?
- // resourceSubCategoryDefinition.getName() : Constants.EMPTY_STRING);
- expectedCatrgoryAuditJavaObject.setSubCategoryName(resourceSubCategoryDefinition.getName());
- // String groupingName = (groupingDefinition != null ?
- // groupingDefinition.getName() : Constants.EMPTY_STRING);
- expectedCatrgoryAuditJavaObject.setGroupingName("");
- expectedCatrgoryAuditJavaObject.setResourceType(AUDIT_RESOURCE_TYPE);
- expectedCatrgoryAuditJavaObject.setStatus(String.valueOf(STATUS_CODE_MISSING_INFORMATION));
- expectedCatrgoryAuditJavaObject.setDesc(errorInfo.getAuditDesc());
- AuditValidationUtils.validateCategoryAudit(expectedCatrgoryAuditJavaObject, ADD_SUB_CATEGORY);
- }
-
- @Test
- public void createSubCategoryHttpCspUserIdIsEmpty() throws Exception {
- User sdncAdminUserDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- sdncAdminUserDetails1.setUserId("");
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails1, RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after create Sub category", STATUS_CODE_MISSING_INFORMATION,
- createSubCategoryRest.getErrorCode().intValue());
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryNotExistsInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), resourceSubCategoryDefinition);
- // Audit validation
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_INFORMATION.name());
- ExpectedCategoryAudit expectedCatrgoryAuditJavaObject = new ExpectedCategoryAudit();
- expectedCatrgoryAuditJavaObject.setAction(ADD_SUB_CATEGORY);
- expectedCatrgoryAuditJavaObject.setModifier("");
- expectedCatrgoryAuditJavaObject.setCategoryName(resourceCategoryDefinition.getUniqueId());
- // String subCategoryName = (resourceSubCategoryDefinition != null ?
- // resourceSubCategoryDefinition.getName() : Constants.EMPTY_STRING);
- expectedCatrgoryAuditJavaObject.setSubCategoryName(resourceSubCategoryDefinition.getName());
- // String groupingName = (groupingDefinition != null ?
- // groupingDefinition.getName() : Constants.EMPTY_STRING);
- expectedCatrgoryAuditJavaObject.setGroupingName("");
- expectedCatrgoryAuditJavaObject.setResourceType(AUDIT_RESOURCE_TYPE);
- expectedCatrgoryAuditJavaObject.setStatus(String.valueOf(STATUS_CODE_MISSING_INFORMATION));
- expectedCatrgoryAuditJavaObject.setDesc(errorInfo.getAuditDesc());
- AuditValidationUtils.validateCategoryAudit(expectedCatrgoryAuditJavaObject, ADD_SUB_CATEGORY);
- }
-
- ////////////////////////////////////////////////////////////
- private void createSubCategorySuccess(CategoryDefinition categoryDefinition,
- SubCategoryDefinition subCategoryDefinition, User sdncAdminUserDetails, String componentType,
- String auditType) throws Exception {
-
- RestResponse createSubCategoryRest = CategoryRestUtils.createSubCategory(subCategoryDefinition,
- categoryDefinition, sdncAdminUserDetails, componentType);
- assertEquals("Check response code after create Sub category", STATUS_CODE_CREATED,
- createSubCategoryRest.getErrorCode().intValue());
- CategoryValidationUtils.validateCreateSubCategoryResponse(createSubCategoryRest, subCategoryDefinition);
- // Audit validation
- AuditValidationUtils.subCategoryAuditSuccess(ADD_SUB_CATEGORY, categoryDefinition, subCategoryDefinition,
- sdncAdminUserDetails, STATUS_CODE_CREATED, auditType);
- // get service category and validate that category added as defined
- // (also set catalog uniqeId)
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails, componentType);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- categoryDefinition.getUniqueId(), subCategoryDefinition); // also
- // set
- // catalog
- // uniqeId
- }
-
- @Test
- public void getResourceCategoryHierarchySuccessFlow() throws Exception {
- int numOfSubCategories = 3;
- List<SubCategoryDefinition> subCategories = new ArrayList();
- RestResponse restResponse;
- SubCategoryDefinition subCategory;
- String subName = resourceSubCategoryDefinition.getName();
- for (int i = 0; i < numOfSubCategories; i++) {
- resourceSubCategoryDefinition.setName(subName + i);
- restResponse = CategoryRestUtils.createSubCategory(resourceSubCategoryDefinition,
- resourceCategoryDefinition, sdncAdminUserDetails, RESOURCE_COMPONENT_TYPE);
- subCategory = ResponseParser.parseToObject(restResponse.getResponse(), SubCategoryDefinition.class);
- subCategories.add(subCategory);
- }
- RestResponse getAllCategoriesRest = CategoryRestUtils.getAllCategories(sdncAdminUserDetails,
- RESOURCE_COMPONENT_TYPE);
- assertEquals("Check response code after get all categories ", STATUS_CODE_SUCCESS,
- getAllCategoriesRest.getErrorCode().intValue());
- AuditValidationUtils.GetCategoryHierarchyAuditSuccess(GET_CATEGORY_HIERARCHY, AUDIT_RESOURCE_TYPE,
- sdncAdminUserDetails, STATUS_CODE_SUCCESS);
- for (SubCategoryDefinition sub : subCategories) {
- CategoryValidationUtils.verifySubCategoryExistInGetResponse(getAllCategoriesRest,
- resourceCategoryDefinition.getUniqueId(), sub);
- }
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/AndreyTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/AndreyTest.java
deleted file mode 100644
index ab6551f49e..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/AndreyTest.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.devCI;
-
-import org.openecomp.sdc.be.model.PropertyDefinition;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaDefinition;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaTopologyTemplateDefinition;
-import org.openecomp.sdc.ci.tests.utils.ToscaParserUtils;
-import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
-
-import java.io.File;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
-public class AndreyTest {
-
- private static ToscaDefinition parseToscaYamlToJavaObject;
-
-
- public static void main(String[] args) throws Exception {
- ToscaDefinition toscaMainAmdocsDefinition, toscaMainVfDefinition, toscaMainServiceDefinition;
- File filesFolder = new File("C:/Users/al714h/Downloads/Design/");
- File genericFilesFolder = new File("C:/Git_work/sdc/catalog-be/src/main/resources/import/tosca/heat-types/");
- File genericVF = new File ("/Generic_VF/Generic_VF.yml");
- File genericVFC = new File ("/Generic_VFC/Generic_VFC.yml");
- File genericPNF = new File ("/Generic_PNF/Generic_PNF.yml");
- File genericService = new File ("/Generic_Service/Generic_Service.yml");
- File amdocsCsarFileName = new File("/77e6b842669f441db20a83489da3f4be.csar");
- File VfCsarFileName = new File("/resource-Civfonboarded2016012VmxAv301072E2e1424cb9d-csar.csar");
- File serviceCsarFileName = new File("/service-Ciservicefeba0521131d-csar.csar");
-
- System.out.println("start " + new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(new Date()));
-
-// File path = new File("C:/Data/D2.0/TOSCA_Ex/Definitions/tosca_definition_version.yaml");
-// File path = new File("C:/Data/D2.0/TOSCA_Ex/resource-Vl11Vl10-template.yml");
-// File path = new File("C:/Data/D2.0/TOSCA_Ex/service-Servicepxtc-template US822998.yml");
-// File path = new File("C:/Data/FileToParse/Definitions/service-Ciservice513e6fa67d07-template.yml");
-// toscaMainAmdocsDefinition = ToscaParserUtils.parseToscaMainYamlToJavaObjectByCsarLocation(new File("C:/Data/FileToParse/LDSA/service-LdsaService-csar.csar"));
- toscaMainAmdocsDefinition = ToscaParserUtils.parseToscaMainYamlToJavaObjectByCsarLocation(new File(filesFolder.getPath() + amdocsCsarFileName));
- toscaMainVfDefinition = ToscaParserUtils.parseToscaMainYamlToJavaObjectByCsarLocation(new File(filesFolder.getPath() + VfCsarFileName));
- toscaMainServiceDefinition = ToscaParserUtils.parseToscaMainYamlToJavaObjectByCsarLocation(new File(filesFolder.getPath() + serviceCsarFileName));
- Resource resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, "Generic_VF", "1.0");
- ToscaTopologyTemplateDefinition topologyTemplate = toscaMainAmdocsDefinition.getTopology_template();
-// FileHandling.parseYamlFileToMapByPattern("","");
-
- Map<String, Object> newInput = new HashMap<String, Object>();
- for (PropertyDefinition property : resource.getProperties()) {
- newInput.put(property.getName(),property);
- }
-
-// topologyTemplate.addInputs(newInput);
-//
-//
-// List<PropertyDefinition> properties = resource.getProperties();
-// File path = new File("C:/Data/FileToParse/Definitions/resource-Civfonboarded2016006VvmVvm301607E2100a9b04-template.yml");
-// File csarPath = new File("C:/Data/D2.0/TOSCA_Ex/Nested.csar");
-
-
-// toscaDefinition = ToscaParserUtils.parseToscaYamlToJavaObject(path);
- System.out.println("listTypeHeatMetaDefinition start " + new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(new Date()));
-// List<TypeHeatMetaDefinition> listTypeHeatMetaDefinition = CsarParserUtils.getListTypeHeatMetaDefinition(csarPath);
- System.out.println("get service start " + new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(new Date()));
-// System.out.println(listTypeHeatMetaDefinition);
-// for(TypeHeatMetaDefinition typeHeatMetaDefinition : listTypeHeatMetaDefinition){
-// for(GroupHeatMetaDefinition groupHeatMetaDefinition : typeHeatMetaDefinition.getGroupHeatMetaDefinition()){
-// List<HeatMetaFirstLevelDefinition> artifactList = groupHeatMetaDefinition.getArtifactList();
-// boolean isBase = groupHeatMetaDefinition.getPropertyHeatMetaDefinition().getValue();
-// }
-//
-// }
- System.out.println("Finished");
- System.out.println("get service start " + new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(new Date()));
- }
-
-
- /*@Test
- public void distributionTest() throws SdcToscaParserException, JToscaException, IOException {
- //String serviceName = import and create().getName();
- //getServiceObject();
- //parseServiceObject();
-
-
-
- SdcToscaParserFactory factory = SdcToscaParserFactory.getInstance();
- long startTime = System.currentTimeMillis();
- long estimatedTime = System.currentTimeMillis() - startTime;
- System.out.println("Time to init factory " + estimatedTime);
- String fileStr1 = "C:\\Users\\ys9693\\NewDownload\\2016-006_vvm_vvm_30_1607_e2e.zip.csar";//ToscaParserStubsTest.class.getClassLoader().getResource("csars/service-ServiceFdnt-csar-0904-2.csar").getFile();
- File file1 = new File(fileStr1);
- String name = file1.getName();
- String absolutePath = file1.getAbsolutePath();
- ISdcCsarHelper fdntCsarHelper = factory.getSdcCsarHelper(file1.getAbsolutePath());
-
- List<NodeTemplate> serviceVfList = fdntCsarHelper.getServiceVfList();
- System.out.println("serviceVfList----->" + serviceVfList);
-
- List<NodeTemplate> serviceNodeTemplatesByTypeVF = fdntCsarHelper.getServiceNodeTemplatesByType("VF");
- System.out.println("serviceNodeTemplatesByTypeVF----->" + serviceNodeTemplatesByTypeVF);
- List<NodeTemplate> serviceNodeTemplatesByTypeVFC = fdntCsarHelper.getServiceNodeTemplatesByType("VFC");
- System.out.println("serviceNodeTemplatesByTypeVFC -------->" + serviceNodeTemplatesByTypeVFC);
- List<NodeTemplate> serviceNodeTemplatesByTypeVL = fdntCsarHelper.getServiceNodeTemplatesByType("VL");
- System.out.println("serviceNodeTemplatesByTypeVL------>" +serviceNodeTemplatesByTypeVL);
- List<NodeTemplate> serviceNodeTemplatesByTypeCP = fdntCsarHelper.getServiceNodeTemplatesByType("CP");
- System.out.println("serviceNodeTemplatesByTypeCP ---------->" + serviceNodeTemplatesByTypeCP);
-
- System.out.println("getMetaData"+ serviceVfList.get(0).getMetaData());
- System.out.println("UUID"+ serviceVfList.get(0).getMetaData().getValue("UUID"));
- System.out.println("customizationUUID"+ serviceVfList.get(0).getMetaData().getValue("customizationUUID"));
- System.out.println("serviceVfList.size()------->"+ serviceVfList.size());
- System.out.println("getCpListByVf--------->" + fdntCsarHelper.getCpListByVf(serviceVfList.get(0).getMetaData().getValue("customizationUUID")));
- List<NodeTemplate> vfcListByVf = fdntCsarHelper.getVfcListByVf(serviceVfList.get(0).getMetaData().getValue("customizationUUID"));
- System.out.println("getVfcListByVf--------->" + vfcListByVf);
- for (NodeTemplate nodeTemplate : vfcListByVf) {
-
- System.out.println("----> getCpPropertiesFromVfc--------->" + fdntCsarHelper.getCpPropertiesFromVfc(nodeTemplate));
- }
-
- for (NodeTemplate nodeTemplate : serviceVfList) {
- System.out.println("NodeName---->"+nodeTemplate.getName());
- System.out.println("getTypeOfNodeTemplate--------->" + fdntCsarHelper.getTypeOfNodeTemplate(nodeTemplate));
- System.out.println("getServiceInputLeafValueOfDefault--------->" + fdntCsarHelper.getServiceInputLeafValueOfDefault(serviceVfList.get(0).getMetaData().getValue("customizationUUID")));
- System.out.println("getVfModulesByVf--------->" + fdntCsarHelper.getVfModulesByVf(nodeTemplate.getMetaData().getValue("customizationUUID")));
- ArrayList<Object> requirements = nodeTemplate.getRequirements();
- requirements.size();
- LinkedHashMap<String, Capability> capabilities = nodeTemplate.getCapabilities();
- ArrayList<Object> requirements2 = nodeTemplate.getRequirements();
- }
-
- }*/
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ArtifactFromCsar.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ArtifactFromCsar.java
deleted file mode 100644
index 7a69d374eb..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ArtifactFromCsar.java
+++ /dev/null
@@ -1,291 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.devCI;
-
-import org.apache.commons.codec.digest.DigestUtils;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.IOUtils;
-import org.openecomp.sdc.ci.tests.datatypes.GroupHeatMetaDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.HeatMetaFirstLevelDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.TypeHeatMetaDefinition;
-import org.openecomp.sdc.ci.tests.utils.CsarParserUtils;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.nio.file.DirectoryStream;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.*;
-import java.util.stream.Collectors;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-
-public class ArtifactFromCsar {
-
-
- public static void main(String[] args) throws Exception {
- String zipFile = "C:\\Users\\rp955r\\Documents\\InTesting\\resource-CivfonboardedFdnt2f792348-csar.csar";
-
-// Map<String, Object> combinedMap = combineHeatArtifacstWithFolderArtifacsToMap(zipFile);
-
- Map<String, Object> vfcArtifacts = ArtifactFromCsar.getVFCArtifacts(zipFile);
-
- System.out.println("1234o");
- }
-
- public static Map<String, Object> combineHeatArtifacstWithFolderArtifacsToMap(String pathToCsar) throws Exception {
- return combineHeatArtifacstWithFolderArtifacsToMap(pathToCsar, "output");
- }
-
- public static Map<String, Object> combineHeatArtifacstWithFolderArtifacsToMap(String pathToCsar, String outputCsar) throws Exception {
- File csarFile = new File(pathToCsar);
-
-
- File dir = new File(csarFile.getParent() + File.separator + outputCsar);
- dir.mkdir();
- if(!dir.exists()) {
- }
-
- String outputFolder = dir.getPath();
- unZip(pathToCsar, outputFolder);
- File directory = new File(outputFolder + File.separator + "Artifacts" + File.separator );
-
- Map<String, Object> artifactsMap = combineHeatArtifacstWithFolderArtifacsToMap(getMapArtifactFromFolderStructure(directory), getDeploymentArtifactListFromHeatMeta(csarFile, directory));
- FileUtils.cleanDirectory(new File(outputFolder));
-
- return artifactsMap;
- }
-
- public static Map<String, Object> getVFCArtifacts(String pathToCsar) throws Exception{
- String outputFolder = unzipCsarFile(pathToCsar);
- File directory = new File(outputFolder + File.separator + "Artifacts" + File.separator );
- Map<String, Object> artifactsMap = getMapArtifactFromFolderStructure(directory);
- cleanFolders(outputFolder);
-
- return artifactsMap;
- }
-
- private static Map<String, Object> combineHeatArtifacstWithFolderArtifacsToMap(Map<String, Object> map, List<HeatMetaFirstLevelDefinition> rlist) {
- if(map.get("Deployment") != null) {
- rlist.addAll((Collection<? extends HeatMetaFirstLevelDefinition>) map.get("Deployment"));
- }
- map.put("Deployment", rlist);
- return map;
- }
-
- private static List<HeatMetaFirstLevelDefinition> getDeploymentArtifactListFromHeatMeta(File pathToCsar, File directory) throws Exception {
- List<HeatMetaFirstLevelDefinition> artifactList = new LinkedList<HeatMetaFirstLevelDefinition>();
-
- List<TypeHeatMetaDefinition> listTypeHeatMetaDefinition = CsarParserUtils.getListTypeHeatMetaDefinition(pathToCsar);
-
- for(TypeHeatMetaDefinition typeHeatMetaDefinition : listTypeHeatMetaDefinition){
- for(GroupHeatMetaDefinition groupHeatMetaDefinition : typeHeatMetaDefinition.getGroupHeatMetaDefinition()){
- artifactList.addAll(groupHeatMetaDefinition.getArtifactList());
- }
- }
-
- List<HeatMetaFirstLevelDefinition> listArtifactWithTypesByList = getListArtifactWithTypesByList(directory, artifactList);
- return listArtifactWithTypesByList;
-// return artifactList;
-
- }
-
- private static Map<String, Object> getMapArtifactFromFolderStructure(File pathToArtifactFolder) throws IOException {
-
- Map<String, Object> map = new HashMap<String, Object>();
-
-
- final Path dir = Paths.get(pathToArtifactFolder.getPath());
- final DirectoryStream<Path> dirStream = Files.newDirectoryStream(dir);
-
- dirStream.forEach(currFile -> {
- File file = currFile.toFile();
- if (file.isDirectory()) {
- System.out.println(file.getName());
- if(file.getName().toLowerCase().equals("deployment") || file.getName().toLowerCase().equals("informational")) {
- map.put(file.getName(), getListArtifactWithTypes(file));
- } else {
- try {
- map.put(file.getName(), getMapArtifactFromFolderStructure(file));
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
- });
-
- dirStream.close();
-
-
-
-//
-// File[] fileList = pathToArtifactFolder.listFiles();
-// for(File file: fileList) {
-// if (file.isDirectory()) {
-//
-// System.out.println(file.getName());
-// if(file.getName().equals("Deployment") || file.getName().equals("Informational")) {
-// map.put(file.getName(), getListArtifactWithTypes(file));
-// } else {
-// map.put(file.getName(), getMapArtifactFromFolderStructure(file));
-// }
-// }
-// }
- return map;
- }
-
-
-
- private static List<HeatMetaFirstLevelDefinition> getListArtifactWithTypes(File folderPath) {
- List<HeatMetaFirstLevelDefinition> artifactList = new LinkedList<HeatMetaFirstLevelDefinition>();
-
- File[] fileList = folderPath.listFiles();
-
- for(File file: fileList) {
- File[] artifacts = file.listFiles();
-
- for(File artifact: artifacts) {
-// HeatMetaFirstLevelDefinition heatMetaFirstLevelDefinition = new HeatMetaFirstLevelDefinition(file.getName(), artifact.getName());
- HeatMetaFirstLevelDefinition heatMetaFirstLevelDefinition = new HeatMetaFirstLevelDefinition(artifact.getName(), file.getName(), crunchifyGetMd5ForFile(artifact));
- artifactList.add(heatMetaFirstLevelDefinition);
- }
- }
-
- return artifactList;
- }
-
- private static List<HeatMetaFirstLevelDefinition> getListArtifactWithTypesByList(File folderPath, List<HeatMetaFirstLevelDefinition> artifactLogicList) {
-
-
- File[] fileList = folderPath.listFiles();
-
-
-
- for (HeatMetaFirstLevelDefinition heatMetaFirstLevelDefinition : artifactLogicList) {
-
- String fileName = heatMetaFirstLevelDefinition.getFileName();
-
- for (File fileFromFolder : fileList) {
- if ( fileFromFolder.getName().equals(fileName)){
- heatMetaFirstLevelDefinition.setCheckSum(crunchifyGetMd5ForFile(fileFromFolder));
- }
-
- }
- }
-
- return artifactLogicList;
- }
-
- public static String crunchifyGetMd5ForFile(File crunchifyFile) {
- String crunchifyValue = null;
- FileInputStream crunchifyInputStream = null;
- try {
- crunchifyInputStream = new FileInputStream(crunchifyFile);
-
- // md5Hex converts an array of bytes into an array of characters representing the hexadecimal values of each byte in order.
- // The returned array will be double the length of the passed array, as it takes two characters to represent any given byte.
- crunchifyValue = DigestUtils.md5Hex(IOUtils.toByteArray(crunchifyInputStream));
- } catch (IOException e) {
- e.printStackTrace();
- } finally {
- IOUtils.closeQuietly(crunchifyInputStream);
- }
- return crunchifyValue;
- }
-
- public static void unZip(String zipFile, String outputFolder) {
- byte[] buffer = new byte[1024];
-
- try{
- File folder = new File(outputFolder);
-
- if(!folder.exists()){
- folder.mkdir();
- }
-
- ZipInputStream zis = new ZipInputStream(new FileInputStream(zipFile));
- ZipEntry ze = zis.getNextEntry();
-
- while(ze!=null){
-
- String fileName = ze.getName();
- File newFile = new File(outputFolder + File.separator + fileName);
-
- if(ze.isDirectory()) {
- newFile.mkdir();
- ze = zis.getNextEntry();
- continue;
- }
-
- new File(newFile.getParent()).mkdirs();
- FileOutputStream fos = new FileOutputStream(newFile);
-
- int len;
- while ((len = zis.read(buffer)) > 0) {
- fos.write(buffer, 0, len);
- }
-
- fos.close();
- ze = zis.getNextEntry();
- }
-
- zis.closeEntry();
- zis.close();
-
- } catch (IOException ex) {
- ex.printStackTrace();
- }
-
- }
-
- private static void cleanFolders(String outputFolder) throws IOException {
- System.gc();
- FileUtils.cleanDirectory(new File(outputFolder));
- FileUtils.deleteDirectory(new File(outputFolder));
- }
-
- private static String unzipCsarFile(String pathToCsar) {
- File csarFile = new File(pathToCsar);
-
-
- File dir = new File(csarFile.getParent() + File.separator + "output-" + UUID.randomUUID());
- if(!dir.exists()) {
- dir.mkdirs();
- }
-
- String outputFolder = dir.getPath();
- ArtifactFromCsar.unZip(pathToCsar, outputFolder);
- return outputFolder;
- }
-
- public static String[] getArtifactNamesFromCsar(String path, String csarFile) throws Exception {
- Map<String, Object> combinedMap = combineHeatArtifacstWithFolderArtifacsToMap(path + csarFile);
- LinkedList<HeatMetaFirstLevelDefinition> deploymentArtifacts = ((LinkedList<HeatMetaFirstLevelDefinition>) combinedMap.get("Deployment"));
- List<String> artifactNamesList = deploymentArtifacts.stream().map(e -> e.getFileName()).collect(Collectors.toList());
- Object[] artifactNamesObjectArr = artifactNamesList.toArray();
- String[] artifactNamesFromFile = Arrays.copyOf(artifactNamesObjectArr, artifactNamesObjectArr.length, String[].class);
- return artifactNamesFromFile;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ImportCsarValidateArtifacts.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ImportCsarValidateArtifacts.java
deleted file mode 100644
index 802de24d4f..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ImportCsarValidateArtifacts.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.devCI;
-
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.openecomp.sdc.ci.tests.utils.validation.CsarValidationUtils;
-import org.testng.annotations.DataProvider;
-import org.testng.annotations.Test;
-
-import static org.testng.AssertJUnit.assertTrue;
-
-public class ImportCsarValidateArtifacts extends ComponentBaseTest {
-
- @Rule
- public static TestName name = new TestName();
-
- public ImportCsarValidateArtifacts() {
- super(name, ImportCsarValidateArtifacts.class.getName());
- }
-
- @DataProvider(name = "happyArts")
- public Object[][] getHappyArtifacts() {
-
- return new Object[][] { { "happy_VF_RI2_G2_two_different_artifacts_under_heatBaseheatVolheatNet2" },
- { "happy_VF_RI2_G2_two_different_artifacts_under_heatBaseheatVolheatNet" },
- { "happy_VF_RI2_G2_two_identical_artifacts_under_heatBaseheatVolheatNet" },
- { "happy_VF_RI2_G2_two_different_artifacts_under_nested" },
- { "happy_VF_RI2_G2_two_indentical_nested_under_different_groups" },
- { "happy_VF_RI2_G2_two_different_nested_under_different_groups" },
- { "happy_VF_RI2_G2_two_different_nested_under_same_group" },
-
- };
- }
-
- @DataProvider(name = "negativeArts")
- public Object[][] getNegativeArtifacts() {
-
- return new Object[][] {
-
- { "negative_VF_RI2_G2_same_heatVol_different_groups" },
- { "negative_VF_RI2_G2_same_heatBase_different_envs" },
- { "negative_VF_RI2_G2_heatBaseHeatVolHeatNet_under_nested" },
- { "negative_VF_RI2_G2_two_indentical_artifacts_under_nested" },
- { "negative_VF_RI2_G2_nested_under_nested" }, { "negative_VF_RI2_G2_same_heatVol_different_groups" }, };
- }
-
- @Test(dataProvider = "happyArts")
- public void createResourceFromCsarArtsHappy(String artifactName) throws Exception {
-
- ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
- resourceDetails.setCsarUUID(artifactName);
- resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
- RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
-
- BaseRestUtils.checkCreateResponse(createResource);
- Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
- CsarValidationUtils.validateCsarVfArtifact(artifactName, resource);
-
- }
-
- @Test(dataProvider = "negativeArts")
- public void createResourceFromCsarArtsNegative(String artifactName) throws Exception {
-
- ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
- resourceDetails.setCsarUUID(artifactName);
- resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
- RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- assertTrue(createResource.getErrorCode() != 201 && createResource.getErrorCode() != 500);
-
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ToscaGroupInsideVF.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ToscaGroupInsideVF.java
deleted file mode 100644
index 54ab644157..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/ToscaGroupInsideVF.java
+++ /dev/null
@@ -1,550 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.devCI;
-
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ToscaGroupInsideVF extends ComponentBaseTest {
- private static Logger logger = LoggerFactory.getLogger(ToscaGroupInsideVF.class.getName());
-
- @Rule
- public static TestName name = new TestName();
-
- public ToscaGroupInsideVF() {
- super(name, ToscaGroupInsideVF.class.getName());
- }
-
- /*@Test
- public void createResourceFromCsarArts() throws Exception {
-
- // String csar = getCsar();
- // parseCsar(csar);
- ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
- resourceDetails.setCsarUUID("VF_RI2_G6_withArtifacts");
- resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
- RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- BaseRestUtils.checkCreateResponse(createResource);
- Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
-
- Component resourceObject = AtomicOperationUtils
- .changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- Resource vfManual = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true)
- .left().value();
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.OTHER, vfManual, UserRoleEnum.DESIGNER, true, true);
- AtomicOperationUtils.changeComponentState(vfManual, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true)
- .getLeft();
-
- Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
- AtomicOperationUtils
- .addComponentInstanceToComponentContainer(resourceObject, service, UserRoleEnum.DESIGNER, true).left()
- .value();
- AtomicOperationUtils.addComponentInstanceToComponentContainer(vfManual, service, UserRoleEnum.DESIGNER, true)
- .left().value();
- AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
- AtomicOperationUtils
- .changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFICATIONREQUEST, true)
- .getLeft();
- AtomicOperationUtils
- .changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CANCELCERTIFICATION, true)
- .getLeft();
- AtomicOperationUtils
- .changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFICATIONREQUEST, true)
- .getLeft();
-
- }
-
- @Test
- public void soferTest() throws Exception {
-
- // String csar = getCsar();
- // parseCsar(csar);
- ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
- resourceDetails.setCsarUUID("sofer");
- resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
- RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- BaseRestUtils.checkCreateResponse(createResource);
- Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
-
- }
-
- @Test
- public void createVFwith2VLs() throws Exception {
-
- // String csar = getCsar();
- // parseCsar(csar);
- ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
- resourceDetails.setCsarUUID("VSPPackage");
- resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
- RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- BaseRestUtils.checkCreateResponse(createResource);
- Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
-
- Component resourceObject = AtomicOperationUtils
- .changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- Resource vfManual = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true)
- .left().value();
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.OTHER, vfManual, UserRoleEnum.DESIGNER, true, true);
- AtomicOperationUtils.changeComponentState(vfManual, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true)
- .getLeft();
-
- Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
- AtomicOperationUtils
- .addComponentInstanceToComponentContainer(resourceObject, service, UserRoleEnum.DESIGNER, true).left()
- .value();
- AtomicOperationUtils.addComponentInstanceToComponentContainer(vfManual, service, UserRoleEnum.DESIGNER, true)
- .left().value();
- AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
- AtomicOperationUtils
- .changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFICATIONREQUEST, true)
- .getLeft();
- AtomicOperationUtils
- .changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CANCELCERTIFICATION, true)
- .getLeft();
- AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true)
- .getLeft();
-
- }
-
- @Test // (enabled = false)
- public void createResourceFromCsarHappy() throws Exception {
- // String csarUUID = "VF_RI2_G2_withArtifacts";
- String csarUUID = "VF_RI2_G1_Invalid";
- ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
- resourceDetails.setCsarUUID(csarUUID);
- resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
- RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- BaseRestUtils.checkCreateResponse(createResource);
- Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
- CsarValidationUtils.validateCsarVfArtifact(csarUUID, resource);
- }
-
- @Test // (enabled = false)
- public void createResourceFromCsarWithProperty() throws Exception {
- String csarUUID = "VF_RI2_G4_withArtifacts";
- ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
- resourceDetails.setCsarUUID(csarUUID);
- resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
- RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- BaseRestUtils.checkCreateResponse(createResource);
- Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
- CsarValidationUtils.validateCsarVfArtifact(csarUUID, resource);
- }
-
- @Test // (enabled = false)
- public void UpdateCsarWithNonExistingResourceInstanceFail() throws Exception {
-
- // String csarUUID = "VF_RI2_G1-RI_NotExist";
- // String csarUUID = "nested3";
-
- // String csarUUID = "VF_RI2_G1_Invalid_WithArtifacts";
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
-
- RestResponse copyRes = copyCsarRest(sdncModifierDetails, "VF_RI2_G4_withArtifacts_a.csar",
- "VF_RI2_G4_withArtifacts.csar");
- BaseRestUtils.checkSuccess(copyRes);
- String csarUUID = "VF_RI2_G4_withArtifacts.csar";
-
- ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
- resourceDetails.setCsarUUID(csarUUID);
- resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
- RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- BaseRestUtils.checkCreateResponse(createResource);
- Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
-
- copyRes = copyCsarRest(sdncModifierDetails, "VF_RI2_G4_withArtifactsRI_FAIL.csar",
- "VF_RI2_G4_withArtifacts.csar");
- BaseRestUtils.checkSuccess(copyRes);
-
- resourceDetails.setName(resource.getName());
- // resourceDetails.setVendorName("Govnuk");
- // resourceDetails.setDescription("Other");
- RestResponse createResource2 = ResourceRestUtils.createResource(resourceDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- BaseRestUtils.checkCreateResponse(createResource2);
- Resource resource2 = ResponseParser.parseToObjectUsingMapper(createResource2.getResponse(), Resource.class);
-
- CsarValidationUtils.validateCsarVfArtifact(csarUUID, resource);
- ToscaDefinition toscaDefinition = ToscaParserUtils.getToscaDefinitionObjectByCsarUuid(csarUUID);
- CsarValidationUtils.validateToscaDefinitonObjectVsResource(toscaDefinition, resource);
-
- // CsarValidationUtils.validateCsarVfArtifact(csarUUID2, resource2);
- // ToscaDefinition toscaDefinition2 =
- // ToscaParserUtils.getToscaDefinitionObjectByCsarUuid(csarUUID2);
- // CsarValidationUtils.validateToscaDefinitonObjectVsResource(toscaDefinition2,
- // resource2);
-
- // Csar csar = parserTocsarObject(csarUUID);
- // validateCsarVsResourceObj(csar, resource);
- // csar.node_types();
-
- }
-
- @Test // (enabled = false)
- public void UpdateCsarWithSameCsarDifferentMetadata() throws Exception {
-
- // User sdncModifierDetails =
- // ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- // RestResponse copyRes =
- // copyCsarRest(sdncModifierDetails,"VF_RI2_G4_withArtifacts_a.csar","VF_RI2_G4_withArtifacts.csar");
- // BaseRestUtils.checkSuccess(copyRes);
- String csarUUID = "VF_RI2_G4_withArtifacts.csar";
-
- ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
- resourceDetails.setCsarUUID(csarUUID);
- resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
- RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- BaseRestUtils.checkCreateResponse(createResource);
- Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
-
- resourceDetails.setName(resource.getName());
- resourceDetails.setVendorName("Govnuk");
- resourceDetails.setDescription("Other");
- RestResponse createResource2 = ResourceRestUtils.createResource(resourceDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- BaseRestUtils.checkCreateResponse(createResource2);
- Resource resource2 = ResponseParser.parseToObjectUsingMapper(createResource2.getResponse(), Resource.class);
-
- CsarValidationUtils.validateCsarVfArtifact(csarUUID, resource);
- ToscaDefinition toscaDefinition = ToscaParserUtils.getToscaDefinitionObjectByCsarUuid(csarUUID);
- CsarValidationUtils.validateToscaDefinitonObjectVsResource(toscaDefinition, resource);
-
- // CsarValidationUtils.validateCsarVfArtifact(csarUUID2, resource2);
- // ToscaDefinition toscaDefinition2 =
- // ToscaParserUtils.getToscaDefinitionObjectByCsarUuid(csarUUID2);
- // CsarValidationUtils.validateToscaDefinitonObjectVsResource(toscaDefinition2,
- // resource2);
-
- // Csar csar = parserTocsarObject(csarUUID);
- // validateCsarVsResourceObj(csar, resource);
- // csar.node_types();
-
- }
-
- @Test // (enabled = false)
- public void UpdateCsarWithSameCsar() throws Exception {
-
- // User sdncModifierDetails =
- // ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- // RestResponse copyRes =
- // copyCsarRest(sdncModifierDetails,"VF_RI2_G4_withArtifacts_a.csar","VF_RI2_G4_withArtifacts.csar");
- // BaseRestUtils.checkSuccess(copyRes);
- String csarUUID = "VF_RI2_G4_withArtifacts.csar";
-
- ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
- resourceDetails.setCsarUUID(csarUUID);
- resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
- RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- BaseRestUtils.checkCreateResponse(createResource);
- Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
-
- resourceDetails.setName(resource.getName());
- RestResponse createResource2 = ResourceRestUtils.createResource(resourceDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- BaseRestUtils.checkCreateResponse(createResource2);
- Resource resource2 = ResponseParser.parseToObjectUsingMapper(createResource2.getResponse(), Resource.class);
-
- CsarValidationUtils.validateCsarVfArtifact(csarUUID, resource);
- ToscaDefinition toscaDefinition = ToscaParserUtils.getToscaDefinitionObjectByCsarUuid(csarUUID);
- CsarValidationUtils.validateToscaDefinitonObjectVsResource(toscaDefinition, resource);
-
- // CsarValidationUtils.validateCsarVfArtifact(csarUUID2, resource2);
- // ToscaDefinition toscaDefinition2 =
- // ToscaParserUtils.getToscaDefinitionObjectByCsarUuid(csarUUID2);
- // CsarValidationUtils.validateToscaDefinitonObjectVsResource(toscaDefinition2,
- // resource2);
-
- // Csar csar = parserTocsarObject(csarUUID);
- // validateCsarVsResourceObj(csar, resource);
- // csar.node_types();
-
- }
-
- @Test // (enabled = false)
- public void UpdateCsarCertifiedVfWithSameCsar() throws Exception {
-
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- RestResponse copyRes = copyCsarRest(sdncModifierDetails, "VF_RI2_G4_withArtifacts_a.csar",
- "VF_RI2_G4_withArtifacts.csar");
- BaseRestUtils.checkSuccess(copyRes);
- String csarUUID = "VF_RI2_G4_withArtifacts.csar";
-
- ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
- resourceDetails.setCsarUUID(csarUUID);
- resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
- RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- BaseRestUtils.checkCreateResponse(createResource);
- Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
- Pair<Component, RestResponse> changeComponentState = AtomicOperationUtils.changeComponentState(resource,
- UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
- resource = (Resource) changeComponentState.getLeft();
-
- resourceDetails.setName(resource.getName());
- RestResponse createResource2 = ResourceRestUtils.createResource(resourceDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- BaseRestUtils.checkCreateResponse(createResource2);
- Resource resource2 = ResponseParser.parseToObjectUsingMapper(createResource2.getResponse(), Resource.class);
-
- CsarValidationUtils.validateCsarVfArtifact(csarUUID, resource);
- ToscaDefinition toscaDefinition = ToscaParserUtils.getToscaDefinitionObjectByCsarUuid(csarUUID);
- CsarValidationUtils.validateToscaDefinitonObjectVsResource(toscaDefinition, resource);
-
- // CsarValidationUtils.validateCsarVfArtifact(csarUUID2, resource2);
- // ToscaDefinition toscaDefinition2 =
- // ToscaParserUtils.getToscaDefinitionObjectByCsarUuid(csarUUID2);
- // CsarValidationUtils.validateToscaDefinitonObjectVsResource(toscaDefinition2,
- // resource2);
-
- // Csar csar = parserTocsarObject(csarUUID);
- // validateCsarVsResourceObj(csar, resource);
- // csar.node_types();
-
- }
-
- @Test // (enabled = false)
- public void UpdateCsarDifferentTosca() throws Exception {
-
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- RestResponse copyRes = copyCsarRest(sdncModifierDetails, "VF_RI2_G4_withArtifacts_a.csar",
- "VF_RI2_G4_withArtifacts.csar");
- BaseRestUtils.checkSuccess(copyRes);
- String csarUUID = "VF_RI2_G4_withArtifacts.csar";
-
- ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
- resourceDetails.setCsarUUID(csarUUID);
- resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
- RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- BaseRestUtils.checkCreateResponse(createResource);
- Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
-
- copyRes = copyCsarRest(sdncModifierDetails, "VF_RI2_G4_withArtifactsUpdated.csar",
- "VF_RI2_G4_withArtifacts.csar");
- BaseRestUtils.checkSuccess(copyRes);
-
- resourceDetails.setName(resource.getName());
- RestResponse createResource2 = ResourceRestUtils.createResource(resourceDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- BaseRestUtils.checkCreateResponse(createResource2);
- Resource resource2 = ResponseParser.parseToObjectUsingMapper(createResource2.getResponse(), Resource.class);
-
- CsarValidationUtils.validateCsarVfArtifact(csarUUID, resource);
- ToscaDefinition toscaDefinition = ToscaParserUtils.getToscaDefinitionObjectByCsarUuid(csarUUID);
- CsarValidationUtils.validateToscaDefinitonObjectVsResource(toscaDefinition, resource);
-
- // CsarValidationUtils.validateCsarVfArtifact(csarUUID2, resource2);
- // ToscaDefinition toscaDefinition2 =
- // ToscaParserUtils.getToscaDefinitionObjectByCsarUuid(csarUUID2);
- // CsarValidationUtils.validateToscaDefinitonObjectVsResource(toscaDefinition2,
- // resource2);
-
- // Csar csar = parserTocsarObject(csarUUID);
- // validateCsarVsResourceObj(csar, resource);
- // csar.node_types();
-
- }
-
- @Test // (enabled = false)
- public void UpdateCsarDifferentToscaAndArtifacts() throws Exception {
-
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- RestResponse copyRes = copyCsarRest(sdncModifierDetails, "VF_RI2_G4_withArtifacts_a.csar",
- "VF_RI2_G4_withArtifacts.csar");
- BaseRestUtils.checkSuccess(copyRes);
- String csarUUID = "VF_RI2_G4_withArtifacts.csar";
-
- ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
- resourceDetails.setCsarUUID(csarUUID);
- resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
- RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- BaseRestUtils.checkCreateResponse(createResource);
- Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
-
- copyRes = copyCsarRest(sdncModifierDetails, "VF_RI2_G4_withArtifacts_UpdateToscaAndArtifacts.csar",
- "VF_RI2_G4_withArtifacts.csar");
- BaseRestUtils.checkSuccess(copyRes);
-
- resourceDetails.setName(resource.getName());
- RestResponse createResource2 = ResourceRestUtils.createResource(resourceDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- BaseRestUtils.checkCreateResponse(createResource2);
- Resource resource2 = ResponseParser.parseToObjectUsingMapper(createResource2.getResponse(), Resource.class);
-
- CsarValidationUtils.validateCsarVfArtifact(csarUUID, resource);
- ToscaDefinition toscaDefinition = ToscaParserUtils.getToscaDefinitionObjectByCsarUuid(csarUUID);
- CsarValidationUtils.validateToscaDefinitonObjectVsResource(toscaDefinition, resource);
-
- // CsarValidationUtils.validateCsarVfArtifact(csarUUID2, resource2);
- // ToscaDefinition toscaDefinition2 =
- // ToscaParserUtils.getToscaDefinitionObjectByCsarUuid(csarUUID2);
- // CsarValidationUtils.validateToscaDefinitonObjectVsResource(toscaDefinition2,
- // resource2);
-
- // Csar csar = parserTocsarObject(csarUUID);
- // validateCsarVsResourceObj(csar, resource);
- // csar.node_types();
-
- }
-
- @Test // (enabled = false)
- public void migration() throws Exception {
- String csarUUID = "VF_RI2_G4_withArtifacts";
- ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
- resourceDetails.setCsarUUID(csarUUID);
- resourceDetails.setName("Resource1");
- resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
- RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- BaseRestUtils.checkCreateResponse(createResource);
-
- resourceDetails.setName("Resource2");
- resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
- createResource = ResourceRestUtils.createResource(resourceDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- BaseRestUtils.checkCreateResponse(createResource);
- Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
- resource = (Resource) AtomicOperationUtils
- .changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- resource = (Resource) AtomicOperationUtils
- .changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- resource = (Resource) AtomicOperationUtils
- .changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- resource = (Resource) AtomicOperationUtils
- .changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
-
- resourceDetails.setName("Resource3");
- resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
- createResource = ResourceRestUtils.createResource(resourceDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- BaseRestUtils.checkCreateResponse(createResource);
- resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
- resource = (Resource) AtomicOperationUtils
- .changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- resource = (Resource) AtomicOperationUtils
- .changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- resource = (Resource) AtomicOperationUtils
- .changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- resourceDetails.setName("Resource4");
- resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
- createResource = ResourceRestUtils.createResource(resourceDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- BaseRestUtils.checkCreateResponse(createResource);
- resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
- resource = (Resource) AtomicOperationUtils
- .changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- resource = (Resource) AtomicOperationUtils
- .changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- resource = (Resource) AtomicOperationUtils
- .changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- resource = (Resource) AtomicOperationUtils
- .changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- resource = (Resource) AtomicOperationUtils
- .changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
-
- resourceDetails.setName("Resource5");
- resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
- createResource = ResourceRestUtils.createResource(resourceDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- BaseRestUtils.checkCreateResponse(createResource);
- resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
- resource = (Resource) AtomicOperationUtils
- .changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- resource = (Resource) AtomicOperationUtils
- .changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- resource = (Resource) AtomicOperationUtils
- .changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- resource = (Resource) AtomicOperationUtils
- .changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
-
- resourceDetails.setName("Resource6");
- resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
- createResource = ResourceRestUtils.createResource(resourceDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- BaseRestUtils.checkCreateResponse(createResource);
- resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
- resource = (Resource) AtomicOperationUtils
- .changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.STARTCERTIFICATION, true)
- .getLeft();
-
- resourceDetails.setName("Resource7");
- resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
- createResource = ResourceRestUtils.createResource(resourceDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- BaseRestUtils.checkCreateResponse(createResource);
- resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
- resource = (Resource) AtomicOperationUtils
- .changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- resource = (Resource) AtomicOperationUtils
- .changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFICATIONREQUEST, true)
- .getLeft();
-
- logger.debug("7 VF resources were created");
-
- }
-
- public static RestResponse copyCsarRest(User sdncModifierDetails, String sourceCsarUuid, String targetCsarUuid)
- throws Exception {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.COPY_CSAR_USING_SIMULATOR, config.getCatalogBeHost(), config.getCatalogBePort(),
- sourceCsarUuid, targetCsarUuid);
- String userId = sdncModifierDetails.getUserId();
- Map<String, String> headersMap = prepareHeadersMap(userId);
- HttpRequest http = new HttpRequest();
-
- RestResponse copyCsarResponse = http.httpSendPost(url, "dummy", headersMap);
- if (copyCsarResponse.getErrorCode() != 200) {
- return null;
- }
- return copyCsarResponse;
-
- }
-
- private static Map<String, String> prepareHeadersMap(String userId) {
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "application/json");
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), "application/json");
- if (userId != null) {
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), userId);
- }
- return headersMap;
- }
-
- public static void main(String[] args) throws Exception {
- // String csarUUID = "VF_RI2_G4_withArtifacts";
- String csarUUID = "node_types";
- ToscaParserUtils.getToscaDefinitionObjectByCsarUuid(csarUUID);
- }*/
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/test1.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/test1.java
deleted file mode 100644
index 49b13b587b..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/test1.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.devCI;
-
-import fj.data.Either;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.Component;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.model.Service;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.enums.*;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
-import org.openecomp.sdc.ci.tests.utils.validation.DistributionValidationUtils;
-import org.openecomp.sdc.externalApis.CRUDExternalAPI;
-import org.testng.annotations.Test;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
-public class test1 extends ComponentBaseTest{
-
- @Rule
- public static TestName name = new TestName();
-
- public test1() {
- super(name, CRUDExternalAPI.class.getName());
-
- }
-
- @Test()
- public void uploadArtifactOnServiceViaExternalAPI() throws Exception {
- Config config = Utils.getConfig();
-
- Service service = AtomicOperationUtils.createServiceByCategory(ServiceCategoriesEnum.MOBILITY, UserRoleEnum.DESIGNER, true).left().value();
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.MODEL_QUERY_SPEC, service, UserRoleEnum.DESIGNER, true, true);
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- if(config.getIsDistributionClientRunning()){
- List<String> distributionStatusList = Arrays.asList(DistributionNotificationStatusEnum.DOWNLOAD_OK.toString(), DistributionNotificationStatusEnum.DEPLOY_OK.toString(), DistributionNotificationStatusEnum.NOTIFIED.toString());
- DistributionValidationUtils.validateDistributedArtifactsByAudit(service, distributionStatusList);
- }
- }
-
-
- public static Map<String, String> addVNF_ModuleDeploymentArtifactToMap(Service service, Map<String, String> distributionArtifactMap){
-
-
- return distributionArtifactMap;
- }
-
- public Component getComponentInTargetLifeCycleState(String componentType, UserRoleEnum creatorUser, LifeCycleStatesEnum targetLifeCycleState) throws Exception {
- Component component = null;
-
- if(componentType.toLowerCase().equals("vf")) {
- Either<Resource, RestResponse> createdResource = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, creatorUser, true);
- component = createdResource.left().value();
- component = AtomicOperationUtils.changeComponentState(component, creatorUser, targetLifeCycleState, true).getLeft();
- } else {
- Either<Service, RestResponse> createdResource = AtomicOperationUtils.createDefaultService(creatorUser, true);
- component = createdResource.left().value();
- component = AtomicOperationUtils.changeComponentState(component, creatorUser, targetLifeCycleState, true).getLeft();
- }
-
- return component;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/distribution/AuthanticationTests.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/distribution/AuthanticationTests.java
deleted file mode 100644
index 7f97ca36be..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/distribution/AuthanticationTests.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.distribution;
-
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.datatypes.elements.ConsumerDataDefinition;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedAuthenticationAudit;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ConsumerRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
-import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
-import org.openecomp.sdc.common.api.Constants;
-import org.openecomp.sdc.common.util.ValidationUtils;
-import org.testng.AssertJUnit;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.DataProvider;
-import org.testng.annotations.Test;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import static org.testng.AssertJUnit.assertEquals;
-
-public class AuthanticationTests extends ComponentBaseTest {
-
- @Rule
- public static TestName name = new TestName();
- protected ResourceReqDetails resourceDetails;
- protected ServiceReqDetails serviceDetails;
- protected User sdncUserDetails;
-
- protected static final String AUTH_SUCCESS = "AUTH_SUCCESS";
-
- protected static final String AUTH_REQUIRED = "AUTH_REQUIRED";
-
- // user ci password 123456
- // protected final String authorizationHeader = "Basic Y2k6MTIzNDU2";
- // user ci password 123456
- protected final String USER = "ci";
- protected final String PASSWORD = "123456";
- protected final String SALT = "2a1f887d607d4515d4066fe0f5452a50";
- protected final String HASHED_PASSWORD = "0a0dc557c3bf594b1a48030e3e99227580168b21f44e285c69740b8d5b13e33b";
- protected User sdncAdminUserDetails;
- protected ConsumerDataDefinition consumerDataDefinition;
-
- public AuthanticationTests() {
- super(name, AuthanticationTests.class.getName());
- }
-
- @DataProvider
- private final Object[][] getServiceDepArtType() throws IOException, Exception {
- return new Object[][] { { ArtifactTypeEnum.YANG_XML.getType() }, { ArtifactTypeEnum.OTHER.getType() } };
- }
-
- @BeforeMethod
- public void setup() throws Exception {
- resourceDetails = ElementFactory.getDefaultResource();
- serviceDetails = ElementFactory.getDefaultService();
- sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- sdncAdminUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-
- createComponents();
- consumerDataDefinition = createConsumer();
- RestResponse deleteResponse = ConsumerRestUtils.deleteConsumer(consumerDataDefinition, sdncAdminUserDetails);
- BaseRestUtils.checkStatusCode(deleteResponse, "delete operation filed", false, 404, 200);
- ;
-
- RestResponse createResponse = ConsumerRestUtils.createConsumer(consumerDataDefinition, sdncAdminUserDetails);
- BaseRestUtils.checkCreateResponse(createResponse);
-
- }
-
- @AfterMethod
- public void tearDown() throws Exception {
- RestResponse deleteResponse = ConsumerRestUtils.deleteConsumer(consumerDataDefinition, sdncAdminUserDetails);
- BaseRestUtils.checkStatusCode(deleteResponse, "delete operation filed", false, 404, 200);
- ;
-
- }
-
- protected ConsumerDataDefinition createConsumer() {
- ConsumerDataDefinition consumer = new ConsumerDataDefinition();
- consumer.setConsumerName(USER);
- consumer.setConsumerSalt(SALT);
- consumer.setConsumerPassword(HASHED_PASSWORD);
- return consumer;
-
- }
-
- protected void createComponents() throws Exception {
- RestResponse response = ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
- ServiceRestUtils.checkCreateResponse(response);
- }
-
- @Test(dataProvider = "getServiceDepArtType", description = "mumu")
- public void downloadServiceArtifactSuccessWithAutantication(String serviceDepArtType) throws Exception {
- String serviceUniqueId = serviceDetails.getUniqueId();
-
- ArtifactReqDetails artifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(serviceDepArtType);
-
- RestResponse addArtifactResponse = ArtifactRestUtils.addInformationalArtifactToService(artifactDetails,
- sdncUserDetails, serviceUniqueId, ArtifactRestUtils.calculateChecksum(artifactDetails));
- AssertJUnit.assertEquals("Check response code after adding interface artifact", 200,
- addArtifactResponse.getErrorCode().intValue());
-
- String artifactName = ValidationUtils.normalizeFileName(artifactDetails.getArtifactName());
- // Thread.sleep(5000);
- Map<String, String> authorizationHeaders = BaseRestUtils.addAuthorizeHeader(USER, PASSWORD);
- RestResponse restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceDetails, artifactDetails,
- sdncUserDetails, authorizationHeaders);
- AssertJUnit.assertEquals("Check response code after download resource", 200,
- restResponse.getErrorCode().intValue());
-
- List<String> contDispHeaderList = restResponse.getHeaderFields().get(Constants.CONTENT_DISPOSITION_HEADER);
- AssertJUnit.assertNotNull(contDispHeaderList);
- AssertJUnit.assertEquals("Check content disposition header",
- new StringBuilder().append("attachment; filename=\"").append(artifactName).append("\"").toString(),
- contDispHeaderList.get(0));
-
- String downloadUrl = ArtifactRestUtils
- .getPartialUrlByArtifactName(serviceDetails, serviceDetails.getVersion(), artifactName).substring(6);
-
- ExpectedAuthenticationAudit expectedAuthenticationAudit = new ExpectedAuthenticationAudit(downloadUrl, USER,
- AuditingActionEnum.AUTH_REQUEST.getName(), AUTH_SUCCESS);
- AuditValidationUtils.validateAuthenticationAudit(expectedAuthenticationAudit);
- }
-
- @Test(dataProvider = "getServiceDepArtType")
- public void downloadServiceArtifactWithOutAutantication(String serviceDepArtType) throws Exception {
- String serviceUniqueId = serviceDetails.getUniqueId();
-
- ArtifactReqDetails artifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(serviceDepArtType);
-
- RestResponse addArtifactResponse = ArtifactRestUtils.addInformationalArtifactToService(artifactDetails,
- sdncUserDetails, serviceUniqueId, ArtifactRestUtils.calculateChecksum(artifactDetails));
- assertEquals("Check response code after adding interface artifact", 200,
- addArtifactResponse.getErrorCode().intValue());
-
- Map<String, String> authorizationHeaders = new HashMap<String, String>();
- RestResponse restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceDetails, artifactDetails,
- sdncUserDetails, authorizationHeaders);
- assertEquals("Check response code after download resource failure", 401,
- restResponse.getErrorCode().intValue());
-
- String downloadUrl = ArtifactRestUtils.getPartialUrlByArtifactName(serviceDetails, serviceDetails.getVersion(),
- artifactDetails.getArtifactName()).substring(6);
- ExpectedAuthenticationAudit expectedAuthenticationAudit = new ExpectedAuthenticationAudit(downloadUrl, "",
- AuditingActionEnum.AUTH_REQUEST.getName(), AUTH_REQUIRED);
- AuditValidationUtils.validateAuthenticationAudit(expectedAuthenticationAudit);
-
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/distribution/DistributionDownloadArtifactTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/distribution/DistributionDownloadArtifactTest.java
deleted file mode 100644
index 7ddddc1628..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/distribution/DistributionDownloadArtifactTest.java
+++ /dev/null
@@ -1,529 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.distribution;
-
-import org.apache.commons.codec.binary.Base64;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.datatypes.elements.ConsumerDataDefinition;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.ArtifactDefinition;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
-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.expected.ExpectedDistDownloadAudit;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.*;
-import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
-import org.openecomp.sdc.common.api.Constants;
-import org.openecomp.sdc.common.util.GeneralUtility;
-import org.openecomp.sdc.common.util.ValidationUtils;
-import org.testng.AssertJUnit;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.zip.ZipInputStream;
-
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertNotNull;
-
-public class DistributionDownloadArtifactTest extends ComponentBaseTest {
-
- protected static ResourceReqDetails resourceDetails;
- protected static User designerUser;
- protected static User adminUser;
- protected static String resourceBaseVersion;
- // user ci password 123456
- protected final String authorizationHeader = "Basic Y2k6MTIzNDU2";
- protected ConsumerDataDefinition consumerDataDefinition;
-
- @Rule
- public static TestName name = new TestName();
- protected static String artifactInterfaceType;
- protected static String artifactOperationName;
-
- protected static ServiceReqDetails serviceDetails;
- protected static String serviceBaseVersion;
- protected static String serviceUniqueId;
- protected final String USER = "ci";
- protected final String PASSWORD = "123456";
- protected final String SALT = "2a1f887d607d4515d4066fe0f5452a50";
- protected final String HASHED_PASSWORD = "0a0dc557c3bf594b1a48030e3e99227580168b21f44e285c69740b8d5b13e33b";
-
- public DistributionDownloadArtifactTest() {
- super(name, DistributionDownloadArtifactTest.class.getName());
- }
-
- // @BeforeClass
- // public static void InitBeforeTest() throws Exception
- // {
- //
- //
- // resourceBaseVersion = "0.1";
- // serviceBaseVersion = "0.1";
- // designerUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- // adminUser = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- // resourceDetails =
- // ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
- // NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS,
- // adminUser);
- // serviceDetails = ElementFactory.getDefaultService();
- // serviceUniqueId = "svc_" + serviceDetails.getName().toLowerCase() + "." +
- // serviceBaseVersion;
- // artifactInterfaceType = "standard";
- // artifactOperationName = "start";
- // }
-
- @BeforeMethod
- public void setup() throws Exception {
-
- resourceBaseVersion = "0.1";
- serviceBaseVersion = "0.1";
- designerUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- adminUser = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- resourceDetails = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
- NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, adminUser);
- serviceDetails = ElementFactory.getDefaultService();
- serviceUniqueId = "svc_" + serviceDetails.getName().toLowerCase() + "." + serviceBaseVersion;
- artifactInterfaceType = "standard";
- artifactOperationName = "start";
- consumerDataDefinition = createConsumer();
- RestResponse deleteResponse = ConsumerRestUtils.deleteConsumer(consumerDataDefinition, adminUser);
- BaseRestUtils.checkStatusCode(deleteResponse, "delete operation filed", false, 404, 200);
-
- RestResponse createResponse = ConsumerRestUtils.createConsumer(consumerDataDefinition, adminUser);
- BaseRestUtils.checkCreateResponse(createResponse);
- }
-
- @Test
- public void downloadResourceArtifactSuccess() throws Exception {
- // Create service
- RestResponse serviceResponse = ServiceRestUtils.createService(serviceDetails, designerUser);
- AssertJUnit.assertEquals("Check response code after creating resource", 201,
- serviceResponse.getErrorCode().intValue());
-
- // Create resource
- RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, designerUser);
- AssertJUnit.assertEquals("Check response code after creating resource", 201,
- createResource.getErrorCode().intValue());
- Resource resource = ResponseParser.convertResourceResponseToJavaObject(createResource.getResponse());
-
- ArtifactReqDetails artifactDetails = ElementFactory
- .getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
- // Setting the name to be with space
- artifactDetails.setArtifactName("test artifact file.yaml");
- // artifactDetails.set(ArtifactRestUtils.calculateChecksum(artifactDetails));
-
- RestResponse addArtifactResponse = ArtifactRestUtils.addInformationalArtifactToResource(artifactDetails,
- designerUser, resource.getUniqueId(), ArtifactRestUtils.calculateChecksum(artifactDetails));
- AssertJUnit.assertEquals("Check response code after adding interface artifact", 200,
- addArtifactResponse.getErrorCode().intValue());
-
- // Getting expected artifact checksum
- ArtifactDefinition artifactResp = ResponseParser
- .convertArtifactDefinitionResponseToJavaObject(addArtifactResponse.getResponse());
- String expectedPayloadChecksum = artifactResp.getArtifactChecksum();
-
- Config config = Utils.getConfig();
- String relativeUrl = encodeUrlForDownload(String.format(Urls.DISTRIB_DOWNLOAD_RESOURCE_ARTIFACT_RELATIVE_URL,
- ValidationUtils.convertToSystemName(serviceDetails.getName()), serviceBaseVersion,
- ValidationUtils.convertToSystemName(resource.getName()), resource.getVersion(),
- artifactResp.getArtifactName()));
- // String fullUrlFormatted =
- // String.format(Urls.DOWNLOAD_RESOURCE_ARTIFACT_FULL_URL,
- // config.getCatalogBeHost(),config.getCatalogBePort(), relativeUrl);
- // String consumerId = "dummy.ecomp";
-
- ResourceReqDetails resourceInfo = new ResourceReqDetails();
- resourceInfo.setName(resource.getName());
- resourceInfo.setVersion(resource.getVersion());
-
- Map<String, String> authorizationHeaders = new HashMap<String, String>();
- authorizationHeaders.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader);
- RestResponse restResponse = ArtifactRestUtils.downloadResourceArtifact(serviceDetails, resourceInfo,
- artifactDetails, designerUser, authorizationHeaders);
- // RestResponse restResponse =
- // artifactUtils.downloadResourceArtifact(designerUser,fullUrlFormatted,
- // consumerId,true);
- AssertJUnit.assertEquals("Check response code after download resource", 200,
- restResponse.getErrorCode().intValue());
-
- // Validating headers
- // content disposition
- List<String> contDispHeaderList = restResponse.getHeaderFields().get(Constants.CONTENT_DISPOSITION_HEADER);
- AssertJUnit.assertNotNull(contDispHeaderList);
- AssertJUnit
- .assertEquals(
- "Check content disposition header", new StringBuilder().append("attachment; filename=\"")
- .append(artifactResp.getArtifactName()).append("\"").toString(),
- contDispHeaderList.get(0));
-
- // content type
- List<String> contTypeHeaderList = restResponse.getHeaderFields().get(Constants.CONTENT_TYPE_HEADER);
- AssertJUnit.assertNotNull(contTypeHeaderList);
- AssertJUnit.assertEquals("Check content type", "application/octet-stream", contTypeHeaderList.get(0));
-
- String actualContents = restResponse.getResponse();
-
- // Contents - comparing decoded content
- AssertJUnit.assertEquals(artifactDetails.getPayload(), Base64.encodeBase64String(actualContents.getBytes()));
-
- // validating checksum
- String actualPayloadChecksum = GeneralUtility.calculateMD5Base64EncodedByByteArray(actualContents.getBytes());
- AssertJUnit.assertEquals(expectedPayloadChecksum, actualPayloadChecksum);
-
- // validate audit
- String auditAction = "DArtifactDownload";
-
- ExpectedDistDownloadAudit expectedDistDownloadAudit = new ExpectedDistDownloadAudit(auditAction,
- BaseRestUtils.ecomp, relativeUrl, "200", "OK");
- AuditValidationUtils.validateAudit(expectedDistDownloadAudit, auditAction);
- }
-
- protected void download_serviceNameNotFound_inner(String serviceName, String serviceVersion, String resourceName,
- String resourceVersion) throws Exception {
- Config config = Utils.getConfig();
- String artifactName = "kuku";
- ArtifactReqDetails artifact = new ArtifactReqDetails();
- artifact.setArtifactName(artifactName);
- String relativeUrl;
- Map<String, String> authorizationHeaders = new HashMap<String, String>();
- authorizationHeaders.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader);
- ServiceReqDetails serviceInfo = new ServiceReqDetails();
- serviceInfo.setName(serviceName);
- serviceInfo.setVersion(serviceVersion);
- RestResponse restResponse = null;
- if (resourceName != null) {
- ResourceReqDetails resourceDetailes = new ResourceReqDetails();
- resourceDetailes.setName(resourceName);
- resourceDetailes.setVersion(resourceVersion);
- relativeUrl = encodeUrlForDownload(String.format(Urls.DISTRIB_DOWNLOAD_RESOURCE_ARTIFACT_RELATIVE_URL,
- ValidationUtils.convertToSystemName(serviceName), serviceVersion,
- ValidationUtils.convertToSystemName(resourceName), resourceVersion, artifactName));
- restResponse = ArtifactRestUtils.downloadResourceArtifact(serviceInfo, resourceDetailes, artifact,
- designerUser, authorizationHeaders);
- } else {
- relativeUrl = encodeUrlForDownload(String.format(Urls.DISTRIB_DOWNLOAD_SERVICE_ARTIFACT_RELATIVE_URL,
- ValidationUtils.convertToSystemName(serviceName), serviceVersion, artifactName));
- restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceInfo, artifact, designerUser,
- authorizationHeaders);
- }
-
- // RestResponse restResponse =
- // artifactUtils.downloadResourceArtifact(designerUser,fullUrlFormatted,
- // consumerId,true);
- AssertJUnit.assertEquals("Check response code after download resource", 404,
- restResponse.getErrorCode().intValue());
-
- // validate audit
- String auditAction = "DArtifactDownload";
-
- ExpectedDistDownloadAudit expectedDistDownloadAudit = new ExpectedDistDownloadAudit(auditAction,
- BaseRestUtils.ecomp, relativeUrl, "404", "SVC4503: Error: Requested '"
- + ValidationUtils.convertToSystemName(serviceName) + "' service was not found.");
- AuditValidationUtils.validateAudit(expectedDistDownloadAudit, auditAction);
- }
-
- protected void download_serviceVersionNotFound_inner(String serviceName, String serviceVersion, String resourceName,
- String resourceVersion) throws Exception {
- Config config = Utils.getConfig();
- String artifactName = "kuku";
- String relativeUrl;
- ArtifactReqDetails artifact = new ArtifactReqDetails();
- artifact.setArtifactName(artifactName);
- Map<String, String> authorizationHeaders = new HashMap<String, String>();
- authorizationHeaders.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader);
- ServiceReqDetails serviceInfo = new ServiceReqDetails();
- serviceInfo.setName(serviceName);
- serviceInfo.setVersion(serviceVersion);
- RestResponse restResponse = null;
- if (resourceName != null) {
- ResourceReqDetails resourceDetailes = new ResourceReqDetails();
- resourceDetailes.setName(resourceName);
- resourceDetailes.setVersion(resourceVersion);
- relativeUrl = encodeUrlForDownload(String.format(Urls.DISTRIB_DOWNLOAD_RESOURCE_ARTIFACT_RELATIVE_URL,
- ValidationUtils.convertToSystemName(serviceName), serviceVersion,
- ValidationUtils.convertToSystemName(resourceName), resourceVersion, artifactName));
- restResponse = ArtifactRestUtils.downloadResourceArtifact(serviceInfo, resourceDetailes, artifact,
- designerUser, authorizationHeaders);
- } else {
- relativeUrl = encodeUrlForDownload(String.format(Urls.DISTRIB_DOWNLOAD_SERVICE_ARTIFACT_RELATIVE_URL,
- ValidationUtils.convertToSystemName(serviceName), serviceVersion, artifactName));
- restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceInfo, artifact, designerUser,
- authorizationHeaders);
- }
- // String fullUrlFormatted =
- // String.format(Urls.DOWNLOAD_RESOURCE_ARTIFACT_FULL_URL,
- // config.getCatalogBeHost(),config.getCatalogBePort(), relativeUrl);
- // String consumerId = "dummy.ecomp";
-
- // RestResponse restResponse =
- // artifactUtils.downloadResourceArtifact(designerUser,fullUrlFormatted,
- // consumerId,true);
- AssertJUnit.assertEquals("Check response code after download resource", 404,
- restResponse.getErrorCode().intValue());
-
- // validate audit
- String auditAction = "DArtifactDownload";
-
- ExpectedDistDownloadAudit expectedDistDownloadAudit = new ExpectedDistDownloadAudit(auditAction,
- BaseRestUtils.ecomp, relativeUrl, "404",
- "SVC4504: Error: Service version " + serviceVersion + " was not found.");
- AuditValidationUtils.validateAudit(expectedDistDownloadAudit, auditAction);
- }
-
- protected String encodeUrlForDownload(String url) {
- return url.replaceAll(" ", "%20");
- }
-
- protected ConsumerDataDefinition createConsumer() {
- ConsumerDataDefinition consumer = new ConsumerDataDefinition();
- consumer.setConsumerName(USER);
- consumer.setConsumerSalt(SALT);
- consumer.setConsumerPassword(HASHED_PASSWORD);
- return consumer;
-
- }
-
- @Test(enabled = true)
- public void downloadServiceArtifactSuccess() throws Exception {
- // Create service
- RestResponse serviceResponse = ServiceRestUtils.createService(serviceDetails, designerUser);
- assertEquals("Check response code after creating resource", 201, serviceResponse.getErrorCode().intValue());
- serviceUniqueId = ResponseParser.convertServiceResponseToJavaObject(serviceResponse.getResponse())
- .getUniqueId();
-
- ArtifactReqDetails artifactDetails = ElementFactory.getDefaultDeploymentArtifactForType("MURANO_PKG");
-
- RestResponse addArtifactResponse = ArtifactRestUtils.addInformationalArtifactToService(artifactDetails,
- designerUser, serviceUniqueId, ArtifactRestUtils.calculateMD5Header(artifactDetails));
- assertEquals("Check response code after adding interface artifact", 200,
- addArtifactResponse.getErrorCode().intValue());
-
- // Getting expected artifact checksum
-
- // ArtifactResJavaObject artifactResp =
- // artifactUtils.parseInformationalArtifactResp(addArtifactResponse);
- String expectedPayloadChecksum = ResponseParser
- .convertArtifactDefinitionResponseToJavaObject(addArtifactResponse.getResponse()).getArtifactChecksum();
-
- String artifactName = ValidationUtils.normalizeFileName(artifactDetails.getArtifactName());
-
- String relativeUrl = encodeUrlForDownload(String.format(Urls.DISTRIB_DOWNLOAD_SERVICE_ARTIFACT_RELATIVE_URL,
- ValidationUtils.convertToSystemName(serviceDetails.getName()), serviceBaseVersion, artifactName));
-
- Map<String, String> authorizationHeaders = new HashMap<String, String>();
- authorizationHeaders.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader);
- RestResponse restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceDetails, artifactDetails,
- designerUser, authorizationHeaders);
- assertEquals("Check response code after download resource", 200, restResponse.getErrorCode().intValue());
-
- // Validating headers
- // content disposition
- List<String> contDispHeaderList = restResponse.getHeaderFields().get(Constants.CONTENT_DISPOSITION_HEADER);
- assertNotNull(contDispHeaderList);
- assertEquals("Check content disposition header",
- new StringBuilder().append("attachment; filename=\"").append(artifactName).append("\"").toString(),
- contDispHeaderList.get(0));
-
- // content type
- List<String> contTypeHeaderList = restResponse.getHeaderFields().get(Constants.CONTENT_TYPE_HEADER);
- assertNotNull(contTypeHeaderList);
- assertEquals("Check content type", "application/octet-stream", contTypeHeaderList.get(0));
-
- String actualContents = restResponse.getResponse();
-
- assertEquals(artifactDetails.getPayload(), Base64.encodeBase64String(actualContents.getBytes()));
-
- // validating checksum
- byte[] bytes = actualContents.getBytes();
- String actualPayloadChecksum = GeneralUtility.calculateMD5Base64EncodedByByteArray(bytes);
- assertEquals(expectedPayloadChecksum, actualPayloadChecksum);
-
- // validating valid zip
- InputStream is = new ByteArrayInputStream(bytes);
- InputStream zis = new ZipInputStream(is);
- zis.close();
-
- // validate audit
- String auditAction = "DArtifactDownload";
-
- ExpectedDistDownloadAudit expectedDistDownloadAudit = new ExpectedDistDownloadAudit(auditAction,
- ResourceRestUtils.ecomp, encodeUrlForDownload(relativeUrl), "200", "OK");
- AuditValidationUtils.validateAudit(expectedDistDownloadAudit, auditAction);
- }
-
- @Test
- public void downloadResourceArtifact_NoConsumerId() throws Exception {
-
- String artifactName = "kuku";
- ArtifactReqDetails artifact = new ArtifactReqDetails();
- artifact.setArtifactName(artifactName);
- ResourceReqDetails resource = new ResourceReqDetails();
- resource.setName("notExisting");
- resource.setVersion("0.1");
- String relativeUrl = encodeUrlForDownload(String.format(Urls.DISTRIB_DOWNLOAD_RESOURCE_ARTIFACT_RELATIVE_URL,
- ValidationUtils.convertToSystemName(serviceDetails.getName()), serviceBaseVersion,
- ValidationUtils.convertToSystemName(resource.getName()), resource.getVersion(), artifactName));
- serviceDetails.setVersion("0.1");
- Map<String, String> authorizationHeaders = new HashMap<String, String>();
- authorizationHeaders.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader);
- RestResponse restResponse = ArtifactRestUtils.downloadResourceArtifact(serviceDetails, resource, artifact,
- designerUser, authorizationHeaders, false);
- assertEquals("Check response code after download resource", 400, restResponse.getErrorCode().intValue());
-
- // validate audit
- String auditAction = "DArtifactDownload";
-
- ExpectedDistDownloadAudit expectedDistDownloadAudit = new ExpectedDistDownloadAudit(auditAction, "",
- relativeUrl, "400", "POL5001: Error: Missing 'X-ECOMP-InstanceID' HTTP header.");
- AuditValidationUtils.validateAudit(expectedDistDownloadAudit, auditAction);
- }
-
- @Test
- public void downloadResourceArtifact_ResourceNameNotFound() throws Exception {
-
- String artifactName = "kuku";
- ArtifactReqDetails artifact = new ArtifactReqDetails();
- artifact.setArtifactName(artifactName);
- ResourceReqDetails resource = new ResourceReqDetails();
- resource.setName("notExisting");
- resource.setVersion("0.1");
- serviceDetails.setVersion("0.1");
- String relativeUrl = encodeUrlForDownload(String.format(Urls.DISTRIB_DOWNLOAD_RESOURCE_ARTIFACT_RELATIVE_URL,
- ValidationUtils.convertToSystemName(serviceDetails.getName()), serviceDetails.getVersion(),
- ValidationUtils.convertToSystemName(resource.getName()), resource.getVersion(), artifactName));
-
- Map<String, String> authorizationHeaders = new HashMap<String, String>();
- authorizationHeaders.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader);
- RestResponse restResponse = ArtifactRestUtils.downloadResourceArtifact(serviceDetails, resource, artifact,
- designerUser, authorizationHeaders);
-
- assertEquals("Check response code after download resource", 404, restResponse.getErrorCode().intValue());
-
- // validate audit
- String auditAction = "DArtifactDownload";
-
- ExpectedDistDownloadAudit expectedDistDownloadAudit = new ExpectedDistDownloadAudit(auditAction,
- BaseRestUtils.ecomp, relativeUrl, "404",
- "SVC4063: Error: Requested 'Notexisting' resource was not found.");
- AuditValidationUtils.validateAudit(expectedDistDownloadAudit, auditAction);
- }
-
- @Test
- public void downloadResourceArtifact_ResourceVersionNotFound() throws Exception {
- RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, designerUser);
- assertEquals("Check response code after creating resource", 201, createResource.getErrorCode().intValue());
-
- Resource resource = ResponseParser.convertResourceResponseToJavaObject(createResource.getResponse());
- ResourceReqDetails resourceDetailes = new ResourceReqDetails();
- resourceDetailes.setName(resource.getName());
- resourceDetailes.setVersion("0.2");
-
- serviceDetails.setVersion("0.1");
-
- String artifactName = "kuku";
- ArtifactReqDetails artifact = new ArtifactReqDetails();
- artifact.setArtifactName(artifactName);
-
- String relativeUrl = encodeUrlForDownload(String.format(Urls.DISTRIB_DOWNLOAD_RESOURCE_ARTIFACT_RELATIVE_URL,
- ValidationUtils.convertToSystemName(serviceDetails.getName()), serviceBaseVersion,
- ValidationUtils.convertToSystemName(resourceDetailes.getName()), resourceDetailes.getVersion(),
- artifactName));
-
- Map<String, String> authorizationHeaders = new HashMap<String, String>();
- authorizationHeaders.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader);
- RestResponse restResponse = ArtifactRestUtils.downloadResourceArtifact(serviceDetails, resourceDetailes,
- artifact, designerUser, authorizationHeaders);
- assertEquals("Check response code after download resource", 404, restResponse.getErrorCode().intValue());
-
- // validate audit
- String auditAction = "DArtifactDownload";
-
- ExpectedDistDownloadAudit expectedDistDownloadAudit = new ExpectedDistDownloadAudit(auditAction,
- BaseRestUtils.ecomp, relativeUrl, "404", "SVC4504: Error: Resource version 0.2 was not found.");
- AuditValidationUtils.validateAudit(expectedDistDownloadAudit, auditAction);
- }
-
- @Test
- public void downloadResourceArtifact_ServiceNameNotFound() throws Exception {
- // Create resource
- RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, designerUser);
- assertEquals("Check response code after creating resource", 201, createResource.getErrorCode().intValue());
- Resource resource = ResponseParser.convertResourceResponseToJavaObject(createResource.getResponse());
- download_serviceNameNotFound_inner("notExistingServiceName", serviceBaseVersion, resource.getName(),
- resource.getVersion());
-
- }
-
- @Test
- public void downloadResourceArtifact_ServiceVersionNotFound() throws Exception {
- // Create resource
- RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, designerUser);
- assertEquals("Check response code after creating resource", 201, createResource.getErrorCode().intValue());
- Resource resource = ResponseParser.convertResourceResponseToJavaObject(createResource.getResponse());
-
- // Create service
- RestResponse serviceResponse = ServiceRestUtils.createService(serviceDetails, designerUser);
- assertEquals("Check response code after creating resource", 201, serviceResponse.getErrorCode().intValue());
- serviceUniqueId = ResponseParser.convertServiceResponseToJavaObject(serviceResponse.getResponse())
- .getUniqueId();
-
- download_serviceVersionNotFound_inner(serviceDetails.getName(), "0.3", resource.getName(),
- resource.getVersion());
- }
-
- @Test
- public void downloadServiceArtifact_ServiceNameNotFound() throws Exception {
- download_serviceNameNotFound_inner("notExistingServiceName", serviceBaseVersion, null, null);
-
- }
-
- @Test
- public void downloadServiceArtifact_ServiceVersionNotFound() throws Exception {
-
- // Create service
- RestResponse serviceResponse = ServiceRestUtils.createService(serviceDetails, designerUser);
- assertEquals("Check response code after creating resource", 201, serviceResponse.getErrorCode().intValue());
- serviceUniqueId = ResponseParser.convertServiceResponseToJavaObject(serviceResponse.getResponse())
- .getUniqueId();
-
- download_serviceVersionNotFound_inner(serviceDetails.getName(), "0.2", null, null);
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/externalapi/DownloadArtifactsTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/externalapi/DownloadArtifactsTest.java
deleted file mode 100644
index e49c912ef4..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/externalapi/DownloadArtifactsTest.java
+++ /dev/null
@@ -1,360 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.externalapi;
-
-import com.google.gson.Gson;
-import org.apache.commons.codec.binary.Base64;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.*;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.datatypes.*;
-import org.openecomp.sdc.ci.tests.datatypes.enums.*;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.*;
-import org.testng.Assert;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import static org.testng.AssertJUnit.*;
-
-public class DownloadArtifactsTest extends ComponentBaseTest {
- @Rule
- public static TestName name = new TestName();
-
- Gson gson = new Gson();
-
- public DownloadArtifactsTest() {
- super(name, DownloadArtifactsTest.class.getName());
- }
-
- private User sdncDesignerDetails;
- private User sdncAdminDetails;
- private ImportReqDetails resourceDetailsVF_01;
- private ResourceReqDetails resourceDetailsVF_02;
- private ResourceReqDetails resourceDetailsVF_03;
- private ResourceReqDetails resourceDetailsCP_01;
- private ServiceReqDetails serviceDetails_01;
- private ServiceReqDetails serviceDetails_02;
- public static String rootPath = System.getProperty("user.dir");
-
- @BeforeMethod(alwaysRun = true)
- public void before() throws Exception {
- init();
- createComponents();
- }
-
- private void createComponents() throws Exception {
- createAtomicResource(resourceDetailsCP_01);
- importVfWithArtifacts(resourceDetailsVF_01);
- createVF(resourceDetailsVF_03);
- createVF(resourceDetailsVF_02);
- createService(serviceDetails_01);
- }
-
- public void init() {
- sdncDesignerDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- sdncAdminDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- resourceDetailsVF_01 = ElementFactory.getDefaultImportResourceByType("VF100", NormativeTypesEnum.ROOT,
- ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, sdncDesignerDetails.getUserId(),
- ResourceTypeEnum.VF.toString());
- resourceDetailsVF_02 = ElementFactory.getDefaultResourceByType("VF200", NormativeTypesEnum.ROOT,
- ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, sdncDesignerDetails.getUserId(),
- ResourceTypeEnum.VF.toString());
- resourceDetailsVF_03 = ElementFactory.getDefaultResourceByType("VF300", NormativeTypesEnum.ROOT,
- ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, sdncDesignerDetails.getUserId(),
- ResourceTypeEnum.VF.toString());
- resourceDetailsCP_01 = ElementFactory.getDefaultResourceByType("CP100", NormativeTypesEnum.PORT,
- ResourceCategoryEnum.GENERIC_NETWORK_ELEMENTS, sdncDesignerDetails.getUserId(),
- ResourceTypeEnum.CP.toString());
- serviceDetails_01 = ElementFactory.getDefaultService("newtestservice1", ServiceCategoriesEnum.MOBILITY,
- sdncDesignerDetails.getUserId(),
- ServiceInstantiationType.A_LA_CARTE.getValue());
- serviceDetails_02 = ElementFactory.getDefaultService("newtestservice2", ServiceCategoriesEnum.MOBILITY,
- sdncDesignerDetails.getUserId(),
- ServiceInstantiationType.A_LA_CARTE.getValue());
- }
-
- @Test
- public void downloadResourceInstanceArtifactsFromServiceTest() throws Exception {
- Service service = createServiceWithRIsWithArtifacts();
- Map<String, ArtifactDefinition> deploymentArtifacts;
- List<ComponentInstance> resourceInstances = service.getComponentInstances();
- for (ComponentInstance ri : resourceInstances) {
- deploymentArtifacts = ri.getDeploymentArtifacts();
- for (ArtifactDefinition artifact : deploymentArtifacts.values()) {
- assertNotNull(downloadResourceInstanceArtifact(service, ri, artifact));
- }
- }
- }
-
- @Test
- public void downloadServiceArtifactsTest() throws Exception {
- Service service = createServiceWithArtifacts();
- Map<String, ArtifactDefinition> deploymentArtifacts = service.getDeploymentArtifacts();
- for (ArtifactDefinition artifact : deploymentArtifacts.values()) {
- assertNotNull(downloadServiceArtifact(service, artifact));
- }
-
- }
-
- private Service createServiceWithArtifacts() throws Exception {
-
- ArtifactReqDetails otherArtifactDetails = ElementFactory
- .getDefaultDeploymentArtifactForType(ArtifactTypeEnum.OTHER.getType());
-
- RestResponse addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(
- otherArtifactDetails, sdncDesignerDetails, serviceDetails_01.getUniqueId());
- assertTrue(
- "response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :"
- + addInformationalArtifactToService.getErrorCode(),
- addInformationalArtifactToService.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
-
- ArtifactReqDetails yangXmlArtifactDetails = ElementFactory
- .getDefaultDeploymentArtifactForType(ArtifactTypeEnum.YANG_XML.getType());
-
- addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(yangXmlArtifactDetails,
- sdncDesignerDetails, serviceDetails_01.getUniqueId());
- assertTrue(
- "response code is not BaseRestUtils.STATUS_CODE_SUCCESS, returned :"
- + addInformationalArtifactToService.getErrorCode(),
- addInformationalArtifactToService.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
- RestResponse createServiceResponse = ServiceRestUtils.getService(serviceDetails_01, sdncDesignerDetails);
- return ResponseParser.convertServiceResponseToJavaObject(createServiceResponse.getResponse());
- }
-
- private RestResponse downloadResourceInstanceArtifact(Service service, ComponentInstance ri,
- ArtifactDefinition artifact) throws Exception {
- String url = String.format(Urls.GET_DOWNLOAD_SERVICE_RI_ARTIFACT, "localhost", "8080", service.getUUID(),
- ri.getUniqueId(), artifact.getArtifactUUID());
- String userId = sdncDesignerDetails.getUserId();
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "application/json");
- headersMap.put(HttpHeaderEnum.CACHE_CONTROL.getValue(), "no-cache");
- headersMap.put(HttpHeaderEnum.AUTHORIZATION.getValue(), "Basic dGVzdDoxMjM0NTY=");
- headersMap.put("X-ECOMP-InstanceID", "test");
- if (userId != null) {
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), userId);
- }
- sendAuthorizationRequest();
- HttpRequest http = new HttpRequest();
- RestResponse response = http.httpSendGet(url, headersMap);
- if (response.getErrorCode() != 200 && response.getResponse().getBytes() == null
- && response.getResponse().getBytes().length == 0) {
- return null;
- }
- return response;
- }
-
- private RestResponse downloadServiceArtifact(Service service, ArtifactDefinition artifact) throws Exception {
- String url = String.format(Urls.GET_DOWNLOAD_SERVICE_ARTIFACT, "localhost", "8080", service.getUUID(),
- artifact.getArtifactUUID());
- String userId = sdncDesignerDetails.getUserId();
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "application/json");
- headersMap.put(HttpHeaderEnum.CACHE_CONTROL.getValue(), "no-cache");
- headersMap.put(HttpHeaderEnum.AUTHORIZATION.getValue(), "Basic dGVzdDoxMjM0NTY=");
- headersMap.put("X-ECOMP-InstanceID", "test");
- if (userId != null) {
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), userId);
- }
- sendAuthorizationRequest();
- HttpRequest http = new HttpRequest();
- RestResponse response = http.httpSendGet(url, headersMap);
- if (response.getErrorCode() != 200 && response.getResponse().getBytes() == null
- && response.getResponse().getBytes().length == 0) {
- return null;
- }
- return response;
-
- }
-
- private RestResponse sendAuthorizationRequest() throws IOException {
- String url = String.format(Urls.POST_AUTHORIZATION, "localhost", "8080");
- String userId = sdncAdminDetails.getUserId();
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "application/json");
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), "application/json");
- headersMap.put(HttpHeaderEnum.CACHE_CONTROL.getValue(), "no-cache");
- if (userId != null) {
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), userId);
- }
-
- HttpRequest http = new HttpRequest();
- RestResponse response = http.httpSendPost(url,
- "{\"consumerName\":\"test\",\"consumerPassword\":\"0a0dc557c3bf594b1a48030e3e99227580168b21f44e285c69740b8d5b13e33b\",\"consumerSalt\":\"2a1f887d607d4515d4066fe0f5452a50\"}",
- headersMap);
- if (response.getErrorCode() != 201) {
- return null;
- }
- return response;
- }
-
- private Service createServiceWithRIsWithArtifacts() throws Exception {
- serviceDetails_02.setUniqueId(serviceDetails_01.getUniqueId());
- createTreeCheckedinVFInstances();
- LifecycleRestUtils.changeResourceState(resourceDetailsCP_01, sdncDesignerDetails, "0.1",
- LifeCycleStatesEnum.CHECKIN);
- createVFInstanceAndAtomicResourceInstanceWithoutCheckin(resourceDetailsVF_01, resourceDetailsCP_01,
- sdncDesignerDetails);
- RestResponse updateServiceResp = ServiceRestUtils.updateService(serviceDetails_02, sdncDesignerDetails);
- ServiceRestUtils.checkSuccess(updateServiceResp);
- getComponentAndValidateRIs(serviceDetails_01, 5, 0);
-
- return ResponseParser.convertServiceResponseToJavaObject(updateServiceResp.getResponse());
- }
-
- private void createTreeCheckedinVFInstances() throws Exception {
- RestResponse createFirstVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_01,
- sdncDesignerDetails);
- ResourceRestUtils.checkCreateResponse(createFirstVFInstResp);
- RestResponse createSecondVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_02,
- sdncDesignerDetails);
- ResourceRestUtils.checkCreateResponse(createSecondVFInstResp);
- RestResponse createThirdVFInstResp = createCheckedinVFInstance(serviceDetails_01, resourceDetailsVF_03,
- sdncDesignerDetails);
- ResourceRestUtils.checkCreateResponse(createThirdVFInstResp);
- }
-
- private Component getComponentAndValidateRIs(ComponentReqDetails componentDetails, int numberOfRIs,
- int numberOfRelations) throws IOException, Exception {
-
- RestResponse getResponse = null;
- Component component = null;
- if (componentDetails instanceof ResourceReqDetails) {
- getResponse = ResourceRestUtils.getResource(sdncAdminDetails, componentDetails.getUniqueId());
- component = ResponseParser.parseToObjectUsingMapper(getResponse.getResponse(), Resource.class);
- } else if (componentDetails instanceof ServiceReqDetails) {
- getResponse = ServiceRestUtils.getService((ServiceReqDetails) componentDetails, sdncAdminDetails);
- component = ResponseParser.parseToObjectUsingMapper(getResponse.getResponse(), Service.class);
- } else if (componentDetails instanceof ProductReqDetails) {
- getResponse = ProductRestUtils.getProduct(componentDetails.getUniqueId(), sdncAdminDetails.getUserId());
- component = ResponseParser.parseToObjectUsingMapper(getResponse.getResponse(), Product.class);
- } else {
- Assert.fail("Unsupported type of componentDetails - " + componentDetails.getClass().getSimpleName());
- }
- ResourceRestUtils.checkSuccess(getResponse);
- int numberOfActualRIs = component.getComponentInstances() != null ? component.getComponentInstances().size()
- : 0;
- int numberOfActualRelations = component.getComponentInstancesRelations() != null
- ? component.getComponentInstancesRelations().size() : 0;
- assertEquals("Check number of RIs meet the expected number", numberOfRIs, numberOfActualRIs);
- assertEquals("Check number of RI relations meet the expected number", numberOfRelations,
- numberOfActualRelations);
-
- return component;
- }
-
- private void createVFInstanceAndAtomicResourceInstanceWithoutCheckin(ResourceReqDetails vf,
- ResourceReqDetails atomicResource, User user) throws Exception {
- RestResponse createVFInstance = createVFInstance(serviceDetails_01, vf, user);
- ResourceRestUtils.checkCreateResponse(createVFInstance);
- RestResponse atomicInstanceForService = createAtomicInstanceForService(serviceDetails_01, atomicResource, user);
- ResourceRestUtils.checkCreateResponse(atomicInstanceForService);
- }
-
- private RestResponse createCheckedinVFInstance(ServiceReqDetails containerDetails,
- ResourceReqDetails compInstOriginDetails, User modifier) throws Exception {
- changeResourceLifecycleState(compInstOriginDetails, modifier.getUserId(), LifeCycleStatesEnum.CHECKIN);
- return createVFInstance(containerDetails, compInstOriginDetails, modifier);
- }
-
- private RestResponse createVFInstance(ServiceReqDetails containerDetails, ResourceReqDetails compInstOriginDetails,
- User modifier) throws Exception {
- return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.SERVICE,
- true);
- }
-
- private RestResponse createAtomicInstanceForService(ServiceReqDetails containerDetails,
- ResourceReqDetails compInstOriginDetails, User modifier) throws Exception {
- return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.SERVICE,
- true);
- }
-
- private RestResponse createComponentInstance(ComponentReqDetails containerDetails,
- ComponentReqDetails compInstOriginDetails, User modifier, ComponentTypeEnum containerComponentTypeEnum,
- boolean isHighestLevel) throws IOException, Exception {
- ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory
- .getComponentResourceInstance(compInstOriginDetails);
- RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
- resourceInstanceReqDetails, modifier, containerDetails.getUniqueId(), containerComponentTypeEnum);
- return createResourceInstanceResponse;
- }
-
- private void changeResourceLifecycleState(ResourceReqDetails resourceDetails, String userUserId,
- LifeCycleStatesEnum lifeCycleStates) throws Exception {
- RestResponse response = LifecycleRestUtils.changeResourceState(resourceDetails, userUserId, lifeCycleStates);
- LifecycleRestUtils.checkLCS_Response(response);
- }
-
- private void createAtomicResource(ResourceReqDetails resourceDetails) throws Exception {
- RestResponse createResourceResponse = ResourceRestUtils.createResource(resourceDetails, sdncDesignerDetails);
- ResourceRestUtils.checkCreateResponse(createResourceResponse);
-
- }
-
- private void createVF(ResourceReqDetails resourceDetails) throws Exception {
- createVF(resourceDetails, sdncDesignerDetails);
-
- }
-
- private void createVF(ResourceReqDetails resourceDetails, User sdncModifier) throws Exception {
- RestResponse createVfResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifier);
- ResourceRestUtils.checkCreateResponse(createVfResponse);
- }
-
- private void createService(ServiceReqDetails serviceDetails) throws Exception {
- createService(serviceDetails, sdncDesignerDetails);
- }
-
- private void createService(ServiceReqDetails serviceDetails, User sdncModifier) throws Exception {
- RestResponse createServiceResponse = ServiceRestUtils.createService(serviceDetails, sdncModifier);
- ResourceRestUtils.checkCreateResponse(createServiceResponse);
- }
-
- private void importVfWithArtifacts(ImportReqDetails resourceDetailsVF_01) throws Exception {
- String payloadName = "VF_RI2_G4_withArtifacts.csar";
- Path path = Paths.get(rootPath + "/src/main/resources/ci/VF_RI2_G4_withArtifacts.csar");
- byte[] data = Files.readAllBytes(path);
- String payloadData = Base64.encodeBase64String(data);
- resourceDetailsVF_01.setPayloadData(payloadData);
-
- resourceDetailsVF_01.setPayloadName(payloadName);
- resourceDetailsVF_01.setResourceType(ResourceTypeEnum.VF.name());
- RestResponse createResource = ResourceRestUtils.createResource(resourceDetailsVF_01, sdncDesignerDetails);
- BaseRestUtils.checkCreateResponse(createResource);
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/general/FeProxyTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/general/FeProxyTest.java
deleted file mode 100644
index e4f7d396be..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/general/FeProxyTest.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.general;
-
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.CategoryRestUtils;
-import org.testng.AssertJUnit;
-import org.testng.annotations.Test;
-
-public class FeProxyTest extends ComponentBaseTest {
-
- @Rule
- public static TestName name = new TestName();
-
- public FeProxyTest() {
- super(name, FeProxyTest.class.getName());
- }
-
- @Test
- public void testFeProxy() throws Exception {
- User defaultUser = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- RestResponse allCategoriesTowardsFe = CategoryRestUtils.getAllCategoriesTowardsFe(defaultUser,
- BaseRestUtils.RESOURCE_COMPONENT_TYPE);
- AssertJUnit.assertEquals("Check response code after get categories towards FE", 200,
- allCategoriesTowardsFe.getErrorCode().intValue());
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/general/UuidTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/general/UuidTest.java
deleted file mode 100644
index e460614d8c..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/general/UuidTest.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.general;
-
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.rest.CatalogRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
-import org.openecomp.sdc.common.api.Constants;
-import org.testng.AssertJUnit;
-import org.testng.annotations.Test;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.UUID;
-
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertTrue;
-
-public class UuidTest extends ComponentBaseTest {
-
- @Rule
- public static TestName name = new TestName();
-
- public UuidTest() {
- super(name, UuidTest.class.getName());
- config = Config.instance();
- }
-
- @Test
- public void testE2EUuidHeaderReturnedAndPreserved() throws IOException {
- UUID randomUUID = UUID.randomUUID();
- String uuidStr = randomUUID.toString();
- RestResponse allTagsTowardsCatalogFe = CatalogRestUtils.getAllCategoriesTowardsCatalogFeWithUuid(uuidStr);
- AssertJUnit.assertEquals(allTagsTowardsCatalogFe.getErrorCode(), new Integer(200));
- List<String> list = allTagsTowardsCatalogFe.getHeaderFields().get(Constants.X_ECOMP_REQUEST_ID_HEADER);
- // check that header is returned
- AssertJUnit.assertTrue(list != null && !list.isEmpty());
- String receivedUuid = list.get(0);
- // Check that same uuid returned
- AssertJUnit.assertEquals(uuidStr, receivedUuid);
- }
-
- @Test
- public void testUuidHeaderGeneratedBe() throws IOException {
- RestResponse allTagsTowardsCatalogBe = CatalogRestUtils.getAllCategoriesTowardsCatalogBe();
- List<String> list = allTagsTowardsCatalogBe.getHeaderFields().get(Constants.X_ECOMP_REQUEST_ID_HEADER);
- // check that response was OK
- assertEquals(allTagsTowardsCatalogBe.getErrorCode(), new Integer(200));
- // check that header is returned
- assertTrue(list != null && !list.isEmpty());
- String uuid = list.get(0);
- // Check there is no conversion error
- UUID.fromString(uuid);
- }
-
- @Test
- public void testE2EOptionsNoUuid() throws IOException {
- RestResponse allTagsTowardsCatalogFe = ResourceRestUtils.sendOptionsTowardsCatalogFeWithUuid();
- assertEquals(allTagsTowardsCatalogFe.getErrorCode(), new Integer(200));
- List<String> list = allTagsTowardsCatalogFe.getHeaderFields().get(Constants.X_ECOMP_REQUEST_ID_HEADER);
- // check that header is returned (generated by BE)
- assertTrue(list != null && !list.isEmpty());
- String receivedUuid = list.get(0);
- // Check there is no conversion error
- UUID.fromString(receivedUuid);
- }
-
- @Test
- public void testE2EMethodNotAllowedWithUuid() throws IOException {
- UUID randomUUID = UUID.randomUUID();
- String uuidStr = randomUUID.toString();
- RestResponse allTagsTowardsCatalogFe = ResourceRestUtils
- .putAllCategoriesTowardsCatalogFeWithUuidNotAllowed(uuidStr);
- assertEquals(allTagsTowardsCatalogFe.getErrorCode(), new Integer(405));
- List<String> list = allTagsTowardsCatalogFe.getHeaderFields().get(Constants.X_ECOMP_REQUEST_ID_HEADER);
- // check that header is returned (generated by BE)
- assertTrue(list != null && !list.isEmpty());
- String receivedUuid = list.get(0);
- // Check that same uuid returned
- assertEquals(uuidStr, receivedUuid);
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/globaltypes/InterfaceLifecycleTypesTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/globaltypes/InterfaceLifecycleTypesTest.java
deleted file mode 100644
index 8b91261129..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/globaltypes/InterfaceLifecycleTypesTest.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright © 2018 European Support Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openecomp.sdc.ci.tests.execute.globaltypes;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.json.simple.JSONObject;
-import org.json.simple.JSONValue;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.testng.AssertJUnit;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-public class InterfaceLifecycleTypesTest extends ComponentBaseTest {
-
- protected Config config = Config.instance();
- protected HttpRequest httpRequest = new HttpRequest();
- protected Map<String, String> headersMap = new HashMap<>();
- @Rule
- public static final TestName testName = new TestName();
-
- public InterfaceLifecycleTypesTest() {
- super(testName, InterfaceLifecycleTypesTest.class.getName());
- }
-
- @BeforeMethod
- public void init() {
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER).getUserId());
- }
-
- @Test
- public void testGetAllInterfaceLifecycleTypes() throws Exception {
- final String standardType = "tosca.interfaces.node.lifecycle.standard";
- final String nfvType = "tosca.interfaces.nfv.vnf.lifecycle.nfv";
- String url = String.format(Urls.GET_All_INTERFACE_LIFECYCLE_TYPES, config.getCatalogBeHost(), config.getCatalogBePort());
- RestResponse restResponse = httpRequest.httpSendGet(url, headersMap);
- AssertJUnit.assertTrue(restResponse.getErrorCode() == 200);
- JSONObject jsonObject = (JSONObject) JSONValue.parse(restResponse.getResponse());
- AssertJUnit.assertTrue(jsonObject.containsKey(standardType));
- AssertJUnit.assertTrue(jsonObject.containsKey(nfvType));
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/groups/GroupsTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/groups/GroupsTest.java
deleted file mode 100644
index 91f564993e..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/groups/GroupsTest.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.groups;
-
-import fj.data.Either;
-import org.apache.commons.collections.MapUtils;
-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.*;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.execute.lifecycle.LCSbaseTest;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils;
-import org.testng.annotations.Test;
-import org.testng.collections.Lists;
-
-import java.io.File;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-
-import static org.junit.Assert.*;
-import static org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils.*;
-import static org.testng.Assert.assertNull;
-
-public class GroupsTest extends ComponentBaseTest {
- @Rule
- public static TestName name = new TestName();
-
- public static final String groupName = "x_group";
- public static final String capabilityName = "vlan_assignment";
- public static final String propertyName = "vfc_instance_group_reference";
- public static final String csarsFilePath = System.getProperty("user.dir") + File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator + "CI" + File.separator + "csars" ;
-
- public GroupsTest() {
- super(name, GroupsTest.class.getName());
- }
-
- @Test
- public void importResourceWithGroupsTest() throws Exception {
- importResource("with_groups.csar");
- }
-
- @Test
- public void importResourceWitIncorrectCapabilityNameTest() throws Exception {
- RestResponse createResource = getCreateResourceRestResponse(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, "incorrect_cap.csar", csarsFilePath);
- BaseRestUtils.checkErrorResponse(createResource, ActionStatus.MISSING_CAPABILITIES,(Lists.newArrayList("vlan_assignment1")).toString(), "group", "x_group");
- }
-
- @Test
- public void importResourceWithoutCapabilitiesTest() throws Exception {
- Resource resource = importResourceFromCsar(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, "without_caps.csar", csarsFilePath);
- validateComponentGroupCapabilityPropertyValue(resource, null);
- }
-
- @Test
- public void updateResourceWithGroupsTest() throws Exception {
- Resource resource = importResource("with_groups.csar");
- updateResource(resource, "with_groups_update.csar");
- }
-
- @Test
- public void supportGroupsWithCapabilitiesServiceLevelTest() throws Exception {
- Resource resource = importCertifiedResourceFromCsar(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, "VLANTaggingFromAmdox1303_2018.csar", csarsFilePath);
- CapReqDef caps = ComponentInstanceRestUtils.getInstancesCapabilitiesRequirements(resource, UserRoleEnum.DESIGNER.getUserId());
- validateVlanAssignmentGroupCapabilitiesInvisible(caps.getCapabilities());
-
- Service service1 = createCertifiedServiceWithInstance(ServiceCategoriesEnum.MOBILITY, resource);
- caps = ComponentInstanceRestUtils.getInstancesCapabilitiesRequirements(service1, UserRoleEnum.DESIGNER.getUserId());
- validateVlanAssignmentGroupCapabilitiesVisible(caps.getCapabilities());
-
- Service service2 = createCertifiedServiceWithInstance(ServiceCategoriesEnum.NETWORK_L4, resource);
- caps = ComponentInstanceRestUtils.getInstancesCapabilitiesRequirements(service2, UserRoleEnum.DESIGNER.getUserId());
- validateVlanAssignmentGroupCapabilitiesVisible(caps.getCapabilities());
-
- Service serviceContainer = createCertifiedServiceWithProxyInstances(ServiceCategoriesEnum.NETWORK_L3, service1, service2);
- caps = ComponentInstanceRestUtils.getInstancesCapabilitiesRequirements(serviceContainer, UserRoleEnum.DESIGNER.getUserId());
- validateVlanAssignmentGroupCapabilitiesVisible(caps.getCapabilities());
-
- assertTrue(serviceContainer.getComponentInstances()!=null);
- }
-
- private void validateVlanAssignmentGroupCapabilitiesVisible(Map<String, List<CapabilityDefinition>> capabilities) {
- if(MapUtils.isNotEmpty(capabilities)){
- validateVlanAssignmentGroupCapabilitiesVisibility(capabilities, true);
- }
- }
-
- private void validateVlanAssignmentGroupCapabilitiesInvisible(Map<String, List<CapabilityDefinition>> capabilities) {
- if(MapUtils.isNotEmpty(capabilities)){
- validateVlanAssignmentGroupCapabilitiesVisibility(capabilities, false);
- }
- }
- private void validateVlanAssignmentGroupCapabilitiesVisibility(Map<String, List<CapabilityDefinition>> capabilities, boolean shouldBeVisible) {
- assertTrue(capabilities.containsKey("org.openecomp.capabilities.VLANAssignment") == shouldBeVisible);
- }
-
- private Service createCertifiedServiceWithProxyInstances(ServiceCategoriesEnum category, Service service1, Service service2) throws Exception {
- Either<Service, RestResponse> createServiceRes = createServiceByCategory(category, UserRoleEnum.DESIGNER, true);
- assertTrue(createServiceRes.isLeft());
- Either<ComponentInstance, RestResponse> result = addComponentInstanceToComponentContainer(service1, createServiceRes.left().value());
- assertTrue(result.isLeft());
- result = addComponentInstanceToComponentContainer(service2, createServiceRes.left().value());
- assertTrue(result.isLeft());
- return certifyService(createServiceRes);
- }
-
- private Service createCertifiedServiceWithInstance(ServiceCategoriesEnum category, Resource resource) throws Exception {
- Either<Service, RestResponse> createServiceRes = createServiceByCategory(category, UserRoleEnum.DESIGNER, true);
- assertTrue(createServiceRes.isLeft());
- Either<ComponentInstance, RestResponse> result = addComponentInstanceToComponentContainer(resource, createServiceRes.left().value());
- assertTrue(result.isLeft());
- return certifyService(createServiceRes);
- }
-
- private Service certifyService(Either<Service, RestResponse> serviceProxy1) throws Exception {
- Service service = getServiceObjectByNameAndVersion(UserRoleEnum.DESIGNER, serviceProxy1.left().value().getName(), "0.1" );
- assertNotNull(service);
- ServiceReqDetails serviceReqDetails = new ServiceReqDetails(service);
- RestResponse restResponseService = LCSbaseTest.certifyService(serviceReqDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- assertTrue(restResponseService.getErrorCode()==200);
- return getServiceObjectByNameAndVersion(UserRoleEnum.DESIGNER, serviceProxy1.left().value().getName(), "1.0" );
- }
-
- private static Resource updateResource(Resource resource, String csarFileName) throws Exception {
- Resource updatedResource = updateResourceFromCsar(resource, UserRoleEnum.DESIGNER, csarFileName, csarsFilePath);
- validateComponentGroupCapabilityPropertyValue(updatedResource, "new_value");
- return updatedResource;
- }
-
- private static Resource importResource(String csarFileName) throws Exception {
- Resource resource = importResourceFromCsar(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, csarFileName, csarsFilePath);
- validateComponentGroupCapabilityPropertyValue(resource, "success");
- return resource;
- }
-
- private static void validateComponentGroupCapabilityPropertyValue(Component component, String propertyValue) {
- assertNotNull(component);
- assertNotNull(component.getGroups());
- assertFalse(component.getGroups().isEmpty());
- assertTrue(component.getGroups().size() == 5);
- Optional<GroupDefinition> vfcInstanceGroup = component.getGroups().stream().filter(g->g.getName().equals(groupName)).findFirst();
- assertTrue(vfcInstanceGroup.isPresent());
- assertFalse(vfcInstanceGroup.get().getCapabilities().isEmpty());
- assertTrue(vfcInstanceGroup.get().getCapabilities().size() == 1);
- assertNotNull(vfcInstanceGroup.get().getCapabilities().get("org.openecomp.capabilities.VLANAssignment"));
- assertTrue(vfcInstanceGroup.get().getCapabilities().get("org.openecomp.capabilities.VLANAssignment").size() == 1);
- assertNotNull(vfcInstanceGroup.get().getCapabilities().get("org.openecomp.capabilities.VLANAssignment").get(0));
- assertTrue(vfcInstanceGroup.get().getCapabilities().get("org.openecomp.capabilities.VLANAssignment").get(0).getName().equals(capabilityName));
- assertNotNull(vfcInstanceGroup.get().getCapabilities().get("org.openecomp.capabilities.VLANAssignment").get(0).getProperties());
- assertTrue(vfcInstanceGroup.get().getCapabilities().get("org.openecomp.capabilities.VLANAssignment").get(0).getProperties().size() == 1);
- assertTrue(vfcInstanceGroup.get().getCapabilities().get("org.openecomp.capabilities.VLANAssignment").get(0).getProperties().get(0).getName().equals(propertyName));
- if(propertyValue == null)
- assertNull(vfcInstanceGroup.get().getCapabilities().get("org.openecomp.capabilities.VLANAssignment").get(0).getProperties().get(0).getValue());
- else
- assertTrue(vfcInstanceGroup.get().getCapabilities().get("org.openecomp.capabilities.VLANAssignment").get(0).getProperties().get(0).getValue().equals(propertyValue));
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/CsarUtilsTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/CsarUtilsTest.java
deleted file mode 100644
index fd1703bfcb..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/CsarUtilsTest.java
+++ /dev/null
@@ -1,451 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.imports;
-
-import org.apache.commons.codec.binary.Base64;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-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.LifeCycleStatesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-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.ArtifactRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.openecomp.sdc.common.util.YamlToObjectConverter;
-import org.testng.annotations.Test;
-import org.yaml.snakeyaml.Yaml;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Map;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-
-import static org.junit.Assert.*;
-
-public class CsarUtilsTest extends ComponentBaseTest {
-
- public static final String ASSET_TOSCA_TEMPLATE = "assettoscatemplate";
-
- @Rule
- public static TestName name = new TestName();
-
- public CsarUtilsTest() {
- super(name, CsarUtilsTest.class.getName());
- }
-
- @Test(enabled = true)
- public void createServiceCsarBasicTest() throws Exception {
-
- Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
-
- Resource resourceVF = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
-
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.VENDOR_LICENSE, resourceVF, UserRoleEnum.DESIGNER,
- true, true);
- resourceVF = (Resource) AtomicOperationUtils
- .changeComponentState(resourceVF, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceVF, service, UserRoleEnum.DESIGNER, true);
-
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
-
- byte[] downloadCSAR = downloadCSAR(sdncModifierDetails, service);
-
- csarBasicValidation(service, downloadCSAR);
- }
-
- @Test(enabled = true)
- public void createResourceCsarBasicTest() throws Exception {
-
- Resource resourceVF = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
- resourceVF = (Resource) AtomicOperationUtils
- .changeComponentState(resourceVF, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
-
- byte[] downloadCSAR = downloadCSAR(sdncModifierDetails, resourceVF);
-
- csarBasicValidation(resourceVF, downloadCSAR);
- }
-
- @Test(enabled = true)
- public void createServiceCsarInclDeploymentArtTest() throws Exception {
-
- Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
-
- Resource resourceVF1 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
- Resource resourceVF2 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
-
- resourceVF1 = (Resource) AtomicOperationUtils
- .changeComponentState(resourceVF1, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- resourceVF2 = (Resource) AtomicOperationUtils
- .changeComponentState(resourceVF2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceVF1, service, UserRoleEnum.DESIGNER, true);
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceVF2, service, UserRoleEnum.DESIGNER, true);
-
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.YANG_XML, service, UserRoleEnum.DESIGNER, true, true);
-
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
-
- byte[] downloadCSAR = downloadCSAR(sdncModifierDetails, service);
-
- csarBasicValidation(service, downloadCSAR);
-
- validateServiceCsar(resourceVF1, resourceVF2, service, downloadCSAR, 3, 5, 1);
- }
-
- @Test(enabled = true)
- public void createResourceCsarInclDeploymentArtTest() throws Exception {
-
- Resource resourceVF1 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
-
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.YANG_XML, resourceVF1, UserRoleEnum.DESIGNER, true, true);
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT_ARTIFACT, resourceVF1, UserRoleEnum.DESIGNER, true, true);
-
- resourceVF1 = (Resource) AtomicOperationUtils
- .changeComponentState(resourceVF1, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
-
- byte[] downloadCSAR = downloadCSAR(sdncModifierDetails, resourceVF1);
-
- csarBasicValidation(resourceVF1, downloadCSAR);
-
- validateVFCsar(resourceVF1, downloadCSAR, 1, 0, 1, 1);
- }
-
- private void csarBasicValidation(Component mainComponent, byte[] downloadCSAR) {
- try (ByteArrayInputStream ins = new ByteArrayInputStream(downloadCSAR);
- ZipInputStream zip = new ZipInputStream(ins);) {
-
- String resourceYaml = null;
- byte[] buffer = new byte[1024];
- ZipEntry nextEntry = zip.getNextEntry();
- StringBuilder sb = new StringBuilder();
- int len;
-
- while ((len = zip.read(buffer)) > 0) {
- sb.append(new String(buffer, 0, len));
- }
-
- assertTrue(nextEntry.getName().equals("TOSCA-Metadata/TOSCA.meta"));
-
- sb.setLength(0);
- nextEntry = zip.getNextEntry();
-
- while ((len = zip.read(buffer)) > 0) {
- sb.append(new String(buffer, 0, len));
- }
-
- resourceYaml = sb.toString();
-
- YamlToObjectConverter yamlToObjectConverter = new YamlToObjectConverter();
- ArtifactDefinition artifactDefinition = mainComponent.getToscaArtifacts()
- .get(ASSET_TOSCA_TEMPLATE);
- String fileName = artifactDefinition.getArtifactName();
- assertEquals("Tosca-Template file name: ", "Definitions/" + fileName, nextEntry.getName());
- assertTrue("Tosca template Yaml validation: ", yamlToObjectConverter.isValidYaml(resourceYaml.getBytes()));
-
- ins.close();
- zip.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- private void validateServiceCsar(Component certifiedVFC1, Component certifiedVFC2, Service fetchedService,
- byte[] resultByte, int toscaEntryIndexToPass, int generatorEntryIndexToPass,
- int deploymentArtifactIndexToPass) {
-
- // TODO Test to validate everything is right (comment out after testing)
- /*try {
- FileUtils.writeByteArrayToFile(new File("c:/TestCSAR/" + fetchedService.getName() + ".zip"), resultByte);
- } catch (IOException e) {
- // Auto-generated catch block
- e.printStackTrace();
- }*/
-
- try (ByteArrayInputStream ins = new ByteArrayInputStream(resultByte);
- ZipInputStream zip = new ZipInputStream(ins);) {
-
- String resourceYaml = null;
- byte[] buffer = new byte[1024];
- ZipEntry nextEntry = zip.getNextEntry();
- StringBuilder sb = new StringBuilder();
- int len;
-
- while ((len = zip.read(buffer)) > 0) {
- sb.append(new String(buffer, 0, len));
- }
-
- assertTrue(nextEntry.getName().equals("TOSCA-Metadata/TOSCA.meta"));
-
- YamlToObjectConverter yamlToObjectConverter = new YamlToObjectConverter();
-
- int toscaEntryIndex = 0;
- int generatorEntryIndex = 0;
- int deploymentArtifactIndex = 0;
- String fileName = null;
- ArtifactDefinition artifactDefinition;
- Component componentToValidate = null;
-
- artifactDefinition = fetchedService.getToscaArtifacts().get(ASSET_TOSCA_TEMPLATE);
- String serviceFileName = artifactDefinition.getArtifactName();
- artifactDefinition = certifiedVFC1.getToscaArtifacts().get(ASSET_TOSCA_TEMPLATE);
- String vfc1FileName = artifactDefinition.getArtifactName();
- artifactDefinition = certifiedVFC2.getToscaArtifacts().get(ASSET_TOSCA_TEMPLATE);
- String vfc2FileName = artifactDefinition.getArtifactName();
-
- while ((nextEntry = zip.getNextEntry()) != null) {
- sb.setLength(0);
-
- while ((len = zip.read(buffer)) > 0) {
- sb.append(new String(buffer, 0, len));
- }
-
- String entryName = nextEntry.getName();
-
- resourceYaml = sb.toString();
- if (entryName.contains(serviceFileName)) {
- componentToValidate = fetchedService;
- fileName = "Definitions/" + serviceFileName;
-
- assertEquals("Validate entry Name", (fileName), nextEntry.getName());
- assertTrue(yamlToObjectConverter.isValidYaml(resourceYaml.getBytes()));
- validateContent(resourceYaml, componentToValidate);
- ++toscaEntryIndex;
- continue;
- }
-
- if (entryName.contains(vfc1FileName)) {
- componentToValidate = certifiedVFC1;
- fileName = "Definitions/" + vfc1FileName;
-
- assertEquals("Validate entry Name", (fileName), nextEntry.getName());
- assertTrue(yamlToObjectConverter.isValidYaml(resourceYaml.getBytes()));
- validateContent(resourceYaml, componentToValidate);
- ++toscaEntryIndex;
- continue;
- }
- if (entryName.contains(vfc2FileName)) {
- componentToValidate = certifiedVFC2;
- fileName = "Definitions/" + vfc2FileName;
-
- assertEquals("Validate entry Name", (fileName), nextEntry.getName());
- assertTrue(yamlToObjectConverter.isValidYaml(resourceYaml.getBytes()));
- validateContent(resourceYaml, componentToValidate);
- ++toscaEntryIndex;
- continue;
- }
-
- if (entryName.contains(".xml") && !entryName.startsWith("Artifacts/AAI")) {
- ++deploymentArtifactIndex;
- continue;
- }
-
- if (entryName.startsWith("Artifacts/AAI")) {
- ++generatorEntryIndex;
- continue;
- }
-
- assertTrue("Unexpected entry: " + entryName, true);
- }
- assertEquals("Validate amount of entries", toscaEntryIndexToPass, toscaEntryIndex);
- assertEquals("Validate amount of generated AAI artifacts", generatorEntryIndexToPass, generatorEntryIndex);
- assertEquals("Validate amount of generated Deployment artifacts", deploymentArtifactIndexToPass,
- deploymentArtifactIndex);
-
- ins.close();
- zip.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- private void validateVFCsar(Component certifiedVF, byte[] resultByte, int toscaEntryIndexToPass, int ymlDeploymentArtifactIndexToPass,
- int xmlDeploymentArtifactIndexToPass, int heatEnvDeploymentArtifactIndexToPass) {
-
- // TODO Test to validate everything is right (comment out after testing)
- /*try {
- FileUtils.writeByteArrayToFile(new File("c:/TestCSAR/" + fetchedService.getName() + ".zip"), resultByte);
- } catch (IOException e) {
- // Auto-generated catch block
- e.printStackTrace();
- }*/
-
- try (ByteArrayInputStream ins = new ByteArrayInputStream(resultByte);
- ZipInputStream zip = new ZipInputStream(ins);) {
-
- String resourceYaml = null;
- byte[] buffer = new byte[1024];
- ZipEntry nextEntry = zip.getNextEntry();
- StringBuilder sb = new StringBuilder();
- int len;
-
- while ((len = zip.read(buffer)) > 0) {
- sb.append(new String(buffer, 0, len));
- }
-
- assertTrue(nextEntry.getName().equals("TOSCA-Metadata/TOSCA.meta"));
-
- YamlToObjectConverter yamlToObjectConverter = new YamlToObjectConverter();
-
- int toscaEntryIndex = 0;
- int ymlEntryIndex = 0;
- int xmlArtifactsIndex = 0;
- int heatEnvDeploymentArtifactIndex = 0;
- String fileName = null;
- ArtifactDefinition artifactDefinition;
- Component componentToValidate = null;
-
- artifactDefinition = certifiedVF.getToscaArtifacts().get(ASSET_TOSCA_TEMPLATE);
- String vfFileName = artifactDefinition.getArtifactName();
-
- while ((nextEntry = zip.getNextEntry()) != null) {
- sb.setLength(0);
-
- while ((len = zip.read(buffer)) > 0) {
- sb.append(new String(buffer, 0, len));
- }
-
- String entryName = nextEntry.getName();
-
- resourceYaml = sb.toString();
- if (entryName.contains(vfFileName)) {
- componentToValidate = certifiedVF;
- fileName = "Definitions/" + vfFileName;
-
- assertEquals("Validate entry Name", (fileName), nextEntry.getName());
- assertTrue(yamlToObjectConverter.isValidYaml(resourceYaml.getBytes()));
- validateContent(resourceYaml, componentToValidate);
- ++toscaEntryIndex;
- continue;
- }
-
- if (entryName.contains(".xml") && entryName.startsWith("Artifacts/")) {
- ++xmlArtifactsIndex;
- continue;
- }
-
- if (entryName.contains(".sh") && entryName.startsWith("Artifacts/")) {
- ++heatEnvDeploymentArtifactIndex;
- continue;
- }
-
- if (entryName.contains(".yml") && entryName.startsWith("Artifacts/")) {
- ++ymlEntryIndex;
- continue;
- }
-
- assertTrue("Unexpected entry: " + entryName, false);
- }
- assertEquals("Validate amount of entries", toscaEntryIndexToPass, toscaEntryIndex);
- assertEquals("Validate amount of YAML artifacts", ymlDeploymentArtifactIndexToPass, ymlEntryIndex);
- assertEquals("Validate amount of generated XML artifacts", xmlDeploymentArtifactIndexToPass,
- xmlArtifactsIndex);
- assertEquals("Validate amount of generated HEAT ENV artifacts", heatEnvDeploymentArtifactIndexToPass,
- heatEnvDeploymentArtifactIndex);
-
- ins.close();
- zip.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- private void validateContent(String content, Component component) {
- Yaml yaml = new Yaml();
-
- InputStream inputStream = new ByteArrayInputStream(content.getBytes());
- @SuppressWarnings("unchecked")
- Map<String, Object> load = (Map<String, Object>) yaml.load(inputStream);
- @SuppressWarnings("unchecked")
- Map<String, Object> metadata = (Map<String, Object>) load.get("metadata");
- assertNotNull(metadata);
-
- String name = (String) metadata.get("name");
- assertNotNull(name);
- assertEquals("Validate component name", component.getName(), name);
-
- String invariantUUID = (String) metadata.get("invariantUUID");
- assertNotNull(invariantUUID);
- assertEquals("Validate component invariantUUID", component.getInvariantUUID(), invariantUUID);
-
- String UUID = (String) metadata.get("UUID");
- assertNotNull(UUID);
- assertEquals("Validate component invariantUUID", component.getUUID(), UUID);
-
- String type = (String) metadata.get("type");
- assertNotNull(type);
- if (component.getComponentType().equals(ComponentTypeEnum.SERVICE)) {
- assertEquals("Validate component type", component.getComponentType().getValue(), type);
- } else {
- assertEquals("Validate component type", ((Resource) component).getResourceType(),
- ResourceTypeEnum.valueOf(type));
- }
- }
-
- private byte[] downloadCSAR(User sdncModifierDetails, Component createdComponent) throws Exception {
-
- String artifactUniqeId = createdComponent.getToscaArtifacts().get("assettoscacsar").getUniqueId();
- RestResponse getCsarResponse = null;
-
- switch (createdComponent.getComponentType()) {
- case RESOURCE:
- getCsarResponse = ArtifactRestUtils.downloadResourceArtifactInternalApi(createdComponent.getUniqueId(),
- sdncModifierDetails, artifactUniqeId);
- break;
- case SERVICE:
- getCsarResponse = ArtifactRestUtils.downloadServiceArtifactInternalApi(createdComponent.getUniqueId(),
- sdncModifierDetails, artifactUniqeId);
- break;
- default:
- break;
- }
-
- assertNotNull(getCsarResponse);
- BaseRestUtils.checkSuccess(getCsarResponse);
-
- ArtifactUiDownloadData artifactUiDownloadData = ResponseParser.parseToObject(getCsarResponse.getResponse(),
- ArtifactUiDownloadData.class);
-
- assertNotNull(artifactUiDownloadData);
-
- byte[] fromUiDownload = artifactUiDownloadData.getBase64Contents().getBytes();
- byte[] decodeBase64 = Base64.decodeBase64(fromUiDownload);
-
- return decodeBase64;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ExportToscaTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ExportToscaTest.java
deleted file mode 100644
index 3f017f448c..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ExportToscaTest.java
+++ /dev/null
@@ -1,430 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.imports;
-
-import com.google.gson.Gson;
-import com.google.gson.JsonParser;
-import com.google.gson.reflect.TypeToken;
-import org.apache.commons.codec.binary.Base64;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.*;
-import org.openecomp.sdc.be.model.tosca.ToscaPropertyType;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ImportReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-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.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.*;
-import org.openecomp.sdc.ci.tests.utils.validation.BaseValidationUtils;
-import org.openecomp.sdc.common.api.Constants;
-import org.testng.annotations.Test;
-import org.yaml.snakeyaml.Yaml;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.*;
-import java.util.Map.Entry;
-import java.util.stream.Collectors;
-
-import static org.junit.Assert.*;
-
-public class ExportToscaTest extends ComponentBaseTest {
- @Rule
- public static TestName name = new TestName();
-
- public ExportToscaTest() {
- super(name, ExportToscaTest.class.getName());
- }
-
- @Test(enabled = true)
- public void exportVfModuleTest() throws Exception {
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
-
- Resource createdResource = createVfFromCSAR(sdncModifierDetails, "VSPPackage");
-
- Map<String, Object> load = downloadAndParseToscaTemplate(sdncModifierDetails, createdResource);
- assertNotNull(load);
- Map<String, Object> topology_template = (Map<String, Object>) load.get("topology_template");
- assertNotNull(topology_template);
- Map<String, Object> groups = (Map<String, Object>) topology_template.get("groups");
- assertNotNull(groups);
- List<GroupDefinition> groupsOrigin = createdResource.getGroups();
-
- assertEquals("Validate groups size", groupsOrigin.size(), groups.size());
- for (GroupDefinition group : groupsOrigin) {
- Map<String, Object> groupTosca = (Map<String, Object>) groups.get(group.getName());
- assertNotNull(groupTosca);
-
- Map<String, Object> metadata = (Map<String, Object>) groupTosca.get("metadata");
- assertNotNull(metadata);
-
- String invariantUUID;
- String name;
- String UUID;
- String version;
- Map<String, Object> properties = (Map<String, Object>) groupTosca.get("properties");
-
- if (group.getType().equals(Constants.DEFAULT_GROUP_VF_MODULE)) {
- invariantUUID = (String) metadata.get("vfModuleModelInvariantUUID");
- name = (String) metadata.get("vfModuleModelName");
- UUID = (String) metadata.get("vfModuleModelUUID");
- version = (String) metadata.get("vfModuleModelVersion");
- assertNotNull(properties);
-
- String vf_module_type = (String) properties.get("vf_module_type");
- List<PropertyDataDefinition> props = group.getProperties();
- for (PropertyDataDefinition prop : props) {
- if (prop.getName().equals(Constants.IS_BASE)) {
- String value = prop.getValue() == null ? prop.getDefaultValue() : prop.getValue();
- boolean bvalue = Boolean.parseBoolean(value);
- if (bvalue) {
- assertEquals("Validate vf_module_type", "Base", vf_module_type);
- } else {
- assertEquals("Validate vf_module_type", "Expansion", vf_module_type);
- }
- break;
- }
- }
- String vf_module_description = (String) properties.get("vf_module_description");
- assertEquals("Validate vf_module_description", group.getDescription(), vf_module_description);
-
- Boolean volume_group = (Boolean) properties.get("volume_group");
- boolean isVolume = false;
- List<String> artifactsList = group.getArtifacts();
- List<ArtifactDefinition> artifacts = new ArrayList<>();
- if (artifactsList != null && !artifactsList.isEmpty()) {
- ArtifactDefinition masterArtifact = findMasterArtifact(createdResource.getDeploymentArtifacts(),
- artifacts, artifactsList);
- if (masterArtifact.getArtifactType().equalsIgnoreCase(ArtifactTypeEnum.HEAT_VOL.getType())) {
- isVolume = true;
- }
- }
- assertEquals("Validate volume_group", isVolume, volume_group);
-
- } else {
- invariantUUID = (String) metadata.get("invariantUUID");
- name = (String) metadata.get("name");
- UUID = (String) metadata.get("UUID");
- version = (String) metadata.get("version");
- assertNull(properties);
-
- }
- assertEquals("Validate InvariantUUID", group.getInvariantUUID(), invariantUUID);
- assertEquals("Validate name", group.getName(), name);
- assertEquals("Validate UUID", group.getGroupUUID(), UUID);
- assertEquals("Validate version", group.getVersion(), version);
-
- }
- }
-
- @Test(enabled = true)
- public void exportCsarInputsTest() throws Exception {
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
-
- Resource createdResource = createVfFromCSAR(sdncModifierDetails, "csar_1");
- Map<String, Object> load = downloadAndParseToscaTemplate(sdncModifierDetails, createdResource);
- assertNotNull(load);
-
- Map<String, Object> topology_template = (Map<String, Object>) load.get("topology_template");
- assertNotNull(topology_template);
-
- Map<String, Object> inputs = (Map<String, Object>) topology_template.get("inputs");
- assertNotNull(inputs);
-
- List<InputDefinition> inputsFromResource = createdResource.getInputs();
- assertEquals("validate inputs size", inputsFromResource.size(), inputs.size());
- for (InputDefinition inputDef : inputsFromResource) {
- Map<String, Object> inputInFile = (Map<String, Object>) inputs.get(inputDef.getName());
- assertNotNull(inputInFile);
- validateInput(inputDef, inputInFile);
- }
- List<ComponentInstance> componentInstances = createdResource.getComponentInstances();
- Map<String, List<ComponentInstanceProperty>> componentInstancesProperties = createdResource
- .getComponentInstancesProperties();
- Map<String, Object> node_templates = (Map<String, Object>) topology_template.get("node_templates");
- assertNotNull(node_templates);
-
- JsonParser jsonParser = new JsonParser();
-
- for (Map.Entry<String, List<ComponentInstanceProperty>> entry : componentInstancesProperties.entrySet()) {
-
- Optional<ComponentInstance> findFirst = componentInstances.stream()
- .filter(ci -> ci.getUniqueId().equals(entry.getKey())).findFirst();
- assertTrue(findFirst.isPresent());
- String resourceName = findFirst.get().getName();
- Map<String, Object> instance = (Map<String, Object>) node_templates.get(resourceName);
- assertNotNull(instance);
- Map<String, Object> properties = (Map<String, Object>) instance.get("properties");
-
- for (ComponentInstanceProperty cip : entry.getValue()) {
- if (cip.getValueUniqueUid() != null && !cip.getValueUniqueUid().isEmpty()) {
- assertNotNull(properties);
- if (cip.getValue().contains("get_input")) {
- Object prop = properties.get(cip.getName());
- assertNotNull(prop);
-
- Gson gson = new Gson();
- String json = gson.toJson(prop);
- assertEquals("validate json property", cip.getValue(), json);
- }
-
- }
- }
-
- }
-
- }
-
- @Test
- public void importExportCsarWithJsonPropertyType() throws Exception {
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- String payloadName = "jsonPropertyTypeTest.csar";
- ImportReqDetails resourceDetails = ElementFactory.getDefaultImportResource();
- String rootPath = System.getProperty("user.dir");
- Path path = null;
- byte[] data = null;
- String payloadData = null;
- path = Paths.get(rootPath + "/src/test/resources/CI/csars/jsonPropertyTypeTest.csar");
- data = Files.readAllBytes(path);
- payloadData = Base64.encodeBase64String(data);
- resourceDetails.setPayloadData(payloadData);
- resourceDetails.setCsarUUID(payloadName);
- resourceDetails.setPayloadName(payloadName);
- resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
- RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
- BaseRestUtils.checkCreateResponse(createResource);
- Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
- ComponentInstance pmaaServer = resource.getComponentInstances().stream()
- .filter(p -> p.getName().equals("pmaa_server_0")).findAny().get();
- ComponentInstanceProperty jsonProp = resource.getComponentInstancesProperties().get(pmaaServer.getUniqueId())
- .stream().filter(p -> p.getType().equals(ToscaPropertyType.JSON.getType())).findAny().get();
- String jsonValue = "{\"pmaa.sb_nic\":{\"address\":{\"get_input\":\"pmaa_dpu_fixed_ip\"},\"cidr\":{\"get_input\":\"pmaa_dpu_cidr\"},\"gateway\":{\"get_input\":\"pmaa_dpu_gateway\"}}}";
- assertEquals(jsonProp.getValue(), jsonValue);
- // download and compare
- Map<String, Object> load = downloadAndParseToscaTemplate(sdncModifierDetails, resource);
- assertNotNull(load);
- Map<String, Object> topology_template = (Map<String, Object>) load.get("topology_template");
- assertNotNull(topology_template);
- Map<String, Object> nodes = (Map<String, Object>) topology_template.get("node_templates");
- assertNotNull(nodes);
- Map<String, Object> pmaaServerObj = (Map<String, Object>) nodes.get("pmaa_server_0");
- assertNotNull(pmaaServerObj);
- Map<String, Object> props = (Map<String, Object>) pmaaServerObj.get("properties");
- assertNotNull(props);
- Map<String, Object> jsonPropObj = (Map<String, Object>) props.get("metadata");
- assertNotNull(jsonPropObj);
- Gson gson = new Gson();
- String json = gson.toJson(jsonPropObj);
- assertEquals(json, jsonValue);
- }
-
- @Test(enabled = true)
- public void exportServiceInputValue() throws Exception {
- //1 create vf as certified
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
-
- Resource createdResource = createVfFromCSAR(sdncModifierDetails, "csar_1");
- RestResponse checkinState = LifecycleRestUtils.changeComponentState(createdResource, sdncModifierDetails, LifeCycleStatesEnum.CHECKIN);
- BaseRestUtils.checkSuccess(checkinState);
- ServiceReqDetails serviceDetails = ElementFactory.getDefaultService(
- "ciNewtestservice1", ServiceCategoriesEnum.MOBILITY, sdncModifierDetails.getUserId(),
- ServiceInstantiationType.A_LA_CARTE.getValue());
-
- //2 create service
- RestResponse createServiceResponse = ServiceRestUtils.createService(serviceDetails, sdncModifierDetails);
- ResourceRestUtils.checkCreateResponse(createServiceResponse);
- Service service = ResponseParser.parseToObjectUsingMapper(createServiceResponse.getResponse(), Service.class);
-
- //3 create vf instance in service
- ComponentInstanceReqDetails componentInstanceDetails = ElementFactory.getComponentInstance(createdResource);
- RestResponse createComponentInstance = ComponentInstanceRestUtils.createComponentInstance(componentInstanceDetails, sdncModifierDetails, service);
- ResourceRestUtils.checkCreateResponse(createComponentInstance);
-
- RestResponse getService = ServiceRestUtils.getService(service.getUniqueId());
- BaseRestUtils.checkSuccess(getService);
- service = ResponseParser.parseToObjectUsingMapper(getService.getResponse(), Service.class);
-
- //4 download tosca template
- Map<String, Object> tosca = downloadAndParseToscaTemplate(sdncModifierDetails, service);
- assertNotNull(tosca);
- Map<String, Object> topology_template = (Map<String, Object>) tosca.get("topology_template");
- assertNotNull(topology_template);
-
- //5 validate no inputs in service
- Map<String, Object> inputs = (Map<String, Object>) tosca.get("inputs");
- assertNull(inputs);
-
- List<ComponentInstance> componentInstances = service.getComponentInstances();
- assertNotNull(componentInstances);
- assertEquals(1, componentInstances.size());
- ComponentInstance vfi = componentInstances.get(0);
-
- //6 add instance inputs in service
- RestResponse getComponentInstanceInputsResponse = InputsRestUtils.getComponentInstanceInputs(service, vfi);
- BaseValidationUtils.checkSuccess(getComponentInstanceInputsResponse);
- List<ComponentInstancePropInput> instanceInputs = new Gson().fromJson(getComponentInstanceInputsResponse.getResponse(), new TypeToken<ArrayList<ComponentInstancePropInput>>(){}.getType());
- // Take only the 2 first inputs
- List<ComponentInstancePropInput> inputsToAdd = instanceInputs.stream().limit(2).collect(Collectors.toList());
-
- //7 Build component instances input map to add to server
- ComponentInstInputsMap buildComponentInstInputsMap = buildComponentInstInputsMap(vfi.getUniqueId(), inputsToAdd);
- RestResponse addInputResponse = InputsRestUtils.addInput(service, buildComponentInstInputsMap, UserRoleEnum.DESIGNER);
- BaseValidationUtils.checkSuccess(addInputResponse);
-
- //8 validate inputs in service
- //8.1 download tosca template
- getService = ServiceRestUtils.getService(service.getUniqueId());
- BaseRestUtils.checkSuccess(getService);
- service = ResponseParser.parseToObjectUsingMapper(getService.getResponse(), Service.class);
-
- tosca = downloadAndParseToscaTemplate(sdncModifierDetails, service);
- assertNotNull(tosca);
- topology_template = (Map<String, Object>) tosca.get("topology_template");
- assertNotNull(topology_template);
-
- //8.2 validate inputs in service
- inputs = (Map<String, Object>) topology_template.get("inputs");
- assertNotNull(inputs);
- assertEquals(2, inputs.size());
-
- //validate created inputs vs inputs in Tosca inputs section
- final Map<String, Object> inputsFinal = inputs;
- buildComponentInstInputsMap.getComponentInstanceInputsMap().values().forEach(listPerInstance ->{
- listPerInstance.forEach(input ->{
- Map<String, Object> inputInMap = (Map<String, Object>)inputsFinal.get(input.getName());
- assertNotNull(inputInMap);
- });
- });
- Map<String, List<ComponentInstanceInput>> componentInstancesInputs = service.getComponentInstancesInputs();
-
- //validate created inputs vs inputs in Tosca instance input value
- List<ComponentInstanceInput> vfiInputs = componentInstancesInputs.get(vfi.getUniqueId());
- assertNotNull(vfiInputs);
- assertEquals(2, vfiInputs.size());
-
- Map<String, Object> node_templates = (Map<String, Object>) topology_template.get("node_templates");
- assertNotNull(node_templates);
-
- Map<String, Object> instance = (Map<String, Object>) node_templates.get(vfi.getName());
- assertNotNull(instance);
- Map<String, Object> properties = (Map<String, Object>)instance.get("properties");
- assertNotNull(properties);
-
- vfiInputs.forEach(vfiInput ->{
- Map<String, Object> inputPropValueInTosca = (Map<String, Object>)properties.get(vfiInput.getName() );
- assertNotNull(inputPropValueInTosca);
- String instaneInputName = (String)inputPropValueInTosca.get("get_input");
- assertNotNull(instaneInputName);
- Map<String, Object> inputInMap = (Map<String, Object>)inputsFinal.get(instaneInputName);
- assertNotNull(inputInMap);
- });
-
-
- }
-
- // ----------------------------------------
- private void validateInput(InputDefinition inputDef, Map<String, Object> inputInFile) {
- assertEquals("validate input type", inputDef.getType(), (String) inputInFile.get("type"));
-
- if (inputDef.getDefaultValue() == null) {
- assertNull(inputInFile.get("default"));
- } else {
- assertNotNull(inputInFile.get("default"));
- String value = inputDef.getDefaultValue().replace("\"", "");
- value = value.replace(" ", "");
- String expValue = inputInFile.get("default").toString().replace(" ", "");
- assertEquals("validate input default", value, expValue);
- }
- assertEquals("validate input description", inputDef.getDescription(), (String) inputInFile.get("description"));
- }
-
- private Map<String, Object> downloadAndParseToscaTemplate(User sdncModifierDetails, Component createdComponent)
- throws Exception {
- String artifactUniqeId = createdComponent.getToscaArtifacts().get("assettoscatemplate").getUniqueId();
- RestResponse toscaTemplate;
-
- if ( createdComponent.getComponentType() == ComponentTypeEnum.RESOURCE ){
- toscaTemplate = ArtifactRestUtils.downloadResourceArtifactInternalApi(
- createdComponent.getUniqueId(), sdncModifierDetails, artifactUniqeId);
-
- }else{
- toscaTemplate = ArtifactRestUtils.downloadServiceArtifactInternalApi(
- createdComponent.getUniqueId(), sdncModifierDetails, artifactUniqeId);
- }
- BaseRestUtils.checkSuccess(toscaTemplate);
-
- ArtifactUiDownloadData artifactUiDownloadData = ResponseParser.parseToObject(toscaTemplate.getResponse(),
- ArtifactUiDownloadData.class);
- byte[] fromUiDownload = artifactUiDownloadData.getBase64Contents().getBytes();
- byte[] decodeBase64 = Base64.decodeBase64(fromUiDownload);
- Yaml yaml = new Yaml();
-
- InputStream inputStream = new ByteArrayInputStream(decodeBase64);
-
- Map<String, Object> load = (Map<String, Object>) yaml.load(inputStream);
- return load;
- }
-
-
- public ArtifactDefinition findMasterArtifact(Map<String, ArtifactDefinition> deplymentArtifact,
- List<ArtifactDefinition> artifacts, List<String> artifactsList) {
- for (String artifactUid : artifactsList) {
- for (Entry<String, ArtifactDefinition> entry : deplymentArtifact.entrySet()) {
- ArtifactDefinition artifact = entry.getValue();
- if (artifactUid.equalsIgnoreCase(artifact.getUniqueId())) {
- artifacts.add(artifact);
- }
-
- }
- }
- ArtifactDefinition masterArtifact = null;
- for (ArtifactDefinition artifactInfo : artifacts) {
- String atrifactType = artifactInfo.getArtifactType();
- if (atrifactType.equalsIgnoreCase(ArtifactTypeEnum.HEAT_VOL.getType())
- || atrifactType.equalsIgnoreCase(ArtifactTypeEnum.HEAT_NET.getType())) {
- masterArtifact = artifactInfo;
- continue;
- }
- if (atrifactType.equalsIgnoreCase(ArtifactTypeEnum.HEAT.getType())) {
- masterArtifact = artifactInfo;
- break;
- }
- }
- return masterArtifact;
- }
- private ComponentInstInputsMap buildComponentInstInputsMap (String addToInput, List<ComponentInstancePropInput> inputs) {
- Map<String, List<ComponentInstancePropInput>> map = new HashMap<>();
- map.put(addToInput, inputs);
- ComponentInstInputsMap componentInstInputsMap = new ComponentInstInputsMap();
- componentInstInputsMap.setComponentInstanceInputsMap(map);
- return componentInstInputsMap;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportGenericResourceCITest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportGenericResourceCITest.java
deleted file mode 100644
index f10aa5da3c..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportGenericResourceCITest.java
+++ /dev/null
@@ -1,586 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.imports;
-
-import com.google.gson.Gson;
-import fj.data.Either;
-import org.apache.http.HttpStatus;
-import org.apache.http.client.ClientProtocolException;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.entity.ContentType;
-import org.apache.http.entity.mime.MultipartEntityBuilder;
-import org.apache.http.entity.mime.content.FileBody;
-import org.apache.http.entity.mime.content.StringBody;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClients;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.model.LifecycleStateEnum;
-import org.openecomp.sdc.be.model.category.CategoryDefinition;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.enums.*;
-import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedResourceAuditJavaObject;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.execute.TODO.ImportCapabilityTypeCITest;
-import org.openecomp.sdc.ci.tests.utils.DbUtils;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ImportRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
-import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import java.io.File;
-import java.io.IOException;
-import java.nio.file.FileSystems;
-import java.nio.file.Files;
-import java.util.*;
-import java.util.Map.Entry;
-
-import static org.testng.AssertJUnit.*;
-
-public class ImportGenericResourceCITest extends ComponentBaseTest {
- private static Logger log = LoggerFactory.getLogger(ImportGenericResourceCITest.class.getName());
- private static final String FILE_NAME_MY_COMPUTE = "tosca.nodes.MyCompute";
- private static final String RESOURCE_NAME_UPDATE_COMPUTE = "userUpdateCompute";
- private static final String RESOURCE_NAME_MY_COMPUTE = "myCompute";
- private static final String RESOURCE_NAME_USER_COMPUTE = "userCompute";
- private static final String FILE_NAME_USER_COMPUTE = "tosca.nodes.userCompute";
- @Rule
- public static TestName name = new TestName();
-
- public ImportGenericResourceCITest() {
- super(name, ImportGenericResourceCITest.class.getName());
- }
-
- @BeforeClass
- public static void beforeImportClass() throws IOException {
- ImportCapabilityTypeCITest.importAllCapabilityTypes();
- // removeAllNormativeTypeResources();
- // importAllNormativeTypesResources(UserRoleEnum.ADMIN);
- }
-
- static Config config = Config.instance();
-
- public static Map<NormativeTypesEnum, Boolean> removeAllNormativeTypeResources() throws ClientProtocolException, IOException {
- Map<NormativeTypesEnum, Boolean> normativeExistInDB = new HashMap<>();
-
- for (NormativeTypesEnum current : NormativeTypesEnum.values()) {
- Boolean existedBeforeDelete = ImportRestUtils.removeNormativeTypeResource(current);
- normativeExistInDB.put(current, existedBeforeDelete);
- }
- return normativeExistInDB;
- }
-
- public static Either<String, Boolean> getNormativeTypeResource(NormativeTypesEnum current) throws ClientProtocolException, IOException {
- return getResource(current.getNormativeName(), "1.0");
- }
-
- @Test
- public void importAllTestResources() throws Exception {
- for (ImportTestTypesEnum currResource : ImportTestTypesEnum.values()) {
- DbUtils.cleanAllAudits();
-
- RestResponse importResponse = ImportRestUtils.importTestResource(currResource, UserRoleEnum.ADMIN);
- // System.err.println("import Resource
- // "+"<"+currResource+">"+"response:
- // "+importResponse.getErrorCode());
- ImportRestUtils.validateImportTestTypesResp(currResource, importResponse);
- if (currResource.getvalidateAudit() == true) {
- // validate audit
- String baseVersion = "1.0";
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(currResource.getActionStatus().name());
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
- String auditAction = "ResourceImport";
- expectedResourceAuditJavaObject.setAction(auditAction);
- expectedResourceAuditJavaObject.setModifierUid(UserRoleEnum.ADMIN.getUserId());
- expectedResourceAuditJavaObject.setModifierName(UserRoleEnum.ADMIN.getUserName());
- expectedResourceAuditJavaObject.setResourceName(currResource.getNormativeName());
- expectedResourceAuditJavaObject.setResourceType("Resource");
- expectedResourceAuditJavaObject.setPrevVersion("");
- expectedResourceAuditJavaObject.setCurrVersion(baseVersion);
- expectedResourceAuditJavaObject.setPrevState("");
- expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.CERTIFIED.toString());
- expectedResourceAuditJavaObject.setComment(null);
- expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
- List<String> variables = (currResource.getErrorParams() != null ? currResource.getErrorParams() : new ArrayList<String>());
- String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
- expectedResourceAuditJavaObject.setDesc(auditDesc);
- AuditValidationUtils.validateAuditImport(expectedResourceAuditJavaObject, auditAction);
- }
- }
- }
-
- // -----------------------------------------------------------------------------------
- protected void validateMyComputeCapabilities(Map<String, Object> map) {
- assertTrue(map.containsKey("capabilities"));
- Map<String, Object> capabilities = (Map<String, Object>) map.get("capabilities");
- assertTrue(capabilities.containsKey("tosca.capabilities.Container"));
- List<Object> hostCapList = (List<Object>) capabilities.get("tosca.capabilities.Container");
- assertFalse(hostCapList.isEmpty());
- Map<String, Object> hostCap = (Map<String, Object>) hostCapList.get(0);
- validateField(hostCap, "type", "tosca.capabilities.Container");
- validateField(hostCap, "name", "host");
- validateField(hostCap, "validSourceTypes", Arrays.asList(new String[] { "tosca.nodes.SoftwareComponent" }));
-
- assertTrue(capabilities.containsKey("tosca.capabilities.Endpoint.Admin"));
- List<Object> endPointCapList = (List<Object>) capabilities.get("tosca.capabilities.Endpoint.Admin");
- assertFalse(endPointCapList.isEmpty());
- Map<String, Object> endPointCap = (Map<String, Object>) endPointCapList.get(0);
- validateField(endPointCap, "name", "endpoint");
- validateField(endPointCap, "type", "tosca.capabilities.Endpoint.Admin");
-
- assertTrue(capabilities.containsKey("tosca.capabilities.OperatingSystem"));
- List<Object> osCapList = (List<Object>) capabilities.get("tosca.capabilities.OperatingSystem");
- assertFalse(osCapList.isEmpty());
- Map<String, Object> osCap = (Map<String, Object>) osCapList.get(0);
- validateField(osCap, "name", "os");
- validateField(osCap, "type", "tosca.capabilities.OperatingSystem");
-
- assertTrue(capabilities.containsKey("tosca.capabilities.Scalable"));
- List<Object> scalableCapList = (List<Object>) capabilities.get("tosca.capabilities.Scalable");
- assertFalse(scalableCapList.isEmpty());
- Map<String, Object> scalableCap = (Map<String, Object>) scalableCapList.get(0);
- validateField(scalableCap, "name", "scalable");
- validateField(scalableCap, "type", "tosca.capabilities.Scalable");
-
- assertTrue(capabilities.containsKey("tosca.capabilities.network.Bindable"));
- List<Object> bindingCapList = (List<Object>) capabilities.get("tosca.capabilities.network.Bindable");
- assertFalse(bindingCapList.isEmpty());
- Map<String, Object> bindingCap = (Map<String, Object>) bindingCapList.get(0);
- validateField(bindingCap, "name", "binding");
- validateField(bindingCap, "type", "tosca.capabilities.network.Bindable");
-
- }
-
- protected void validateMyComputeResource(String resourceName, String resourceVersion, String expectedState) throws ClientProtocolException, IOException {
- Either<String, Boolean> eitherMyCompute = getResource(resourceName, resourceVersion);
- assertTrue(eitherMyCompute.isLeft());
- String testComputeYml = eitherMyCompute.left().value();
-
- Map<String, Object> map = new HashMap<String, Object>();
- map = (Map<String, Object>) new Gson().fromJson(testComputeYml, map.getClass());
-
- validateMyComputeBasicFields(map, resourceName, resourceVersion, expectedState);
-
- validateMyComputeCapabilities(map);
-
- validateMyComputeRequirements(map);
- validateField(map, RespJsonKeysEnum.RESOURCE_VERSION.getRespJsonKeyName(), resourceVersion);
-
- }
-
- protected void validateMyComputeResource(String uid, String resourceName, String resourceVersion, String expectedState) throws ClientProtocolException, IOException {
- RestResponse resourceResponse = ResourceRestUtils.getResource(uid);
- ResourceRestUtils.checkSuccess(resourceResponse);
- String testComputeYml = resourceResponse.getResponse();
-
- // Either<String, Boolean> eitherMyCompute = getResource(resourceName,
- // resourceVersion);
- // assertTrue( eitherMyCompute.isLeft() );
- // String testComputeYml = eitherMyCompute.left().value();
-
- Map<String, Object> map = new HashMap<String, Object>();
- map = (Map<String, Object>) new Gson().fromJson(testComputeYml, map.getClass());
-
- validateMyComputeBasicFields(map, resourceName, resourceVersion, expectedState);
-
- validateMyComputeCapabilities(map);
-
- validateMyComputeRequirements(map);
- validateField(map, RespJsonKeysEnum.RESOURCE_VERSION.getRespJsonKeyName(), resourceVersion);
-
- }
-
- protected void validateMyComputeResourceAfterUpdate(String uid, String resourceName, String resourceVersion, String expectedState) throws ClientProtocolException, IOException {
- RestResponse resourceResponse = ResourceRestUtils.getResource(uid);
- ResourceRestUtils.checkSuccess(resourceResponse);
- String testComputeYml = resourceResponse.getResponse();
-
- // Either<String, Boolean> eitherMyCompute = getResource(resourceName,
- // resourceVersion);
- // assertTrue( eitherMyCompute.isLeft() );
-
- // String testComputeYml = eitherMyCompute.left().value();
-
- Map<String, Object> map = new HashMap<String, Object>();
- map = (Map<String, Object>) new Gson().fromJson(testComputeYml, map.getClass());
-
- validateMyComputeBasicFields(map, resourceName, resourceVersion, expectedState);
- validateField(map, RespJsonKeysEnum.DESCRIPTION.getRespJsonKeyName(), "Short description");
- validateField(map, RespJsonKeysEnum.VENDOR_NAME.getRespJsonKeyName(), "UserVendor");
- validateField(map, RespJsonKeysEnum.VENDOR_RELEASE.getRespJsonKeyName(), "1.1.2");
-
- // validateMyComputeCapabilities(map);
- // AssertJUnit.assertTrue(map.containsKey("capabilities"));
- // Map<String, Object> capabilities = (Map<String, Object>)
- // map.get("capabilities");
- // AssertJUnit.assertTrue(capabilities.containsKey("host"));
- // Map<String, Object> hostCap = (Map<String, Object>)
- // capabilities.get("host");
- // validateField(hostCap, "type", "tosca.capabilities.Container");
- // validateField(hostCap, "validSourceTypes", Arrays.asList(new
- // String[]{"tosca.nodes.SoftwareComponent"}));
- //
- // AssertJUnit.assertTrue(capabilities.containsKey("endpoint"));
- // Map<String, Object> endPointCap = (Map<String, Object>)
- // capabilities.get("endpoint");
- // validateField(endPointCap, "type",
- // "tosca.capabilities.Endpoint.Admin");
-
- assertTrue(map.containsKey("capabilities"));
- Map<String, Object> capabilities = (Map<String, Object>) map.get("capabilities");
- assertTrue(capabilities.containsKey("tosca.capabilities.Container"));
- List<Object> hostCapList = (List<Object>) capabilities.get("tosca.capabilities.Container");
- assertFalse(hostCapList.isEmpty());
- Map<String, Object> hostCap = (Map<String, Object>) hostCapList.get(0);
- validateField(hostCap, "type", "tosca.capabilities.Container");
- validateField(hostCap, "name", "host");
- validateField(hostCap, "validSourceTypes", Arrays.asList(new String[] { "tosca.nodes.SoftwareComponent" }));
-
- assertTrue(capabilities.containsKey("tosca.capabilities.Endpoint.Admin"));
- List<Object> endPointCapList = (List<Object>) capabilities.get("tosca.capabilities.Endpoint.Admin");
- assertFalse(endPointCapList.isEmpty());
- Map<String, Object> endPointCap = (Map<String, Object>) endPointCapList.get(0);
- validateField(endPointCap, "name", "endpoint");
- validateField(endPointCap, "type", "tosca.capabilities.Endpoint.Admin");
-
- validateMyComputeRequirements(map);
- validateField(map, RespJsonKeysEnum.RESOURCE_VERSION.getRespJsonKeyName(), resourceVersion);
-
- }
-
- protected void validateMyComputeRequirements(Map<String, Object> map) {
- assertTrue(map.containsKey("requirements"));
- Map<String, Object> requirements = (Map<String, Object>) map.get("requirements");
-
- assertTrue(requirements.containsKey("tosca.capabilities.Attachment"));
- List<Object> localStorageReqList = (List<Object>) requirements.get("tosca.capabilities.Attachment");
- assertFalse(localStorageReqList.isEmpty());
- Map<String, Object> localStorageReq = (Map<String, Object>) localStorageReqList.get(0);
- validateField(localStorageReq, "capability", "tosca.capabilities.Attachment");
- validateField(localStorageReq, "node", "tosca.nodes.BlockStorage");
- validateField(localStorageReq, "relationship", "tosca.relationships.AttachesTo");
- validateField(localStorageReq, "name", "local_storage");
- }
-
- protected void validateMyComputeBasicFields(Map<String, Object> map, String resourceName, String resourceVersion, String expectedState) {
- validateField(map, RespJsonKeysEnum.IS_ABSTRACT.getRespJsonKeyName(), false);
- // validateField(map, RespJsonKeysEnum.CATEGORIES.getRespJsonKeyName(),
- // categoryDefinition);
- // validateField(map, RespJsonKeysEnum.UNIQUE_ID.getRespJsonKeyName(),
- // UniqueIdBuilder.buildResourceUniqueId(resourceName,
- // resourceVersion));
- validateField(map, RespJsonKeysEnum.RESOURCE_NAME.getRespJsonKeyName(), resourceName);
- validateField(map, RespJsonKeysEnum.TAGS.getRespJsonKeyName(), Arrays.asList(new String[] { resourceName }));
- validateField(map, RespJsonKeysEnum.LIFE_CYCLE_STATE.getRespJsonKeyName(), expectedState);
-
- validateField(map, RespJsonKeysEnum.DERIVED_FROM.getRespJsonKeyName(), Arrays.asList(new String[] { "tosca.nodes.Root" }));
- }
-
- protected static void validateField(Map<String, Object> map, String jsonField, Object expectedValue) {
- if (expectedValue == null) {
- assertTrue(!map.containsKey(jsonField));
- } else {
- assertTrue("map does not contain field " + jsonField, map.containsKey(jsonField));
- Object foundValue = map.get(jsonField);
- compareElements(expectedValue, foundValue);
- }
- }
-
- protected static void compareElements(Object expectedValue, Object foundValue) {
- if (expectedValue instanceof String) {
- assertTrue(foundValue instanceof String);
- assertTrue(foundValue.equals(expectedValue));
- }
-
- else if (expectedValue instanceof Boolean) {
- assertTrue(foundValue instanceof Boolean);
- assertTrue(foundValue == expectedValue);
- } else if (expectedValue instanceof Map) {
- assertTrue(foundValue instanceof Map);
- Map<String, Object> foundMap = (Map<String, Object>) foundValue;
- Map<String, Object> excpectedMap = (Map<String, Object>) expectedValue;
- assertTrue(foundMap.size() == excpectedMap.size());
- Iterator<String> foundkeyItr = foundMap.keySet().iterator();
- while (foundkeyItr.hasNext()) {
- String foundKey = foundkeyItr.next();
- assertTrue(excpectedMap.containsKey(foundKey));
- compareElements(excpectedMap.get(foundKey), foundMap.get(foundKey));
- }
-
- } else if (expectedValue instanceof List) {
- assertTrue(foundValue instanceof List);
- List<Object> foundList = (List<Object>) foundValue;
- List<Object> excpectedList = (List<Object>) expectedValue;
- assertTrue(foundList.size() == excpectedList.size());
- for (int i = 0; i < foundList.size(); i++) {
- compareElements(excpectedList.get(i), foundList.get(i));
- }
-
- } else if (expectedValue instanceof CategoryDefinition) {
- assertTrue(foundValue instanceof Map);
- CategoryDefinition expCat = (CategoryDefinition) expectedValue;
- Map<String, Object> actCat = (Map<String, Object>) foundValue;
- assertEquals(expCat.getName(), actCat.get("name"));
-
- // assertEquals(expCat.getSubcategories().get(0).getName(),
- // actCat.get("subcategories").getName());
- } else {
- assertTrue(foundValue.equals(expectedValue));
- }
- }
-
- public static void restoreToOriginalState(Map<NormativeTypesEnum, Boolean> originalState, UserRoleEnum userRole) throws IOException {
- removeAllNormativeTypeResources();
-
- Iterator<Entry<NormativeTypesEnum, Boolean>> iterator = originalState.entrySet().iterator();
- while (iterator.hasNext()) {
- Entry<NormativeTypesEnum, Boolean> entry = iterator.next();
- Boolean isExistBeforeDelete = entry.getValue();
- if (isExistBeforeDelete) {
- importNormativeResource(entry.getKey(), userRole);
- }
- }
-
- }
-
- public static void importAllNormativeTypesResources(UserRoleEnum userRole) throws IOException {
- for (NormativeTypesEnum currResource : NormativeTypesEnum.values()) {
- Either<String, Boolean> resource = getResource(currResource.getNormativeName(), "1.0");
- if (resource.isRight()) {
- importNormativeResource(currResource, userRole);
- }
- }
-
- }
-
- protected static Integer importNormativeResource(NormativeTypesEnum resource, UserRoleEnum userRole) throws IOException {
- return importResource(resource.getFolderName(), userRole, true);
- }
-
- protected static Integer importResource(String folderName, UserRoleEnum userRole, boolean isNormative) throws IOException {
- Config config = Utils.getConfig();
- CloseableHttpResponse response = null;
- MultipartEntityBuilder mpBuilder = MultipartEntityBuilder.create();
-
- mpBuilder.addPart("resourceZip", new FileBody(getZipFile(folderName)));
- mpBuilder.addPart("resourceMetadata", new StringBody(getJsonStringOfFile(folderName, folderName + ".json"), ContentType.APPLICATION_JSON));
-
- String url = String.format(Urls.IMPORT_RESOURCE_NORMATIVE, config.getCatalogBeHost(), config.getCatalogBePort());
- if (!isNormative) {
- url = String.format(Urls.IMPORT_USER_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort());
- }
-
- CloseableHttpClient client = HttpClients.createDefault();
- try {
- HttpPost httpPost = new HttpPost(url);
- httpPost.addHeader("USER_ID", userRole.getUserId());
- httpPost.setEntity(mpBuilder.build());
- response = client.execute(httpPost);
- return response.getStatusLine().getStatusCode();
- } finally {
- closeResponse(response);
- closeHttpClient(client);
-
- }
- }
-
- public static void closeHttpClient(CloseableHttpClient client) {
- try {
- if (client != null) {
- client.close();
- }
- } catch (IOException e) {
- log.debug("failed to close client or response: ", e);
- }
- }
-
- public static void closeResponse(CloseableHttpResponse response) {
- try {
- if (response != null) {
- response.close();
- }
- } catch (IOException e) {
- log.debug("failed to close client or response: ", e);
- }
- }
-
- protected static String getJsonStringOfFile(String folderName, String fileName) throws IOException {
- String sourceDir = config.getImportResourceConfigDir();
- sourceDir += File.separator + "normative-types";
-
- java.nio.file.Path filePath = FileSystems.getDefault().getPath(sourceDir + File.separator + folderName, fileName);
- byte[] fileContent = Files.readAllBytes(filePath);
- String content = new String(fileContent);
- return content;
- }
-
- protected static File getZipFile(String elementName) throws IOException {
- String sourceDir = config.getImportResourceConfigDir();
- sourceDir += File.separator + "normative-types";
-
- java.nio.file.Path filePath = FileSystems.getDefault().getPath(sourceDir + File.separator + elementName, "normative-types-new-" + elementName + ".zip");
- return filePath.toFile();
- }
-
- protected static String getTestJsonStringOfFile(String folderName, String fileName) throws IOException {
- String sourceDir = config.getImportResourceTestsConfigDir();
- java.nio.file.Path filePath = FileSystems.getDefault().getPath(sourceDir + File.separator + folderName, fileName);
- byte[] fileContent = Files.readAllBytes(filePath);
- String content = new String(fileContent);
- return content;
- }
-
- protected static File getTestZipFile(String elementName) throws IOException {
- String sourceDir = config.getImportResourceTestsConfigDir();
-
- java.nio.file.Path filePath = FileSystems.getDefault().getPath(sourceDir + File.separator + elementName, "normative-types-new-" + elementName + ".zip");
- return filePath.toFile();
- }
-
- protected static Either<String, Boolean> getResource(String name, String version) throws IOException {
- RestResponse resource = ResourceRestUtils.getResourceByNameAndVersion(UserRoleEnum.DESIGNER.getUserId(), name, version);
- if (resource.getErrorCode() == ImportRestUtils.STATUS_CODE_GET_SUCCESS) {
- return Either.left(resource.getResponse());
- // return Either.right(true);
-
- }
- return Either.right(false);
- }
-
- @Test
- public void testImportWithRequirmentsAndCapabilities() throws IOException {
- String fileName = FILE_NAME_MY_COMPUTE;
- RestResponse response = ImportRestUtils.importNormativeResourceByName(RESOURCE_NAME_MY_COMPUTE, UserRoleEnum.ADMIN);
- Integer statusCode = response.getErrorCode();
- assertTrue(statusCode == ImportRestUtils.STATUS_CODE_IMPORT_SUCCESS);
- String uid = ResponseParser.getUniqueIdFromResponse(response);
- validateMyComputeResource(uid, fileName, "1.0", "CERTIFIED");
- }
-
- @Test
- public void testImportWithUpdateNormativeType() throws IOException {
- String fileName = FILE_NAME_MY_COMPUTE;
- RestResponse response = ImportRestUtils.importNormativeResourceByName(RESOURCE_NAME_MY_COMPUTE, UserRoleEnum.ADMIN);
- Integer statusCode = response.getErrorCode();
- assertTrue(statusCode == BaseRestUtils.STATUS_CODE_IMPORT_SUCCESS);
- String uid = ResponseParser.getUniqueIdFromResponse(response);
- validateMyComputeResource(uid, fileName, "1.0", "CERTIFIED");
-
- // update
- response = ImportRestUtils.importNormativeResourceByName(RESOURCE_NAME_MY_COMPUTE, UserRoleEnum.ADMIN);
- statusCode = response.getErrorCode();
- assertTrue(statusCode == ImportRestUtils.STATUS_CODE_UPDATE_SUCCESS);
- uid = ResponseParser.getUniqueIdFromResponse(response);
- validateMyComputeResource(uid, fileName, "2.0", "CERTIFIED");
-
- }
-
- @Test
- public void testImportWithInvalidDefaultValue() throws IOException {
- RestResponse response = ImportRestUtils.importNewResourceByName("portInvalidDefaultValue", UserRoleEnum.DESIGNER);
- assertTrue(response.getErrorCode() == HttpStatus.SC_BAD_REQUEST);
- }
-
- @Test
- public void testImportUserResource() throws IOException {
- String fileName = FILE_NAME_USER_COMPUTE;
- RestResponse response = ImportRestUtils.importNewResourceByName(RESOURCE_NAME_USER_COMPUTE, UserRoleEnum.DESIGNER);
- Integer statusCode = response.getErrorCode();
- assertTrue(statusCode == ImportRestUtils.STATUS_CODE_IMPORT_SUCCESS);
- String uid = ResponseParser.getUniqueIdFromResponse(response);
- validateMyComputeResource(uid, fileName, "0.1", "NOT_CERTIFIED_CHECKOUT");
-
- }
-
- @Test
- public void testImportAndUpdateUserResource() throws IOException {
- String fileName = FILE_NAME_USER_COMPUTE;
- RestResponse response = ImportRestUtils.importNewResourceByName(RESOURCE_NAME_USER_COMPUTE, UserRoleEnum.DESIGNER);
- Integer statusCode = response.getErrorCode();
- assertTrue(statusCode == ImportRestUtils.STATUS_CODE_IMPORT_SUCCESS);
- String uid = ResponseParser.getUniqueIdFromResponse(response);
- validateMyComputeResource(uid, fileName, "0.1", "NOT_CERTIFIED_CHECKOUT");
- response = ImportRestUtils.importNewResourceByName(RESOURCE_NAME_UPDATE_COMPUTE, UserRoleEnum.DESIGNER);
- statusCode = response.getErrorCode();
- assertTrue(statusCode == ImportRestUtils.STATUS_CODE_UPDATE_SUCCESS);
- uid = ResponseParser.getUniqueIdFromResponse(response);
- validateMyComputeResourceAfterUpdate(uid, fileName, "0.1", "NOT_CERTIFIED_CHECKOUT");
-
- }
-
- @Test
- public void testImportAndUpdateChangesUserResource() throws IOException {
- String fileName = FILE_NAME_USER_COMPUTE;
- RestResponse response = ImportRestUtils.importNewResourceByName(RESOURCE_NAME_USER_COMPUTE, UserRoleEnum.DESIGNER);
- Integer statusCode = response.getErrorCode();
- assertTrue(statusCode == ImportRestUtils.STATUS_CODE_IMPORT_SUCCESS);
- String uid = ResponseParser.getUniqueIdFromResponse(response);
- validateMyComputeResource(uid, fileName, "0.1", "NOT_CERTIFIED_CHECKOUT");
- // Either<String, Boolean> resource = getResource(fileName, "0.1");
- // assertTrue(resource.isLeft());
-
- response = ImportRestUtils.importNewResourceByName(RESOURCE_NAME_UPDATE_COMPUTE, UserRoleEnum.DESIGNER);
- statusCode = response.getErrorCode();
- assertTrue(statusCode == ImportRestUtils.STATUS_CODE_UPDATE_SUCCESS);
- validateMyComputeResourceAfterUpdate(uid, fileName, "0.1", "NOT_CERTIFIED_CHECKOUT");
-
- }
-
- @Test
- public void testImportCheckoutAndUpdateUserResource() throws IOException {
- String fileName = FILE_NAME_USER_COMPUTE;
- RestResponse response = ImportRestUtils.importNormativeResourceByName(RESOURCE_NAME_USER_COMPUTE, UserRoleEnum.ADMIN);
- Integer statusCode = response.getErrorCode();
- assertTrue(statusCode == ImportRestUtils.STATUS_CODE_IMPORT_SUCCESS);
- String uid = ResponseParser.getUniqueIdFromResponse(response);
- validateMyComputeResource(uid, fileName, "1.0", "CERTIFIED");
-
- response = ImportRestUtils.importNewResourceByName(RESOURCE_NAME_USER_COMPUTE, UserRoleEnum.DESIGNER);
- statusCode = response.getErrorCode();
- assertEquals("check response code after update resource", ImportRestUtils.STATUS_CODE_UPDATE_SUCCESS, statusCode.intValue());
- uid = ResponseParser.getUniqueIdFromResponse(response);
- validateMyComputeResource(uid, fileName, "1.1", "NOT_CERTIFIED_CHECKOUT");
-
- }
-
- @Test
- public void importNormativeTypesTesterUserRole() throws Exception {
- Integer statusCode = ImportRestUtils.importNormativeResourceByName(RESOURCE_NAME_MY_COMPUTE, UserRoleEnum.TESTER).getErrorCode();
- assertTrue(statusCode == ImportRestUtils.RESTRICTED_OPERATION);
- }
-
- @Test
- public void importNormativeTypesDesignerUserRole() throws Exception {
- Integer statusCode = ImportRestUtils.importNormativeResourceByName(RESOURCE_NAME_MY_COMPUTE, UserRoleEnum.DESIGNER).getErrorCode();
- assertTrue(statusCode == 409);
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportToscaCapabilitiesWithProperties.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportToscaCapabilitiesWithProperties.java
deleted file mode 100644
index 4338a1b151..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportToscaCapabilitiesWithProperties.java
+++ /dev/null
@@ -1,411 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.imports;
-
-import com.google.gson.Gson;
-import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.lang3.tuple.ImmutablePair;
-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.*;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.datatypes.ImportReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.testng.annotations.Test;
-
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertTrue;
-
-/**
- * US US730518 Story [BE] - TOSCA capabilities with properties - import "As a
- * resource designer, I would like to add my VFC capabilities with properties."
- *
- * @author ns019t
- *
- */
-public class ImportToscaCapabilitiesWithProperties extends ComponentBaseTest {
- @Rule
- public static TestName name = new TestName();
-
- Gson gson = new Gson();
-
- /**
- * public Constructor ImportToscaCapabilitiesWithProperties
- */
- public ImportToscaCapabilitiesWithProperties() {
- super(name, ImportToscaCapabilitiesWithProperties.class.getName());
- }
-
- /**
- * String constants
- */
- public static String propertyForTestName = "propertyfortest";
- public static String rootPath = System.getProperty("user.dir");
- public static String scalable = "tosca.capabilities.Scalable";
- public static String container = "tosca.capabilities.Container";
- public static String minInstances = "min_instances";
- public static String userDefinedNodeYaml = "mycompute.yml";
-
- /**
- * Capability Type - capability type on the graph should already have
- * properties modeled on it. please verify. The import of the capability
- * types should support adding those properties. when importing, validate
- * name uniqueness between the capability's properties see capability
- * tosca.capabilities.Container
- *
- * Acceptance Criteria: validate capability type properties (for example,
- * compute have capability Container -> the properties of this capability
- * should be in the Json response)
- *
- * @throws IOException
- */
- @Test
- public void validateCapabilityTypePropertiesSucceed() throws IOException {
- User user = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- RestResponse createResourceRes = ResourceRestUtils.getResourceByNameAndVersion(user.getUserId(), "Compute",
- "1.0");
- BaseRestUtils.checkSuccess(createResourceRes);
- Resource resource = ResponseParser.convertResourceResponseToJavaObject(createResourceRes.getResponse());
- Map<String, List<CapabilityDefinition>> capabilities = resource.getCapabilities();
- assertEquals(capabilities.size(), 6);
-
- CapabilityDefinition capability = capabilities.get(scalable).get(0);
- List<ComponentInstanceProperty> properties = capability.getProperties();
- assertEquals(properties.size(), 3);
- assertTrue(!properties.stream().filter(p -> p.getName().equalsIgnoreCase(propertyForTestName)).findAny()
- .isPresent());
-
- ComponentInstanceProperty originalProperty = properties.stream()
- .filter(p -> p.getName().equalsIgnoreCase(minInstances)).findAny().get();
- assertEquals(originalProperty.getType(), "integer");
- assertEquals(originalProperty.getDefaultValue(), "1");
-
- capability = capabilities.get(container).get(0);
- properties = capability.getProperties();
- assertEquals(properties.size(), 4);
- }
-
- /**
- * Capability Definition on VFC / CP / VL - properties can also be defined
- * on the capability when the capability is declared. (property definition
- * with default value) If the property name (case insensitive) already
- * defined on the capability type, it overrides the capability from the
- * capability type Import of VFC / CP /VL should support adding properties
- * to the capability. when importing, validate name uniqueness between the
- * capability's properties
- *
- * Acceptance Criteria: import node type with capability definition on it.
- * use the attached "myCompute"
- *
- * @throws Exception
- */
- @Test
- public void importNodeTypeWithCapabilityWithPropertiesFromYmlSucceed() throws Exception {
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- ImportReqDetails resourceDetails = ElementFactory.getDefaultImportResource();
- RestResponse createResource = importUserDefinedNodeType(userDefinedNodeYaml, sdncModifierDetails,
- resourceDetails);
- BaseRestUtils.checkCreateResponse(createResource);
- Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
-
- Map<String, List<CapabilityDefinition>> capabilities = resource.getCapabilities();
- assertEquals(capabilities.size(), 6);
-
- CapabilityDefinition capability = capabilities.get(scalable).get(0);
- List<ComponentInstanceProperty> properties = capability.getProperties();
- assertEquals(properties.size(), 4);
-
- ComponentInstanceProperty newProperty = properties.stream()
- .filter(p -> p.getName().equalsIgnoreCase(propertyForTestName)).findAny().get();
- assertEquals(newProperty.getType(), "string");
- assertEquals(newProperty.getDescription(), "test");
- assertEquals(newProperty.getDefaultValue(), "success");
-
- ComponentInstanceProperty overriddenProperty = properties.stream()
- .filter(p -> p.getName().equalsIgnoreCase(minInstances)).collect(Collectors.toList()).get(0);
- assertEquals(overriddenProperty.getType(), "integer");
- assertEquals(overriddenProperty.getDefaultValue(), "3");
-
- }
-
- /**
- * importNodeTypeWithCapabilityWithPropertiesFromYmlFailed
- *
- * @throws Exception
- */
- @Test
- public void importNodeTypeWithCapabilityWithPropertiesFromYmlFailed() throws Exception {
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- ImportReqDetails resourceDetails = ElementFactory.getDefaultImportResource();
- RestResponse createResource = importUserDefinedNodeType("mycompute_failed.yml", sdncModifierDetails,
- resourceDetails);
- BaseRestUtils.checkErrorMessageResponse(createResource, ActionStatus.PROPERTY_NAME_ALREADY_EXISTS);
- }
-
- /**
- * Capability Assignment (on node_template / resource instance) - should
- * support assignment of the property (property value). On the resource
- * instance level, value can be assigned to either properties that are
- * defined on the capability type or on the capability definition. When
- * importing a VF - the node_template can have capability's property value.
- * It should be imported and saved on the graph Acceptance Criteria: import
- * a VF that assign values to property of capability that was defined on the
- * capability type
- *
- * @throws Exception
- */
- @Test
- public void importResourceWithCapabilityWithPropertiesOverridingCapTypePropertiesSucceed() throws Exception {
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- String payloadName = "vf_with_cap_prop_override_cap_type_prop.csar";
- ImportReqDetails resourceDetails = ElementFactory.getDefaultImportResource();
- Path path = Paths.get(rootPath + "/src/test/resources/CI/csars/vf_with_cap_prop_override_cap_type_prop.csar");
- byte[] data = Files.readAllBytes(path);
- String payloadData = Base64.encodeBase64String(data);
- resourceDetails.setPayloadData(payloadData);
-
- resourceDetails.setPayloadName(payloadName);
- resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
- RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
- BaseRestUtils.checkCreateResponse(createResource);
-
- List<ImmutablePair<String, String>> propertyNamesValues = new ArrayList<>();
- propertyNamesValues.add(new ImmutablePair<String, String>("num_cpus", "2"));
- propertyNamesValues.add(new ImmutablePair<String, String>("mem_size", "2000 MB"));
- checkResource(createResource, 8, container, "DBMS", propertyNamesValues);
-
- ResourceReqDetails resourceDetails2 = ElementFactory.getDefaultResource();
- resourceDetails2.setCsarUUID("vf_with_cap_prop_override_cap_type_prop.csar");
- resourceDetails2.setResourceType(ResourceTypeEnum.VF.name());
- createResource = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
- BaseRestUtils.checkCreateResponse(createResource);
-
- checkResource(createResource, 8, container, "DBMS", propertyNamesValues);
- }
-
- /**
- * importResourceWithCapabilityWithPropertiesOverridingCapTypePropertiesFailed
- *
- * @throws Exception
- */
- @Test
- public void importResourceWithCapabilityWithPropertiesOverridingCapTypePropertiesFailed() throws Exception {
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- String payloadName = "vf_with_cap_prop_override_cap_type_prop_failed.csar";
- ImportReqDetails resourceDetails = ElementFactory.getDefaultImportResource();
- Path path = Paths
- .get(rootPath + "/src/test/resources/CI/csars/vf_with_cap_prop_override_cap_type_prop_failed.csar");
- byte[] data = Files.readAllBytes(path);
- String payloadData = Base64.encodeBase64String(data);
- resourceDetails.setPayloadData(payloadData);
-
- resourceDetails.setPayloadName(payloadName);
- resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
- RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
- BaseRestUtils.checkErrorMessageResponse(createResource, ActionStatus.INVALID_PROPERTY);
-
- ResourceReqDetails resourceDetails2 = ElementFactory.getDefaultResource();
- resourceDetails2.setCsarUUID("vf_with_cap_prop_override_cap_type_prop_failed.csar");
- resourceDetails2.setResourceType(ResourceTypeEnum.VF.name());
- createResource = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
- BaseRestUtils.checkErrorMessageResponse(createResource, ActionStatus.INVALID_PROPERTY);
-
- }
-
- /**
- * Capability Assignment (on node_template / resource instance) - should
- * support assignment of the property (property value). On the resource
- * instance level, value can be assigned to either properties that are
- * defined on the capability type or on the capability definition. When
- * importing a VF - the node_template can have capability's property value.
- * It should be imported and saved on the graph Acceptance Criteria: import
- * a VF that assign values to property of capability that was defined on the
- * capability definition (on the node type)
- *
- * @throws Exception
- */
- @Test
- public void importResourceWithCapabilityWithPropertiesOverridingNodeTypeCapPropertiesSucceed() throws Exception {
-
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- ImportReqDetails resourceDetails = ElementFactory.getDefaultImportResource();
- RestResponse createResource = importUserDefinedNodeType(userDefinedNodeYaml, sdncModifierDetails,
- resourceDetails);
- BaseRestUtils.checkCreateResponse(createResource);
- Resource userDefinedNodeType = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(),
- Resource.class);
-
- String payloadName = "vf_with_cap_prop_override_cap_type_prop1.csar";
- resourceDetails = ElementFactory.getDefaultImportResource();
- Path path = Paths.get(rootPath + "/src/test/resources/CI/csars/vf_with_cap_prop_override_cap_type_prop1.csar");
- byte[] data = Files.readAllBytes(path);
- String payloadData = Base64.encodeBase64String(data);
- resourceDetails.setPayloadData(payloadData);
-
- resourceDetails.setPayloadName(payloadName);
- resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
- createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
- BaseRestUtils.checkCreateResponse(createResource);
-
- List<ImmutablePair<String, String>> propertyNamesValues = new ArrayList<>();
- propertyNamesValues.add(new ImmutablePair<String, String>("num_cpus", "2"));
- propertyNamesValues.add(new ImmutablePair<String, String>("mem_size", "2000 MB"));
- checkResource(createResource, 8, container, "DBMS", propertyNamesValues);
-
- List<ImmutablePair<String, String>> propertyNamesValues1 = new ArrayList<>();
- propertyNamesValues1.add(new ImmutablePair<String, String>(propertyForTestName, "success_again"));
- propertyNamesValues1.add(new ImmutablePair<String, String>(minInstances, "4"));
- checkResource(createResource, 8, scalable, userDefinedNodeType.getName(), propertyNamesValues1);
-
- ResourceReqDetails resourceDetails2 = ElementFactory.getDefaultResource();
- resourceDetails2.setCsarUUID("vf_with_cap_prop_override_cap_type_prop1.csar");
- resourceDetails2.setResourceType(ResourceTypeEnum.VF.name());
- createResource = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
- BaseRestUtils.checkCreateResponse(createResource);
-
- checkResource(createResource, 8, container, "DBMS", propertyNamesValues);
- checkResource(createResource, 8, scalable, userDefinedNodeType.getName(), propertyNamesValues1);
-
- }
-
- /**
- * importResourceWithCapabilityWithPropertiesOverridingNodeTypeCapPropertiesFailed
- *
- * @throws Exception
- */
- @Test
- public void importResourceWithCapabilityWithPropertiesOverridingNodeTypeCapPropertiesFailed() throws Exception {
-
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- ImportReqDetails resourceDetails = ElementFactory.getDefaultImportResource();
- RestResponse createResource = importUserDefinedNodeType(userDefinedNodeYaml, sdncModifierDetails,
- resourceDetails);
- BaseRestUtils.checkCreateResponse(createResource);
-
- String payloadName = "vf_with_cap_prop_override_cap_type_prop1_failed.csar";
- resourceDetails = ElementFactory.getDefaultImportResource();
- Path path = Paths
- .get(rootPath + "/src/test/resources/CI/csars/vf_with_cap_prop_override_cap_type_prop1_failed.csar");
- byte[] data = Files.readAllBytes(path);
- String payloadData = Base64.encodeBase64String(data);
- resourceDetails.setPayloadData(payloadData);
-
- resourceDetails.setPayloadName(payloadName);
- resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
- createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
- BaseRestUtils.checkErrorResponse(createResource, ActionStatus.PROPERTY_NAME_ALREADY_EXISTS,
- propertyForTestName);
-
- ResourceReqDetails resourceDetails2 = ElementFactory.getDefaultResource();
- resourceDetails2.setCsarUUID("vf_with_cap_prop_override_cap_type_prop1_failed.csar");
- resourceDetails2.setResourceType(ResourceTypeEnum.VF.name());
- createResource = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
- BaseRestUtils.checkErrorResponse(createResource, ActionStatus.PROPERTY_NAME_ALREADY_EXISTS,
- propertyForTestName);
- }
-
- private RestResponse importUserDefinedNodeType(String payloadName, User sdncModifierDetails,
- ImportReqDetails resourceDetails) throws Exception {
-
- Path path = Paths.get(rootPath + "/src/test/resources/CI/csars/" + payloadName);
- byte[] data = Files.readAllBytes(path);
- String payloadData = Base64.encodeBase64String(data);
- resourceDetails.setPayloadData(payloadData);
-
- resourceDetails.setPayloadName(payloadName);
- resourceDetails.setResourceType(ResourceTypeEnum.VFC.name());
- return ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
- }
-
- // TODO Tal: Since Cashing change partial resource returned that causes null
- // pointer exception
- // commented out till fixing
- private void checkResource(RestResponse createResource, int capNum, String capType, String riName,
- List<ImmutablePair<String, String>> propertyNamesValues) {
- Resource resource = ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
-
- Map<String, List<CapabilityDefinition>> capabilities = resource.getCapabilities();
- // TODO Tal: Since Cashing change partial resource returned that causes
- // null pointer exception
- /* assertEquals(capabilities.size(), capNum); */
- /*
- * List<CapabilityDefinition> capabilitesContainer =
- * capabilities.get(capType);
- */
-
- ComponentInstance resourceRI = resource.getComponentInstances().stream()
- .filter(ri -> ri.getComponentName().equals(riName)).collect(Collectors.toList()).get(0);
- // TODO Tal: Since Cashing change partial resource returned that causes
- // null pointer exception
- /*
- * CapabilityDefinition capabilityFromContainer =
- * capabilitesContainer.stream()
- * .filter(cap->cap.getOwnerId().equals(resourceRI.getUniqueId())).
- * collect(Collectors.toList()).get(0);
- */
-
- CapabilityDefinition capabilityFromRI = resourceRI.getCapabilities().get(capType).get(0);
- for (ImmutablePair<String, String> propValuePair : propertyNamesValues) {
- // TODO Tal: Since Cashing change partial resource returned that
- // causes null pointer exception
- /*
- * Map<String, ComponentInstanceProperty> propertiesFromContainer =
- * capabilityFromContainer.getProperties()
- * .stream().filter(p->p.getName().equalsIgnoreCase(propValuePair.
- * getLeft())) .collect(Collectors.toMap(p->p.getName(), p->p));
- */
-
- List<ComponentInstanceProperty> propertiesFromRI = capabilityFromRI.getProperties().stream()
- .filter(p -> p.getName().equalsIgnoreCase(propValuePair.getLeft())).collect(Collectors.toList());
- // TODO Tal: Since Cashing change partial resource returned that
- // causes null pointer exception
- /*
- * for(ComponentInstanceProperty riProp : propertiesFromRI){
- * assertTrue(propertiesFromContainer.containsKey(riProp.getName()))
- * ; ComponentInstanceProperty containerProp =
- * propertiesFromContainer.get(riProp.getName());
- * assertEquals(riProp.getValue(), containerProp.getValue());
- * if(riProp.getName().equals(propValuePair.getLeft()))
- * assertEquals(riProp.getValue(), propValuePair.getRight());
- *
- * }
- */
- }
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/inputs/InputsApiTests.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/inputs/InputsApiTests.java
deleted file mode 100644
index 714a029fd8..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/inputs/InputsApiTests.java
+++ /dev/null
@@ -1,361 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.inputs;
-
-import static org.testng.AssertJUnit.assertTrue;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.google.gson.reflect.TypeToken;
-
-import java.io.IOException;
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-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.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.Component;
-import org.openecomp.sdc.be.model.ComponentInstInputsMap;
-import org.openecomp.sdc.be.model.ComponentInstance;
-import org.openecomp.sdc.be.model.ComponentInstancePropInput;
-import org.openecomp.sdc.be.model.InputDefinition;
-import org.openecomp.sdc.be.model.PropertyConstraint;
-import org.openecomp.sdc.be.model.PropertyDefinition;
-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.operations.impl.PropertyOperation;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.datatypes.PropertyReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-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.BaseRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.InputsRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.PropertyRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
-import org.openecomp.sdc.ci.tests.utils.validation.BaseValidationUtils;
-import org.testng.AssertJUnit;
-import org.testng.annotations.Test;
-
-/**
- * CI-Tests for inputs
- * @author il0695
- *
- */
-public class InputsApiTests extends ComponentBaseTest {
-
- private static String inputCsar1 = "FCGI_with_inputs.csar";
- private static String inputCsar2 = "LDSA1_with_inputs.csar";
- private static User sdncDesignerDetails = null;
-
- @Rule
- public static TestName name = new TestName();
-
- /**
- * Constructor
- */
- public InputsApiTests() {
- super(name, InputsApiTests.class.getName());
- sdncDesignerDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- }
-
- /**
- * Create VF with inputs from CSAR file
- *
- * @throws Exception
- */
- @Test
- public void testCreateResourceInstanceWithInputsFromCsar() throws Exception {
- Resource vf = AtomicOperationUtils.importResourceFromCsar(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, inputCsar1);
- assertTrue("Success creating VF from CSAR", !vf.getInputs().isEmpty());
- }
-
- /**
- * Create service and add to it VF instance with inputs
- *
- * @throws Exception
- */
- @Test
- public void testAddVfInstanceWithInputsToService() throws Exception {
- createServiceWithVFInstanceWithInputs();
- }
-
- /**
- * General test to check most functionality of inputs
- * <ul>
- * <li>Create service with VF instance that has inputs)</li>
- * <li>Get all inputs of VF instance</li>
- * <li>Add inputs to service</li>
- * <li>Get service inputs</li>
- * <li>Delete service inputs</li>
- * </ul>
- *
- * @throws Exception
- */
- @Test
- public void testInputsMainFunctionality() throws Exception {
- Service service = createServiceWithVFInstanceWithInputs();
- int totalInputsBeforeAdd = service.getInputs().size();
-
- // Get component instances
- RestResponse getInstancesResponse = ComponentInstanceRestUtils.getComponentInstances(ComponentTypeEnum.SERVICE, service.getUniqueId(), sdncDesignerDetails);
- BaseValidationUtils.checkSuccess(getInstancesResponse);
- List<ComponentInstance> serviceInstances = new Gson().fromJson(getInstancesResponse.getResponse(), new TypeToken<ArrayList<ComponentInstance>>(){}.getType());
-
- // Get all inputs of first instance
- ComponentInstance vfInstance = serviceInstances.get(0);
- RestResponse getComponentInstanceInputsResponse = InputsRestUtils.getComponentInstanceInputs(service, vfInstance);
- BaseValidationUtils.checkSuccess(getComponentInstanceInputsResponse);
- List<ComponentInstancePropInput> instanceInputs = new Gson().fromJson(getComponentInstanceInputsResponse.getResponse(), new TypeToken<ArrayList<ComponentInstancePropInput>>(){}.getType());
-
- // Take only the 2 first inputs
- List<ComponentInstancePropInput> inputsToAdd = instanceInputs.stream().limit(2).collect(Collectors.toList());
-
- // Build component instances input map to add to server
- ComponentInstInputsMap buildComponentInstInputsMap = buildComponentInstInputsMap(vfInstance.getUniqueId(), inputsToAdd);
- RestResponse addInputResponse = InputsRestUtils.addInput(service, buildComponentInstInputsMap, UserRoleEnum.DESIGNER);
- BaseValidationUtils.checkSuccess(addInputResponse);
-
- // Get service inputs count
- RestResponse getComponentInputsResponse = InputsRestUtils.getComponentInputs(service);
- BaseValidationUtils.checkSuccess(getComponentInputsResponse);
- List<InputDefinition> serviceInputsAfterAdd = new Gson().fromJson(getComponentInputsResponse.getResponse(), new TypeToken<ArrayList<InputDefinition>>(){}.getType());
- if (serviceInputsAfterAdd.size()-totalInputsBeforeAdd!=2) {
- assertTrue("Error adding inputs to service (service should have 2 inputs)", false);
- }
-
- // Delete 1 input from service
- RestResponse deleteInputFromComponentResponse = InputsRestUtils.deleteInputFromComponent(service, serviceInputsAfterAdd.get(0).getUniqueId());
- BaseValidationUtils.checkSuccess(deleteInputFromComponentResponse);
-
- // Get service inputs count after delete
- RestResponse getComponentInputsResponseAfterDelete = InputsRestUtils.getComponentInputs(service);
- BaseValidationUtils.checkSuccess(getComponentInputsResponseAfterDelete);
- List<InputDefinition> serviceInputsAfterDelete = new Gson().fromJson(getComponentInputsResponseAfterDelete.getResponse(), new TypeToken<ArrayList<InputDefinition>>(){}.getType());
- if (serviceInputsAfterDelete.size()-totalInputsBeforeAdd!=1) {
- assertTrue("Error deleting inputs from service (service should have 1 input)", false);
- }
-
- assertTrue("Success testing inputs main functionality", true);
- }
-
- /**
- * Private method to create service with VF instance that has inputs
- * This is private method to be used by multiple tests
- *
- * @return {@link org.openecomp.sdc.be.model}
- * @throws Exception
- * @throws IOException
- */
- private Service createServiceWithVFInstanceWithInputs() throws Exception, IOException {
- // Create default service
- Either<Service, RestResponse> createDefaultServiceEither = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true);
- if (createDefaultServiceEither.isRight()){
- assertTrue("Error creating default service", false);
- }
- Service service = createDefaultServiceEither.left().value();
-
- // Create VF from CSAR file
- Resource vfWithInputs = AtomicOperationUtils.importResourceFromCsar(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, inputCsar2);
-
- // Certify VF
- Pair<Component, RestResponse> changeComponentState = AtomicOperationUtils.changeComponentState(vfWithInputs, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
- assertTrue("response code is BaseRestUtils.STATUS_CODE_SUCCESS, returned :" + changeComponentState.getRight().getErrorCode(), changeComponentState.getRight().getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
-
- // Add VF instance to service
- Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainerEither = AtomicOperationUtils.addComponentInstanceToComponentContainer(vfWithInputs, service, UserRoleEnum.DESIGNER, true);
- if (addComponentInstanceToComponentContainerEither.isRight()){
- assertTrue("Error adding VF to service", false);
- }
-
- // Get service response
- ServiceReqDetails serviceDetails = new ServiceReqDetails(service);
- RestResponse getServiceResponse = ServiceRestUtils.getService(serviceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- service = ResponseParser.parseToObjectUsingMapper(getServiceResponse.getResponse(), Service.class);
-
- // Get VF instance from service
- ComponentInstance vfInstance = service.getComponentInstances().get(0);
- if (vfInstance!=null){
- assertTrue("Success creating service with VF instance", true);
- } else {
- assertTrue("Error creating service with VF instance", false);
- }
- return service;
- }
-
- /**
- * Return default ComponentInstInputsMap
- *
- * @param addToInput
- * @param inputs
- * @return {@link org.openecomp.sdc.be.model.ComponentInstInputsMap}
- */
- private ComponentInstInputsMap buildComponentInstInputsMap (String addToInput, List<ComponentInstancePropInput> inputs) {
- Map<String, List<ComponentInstancePropInput>> map = new HashMap<>();
- map.put(addToInput, inputs);
- ComponentInstInputsMap componentInstInputsMap = new ComponentInstInputsMap();
- componentInstInputsMap.setComponentInstanceInputsMap(map);
- return componentInstInputsMap;
- }
-
-
- @Test
- public void validateValidValueConstraintOnInputFailTest() throws Exception {
- Either<Service, RestResponse> createDefaultServiceEither = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true);
- if (createDefaultServiceEither.isRight()){
- assertTrue("Error creating default service", false);
- }
- Service service = createDefaultServiceEither.left().value();
-
- String body = "{\"SubnetProp\": {\"schema\": {\"property\": {\"type\": \"\"}},\"type\": \"org.openecomp"
- + ".datatypes.heat.network.neutron.Subnet\",\"name\": \"SubnetProp\"}}";
- RestResponse createPropertyResponse = PropertyRestUtils.createProperty(service.getUniqueId(), body,
- sdncDesignerDetails);
- AssertJUnit.assertEquals("Expected result code - 200, received - " + createPropertyResponse.getErrorCode(), 200,
- (int) createPropertyResponse.getErrorCode());
-
- ObjectMapper mapper = new ObjectMapper();
- mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
- mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- PropertyReqDetails propertyResponseObject = mapper.readValue(createPropertyResponse.getResponse(),
- PropertyReqDetails.class);
-
- PropertyDefinition input = new PropertyDefinition();
- input.setName("ipv6_address_mode");
- input.setType("string");
- input.setUniqueId("org.openecomp.datatypes.heat.network.neutron.Subnet.datatype.ipv6_address_mode");
-
- ComponentInstancePropInput componentInstancePropInput = new ComponentInstancePropInput();
- componentInstancePropInput.setPropertiesName("SubnetProp#ipv6_address_mode");
- componentInstancePropInput.setName("SubnetProp");
- componentInstancePropInput.setParentUniqueId(service.getUniqueId());
- componentInstancePropInput.setType("org.openecomp.datatypes.heat.network.neutron.Subnet");
- componentInstancePropInput.setUniqueId(propertyResponseObject.getUniqueId());
- componentInstancePropInput.setInput(input);
-
- ComponentInstInputsMap componentInstInputsMap = new ComponentInstInputsMap();
- componentInstInputsMap.setServiceProperties(Collections.singletonMap(service.getUniqueId(),
- Collections.singletonList(componentInstancePropInput)));
- RestResponse addInputResponse = InputsRestUtils.addInput(service, componentInstInputsMap,
- UserRoleEnum.DESIGNER);
-
- AssertJUnit.assertEquals("Expected result code - 200, received - " + addInputResponse.getErrorCode(),
- 200, (int) addInputResponse.getErrorCode());
-
- Type constraintType = new TypeToken<PropertyConstraint>() {}.getType();
- Type inDefType = new TypeToken<List<InputDefinition>>() { }.getType();
- Gson gson = new GsonBuilder().registerTypeAdapter(constraintType, new PropertyOperation.PropertyConstraintDeserialiser()).create();
- try {
- List<InputDefinition> inputDefinitions = gson.fromJson(addInputResponse.getResponse(),
- inDefType);
-
- inputDefinitions.get(0).setDefaultValue("Fail");
-
- RestResponse updateInputResponse = InputsRestUtils.updateInput(service, mapper.writeValueAsString(inputDefinitions),
- UserRoleEnum.DESIGNER);
-
- AssertJUnit.assertEquals("Expected result code - 400, received - " + addInputResponse.getErrorCode(),
- 400, (int) updateInputResponse.getErrorCode());
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- @Test
- public void validateValidValueConstraintOnInputSuccessTest() throws Exception {
- Either<Service, RestResponse> createDefaultServiceEither = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true);
- if (createDefaultServiceEither.isRight()){
- assertTrue("Error creating default service", false);
- }
- Service service = createDefaultServiceEither.left().value();
-
- String body = "{\"SubnetProp\": {\"schema\": {\"property\": {\"type\": \"\"}},\"type\": \"org.openecomp"
- + ".datatypes.heat.network.neutron.Subnet\",\"name\": \"SubnetProp\"}}";
- RestResponse createPropertyResponse = PropertyRestUtils.createProperty(service.getUniqueId(), body,
- sdncDesignerDetails);
- AssertJUnit.assertEquals("Expected result code - 200, received - " + createPropertyResponse.getErrorCode(), 200,
- (int) createPropertyResponse.getErrorCode());
-
- ObjectMapper mapper = new ObjectMapper();
- mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
- mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- PropertyReqDetails propertyResponseObject = mapper.readValue(createPropertyResponse.getResponse(),
- PropertyReqDetails.class);
-
- PropertyDefinition input = new PropertyDefinition();
- input.setName("ipv6_address_mode");
- input.setType("string");
- input.setUniqueId("org.openecomp.datatypes.heat.network.neutron.Subnet.datatype.ipv6_address_mode");
-
- ComponentInstancePropInput componentInstancePropInput = new ComponentInstancePropInput();
- componentInstancePropInput.setPropertiesName("SubnetProp#ipv6_address_mode");
- componentInstancePropInput.setName("SubnetProp");
- componentInstancePropInput.setParentUniqueId(service.getUniqueId());
- componentInstancePropInput.setType("org.openecomp.datatypes.heat.network.neutron.Subnet");
- componentInstancePropInput.setUniqueId(propertyResponseObject.getUniqueId());
- componentInstancePropInput.setInput(input);
-
- ComponentInstInputsMap componentInstInputsMap = new ComponentInstInputsMap();
- componentInstInputsMap.setServiceProperties(Collections.singletonMap(service.getUniqueId(),
- Collections.singletonList(componentInstancePropInput)));
- RestResponse addInputResponse = InputsRestUtils.addInput(service, componentInstInputsMap,
- UserRoleEnum.DESIGNER);
-
- AssertJUnit.assertEquals("Expected result code - 200, received - " + addInputResponse.getErrorCode(),
- 200, (int) addInputResponse.getErrorCode());
-
- Type constraintType = new TypeToken<PropertyConstraint>() {}.getType();
- Type inDefType = new TypeToken<List<InputDefinition>>() { }.getType();
- Gson gson = new GsonBuilder().registerTypeAdapter(constraintType, new PropertyOperation.PropertyConstraintDeserialiser()).create();
- try {
- List<InputDefinition> inputDefinitions = gson.fromJson(addInputResponse.getResponse(),
- inDefType);
-
- inputDefinitions.get(0).setDefaultValue("slaac");
-
- RestResponse updateInputResponse = InputsRestUtils.updateInput(service, mapper.writeValueAsString(inputDefinitions),
- UserRoleEnum.DESIGNER);
-
- AssertJUnit.assertEquals("Expected result code - 200, received - " + addInputResponse.getErrorCode(),
- 200, (int) updateInputResponse.getErrorCode());
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/interfaceoperation/InterfaceOperationsTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/interfaceoperation/InterfaceOperationsTest.java
deleted file mode 100644
index b9ca9f0d81..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/interfaceoperation/InterfaceOperationsTest.java
+++ /dev/null
@@ -1,401 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.interfaceoperation;
-
-import static org.testng.AssertJUnit.fail;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import fj.data.Either;
-import org.apache.commons.collections4.CollectionUtils;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.datatypes.elements.ListDataDefinition;
-import org.openecomp.sdc.be.datatypes.elements.OperationInputDefinition;
-import org.openecomp.sdc.be.datatypes.elements.OperationOutputDefinition;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.InputDefinition;
-import org.openecomp.sdc.be.model.InterfaceDefinition;
-import org.openecomp.sdc.be.model.Operation;
-import org.openecomp.sdc.be.model.PropertyDefinition;
-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.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-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.BaseRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.InterfaceOperationsRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
-import org.testng.Assert;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-public class InterfaceOperationsTest extends ComponentBaseTest {
-
- @Rule
- private static final TestName name = new TestName();
- private static final String INTERFACES = "interfaces";
- private static final String TOSCA_PRESENTATION = "toscaPresentation";
- private static final User user = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- private static final String WORKFLOW_ID_STR = "WorkflowId";
- private static final String WORKFLOW_VERSION_ID_STR = "workflowVersionId";
- private static final String WORKFLOW_ASSOCIATION_TYPE_NONE_STR = "NONE";
-
- private static Service service;
- private static Resource resource;
- private static Resource pnfResource;
- private String resourceInterfaceUniqueId;
- private String resourceOperationUniqueId;
- private String pnfResourceInterfaceUniqueId;
- private String pnfResourceOperationUniqueId;
- private String serviceInterfaceUniqueId;
- private String serviceOperationUniqueId;
-
- public InterfaceOperationsTest() {
- super(name, InterfaceOperationsTest.class.getName());
- }
-
- @BeforeClass
- public static void init() throws Exception {
- // Create default service
- Either<Service, RestResponse> createDefaultServiceEither =
- AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true);
- if (createDefaultServiceEither.isRight()) {
- fail("Error creating default service");
- }
- service = createDefaultServiceEither.left().value();
-
- // Create default resource
- Either<Resource, RestResponse> createDefaultResourceEither =
- AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true);
- if (createDefaultResourceEither.isRight()) {
- fail("Error creating default resource");
- }
- resource = createDefaultResourceEither.left().value();
-
- // Create default PNF resource
- Either<Resource, RestResponse> createDefaultPNFResourceEither =
- AtomicOperationUtils.createResourceByType(ResourceTypeEnum.PNF, UserRoleEnum.DESIGNER, true);
- if (createDefaultPNFResourceEither.isRight()) {
- fail("Error creating default pnf resource");
- }
- pnfResource = createDefaultPNFResourceEither.left().value();
- }
-
- public Map<String, Object> buildInterfaceDefinitionForResource(Resource resource,
- String resourceInterfaceUniqueId,
- String resourceOperationUniqueId) {
- Operation operation = new Operation();
- operation.setName("TestOperationOnResource");
- operation.setWorkflowId(WORKFLOW_ID_STR);
- operation.setWorkflowVersionId(WORKFLOW_VERSION_ID_STR);
- operation.setWorkflowAssociationType(WORKFLOW_ASSOCIATION_TYPE_NONE_STR);
- if(CollectionUtils.isNotEmpty(resource.getInputs())){
- PropertyDefinition property =
- resource.getInputs().stream().filter(a -> a.getName().equalsIgnoreCase("nf_naming")).findFirst()
- .orElse(new InputDefinition());
- ListDataDefinition<OperationInputDefinition> operationInputDefinitionList = new ListDataDefinition<>();
- operationInputDefinitionList.add(createOperationInputDefinition("TestInput1", property.getUniqueId()));
- operation.setInputs(operationInputDefinitionList);
- }
- ListDataDefinition<OperationOutputDefinition> operationOutputDefinitionList = new ListDataDefinition<>();
- operationOutputDefinitionList.add(createOperationOutputDefinition("TestOutput1"));
- operation.setOutputs(operationOutputDefinitionList);
- return buildInterfaceDefinitionMap(operation, "TestInterface", resourceInterfaceUniqueId,
- resourceOperationUniqueId);
- }
-
- private Map<String, Object> buildInterfaceDefinitionOfGlobalTypeForResource(Resource resource) {
- Operation operation = new Operation();
- operation.setName("create");
- operation.setWorkflowId(WORKFLOW_ID_STR);
- operation.setWorkflowVersionId(WORKFLOW_VERSION_ID_STR);
- operation.setWorkflowAssociationType("NONE");
- if(CollectionUtils.isNotEmpty(resource.getInputs())){
- PropertyDefinition property =
- resource.getInputs().stream().filter(a -> a.getName().equalsIgnoreCase("nf_naming")).findFirst()
- .orElse(new InputDefinition());
- ListDataDefinition<OperationInputDefinition> operationInputDefinitionList = new ListDataDefinition<>();
- operationInputDefinitionList.add(createOperationInputDefinition("TestInput1", property.getUniqueId()));
- operation.setInputs(operationInputDefinitionList);
- }
- ListDataDefinition<OperationOutputDefinition> operationOutputDefinitionList = new ListDataDefinition<>();
- operationOutputDefinitionList.add(createOperationOutputDefinition("TestOutput1"));
- operation.setOutputs(operationOutputDefinitionList);
- return buildInterfaceDefinitionMap(operation, "tosca.interfaces.node.lifecycle.Standard",
- resourceInterfaceUniqueId, resourceOperationUniqueId);
- }
-
- private OperationInputDefinition createOperationInputDefinition(String name, String inputId) {
- OperationInputDefinition operationInputDefinition = new OperationInputDefinition();
- operationInputDefinition.setName(name);
- operationInputDefinition.setInputId(inputId);
- operationInputDefinition.setRequired(true);
- operationInputDefinition.setType("string");
- return operationInputDefinition;
- }
-
- private OperationOutputDefinition createOperationOutputDefinition(String name) {
- OperationOutputDefinition operationOutputDefinition = new OperationOutputDefinition();
- operationOutputDefinition.setName(name);
- operationOutputDefinition.setRequired(true);
- operationOutputDefinition.setType("string");
- return operationOutputDefinition;
- }
-
- private Map<String, Object> buildInterfaceDefinitionMap(Operation operation, String interfaceType,
- String interfaceId,
- String operationId) {
- if (operationId != null) {
- operation.setUniqueId(operationId);
- }
- Map<String, Operation> operationMap = new HashMap<>();
- operationMap.put(operation.getName(), operation);
-
- InterfaceDefinition interfaceDefinition = new InterfaceDefinition();
- interfaceDefinition.setType(interfaceType);
- interfaceDefinition.setOperationsMap(operationMap);
- if (interfaceId != null) {
- interfaceDefinition.setUniqueId(interfaceId);
- }
- interfaceDefinition.setOperationsMap(operationMap);
-
- Map<String, Object> interfaceDefAsMap = getObjectAsMap(interfaceDefinition);
- Map<String, Object> interfaceMap = new HashMap<>();
- interfaceMap.put(interfaceDefinition.getType(), interfaceDefAsMap);
- Map<String, Object> outerMap = new HashMap<>();
- outerMap.put(INTERFACES, interfaceMap);
- return outerMap;
- }
-
- private static Map<String, Object> getObjectAsMap(Object obj) {
- ObjectMapper objectMapper = new ObjectMapper();
- if (obj instanceof InterfaceDefinition) {
- objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
- }
- Map<String, Object> objectAsMap =
- obj instanceof Map ? (Map<String, Object>) obj : objectMapper.convertValue(obj, Map.class);
- objectAsMap.remove(TOSCA_PRESENTATION);
- return objectAsMap;
- }
-
- public Map<String, Object> buildInterfaceDefinitionForService() {
- Operation operation = new Operation();
- operation.setName("TestOperationOnService");
- operation.setWorkflowId(WORKFLOW_ID_STR);
- operation.setWorkflowVersionId(WORKFLOW_VERSION_ID_STR);
- operation.setWorkflowAssociationType("NONE");
- return buildInterfaceDefinitionMap(operation, "TestInterface", serviceInterfaceUniqueId,
- serviceOperationUniqueId);
- }
-
- @Test
- public void addInterfaceOperationsOnResource() throws Exception {
- RestResponse restResponse = InterfaceOperationsRestUtils
- .addInterfaceOperations(resource,
- buildInterfaceDefinitionForResource(resource, resourceInterfaceUniqueId,
- resourceOperationUniqueId), user);
- logger.info("addInterfaceOperationsOnResource Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- String interfaceDefinitionStr = ResponseParser.getListFromJson(restResponse, INTERFACES).get(0).toString();
- InterfaceDefinition interfaceDefinition =
- ResponseParser.convertInterfaceDefinitionResponseToJavaObject(interfaceDefinitionStr);
- resourceInterfaceUniqueId = interfaceDefinition.getUniqueId();
- resourceOperationUniqueId = interfaceDefinition.getOperationsMap().keySet().stream().findFirst().orElse(null);
- }
-
- @Test(dependsOnMethods = "addInterfaceOperationsOnResource")
- public void getInterfaceOperationsFromResource() throws Exception {
- RestResponse restResponse = InterfaceOperationsRestUtils
- .getInterfaceOperations(resource, resourceInterfaceUniqueId,
- resourceOperationUniqueId, user);
- logger.info("getInterfaceOperationsFromResource Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- @Test(dependsOnMethods = "getInterfaceOperationsFromResource")
- public void updateInterfaceOperationsOnResource() throws Exception {
- RestResponse restResponse = InterfaceOperationsRestUtils
- .updateInterfaceOperations(resource,
- buildInterfaceDefinitionForResource(resource, resourceInterfaceUniqueId, resourceOperationUniqueId),
- user);
- logger.info("updateInterfaceOperationsOnResource Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- @Test(dependsOnMethods = "updateInterfaceOperationsOnResource")
- public void deleteInterfaceOperationsFromResource() throws Exception {
- RestResponse restResponse = InterfaceOperationsRestUtils
- .deleteInterfaceOperations(resource, resourceInterfaceUniqueId,
- resourceOperationUniqueId, user);
- logger.info("deleteInterfaceOperationsFromResource Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- @Test
- public void addInterfaceOperationsOnPNFResource() throws Exception {
- RestResponse restResponse = InterfaceOperationsRestUtils
- .addInterfaceOperations(pnfResource, buildInterfaceDefinitionForResource(pnfResource, pnfResourceInterfaceUniqueId,
- pnfResourceOperationUniqueId), user);
- logger.info("addInterfaceOperationsOnPNFResource Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- String interfaceDefinitionStr = ResponseParser.getListFromJson(restResponse, INTERFACES).get(0).toString();
- InterfaceDefinition interfaceDefinition =
- ResponseParser.convertInterfaceDefinitionResponseToJavaObject(interfaceDefinitionStr);
- pnfResourceInterfaceUniqueId = interfaceDefinition.getUniqueId();
- pnfResourceOperationUniqueId =
- interfaceDefinition.getOperationsMap().keySet().stream().findFirst().orElse(null);
- }
-
- @Test(dependsOnMethods = "addInterfaceOperationsOnPNFResource")
- public void getInterfaceOperationsFromPNFResource() throws Exception {
- RestResponse restResponse = InterfaceOperationsRestUtils
- .getInterfaceOperations(pnfResource, pnfResourceInterfaceUniqueId,
- pnfResourceOperationUniqueId, user);
- logger.info("getInterfaceOperationsFromPNFResource Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- @Test(dependsOnMethods = "getInterfaceOperationsFromPNFResource")
- public void updateInterfaceOperationsOnPNFResource() throws Exception {
- RestResponse restResponse = InterfaceOperationsRestUtils
- .updateInterfaceOperations(pnfResource,
- buildInterfaceDefinitionForResource(pnfResource, pnfResourceInterfaceUniqueId,
- pnfResourceOperationUniqueId), user);
- logger.info("updateInterfaceOperationsOnPNFResource Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- @Test(dependsOnMethods = "updateInterfaceOperationsOnPNFResource")
- public void deleteInterfaceOperationsFromPNFResource() throws Exception {
- RestResponse restResponse = InterfaceOperationsRestUtils
- .deleteInterfaceOperations(pnfResource, pnfResourceInterfaceUniqueId,
- pnfResourceOperationUniqueId, user);
- logger.info("deleteInterfaceOperationsFromPNFResource Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- @Test
- public void testCreateOperationWithLocalInterfaceAndDownloadArtifact() throws Exception{
- Either<Service, RestResponse> createDefaultServiceEither =
- AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true);
- if (createDefaultServiceEither.isRight()) {
- fail("Error creating default service");
- }
- Service service = createDefaultServiceEither.left().value();
- String serviceUniqueId = service.getUniqueId();
- Operation operation = new Operation();
- operation.setName("LocalOper");
- operation.setWorkflowAssociationType("NONE");
- Map<String, Object> interfaceOperationMap = buildInterfaceDefinitionMap(operation, "Local", null, null);
-
- RestResponse restResponse = InterfaceOperationsRestUtils.addInterfaceOperations(service, interfaceOperationMap,
- user);
-
- Integer responseCode = restResponse.getErrorCode();
- Integer expectedCode = 200;
- Assert.assertEquals(responseCode, expectedCode);
-
- service = ResponseParser.convertServiceResponseToJavaObject(
- ServiceRestUtils.getServiceToscaArtifacts(service.getUniqueId()).getResponse());
- service.setUniqueId(serviceUniqueId);
- service.setComponentType(ComponentTypeEnum.SERVICE);
- service.setLastUpdaterUserId(user.getUserId());
- Either<String, RestResponse> responseEither = AtomicOperationUtils
- .getComponenetArtifactPayload(service, "assettoscacsar");
-
- Assert.assertTrue(responseEither.isLeft());
- }
-
- @Test
- public void addInterfaceOperationsOnService() throws Exception {
- RestResponse restResponse = InterfaceOperationsRestUtils
- .addInterfaceOperations(service, buildInterfaceDefinitionForService(),
- user);
- logger.info("addInterfaceOperationsOnService Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- String interfaceDefinitionStr = ResponseParser.getListFromJson(restResponse, INTERFACES).get(0).toString();
- InterfaceDefinition interfaceDefinition =
- ResponseParser.convertInterfaceDefinitionResponseToJavaObject(interfaceDefinitionStr);
- serviceInterfaceUniqueId = interfaceDefinition.getUniqueId();
- serviceOperationUniqueId = interfaceDefinition.getOperationsMap().keySet().stream().findFirst().orElse(null);
- }
-
- @Test(dependsOnMethods = "addInterfaceOperationsOnService")
- public void getInterfaceOperationsFromService() throws Exception {
- RestResponse restResponse = InterfaceOperationsRestUtils
- .getInterfaceOperations(service, serviceInterfaceUniqueId,
- serviceOperationUniqueId, user);
- logger.info("getInterfaceOperationsFromService Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- @Test(dependsOnMethods = "getInterfaceOperationsFromService")
- public void updateInterfaceOperationsOnService() throws Exception {
- RestResponse restResponse = InterfaceOperationsRestUtils
- .updateInterfaceOperations(service, buildInterfaceDefinitionForService(),
- user);
- logger.info("updateInterfaceOperations Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- @Test(dependsOnMethods = "updateInterfaceOperationsOnService")
- public void deleteInterfaceOperationsFromService() throws Exception {
- RestResponse restResponse = InterfaceOperationsRestUtils
- .deleteInterfaceOperations(service, serviceInterfaceUniqueId,
- serviceOperationUniqueId, user);
- logger.info("deleteInterfaceOperations Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- @Test
- public void addInterfaceOperationsOfGlobalTypeOnResource() throws Exception {
- RestResponse restResponse =
- InterfaceOperationsRestUtils.addInterfaceOperations(resource,
- buildInterfaceDefinitionOfGlobalTypeForResource(resource), user);
-
- logger.info("addInterfaceOperationsOnResource Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- @Test
- public void addInterfaceOperationsOfGlobalTypeOnPNFResource() throws Exception {
- RestResponse restResponse =
- InterfaceOperationsRestUtils.addInterfaceOperations(pnfResource,
- buildInterfaceDefinitionOfGlobalTypeForResource(pnfResource), user);
-
- logger.info("addInterfaceOperationsOnPNFResource Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- String interfaceDefinitionStr = ResponseParser.getListFromJson(restResponse, INTERFACES).get(0).toString();
- InterfaceDefinition interfaceDefinition =
- ResponseParser.convertInterfaceDefinitionResponseToJavaObject(interfaceDefinitionStr);
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/lifecycle/LCSbaseTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/lifecycle/LCSbaseTest.java
deleted file mode 100644
index b623aea33b..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/lifecycle/LCSbaseTest.java
+++ /dev/null
@@ -1,263 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.lifecycle;
-
-
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.model.LifecycleStateEnum;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.*;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.ArtifactUtils;
-import org.openecomp.sdc.ci.tests.utils.DbUtils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.*;
-import org.testng.annotations.BeforeMethod;
-
-import java.io.IOException;
-
-import static org.testng.AssertJUnit.*;
-
-/**
- * @author al714h
- * <p>
- * resourceDetails - create, Add Heat, certify resourceDetails1 - create
- * resource, LCS - CheckOut serviceDetails - create, add RI from
- * resourceDetails serviceDetails2 - create, add RI from resourceDetails
- * serviceDetailsEmpty - create, LCS - CheckOut serviceDetailsEmpty2 -
- * create, LCS - CheckOut
- */
-public abstract class LCSbaseTest extends ComponentBaseTest {
-
- protected ResourceReqDetails resourceDetails;
- protected ResourceReqDetails resourceDetails1;
- protected ServiceReqDetails serviceDetails;
- protected ServiceReqDetails serviceDetails2;
- protected ServiceReqDetails serviceDetailsEmpty;
- protected ServiceReqDetails serviceDetailsEmpty2;
- protected ComponentInstanceReqDetails componentInstanceReqDetails;
- protected ComponentInstanceReqDetails resourceInstanceReqDetails2;
- protected User sdncDesignerDetails1;
- protected User sdncDesignerDetails2;
- protected static User sdncTesterDeatails1;
- protected User sdncAdminDetails1;
- protected ArtifactReqDetails heatArtifactDetails;
- protected ArtifactReqDetails heatVolArtifactDetails;
- protected ArtifactReqDetails heatNetArtifactDetails;
-
- protected ArtifactReqDetails defaultArtifactDetails;
-
- protected ArtifactUtils artifactUtils;
-
- // protected static ServiceUtils serviceUtils = new ServiceUtils();
- public LCSbaseTest(TestName testName, String className) {
- super(testName, className);
- }
-
- @BeforeMethod
- public void before() throws Exception {
-
- initializeMembers();
-
- createComponents();
-
- }
-
- public void initializeMembers() throws IOException, Exception {
- resourceDetails = ElementFactory.getDefaultResource();
- // resourceDetails =
- // ElementFactory.getDefaultResource("myNewResource1234567890",
- // NormativeTypesEnum.ROOT, ResourceServiceCategoriesEnum.ROUTERS,
- // UserRoleEnum.DESIGNER.getUserId());
- resourceDetails1 = ElementFactory.getDefaultResource("secondResource", NormativeTypesEnum.ROOT);
- serviceDetails = ElementFactory.getDefaultService();
- serviceDetails2 = ElementFactory.getDefaultService("newTestService2", ServiceCategoriesEnum.MOBILITY, "al1976", ServiceInstantiationType.A_LA_CARTE.getValue());
- serviceDetailsEmpty = ElementFactory.getDefaultService("newEmptyService", ServiceCategoriesEnum.MOBILITY,
- "al1976", ServiceInstantiationType.A_LA_CARTE.getValue());
- serviceDetailsEmpty2 = ElementFactory.getDefaultService("newEmptyService2", ServiceCategoriesEnum.MOBILITY,
- "al1976", ServiceInstantiationType.A_LA_CARTE.getValue());
- sdncDesignerDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- sdncDesignerDetails2 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER2);
- sdncTesterDeatails1 = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
- sdncAdminDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- heatArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
- heatNetArtifactDetails = ElementFactory
- .getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT_NET.getType());
- heatVolArtifactDetails = ElementFactory
- .getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT_VOL.getType());
- componentInstanceReqDetails = ElementFactory.getDefaultComponentInstance();
- resourceInstanceReqDetails2 = ElementFactory.getDefaultComponentInstance();
-
- }
-
- protected void createComponents() throws Exception {
-
- RestResponse response = ResourceRestUtils.createResource(resourceDetails1, sdncDesignerDetails1);
- assertTrue("create request returned status:" + response.getErrorCode(), response.getErrorCode() == 201);
- assertNotNull("resource uniqueId is null:", resourceDetails1.getUniqueId());
-
- response = ResourceRestUtils.createResource(resourceDetails, sdncDesignerDetails1);
- assertTrue("create request returned status:" + response.getErrorCode(), response.getErrorCode() == 201);
- assertNotNull("resource uniqueId is null:", resourceDetails.getUniqueId());
-
- response = ServiceRestUtils.createService(serviceDetails, sdncDesignerDetails1);
- assertTrue("create request returned status:" + response.getErrorCode(), response.getErrorCode() == 201);
- assertNotNull("service uniqueId is null:", serviceDetails.getUniqueId());
-
- ArtifactReqDetails heatArtifactDetails = ElementFactory
- .getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
- response = ArtifactRestUtils.addInformationalArtifactToResource(heatArtifactDetails, sdncDesignerDetails1,
- resourceDetails.getUniqueId());
- assertTrue("add HEAT artifact to resource request returned status:" + response.getErrorCode(),
- response.getErrorCode() == 200);
-
- // certified resource
- response = LCSbaseTest.certifyResource(resourceDetails, sdncDesignerDetails1);
- assertTrue("certify resource request returned status:" + response.getErrorCode(),
- response.getErrorCode() == 200);
-
- // add resource instance with HEAT deployment artifact to the service
- componentInstanceReqDetails.setComponentUid(resourceDetails.getUniqueId());
- response = ComponentInstanceRestUtils.createComponentInstance(componentInstanceReqDetails, sdncDesignerDetails1,
- serviceDetails.getUniqueId(), ComponentTypeEnum.SERVICE);
- assertTrue("response code is not 201, returned: " + response.getErrorCode(), response.getErrorCode() == 201);
-
- response = ServiceRestUtils.createService(serviceDetails2, sdncDesignerDetails1);
- assertTrue("create request returned status:" + response.getErrorCode(), response.getErrorCode() == 201);
- assertNotNull("service uniqueId is null:", serviceDetails2.getUniqueId());
-
- componentInstanceReqDetails.setComponentUid(resourceDetails.getUniqueId());
- response = ComponentInstanceRestUtils.createComponentInstance(componentInstanceReqDetails, sdncDesignerDetails1,
- serviceDetails2.getUniqueId(), ComponentTypeEnum.SERVICE);
- assertTrue("response code is not 201, returned: " + response.getErrorCode(), response.getErrorCode() == 201);
-
- response = ServiceRestUtils.createService(serviceDetailsEmpty, sdncDesignerDetails1);
- assertTrue("create request returned status:" + response.getErrorCode(), response.getErrorCode() == 201);
- assertNotNull("service uniqueId is null:", serviceDetailsEmpty.getUniqueId());
-
- response = ServiceRestUtils.createService(serviceDetailsEmpty2, sdncDesignerDetails1);
- assertTrue("create request returned status:" + response.getErrorCode(), response.getErrorCode() == 201);
- assertNotNull("service uniqueId is null:", serviceDetailsEmpty2.getUniqueId());
-
- DbUtils.cleanAllAudits();
-
- }
-
- public static RestResponse certifyResource(ResourceReqDetails resourceDetails, User user) throws Exception {
-/* RestResponse restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails, user.getUserId(),
- LifeCycleStatesEnum.CHECKIN);
- // if (restResponseResource.getErrorCode() == 200){
- restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails, user.getUserId(),
- LifeCycleStatesEnum.CERTIFICATIONREQUEST);
- // }else
- // return restResponseResource;
- sdncTesterDeatails1 = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
- if (restResponseResource.getErrorCode() == 200) {
- restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails,
- sdncTesterDeatails1.getUserId(), LifeCycleStatesEnum.STARTCERTIFICATION);
- } else
- return restResponseResource;
- if (restResponseResource.getErrorCode() == 200) {
- restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails,
- sdncTesterDeatails1.getUserId(), LifeCycleStatesEnum.CERTIFY);
- }
- return restResponseResource;*/
- return LifecycleRestUtils.changeResourceState(resourceDetails,
- sdncTesterDeatails1.getUserId(), LifeCycleStatesEnum.CERTIFY);
- }
-
- public static RestResponse certifyService(ServiceReqDetails serviceDetails, User user) throws Exception {
- RestResponse restResponseService = LifecycleRestUtils.changeServiceState(serviceDetails, user,
- LifeCycleStatesEnum.CHECKIN);
- // if (restResponseService.getErrorCode() == 200){
- restResponseService = LifecycleRestUtils.changeServiceState(serviceDetails, user,
- LifeCycleStatesEnum.CERTIFICATIONREQUEST);
- // }else
- // return restResponseService;
-
- sdncTesterDeatails1 = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
- if (restResponseService.getErrorCode() == 200) {
- restResponseService = LifecycleRestUtils.changeServiceState(serviceDetails, sdncTesterDeatails1,
- LifeCycleStatesEnum.STARTCERTIFICATION);
- } else
- return restResponseService;
- if (restResponseService.getErrorCode() == 200) {
- restResponseService = LifecycleRestUtils.changeServiceState(serviceDetails, sdncTesterDeatails1,
- LifeCycleStatesEnum.CERTIFY);
- }
- return restResponseService;
- }
-
- protected static RestResponse raiseResourceToTargetVersion(ResourceReqDetails resourceDetails, String targetVersion,
- User user) throws Exception {
- return raiseResourceToTargetVersion(resourceDetails, targetVersion, null, user);
- }
-
- protected static RestResponse raiseResourceToTargetVersion(ResourceReqDetails resourceDetails, String targetVersion,
- RestResponse prevResponse, User user) throws Exception {
-
- String[] splitParts = targetVersion.split("\\.");
-
- int version = Integer.parseInt(splitParts[1]);
- String checkinComment = "good checkin";
- String checkinComentJson = "{\"userRemarks\": \"" + checkinComment + "\"}";
-
- if (prevResponse != null) {
- Resource resourceRespJavaObject = ResponseParser
- .convertResourceResponseToJavaObject(prevResponse.getResponse());
- if (resourceRespJavaObject.getLifecycleState().equals(LifecycleStateEnum.CERTIFIED)) {
- RestResponse restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails,
- user.getUserId(), LifeCycleStatesEnum.CHECKOUT);
- }
- }
-
- RestResponse restResponseResource = null;
- for (int i = 0; i < (version - 1); i++) {
-
- restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails, user, null,
- LifeCycleStatesEnum.CHECKIN, checkinComentJson);
- if (restResponseResource.getErrorCode() == 200) {
- restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails, user.getUserId(),
- LifeCycleStatesEnum.CHECKOUT);
- if (restResponseResource.getErrorCode() == 200) {
-
- } else
- break;
-
- } else
- break;
-
- }
-
- restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails, user, null,
- LifeCycleStatesEnum.CHECKIN, checkinComentJson);
- assertEquals("Check response code ", 200, restResponseResource.getErrorCode().intValue());
- return restResponseResource;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductBaseTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductBaseTest.java
deleted file mode 100644
index 1e1a197e40..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductBaseTest.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.product;
-
-import com.google.gson.Gson;
-import com.google.gson.reflect.TypeToken;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.be.model.category.CategoryDefinition;
-import org.openecomp.sdc.be.model.category.GroupingDefinition;
-import org.openecomp.sdc.be.model.category.SubCategoryDefinition;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.CategoryRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.testng.annotations.BeforeMethod;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.PRODUCT_COMPONENT_TYPE;
-
-public abstract class ProductBaseTest extends ComponentBaseTest {
- User productStrategistUser1;
- User productStrategistUser2;
- User productStrategistUser3;
- User productManager1;
- User productManager2;
- User adminUser;
- User designerUser;
-
- // Category1->Subcategory1->Grouping1
- protected List<CategoryDefinition> defaultCategories;
-
- protected static String auditAction;
- protected static ComponentOperationEnum operation;
-
- public ProductBaseTest(TestName testName, String className) {
- super(testName, className);
- }
-
- @BeforeMethod
- public void beforeProductTest() throws IOException, Exception {
- productStrategistUser1 = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST1);
- productStrategistUser2 = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST2);
- productStrategistUser3 = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST3);
- productManager1 = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1);
- productManager2 = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER2);
- adminUser = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- designerUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- createDefaultChain();
- }
-
- private void createDefaultChain() throws Exception {
- CategoryDefinition productCategoryDefinition = ElementFactory.getDefaultCategory();
- SubCategoryDefinition productSubCategoryDefinition = ElementFactory.getDefaultSubCategory();
- GroupingDefinition productGroupingDefinition = ElementFactory.getDefaultGroup();
- productCategoryDefinition.addSubCategory(productSubCategoryDefinition);
- productSubCategoryDefinition.addGrouping(productGroupingDefinition);
- List<CategoryDefinition> definitionsList = new ArrayList<>();
- definitionsList.add(productCategoryDefinition);
- defaultCategories = createCategoriesChain(definitionsList);
- }
-
- private List<CategoryDefinition> createCategoriesChain(List<CategoryDefinition> categoryDefinitions)
- throws Exception {
- for (CategoryDefinition categoryDefinition : categoryDefinitions) {
- RestResponse createCategory = CategoryRestUtils.createCategory(categoryDefinition, productStrategistUser1,
- PRODUCT_COMPONENT_TYPE);
- int status = createCategory.getErrorCode().intValue();
- if (status == BaseRestUtils.STATUS_CODE_CREATED) {
- String categoryId = ResponseParser.getUniqueIdFromResponse(createCategory);
- categoryDefinition.setUniqueId(categoryId);
- }
- List<SubCategoryDefinition> subcategories = categoryDefinition.getSubcategories();
- for (SubCategoryDefinition subCategoryDefinition : subcategories) {
- RestResponse createSubCategory = CategoryRestUtils.createSubCategory(subCategoryDefinition,
- categoryDefinition, productStrategistUser1, PRODUCT_COMPONENT_TYPE);
- status = createSubCategory.getErrorCode().intValue();
- if (status == BaseRestUtils.STATUS_CODE_CREATED) {
- String subCategoryId = ResponseParser.getUniqueIdFromResponse(createSubCategory);
- subCategoryDefinition.setUniqueId(subCategoryId);
- }
- List<GroupingDefinition> groupings = subCategoryDefinition.getGroupings();
- for (GroupingDefinition groupingDefinition : groupings) {
- RestResponse createGroupingRest = CategoryRestUtils.createGrouping(groupingDefinition,
- subCategoryDefinition, categoryDefinition, productStrategistUser1, PRODUCT_COMPONENT_TYPE);
- status = createGroupingRest.getErrorCode().intValue();
- if (status == BaseRestUtils.STATUS_CODE_CREATED) {
- String groupingId = ResponseParser.getUniqueIdFromResponse(createGroupingRest);
- groupingDefinition.setUniqueId(groupingId);
- }
- }
- }
- }
- RestResponse allCategories = CategoryRestUtils.getAllCategories(productStrategistUser1, PRODUCT_COMPONENT_TYPE);
- Gson gson = new Gson();
- List<CategoryDefinition> res = gson.fromJson(allCategories.getResponse(),
- new TypeToken<List<CategoryDefinition>>() {
- }.getType());
- return res;
- }
-
- // Category1->Subcategory1->[Grouping1, Grouping11]
- protected List<CategoryDefinition> addSecondGroupingToDefaultCategory() throws Exception {
- GroupingDefinition productGroupingDefinition = ElementFactory.getDefaultGroup();
- productGroupingDefinition.setName("Grouping11");
- defaultCategories.get(0).getSubcategories().get(0).addGrouping(productGroupingDefinition);
- return createCategoriesChain(defaultCategories);
- }
-
- // Category1->[Subcategory1->[Grouping1,
- // Grouping11],Subcategory2->[Grouping12]]
- protected List<CategoryDefinition> addSubcategoryAndGroupingToDefaultCategory() throws Exception {
- GroupingDefinition groupingDefinition1 = ElementFactory.getDefaultGroup();
- groupingDefinition1.setName("Grouping11");
- defaultCategories.get(0).getSubcategories().get(0).addGrouping(groupingDefinition1);
-
- SubCategoryDefinition subCategory2 = ElementFactory.getDefaultSubCategory();
- subCategory2.setName("Subcategory2");
- GroupingDefinition groupingDefinition2 = ElementFactory.getDefaultGroup();
- groupingDefinition2.setName("Grouping12");
- subCategory2.addGrouping(groupingDefinition2);
- defaultCategories.get(0).addSubCategory(subCategory2);
- return createCategoriesChain(defaultCategories);
- }
-
- // [Category1->[Subcategory1->[Grouping1,
- // Grouping11],Subcategory2->[Grouping12]],
- // Category2->[Subcategory1->[Grouping1],Subcategory2->[Grouping1]],
- // Category3->[Subcategory1->[Grouping11],Subcategory2->[Grouping11,
- // Grouping22]]]
- protected List<CategoryDefinition> addManyGroupingsDiffCategories() throws Exception {
- CategoryDefinition category2 = ElementFactory.getDefaultCategory();
- category2.setName("Category2");
- CategoryDefinition category3 = ElementFactory.getDefaultCategory();
- category3.setName("Category3");
- SubCategoryDefinition subCategory1 = ElementFactory.getDefaultSubCategory();
- subCategory1.setName("Subcategory1");
- SubCategoryDefinition subCategory2 = ElementFactory.getDefaultSubCategory();
- subCategory2.setName("Subcategory2");
- SubCategoryDefinition subCategory1_2 = ElementFactory.getDefaultSubCategory();
- subCategory1_2.setName("Subcategory1");
- SubCategoryDefinition subCategory2_2 = ElementFactory.getDefaultSubCategory();
- subCategory2_2.setName("Subcategory2");
- SubCategoryDefinition subCategory1_3 = ElementFactory.getDefaultSubCategory();
- subCategory1_3.setName("Subcategory1");
- SubCategoryDefinition subCategory2_3 = ElementFactory.getDefaultSubCategory();
- subCategory2_3.setName("Subcategory2");
-
- GroupingDefinition groupingDefinition1 = ElementFactory.getDefaultGroup();
- groupingDefinition1.setName("Grouping1");
- GroupingDefinition groupingDefinition11 = ElementFactory.getDefaultGroup();
- groupingDefinition11.setName("Grouping11");
- GroupingDefinition groupingDefinition12 = ElementFactory.getDefaultGroup();
- groupingDefinition12.setName("Grouping12");
- GroupingDefinition groupingDefinition22 = ElementFactory.getDefaultGroup();
- groupingDefinition22.setName("Grouping22");
-
- defaultCategories.get(0).getSubcategories().get(0).addGrouping(groupingDefinition11);
- subCategory2.addGrouping(groupingDefinition12);
- defaultCategories.get(0).addSubCategory(subCategory2);
-
- defaultCategories.add(category2);
- defaultCategories.add(category3);
- category2.addSubCategory(subCategory1_2);
- category2.addSubCategory(subCategory2_2);
- subCategory1_2.addGrouping(groupingDefinition1);
- subCategory2_2.addGrouping(groupingDefinition1);
- category3.addSubCategory(subCategory1_3);
- category3.addSubCategory(subCategory2_3);
- subCategory1_3.addGrouping(groupingDefinition11);
- subCategory2_3.addGrouping(groupingDefinition11);
- subCategory2_3.addGrouping(groupingDefinition22);
- return createCategoriesChain(defaultCategories);
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductCheckinTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductCheckinTest.java
deleted file mode 100644
index 94027bd6eb..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductCheckinTest.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.product;
-
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.model.LifecycleStateEnum;
-import org.openecomp.sdc.be.model.Product;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.datatypes.enums.AuditJsonKeysEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedProductAudit;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.DbUtils;
-import org.openecomp.sdc.ci.tests.utils.general.Convertor;
-import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
-import org.openecomp.sdc.ci.tests.utils.validation.ProductValidationUtils;
-import org.openecomp.sdc.common.api.Constants;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import static org.testng.AssertJUnit.assertEquals;
-
-public class ProductCheckinTest extends ProductLifecycleTest {
-
- @Rule
- public static TestName name = new TestName();
-
- public ProductCheckinTest() {
- super(name, ProductCheckinTest.class.getName());
- }
-
- @BeforeClass
- public static void staticInit() {
- auditAction = CHECKIN_ACTION;
- operation = ComponentOperationEnum.CHANGE_STATE_CHECKIN;
- }
-
- @Test
- public void checkInProductByCreator() throws Exception {
-
- String checkinComment = "good checkin";
- RestResponse checkInResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager1,
- LifeCycleStatesEnum.CHECKIN, checkinComment);
- assertEquals("Check response code after checkin resource", 200, checkInResponse.getErrorCode().intValue());
- Product checkedInProduct = ResponseParser.parseToObjectUsingMapper(checkInResponse.getResponse(),
- Product.class);
-
- expectedProduct.setLifecycleState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, checkedInProduct, operation);
-
- ExpectedProductAudit expectedProductAudit = Convertor.constructFieldsForAuditValidation(checkedInProduct,
- auditAction, productManager1, ActionStatus.OK, "0.1", "0.1", LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT,
- LifecycleStateEnum.NOT_CERTIFIED_CHECKIN, checkedInProduct.getUUID());
- expectedProductAudit.setCOMMENT(checkinComment);
- AuditValidationUtils.validateAuditProduct(expectedProductAudit, auditAction, AuditJsonKeysEnum.COMMENT);
- }
-
- @Test
- public void checkInProductByPM() throws Exception {
-
- String checkinComment = "good checkin";
- RestResponse response = LifecycleRestUtils.changeProductState(expectedProduct, productManager1,
- LifeCycleStatesEnum.CHECKIN, checkinComment);
- assertEquals("Check response code after checkin resource", 200, response.getErrorCode().intValue());
-
- User checkoutUser = productManager2;
- response = LifecycleRestUtils.changeProductState(expectedProduct, checkoutUser, LifeCycleStatesEnum.CHECKOUT);
- assertEquals("Check response code after checkin resource", 200, response.getErrorCode().intValue());
- expectedProduct = ResponseParser.parseToObjectUsingMapper(response.getResponse(), Product.class);
-
- DbUtils.cleanAllAudits();
- checkinComment = "good checkin no 2";
- response = LifecycleRestUtils.changeProductState(expectedProduct, checkoutUser, LifeCycleStatesEnum.CHECKIN,
- checkinComment);
- assertEquals("Check response code after checkin resource", 200, response.getErrorCode().intValue());
-
- Product checkedInProduct = ResponseParser.parseToObjectUsingMapper(response.getResponse(), Product.class);
-
- expectedProduct.setLifecycleState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN);
- expectedProduct.setVersion("0.2");
- expectedProduct.setLastUpdaterUserId(checkoutUser.getUserId());
- expectedProduct.setLastUpdaterFullName(checkoutUser.getFullName());
-
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, checkedInProduct, operation);
-
- ExpectedProductAudit expectedProductAudit = Convertor.constructFieldsForAuditValidation(checkedInProduct,
- auditAction, checkoutUser, ActionStatus.OK, "0.2", "0.2", LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT,
- LifecycleStateEnum.NOT_CERTIFIED_CHECKIN, checkedInProduct.getUUID());
- expectedProductAudit.setCOMMENT(checkinComment);
- AuditValidationUtils.validateAuditProduct(expectedProductAudit, auditAction, AuditJsonKeysEnum.COMMENT);
- }
-
- @Test
- public void checkInProductByAdmin() throws Exception {
-
- String checkinComment = "good checkin";
- RestResponse checkInResponse = LifecycleRestUtils.changeProductState(expectedProduct, adminUser,
- LifeCycleStatesEnum.CHECKIN, checkinComment);
- assertEquals("Check response code after checkin resource", 200, checkInResponse.getErrorCode().intValue());
- Product checkedInProduct = ResponseParser.parseToObjectUsingMapper(checkInResponse.getResponse(),
- Product.class);
-
- expectedProduct.setLifecycleState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN);
- expectedProduct.setLastUpdaterUserId(adminUser.getUserId());
- expectedProduct.setLastUpdaterFullName(adminUser.getFullName());
-
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, checkedInProduct, operation);
-
- ExpectedProductAudit expectedProductAudit = Convertor.constructFieldsForAuditValidation(checkedInProduct,
- auditAction, adminUser, ActionStatus.OK, "0.1", "0.1", LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT,
- LifecycleStateEnum.NOT_CERTIFIED_CHECKIN, checkedInProduct.getUUID());
- expectedProductAudit.setCOMMENT(checkinComment);
- AuditValidationUtils.validateAuditProduct(expectedProductAudit, auditAction, AuditJsonKeysEnum.COMMENT);
- }
-
- @Test
- public void checkInProductByPMNotOwner() throws Exception {
-
- RestResponse checkInResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager2,
- LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkin resource", 403, checkInResponse.getErrorCode().intValue());
- String[] auditParameters = new String[] { expectedProduct.getName(), "product", productManager1.getFirstName(),
- productManager1.getLastName(), productManager1.getUserId() };
- ExpectedProductAudit expectedProductAudit = Convertor.constructFieldsForAuditValidation(expectedProduct,
- auditAction, productManager2, ActionStatus.COMPONENT_CHECKOUT_BY_ANOTHER_USER, "0.1", "0.1",
- LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT,
- expectedProduct.getUUID(), auditParameters);
- AuditValidationUtils.validateAuditProduct(expectedProductAudit, auditAction);
- }
-
- @Test
- public void checkInProductByPsRoleNotAllowed() throws Exception {
-
- RestResponse checkInResponse = LifecycleRestUtils.changeProductState(expectedProduct, productStrategistUser1,
- LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkin resource", 409, checkInResponse.getErrorCode().intValue());
- ExpectedProductAudit expectedProductAudit = Convertor.constructFieldsForAuditValidation(expectedProduct,
- auditAction, productStrategistUser1, ActionStatus.RESTRICTED_OPERATION, "0.1", "0.1",
- LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT,
- expectedProduct.getUUID());
- AuditValidationUtils.validateAuditProduct(expectedProductAudit, auditAction);
- }
-
- @Test
- public void checkInProductNotExist() throws Exception {
- String notExisitingUuid = "1234";
- expectedProduct.setUniqueId(notExisitingUuid);
- RestResponse checkInResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager1,
- LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkin resource", 404, checkInResponse.getErrorCode().intValue());
- String[] auditParameters = new String[] { "", "product" };
- ExpectedProductAudit expectedProductAudit = Convertor.constructFieldsForAuditValidation(expectedProduct,
- auditAction, productManager1, ActionStatus.PRODUCT_NOT_FOUND, Constants.EMPTY_STRING,
- Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, auditParameters);
- expectedProductAudit.setCURR_STATE(Constants.EMPTY_STRING);
- expectedProductAudit.setRESOURCE_NAME(notExisitingUuid);
- AuditValidationUtils.validateAuditProduct(expectedProductAudit, auditAction);
- }
-
- @Test
- public void checkInProductAlreadyCheckedIn() throws Exception {
- RestResponse checkInResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager1,
- LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkin resource", 200, checkInResponse.getErrorCode().intValue());
- DbUtils.cleanAllAudits();
- checkInResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager2,
- LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkin resource", 409, checkInResponse.getErrorCode().intValue());
- String[] auditParameters = new String[] { expectedProduct.getName(), "product", productManager1.getFirstName(),
- productManager1.getLastName(), productManager1.getUserId() };
- ExpectedProductAudit expectedProductAudit = Convertor.constructFieldsForAuditValidation(expectedProduct,
- auditAction, productManager2, ActionStatus.COMPONENT_ALREADY_CHECKED_IN, "0.1", "0.1",
- LifecycleStateEnum.NOT_CERTIFIED_CHECKIN, LifecycleStateEnum.NOT_CERTIFIED_CHECKIN,
- expectedProduct.getUUID(), auditParameters);
- AuditValidationUtils.validateAuditProduct(expectedProductAudit, auditAction);
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductCheckoutTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductCheckoutTest.java
deleted file mode 100644
index 36458d09f9..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductCheckoutTest.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.product;
-
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.model.LifecycleStateEnum;
-import org.openecomp.sdc.be.model.Product;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedProductAudit;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.DbUtils;
-import org.openecomp.sdc.ci.tests.utils.general.Convertor;
-import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ProductRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
-import org.openecomp.sdc.ci.tests.utils.validation.ProductValidationUtils;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import java.io.FileNotFoundException;
-
-import static org.testng.AssertJUnit.assertEquals;
-
-public class ProductCheckoutTest extends ProductLifecycleTest {
-
- @Rule
- public static TestName name = new TestName();
-
- @BeforeClass
- public static void staticInit() {
- auditAction = CHECKOUT_ACTION;
- operation = ComponentOperationEnum.CHANGE_STATE_CHECKOUT;
- }
-
- public ProductCheckoutTest() {
- super(name, ProductCheckoutTest.class.getName());
- }
-
- @Test
- public void checkOutProductByPmNotInContacts() throws Exception {
- checkOutProductSuccess(productManager2);
- }
-
- @Test
- public void checkOutProductByPmInContacts() throws Exception {
- checkOutProductSuccess(productManager1);
- }
-
- @Test
- public void checkOutProductByAdmin() throws Exception {
- checkOutProductSuccess(adminUser);
- }
-
- @Test
- public void checkOutProductByPs() throws Exception {
- // Changed in 1604 patch - now it's restricted
- checkOutProductRestricted(productStrategistUser3);
- // checkOutProductSuccess(productStrategistUser3);
- }
-
- @Test
- public void checkOutProductByDesignerRoleNotAllowed() throws Exception {
- checkOutProductRestricted(designerUser);
- }
-
- @Test
- public void checkOutProductAlreadyCheckedOut() throws Exception {
- RestResponse lcsResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager1, LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkin resource", 200, lcsResponse.getErrorCode().intValue());
-
- lcsResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager1, LifeCycleStatesEnum.CHECKOUT);
- assertEquals("Check response code after checkin resource", 200, lcsResponse.getErrorCode().intValue());
- Product checkedOutProduct = ResponseParser.parseToObjectUsingMapper(lcsResponse.getResponse(), Product.class);
-
- DbUtils.cleanAllAudits();
-
- lcsResponse = LifecycleRestUtils.changeProductState(checkedOutProduct, productManager2, LifeCycleStatesEnum.CHECKOUT);
- assertEquals("Check response code after checkin resource", 403, lcsResponse.getErrorCode().intValue());
- String[] auditParameters = new String[] { checkedOutProduct.getName(), "product", productManager1.getFirstName(), productManager1.getLastName(), productManager1.getUserId() };
-
- ExpectedProductAudit expectedProductAudit = Convertor.constructFieldsForAuditValidation(checkedOutProduct, auditAction, productManager2, ActionStatus.COMPONENT_IN_CHECKOUT_STATE, "0.2", "0.2", LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT,
- LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, checkedOutProduct.getUUID(), auditParameters);
- AuditValidationUtils.validateAuditProduct(expectedProductAudit, auditAction);
- }
-
- private void checkOutProductSuccess(User checkoutUser) throws Exception, FileNotFoundException {
- RestResponse lcsResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager1, LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkin resource", 200, lcsResponse.getErrorCode().intValue());
-
- lcsResponse = LifecycleRestUtils.changeProductState(expectedProduct, checkoutUser, LifeCycleStatesEnum.CHECKOUT);
- assertEquals("Check response code after checkin resource", 200, lcsResponse.getErrorCode().intValue());
-
- // 0.1 is not highest now
- RestResponse prevVersionProductResp = ProductRestUtils.getProduct(expectedProduct.getUniqueId(), productStrategistUser1.getUserId());
- Product prevVersionProduct = ResponseParser.parseToObjectUsingMapper(prevVersionProductResp.getResponse(), Product.class);
- Boolean falseParam = false;
- assertEquals(falseParam, prevVersionProduct.isHighestVersion());
-
- Product checkedOutProduct = ResponseParser.parseToObjectUsingMapper(lcsResponse.getResponse(), Product.class);
-
- expectedProduct.setLifecycleState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
- expectedProduct.setVersion("0.2");
- expectedProduct.setLastUpdaterUserId(checkoutUser.getUserId());
- expectedProduct.setLastUpdaterFullName(checkoutUser.getFullName());
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, checkedOutProduct, operation);
-
- ExpectedProductAudit expectedProductAudit = Convertor.constructFieldsForAuditValidation(checkedOutProduct, auditAction, checkoutUser, ActionStatus.OK, "0.1", "0.2", LifecycleStateEnum.NOT_CERTIFIED_CHECKIN,
- LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, checkedOutProduct.getUUID());
- AuditValidationUtils.validateAuditProduct(expectedProductAudit, auditAction);
- }
-
- private void checkOutProductRestricted(User checkoutUser) throws Exception, FileNotFoundException {
- RestResponse lcsResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager1, LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkin resource", 200, lcsResponse.getErrorCode().intValue());
-
- lcsResponse = LifecycleRestUtils.changeProductState(expectedProduct, checkoutUser, LifeCycleStatesEnum.CHECKOUT);
- assertEquals("Check response code after checkin resource", 409, lcsResponse.getErrorCode().intValue());
-
- ExpectedProductAudit expectedProductAudit = Convertor.constructFieldsForAuditValidation(expectedProduct, auditAction, checkoutUser, ActionStatus.RESTRICTED_OPERATION, "0.1", "0.1", LifecycleStateEnum.NOT_CERTIFIED_CHECKIN,
- LifecycleStateEnum.NOT_CERTIFIED_CHECKIN, expectedProduct.getUUID());
- AuditValidationUtils.validateAuditProduct(expectedProductAudit, auditAction);
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductCreateWithValidationsTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductCreateWithValidationsTest.java
deleted file mode 100644
index a0a961dd8e..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductCreateWithValidationsTest.java
+++ /dev/null
@@ -1,1717 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.product;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.model.LifecycleStateEnum;
-import org.openecomp.sdc.be.model.Product;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.datatypes.ProductReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedProductAudit;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.DbUtils;
-import org.openecomp.sdc.ci.tests.utils.general.Convertor;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ProductRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
-import org.openecomp.sdc.ci.tests.utils.validation.ProductValidationUtils;
-import org.openecomp.sdc.common.api.Constants;
-import org.testng.annotations.Test;
-
-import java.util.Arrays;
-
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertTrue;
-
-public class ProductCreateWithValidationsTest extends ProductBaseTest {
- @Rule
- public static TestName name = new TestName();
-
- public static String INITIAL_PRODUCT_VERSION = "0.1";
- public static String CREATE_AUDIT_ACTION = "Create";
- public String normalizedName;
-
- public ProductCreateWithValidationsTest() {
- super(name, ProductCreateWithValidationsTest.class.getName());
- }
-
- @Test // (enabled = false)
- public void createProductSuccessValidation() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- ProductRestUtils.checkCreateResponse(createProduct);
- String productUuid = ResponseParser.getUuidFromResponse(createProduct);
- compareExpectedAndActualProducts(productReqDetails, createProduct);
- Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
- productManager1.getUserId());
- ProductRestUtils.checkSuccess(getProductRes);
- Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
- ComponentOperationEnum.GET_COMPONENT);
- assertEquals(actualProduct.getIsActive(), new Boolean(false));
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
- "0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test
- public void createProductNotByPmUser() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1");
- normalizedName = productReqDetails.getName().toLowerCase();
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productStrategistUser1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_RESTRICTED_OPERATION,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, INITIAL_PRODUCT_VERSION,
- productStrategistUser1);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productStrategistUser1, ActionStatus.RESTRICTED_OPERATION,
- Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING);
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test
- public void createProductNotByAsdcUser() throws Exception {
- User nonAsdcUser = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1);
- nonAsdcUser.setUserId("bt750k");
- nonAsdcUser.setFirstName(null);
- nonAsdcUser.setLastName(null);
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1");
- normalizedName = productReqDetails.getName().toLowerCase();
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, nonAsdcUser);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_RESTRICTED_OPERATION,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, INITIAL_PRODUCT_VERSION,
- nonAsdcUser);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, nonAsdcUser, ActionStatus.RESTRICTED_OPERATION,
- Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING);
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test
- public void createProductUserIdIsEmpty() throws Exception {
- User nonAsdcUser = ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1);
- nonAsdcUser.setUserId("");
- nonAsdcUser.setFirstName(null);
- nonAsdcUser.setLastName(null);
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1");
- normalizedName = productReqDetails.getName().toLowerCase();
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, nonAsdcUser);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_MISSING_INFORMATION,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, INITIAL_PRODUCT_VERSION,
- nonAsdcUser);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, nonAsdcUser, ActionStatus.MISSING_INFORMATION,
- Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING);
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test
- public void createProductNameValidationLessThanMinCharacters() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- productReqDetails.setName("Pro");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1,
- ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_LENGTH, Constants.EMPTY_STRING, Constants.EMPTY_STRING,
- null, null, Constants.EMPTY_STRING, "Product", "abbreviated");
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test // (enabled = false)
- public void createProductNameValidationMaxLength() throws Exception {
- // Max length = 25
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
-// productReqDetails.setName("Qwertyuiop1234567890asdfA");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase();
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- ProductRestUtils.checkCreateResponse(createProduct);
- String productUuid = ResponseParser.getUuidFromResponse(createProduct);
- compareExpectedAndActualProducts(productReqDetails, createProduct);
- Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
- productManager1.getUserId());
- ProductRestUtils.checkSuccess(getProductRes);
- Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
- ComponentOperationEnum.GET_COMPONENT);
- assertEquals(actualProduct.getIsActive(), new Boolean(false));
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
- "0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test
- public void createProductNameValidationExceedMaxLength() throws Exception {
- // Max length = 25
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- productReqDetails.setName("Qwertyuiop1234567890asdfAa");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase();
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1,
- ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_LENGTH, Constants.EMPTY_STRING, Constants.EMPTY_STRING,
- null, null, Constants.EMPTY_STRING, "Product", "abbreviated");
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test
- public void createProductNameValidationEmptyName() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- productReqDetails.setName("");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase();
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.MISSING_ONE_OF_COMPONENT_NAMES,
- Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "Product",
- "abbreviated");
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test // (enabled = false)
- public void createProductNameAlreadyExist() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase();
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- ProductRestUtils.checkCreateResponse(createProduct);
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase();
- // // productReqDetails.setName("CIProduct1");
- DbUtils.deleteFromEsDbByPattern("_all");
- createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_ALREADY_EXISTS,
- createProduct.getErrorCode().intValue());
- productReqDetails.setVersion("0.1");
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.COMPONENT_NAME_ALREADY_EXIST,
- Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "Product",
- productReqDetails.getName());
- constructFieldsForAuditValidation.setCURR_VERSION("0.1");
- constructFieldsForAuditValidation.setCURR_STATE("");
- constructFieldsForAuditValidation.setCURR_STATE("NOT_CERTIFIED_CHECKOUT");
- constructFieldsForAuditValidation.setSERVICE_INSTANCE_ID(null);
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test
- public void createProductNameValidationNameIsNull() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- productReqDetails.setName(null);
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.MISSING_ONE_OF_COMPONENT_NAMES,
- Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "Product",
- "abbreviated");
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- // DE193857
- @Test (enabled = false)
- public void createProductNameValidationAllowedCharacters() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- productReqDetails.setName("Ci_2@3:4& m=n+b-u.j-u'g#b"); // Bug @:&=+'#
- normalizedName = "ci234mnbujugb";
- String expectedProductName = "Ci_2@3:4& M=n+b-u.j-u'g#b";
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- ProductRestUtils.checkCreateResponse(createProduct);
- String productUuid = ResponseParser.getUuidFromResponse(createProduct);
- productReqDetails.setName(expectedProductName);
- productReqDetails.setName("Ci_2@3:4& M=n+b-u.j-u'g#b");
- compareExpectedAndActualProducts(productReqDetails, createProduct);
- Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- expectedProduct.setNormalizedName(normalizedName);
- RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
- productManager1.getUserId());
- ProductRestUtils.checkSuccess(getProductRes);
- Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
- ComponentOperationEnum.GET_COMPONENT);
- assertEquals(actualProduct.getIsActive(), new Boolean(false));
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
- "0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- // DE193857
- @Test
- public void createProductNameValidationREmoveExtraNonAlphanumericChars() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- productReqDetails.setName("Ci____222----333......asd");
-// productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- ProductRestUtils.checkCreateResponse(createProduct);
- productReqDetails.setName("Ci_222-333.asd");
- normalizedName = "ci222333asd";
- String productUuid = ResponseParser.getUuidFromResponse(createProduct);
- compareExpectedAndActualProducts(productReqDetails, createProduct);
- Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
- productManager1.getUserId());
- ProductRestUtils.checkSuccess(getProductRes);
- Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
- ComponentOperationEnum.GET_COMPONENT);
- assertEquals(actualProduct.getIsActive(), new Boolean(false));
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
- "0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test
- public void createProductNameValidationNotAllowedCharacters() throws Exception {
- ExpectedProductAudit constructFieldsForAuditValidation;
- char invalidChars[] = { '~', '!', '%', '^', '*', '(', ')', '"', '{', '}', '[', ']', '?', '>', '<', '/', '|',
- '\\', ',', '$' };
- for (int i = 0; i < invalidChars.length; i++) {
- DbUtils.deleteFromEsDbByPattern("_all");
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- productReqDetails.setName("abc" + invalidChars[i]);
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "",
- productManager1);
- constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(expectedProduct,
- CREATE_AUDIT_ACTION, productManager1, ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_FORMAT,
- Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "Product",
- "abbreviated");
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
- }
-
- @Test
- public void createProductFullNameContainSpecialCharacters() throws Exception {
- char invalidChars[] = { '~', '!', '%', '^', '*', '(', ')', '"', '{', '}', '[', ']', '?', '>', '<', '/', '|',
- '\\', ',', '$' };
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- for (int i = 0; i < invalidChars.length; i++) {
- DbUtils.deleteFromEsDbByPattern("_all");
- productReqDetails.setFullName("abc" + invalidChars[i]);
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_CREATED,
- createProduct.getErrorCode().intValue());
- RestResponse deleteProduct = ProductRestUtils.deleteProduct(productReqDetails.getUniqueId(),
- productManager1.getUserId());
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS,
- deleteProduct.getErrorCode().intValue());
- }
- }
-
- // Already enabled = false
- @Test
- public void createProductNameValidationRemoveSpaceFromBeginning() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- productReqDetails.setName(" Ciertyuiop1234567890asdfA");
-// productReqDetails.setTags(Arrays.asList(productReqDetails.getName().trim()));
- normalizedName = productReqDetails.getName().trim().toLowerCase();
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- ProductRestUtils.checkCreateResponse(createProduct);
- String productUuid = ResponseParser.getUuidFromResponse(createProduct);
- productReqDetails.setName(" Ciertyuiop1234567890asdfA".trim());
- compareExpectedAndActualProducts(productReqDetails, createProduct);
- Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
- productManager1.getUserId());
- ProductRestUtils.checkSuccess(getProductRes);
- Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
- ComponentOperationEnum.GET_COMPONENT);
- assertEquals(actualProduct.getIsActive(), new Boolean(false));
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
- "0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- // Already enabled = false
- @Test
- public void createProductNameValidationRemoveSpaceFromTheEnd() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- productReqDetails.setName("Ciertyuiop1234567890asdfA ");
-// productReqDetails.setTags(Arrays.asList(productReqDetails.getName().trim()));
- normalizedName = productReqDetails.getName().trim().toLowerCase();
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- ProductRestUtils.checkCreateResponse(createProduct);
- String productUuid = ResponseParser.getUuidFromResponse(createProduct);
- productReqDetails.setName("Ciertyuiop1234567890asdfA ".trim());
- compareExpectedAndActualProducts(productReqDetails, createProduct);
- Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
- productManager1.getUserId());
- ProductRestUtils.checkSuccess(getProductRes);
- Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
- ComponentOperationEnum.GET_COMPONENT);
- assertEquals(actualProduct.getIsActive(), new Boolean(false));
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
- "0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test
- public void createProductNameValidationStartWithNumber() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- productReqDetails.setName("1Qwert");
-// productReqDetails.setTags(Arrays.asList(productReqDetails.getName().trim()));
- normalizedName = productReqDetails.getName().trim().toLowerCase();
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- ProductRestUtils.checkCreateResponse(createProduct);
- String productUuid = ResponseParser.getUuidFromResponse(createProduct);
- compareExpectedAndActualProducts(productReqDetails, createProduct);
- Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
- productManager1.getUserId());
- ProductRestUtils.checkSuccess(getProductRes);
- Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
- ComponentOperationEnum.GET_COMPONENT);
- assertEquals(actualProduct.getIsActive(), new Boolean(false));
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
- "0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- productReqDetails.setName("Ci1Qwert");
- RestResponse updateProduct = ProductRestUtils.updateProduct(productReqDetails, productManager1);
-
- }
-
- @Test
- public void createProductNameValidationStartWithNonAlphaNumeric() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- productReqDetails.setName("_Qwert");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName().trim()));
- normalizedName = productReqDetails.getName().trim().toLowerCase();
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1,
- ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_FORMAT, Constants.EMPTY_STRING, Constants.EMPTY_STRING,
- null, null, Constants.EMPTY_STRING, "Product", "abbreviated");
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test // (enabled = false)
- public void createProductNameValidationFirstLetterOfKeyWordsCapitalized() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("Abba");
- // productReqDetails.setTags(Arrays.asList("abba"));
- normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- ProductRestUtils.checkCreateResponse(createProduct);
- // // productReqDetails.setName("Abba");
- /*
- * String actualNormalizedNameFromResponse =
- * ResponseParser.getValueFromJsonResponse(createProduct.getResponse(),
- * "normalizedName");
- * assertTrue(actualNormalizedNameFromResponse.equals(normalizedName));
- */
- String productUuid = ResponseParser.getUuidFromResponse(createProduct);
- compareExpectedAndActualProducts(productReqDetails, createProduct);
- Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
- productManager1.getUserId());
- ProductRestUtils.checkSuccess(getProductRes);
- Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
- ComponentOperationEnum.GET_COMPONENT);
- assertEquals(actualProduct.getIsActive(), new Boolean(false));
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
- "0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test
- public void createProductFullNameValidationIsEmpty() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- productReqDetails.setFullName("");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.MISSING_ONE_OF_COMPONENT_NAMES,
- Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "Product", "full");
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test
- public void createProductFullNameValidationIsNull() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- productReqDetails.setFullName("");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.MISSING_ONE_OF_COMPONENT_NAMES,
- Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "Product", "full");
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test
- public void createProductFullNameLessThanMinLength() throws Exception {
- // Min is 4 characters
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- productReqDetails.setFullName("abc");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1,
- ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_LENGTH, Constants.EMPTY_STRING, Constants.EMPTY_STRING,
- null, null, Constants.EMPTY_STRING, "Product", "full");
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test // (enabled = false)
- public void createProductFullNameHasMinLength() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("Abba");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
- productReqDetails.setFullName("abcd");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- ProductRestUtils.checkCreateResponse(createProduct);
- String productUuid = ResponseParser.getUuidFromResponse(createProduct);
- compareExpectedAndActualProducts(productReqDetails, createProduct);
- Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
- productManager1.getUserId());
- ProductRestUtils.checkSuccess(getProductRes);
- Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
- ComponentOperationEnum.GET_COMPONENT);
- assertEquals(actualProduct.getIsActive(), new Boolean(false));
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
- "0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test // (enabled = false)
- public void createProductFullNameHasMaxLength() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("Abba");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
- productReqDetails.setFullName(
- "Abba1234567890asdfghjk l123zxcvbnm432adfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- ProductRestUtils.checkCreateResponse(createProduct);
- String productUuid = ResponseParser.getUuidFromResponse(createProduct);
- compareExpectedAndActualProducts(productReqDetails, createProduct);
- Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
- productManager1.getUserId());
- ProductRestUtils.checkSuccess(getProductRes);
- Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
- ComponentOperationEnum.GET_COMPONENT);
- assertEquals(actualProduct.getIsActive(), new Boolean(false));
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
- "0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test // (enabled = false)
- public void createProductFullNameExceedMaxLength() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("Abba");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
- productReqDetails.setFullName(
- "Abba1234567890asdfghjk l123zxcvbnm432adfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.123");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1,
- ActionStatus.COMPONENT_ELEMENT_INVALID_NAME_LENGTH, Constants.EMPTY_STRING, Constants.EMPTY_STRING,
- null, null, Constants.EMPTY_STRING, "Product", "full");
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test // (enabled = false)
- public void createProductFullNameRemoveExtraSpaces() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("Abba");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
- productReqDetails.setFullName("Abbaaa a1");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- ProductRestUtils.checkCreateResponse(createProduct);
- productReqDetails.setFullName("Abbaaa a1");
- String productUuid = ResponseParser.getUuidFromResponse(createProduct);
- compareExpectedAndActualProducts(productReqDetails, createProduct);
- Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
- productManager1.getUserId());
- ProductRestUtils.checkSuccess(getProductRes);
- Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
- ComponentOperationEnum.GET_COMPONENT);
- assertEquals(actualProduct.getIsActive(), new Boolean(false));
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
- "0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test
- public void createProductDescriptionValidationIsEmpty() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- productReqDetails.setDescription("");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.COMPONENT_MISSING_DESCRIPTION,
- Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "Product");
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test
- public void createProductDescriptionValidationIsNull() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- productReqDetails.setDescription(null);
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.COMPONENT_MISSING_DESCRIPTION,
- Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "Product");
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test (enabled = false)
- public void createProductDescriptionValidCharacters01() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("Abba");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
- productReqDetails.setDescription("qwertyuiopasdfghjklzxcvbnm1234567890<b>Bold<</b>");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- ProductRestUtils.checkCreateResponse(createProduct);
- productReqDetails.setDescription("qwertyuiopasdfghjklzxcvbnm1234567890Bold&lt;");
- String productUuid = ResponseParser.getUuidFromResponse(createProduct);
- compareExpectedAndActualProducts(productReqDetails, createProduct);
- Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
- productManager1.getUserId());
- ProductRestUtils.checkSuccess(getProductRes);
- Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
- ComponentOperationEnum.GET_COMPONENT);
- assertEquals(actualProduct.getIsActive(), new Boolean(false));
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
- "0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test (enabled = false)
- public void createProductDescriptionValidCharacters02() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("Abba");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
- productReqDetails.setDescription("~!@#$%^&*()_+<>?qwertyuiopasdfghjklzxcvbnm1234567890#");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- ProductRestUtils.checkCreateResponse(createProduct);
- productReqDetails.setDescription("~!@#$%^&amp;*()_+&lt;&gt;?qwertyuiopasdfghjklzxcvbnm1234567890#");
- String productUuid = ResponseParser.getUuidFromResponse(createProduct);
- compareExpectedAndActualProducts(productReqDetails, createProduct);
- Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
- productManager1.getUserId());
- ProductRestUtils.checkSuccess(getProductRes);
- Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
- ComponentOperationEnum.GET_COMPONENT);
- assertEquals(actualProduct.getIsActive(), new Boolean(false));
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
- "0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test // (enabled = false)
- public void createProductDescriptionInValidCharacters() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("Abba");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
- productReqDetails.setDescription("מה");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.COMPONENT_INVALID_DESCRIPTION,
- Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "Product");
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test (enabled = false)
- public void createProductDescriptionRemoveSpacesFromBeginning() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("Abba");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
- productReqDetails.setDescription(" abcd12345");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- ProductRestUtils.checkCreateResponse(createProduct);
- productReqDetails.setDescription("abcd12345");
- String productUuid = ResponseParser.getUuidFromResponse(createProduct);
- compareExpectedAndActualProducts(productReqDetails, createProduct);
- Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
- productManager1.getUserId());
- ProductRestUtils.checkSuccess(getProductRes);
- Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
- ComponentOperationEnum.GET_COMPONENT);
- assertEquals(actualProduct.getIsActive(), new Boolean(false));
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
- "0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test (enabled = false)
- public void createProductDescriptionRemoveSpacesFromTheEnd() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("Abba");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
- productReqDetails.setDescription("abcd 12345 xcvb ");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- ProductRestUtils.checkCreateResponse(createProduct);
- productReqDetails.setDescription("abcd 12345 xcvb");
- String productUuid = ResponseParser.getUuidFromResponse(createProduct);
- compareExpectedAndActualProducts(productReqDetails, createProduct);
- Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
- productManager1.getUserId());
- ProductRestUtils.checkSuccess(getProductRes);
- Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
- ComponentOperationEnum.GET_COMPONENT);
- assertEquals(actualProduct.getIsActive(), new Boolean(false));
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
- "0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test // (enabled = false)
- public void createProductDescriptionMaxLength() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("Abba");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
- productReqDetails.setDescription(
- "Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12asdfghjklzxcvbnmqwertyui");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- ProductRestUtils.checkCreateResponse(createProduct);
- String productUuid = ResponseParser.getUuidFromResponse(createProduct);
- compareExpectedAndActualProducts(productReqDetails, createProduct);
- Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
- productManager1.getUserId());
- ProductRestUtils.checkSuccess(getProductRes);
- Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
- ComponentOperationEnum.GET_COMPONENT);
- assertEquals(actualProduct.getIsActive(), new Boolean(false));
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
- "0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test // (enabled = false)
- public void createProductDescriptionExceedMaxLength() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("Abba");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
- productReqDetails.setDescription(
- "Abxba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12Abba1234567890asdfghjkl123zxcvbnm432asdfghjkl_-.123Abba1234567890asdfghjkl23zxcvbnm432asdfghjkl_-.12asdfghjklzxcvbnmqwertyui");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.COMPONENT_DESCRIPTION_EXCEEDS_LIMIT,
- Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "Product", "1024");
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test
- public void createProductTagIsEmpty() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- productReqDetails.setName("Product");
- productReqDetails.setTags(Arrays.asList(""));
- normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.INVALID_FIELD_FORMAT,
- Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "Product", "tag");
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- // DE192351
- @Test // (enabled = false)
- public void createProductTagValidationAllowedCharacters() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1"); // Bug @:&=+'#
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName(), "Acde2@3:4& m=n+b-u.j-u'g#b"));
- normalizedName = productReqDetails.getName().toLowerCase();
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- ProductRestUtils.checkCreateResponse(createProduct);
- String productUuid = ResponseParser.getUuidFromResponse(createProduct);
- compareExpectedAndActualProducts(productReqDetails, createProduct);
- Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
- productManager1.getUserId());
- ProductRestUtils.checkSuccess(getProductRes);
- Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
- ComponentOperationEnum.GET_COMPONENT);
- assertEquals(actualProduct.getIsActive(), new Boolean(false));
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
- "0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test // (enabled = false)
- public void createProductTagsNameValidationProductNameIsNotInTag() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
-// productReqDetails.setName("Qwertyuiop1234567890asdfA");
- productReqDetails.setTags(Arrays.asList("Abc"));
- normalizedName = productReqDetails.getName().trim().toLowerCase();
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.COMPONENT_INVALID_TAGS_NO_COMP_NAME,
- Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING);
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test // (enabled = false)
- public void createProductSingleTagMaxLength() throws Exception {
- // SingleTagMaxLength = 50
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1");
- productReqDetails.setTags(
- Arrays.asList(productReqDetails.getName(), "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345678"));
- normalizedName = productReqDetails.getName().toLowerCase();
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- ProductRestUtils.checkCreateResponse(createProduct);
- String productUuid = ResponseParser.getUuidFromResponse(createProduct);
- compareExpectedAndActualProducts(productReqDetails, createProduct);
- Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
- productManager1.getUserId());
- ProductRestUtils.checkSuccess(getProductRes);
- Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
- ComponentOperationEnum.GET_COMPONENT);
- assertEquals(actualProduct.getIsActive(), new Boolean(false));
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
- "0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test (enabled = false)
- public void createProductSingleTagExceedMaxLength() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1"); // Bug @:&=+'#
- productReqDetails.setTags(
- Arrays.asList(productReqDetails.getName(), "Axbba1234567890asdfghjkl123zxcvbnm432asdfgh12345678"));
- normalizedName = productReqDetails.getName().toLowerCase();
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.COMPONENT_SINGLE_TAG_EXCEED_LIMIT,
- Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "50");
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test (enabled = false)
- public void createProductAllTagsMaxLength() throws Exception {
- // AllTagsMaxLength = 1024
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1");
- productReqDetails.setTags(
- Arrays.asList(productReqDetails.getName(), "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345601",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345602",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345603",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345604",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345605",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345606",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345607",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345608",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh1234569",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345610",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345611",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345612",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345613",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345614",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345615",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345616",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345617",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345618",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345619",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345"));
- normalizedName = productReqDetails.getName().toLowerCase();
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- ProductRestUtils.checkCreateResponse(createProduct);
- String productUuid = ResponseParser.getUuidFromResponse(createProduct);
- compareExpectedAndActualProducts(productReqDetails, createProduct);
- Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
- productManager1.getUserId());
- ProductRestUtils.checkSuccess(getProductRes);
- Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
- ComponentOperationEnum.GET_COMPONENT);
- assertEquals(actualProduct.getIsActive(), new Boolean(false));
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
- "0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test
- public void createProductAllTagsExceedMaxLength() throws Exception {
- // AllTagsMaxLength = 1024
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1");
- productReqDetails.setTags(
- Arrays.asList(productReqDetails.getName(), "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345601",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345602",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345603",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345604",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345605",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345606",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345607",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345608",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh1234569",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345610",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345611",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345612",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345613",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345614",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345615",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345616",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345617",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345618",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh12345619",
- "Abba1234567890asdfghjkl123zxcvbnm432asdfgh123456"));
- normalizedName = productReqDetails.getName().toLowerCase();
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.COMPONENT_TAGS_EXCEED_LIMIT,
- Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "1024");
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test // (enabled = false)
- public void createProductDuplicateTagRemoved() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1"); // Bug @:&=+'#
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName(), productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase();
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- ProductRestUtils.checkCreateResponse(createProduct);
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- String productUuid = ResponseParser.getUuidFromResponse(createProduct);
- compareExpectedAndActualProducts(productReqDetails, createProduct);
- Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
- productManager1.getUserId());
- ProductRestUtils.checkSuccess(getProductRes);
- Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
- ComponentOperationEnum.GET_COMPONENT);
- assertEquals(actualProduct.getIsActive(), new Boolean(false));
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
- "0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test // (enabled = false)
- public void createProductContactsIsEmpty() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1"); // Bug @:&=+'#
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase();
- productReqDetails.setContacts(Arrays.asList(""));
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.COMPONENT_INVALID_CONTACT,
- Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "Product");
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test // (enabled = false)
- public void createProductContactsInvalidFormat() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1"); // Bug @:&=+'#
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase();
- productReqDetails.setContacts(Arrays.asList("bt750345"));
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.COMPONENT_INVALID_CONTACT,
- Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "Product");
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test // (enabled = false)
- public void createProductConvertContactsToLowerCase() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1"); // Bug @:&=+'#
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase();
- productReqDetails.setContacts(Arrays.asList(productManager1.getUserId().toUpperCase()));
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- ProductRestUtils.checkCreateResponse(createProduct);
- productReqDetails.setContacts(Arrays.asList(productManager1.getUserId().toLowerCase()));
- String productUuid = ResponseParser.getUuidFromResponse(createProduct);
- compareExpectedAndActualProducts(productReqDetails, createProduct);
- Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
- productManager1.getUserId());
- ProductRestUtils.checkSuccess(getProductRes);
- Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
- ComponentOperationEnum.GET_COMPONENT);
- assertEquals(actualProduct.getIsActive(), new Boolean(false));
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
- "0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test // (enabled = false)
- public void createProductContactsDoexNotContainTheProductCreator() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1"); // Bug @:&=+'#
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase();
- productReqDetails.setContacts(Arrays.asList(productManager2.getUserId()));
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- ProductRestUtils.checkCreateResponse(createProduct);
- productReqDetails.setContacts(Arrays.asList(productManager2.getUserId(), productManager1.getUserId()));
- String productUuid = ResponseParser.getUuidFromResponse(createProduct);
- compareExpectedAndActualProducts(productReqDetails, createProduct);
- Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
- productManager1.getUserId());
- ProductRestUtils.checkSuccess(getProductRes);
- Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
- ComponentOperationEnum.GET_COMPONENT);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
- "0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test // (enabled = false)
- public void createProductContactsNotAllowedAsdcUsers() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1"); // Bug @:&=+'#
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase();
- productReqDetails.setContacts(Arrays.asList(designerUser.getUserId()));
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.INVALID_PRODUCT_CONTACT,
- Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING,
- designerUser.getUserId());
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test // (enabled = false)
- public void createProductContactsNotAsdcUser() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1"); // Bug @:&=+'#
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase();
- String nonAsdcUser = "bh1234";
- productReqDetails.setContacts(Arrays.asList(nonAsdcUser));
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.INVALID_PRODUCT_CONTACT,
- Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, nonAsdcUser);
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test // (enabled = false)
- public void createProductProjectCodeIsEmpty() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
- productReqDetails.setProjectCode("");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.MISSING_PROJECT_CODE,
- Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING);
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test // (enabled = false)
- public void createProductProjectCodeIsNull() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
- productReqDetails.setProjectCode(null);
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.MISSING_PROJECT_CODE,
- Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING);
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test // (enabled = false)
- public void createProductProjectCodeIsNotNumeric() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
- productReqDetails.setProjectCode("asdfgh");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.INVALID_PROJECT_CODE,
- Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING);
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test // (enabled = false)
- public void createProductProjectCodeHasnMinCharacters() throws Exception {
- // Min =5
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
- productReqDetails.setProjectCode("12345");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- ProductRestUtils.checkCreateResponse(createProduct);
- String productUuid = ResponseParser.getUuidFromResponse(createProduct);
- compareExpectedAndActualProducts(productReqDetails, createProduct);
- Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
- productManager1.getUserId());
- ProductRestUtils.checkSuccess(getProductRes);
- Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
- ComponentOperationEnum.GET_COMPONENT);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
- "0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test // (enabled = false)
- public void createProductProjectCodeHasnMaxCharacters() throws Exception {
- // Max =10
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
- productReqDetails.setProjectCode("1234567890");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- ProductRestUtils.checkCreateResponse(createProduct);
- String productUuid = ResponseParser.getUuidFromResponse(createProduct);
- compareExpectedAndActualProducts(productReqDetails, createProduct);
- Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
- productManager1.getUserId());
- ProductRestUtils.checkSuccess(getProductRes);
- Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
- ComponentOperationEnum.GET_COMPONENT);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
- "0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test // (enabled = false)
- public void createProductProjectCodeExceedMaxCharacters() throws Exception {
- // Max =10
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
- productReqDetails.setProjectCode("12345678901");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.INVALID_PROJECT_CODE,
- Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING);
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test // (enabled = false)
- public void createProductProjectCodeLessThanMinCharacters() throws Exception {
- // Max =10
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
- productReqDetails.setProjectCode("1234");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.INVALID_PROJECT_CODE,
- Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING);
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test // (enabled = false)
- public void createProductIconIsEmpty() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
- productReqDetails.setIcon("");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.COMPONENT_MISSING_ICON,
- Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "Product");
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test // (enabled = false)
- public void createProductIconIsNull() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
- productReqDetails.setIcon(null);
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.COMPONENT_MISSING_ICON,
- Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "Product");
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test // (enabled = false)
- public void createProductIconMaxLength() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
- productReqDetails.setIcon("asdfghjklqwertyuiozxcvbfv");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- ProductRestUtils.checkCreateResponse(createProduct);
- String productUuid = ResponseParser.getUuidFromResponse(createProduct);
- compareExpectedAndActualProducts(productReqDetails, createProduct);
- Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
- productManager1.getUserId());
- ProductRestUtils.checkSuccess(getProductRes);
- Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
- ComponentOperationEnum.GET_COMPONENT);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
- "0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test // (enabled = false)
- public void createProductIconExceedMaxLength() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
- productReqDetails.setIcon("asdfghjklqwertyuiozxcvbf12");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.COMPONENT_ICON_EXCEEDS_LIMIT,
- Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "Product", "25");
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test // (enabled = false)
- public void createProductIconAllowedCharacters() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
- productReqDetails.setIcon("a--s-fghjk_q__r1234567890");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- ProductRestUtils.checkCreateResponse(createProduct);
- String productUuid = ResponseParser.getUuidFromResponse(createProduct);
- compareExpectedAndActualProducts(productReqDetails, createProduct);
- Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
- productManager1.getUserId());
- ProductRestUtils.checkSuccess(getProductRes);
- Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
- ComponentOperationEnum.GET_COMPONENT);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
- "0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test (enabled = false)
- public void createProductIconInValidCharacters() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
- String icon = "asdfg";
- char invalidChars[] = { '~', '!', '$', '%', '^', '*', '(', ')', '"', '{', '}', '[', ']', '?', '>', '<', '/',
- '|', '\\', ',' };
- RestResponse createProduct;
- for (int i = 0; i < invalidChars.length; i++) {
- productReqDetails.setIcon(icon + invalidChars[i]);
- createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "",
- productManager1);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.COMPONENT_INVALID_ICON,
- Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, "Product");
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
- }
-
- @Test // (enabled = false)
- public void createProductIsActiveisEmpty() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
- productReqDetails.setActive("");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- ProductRestUtils.checkCreateResponse(createProduct);
- productReqDetails.setActive("false");
- String productUuid = ResponseParser.getUuidFromResponse(createProduct);
- compareExpectedAndActualProducts(productReqDetails, createProduct);
- Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
- productManager1.getUserId());
- ProductRestUtils.checkSuccess(getProductRes);
- Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
- ComponentOperationEnum.GET_COMPONENT);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
- "0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test // (enabled = false)
- public void createProductIsActiveisNull() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
- productReqDetails.setActive("");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- ProductRestUtils.checkCreateResponse(createProduct);
- productReqDetails.setActive("false");
- String productUuid = ResponseParser.getUuidFromResponse(createProduct);
- compareExpectedAndActualProducts(productReqDetails, createProduct);
- Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
- productManager1.getUserId());
- ProductRestUtils.checkSuccess(getProductRes);
- Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
- ComponentOperationEnum.GET_COMPONENT);
- assertEquals(actualProduct.getIsActive(), new Boolean(false));
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
- "0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test // (enabled = false)
- public void createProductIsActiveisFalse() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
- productReqDetails.setActive("false");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- ProductRestUtils.checkCreateResponse(createProduct);
- String productUuid = ResponseParser.getUuidFromResponse(createProduct);
- compareExpectedAndActualProducts(productReqDetails, createProduct);
- Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
- productManager1.getUserId());
- ProductRestUtils.checkSuccess(getProductRes);
- Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
- ComponentOperationEnum.GET_COMPONENT);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
- "0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test
- public void createProductIsActiveisHasInvalidValue() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
- productReqDetails.setActive("xfalse");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_INVALID_CONTENT,
- createProduct.getErrorCode().intValue());
- Product expectedProduct = Convertor.constructFieldsForRespValidation(productReqDetails, "", productManager1);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.INVALID_CONTENT,
- Constants.EMPTY_STRING, Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING);
- constructFieldsForAuditValidation.setCURR_VERSION("");
- constructFieldsForAuditValidation.setCURR_STATE("");
- constructFieldsForAuditValidation.setRESOURCE_NAME("");
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- @Test // (enabled = false)
- public void createProductIsActiveisTrue() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- // productReqDetails.setName("CIProduct1");
- productReqDetails.setTags(Arrays.asList(productReqDetails.getName()));
- normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
- productReqDetails.setActive("true");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- ProductRestUtils.checkCreateResponse(createProduct);
- String productUuid = ResponseParser.getUuidFromResponse(createProduct);
- compareExpectedAndActualProducts(productReqDetails, createProduct);
- Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
- productManager1.getUserId());
- ProductRestUtils.checkSuccess(getProductRes);
- Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
- ComponentOperationEnum.GET_COMPONENT);
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
- "0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- //////////////////////////////////////////////
- // DE192424
- @Test // (enabled = false)
- public void createProductNameValidationNormalizationNameWithSpaces() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
-// productReqDetails.setName("Abba Emma");
- // productReqDetails.setName("abba emma");
- // productReqDetails.setTags(Arrays.asList("abba emma"));
- normalizedName = productReqDetails.getName().toLowerCase().replaceAll("\\s+", "");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- ProductRestUtils.checkCreateResponse(createProduct);
- String actualNormalizedNameFromResponse = ResponseParser.getValueFromJsonResponse(createProduct.getResponse(),
- "normalizedName");
- assertTrue(actualNormalizedNameFromResponse.equals(normalizedName));
- // productReqDetails.setName("Abba Emma");
- String productUuid = ResponseParser.getUuidFromResponse(createProduct);
- compareExpectedAndActualProducts(productReqDetails, createProduct);
- Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
- productManager1.getUserId());
- ProductRestUtils.checkSuccess(getProductRes);
- Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
- ComponentOperationEnum.GET_COMPONENT);
- assertEquals(actualProduct.getIsActive(), new Boolean(false));
- ExpectedProductAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(
- expectedProduct, CREATE_AUDIT_ACTION, productManager1, ActionStatus.CREATED, Constants.EMPTY_STRING,
- "0.1", null, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, productUuid);
- AuditValidationUtils.validateAuditProduct(constructFieldsForAuditValidation, CREATE_AUDIT_ACTION);
- }
-
- private void compareExpectedAndActualProducts(ProductReqDetails productReqDetails, RestResponse createProduct)
- throws JSONException {
- String productName = ResponseParser.getNameFromResponse(createProduct);
- assertTrue(productReqDetails.getName().equals(productName));
- String productIcon = ResponseParser.getValueFromJsonResponse(createProduct.getResponse(), "icon");
- assertTrue(productReqDetails.getIcon().equals(productIcon));
- String productFullName = ResponseParser.getValueFromJsonResponse(createProduct.getResponse(), "fullName");
- assertTrue(productReqDetails.getFullName().equals(productFullName));
- String productProjectCode = ResponseParser.getValueFromJsonResponse(createProduct.getResponse(), "projectCode");
- assertTrue(productReqDetails.getProjectCode().equals(productProjectCode));
- String productIsActive = ResponseParser.getValueFromJsonResponse(createProduct.getResponse(), "isActive");
- String expectedIsActive = (productReqDetails.getActive() != null ? productReqDetails.getActive() : "false");
- assertTrue(productIsActive.equals(expectedIsActive));
- String productdescription = ResponseParser.getValueFromJsonResponse(createProduct.getResponse(), "description");
- assertTrue(productReqDetails.getDescription().equals(productdescription));
- String productNormalizedName = ResponseParser.getValueFromJsonResponse(createProduct.getResponse(),
- "normalizedName");
- assertTrue(normalizedName.equals(productNormalizedName));
- String productContacts = ResponseParser.getValueFromJsonResponse(createProduct.getResponse(), "contacts");
- JSONArray reciviedContacts = new JSONArray(productContacts);
- String actualContact = null;
- for (int i = 0; i < reciviedContacts.length(); i++) {
- actualContact = reciviedContacts.getString(i);
- assertEquals(productReqDetails.getContacts().get(i), actualContact);
- }
- String productTags = ResponseParser.getValueFromJsonResponse(createProduct.getResponse(), "tags");
- JSONArray reciviedTages = new JSONArray(productTags);
- String actualTag = null;
- for (int i = 0; i < reciviedTages.length(); i++) {
- actualTag = reciviedTages.getString(i);
- assertEquals(productReqDetails.getTags().get(i), actualTag);
- }
- }
-
- // END
- ///////////////////////////////////////////////////////
- @Test
- public void createProductSuccessFlow() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code after create Product", BaseRestUtils.STATUS_CODE_CREATED,
- createProduct.getErrorCode().intValue());
-
- RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
- productManager1.getUserId());
- assertEquals("Check response code after getting created Product", BaseRestUtils.STATUS_CODE_SUCCESS,
- getProductRes.getErrorCode().intValue());
-
- Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
- ComponentOperationEnum.GET_COMPONENT);
- assertEquals(actualProduct.getIsActive(), new Boolean(false));
- }
-
- @Test
- public void createProductSetIsActive() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- productReqDetails.setActive("true");
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code after create Product", BaseRestUtils.STATUS_CODE_CREATED,
- createProduct.getErrorCode().intValue());
-
- RestResponse getProductRes = ProductRestUtils.getProduct(productReqDetails.getUniqueId(),
- productManager1.getUserId());
- assertEquals("Check response code after getting created Product", BaseRestUtils.STATUS_CODE_SUCCESS,
- getProductRes.getErrorCode().intValue());
-
- Product expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- Product actualProduct = ResponseParser.parseToObjectUsingMapper(getProductRes.getResponse(), Product.class);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct,
- ComponentOperationEnum.GET_COMPONENT);
- assertEquals(actualProduct.getIsActive(), new Boolean(true));
- }
-
- @Test
- public void createProductNoIcon() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- productReqDetails.setIcon(null);
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code after create Product", BaseRestUtils.STATUS_CODE_MISSING_DATA,
- createProduct.getErrorCode().intValue());
-
- }
-
- @Test
- public void createProductNoProjectCode() throws Exception {
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
- productReqDetails.setProjectCode(null);
- RestResponse createProduct = ProductRestUtils.createProduct(productReqDetails, productManager1);
- assertEquals("Check response code after create Product", BaseRestUtils.STATUS_CODE_MISSING_DATA,
- createProduct.getErrorCode().intValue());
-
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductGetFollowedTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductGetFollowedTest.java
deleted file mode 100644
index aebea697b2..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductGetFollowedTest.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.product;
-
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.model.Product;
-import org.openecomp.sdc.ci.tests.datatypes.ProductReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.ProductRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.openecomp.sdc.ci.tests.utils.validation.ProductValidationUtils;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-public class ProductGetFollowedTest extends ProductBaseTest {
-
- protected Product product200;
- protected Product product400;
-
- private ProductReqDetails productDetails200;
- private ProductReqDetails productDetails400;
-
- @Rule
- public static TestName name = new TestName();
-
- public ProductGetFollowedTest() {
- super(name, ProductGetFollowedTest.class.getName());
- }
-
- @BeforeMethod
- public void init() throws Exception {
- createProducts();
- }
-
- @Test
- public void followedPageTest() throws Exception { // Actions
- RestResponse changeLifeCycleResponse;
- changeLifeCycleResponse = ProductRestUtils.changeProductLifeCycle(product200, productManager1, LifeCycleStatesEnum.CHECKIN);
- ResourceRestUtils.checkSuccess(changeLifeCycleResponse);
- changeLifeCycleResponse = ProductRestUtils.changeProductLifeCycle(product400, productManager2, LifeCycleStatesEnum.CHECKIN);
- ResourceRestUtils.checkSuccess(changeLifeCycleResponse);
- // Expected users Followed page
- ProductValidationUtils.checkUserFollowedPage(productManager1, product200);
- ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(productManager1, product400);
- ProductValidationUtils.checkUserFollowedPage(productManager2, product400);
- ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(productManager2, product200);
- ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(adminUser, product200, product400);
- ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(designerUser, product200, product400);
- ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(productStrategistUser1, product200, product400);
- }
-
- @Test
- public void followedPagePmCheckedOutProductWasCheckInByOtherPm() throws Exception {
- ProductRestUtils.changeProductLifeCycle(product200, productManager1, LifeCycleStatesEnum.CHECKIN);
- ProductRestUtils.changeProductLifeCycle(product400, productManager2, LifeCycleStatesEnum.CHECKIN);
- ProductRestUtils.changeProductLifeCycle(product400, productManager1, LifeCycleStatesEnum.CHECKOUT);
- RestResponse changeLifeCycleResponse = ProductRestUtils.changeProductLifeCycle(product200, productManager2, LifeCycleStatesEnum.CHECKOUT);
- ResourceRestUtils.checkSuccess(changeLifeCycleResponse);
-
- ProductValidationUtils.checkUserFollowedPage(productManager1, product400);
- ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(productManager2, product400);
- ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(adminUser, product200, product400);
- ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(designerUser, product200, product400);
- ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(productStrategistUser1, product200, product400);
- }
-
- @Test
- public void followedPagePmCheckInProduct02() throws Exception {
- ProductRestUtils.changeProductLifeCycle(product200, productManager1, LifeCycleStatesEnum.CHECKIN);
- ProductRestUtils.changeProductLifeCycle(product400, productManager2, LifeCycleStatesEnum.CHECKIN);
-
- ProductValidationUtils.checkUserFollowedPage(productManager1, product200);
- ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(productManager1, product400);
- ProductValidationUtils.checkUserFollowedPage(productManager2, product400);
- ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(productManager2, product200);
- ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(adminUser, product200, product400);
- ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(designerUser, product200, product400);
- ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(productStrategistUser1, product200, product400);
- }
-
- @Test
- public void followedPageAdminCheckoutProductWasCheckedinByPm() throws Exception {
- ProductRestUtils.changeProductLifeCycle(product400, productManager2, LifeCycleStatesEnum.CHECKIN);
- RestResponse changeLifeCycleResponse = ProductRestUtils.changeProductLifeCycle(product400, adminUser, LifeCycleStatesEnum.CHECKOUT);
- ResourceRestUtils.checkSuccess(changeLifeCycleResponse);
-
- ProductValidationUtils.checkUserFollowedPage(productManager1, product200);
- ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(productManager1, product400);
- ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(productManager2, product400);
- ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(adminUser, product200);
- ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(designerUser, product200, product400);
- ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(productStrategistUser1, product200, product400);
- }
-
- @Test
- public void followedPageAdminCheckInProduct() throws Exception {
- ProductRestUtils.changeProductLifeCycle(product400, productManager2, LifeCycleStatesEnum.CHECKIN);
- ProductRestUtils.changeProductLifeCycle(product400, adminUser, LifeCycleStatesEnum.CHECKOUT);
- RestResponse changeLifeCycleResponse = ProductRestUtils.changeProductLifeCycle(product400, adminUser, LifeCycleStatesEnum.CHECKIN);
- ResourceRestUtils.checkSuccess(changeLifeCycleResponse);
-
- ProductValidationUtils.checkUserFollowedPage(productManager1, product200);
- ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(productManager1, product400);
- ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(productManager2, product400);
- ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(adminUser, product200);
- ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(designerUser, product200, product400);
- ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(productStrategistUser1, product200, product400);
- }
-
- @Test
- public void followedPagePmCheckoutProductWasCheckedinByAdmin() throws Exception {
- ProductRestUtils.changeProductLifeCycle(product200, productManager1, LifeCycleStatesEnum.CHECKIN);
- ProductRestUtils.changeProductLifeCycle(product400, productManager2, LifeCycleStatesEnum.CHECKIN);
- ProductRestUtils.changeProductLifeCycle(product200, adminUser, LifeCycleStatesEnum.CHECKOUT);
- ProductRestUtils.changeProductLifeCycle(product200, adminUser, LifeCycleStatesEnum.CHECKIN);
- RestResponse changeLifeCycleResponse = ProductRestUtils.changeProductLifeCycle(product200, productManager2, LifeCycleStatesEnum.CHECKOUT);
- ResourceRestUtils.checkSuccess(changeLifeCycleResponse);
-
- ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(productManager1, product200);
- ProductValidationUtils.checkUserFollowedPage(productManager2, product200, product400);
- ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(adminUser, product200, product400);
- ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(designerUser, product200, product400);
- ProductValidationUtils.verifyProductsNotExistInUserFollowedPage(productStrategistUser1, product200, product400);
- }
-
- private void createProducts() throws Exception {
- // PM1 (Product manager) create :PR200 (check In State)
- // PM2 (Product manager) create :PR400 (check In State)
-
- productDetails200 = ElementFactory.getDefaultProduct("CiProd200", defaultCategories);
- productDetails400 = ElementFactory.getDefaultProduct("CiProd400", defaultCategories);
-
- RestResponse createProduct = ProductRestUtils.createProduct(productDetails200, productManager1);
- ResourceRestUtils.checkCreateResponse(createProduct);
- product200 = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
-
- createProduct = ProductRestUtils.createProduct(productDetails400, productManager2);
- ResourceRestUtils.checkCreateResponse(createProduct);
- product400 = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductLifecycleTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductLifecycleTest.java
deleted file mode 100644
index 7404e8e8a6..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductLifecycleTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.product;
-
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.model.Product;
-import org.openecomp.sdc.ci.tests.datatypes.ProductReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ProductRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.testng.annotations.BeforeMethod;
-
-import static org.testng.AssertJUnit.assertEquals;
-
-public abstract class ProductLifecycleTest extends ProductBaseTest {
-
- protected static final String CHECKIN_ACTION = "Checkin";
- protected static final String CHECKOUT_ACTION = "Checkout";
- protected static final String UNDO_CHECKOUT_ACTION = "UndoCheckout";
-
- protected Product expectedProduct;
-
- public ProductLifecycleTest(TestName testName, String className) {
- super(testName, className);
- }
-
- @BeforeMethod
- public void init() throws Exception {
- ProductReqDetails defaultProduct = ElementFactory.getDefaultProduct(defaultCategories);
- RestResponse createProduct = ProductRestUtils.createProduct(defaultProduct, productManager1);
- assertEquals("Check response code after create Product", BaseRestUtils.STATUS_CODE_CREATED,
- createProduct.getErrorCode().intValue());
- expectedProduct = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductTestBase.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductTestBase.java
deleted file mode 100644
index 2b62a558ab..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductTestBase.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.product;
-
-
-import org.junit.Before;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.model.Product;
-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.ci.tests.datatypes.*;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.ArtifactUtils;
-import org.openecomp.sdc.ci.tests.utils.DbUtils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.*;
-
-import java.io.IOException;
-
-import static org.junit.Assert.*;
-
-public class ProductTestBase extends ProductBaseTest {
-
- public ProductTestBase(TestName testName, String className) {
- super(testName, className);
- }
-
- protected ResourceReqDetails downloadResourceDetails;
- protected ServiceReqDetails serviceDetails;
- protected ComponentInstanceReqDetails resourceInstanceReqDetails;
- protected User sdncUserDetails;
- protected ArtifactReqDetails heatArtifactDetails;
- protected ArtifactReqDetails defaultArtifactDetails;
-
- protected ArtifactUtils artifactUtils;
- protected Resource resource;
- protected Service service;
- protected Product product;
-
- // protected static ServiceUtils serviceUtils = new ServiceUtils();
-
- @Before
- public void before() throws Exception {
-
- initializeMembers();
- createComponents();
-
- }
-
- public void initializeMembers() throws IOException, Exception {
-
- downloadResourceDetails = ElementFactory.getDefaultResource();
- serviceDetails = ElementFactory.getDefaultService();
- sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- heatArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
- resourceInstanceReqDetails = ElementFactory.getDefaultComponentInstance();
-
- }
-
- protected void createComponents() throws Exception {
-
- RestResponse response = ResourceRestUtils.createResource(downloadResourceDetails, sdncUserDetails);
- assertTrue("create request returned status:" + response.getErrorCode(), response.getErrorCode() == 201);
- assertNotNull("resource uniqueId is null:", downloadResourceDetails.getUniqueId());
-
- ArtifactReqDetails heatArtifactDetails = ElementFactory
- .getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
- response = ArtifactRestUtils.addInformationalArtifactToResource(heatArtifactDetails, sdncUserDetails,
- downloadResourceDetails.getUniqueId());
- assertTrue("add HEAT artifact to resource request returned status:" + response.getErrorCode(),
- response.getErrorCode() == 200);
-
- // certified resource
- response = LifecycleRestUtils.certifyResource(downloadResourceDetails);
- assertTrue("certify resource request returned status:" + response.getErrorCode(),
- response.getErrorCode() == 200);
-
- response = ResourceRestUtils.getResource(downloadResourceDetails.getUniqueId());
- assertTrue("response code is not 200, returned: " + response.getErrorCode(), response.getErrorCode() == 200);
- resource = ResponseParser.convertResourceResponseToJavaObject(response.getResponse());
-
- response = ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
- assertTrue("create request returned status:" + response.getErrorCode(), response.getErrorCode() == 201);
- assertNotNull("service uniqueId is null:", serviceDetails.getUniqueId());
-
- // add resource instance with HEAT deployment artifact to the service
- resourceInstanceReqDetails.setComponentUid(downloadResourceDetails.getUniqueId());
- response = ComponentInstanceRestUtils.createComponentInstance(resourceInstanceReqDetails, sdncUserDetails,
- serviceDetails.getUniqueId(), ComponentTypeEnum.SERVICE);
- assertTrue("response code is not 201, returned: " + response.getErrorCode(), response.getErrorCode() == 201);
-
- // certified service
- response = LifecycleRestUtils.certifyService(serviceDetails);
- assertTrue("certify service request returned status:" + response.getErrorCode(),
- response.getErrorCode() == 200);
-
- response = ServiceRestUtils.getService(serviceDetails, sdncUserDetails);
- assertTrue("response code is not 200, returned: " + response.getErrorCode(), response.getErrorCode() == 200);
- service = ResponseParser.convertServiceResponseToJavaObject(response.getResponse());
-
- DbUtils.cleanAllAudits();
-
- ProductReqDetails defaultProduct = ElementFactory.getDefaultProduct(defaultCategories);
- RestResponse createProduct = ProductRestUtils.createProduct(defaultProduct, productStrategistUser1);
- assertEquals("Check response code after create Product", BaseRestUtils.STATUS_CODE_CREATED,
- createProduct.getErrorCode().intValue());
- product = ResponseParser.parseToObjectUsingMapper(createProduct.getResponse(), Product.class);
-
- // add service instance to product
- //
-
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductToscaYamlGenerationTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductToscaYamlGenerationTest.java
deleted file mode 100644
index 0c74f255fd..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductToscaYamlGenerationTest.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.product;
-
-import com.google.gson.Gson;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.model.ArtifactUiDownloadData;
-import org.openecomp.sdc.ci.tests.utils.Decoder;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.testng.annotations.Test;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-public class ProductToscaYamlGenerationTest extends ProductTestBase {
-
- @Rule
- public static TestName name = new TestName();
-
- public ProductToscaYamlGenerationTest() {
- super(name, ProductToscaYamlGenerationTest.class.getName());
- }
-
- @Test
- public void productToscaYamlFormat() throws IOException {
-
- String heatEnvArtifactHeader = (String) Utils.parseYamlConfig("heatEnvArtifactHeader");
- // System.out.println("heatEnvArtifactHeader = \n" +
- // heatEnvArtifactHeader);
-
- String heatEnvArtifactFooter = (String) Utils.parseYamlConfig("heatEnvArtifactFooter");
- // System.out.println("heatEnvArtifactFooter = \n" +
- // heatEnvArtifactFooter);
-
- // temporary commented
- // RestResponse downloadResourceInstanceHeatArtifact =
- // ArtifactRestUtils.downloadResourceInstanceArtifact(service.getUniqueId(),
- // resourceInstanceId, sdncUserDetails,
- // heatArtifactDefinition.getUniqueId());
- // assertTrue("expected request returned status:" + 200 + ", actual: " +
- // downloadResourceInstanceHeatArtifact.getErrorCode(),
- // downloadResourceInstanceHeatArtifact.getErrorCode()==200);
-
- // InputStream stream =
- // getDecodedSteramFromString(downloadResourceInstanceHeatArtifact.getResponse());
- // System.out.println(Utils.getParamValueFromYamlByKey(stream,
- // "description", String.class));
-
- // node_types
-
- }
-
- private InputStream getDecodedSteramFromString(String encoded64Payload) throws IOException {
-
- Gson gson = new Gson();
- ArtifactUiDownloadData artifactUiDownloadData = gson.fromJson(encoded64Payload, ArtifactUiDownloadData.class);
- String decodedPayload = Decoder.decode(artifactUiDownloadData.getBase64Contents());
- return new ByteArrayInputStream(decodedPayload.getBytes());
-
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductUndoCheckoutTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductUndoCheckoutTest.java
deleted file mode 100644
index 4bd1dffeff..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/product/ProductUndoCheckoutTest.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.product;
-
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.model.LifecycleStateEnum;
-import org.openecomp.sdc.be.model.Product;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedProductAudit;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.general.Convertor;
-import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ProductRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
-import org.openecomp.sdc.ci.tests.utils.validation.ProductValidationUtils;
-import org.openecomp.sdc.common.api.Constants;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import java.io.FileNotFoundException;
-
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertNull;
-
-public class ProductUndoCheckoutTest extends ProductLifecycleTest {
-
- @Rule
- public static TestName name = new TestName();
-
- @BeforeClass
- public static void staticInit() {
- auditAction = UNDO_CHECKOUT_ACTION;
- operation = ComponentOperationEnum.CHANGE_STATE_UNDO_CHECKOUT;
- }
-
- public ProductUndoCheckoutTest() {
- super(name, ProductUndoCheckoutTest.class.getName());
- }
-
- @Test
- public void undoCheckOutProductByPm() throws Exception {
- undoCheckOutProductSuccess(productManager1, false);
- }
-
- @Test
- public void undoCheckOutProductByAdmin() throws Exception {
- undoCheckOutProductSuccess(adminUser, true);
- }
-
- @Test
- public void undoCheckOutAfterCreate() throws Exception {
- RestResponse lcsResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager1,
- LifeCycleStatesEnum.UNDOCHECKOUT);
- assertEquals("Check response code after undo checkout product", 200, lcsResponse.getErrorCode().intValue());
-
- // Verify version was removed
- lcsResponse = ProductRestUtils.getProduct(expectedProduct.getUniqueId(), productManager1.getUserId());
- assertEquals("Check response code after get undone product", 404, lcsResponse.getErrorCode().intValue());
-
- Product emptyProduct = ResponseParser.parseToObjectUsingMapper(lcsResponse.getResponse(), Product.class);
- assertNull(emptyProduct);
- ExpectedProductAudit expectedProductAudit = Convertor.constructFieldsForAuditValidation(emptyProduct,
- auditAction, productManager1, ActionStatus.OK, "0.1", Constants.EMPTY_STRING,
- LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, null, Constants.EMPTY_STRING);
- AuditValidationUtils.validateAuditProduct(expectedProductAudit, auditAction);
-
- }
-
- @Test
- public void undoCheckOutNotExist() throws Exception {
- String notExistId = "1234";
- expectedProduct.setUniqueId(notExistId);
- RestResponse lcsResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager1,
- LifeCycleStatesEnum.UNDOCHECKOUT);
- assertEquals("Check response code after undo checkout product", 404, lcsResponse.getErrorCode().intValue());
- expectedProduct.setName(notExistId);
- String[] auditParameters = new String[] { Constants.EMPTY_STRING };
- ExpectedProductAudit expectedProductAudit = Convertor.constructFieldsForAuditValidation(expectedProduct,
- auditAction, productManager1, ActionStatus.PRODUCT_NOT_FOUND, Constants.EMPTY_STRING,
- Constants.EMPTY_STRING, null, null, Constants.EMPTY_STRING, auditParameters);
- AuditValidationUtils.validateAuditProduct(expectedProductAudit, auditAction);
-
- }
-
- @Test
- public void undoCheckOutNotInCheckout() throws Exception {
- RestResponse lcsResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager1,
- LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkin product", 200, lcsResponse.getErrorCode().intValue());
-
- lcsResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager1,
- LifeCycleStatesEnum.UNDOCHECKOUT);
- assertEquals("Check response code after undo checkout product", 409, lcsResponse.getErrorCode().intValue());
-
- String[] auditParameters = new String[] { expectedProduct.getName(), "product", productManager1.getFirstName(),
- productManager1.getLastName(), productManager1.getUserId() };
-
- ExpectedProductAudit expectedProductAudit = Convertor.constructFieldsForAuditValidation(expectedProduct,
- auditAction, productManager1, ActionStatus.COMPONENT_ALREADY_CHECKED_IN, "0.1", "0.1",
- LifecycleStateEnum.NOT_CERTIFIED_CHECKIN, LifecycleStateEnum.NOT_CERTIFIED_CHECKIN,
- expectedProduct.getUUID(), auditParameters);
- AuditValidationUtils.validateAuditProduct(expectedProductAudit, auditAction);
-
- }
-
- @Test
- public void undoCheckOutProductByPsRoleNotAllowed() throws Exception {
- undoCheckOutProductRestricted(productStrategistUser1);
- }
-
- @Test
- public void undoCheckOutProductByPmNotStateOwner() throws Exception {
- undoCheckOutProductForbidden(productManager2);
- }
-
- private void undoCheckOutProductSuccess(User user, boolean isAdmin) throws Exception, FileNotFoundException {
- RestResponse lcsResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager1,
- LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkin product", 200, lcsResponse.getErrorCode().intValue());
-
- // Checking undo checkout of admin even if not state owner
- User checkoutUser = isAdmin ? productManager1 : user;
-
- lcsResponse = LifecycleRestUtils.changeProductState(expectedProduct, checkoutUser,
- LifeCycleStatesEnum.CHECKOUT);
- assertEquals("Check response code after checkout product", 200, lcsResponse.getErrorCode().intValue());
- Product productToBeUndone = ResponseParser.parseToObjectUsingMapper(lcsResponse.getResponse(), Product.class);
-
- lcsResponse = LifecycleRestUtils.changeProductState(productToBeUndone, user, LifeCycleStatesEnum.UNDOCHECKOUT);
- assertEquals("Check response code after undo checkout product", 200, lcsResponse.getErrorCode().intValue());
-
- // Verify version was removed
- lcsResponse = ProductRestUtils.getProduct(productToBeUndone.getUniqueId(), user.getUserId());
- assertEquals("Check response code after get undone product", 404, lcsResponse.getErrorCode().intValue());
-
- lcsResponse = ProductRestUtils.getProduct(expectedProduct.getUniqueId(), user.getUserId());
- assertEquals("Check response code after get latest version", 200, lcsResponse.getErrorCode().intValue());
-
- Product latestProduct = ResponseParser.parseToObjectUsingMapper(lcsResponse.getResponse(), Product.class);
-
- expectedProduct.setLifecycleState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, latestProduct, operation);
-
- ExpectedProductAudit expectedProductAudit = Convertor.constructFieldsForAuditValidation(latestProduct,
- auditAction, user, ActionStatus.OK, "0.2", "0.1", LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT,
- LifecycleStateEnum.NOT_CERTIFIED_CHECKIN, latestProduct.getUUID());
- AuditValidationUtils.validateAuditProduct(expectedProductAudit, auditAction);
- }
-
- private void undoCheckOutProductRestricted(User undoCheckoutUser) throws Exception, FileNotFoundException {
- RestResponse lcsResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager1,
- LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkin product", 200, lcsResponse.getErrorCode().intValue());
-
- lcsResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager1,
- LifeCycleStatesEnum.CHECKOUT);
- assertEquals("Check response code after checkout product", 200, lcsResponse.getErrorCode().intValue());
- Product productToBeUndone = ResponseParser.parseToObjectUsingMapper(lcsResponse.getResponse(), Product.class);
-
- lcsResponse = LifecycleRestUtils.changeProductState(productToBeUndone, undoCheckoutUser,
- LifeCycleStatesEnum.UNDOCHECKOUT);
- assertEquals("Check response code after undocheckout product", 409, lcsResponse.getErrorCode().intValue());
-
- ExpectedProductAudit expectedProductAudit = Convertor.constructFieldsForAuditValidation(productToBeUndone,
- auditAction, undoCheckoutUser, ActionStatus.RESTRICTED_OPERATION, "0.2", "0.2",
- LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT,
- productToBeUndone.getUUID());
- AuditValidationUtils.validateAuditProduct(expectedProductAudit, auditAction);
- }
-
- private void undoCheckOutProductForbidden(User undoCheckoutUser) throws Exception, FileNotFoundException {
- RestResponse lcsResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager1,
- LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkin product", 200, lcsResponse.getErrorCode().intValue());
-
- lcsResponse = LifecycleRestUtils.changeProductState(expectedProduct, productManager1,
- LifeCycleStatesEnum.CHECKOUT);
- assertEquals("Check response code after checkout product", 200, lcsResponse.getErrorCode().intValue());
- Product productToBeUndone = ResponseParser.parseToObjectUsingMapper(lcsResponse.getResponse(), Product.class);
-
- lcsResponse = LifecycleRestUtils.changeProductState(productToBeUndone, undoCheckoutUser,
- LifeCycleStatesEnum.UNDOCHECKOUT);
- assertEquals("Check response code after undocheckout product", 403, lcsResponse.getErrorCode().intValue());
- String[] auditParameters = new String[] { productToBeUndone.getName(), "product",
- productManager1.getFirstName(), productManager1.getLastName(), productManager1.getUserId() };
-
- ExpectedProductAudit expectedProductAudit = Convertor.constructFieldsForAuditValidation(expectedProduct,
- auditAction, undoCheckoutUser, ActionStatus.COMPONENT_CHECKOUT_BY_ANOTHER_USER, "0.2", "0.2",
- LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT,
- productToBeUndone.getUUID(), auditParameters);
- AuditValidationUtils.validateAuditProduct(expectedProductAudit, auditAction);
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/property/AdditionalInformationServletTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/property/AdditionalInformationServletTest.java
deleted file mode 100644
index ff9d3e6d42..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/property/AdditionalInformationServletTest.java
+++ /dev/null
@@ -1,2009 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.property;
-
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.google.gson.reflect.TypeToken;
-import org.json.simple.parser.JSONParser;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.datatypes.elements.AdditionalInfoParameterInfo;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.model.AdditionalInformationDefinition;
-import org.openecomp.sdc.be.model.PropertyConstraint;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.be.model.operations.impl.PropertyOperation.PropertyConstraintDeserialiser;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.*;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.execute.resource.ResourceApiTest;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.*;
-import org.testng.AssertJUnit;
-import org.testng.annotations.Test;
-
-import java.io.IOException;
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import static org.testng.AssertJUnit.*;
-
-public class AdditionalInformationServletTest extends ComponentBaseTest {
-
- protected Type constraintType = new TypeToken<PropertyConstraint>() {
- }.getType();
-
- protected Gson gson = new GsonBuilder().registerTypeAdapter(constraintType, new PropertyConstraintDeserialiser()).create();
-
- @Rule
- public static TestName name = new TestName();
-
- protected String contentTypeHeaderData = "application/json";
- protected String acceptHeaderDate = "application/json";
-
- protected JSONParser jsonParser = new JSONParser();
-
- public AdditionalInformationServletTest() {
- super(name, AdditionalInformationServletTest.class.getName());
- }
-
- // @Before
- // public void deleteResources() {
- // //TODO Evg : will be new API added for delete by name and version
- //
- // ResourceReqDetails resource = getResource();
- // User user = getUser();
- //
- // try {
- // String resourceName = resource.getResourceName();
- // ResourceRestUtils.deleteResourceByNameAndVersion(user, resourceName,
- // "0.1");
- // ResourceRestUtils.deleteResourceByNameAndVersion(user, resourceName,
- // "0.2");
- // ResourceRestUtils.deleteResourceByNameAndVersion(user, resourceName,
- // "1.0");
- // ResourceRestUtils.deleteResourceByNameAndVersion(user, resourceName,
- // "1.1");
- // ResourceRestUtils.deleteResourceByNameAndVersion(user, resourceName +
- // "aa", "0.1");
- // resourceUtils.deleteResource_allVersions(resource, user);
- //
- // } catch (IOException e) {
- // assertTrue(false);
- // }
- //
- // try {
- // ServiceReqDetails serviceDetails = getServiceDetails();
- //
- // RestResponse deleteServiceResponse =
- // serviceUtils.deleteServiceByNameAndVersion(UserUtils.getAdminDetails(),
- // serviceDetails.getServiceName(), "0.1");
- //
- // assertNotNull("check response object is not null after delete
- // service",deleteServiceResponse);
- // assertNotNull("check error code exists in response after delete
- // service",deleteServiceResponse.getErrorCode());
- // assertTrue("delete service failed status:" +
- // deleteServiceResponse.getErrorCode(),
- // deleteServiceResponse.getErrorCode() != 500);
- //
- // deleteServiceResponse =
- // serviceUtils.deleteServiceByNameAndVersion(UserUtils.getAdminDetails(),
- // serviceDetails.getServiceName(), "1.0");
- //
- // assertNotNull("check response object is not null after delete
- // service",deleteServiceResponse);
- // assertNotNull("check error code exists in response after delete
- // service",deleteServiceResponse.getErrorCode());
- // assertTrue("delete service failed status:" +
- // deleteServiceResponse.getErrorCode(),
- // deleteServiceResponse.getErrorCode() != 500);
- //
- // serviceUtils.deleteService_allVersions(serviceDetails, user);
- //
- // } catch (IOException e) {
- // assertTrue(false);
- // }
- // }
-
- @Test
- public void updateResourceAdditionalInformationTest() throws Exception {
- User user = getUser();
- ResourceReqDetails resource = getResource();
-
- // deleteResource(resourceId, user);
- RestResponse createResourceResponse = createResource(resource, user);
-
- String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
-
- AssertJUnit.assertNotNull("check response object is not null after create resource", createResourceResponse);
- AssertJUnit.assertNotNull("check error code exists in response after create resource", createResourceResponse.getErrorCode());
- AssertJUnit.assertEquals("Check response code after create resource", 201, createResourceResponse.getErrorCode().intValue());
-
- String key = "AAA AAA";
- String value = "BBBB";
-
- String updatedKey = "ZZZ ZZZ";
- String updatedValue = "JJJJ";
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
-
- RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
- AssertJUnit.assertNotNull("check response object is not null after create property", createProperty);
- AssertJUnit.assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- AssertJUnit.assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
-
- AdditionalInfoParameterInfo fromJson = gson.fromJson(createProperty.getResponse(), AdditionalInfoParameterInfo.class);
- AssertJUnit.assertFalse("check number of spaces", fromJson.getKey().contains(" "));
- AssertJUnit.assertEquals("check returned key", "AAA AAA", fromJson.getKey());
-
- fromJson.setKey(updatedKey);
- fromJson.setValue(updatedValue);
-
- RestResponse updatedProperty = updateAdditionalInformation(resourceId, fromJson, user, fromJson.getUniqueId());
- AssertJUnit.assertNotNull("check response object is not null after update additional information", updatedProperty);
- AssertJUnit.assertNotNull("check error code exists in response after additional information", updatedProperty.getErrorCode());
- AssertJUnit.assertEquals("Check response code after additional information", 200, updatedProperty.getErrorCode().intValue());
-
- AdditionalInfoParameterInfo updatedJson = gson.fromJson(updatedProperty.getResponse(), AdditionalInfoParameterInfo.class);
- AssertJUnit.assertFalse("check number of spaces", updatedJson.getKey().contains(" "));
- AssertJUnit.assertEquals("check returned key", "ZZZ ZZZ", updatedJson.getKey());
- AssertJUnit.assertEquals("check returned value", updatedValue, updatedJson.getValue());
- AssertJUnit.assertEquals("check returned id", fromJson.getUniqueId(), updatedJson.getUniqueId());
-
- }
-
- @Test
- public void deleteResourceAdditionalInformationTest() throws Exception {
- User user = getUser();
- ResourceReqDetails resource = getResource();
-
- RestResponse createResourceResponse = createResource(resource, user);
-
- String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
-
- AssertJUnit.assertNotNull("check response object is not null after create resource", createResourceResponse);
- AssertJUnit.assertNotNull("check error code exists in response after create resource", createResourceResponse.getErrorCode());
- AssertJUnit.assertEquals("Check response code after create resource", 201, createResourceResponse.getErrorCode().intValue());
-
- String key = "AAA AAA";
- String value = "BBBB";
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
-
- RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
- AssertJUnit.assertNotNull("check response object is not null after create property", createProperty);
- AssertJUnit.assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- AssertJUnit.assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
-
- AdditionalInfoParameterInfo fromJson = gson.fromJson(createProperty.getResponse(), AdditionalInfoParameterInfo.class);
- AssertJUnit.assertFalse("check number of spaces", fromJson.getKey().contains(" "));
- AssertJUnit.assertEquals("check returned key", "AAA AAA", fromJson.getKey());
-
- RestResponse deletedProperty = deleteAdditionalInformation(resourceId, fromJson.getUniqueId(), user);
- AssertJUnit.assertNotNull("check response object is not null after update additional information", deletedProperty);
- AssertJUnit.assertNotNull("check error code exists in response after additional information", deletedProperty.getErrorCode());
- AssertJUnit.assertEquals("Check response code after additional information", 200, deletedProperty.getErrorCode().intValue());
-
- AdditionalInfoParameterInfo updatedJson = gson.fromJson(deletedProperty.getResponse(), AdditionalInfoParameterInfo.class);
- AssertJUnit.assertFalse("check number of spaces", updatedJson.getKey().contains(" "));
- AssertJUnit.assertEquals("check returned key", "AAA AAA", updatedJson.getKey());
- AssertJUnit.assertEquals("check returned value", value, updatedJson.getValue());
- AssertJUnit.assertEquals("check returned id", fromJson.getUniqueId(), updatedJson.getUniqueId());
-
- deletedProperty = deleteAdditionalInformation(resourceId, fromJson.getUniqueId(), user);
- AssertJUnit.assertNotNull("check response object is not null after update additional information", deletedProperty);
- AssertJUnit.assertNotNull("check error code exists in response after additional information", deletedProperty.getErrorCode());
- AssertJUnit.assertEquals("Check response code after additional information", 409, deletedProperty.getErrorCode().intValue());
-
- }
-
- @Test
- public void createResourceAdditionalInformationTestDuringLifecycle() throws Exception {
- User user = getUser();
- ResourceReqDetails resource = getResource();
-
- // deleteResource(resourceId, user);
- RestResponse createResourceResponse = createResource(resource, user);
-
- String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
-
- AssertJUnit.assertNotNull("check response object is not null after create resource", createResourceResponse);
- AssertJUnit.assertNotNull("check error code exists in response after create resource", createResourceResponse.getErrorCode());
- AssertJUnit.assertEquals("Check response code after create resource", 201, createResourceResponse.getErrorCode().intValue());
-
- String key = "AAA AAA";
- String value = "BBBB";
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
-
- RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
- AssertJUnit.assertNotNull("check response object is not null after create property", createProperty);
- AssertJUnit.assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- AssertJUnit.assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
-
- AdditionalInfoParameterInfo fromJson = gson.fromJson(createProperty.getResponse(), AdditionalInfoParameterInfo.class);
- AssertJUnit.assertFalse("check number of spaces", fromJson.getKey().contains(" "));
- AssertJUnit.assertEquals("check returned key", "AAA AAA", fromJson.getKey());
-
- resource.setUniqueId(resourceId);
-
- // resourceUtils.addResourceMandatoryArtifacts(user,
- // createResourceResponse);
-
- certifyResource(user, resource, null, 1);
-
- }
-
- public RestResponse createService() {
-
- User user = getUser();
- ServiceReqDetails serviceDetails = getServiceDetails();
-
- RestResponse createServiceResponse = null;
- try {
- createServiceResponse = ServiceRestUtils.createService(serviceDetails, user);
- AssertJUnit.assertNotNull("check response object is not null after create user", createServiceResponse);
- AssertJUnit.assertNotNull("check error code exists in response after create resource", createServiceResponse.getErrorCode());
- AssertJUnit.assertEquals("Check response code after checkout resource", 201, createServiceResponse.getErrorCode().intValue());
- } catch (Exception e) {
- AssertJUnit.assertTrue(false);
- }
-
- return createServiceResponse;
-
- }
-
- protected User getUser() {
- String adminFirstName = "Jimmy";
- String adminLastName = "Hendrix";
- String adminUserId = "jh0003";
- return new User(adminFirstName, adminLastName, adminUserId, null, null, null);
- }
-
- protected ResourceReqDetails getResource() {
- String resourceName = "ciResourceforproperty4";
- String description = "description";
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add(resourceName);
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add("tosca.nodes.Root");
- String vendorName = "Oracle";
- String vendorRelease = "1.5";
- String contactId = "pe0123";
- String icon = "myICON";
- ResourceReqDetails resource = new ResourceReqDetails(resourceName, description, resourceTags, null, derivedFrom, vendorName, vendorRelease, contactId, icon);
- resource.addCategoryChain(ResourceCategoryEnum.GENERIC_DATABASE.getCategory(), ResourceCategoryEnum.GENERIC_DATABASE.getSubCategory());
- return resource;
- }
-
- protected RestResponse createResource(ResourceReqDetails resourceDetails, User sdncModifierDetails) throws IOException {
-
- ResourceApiTest rat = new ResourceApiTest();
- ResourceReqDetails resourceObj = rat.getResourceObj();
-
- Config config = Utils.getConfig();
-
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
-
- Gson gson = new Gson();
- String userBodyJson = gson.toJson(resourceDetails);
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.CREATE_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort());
- RestResponse createResourceResponse = http.httpSendPost(url, userBodyJson, headersMap);
-
- return createResourceResponse;
-
- }
-
- protected RestResponse getResource(User sdncModifierDetails, String resourceUid) throws IOException {
-
- ResourceApiTest rat = new ResourceApiTest();
- ResourceReqDetails resourceObj = rat.getResourceObj();
-
- Config config = Utils.getConfig();
-
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
-
- Gson gson = new Gson();
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.GET_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceUid);
- RestResponse createResourceResponse = http.httpSendGet(url, headersMap);
-
- return createResourceResponse;
-
- }
-
- protected RestResponse deleteResource(String resourceName, String resourceVersion, User sdncModifierDetails) throws IOException {
- RestResponse deleteResourceResponse = ResourceRestUtils.deleteResourceByNameAndVersion(sdncModifierDetails, resourceName, resourceVersion);
-
- return deleteResourceResponse;
-
- }
-
- protected RestResponse updateAdditionalInformation(String resourceId, AdditionalInfoParameterInfo additionalInfo, User sdncModifierDetails, String id) throws IOException {
- Config config = Utils.getConfig();
-
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
-
- Gson gson = new Gson();
- String body = gson.toJson(additionalInfo);
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.UPDATE_ADDITIONAL_INFORMATION_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceId, id);
- return http.httpSendPut(url, body, headersMap);
-
- }
-
- protected RestResponse updateServiceAdditionalInformation(String resourceId, AdditionalInfoParameterInfo additionalInfo, User sdncModifierDetails, String id) throws IOException {
- Config config = Utils.getConfig();
-
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
-
- Gson gson = new Gson();
- String body = gson.toJson(additionalInfo);
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.UPDATE_ADDITIONAL_INFORMATION_SERVICE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceId, id);
- return http.httpSendPut(url, body, headersMap);
-
- }
-
- protected RestResponse deleteAdditionalInformation(String resourceId, String id, User sdncModifierDetails) throws IOException {
- Config config = Utils.getConfig();
-
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
-
- Gson gson = new Gson();
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.DELETE_ADDITIONAL_INFORMATION_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceId, id);
- return http.httpSendDelete(url, headersMap);
-
- }
-
- protected RestResponse deleteServiceAdditionalInformation(String resourceId, String id, User sdncModifierDetails) throws IOException {
- Config config = Utils.getConfig();
-
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
-
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.DELETE_ADDITIONAL_INFORMATION_SERVICE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceId, id);
- return http.httpSendDelete(url, headersMap);
-
- }
-
- protected RestResponse getAdditionalInformation(String resourceId, String id, User sdncModifierDetails) throws IOException {
- Config config = Utils.getConfig();
-
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
-
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.GET_ADDITIONAL_INFORMATION_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceId, id);
- return http.httpSendGet(url, headersMap);
-
- }
-
- protected RestResponse getServiceAdditionalInformation(String resourceId, String id, User sdncModifierDetails) throws IOException {
- Config config = Utils.getConfig();
-
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
-
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.GET_ADDITIONAL_INFORMATION_SERVICE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceId, id);
- return http.httpSendGet(url, headersMap);
-
- }
-
- protected RestResponse getResourceAllAdditionalInformation(String resourceId, User sdncModifierDetails) throws IOException {
- Config config = Utils.getConfig();
-
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
-
- Gson gson = new Gson();
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.GET_ALL_ADDITIONAL_INFORMATION_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceId);
- return http.httpSendGet(url, headersMap);
-
- }
-
- protected RestResponse getServiceAllAdditionalInformation(String resourceId, User sdncModifierDetails) throws IOException {
- Config config = Utils.getConfig();
-
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
-
- Gson gson = new Gson();
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.GET_ALL_ADDITIONAL_INFORMATION_SERVICE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceId);
- return http.httpSendGet(url, headersMap);
-
- }
-
- protected RestResponse createResourceAdditionalInformation(String resourceId, AdditionalInfoParameterInfo additionalInfo, User sdncModifierDetails) throws IOException {
- Config config = Utils.getConfig();
-
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
-
- Gson gson = new Gson();
- String body = gson.toJson(additionalInfo);
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.CREATE_ADDITIONAL_INFORMATION_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceId);
- return http.httpSendPost(url, body, headersMap);
-
- }
-
- protected RestResponse createServiceAdditionalInformation(String serviceId, AdditionalInfoParameterInfo additionalInfo, User sdncModifierDetails) throws IOException {
- Config config = Utils.getConfig();
-
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
-
- Gson gson = new Gson();
- String body = gson.toJson(additionalInfo);
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.CREATE_ADDITIONAL_INFORMATION_SERVICE, config.getCatalogBeHost(), config.getCatalogBePort(), serviceId);
- return http.httpSendPost(url, body, headersMap);
-
- }
-
- protected ServiceReqDetails getServiceDetails() {
- String serviceName = "ciNewTestService21";
- String category = ServiceCategoriesEnum.MOBILITY.getValue();
- ArrayList<String> tags = new ArrayList<String>();
- tags.add("serviceTag");
- tags.add(serviceName);
- String description = "service Description";
- String vendorName = "Oracle";
- String vendorRelease = "0.1";
- String contactId = "al1976";
- String icon = "myIcon";
- String instantiationType = ServiceInstantiationType.A_LA_CARTE.getValue();
-
- return new ServiceReqDetails(serviceName, category, tags, description, contactId, icon, instantiationType);
- }
-
- // TODO Tal: Since Cashing change partial resource returned that causes null
- // pointer exception in line:
- // commented out till fixing
- protected Resource certifyResource(User user, ResourceReqDetails resource, String resourceVersion, int numberOfAI) throws IOException {
- RestResponse checkInResponse = LifecycleRestUtils.changeResourceState(resource, user, resourceVersion, LifeCycleStatesEnum.CHECKIN);
-
- AssertJUnit.assertNotNull("check response object is not null after create user", checkInResponse);
- AssertJUnit.assertNotNull("check error code exists in response after create user", checkInResponse.getErrorCode());
- AssertJUnit.assertEquals("Check response code after create user", 200, checkInResponse.getErrorCode().intValue());
-
- Resource resourceAfterOperation = gson.fromJson(checkInResponse.getResponse(), Resource.class);
- /*// TODO Tal: Since Cashing change partial resource returned that causes
- // null pointer exception
- *//*
- * AssertJUnit.assertEquals("check size of additional information", 1, resourceAfterOperation.getAdditionalInformation().size());
- *//*
- *//*
- * AssertJUnit.assertEquals("check size of additional information", numberOfAI, resourceAfterOperation.getAdditionalInformation().get(0). getParameters().size());
- *//*
-
- RestResponse req4certResponse = LifecycleRestUtils.changeResourceState(resource, user, resourceVersion, LifeCycleStatesEnum.CERTIFICATIONREQUEST);
-
- AssertJUnit.assertNotNull("check response object is not null after create user", req4certResponse);
- AssertJUnit.assertEquals("Check response code after checkout resource", 200, req4certResponse.getErrorCode().intValue());
-
- resourceAfterOperation = gson.fromJson(req4certResponse.getResponse(), Resource.class);
- // TODO Tal: Since Cashing change partial resource returned that causes
- // null pointer exception
- *//*
- * AssertJUnit.assertEquals("check size of additional information", 1, resourceAfterOperation.getAdditionalInformation().size());
- *//*
- *//*
- * AssertJUnit.assertEquals("check size of additional information", numberOfAI, resourceAfterOperation.getAdditionalInformation().get(0). getParameters().size());
- *//*
-
- // change modifier
- user.setUserId(UserRoleEnum.TESTER.getUserId());
- // start certification
-
- RestResponse startCertResourceResponse3 = LifecycleRestUtils.changeResourceState(resource, user, resourceVersion, LifeCycleStatesEnum.STARTCERTIFICATION);
- AssertJUnit.assertNotNull("check response object is not null after create user", startCertResourceResponse3);
- AssertJUnit.assertEquals("Check response code after checkout resource", 200, startCertResourceResponse3.getErrorCode().intValue());
-
- resourceAfterOperation = gson.fromJson(startCertResourceResponse3.getResponse(), Resource.class);
- // TODO Tal: Since Cashing change partial resource returned that causes
- // null pointer exception
- *//*
- * AssertJUnit.assertEquals("check size of additional information", 1, resourceAfterOperation.getAdditionalInformation().size());
- *//*
- *//*
- * AssertJUnit.assertEquals("check size of additional information", numberOfAI, resourceAfterOperation.getAdditionalInformation().get(0). getParameters().size());
- */
-
- // certify
-
- RestResponse certifyResponse = LifecycleRestUtils.changeResourceState(resource, user, resourceVersion, LifeCycleStatesEnum.CERTIFY);
- AssertJUnit.assertNotNull("check response object is not null after create user", certifyResponse);
- AssertJUnit.assertEquals("Check response code after checkout resource", 200, certifyResponse.getErrorCode().intValue());
-
- resourceAfterOperation = gson.fromJson(certifyResponse.getResponse(), Resource.class);
- AssertJUnit.assertEquals("check size of additional information", 1, resourceAfterOperation.getAdditionalInformation().size());
- AssertJUnit.assertEquals("check size of additional information", numberOfAI, resourceAfterOperation.getAdditionalInformation().get(0).getParameters().size());
-
- Resource certifyResource = gson.fromJson(certifyResponse.getResponse(), Resource.class);
- return certifyResource;
- }
-
- protected Resource certifyService(User user, ServiceReqDetails service, String resourceVersion) throws Exception {
- RestResponse checkInResponse = LifecycleRestUtils.changeServiceState(service, user, resourceVersion, LifeCycleStatesEnum.CHECKIN);
-
- AssertJUnit.assertNotNull("check response object is not null after create user", checkInResponse);
- AssertJUnit.assertNotNull("check error code exists in response after create user", checkInResponse.getErrorCode());
- AssertJUnit.assertEquals("Check response code after create user", 200, checkInResponse.getErrorCode().intValue());
-
- Resource resourceAfterOperation = gson.fromJson(checkInResponse.getResponse(), Resource.class);
- AssertJUnit.assertEquals("check size of additional information", 1, resourceAfterOperation.getAdditionalInformation().size());
- AssertJUnit.assertEquals("check size of additional information", 1, resourceAfterOperation.getAdditionalInformation().get(0).getParameters().size());
-
- RestResponse req4certResponse = LifecycleRestUtils.changeServiceState(service, user, resourceVersion, LifeCycleStatesEnum.CERTIFICATIONREQUEST);
-
- AssertJUnit.assertNotNull("check response object is not null after create user", req4certResponse);
- AssertJUnit.assertEquals("Check response code after checkout resource", 200, req4certResponse.getErrorCode().intValue());
-
- resourceAfterOperation = gson.fromJson(req4certResponse.getResponse(), Resource.class);
- AssertJUnit.assertEquals("check size of additional information", 1, resourceAfterOperation.getAdditionalInformation().size());
- AssertJUnit.assertEquals("check size of additional information", 1, resourceAfterOperation.getAdditionalInformation().get(0).getParameters().size());
-
- // change modifier
- user.setUserId(UserRoleEnum.TESTER.getUserId());
- // start certification
-
- RestResponse startCertResourceResponse3 = LifecycleRestUtils.changeServiceState(service, user, resourceVersion, LifeCycleStatesEnum.STARTCERTIFICATION);
- AssertJUnit.assertNotNull("check response object is not null after create user", startCertResourceResponse3);
- AssertJUnit.assertEquals("Check response code after checkout resource", 200, startCertResourceResponse3.getErrorCode().intValue());
-
- resourceAfterOperation = gson.fromJson(startCertResourceResponse3.getResponse(), Resource.class);
- AssertJUnit.assertEquals("check size of additional information", 1, resourceAfterOperation.getAdditionalInformation().size());
- AssertJUnit.assertEquals("check size of additional information", 1, resourceAfterOperation.getAdditionalInformation().get(0).getParameters().size());
-
- // certify
-
- RestResponse certifyResponse = LifecycleRestUtils.changeServiceState(service, user, resourceVersion, LifeCycleStatesEnum.CERTIFY);
- AssertJUnit.assertNotNull("check response object is not null after create user", certifyResponse);
- AssertJUnit.assertEquals("Check response code after checkout resource", 200, certifyResponse.getErrorCode().intValue());
-
- resourceAfterOperation = gson.fromJson(certifyResponse.getResponse(), Resource.class);
- AssertJUnit.assertEquals("check size of additional information", 1, resourceAfterOperation.getAdditionalInformation().size());
- AssertJUnit.assertEquals("check size of additional information", 1, resourceAfterOperation.getAdditionalInformation().get(0).getParameters().size());
-
- Resource certifyResource = gson.fromJson(certifyResponse.getResponse(), Resource.class);
- return certifyResource;
- }
-
- @Test
- public void createResourceAdditionalInformationTest() throws Exception {
- User user = getUser();
- ResourceReqDetails resource = getResource();
-
- // deleteResource(resourceId, user);
- RestResponse createResourceResponse = createResource(resource, user);
-
- String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
-
- assertNotNull("check response object is not null after create resource", createResourceResponse);
- assertNotNull("check error code exists in response after create resource", createResourceResponse.getErrorCode());
- assertEquals("Check response code after create resource", 201, createResourceResponse.getErrorCode().intValue());
-
- String key = "AAA AAA";
- String value = "BBBB";
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
-
- RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
-
- AdditionalInfoParameterInfo fromJson = gson.fromJson(createProperty.getResponse(), AdditionalInfoParameterInfo.class);
- assertFalse("check number of spaces", fromJson.getKey().contains(" "));
- assertEquals("check returned key", "AAA AAA", fromJson.getKey());
-
- createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 409, createProperty.getErrorCode().intValue());
-
- }
-
- @Test
- public void createResourceAdditionalInfoFormatWithTags() throws Exception {
- User user = getUser();
- ResourceReqDetails resource = getResource();
-
- // deleteResource(resourceId, user);
- RestResponse createResourceResponse = createResource(resource, user);
-
- String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
-
- assertNotNull("check response object is not null after create resource", createResourceResponse);
- assertNotNull("check error code exists in response after create resource", createResourceResponse.getErrorCode());
- assertEquals("Check response code after create resource", 201, createResourceResponse.getErrorCode().intValue());
-
- String key = "AAA AAA";
- String value = "<b>Bold<</b>";
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
-
- RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
-
- AdditionalInfoParameterInfo fromJson = gson.fromJson(createProperty.getResponse(), AdditionalInfoParameterInfo.class);
- assertEquals("check returned key", "Bold&amp;lt;", fromJson.getValue());
-
- }
-
- @Test
- public void createServiceAdditionalInfoFormatWithTags() throws Exception {
- User user = getUser();
- RestResponse createServiceResponse = createService();
-
- String serviceId = ResponseParser.convertServiceResponseToJavaObject(createServiceResponse.getResponse()).getUniqueId();
-
- assertNotNull("check response object is not null after create resource", createServiceResponse);
- assertNotNull("check error code exists in response after create resource", createServiceResponse.getErrorCode());
- assertEquals("Check response code after create resource", 201, createServiceResponse.getErrorCode().intValue());
-
- String key = "AAA AAA";
- String value = "<b>Bold<</b>";
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
-
- RestResponse createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
-
- AdditionalInfoParameterInfo fromJson = gson.fromJson(createProperty.getResponse(), AdditionalInfoParameterInfo.class);
- assertEquals("check returned key", "Bold&amp;lt;", fromJson.getValue());
-
- }
-
- @Test
- public void createResourceAdditionalInfoFormatWithWhiteSpaces() throws Exception {
- User user = getUser();
- ResourceReqDetails resource = getResource();
-
- // deleteResource(resourceId, user);
- RestResponse createResourceResponse = createResource(resource, user);
-
- String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
-
- assertNotNull("check response object is not null after create resource", createResourceResponse);
- assertNotNull("check error code exists in response after create resource", createResourceResponse.getErrorCode());
- assertEquals("Check response code after create resource", 201, createResourceResponse.getErrorCode().intValue());
-
- String key = "AAA AAA";
- String value = " ";
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
-
- RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 400, createProperty.getErrorCode().intValue());
-
- key = " ";
- value = "AAA AAA";
-
- additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
-
- createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 400, createProperty.getErrorCode().intValue());
-
- }
-
- @Test
- public void createServiceAdditionalInfoFormatWithWhiteSpaces() throws Exception {
- User user = getUser();
-
- RestResponse createServiceResponse = createService();
- ResponseParser.convertServiceResponseToJavaObject(createServiceResponse.getResponse()).getUniqueId();
-
- String serviceId = ResponseParser.convertServiceResponseToJavaObject(createServiceResponse.getResponse()).getUniqueId();
-
- assertNotNull("check response object is not null after create resource", createServiceResponse);
- assertNotNull("check error code exists in response after create resource", createServiceResponse.getErrorCode());
- assertEquals("Check response code after create resource", 201, createServiceResponse.getErrorCode().intValue());
-
- String key = "AAA AAA";
- String value = " ";
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
-
- RestResponse createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 400, createProperty.getErrorCode().intValue());
-
- key = " ";
- value = "AAA AAA";
-
- additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
-
- createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 400, createProperty.getErrorCode().intValue());
-
- }
-
- @Test
- public void createResourceAndUpdateAdditionalInfo() throws Exception {
- User user = getUser();
- ResourceReqDetails resource = getResource();
-
- // deleteResource(resourceId, user);
- RestResponse createResourceResponse = createResource(resource, user);
-
- String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
-
- assertNotNull("check response object is not null after create resource", createResourceResponse);
- assertNotNull("check error code exists in response after create resource", createResourceResponse.getErrorCode());
- assertEquals("Check response code after create resource", 201, createResourceResponse.getErrorCode().intValue());
-
- String key = "AAA AAA";
- String value = "BBBB";
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
-
- RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
-
- AdditionalInfoParameterInfo fromJson = gson.fromJson(createProperty.getResponse(), AdditionalInfoParameterInfo.class);
- assertFalse("check number of spaces", fromJson.getKey().contains(" "));
- assertEquals("check returned key", "AAA AAA", fromJson.getKey());
-
- key = "BBB BBB";
- value = "BBBB";
-
- additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
-
- createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
-
- fromJson = gson.fromJson(createProperty.getResponse(), AdditionalInfoParameterInfo.class);
- assertFalse("check number of spaces", fromJson.getKey().contains(" "));
- assertEquals("check returned key", "BBB BBB", fromJson.getKey());
-
- String updatedKey = "AAA AAA";
- String updatedValue = "JJJJ";
-
- fromJson.setKey(updatedKey);
- fromJson.setValue(updatedValue);
-
- RestResponse updatedProperty = updateAdditionalInformation(resourceId, fromJson, user, fromJson.getUniqueId());
- assertNotNull("check response object is not null after update additional information", updatedProperty);
- assertNotNull("check error code exists in response after additional information", updatedProperty.getErrorCode());
- assertEquals("Check response code after additional information", 409, updatedProperty.getErrorCode().intValue());
-
- }
-
- @Test
- public void createServiceAdditionalInformationTest() throws Exception {
- User user = getUser();
-
- RestResponse createServiceResponse = createService();
-
- String serviceId = ResponseParser.convertServiceResponseToJavaObject(createServiceResponse.getResponse()).getUniqueId();
-
- String key = "AAA AAA";
- String value = "BBBB";
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
-
- RestResponse createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
-
- AdditionalInfoParameterInfo fromJson = gson.fromJson(createProperty.getResponse(), AdditionalInfoParameterInfo.class);
- assertFalse("check number of spaces", fromJson.getKey().contains(" "));
- assertEquals("check returned key", "AAA AAA", fromJson.getKey());
-
- createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 409, createProperty.getErrorCode().intValue());
-
- }
-
- @Test
- public void createResourceEmptyAdditionalInformationTest() throws Exception {
- User user = getUser();
- ResourceReqDetails resource = getResource();
-
- // deleteResource(resourceId, user);
- RestResponse createResourceResponse = createResource(resource, user);
-
- String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
-
- assertNotNull("check response object is not null after create resource", createResourceResponse);
- assertNotNull("check error code exists in response after create resource", createResourceResponse.getErrorCode());
- assertEquals("Check response code after create resource", 201, createResourceResponse.getErrorCode().intValue());
-
- String key = "";
- String value = "BBBB";
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
-
- RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 400, createProperty.getErrorCode().intValue());
-
- key = "BBBB";
- value = "";
-
- additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
-
- createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 400, createProperty.getErrorCode().intValue());
-
- }
-
- @Test
- public void createServiceEmptyAdditionalInformationTest() throws Exception {
-
- User user = getUser();
-
- RestResponse createServiceResponse = createService();
-
- String serviceId = ResponseParser.convertServiceResponseToJavaObject(createServiceResponse.getResponse()).getUniqueId();
-
- String key = "";
- String value = "BBBB";
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
-
- RestResponse createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 400, createProperty.getErrorCode().intValue());
-
- }
-
- @Test
- public void createResourceAllSpacesAdditionalInformationTest() throws Exception {
- User user = getUser();
- ResourceReqDetails resource = getResource();
-
- // deleteResource(resourceId, user);
- RestResponse createResourceResponse = createResource(resource, user);
-
- String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
-
- assertNotNull("check response object is not null after create resource", createResourceResponse);
- assertNotNull("check error code exists in response after create resource", createResourceResponse.getErrorCode());
- assertEquals("Check response code after create resource", 201, createResourceResponse.getErrorCode().intValue());
-
- String key = " ";
- String value = "BBBB";
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
-
- RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 400, createProperty.getErrorCode().intValue());
-
- }
-
- @Test
- public void createServiceAllSpacesAdditionalInformationTest() throws Exception {
- User user = getUser();
-
- RestResponse createServiceResponse = createService();
-
- String serviceId = ResponseParser.convertServiceResponseToJavaObject(createServiceResponse.getResponse()).getUniqueId();
-
- String key = " ";
- String value = "BBBB";
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
-
- RestResponse createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 400, createProperty.getErrorCode().intValue());
-
- }
-
- @Test
- public void createResourceInvalidKeyAdditionalInformationTest() throws Exception {
- User user = getUser();
- ResourceReqDetails resource = getResource();
-
- // deleteResource(resourceId, user);
- RestResponse createResourceResponse = createResource(resource, user);
-
- String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
-
- assertNotNull("check response object is not null after create resource", createResourceResponse);
- assertNotNull("check error code exists in response after create resource", createResourceResponse.getErrorCode());
- assertEquals("Check response code after create resource", 201, createResourceResponse.getErrorCode().intValue());
-
- String key = "abc?";
- String value = "BBBB";
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
-
- RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 400, createProperty.getErrorCode().intValue());
-
- }
-
- @Test
- public void createServiceInvalidKeyAdditionalInformationTest() throws Exception {
- User user = getUser();
-
- RestResponse createServiceResponse = createService();
-
- String serviceId = ResponseParser.convertServiceResponseToJavaObject(createServiceResponse.getResponse()).getUniqueId();
-
- String key = "abc?";
- String value = "BBBB";
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
-
- RestResponse createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 400, createProperty.getErrorCode().intValue());
-
- }
-
- @Test
- public void createResourceAdditionalInformationNullKeyTest() throws Exception {
-
- User user = getUser();
- ResourceReqDetails resource = getResource();
-
- RestResponse createResourceResponse = createResource(resource, user);
-
- assertNotNull("check response object is not null after create resource", createResourceResponse);
- assertNotNull("check error code exists in response after create resource", createResourceResponse.getErrorCode());
- assertEquals("Check response code after create resource", 201, createResourceResponse.getErrorCode().intValue());
-
- String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
-
- String key = null;
- String value = "BBBB";
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
-
- RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 400, createProperty.getErrorCode().intValue());
-
- }
-
- @Test
- public void createServiceAdditionalInformationNullKeyTest() throws Exception {
- User user = getUser();
-
- RestResponse createServiceResponse = createService();
-
- String serviceId = ResponseParser.convertServiceResponseToJavaObject(createServiceResponse.getResponse()).getUniqueId();
-
- String key = null;
- String value = "BBBB";
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
-
- RestResponse createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 400, createProperty.getErrorCode().intValue());
-
- }
-
- @Test
- public void createResourceMaximumInformationTest() throws Exception {
- User user = getUser();
- ResourceReqDetails resource = getResource();
-
- // deleteResource(resourceId, user);
- RestResponse createResourceResponse = createResource(resource, user);
-
- String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
-
- assertNotNull("check response object is not null after create resource", createResourceResponse);
- assertNotNull("check error code exists in response after create resource", createResourceResponse.getErrorCode());
- assertEquals("Check response code after create resource", 201, createResourceResponse.getErrorCode().intValue());
-
- String key = "AAA AAA";
- String value = "BBBB";
-
- for (int i = 0; i < 50; i++) {
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key + i, value);
-
- RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
-
- }
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
- RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
-
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 409, createProperty.getErrorCode().intValue());
-
- }
-
- @Test
- public void createResourceLifeCycleAndMaximumInformationTest() throws Exception {
- User user = getUser();
- ResourceReqDetails resource = getResource();
-
- // deleteResource(resourceId, user);
- RestResponse createResourceResponse = createResource(resource, user);
-
- assertNotNull("check response object is not null after create resource", createResourceResponse);
- assertNotNull("check error code exists in response after create resource", createResourceResponse.getErrorCode());
- assertEquals("Check response code after create resource", 201, createResourceResponse.getErrorCode().intValue());
-
- String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
- resource.setUniqueId(resourceId);
-
- String key = "AAA AAA";
- String value = "BBBB";
-
- for (int i = 0; i < 49; i++) {
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key + i, value);
-
- RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
-
- }
-
- String resourceVersion = "0.1";
- String checkinComment = "good checkin";
- String checkinComentJson = "{\"userRemarks\": \"" + checkinComment + "\"}";
- RestResponse checkInResponse = LifecycleRestUtils.changeResourceState(resource, user, resourceVersion, LifeCycleStatesEnum.CHECKIN, checkinComentJson);
-
- assertNotNull("check response object is not null after create property", checkInResponse);
- assertNotNull("check error code exists in response after create property", checkInResponse.getErrorCode());
- assertEquals("Check response code after create property", 200, checkInResponse.getErrorCode().intValue());
-
- resourceVersion = "0.2";
-
- RestResponse checkOutResponse = LifecycleRestUtils.changeResourceState(resource, user, resourceVersion, LifeCycleStatesEnum.CHECKOUT, null);
-
- resourceId = ResponseParser.getUniqueIdFromResponse(checkOutResponse);
- resource.setUniqueId(resourceId);
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key + 50, value);
- RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
-
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
-
- additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key + 51, value);
- createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
-
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 409, createProperty.getErrorCode().intValue());
-
- RestResponse checkUndoOutResponse = LifecycleRestUtils.changeResourceState(resource, user, resourceVersion, LifeCycleStatesEnum.UNDOCHECKOUT, null);
-
- resourceVersion = "0.1";
-
- checkOutResponse = LifecycleRestUtils.changeResourceState(resource, user, resourceVersion, LifeCycleStatesEnum.CHECKOUT, null);
- resourceId = ResponseParser.getUniqueIdFromResponse(checkOutResponse);
- resource.setUniqueId(resourceId);
-
- additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key + 50, value);
- createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
-
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
-
- additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key + 51, value);
- createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
-
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 409, createProperty.getErrorCode().intValue());
-
- }
-
- @Test
- public void createResourceLifeCycleCertifyAndMaximumInformationTest() throws Exception {
- User user = getUser();
- ResourceReqDetails resource = getResource();
-
- // deleteResource(resourceId, user);
- RestResponse createResourceResponse = createResource(resource, user);
-
- assertNotNull("check response object is not null after create resource", createResourceResponse);
- assertNotNull("check error code exists in response after create resource", createResourceResponse.getErrorCode());
- assertEquals("Check response code after create resource", 201, createResourceResponse.getErrorCode().intValue());
-
- String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
- resource.setUniqueId(resourceId);
-
- String key = "AAA AAA";
- String value = "BBBB";
-
- for (int i = 0; i < 49; i++) {
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key + i, value);
-
- RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
-
- }
-
- String resourceVersion = "0.1";
- String checkinComment = "good checkin";
- String checkinComentJson = "{\"userRemarks\": \"" + checkinComment + "\"}";
-
- // resourceUtils.addResourceMandatoryArtifacts(user,
- // createResourceResponse);
-
- RestResponse checkInResponse = LifecycleRestUtils.changeResourceState(resource, user, resourceVersion, LifeCycleStatesEnum.CHECKIN, checkinComentJson);
-
- assertNotNull("check response object is not null after create property", checkInResponse);
- assertNotNull("check error code exists in response after create property", checkInResponse.getErrorCode());
- assertEquals("Check response code after create property", 200, checkInResponse.getErrorCode().intValue());
-
- /*RestResponse changeStateResponse = LifecycleRestUtils.changeResourceState(resource, user, resourceVersion, LifeCycleStatesEnum.CERTIFICATIONREQUEST, null);
- changeStateResponse = LifecycleRestUtils.changeResourceState(resource, user, resourceVersion, LifeCycleStatesEnum.STARTCERTIFICATION, null);*/
- RestResponse changeStateResponse = LifecycleRestUtils.changeResourceState(resource, user, resourceVersion, LifeCycleStatesEnum.CERTIFY, null);
-
- assertNotNull("check response object is not null after create property", checkInResponse);
- assertNotNull("check error code exists in response after create property", checkInResponse.getErrorCode());
- assertEquals("Check response code after create property", 200, checkInResponse.getErrorCode().intValue());
-
- resourceId = ResponseParser.getUniqueIdFromResponse(changeStateResponse);
- resource.setUniqueId(resourceId);
-
- resourceVersion = "1.0";
-
- changeStateResponse = LifecycleRestUtils.changeResourceState(resource, user, resourceVersion, LifeCycleStatesEnum.CHECKOUT, null);
- resourceId = ResponseParser.getUniqueIdFromResponse(changeStateResponse);
- resource.setUniqueId(resourceId);
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key + 50, value);
- RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
-
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
-
- additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key + 51, value);
- createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
-
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 409, createProperty.getErrorCode().intValue());
-
- }
-
- @Test
- public void createServiceCycleAndMaximumInformationTest() throws Exception {
-
- User user = getUser();
-
- ServiceReqDetails service = getServiceDetails();
-
- RestResponse createServiceResponse = createService();
-
- String serviceId = ResponseParser.convertServiceResponseToJavaObject(createServiceResponse.getResponse()).getUniqueId();
-
- assertNotNull("check response object is not null after create resource", createServiceResponse);
- assertNotNull("check error code exists in response after create resource", createServiceResponse.getErrorCode());
- assertEquals("Check response code after create resource", 201, createServiceResponse.getErrorCode().intValue());
-
- service.setUniqueId(serviceId);
-
- String key = "AAA AAA";
- String value = "BBBB";
-
- for (int i = 0; i < 49; i++) {
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key + i, value);
-
- RestResponse createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
-
- }
-
- String resourceVersion = "0.1";
- String checkinComment = "good checkin";
- String checkinComentJson = "{\"userRemarks\": \"" + checkinComment + "\"}";
- RestResponse checkInResponse = LifecycleRestUtils.changeServiceState(service, user, resourceVersion, LifeCycleStatesEnum.CHECKIN, checkinComentJson);
-
- assertNotNull("check response object is not null after create property", checkInResponse);
- assertNotNull("check error code exists in response after create property", checkInResponse.getErrorCode());
- assertEquals("Check response code after create property", 200, checkInResponse.getErrorCode().intValue());
-
- resourceVersion = "0.2";
-
- RestResponse checkOutResponse = LifecycleRestUtils.changeServiceState(service, user, resourceVersion, LifeCycleStatesEnum.CHECKOUT, null);
-
- serviceId = ResponseParser.convertServiceResponseToJavaObject(checkOutResponse.getResponse()).getUniqueId();
- service.setUniqueId(serviceId);
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key + 50, value);
- RestResponse createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
-
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
-
- additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key + 51, value);
- createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
-
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 409, createProperty.getErrorCode().intValue());
-
- RestResponse checkUndoOutResponse = LifecycleRestUtils.changeServiceState(service, user, resourceVersion, LifeCycleStatesEnum.UNDOCHECKOUT, null);
-
- resourceVersion = "0.1";
-
- checkOutResponse = LifecycleRestUtils.changeServiceState(service, user, resourceVersion, LifeCycleStatesEnum.CHECKOUT, null);
- serviceId = ResponseParser.convertServiceResponseToJavaObject(checkOutResponse.getResponse()).getUniqueId();
- service.setUniqueId(serviceId);
-
- additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key + 50, value);
- createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
-
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
-
- additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key + 51, value);
- createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
-
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 409, createProperty.getErrorCode().intValue());
-
- }
-
- @Test
- public void createServiceMaximumInformationTest() throws Exception {
- User user = getUser();
-
- RestResponse createServiceResponse = createService();
-
- String serviceId = ResponseParser.convertServiceResponseToJavaObject(createServiceResponse.getResponse()).getUniqueId();
-
- String key = "AAA AAA";
- String value = "BBBB";
-
- String lastCreatedProperty = null;
-
- for (int i = 0; i < 50; i++) {
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key + i, value);
-
- RestResponse createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
-
- AdditionalInfoParameterInfo fromJson = gson.fromJson(createProperty.getResponse(), AdditionalInfoParameterInfo.class);
- lastCreatedProperty = fromJson.getUniqueId();
-
- }
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
- RestResponse createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
-
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 409, createProperty.getErrorCode().intValue());
-
- RestResponse deletedProperty = deleteServiceAdditionalInformation(serviceId, lastCreatedProperty, user);
- assertNotNull("check response object is not null after update additional information", deletedProperty);
- assertNotNull("check error code exists in response after additional information", deletedProperty.getErrorCode());
- assertEquals("Check response code after additional information", 200, deletedProperty.getErrorCode().intValue());
-
- additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
- createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
-
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
-
- }
-
- @Test
- public void updateServiceAdditionalInformationTest() throws Exception {
- User user = getUser();
-
- RestResponse createServiceResponse = createService();
-
- String serviceId = ResponseParser.convertServiceResponseToJavaObject(createServiceResponse.getResponse()).getUniqueId();
-
- String key = "AAA AAA";
- String value = "BBBB";
-
- String updatedKey = "ZZZ ZZZ";
- String updatedValue = "JJJJ";
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
-
- RestResponse createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
-
- AdditionalInfoParameterInfo fromJson = gson.fromJson(createProperty.getResponse(), AdditionalInfoParameterInfo.class);
- assertFalse("check number of spaces", fromJson.getKey().contains(" "));
- assertEquals("check returned key", "AAA AAA", fromJson.getKey());
-
- fromJson.setKey(updatedKey);
- fromJson.setValue(updatedValue);
-
- RestResponse updatedProperty = updateServiceAdditionalInformation(serviceId, fromJson, user, fromJson.getUniqueId());
- assertNotNull("check response object is not null after update additional information", updatedProperty);
- assertNotNull("check error code exists in response after additional information", updatedProperty.getErrorCode());
- assertEquals("Check response code after additional information", 200, updatedProperty.getErrorCode().intValue());
-
- AdditionalInfoParameterInfo updatedJson = gson.fromJson(updatedProperty.getResponse(), AdditionalInfoParameterInfo.class);
- assertFalse("check number of spaces", updatedJson.getKey().contains(" "));
- assertEquals("check returned key", "ZZZ ZZZ", updatedJson.getKey());
- assertEquals("check returned value", updatedValue, updatedJson.getValue());
- assertEquals("check returned id", fromJson.getUniqueId(), updatedJson.getUniqueId());
-
- fromJson.setKey(updatedKey);
- fromJson.setValue("\uC2B5");
-
- updatedProperty = updateServiceAdditionalInformation(serviceId, fromJson, user, fromJson.getUniqueId());
- assertNotNull("check response object is not null after update additional information", updatedProperty);
- assertNotNull("check error code exists in response after additional information", updatedProperty.getErrorCode());
- assertEquals("Check response code after additional information", 400, updatedProperty.getErrorCode().intValue());
-
- }
-
- @Test
- public void deleteServiceAdditionalInformationTest() throws Exception {
- User user = getUser();
-
- RestResponse createServiceResponse = createService();
-
- String serviceId = ResponseParser.convertServiceResponseToJavaObject(createServiceResponse.getResponse()).getUniqueId();
-
- String key = "AAA AAA";
- String value = "BBBB";
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
-
- RestResponse createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
-
- AdditionalInfoParameterInfo fromJson = gson.fromJson(createProperty.getResponse(), AdditionalInfoParameterInfo.class);
- assertFalse("check number of spaces", fromJson.getKey().contains(" "));
- assertEquals("check returned key", "AAA AAA", fromJson.getKey());
-
- RestResponse deletedProperty = deleteServiceAdditionalInformation(serviceId, fromJson.getUniqueId(), user);
- assertNotNull("check response object is not null after update additional information", deletedProperty);
- assertNotNull("check error code exists in response after additional information", deletedProperty.getErrorCode());
- assertEquals("Check response code after additional information", 200, deletedProperty.getErrorCode().intValue());
-
- AdditionalInfoParameterInfo updatedJson = gson.fromJson(deletedProperty.getResponse(), AdditionalInfoParameterInfo.class);
- assertFalse("check number of spaces", updatedJson.getKey().contains(" "));
- assertEquals("check returned key", "AAA AAA", updatedJson.getKey());
- assertEquals("check returned value", value, updatedJson.getValue());
- assertEquals("check returned id", fromJson.getUniqueId(), updatedJson.getUniqueId());
-
- deletedProperty = deleteServiceAdditionalInformation(serviceId, fromJson.getUniqueId(), user);
- assertNotNull("check response object is not null after update additional information", deletedProperty);
- assertNotNull("check error code exists in response after additional information", deletedProperty.getErrorCode());
- assertEquals("Check response code after additional information", 409, deletedProperty.getErrorCode().intValue());
-
- }
-
- @Test
- public void getResourceAdditionalInformationTest() throws Exception {
- User user = getUser();
- ResourceReqDetails resource = getResource();
-
- RestResponse createResourceResponse = createResource(resource, user);
-
- String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
-
- assertNotNull("check response object is not null after create resource", createResourceResponse);
- assertNotNull("check error code exists in response after create resource", createResourceResponse.getErrorCode());
- assertEquals("Check response code after create resource", 201, createResourceResponse.getErrorCode().intValue());
-
- String key = "AAA AAA";
- String value = "BBBB";
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
-
- RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
-
- AdditionalInfoParameterInfo fromJson = gson.fromJson(createProperty.getResponse(), AdditionalInfoParameterInfo.class);
- assertFalse("check number of spaces", fromJson.getKey().contains(" "));
- assertEquals("check returned key", "AAA AAA", fromJson.getKey());
-
- RestResponse deletedProperty = getAdditionalInformation(resourceId, fromJson.getUniqueId(), user);
- assertNotNull("check response object is not null after update additional information", deletedProperty);
- assertNotNull("check error code exists in response after additional information", deletedProperty.getErrorCode());
- assertEquals("Check response code after additional information", 200, deletedProperty.getErrorCode().intValue());
-
- AdditionalInfoParameterInfo updatedJson = gson.fromJson(deletedProperty.getResponse(), AdditionalInfoParameterInfo.class);
- assertFalse("check number of spaces", updatedJson.getKey().contains(" "));
- assertEquals("check returned key", "AAA AAA", updatedJson.getKey());
- assertEquals("check returned value", value, updatedJson.getValue());
- assertEquals("check returned id", fromJson.getUniqueId(), updatedJson.getUniqueId());
-
- }
-
- @Test
- public void getServiceAdditionalInformationTest() throws Exception {
- User user = getUser();
-
- RestResponse createServiceResponse = createService();
-
- String serviceId = ResponseParser.convertServiceResponseToJavaObject(createServiceResponse.getResponse()).getUniqueId();
-
- String key = "AAA AAA";
- String value = "BBBB";
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
-
- RestResponse createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
-
- AdditionalInfoParameterInfo fromJson = gson.fromJson(createProperty.getResponse(), AdditionalInfoParameterInfo.class);
- assertFalse("check number of spaces", fromJson.getKey().contains(" "));
- assertEquals("check returned key", "AAA AAA", fromJson.getKey());
-
- RestResponse deletedProperty = getServiceAdditionalInformation(serviceId, fromJson.getUniqueId(), user);
- assertNotNull("check response object is not null after update additional information", deletedProperty);
- assertNotNull("check error code exists in response after additional information", deletedProperty.getErrorCode());
- assertEquals("Check response code after additional information", 200, deletedProperty.getErrorCode().intValue());
-
- AdditionalInfoParameterInfo updatedJson = gson.fromJson(deletedProperty.getResponse(), AdditionalInfoParameterInfo.class);
- assertFalse("check number of spaces", updatedJson.getKey().contains(" "));
- assertEquals("check returned key", "AAA AAA", updatedJson.getKey());
- assertEquals("check returned value", value, updatedJson.getValue());
- assertEquals("check returned id", fromJson.getUniqueId(), updatedJson.getUniqueId());
-
- }
-
- @Test
- public void getResourceAllAdditionalInformationTest() throws Exception {
- User user = getUser();
- ResourceReqDetails resource = getResource();
-
- RestResponse createResourceResponse = createResource(resource, user);
-
- String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
-
- assertNotNull("check response object is not null after create resource", createResourceResponse);
- assertNotNull("check error code exists in response after create resource", createResourceResponse.getErrorCode());
- assertEquals("Check response code after create resource", 201, createResourceResponse.getErrorCode().intValue());
-
- String key = "AAA AAA";
- String value = "BBBB";
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
-
- RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
-
- AdditionalInfoParameterInfo fromJson = gson.fromJson(createProperty.getResponse(), AdditionalInfoParameterInfo.class);
- assertFalse("check number of spaces", fromJson.getKey().contains(" "));
- assertEquals("check returned key", "AAA AAA", fromJson.getKey());
-
- RestResponse deletedProperty = getResourceAllAdditionalInformation(resourceId, user);
- assertNotNull("check response object is not null after update additional information", deletedProperty);
- assertNotNull("check error code exists in response after additional information", deletedProperty.getErrorCode());
- assertEquals("Check response code after additional information", 200, deletedProperty.getErrorCode().intValue());
-
- AdditionalInformationDefinition updatedJson = gson.fromJson(deletedProperty.getResponse(), AdditionalInformationDefinition.class);
- assertEquals("check number of parameters", 1, updatedJson.getParameters().size());
- AdditionalInfoParameterInfo info = updatedJson.getParameters().iterator().next();
-
- assertFalse("check number of spaces", info.getKey().contains(" "));
- assertEquals("check returned key", "AAA AAA", info.getKey());
- assertEquals("check returned value", value, info.getValue());
- assertEquals("check returned id", fromJson.getUniqueId(), info.getUniqueId());
-
- }
-
- @Test
- public void getServiceAllAdditionalInformationTest() throws Exception {
- User user = getUser();
-
- RestResponse createServiceResponse = createService();
-
- String serviceId = ResponseParser.convertServiceResponseToJavaObject(createServiceResponse.getResponse()).getUniqueId();
-
- String key = "AAA AAA";
- String value = "BBBB";
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
-
- RestResponse createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
-
- AdditionalInfoParameterInfo fromJson = gson.fromJson(createProperty.getResponse(), AdditionalInfoParameterInfo.class);
- assertFalse("check number of spaces", fromJson.getKey().contains(" "));
- assertEquals("check returned key", "AAA AAA", fromJson.getKey());
-
- RestResponse deletedProperty = getServiceAllAdditionalInformation(serviceId, user);
- assertNotNull("check response object is not null after update additional information", deletedProperty);
- assertNotNull("check error code exists in response after additional information", deletedProperty.getErrorCode());
- assertEquals("Check response code after additional information", 200, deletedProperty.getErrorCode().intValue());
-
- AdditionalInformationDefinition updatedJson = gson.fromJson(deletedProperty.getResponse(), AdditionalInformationDefinition.class);
- assertEquals("check number of parameters", 1, updatedJson.getParameters().size());
- AdditionalInfoParameterInfo info = updatedJson.getParameters().iterator().next();
-
- assertFalse("check number of spaces", info.getKey().contains(" "));
- assertEquals("check returned key", "AAA AAA", info.getKey());
- assertEquals("check returned value", value, info.getValue());
- assertEquals("check returned id", fromJson.getUniqueId(), info.getUniqueId());
-
- }
-
- @Test
- public void createServiceAdditionalInformationTestDuringLifecycle() throws Exception {
-
- User user = getUser();
- RestResponse createServiceResponse = createService();
- String serviceId = ResponseParser.convertServiceResponseToJavaObject(createServiceResponse.getResponse()).getUniqueId();
- String key = "AAA AAA";
- String value = "BBBB";
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
-
- RestResponse createProperty = createServiceAdditionalInformation(serviceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
-
- AdditionalInfoParameterInfo fromJson = gson.fromJson(createProperty.getResponse(), AdditionalInfoParameterInfo.class);
- assertFalse("check number of spaces", fromJson.getKey().contains(" "));
- assertEquals("check returned key", "AAA AAA", fromJson.getKey());
-
- ServiceReqDetails serviceDetails = getServiceDetails();
-
- serviceDetails.setUniqueId(serviceId);
-
- // serviceUtils.addServiceMandatoryArtifacts(user,
- // createServiceResponse);
-
- certifyService(user, serviceDetails, null);
-
- }
-
- @Test
- public void createCascadeResource() {
-
- // TODO: to check after rebase
-
- User user = getUser();
- ResourceReqDetails resource = getResource();
- String newResourceNameSuffix = "aa";
-
- RestResponse createResourceResponse = null;
- try {
-
- createResourceResponse = createResource(resource, user);
- assertEquals("check invalid type", 201, createResourceResponse.getErrorCode().intValue());
- String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
-
- String resourceVersion = "0.1";
- // resourceUtils.addResourceMandatoryArtifacts(user,
- // createResourceResponse);
-
- String key = "AAA AAA";
- String value = "BBBB";
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
-
- RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
-
- resource.setUniqueId(resourceId);
- Resource certifiedResource = certifyResource(user, resource, resourceVersion, 1);
-
- ResourceReqDetails newResourceDetails = getResource();
- String newResourceName = newResourceDetails.getName() + newResourceNameSuffix;
- newResourceDetails.setName(newResourceName);
- List<String> derivedFrom = new ArrayList<>();
- derivedFrom.add(certifiedResource.getName());
- newResourceDetails.setDerivedFrom(derivedFrom);
- newResourceDetails.getTags().add(newResourceName);
-
- user.setUserId(UserRoleEnum.ADMIN.getUserId());
- RestResponse newCreateResourceResponse = createResource(newResourceDetails, user);
- assertEquals("Check response code after creating resource", 201, newCreateResourceResponse.getErrorCode().intValue());
- Resource newResource = gson.fromJson(newCreateResourceResponse.getResponse(), Resource.class);
-
- RestResponse allAdditionalInformation = getResourceAllAdditionalInformation(newResource.getUniqueId(), user);
-
- assertNotNull("check response object is not null after update additional information", allAdditionalInformation);
- assertNotNull("check error code exists in response after additional information", allAdditionalInformation.getErrorCode());
- assertEquals("Check response code after additional information", 200, allAdditionalInformation.getErrorCode().intValue());
-
- AdditionalInformationDefinition updatedJson = gson.fromJson(allAdditionalInformation.getResponse(), AdditionalInformationDefinition.class);
- assertEquals("check number of parameters", 0, updatedJson.getParameters().size());
- // AdditionalInfoParameterInfo info =
- // updatedJson.getParameters().iterator().next();
-
- String newResourceId = newResource.getUniqueId();
- createProperty = createResourceAdditionalInformation(newResourceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
-
- allAdditionalInformation = getResourceAllAdditionalInformation(newResourceId, user);
-
- assertNotNull("check response object is not null after update additional information", allAdditionalInformation);
- assertNotNull("check error code exists in response after additional information", allAdditionalInformation.getErrorCode());
- assertEquals("Check response code after additional information", 200, allAdditionalInformation.getErrorCode().intValue());
-
- updatedJson = gson.fromJson(allAdditionalInformation.getResponse(), AdditionalInformationDefinition.class);
- assertEquals("check number of parameters", 1, updatedJson.getParameters().size());
-
- } catch (IOException e) {
- assertTrue(false);
- }
-
- }
-
- @Test
- public void createSamePropertyAfterCiCOResource() {
-
- User user = getUser();
- ResourceReqDetails resource = getResource();
-
- RestResponse createResourceResponse = null;
- try {
-
- createResourceResponse = createResource(resource, user);
- assertEquals("check invalid type", 201, createResourceResponse.getErrorCode().intValue());
- String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
-
- String resourceVersion = "0.1";
- // resourceUtils.addResourceMandatoryArtifacts(user,
- // createResourceResponse);
-
- String key = "AAA AAA";
- String value = "BBBB";
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
-
- RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
-
- resource.setUniqueId(resourceId);
- RestResponse checkInResponse = LifecycleRestUtils.changeResourceState(resource, user, resourceVersion, LifeCycleStatesEnum.CHECKIN);
-
- assertNotNull("check response object is not null after create user", checkInResponse);
- assertNotNull("check error code exists in response after create user", checkInResponse.getErrorCode());
- assertEquals("Check response code after create user", 200, checkInResponse.getErrorCode().intValue());
-
- Resource resourceAfterOperation = gson.fromJson(checkInResponse.getResponse(), Resource.class);
- assertEquals("check size of additional information", 1, resourceAfterOperation.getAdditionalInformation().size());
- assertEquals("check size of additional information", 1, resourceAfterOperation.getAdditionalInformation().get(0).getParameters().size());
-
- RestResponse checkOutResponse = LifecycleRestUtils.changeResourceState(resource, user, resourceVersion, LifeCycleStatesEnum.CHECKOUT);
-
- assertNotNull("check response object is not null after create user", checkOutResponse);
- assertNotNull("check error code exists in response after create user", checkOutResponse.getErrorCode());
- assertEquals("Check response code after create user", 200, checkOutResponse.getErrorCode().intValue());
-
- Resource resourceAfterCoOperation = gson.fromJson(checkOutResponse.getResponse(), Resource.class);
- assertEquals("check size of additional information", 1, resourceAfterCoOperation.getAdditionalInformation().size());
- assertEquals("check size of additional information", 1, resourceAfterCoOperation.getAdditionalInformation().get(0).getParameters().size());
-
- String newResourceId = ResponseParser.getUniqueIdFromResponse(checkOutResponse);
-
- String key2 = "ZZZ";
- String value2 = "BBBB";
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo2 = new AdditionalInfoParameterInfo(null, key2, value2);
-
- RestResponse createProperty2 = createResourceAdditionalInformation(newResourceId, additionalInfoParameterInfo2, user);
- assertNotNull("check response object is not null after create property", createProperty2);
- assertNotNull("check error code exists in response after create property", createProperty2.getErrorCode());
- assertEquals("Check response code after create property", 201, createProperty2.getErrorCode().intValue());
-
- RestResponse afterCreateAI = ResourceRestUtils.getResource(user, newResourceId);
- Resource resourceNew = gson.fromJson(afterCreateAI.getResponse(), Resource.class);
- assertEquals("check size of additional information", 1, resourceNew.getAdditionalInformation().size());
- assertEquals("check size of additional information", 2, resourceNew.getAdditionalInformation().get(0).getParameters().size());
-
- resource.setUniqueId(newResourceId);
- Resource certifiedResource = certifyResource(user, resource, resourceVersion, 2);
- assertEquals("check size of additional information", 1, certifiedResource.getAdditionalInformation().size());
- assertEquals("check size of additional information", 2, certifiedResource.getAdditionalInformation().get(0).getParameters().size());
-
- user.setUserId(UserRoleEnum.DESIGNER.getUserId());
- resource.setUniqueId(certifiedResource.getUniqueId());
- RestResponse checkOutResponseAfterCertify = LifecycleRestUtils.changeResourceState(resource, user, resourceVersion, LifeCycleStatesEnum.CHECKOUT);
-
- assertNotNull("check response object is not null after create user", checkOutResponseAfterCertify);
- assertNotNull("check error code exists in response after create user", checkOutResponseAfterCertify.getErrorCode());
- assertEquals("Check response code after create user", 200, checkOutResponseAfterCertify.getErrorCode().intValue());
-
- Resource resourceAfterCertifyCoOperation = gson.fromJson(checkOutResponseAfterCertify.getResponse(), Resource.class);
- assertEquals("check size of additional information", 1, resourceAfterCertifyCoOperation.getAdditionalInformation().size());
- assertEquals("check size of additional information", 2, resourceAfterCertifyCoOperation.getAdditionalInformation().get(0).getParameters().size());
-
- } catch (IOException e) {
- assertTrue(false);
- }
-
- }
-
- // public Resource certifyService(User user, ServiceReqDetails service,
- // String resourceVersion) throws Exception {
- //
- // RestResponse checkInResponse =
- // LifecycleRestUtils.changeServiceState(service, user, resourceVersion,
- // LifeCycleStates.CHECKIN);
- //
- // assertNotNull("check response object is not null after create user",
- // checkInResponse);
- // assertNotNull("check error code exists in response after create user",
- // checkInResponse.getErrorCode());
- // assertEquals("Check response code after create user", 200,
- // checkInResponse.getErrorCode().intValue());
- //
- // Resource resourceAfterOperation =
- // gson.fromJson(checkInResponse.getResponse(), Resource.class);
- // assertEquals("check size of additional information", 1,
- // resourceAfterOperation.getAdditionalInformation().size());
- // assertEquals("check size of additional information", 1,
- // resourceAfterOperation.getAdditionalInformation().get(0).getParameters().size());
- //
- //// TODO Andrey
- // createAndAddCertResourceToService(service, user);
- //
- // RestResponse req4certResponse =
- // LifecycleRestUtils.changeServiceState(service, user, resourceVersion,
- // LifeCycleStates.CERTIFICATIONREQUEST);
- //
- // assertNotNull("check response object is not null after create user",
- // req4certResponse);
- // assertEquals("Check response code after checkout resource", 200,
- // req4certResponse.getErrorCode().intValue());
- //
- // resourceAfterOperation = gson.fromJson(req4certResponse.getResponse(),
- // Resource.class);
- // assertEquals("check size of additional information", 1,
- // resourceAfterOperation.getAdditionalInformation().size());
- // assertEquals("check size of additional information", 1,
- // resourceAfterOperation.getAdditionalInformation().get(0).getParameters().size());
- //
- // //change modifier
- // user.setUserId(UserRoleEnum.TESTER.getUserId());
- //
- // //start certification
- // RestResponse startCertResourceResponse3 =
- // LifecycleRestUtils.changeServiceState(service, user, resourceVersion,
- // LifeCycleStates.STARTCERTIFICATION);
- // assertNotNull("check response object is not null after create user",
- // startCertResourceResponse3);
- // assertEquals("Check response code after checkout resource", 200,
- // startCertResourceResponse3.getErrorCode().intValue());
- //
- // resourceAfterOperation =
- // gson.fromJson(startCertResourceResponse3.getResponse(), Resource.class);
- // assertEquals("check size of additional information", 1,
- // resourceAfterOperation.getAdditionalInformation().size());
- // assertEquals("check size of additional information", 1,
- // resourceAfterOperation.getAdditionalInformation().get(0).getParameters().size());
- //
- // //certify
- //
- // RestResponse certifyResponse =
- // LifecycleRestUtils.changeServiceState(service, user, resourceVersion,
- // LifeCycleStates.CERTIFY);
- // assertNotNull("check response object is not null after create user",
- // certifyResponse);
- // assertEquals("Check response code after checkout resource", 200,
- // certifyResponse.getErrorCode().intValue());
- //
- // resourceAfterOperation = gson.fromJson(certifyResponse.getResponse(),
- // Resource.class);
- // assertEquals("check size of additional information", 1,
- // resourceAfterOperation.getAdditionalInformation().size());
- // assertEquals("check size of additional information", 1,
- // resourceAfterOperation.getAdditionalInformation().get(0).getParameters().size());
- //
- // Resource certifyResource = gson.fromJson(certifyResponse.getResponse(),
- // Resource.class);
- // return certifyResource;
- // }
-
- private void createAndAddCertResourceToService(ServiceReqDetails serviceDetails, User user) throws Exception {
-
- User sdncTesterUser = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
-
- ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
- ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory.getDefaultComponentInstance();
-
- RestResponse response = ResourceRestUtils.createResource(resourceDetails, user);
- assertTrue("create request returned status:" + response.getErrorCode(), response.getErrorCode() == 201);
- assertNotNull("resource uniqueId is null:", resourceDetails.getUniqueId());
-
- ArtifactReqDetails heatArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
- response = ArtifactRestUtils.addInformationalArtifactToResource(heatArtifactDetails, user, resourceDetails.getUniqueId());
- assertTrue("add HEAT artifact to resource request returned status:" + response.getErrorCode(), response.getErrorCode() == 200);
-
- // certified resource
- // response = LCSbaseTest.certifyResource(resourceDetails);
- RestResponse restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails, user, LifeCycleStatesEnum.CHECKIN);
- assertTrue("certify resource request returned status:" + restResponseResource.getErrorCode(), response.getErrorCode() == 200);
- /*restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails, user, LifeCycleStatesEnum.CERTIFICATIONREQUEST);
- assertTrue("certify resource request returned status:" + restResponseResource.getErrorCode(), response.getErrorCode() == 200);
- restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncTesterUser, LifeCycleStatesEnum.STARTCERTIFICATION);
- assertTrue("certify resource request returned status:" + restResponseResource.getErrorCode(), response.getErrorCode() == 200);*/
- restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails, user, LifeCycleStatesEnum.CERTIFY);
- assertTrue("certify resource request returned status:" + restResponseResource.getErrorCode(), response.getErrorCode() == 200);
-
- // add resource instance with HEAT deployment artifact to the service
- restResponseResource = LifecycleRestUtils.changeServiceState(serviceDetails, user, serviceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
- assertTrue("certify resource request returned status:" + restResponseResource.getErrorCode(), response.getErrorCode() == 200);
- resourceInstanceReqDetails.setComponentUid(resourceDetails.getUniqueId());
- response = ComponentInstanceRestUtils.createComponentInstance(resourceInstanceReqDetails, user, serviceDetails.getUniqueId(), ComponentTypeEnum.SERVICE);
- assertTrue("response code is not 201, returned: " + response.getErrorCode(), response.getErrorCode() == 201);
- }
-
- @Test
- public void createResourceAdditionalInformationTestAddValue() throws Exception {
- User user = getUser();
- ResourceReqDetails resource = getResource();
-
- // deleteResource(resourceId, user);
- RestResponse createResourceResponse = createResource(resource, user);
-
- String resourceId = ResponseParser.getUniqueIdFromResponse(createResourceResponse);
-
- assertNotNull("check response object is not null after create resource", createResourceResponse);
- assertNotNull("check error code exists in response after create resource", createResourceResponse.getErrorCode());
- assertEquals("Check response code after create resource", 201, createResourceResponse.getErrorCode().intValue());
-
- String key = "AAA AAA";
- String value = "\uC2B5";
-
- AdditionalInfoParameterInfo additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
-
- RestResponse createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 400, createProperty.getErrorCode().intValue());
-
- value = "";
-
- additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
-
- createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 400, createProperty.getErrorCode().intValue());
-
- value = "----<b></b><>;";
-
- additionalInfoParameterInfo = new AdditionalInfoParameterInfo(null, key, value);
-
- createProperty = createResourceAdditionalInformation(resourceId, additionalInfoParameterInfo, user);
- assertNotNull("check response object is not null after create property", createProperty);
- assertNotNull("check error code exists in response after create property", createProperty.getErrorCode());
- assertEquals("Check response code after create property", 201, createProperty.getErrorCode().intValue());
-
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/property/ComponentInstancePropertyTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/property/ComponentInstancePropertyTest.java
deleted file mode 100644
index 5385eb94f6..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/property/ComponentInstancePropertyTest.java
+++ /dev/null
@@ -1,1258 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.property;
-
-import fj.data.Either;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-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.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.datatypes.PropertyReqDetails;
-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.BaseRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.PropertyRestUtils;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import static org.testng.AssertJUnit.assertTrue;
-
-// open bug for this class: DE199108 - closed, DE199741
-public class ComponentInstancePropertyTest extends ComponentBaseTest {
-
- protected Resource basicVFC;
- protected Resource vfc1FromBasicVFC;
- protected Resource vfc2FromVfc1;
- protected Resource vfResource;
-
- private List<ComponentInstanceProperty> expectedPropertyList;
- private List<ComponentInstanceProperty> actualPropertyList;
- // protected String updatedStringValue = "{Not Default String Value}";
- protected String updatedStringValue = "Not Default String Value";
- protected String updatedIntegerValue = "666";
- protected String updatedBooleanValue = "false";
- protected String newStringPropName = "stringProp2";
- protected String newIntegerPropName = "integerProp2";
- protected String newBooleanPropName = "booleanProp2";
- // bug DE199741 protected String newStringPropValue = "<second string
- // value>";
- protected String newStringPropValue = "second string value";
- protected String newIntegerPropValue = "888";
- protected String newBooleanPropValue = "false";
-
- @BeforeMethod
- public void init() {
- expectedPropertyList = new ArrayList<ComponentInstanceProperty>();
- actualPropertyList = new ArrayList<ComponentInstanceProperty>();
- }
-
- @Rule
- public static TestName name = new TestName();
-
- public ComponentInstancePropertyTest() {
- super(name, ComponentInstancePropertyTest.class.getName());
- }
-
- // --------------Regular
- // resource-------------------------------------------------------------------------------
-
- @Test
- public void nestedResourceProperty3Levels() throws Exception {
-
- // first res
- basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
- // second resource
- vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
- ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
- // third resource
- vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
- LifeCycleStatesEnum.CHECKIN, vfc1FromBasicVFC);
- // verify property
- vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
- actualPropertyList = PropertyRestUtils.addResourcePropertiesToList(vfc2FromVfc1, actualPropertyList);
- assertTrue("check list size failed, expected 3", actualPropertyList.size() == 3);
-
- }
-
- // --------------VF
- // resource-----------------------------------------------------------
-
- @Test
- public void nestedVfResourceProperty3Levels() throws Exception {
-
- basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
- vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
- ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
- vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
- LifeCycleStatesEnum.CHECKIN, vfc1FromBasicVFC);
-
- vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
- expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(vfc2FromVfc1, expectedPropertyList);
-
- // create VF + add RI
- vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
- .value();
- ComponentInstance componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
- .value();
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
- PropertyRestUtils.updatePropertyListWithPathOnResource(componentInstDetails, vfc2FromVfc1, expectedPropertyList,
- vfResource);
- // verify property
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
- actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, actualPropertyList, null);
- PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
- }
-
- @Test
- public void nestedVfResourceProperty3LevelsAndCpWithProp() throws Exception {
-
- basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
- vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
- ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
- vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
- LifeCycleStatesEnum.CHECKIN, vfc1FromBasicVFC);
-
- vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
- expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(vfc2FromVfc1, expectedPropertyList);
-
- // four resource
- Resource cp = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.CP,
- NormativeTypesEnum.NETWORK, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
- .value();
- PropertyReqDetails cpStringProperty = ElementFactory.getDefaultStringProperty();
- cpStringProperty.setName("Different Name");
- cpStringProperty.setPropertyDefaultValue("Different value from default");
- AtomicOperationUtils.addCustomPropertyToResource(cpStringProperty, cp, UserRoleEnum.DESIGNER, true);
- AtomicOperationUtils.changeComponentState(basicVFC, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
- cp = AtomicOperationUtils.getResourceObject(cp, UserRoleEnum.DESIGNER);
- expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(cp, expectedPropertyList);
- // create VF + add RI
- vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
- .value();
- ComponentInstance componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
- .value();
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
- PropertyRestUtils.updatePropertyListWithPathOnResource(componentInstDetails, vfc2FromVfc1, expectedPropertyList,
- vfResource);
- componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(cp, vfResource, UserRoleEnum.DESIGNER, true).left().value();
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
- PropertyRestUtils.updatePropertyListWithPathOnResource(componentInstDetails, cp, expectedPropertyList,
- vfResource);
- // verify property
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
- actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, actualPropertyList, null);
- PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
- }
-
- @Test
- public void nestedCertifiedVfResourceProperty3Levels() throws Exception {
- basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
- vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
- ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
- vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
- LifeCycleStatesEnum.CERTIFY, vfc1FromBasicVFC);
-
- vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
- expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(vfc2FromVfc1, expectedPropertyList);
- // create VF + add RI
- vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
- .value();
- ComponentInstance componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
- .value();
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
- PropertyRestUtils.updatePropertyListWithPathOnResource(componentInstDetails, vfc2FromVfc1, expectedPropertyList,
- vfResource);
- // verify property
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
- AtomicOperationUtils.changeComponentState(vfResource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
- PropertyRestUtils.updatePropertyListWithPathOnResource(componentInstDetails, vfc2FromVfc1, expectedPropertyList,
- vfResource);
- actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, actualPropertyList, null);
- PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
- }
-
- @Test
- public void nestedVfResourceProperty3Levels2SameResInstances() throws Exception {
-
- basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
- vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
- ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
- vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
- LifeCycleStatesEnum.CHECKIN, vfc1FromBasicVFC);
-
- vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
- expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(vfc2FromVfc1, expectedPropertyList);
- expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(vfc2FromVfc1, expectedPropertyList);
- // create VF + add RI
- vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
- .value();
- ComponentInstance componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
- .value();
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
- // verify property
- PropertyRestUtils.updatePropertyListWithPathOnResource(componentInstDetails, vfc2FromVfc1, expectedPropertyList,
- vfResource);
-
- componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
- .value();
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
- PropertyRestUtils.updatePropertyListWithPathOnResource(componentInstDetails, vfc2FromVfc1, expectedPropertyList,
- vfResource);
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
- actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, actualPropertyList, null);
- PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
- }
-
- // ------------------update resource
- // property-----------------------------------
-
- @Test
- public void nestedVfResourceProperty3LevelsUpdateFirstLevelProperty() throws Exception {
- // first res
- basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
- NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
- .value();
- Either<ComponentInstanceProperty, RestResponse> propDetailsToUpdate = AtomicOperationUtils
- .addDefaultPropertyToResource(PropertyTypeEnum.STRING, basicVFC, UserRoleEnum.DESIGNER, true);
- String propNameToUpdate = propDetailsToUpdate.left().value().getName();
- String propTypeToUpdate = propDetailsToUpdate.left().value().getType();
- AtomicOperationUtils.changeComponentState(basicVFC, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
-
- vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
- ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
- vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
- LifeCycleStatesEnum.CHECKIN, vfc1FromBasicVFC);
-
- vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
- expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(vfc2FromVfc1, expectedPropertyList);
-
- // create VF + add RI
- vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
- .value();
- ComponentInstance componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
- .value();
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
- PropertyRestUtils.updatePropertyListWithPathOnResource(componentInstDetails, vfc2FromVfc1, expectedPropertyList,
- vfResource);
-
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
- actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, actualPropertyList, null);
-
- // verify property
- PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
-
- // update property
- ComponentInstanceProperty expectedUpdatePropDetails = PropertyRestUtils
- .getPropFromListByPropNameAndType(actualPropertyList, propNameToUpdate, propTypeToUpdate);
- expectedUpdatePropDetails.setValue(updatedStringValue);
- String propUniqeId = expectedUpdatePropDetails.getUniqueId();
- RestResponse updatePropertyValueOnResourceInstance = ComponentInstanceRestUtils
- .updatePropertyValueOnResourceInstance(vfResource, componentInstDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), expectedUpdatePropDetails);
- assertTrue("expected updatePropertyValueOnResourceInstance response code: " + BaseRestUtils.STATUS_CODE_SUCCESS,
- updatePropertyValueOnResourceInstance.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
-
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
-
- actualPropertyList = new ArrayList<>();
- actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, actualPropertyList, null);
-
- ComponentInstanceProperty actualUpdatedPropDetails = PropertyRestUtils
- .getPropFromListByPropIdAndPath(actualPropertyList, propUniqeId, null);
- assertTrue("property was not updated propely",
- PropertyRestUtils.comparePropertyObjects(expectedUpdatePropDetails, actualUpdatedPropDetails, true));
-
- }
-
- @Test
- public void nestedVfResourceProperty3LevelsUpdateSecondLevelProperty() throws Exception {
- basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
-
- // second resource
- vfc1FromBasicVFC = AtomicOperationUtils.createResourcesByCustomNormativeTypeAndCatregory(ResourceTypeEnum.VFC,
- basicVFC, ResourceCategoryEnum.APPLICATION_L4_BORDER, UserRoleEnum.DESIGNER, true).left().value();
- Either<ComponentInstanceProperty, RestResponse> propDetailsToUpdate = AtomicOperationUtils
- .addCustomPropertyToResource(ElementFactory.getDefaultIntegerProperty(), vfc1FromBasicVFC,
- UserRoleEnum.DESIGNER, true);
- String propNameToUpdate = propDetailsToUpdate.left().value().getName();
- String propTypeToUpdate = propDetailsToUpdate.left().value().getType();
- AtomicOperationUtils.changeComponentState(vfc1FromBasicVFC, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY,
- true);
-
- vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
- LifeCycleStatesEnum.CHECKIN, vfc1FromBasicVFC);
-
- vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
- expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(vfc2FromVfc1, expectedPropertyList);
-
- // create VF + add RI
- vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
- .value();
- ComponentInstance componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
- .value();
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
- PropertyRestUtils.updatePropertyListWithPathOnResource(componentInstDetails, vfc2FromVfc1, expectedPropertyList,
- vfResource);
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
- actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, actualPropertyList, null);
-
- // verify property
- PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
-
- // update property
- ComponentInstanceProperty expectedUpdatePropDetails = PropertyRestUtils
- .getPropFromListByPropNameAndType(actualPropertyList, propNameToUpdate, propTypeToUpdate);
- expectedUpdatePropDetails.setValue(updatedIntegerValue);
- String propUniqeId = expectedUpdatePropDetails.getUniqueId();
- RestResponse updatePropertyValueOnResourceInstance = ComponentInstanceRestUtils
- .updatePropertyValueOnResourceInstance(vfResource, componentInstDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), expectedUpdatePropDetails);
- assertTrue(
- "expected updatePropertyValueOnResourceInstance response code: " + BaseRestUtils.STATUS_CODE_SUCCESS
- + " ,but was " + updatePropertyValueOnResourceInstance.getErrorCode(),
- updatePropertyValueOnResourceInstance.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
-
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
-
- actualPropertyList = new ArrayList<>();
- actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, actualPropertyList, null);
- ComponentInstanceProperty actualUpdatedPropDetails = PropertyRestUtils
- .getPropFromListByPropIdAndPath(actualPropertyList, propUniqeId, null);
- assertTrue("property was not updated properly",
- PropertyRestUtils.comparePropertyObjects(expectedUpdatePropDetails, actualUpdatedPropDetails, true));
-
- }
-
- @Test
- public void nestedVfResourceProperty3LevelsUpdateThirdLevelProperty() throws Exception {
-
- basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
- vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
- ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
-
- // third resource
- vfc2FromVfc1 = AtomicOperationUtils.createResourcesByCustomNormativeTypeAndCatregory(ResourceTypeEnum.VFC,
- vfc1FromBasicVFC, ResourceCategoryEnum.GENERIC_DATABASE, UserRoleEnum.DESIGNER, true).left().value();
- Either<ComponentInstanceProperty, RestResponse> propDetailsToUpdate = AtomicOperationUtils
- .addCustomPropertyToResource(ElementFactory.getDefaultBooleanProperty(), vfc2FromVfc1,
- UserRoleEnum.DESIGNER, true);
- String propNameToUpdate = propDetailsToUpdate.left().value().getName();
- String propTypeToUpdate = propDetailsToUpdate.left().value().getType();
- AtomicOperationUtils.changeComponentState(vfc2FromVfc1, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN,
- true);
-
- vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
- expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(vfc2FromVfc1, expectedPropertyList);
-
- // create VF + add RI
- vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
- .value();
- ComponentInstance componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
- .value();
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
- PropertyRestUtils.updatePropertyListWithPathOnResource(componentInstDetails, vfc2FromVfc1, expectedPropertyList,
- vfResource);
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
- actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, actualPropertyList, null);
-
- // verify property
- PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
-
- // update property
- ComponentInstanceProperty expectedUpdatePropDetails = PropertyRestUtils
- .getPropFromListByPropNameAndType(actualPropertyList, propNameToUpdate, propTypeToUpdate);
- expectedUpdatePropDetails.setValue(updatedBooleanValue);
- String propUniqeId = expectedUpdatePropDetails.getUniqueId();
- RestResponse updatePropertyValueOnResourceInstance = ComponentInstanceRestUtils
- .updatePropertyValueOnResourceInstance(vfResource, componentInstDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), expectedUpdatePropDetails);
- assertTrue("expected updatePropertyValueOnResourceInstance response code: " + BaseRestUtils.STATUS_CODE_SUCCESS,
- updatePropertyValueOnResourceInstance.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
-
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
-
- actualPropertyList = new ArrayList<>();
- actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, actualPropertyList, null);
- ComponentInstanceProperty actualUpdatedPropDetails = PropertyRestUtils
- .getPropFromListByPropIdAndPath(actualPropertyList, propUniqeId, null);
- assertTrue("property was not updated propely",
- PropertyRestUtils.comparePropertyObjects(expectedUpdatePropDetails, actualUpdatedPropDetails, true));
-
- }
-
- // ---------------------Service------------------------------------------------------------------------
-
- /**
- * Service-->VF1(inst)-->VF-->(VFC(inst)-->VFC-->VFC-->VFC) (p3) (p2) (p1)
- */
- @Test
- public void serviceWithNestedResourceProperty3Levels() throws Exception {
-
- basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
- vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
- ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
- vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
- LifeCycleStatesEnum.CHECKIN, vfc1FromBasicVFC);
- vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
- expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(vfc2FromVfc1, expectedPropertyList);
-
- vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
- .value();
- ComponentInstance componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
- .value();
- AtomicOperationUtils.changeComponentState(vfResource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
- PropertyRestUtils.updatePropertyListWithPathOnResource(componentInstDetails, vfc2FromVfc1, expectedPropertyList,
- vfResource);
- Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
- componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfResource, service, UserRoleEnum.DESIGNER, true).left()
- .value();
- service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
- PropertyRestUtils.updatePropertyListWithPathOnComponentInstance(componentInstDetails, service,
- expectedPropertyList);
- actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
- PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
-
- }
-
- /**
- * Service-->VF1(inst)-->VF-->(VFC(inst)-->VFC-->VFC-->VFC) (p4) (p3) (p2)
- * (p1)
- */
- @Test
- public void serviceWithNestedResourceProperty3LevelsAndVfProperty() throws Exception {
-
- basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
- vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
- ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
- vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
- LifeCycleStatesEnum.CHECKIN, vfc1FromBasicVFC);
- vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
- expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(vfc2FromVfc1, expectedPropertyList);
-
- vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
- .value();
- ComponentInstance componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
- .value();
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
- PropertyRestUtils.updatePropertyListWithPathOnResource(componentInstDetails, vfc2FromVfc1, expectedPropertyList,
- vfResource);
- PropertyReqDetails propDetails = ElementFactory.getDefaultBooleanProperty();
- propDetails.setName(newBooleanPropName);
- propDetails.setPropertyDefaultValue(newBooleanPropValue);
- AtomicOperationUtils.addCustomPropertyToResource(propDetails, vfResource, UserRoleEnum.DESIGNER, true);
- propDetails = ElementFactory.getDefaultStringProperty();
- propDetails.setName(newStringPropName);
- propDetails.setPropertyDefaultValue(newStringPropValue);
- AtomicOperationUtils.addCustomPropertyToResource(propDetails, vfResource, UserRoleEnum.DESIGNER, true);
- propDetails = ElementFactory.getDefaultIntegerProperty();
- propDetails.setName(newIntegerPropName);
- propDetails.setPropertyDefaultValue(newIntegerPropValue);
- AtomicOperationUtils.addCustomPropertyToResource(propDetails, vfResource, UserRoleEnum.DESIGNER, true);
- AtomicOperationUtils.changeComponentState(vfResource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
- expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(vfResource, expectedPropertyList);
-
- Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
- componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfResource, service, UserRoleEnum.DESIGNER, true).left()
- .value();
- service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
- PropertyRestUtils.updatePropertyListWithPathOnComponentInstance(componentInstDetails, service,
- expectedPropertyList);
- actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
- PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
-
- }
-
- /**
- * Service-->VF1(inst)-->VF-->(VFC(inst)-->VFC-->VFC-->VFC) (p4) (p3) (p2)
- * (p1) CP(VF inst) (p5)
- */
- @Test
- public void serviceWithNestedResourceProperty3LevelsAndCp() throws Exception {
-
- basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
- vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
- ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
- vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
- LifeCycleStatesEnum.CHECKIN, vfc1FromBasicVFC);
- vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
- expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(vfc2FromVfc1, expectedPropertyList);
-
- // four resource
- Resource cp = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.CP,
- NormativeTypesEnum.NETWORK, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
- .value();
- PropertyReqDetails cpStringProperty = ElementFactory.getDefaultStringProperty();
- cpStringProperty.setName("Different Name");
- cpStringProperty.setPropertyDefaultValue("Different value from default");
- AtomicOperationUtils.addCustomPropertyToResource(cpStringProperty, cp, UserRoleEnum.DESIGNER, true);
- AtomicOperationUtils.changeComponentState(basicVFC, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
- cp = AtomicOperationUtils.getResourceObject(cp, UserRoleEnum.DESIGNER);
- expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(cp, expectedPropertyList);
- // create VF + add RI
- vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
- .value();
- ComponentInstance componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
- .value();
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
- PropertyRestUtils.updatePropertyListWithPathOnResource(componentInstDetails, vfc2FromVfc1, expectedPropertyList,
- vfResource);
- componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(cp, vfResource, UserRoleEnum.DESIGNER, true).left().value();
- AtomicOperationUtils.changeComponentState(vfResource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
- PropertyRestUtils.updatePropertyListWithPathOnResource(componentInstDetails, cp, expectedPropertyList,
- vfResource);
-
- Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
- componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfResource, service, UserRoleEnum.DESIGNER, true).left()
- .value();
- service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
- PropertyRestUtils.updatePropertyListWithPathOnComponentInstance(componentInstDetails, service,
- expectedPropertyList);
- actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
- PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
-
- }
-
- /**
- * Service-->VF1(inst)-->VF-->(VFC(inst)-->VFC-->VFC-->VFC) (p4) (p3) (p2)
- * (p1) CP(inst) (p5)
- */
- @Test
- public void serviceWithNestedResourceProperty3LevelsAndCpResInst() throws Exception {
-
- basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
- vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
- ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
- vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
- LifeCycleStatesEnum.CHECKIN, vfc1FromBasicVFC);
- vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
- // expectedPropertyList =
- // PropertyRestUtils.addResourcePropertiesToList(vfc2FromVfc1,
- // expectedPropertyList);
-
- // four resource
- Resource cp = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.CP,
- NormativeTypesEnum.NETWORK, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
- .value();
- PropertyReqDetails cpStringProperty = ElementFactory.getDefaultStringProperty();
- cpStringProperty.setName("Different Name");
- cpStringProperty.setPropertyDefaultValue("Different value from default");
- AtomicOperationUtils.addCustomPropertyToResource(cpStringProperty, cp, UserRoleEnum.DESIGNER, true);
- AtomicOperationUtils.changeComponentState(cp, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
- cp = AtomicOperationUtils.getResourceObject(cp, UserRoleEnum.DESIGNER);
- // create VF + add RI
- vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
- .value();
- ComponentInstance componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
- .value();
- AtomicOperationUtils.changeComponentState(vfResource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
-
- // Service
- expectedPropertyList = new ArrayList<ComponentInstanceProperty>();
- actualPropertyList = new ArrayList<ComponentInstanceProperty>();
- expectedPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, expectedPropertyList,
- null);
- expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(cp, expectedPropertyList);
-
- Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
- componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfResource, service, UserRoleEnum.DESIGNER, true).left()
- .value();
- service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
- PropertyRestUtils.updatePropertyListWithPathOnComponentInstance(componentInstDetails, service,
- expectedPropertyList);
- componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(cp, service, UserRoleEnum.DESIGNER, true).left().value();
- service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
- PropertyRestUtils.updatePropertyListWithPathOnComponentInstance(componentInstDetails, service,
- expectedPropertyList);
- actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
- PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
-
- }
-
- /**
- * Service-->VF1(inst)-->VF-->(VFC(inst)-->VFC-->VFC-->VFC) | (p3) (p2) (p1)
- * | (VFC(inst)-->VFC-->VFC-->VFC) (p3) (p2) (p1)
- *
- * VF2(inst)-->VF-->(VFC(inst)-->VFC-->VFC-->VFC) | (p3') (p2') (p1') |
- * (VFC(inst)-->VFC-->VFC-->VFC) (p3) (p2) (p1)
- */
- @Test
- public void serviceNestedVfResourceProperty3Levels2SameResInstances() throws Exception {
-
- basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
- vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
- ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
- vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
- LifeCycleStatesEnum.CHECKIN, vfc1FromBasicVFC);
- vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
-
- expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(vfc2FromVfc1, expectedPropertyList);
- expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(vfc2FromVfc1, expectedPropertyList);
-
- // create VF + add RI
- vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
- .value();
- ComponentInstance componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
- .value();
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
- // verify property
- PropertyRestUtils.updatePropertyListWithPathOnResource(componentInstDetails, vfc2FromVfc1, expectedPropertyList,
- vfResource);
-
- componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
- .value();
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
- PropertyRestUtils.updatePropertyListWithPathOnResource(componentInstDetails, vfc2FromVfc1, expectedPropertyList,
- vfResource);
- AtomicOperationUtils.changeComponentState(vfResource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
- actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, actualPropertyList, null);
- PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
-
- // Service
- expectedPropertyList = new ArrayList<ComponentInstanceProperty>();
- actualPropertyList = new ArrayList<ComponentInstanceProperty>();
- expectedPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, expectedPropertyList,
- null);
- expectedPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, expectedPropertyList,
- null);
- Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
- componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfResource, service, UserRoleEnum.DESIGNER, true).left()
- .value();
- service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
- PropertyRestUtils.updatePropertyListWithPathOnComponentInstance(componentInstDetails, service,
- expectedPropertyList);
- componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfResource, service, UserRoleEnum.DESIGNER, true).left()
- .value();
- service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
- PropertyRestUtils.updatePropertyListWithPathOnComponentInstance(componentInstDetails, service,
- expectedPropertyList);
- service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
- actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
- PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
-
- }
-
- // service test template
- /**
- * Service-->VF(inst)-->VF-->(VFC(inst)-->VFC-->VFC-->VFC) (p4) (p3) (p2)
- * (p1)
- */
- @Test
- public void serviceNestedVfResourceProperty3LevelsAndSelfVfProperty() throws Exception {
-
- basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
- vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
- ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
- vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
- LifeCycleStatesEnum.CHECKIN, vfc1FromBasicVFC);
- vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
-
- // create VF + add RI
- vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
- .value();
- ComponentInstance componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
- .value();
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
- PropertyReqDetails newProp = ElementFactory.getDefaultStringProperty();
- newProp.setName(newStringPropName);
- newProp.setPropertyDefaultValue(newStringPropValue);
- AtomicOperationUtils.addCustomPropertyToResource(newProp, vfResource, UserRoleEnum.DESIGNER, true);
- AtomicOperationUtils.changeComponentState(vfResource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
-
- // Service
- expectedPropertyList = new ArrayList<ComponentInstanceProperty>();
- actualPropertyList = new ArrayList<ComponentInstanceProperty>();
- expectedPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, expectedPropertyList,
- null);
- Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
- componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfResource, service, UserRoleEnum.DESIGNER, true).left()
- .value();
- service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
- PropertyRestUtils.updatePropertyListWithPathOnComponentInstance(componentInstDetails, service,
- expectedPropertyList);
- service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
- actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
- PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
-
- }
-
- /**
- * update property(p4)
- *
- *
- * VFC(p1) ^ | VFC(p2) ^ | Service-->VF(inst)-->VF-->(VFC(inst)-->VFC(p3)
- * (p4)
- */
- @Test
- public void serviceNestedVfResourceProperty3LevelsAndSelfVfProperty_UpdateVfproperty() throws Exception {
- // Create VFC(check-in state) derived from another resource
- basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
- vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
- ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
- vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
- LifeCycleStatesEnum.CHECKIN, vfc1FromBasicVFC);
- vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
-
- // create VF + add RI
- vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
- .value();
- ComponentInstance componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
- .value();
-
- // add property to VF
- PropertyReqDetails newProp = ElementFactory.getDefaultStringProperty();
- newProp.setName(newStringPropName);
- newProp.setPropertyDefaultValue(newStringPropValue);
- Either<ComponentInstanceProperty, RestResponse> propDetailsToUpdate = AtomicOperationUtils
- .addCustomPropertyToResource(newProp, vfResource, UserRoleEnum.DESIGNER, true);
- String propNameToUpdate = propDetailsToUpdate.left().value().getName();
- String propTypeToUpdate = propDetailsToUpdate.left().value().getType();
- AtomicOperationUtils.changeComponentState(vfResource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
-
- // Service
- expectedPropertyList = new ArrayList<ComponentInstanceProperty>();
- actualPropertyList = new ArrayList<ComponentInstanceProperty>();
- expectedPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, expectedPropertyList,
- null);
- Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
- componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfResource, service, UserRoleEnum.DESIGNER, true).left()
- .value();
- service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
- PropertyRestUtils.updatePropertyListWithPathOnComponentInstance(componentInstDetails, service,
- expectedPropertyList);
-
- service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
- actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
- PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
-
- // update VF instance property
- ComponentInstanceProperty expectedUpdatePropDetails = PropertyRestUtils
- .getPropFromListByPropNameAndType(actualPropertyList, propNameToUpdate, propTypeToUpdate);
- expectedUpdatePropDetails.setValue(updatedStringValue);
- String propUniqeId = expectedUpdatePropDetails.getUniqueId();
- RestResponse updatePropertyValueOnResourceInstance = ComponentInstanceRestUtils
- .updatePropertyValueOnResourceInstance(service, componentInstDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), expectedUpdatePropDetails);
- assertTrue("expected updatePropertyValueOnResourceInstance response code: " + BaseRestUtils.STATUS_CODE_SUCCESS,
- updatePropertyValueOnResourceInstance.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
-
- service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
-
- actualPropertyList = new ArrayList<>();
- actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
-
- ComponentInstanceProperty actualUpdatedPropDetails = PropertyRestUtils
- .getPropFromListByPropIdAndPath(actualPropertyList, propUniqeId, null);
- assertTrue("property was not updated propely",
- PropertyRestUtils.comparePropertyObjects(expectedUpdatePropDetails, actualUpdatedPropDetails, true));
-
- }
-
- /**
- * update property(p1)
- * Service-->VF(inst)-->VF-->(VFC(inst)-->VFC-->VFC-->VFC) (p4) (p3) (p2)
- * (p1)
- */
- @Test
- public void serviceNestedVfResourceProperty3LevelsAndSelfVfPropertyUpdateVfInheritance1LevelProperty()
- throws Exception {
-
- basicVFC = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
- NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
- .value();
- Either<ComponentInstanceProperty, RestResponse> propDetailsToUpdate = AtomicOperationUtils
- .addDefaultPropertyToResource(PropertyTypeEnum.STRING, basicVFC, UserRoleEnum.DESIGNER, true);
- String propNameToUpdate = propDetailsToUpdate.left().value().getName();
- String propTypeToUpdate = propDetailsToUpdate.left().value().getType();
- AtomicOperationUtils.changeComponentState(basicVFC, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
- vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
- ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
- vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
- LifeCycleStatesEnum.CHECKIN, vfc1FromBasicVFC);
- vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
-
- // create VF + add RI
- vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
- .value();
- ComponentInstance componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
- .value();
- // verify property
- PropertyReqDetails newProp = ElementFactory.getDefaultStringProperty();
- newProp.setName(newStringPropName);
- newProp.setPropertyDefaultValue(newStringPropValue);
- AtomicOperationUtils.addCustomPropertyToResource(newProp, vfResource, UserRoleEnum.DESIGNER, true);
- AtomicOperationUtils.changeComponentState(vfResource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
-
- // Service
- expectedPropertyList = new ArrayList<ComponentInstanceProperty>();
- actualPropertyList = new ArrayList<ComponentInstanceProperty>();
- expectedPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, expectedPropertyList,
- null);
- Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
- componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfResource, service, UserRoleEnum.DESIGNER, true).left()
- .value();
- service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
- PropertyRestUtils.updatePropertyListWithPathOnComponentInstance(componentInstDetails, service,
- expectedPropertyList);
-
- service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
- actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
- PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
-
- // update VF property
- ComponentInstanceProperty expectedUpdatePropDetails = PropertyRestUtils
- .getPropFromListByPropNameAndType(actualPropertyList, propNameToUpdate, propTypeToUpdate);
- expectedUpdatePropDetails.setValue(updatedStringValue);
- String propUniqeId = expectedUpdatePropDetails.getUniqueId();
- RestResponse updatePropertyValueOnResourceInstance = ComponentInstanceRestUtils
- .updatePropertyValueOnResourceInstance(service, componentInstDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), expectedUpdatePropDetails);
- assertTrue("expected updatePropertyValueOnResourceInstance response code: " + BaseRestUtils.STATUS_CODE_SUCCESS,
- updatePropertyValueOnResourceInstance.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
-
- service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
-
- actualPropertyList = new ArrayList<>();
- actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
-
- ComponentInstanceProperty actualUpdatedPropDetails = PropertyRestUtils
- .getPropFromListByPropIdAndPath(actualPropertyList, propUniqeId, null);
- assertTrue("property was not updated propely",
- PropertyRestUtils.comparePropertyObjects(expectedUpdatePropDetails, actualUpdatedPropDetails, true));
-
- }
-
- /**
- * update property(p2)
- * Service-->VF(inst)-->VF-->(VFC(inst)-->VFC-->VFC-->VFC) (p4) (p3) (p2)
- * (p1)
- */
- @Test
- public void serviceNestedVfResourceProperty3LevelsAndSelfVfPropertyUpdateVfInheritance2LevelProperty()
- throws Exception {
-
- basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
- vfc1FromBasicVFC = AtomicOperationUtils.createResourcesByCustomNormativeTypeAndCatregory(ResourceTypeEnum.VFC,
- basicVFC, ResourceCategoryEnum.APPLICATION_L4_BORDER, UserRoleEnum.DESIGNER, true).left().value();
- Either<ComponentInstanceProperty, RestResponse> propDetailsToUpdate = AtomicOperationUtils
- .addCustomPropertyToResource(ElementFactory.getDefaultIntegerProperty(), vfc1FromBasicVFC,
- UserRoleEnum.DESIGNER, true);
- String propNameToUpdate = propDetailsToUpdate.left().value().getName();
- String propTypeToUpdate = propDetailsToUpdate.left().value().getType();
- AtomicOperationUtils.changeComponentState(vfc1FromBasicVFC, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY,
- true);
- vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
- LifeCycleStatesEnum.CHECKIN, vfc1FromBasicVFC);
- vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
-
- // create VF + add RI
- vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
- .value();
- ComponentInstance componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
- .value();
-
- // verify property
- PropertyReqDetails newProp = ElementFactory.getDefaultStringProperty();
- newProp.setName(newStringPropName);
- newProp.setPropertyDefaultValue(newStringPropValue);
- AtomicOperationUtils.addCustomPropertyToResource(newProp, vfResource, UserRoleEnum.DESIGNER, true);
- AtomicOperationUtils.changeComponentState(vfResource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
-
- // Service
- expectedPropertyList = new ArrayList<ComponentInstanceProperty>();
- actualPropertyList = new ArrayList<ComponentInstanceProperty>();
- expectedPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, expectedPropertyList,
- null);
- Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
- componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfResource, service, UserRoleEnum.DESIGNER, true).left()
- .value();
- service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
- PropertyRestUtils.updatePropertyListWithPathOnComponentInstance(componentInstDetails, service,
- expectedPropertyList);
-
- service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
- actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
- PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
-
- // update VF property
- ComponentInstanceProperty expectedUpdatePropDetails = PropertyRestUtils
- .getPropFromListByPropNameAndType(actualPropertyList, propNameToUpdate, propTypeToUpdate);
- expectedUpdatePropDetails.setValue(updatedIntegerValue);
- String propUniqeId = expectedUpdatePropDetails.getUniqueId();
- RestResponse updatePropertyValueOnResourceInstance = ComponentInstanceRestUtils
- .updatePropertyValueOnResourceInstance(service, componentInstDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), expectedUpdatePropDetails);
- assertTrue("expected updatePropertyValueOnResourceInstance response code: " + BaseRestUtils.STATUS_CODE_SUCCESS,
- updatePropertyValueOnResourceInstance.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
-
- service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
- actualPropertyList = new ArrayList<>();
- actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
- ComponentInstanceProperty actualUpdatedPropDetails = PropertyRestUtils
- .getPropFromListByPropIdAndPath(actualPropertyList, propUniqeId, null);
- assertTrue("property was not updated propely",
- PropertyRestUtils.comparePropertyObjects(expectedUpdatePropDetails, actualUpdatedPropDetails, true));
-
- }
-
- /**
- * update property(p3)
- * Service-->VF(inst)-->VF-->(VFC(inst)-->VFC-->VFC-->VFC) (p4) (p3) (p2)
- * (p1)
- */
- @Test
- public void serviceNestedVfResourceProperty3LevelsAndSelfVfPropertyUpdateVfInheritance3LevelProperty()
- throws Exception {
-
- basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
- vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
- ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
- vfc2FromVfc1 = AtomicOperationUtils.createResourcesByCustomNormativeTypeAndCatregory(ResourceTypeEnum.VFC,
- vfc1FromBasicVFC, ResourceCategoryEnum.GENERIC_DATABASE, UserRoleEnum.DESIGNER, true).left().value();
- Either<ComponentInstanceProperty, RestResponse> propDetailsToUpdate = AtomicOperationUtils
- .addCustomPropertyToResource(ElementFactory.getDefaultBooleanProperty(), vfc2FromVfc1,
- UserRoleEnum.DESIGNER, true);
- String propNameToUpdate = propDetailsToUpdate.left().value().getName();
- String propTypeToUpdate = propDetailsToUpdate.left().value().getType();
- AtomicOperationUtils.changeComponentState(vfc2FromVfc1, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN,
- true);
- vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
-
- // create VF + add RI
- vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
- .value();
- ComponentInstance componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
- .value();
- // verify property
- PropertyReqDetails newProp = ElementFactory.getDefaultStringProperty();
- newProp.setName(newStringPropName);
- newProp.setPropertyDefaultValue(newStringPropValue);
- AtomicOperationUtils.addCustomPropertyToResource(newProp, vfResource, UserRoleEnum.DESIGNER, true);
- AtomicOperationUtils.changeComponentState(vfResource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
-
- // Service
- expectedPropertyList = new ArrayList<ComponentInstanceProperty>();
- actualPropertyList = new ArrayList<ComponentInstanceProperty>();
- expectedPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, expectedPropertyList,
- null);
- Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
- componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfResource, service, UserRoleEnum.DESIGNER, true).left()
- .value();
- service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
- PropertyRestUtils.updatePropertyListWithPathOnComponentInstance(componentInstDetails, service,
- expectedPropertyList);
-
- service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
- actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
- PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
-
- // update VF property
- ComponentInstanceProperty expectedUpdatePropDetails = PropertyRestUtils
- .getPropFromListByPropNameAndType(actualPropertyList, propNameToUpdate, propTypeToUpdate);
- expectedUpdatePropDetails.setValue(updatedBooleanValue);
- String propUniqeId = expectedUpdatePropDetails.getUniqueId();
- RestResponse updatePropertyValueOnResourceInstance = ComponentInstanceRestUtils
- .updatePropertyValueOnResourceInstance(service, componentInstDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), expectedUpdatePropDetails);
- assertTrue("expected updatePropertyValueOnResourceInstance response code: " + BaseRestUtils.STATUS_CODE_SUCCESS,
- updatePropertyValueOnResourceInstance.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
-
- service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
-
- actualPropertyList = new ArrayList<>();
- actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
-
- ComponentInstanceProperty actualUpdatedPropDetails = PropertyRestUtils
- .getPropFromListByPropIdAndPath(actualPropertyList, propUniqeId, null);
- assertTrue("property was not updated propely",
- PropertyRestUtils.comparePropertyObjects(expectedUpdatePropDetails, actualUpdatedPropDetails, true));
-
- }
-
- /**
- * update property p5'
- * Service-->VF1(inst)-->VF-->(VFC(inst)-->VFC-->VFC-->VFC) (p4) (p3) (p2)
- * (p1) CP(inst on VF) (p5) CP(inst) (p5')
- */
- @Test
- public void serviceWithNestedResourceProperty3LevelsAndCpOnVfUpdateCpInstanceOfService() throws Exception {
- basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
- vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
- ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
- vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
- LifeCycleStatesEnum.CHECKIN, vfc1FromBasicVFC);
- vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
- // expectedPropertyList =
- // PropertyRestUtils.addResourcePropertiesToList(vfc2FromVfc1,
- // expectedPropertyList);
-
- // four resource
- Resource cp = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.CP,
- NormativeTypesEnum.NETWORK, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
- .value();
- PropertyReqDetails cpStringProperty = ElementFactory.getDefaultStringProperty();
- cpStringProperty.setName("Different Name");
- cpStringProperty.setPropertyDefaultValue("Different value from default");
- AtomicOperationUtils.addCustomPropertyToResource(cpStringProperty, cp, UserRoleEnum.DESIGNER, true);
- AtomicOperationUtils.changeComponentState(cp, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
- cp = AtomicOperationUtils.getResourceObject(cp, UserRoleEnum.DESIGNER);
- // create VF + add RI
- vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
- .value();
- ComponentInstance componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
- .value();
- componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(cp, vfResource, UserRoleEnum.DESIGNER, true).left().value();
- AtomicOperationUtils.changeComponentState(vfResource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
-
- // Service
- expectedPropertyList = new ArrayList<ComponentInstanceProperty>();
- actualPropertyList = new ArrayList<ComponentInstanceProperty>();
- expectedPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, expectedPropertyList,
- null);
- expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(cp, expectedPropertyList);
-
- Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
- componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfResource, service, UserRoleEnum.DESIGNER, true).left()
- .value();
- service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
- PropertyRestUtils.updatePropertyListWithPathOnComponentInstance(componentInstDetails, service,
- expectedPropertyList);
-
- componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(cp, service, UserRoleEnum.DESIGNER, true).left().value();
- service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
- PropertyRestUtils.updatePropertyListWithPathOnComponentInstance(componentInstDetails, service,
- expectedPropertyList);
-
- // service = AtomicOperationUtils.getServiceObject(service,
- // UserRoleEnum.DESIGNER);
- actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
- PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
-
- String propNameToUpdate = "cidr";
- String propTypeToUpdate = "string";
-
- // update CP property
- ComponentInstanceProperty expectedUpdatePropDetails = PropertyRestUtils.getCompPropInstListByInstIdAndPropName(
- service, componentInstDetails, propNameToUpdate, propTypeToUpdate);
- expectedUpdatePropDetails.setValue(updatedStringValue);
- String propUniqeId = expectedUpdatePropDetails.getUniqueId();
- List<String> path = expectedUpdatePropDetails.getPath();
- RestResponse updatePropertyValueOnResourceInstance = ComponentInstanceRestUtils
- .updatePropertyValueOnResourceInstance(service, componentInstDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), expectedUpdatePropDetails);
- assertTrue("expected updatePropertyValueOnResourceInstance response code: " + BaseRestUtils.STATUS_CODE_SUCCESS,
- updatePropertyValueOnResourceInstance.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
-
- service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
-
- actualPropertyList = new ArrayList<>();
- actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
-
- ComponentInstanceProperty actualUpdatedPropDetails = PropertyRestUtils
- .getPropFromListByPropIdAndPath(actualPropertyList, propUniqeId, path);
- assertTrue("property was not updated propely",
- PropertyRestUtils.comparePropertyObjects(expectedUpdatePropDetails, actualUpdatedPropDetails, true));
- }
-
- /**
- * update property p5
- * Service-->VF1(inst)-->VF-->(VFC(inst)-->VFC-->VFC-->VFC) (p4) (p3) (p2)
- * (p1) CP(inst on VF) (p5) CP(inst) (p5')
- */
- @Test
- public void serviceWithNestedResourceProperty3LevelsAndCpOnVfUpdateCpInstanceOfVf() throws Exception {
- basicVFC = createResourceWithProperty(ElementFactory.getDefaultStringProperty(), LifeCycleStatesEnum.CERTIFY);
- vfc1FromBasicVFC = createResourceWithPropertyDerivedFromOtherResource(
- ElementFactory.getDefaultIntegerProperty(), LifeCycleStatesEnum.CERTIFY, basicVFC);
- vfc2FromVfc1 = createResourceWithPropertyDerivedFromOtherResource(ElementFactory.getDefaultBooleanProperty(),
- LifeCycleStatesEnum.CERTIFY, vfc1FromBasicVFC);
- vfc2FromVfc1 = AtomicOperationUtils.getResourceObject(vfc2FromVfc1, UserRoleEnum.DESIGNER);
- // expectedPropertyList =
- // PropertyRestUtils.addResourcePropertiesToList(vfc2FromVfc1,
- // expectedPropertyList);
-
- // four resource
- Resource cp = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.CP,
- NormativeTypesEnum.NETWORK, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
- .value();
- PropertyReqDetails cpStringProperty = ElementFactory.getDefaultStringProperty();
- cpStringProperty.setName("Different Name");
- cpStringProperty.setPropertyDefaultValue("Different value from default");
- AtomicOperationUtils.addCustomPropertyToResource(cpStringProperty, cp, UserRoleEnum.DESIGNER, true);
- AtomicOperationUtils.changeComponentState(cp, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
- // create VF + add RI
- cp = AtomicOperationUtils.getResourceObject(cp, UserRoleEnum.DESIGNER);
- vfResource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
- .value();
- ComponentInstance componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfc2FromVfc1, vfResource, UserRoleEnum.DESIGNER, true).left()
- .value();
- componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(cp, vfResource, UserRoleEnum.DESIGNER, true).left().value();
- AtomicOperationUtils.changeComponentState(vfResource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
- vfResource = AtomicOperationUtils.getResourceObject(vfResource, UserRoleEnum.DESIGNER);
-
- // Service
- expectedPropertyList = new ArrayList<ComponentInstanceProperty>();
- actualPropertyList = new ArrayList<ComponentInstanceProperty>();
- expectedPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(vfResource, expectedPropertyList,
- null);
- expectedPropertyList = PropertyRestUtils.addResourcePropertiesToList(cp, expectedPropertyList);
-
- Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
- componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vfResource, service, UserRoleEnum.DESIGNER, true).left()
- .value();
- service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
- PropertyRestUtils.updatePropertyListWithPathOnComponentInstance(componentInstDetails, service,
- expectedPropertyList);
-
- componentInstDetails = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(cp, service, UserRoleEnum.DESIGNER, true).left().value();
- service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
- PropertyRestUtils.updatePropertyListWithPathOnComponentInstance(componentInstDetails, service,
- expectedPropertyList);
-
- service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
- actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
- PropertyRestUtils.comparePropertyLists(expectedPropertyList, actualPropertyList, false);
-
- String propNameToUpdate = "cidr";
- String propTypeToUpdate = "string";
-
- // update CP property
- ComponentInstanceProperty expectedUpdatePropDetails = PropertyRestUtils.getCompPropInstListByInstIdAndPropName(
- service, componentInstDetails, propNameToUpdate, propTypeToUpdate);
- expectedUpdatePropDetails.setValue(updatedStringValue);
- String propUniqeId = expectedUpdatePropDetails.getUniqueId();
- List<String> path = expectedUpdatePropDetails.getPath();
- RestResponse updatePropertyValueOnResourceInstance = ComponentInstanceRestUtils
- .updatePropertyValueOnResourceInstance(service, componentInstDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), expectedUpdatePropDetails);
- assertTrue("expected updatePropertyValueOnResourceInstance response code: " + BaseRestUtils.STATUS_CODE_SUCCESS,
- updatePropertyValueOnResourceInstance.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
-
- service = AtomicOperationUtils.getServiceObject(service, UserRoleEnum.DESIGNER);
-
- actualPropertyList = new ArrayList<>();
- actualPropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, actualPropertyList, null);
-
- ComponentInstanceProperty actualUpdatedPropDetails = PropertyRestUtils
- .getPropFromListByPropIdAndPath(actualPropertyList, propUniqeId, path);
- assertTrue("property was not updated propely",
- PropertyRestUtils.comparePropertyObjects(expectedUpdatePropDetails, actualUpdatedPropDetails, true));
- }
-
- // -------------------Methods--------------------------
- public static PropertyDataDefinition convertToPropertyDataDefinitionObject(PropertyReqDetails prop) {
- PropertyDataDefinition propDataDef = new PropertyDataDefinition();
- propDataDef.setDefaultValue(prop.getPropertyDefaultValue());
- propDataDef.setType(prop.getPropertyType());
- propDataDef.setPassword(prop.getPropertyPassword());
- propDataDef.setDescription(prop.getPropertyDescription());
- return propDataDef;
- }
-
- protected Resource createResourceWithPropertyDerivedFromOtherResource(PropertyReqDetails propertyReqDetails,
- LifeCycleStatesEnum state, Resource derivedFromResource) throws Exception {
- Resource resource = AtomicOperationUtils.createResourcesByCustomNormativeTypeAndCatregory(ResourceTypeEnum.VFC,
- derivedFromResource, ResourceCategoryEnum.APPLICATION_L4_BORDER, UserRoleEnum.DESIGNER, true).left()
- .value();
- if (propertyReqDetails != null) {
- AtomicOperationUtils.addCustomPropertyToResource(propertyReqDetails, resource, UserRoleEnum.DESIGNER, true);
- }
- AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, state, true);
- return AtomicOperationUtils.getResourceObject(resource, UserRoleEnum.DESIGNER);
- // return resource;
- }
-
- protected Resource createResourceWithProperty(PropertyReqDetails propertyReqDetails, LifeCycleStatesEnum state)
- throws Exception {
- Resource resource = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC,
- NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left()
- .value();
- if (propertyReqDetails != null) {
- AtomicOperationUtils.addCustomPropertyToResource(propertyReqDetails, resource, UserRoleEnum.DESIGNER, true);
- }
- AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, state, true);
- return AtomicOperationUtils.getResourceObject(resource, UserRoleEnum.DESIGNER);
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/property/PropertyApisTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/property/PropertyApisTest.java
deleted file mode 100644
index 789b118419..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/property/PropertyApisTest.java
+++ /dev/null
@@ -1,367 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.property;
-
-import static org.testng.AssertJUnit.assertTrue;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.json.simple.JSONObject;
-import org.json.simple.JSONValue;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.be.model.operations.impl.UniqueIdBuilder;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.PropertyReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-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.http.HttpHeaderEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.preRequisites.SimpleOneRsrcOneServiceTest;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.PropertyRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.openecomp.sdc.ci.tests.utils.rest.UserRestUtils;
-import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
-import org.testng.AssertJUnit;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-public class PropertyApisTest extends SimpleOneRsrcOneServiceTest {
-
- protected static final String RESOURCE_CATEGORY = "Generic/Databases";
- protected Config config = Config.instance();
- protected String contentTypeHeaderData = "application/json";
- protected String acceptHeaderDate = "application/json";;
- protected PropertyReqDetails property;
- protected String body;
-
- protected HttpRequest httpRequest = new HttpRequest();
- protected Map<String, String> headersMap = new HashMap<String, String>();
-
- @Rule
- public static TestName testName = new TestName();
-
- public PropertyApisTest() {
- super(testName, PropertyApisTest.class.getName());
- }
-
- @BeforeMethod
- public void init() throws Exception {
- property = ElementFactory.getDefaultProperty();
- body = property.propertyToJsonString();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncDesignerDetails.getUserId());
-
- }
-
- @Test
- public void validateValidValueConstraintFailTest() throws Exception {
- body = "{\"SubnetProp\": {\"schema\": {\"property\": {\"type\": \"\"}},\"type\": \"org.openecomp.datatypes.heat.network.neutron.Subnet\",\"name\": \"SubnetProp\"}}";
- RestResponse createPropertyResponse = PropertyRestUtils.createProperty(getResourceId(resourceDetails), body,
- sdncDesignerDetails);
- AssertJUnit.assertEquals("Expected result code - 200, received - " + createPropertyResponse.getErrorCode(), 200,
- (int) createPropertyResponse.getErrorCode());
-
- ObjectMapper mapper = new ObjectMapper();
- mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
- mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- try {
- PropertyReqDetails propertyResponseObject = mapper.readValue(createPropertyResponse.getResponse(),
- PropertyReqDetails.class);
-
- PropertyReqDetails propertyReqDetails = new PropertyReqDetails();
- propertyReqDetails.setPropertyType("org.openecomp.datatypes.heat.network.neutron.Subnet");
- propertyReqDetails.setName(propertyResponseObject.getName());
- propertyReqDetails.setValue(mapper.writeValueAsString(Collections.singletonMap("ipv6_address_mode", "Fail")));
- propertyReqDetails.setParentUniqueId(propertyResponseObject.getParentUniqueId());
- propertyReqDetails.setUniqueId(propertyResponseObject.getUniqueId());
-
- body = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(Collections.singletonList(propertyReqDetails));
- body = body.replace("propertyType", "type");
- RestResponse addValueToPropertyResponse =
- PropertyRestUtils.addValueToProperty(getResourceId(resourceDetails), body, sdncDesignerDetails);
-
- AssertJUnit.assertEquals("Expected result code - 400, received - " + addValueToPropertyResponse.getErrorCode(),
- 400, (int) addValueToPropertyResponse.getErrorCode());
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- @Test
- public void validateValidValueConstraintSuccessTest() throws Exception {
- body = "{\"SubnetProp\": {\"schema\": {\"property\": {\"type\": \"\"}},\"type\": \"org.openecomp.datatypes.heat.network.neutron.Subnet\",\"name\": \"SubnetProp\"}}";
- RestResponse createPropertyResponse = PropertyRestUtils.createProperty(getResourceId(resourceDetails), body,
- sdncDesignerDetails);
- AssertJUnit.assertEquals("Expected result code - 201, received - " + createPropertyResponse.getErrorCode(), 200,
- (int) createPropertyResponse.getErrorCode());
-
- ObjectMapper mapper = new ObjectMapper();
- mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
- mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- try {
- PropertyReqDetails propertyResponseObject = mapper.readValue(createPropertyResponse.getResponse(),
- PropertyReqDetails.class);
-
- PropertyReqDetails propertyReqDetails = new PropertyReqDetails();
- propertyReqDetails.setPropertyType("org.openecomp.datatypes.heat.network.neutron.Subnet");
- propertyReqDetails.setName(propertyResponseObject.getName());
- propertyReqDetails.setValue(mapper.writeValueAsString(Collections.singletonMap("ipv6_address_mode", "slaac")));
- propertyReqDetails.setParentUniqueId(propertyResponseObject.getParentUniqueId());
- propertyReqDetails.setUniqueId(propertyResponseObject.getUniqueId());
-
- body = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(Collections.singletonList(propertyReqDetails));
- body = body.replace("propertyType", "type");
- RestResponse addValueToPropertyResponse =
- PropertyRestUtils.addValueToProperty(getResourceId(resourceDetails), body, sdncDesignerDetails);
-
- AssertJUnit.assertEquals("Expected result code - 200, received - " + addValueToPropertyResponse.getErrorCode(),
- 200, (int) addValueToPropertyResponse.getErrorCode());
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- @Test
- public void testPropertyApis() throws Exception {
- String propertyId = UniqueIdBuilder.buildComponentPropertyUniqueId(getResourceId(resourceDetails), property.getName());
-
- PropertyRestUtils.deleteProperty(getResourceId(resourceDetails), propertyId, sdncDesignerDetails);
- RestResponse createPropertyResponse = PropertyRestUtils.createProperty(getResourceId(resourceDetails), body,
- sdncDesignerDetails);
- AssertJUnit.assertTrue("Expected result code - 201, received - " + createPropertyResponse.getErrorCode(),
- createPropertyResponse.getErrorCode() == 201);
-
- // Get property
- RestResponse getPropertyResponse = PropertyRestUtils.getProperty(getResourceId(resourceDetails), propertyId,
- sdncDesignerDetails);
- AssertJUnit.assertTrue("Expected result code - 200, received - " + getPropertyResponse.getErrorCode(),
- getPropertyResponse.getErrorCode() == 200);
-
- JSONObject jsonResp = (JSONObject) JSONValue.parse(getPropertyResponse.getResponse());
-
- // Update property
- property.setPropertyDescription("Updated description");
- body = property.propertyToJsonString();
-
- RestResponse updatePropertyResponse = PropertyRestUtils.updateProperty(getResourceId(resourceDetails),
- propertyId, body, sdncDesignerDetails);
- AssertJUnit.assertTrue("Expected result code - 200, received - " + updatePropertyResponse.getErrorCode(),
- updatePropertyResponse.getErrorCode() == 200);
-
- // Get property
- getPropertyResponse = PropertyRestUtils.getProperty(getResourceId(resourceDetails), propertyId,
- sdncDesignerDetails);
- AssertJUnit.assertTrue("Expected result code - 200, received - " + getPropertyResponse.getErrorCode(),
- getPropertyResponse.getErrorCode() == 200);
-
- jsonResp = (JSONObject) JSONValue.parse(getPropertyResponse.getResponse());
-
- // Delete property
- RestResponse deletePropertyResponse = PropertyRestUtils.deleteProperty(getResourceId(resourceDetails),
- propertyId, sdncDesignerDetails);
- AssertJUnit.assertTrue("Expected result code - 204, received - " + deletePropertyResponse.getErrorCode(),
- deletePropertyResponse.getErrorCode() == 204);
-
- // Get property - verify that the property doesn't exist.
- getPropertyResponse = PropertyRestUtils.getProperty(getResourceId(resourceDetails), propertyId,
- sdncDesignerDetails);
- List<String> variables = Arrays.asList("");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.PROPERTY_NOT_FOUND.name(), variables,
- getPropertyResponse.getResponse());
-
- }
-
- // --------------------------------------------------------------------------------------
-
- protected String getPropertyId(ResourceReqDetails resource, PropertyReqDetails property) {
- return UniqueIdBuilder.buildComponentPropertyUniqueId(resource.getUniqueId(), property.getName());
- }
-
- protected String getResourceId(ResourceReqDetails resource) {
- return resource.getUniqueId();
- }
-
- protected User createUser(String cspUserId, String firstName, String lastName, String email, String role)
- throws Exception {
- User sdncUserDetails = new User(firstName, lastName, cspUserId, email, role, null);
-
- User adminUser = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- UserRestUtils.createUser(sdncUserDetails, adminUser);
-
- return sdncUserDetails;
- }
-
- protected ResourceReqDetails createResource(User sdncUserDetails, String resourceName) throws Exception {
- String description = "description";
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add(resourceName);
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add("tosca.nodes.Root");
- String vendorName = "Oracle";
- String vendorRelease = "1.0";
- String contactId = sdncUserDetails.getUserId();
- String icon = "myICON";
-
- ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, null,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
- resourceDetails.addCategoryChain(ResourceCategoryEnum.GENERIC_DATABASE.getCategory(),
- ResourceCategoryEnum.GENERIC_DATABASE.getSubCategory());
- // TODO delete by name
- // deleteResource(UniqueIdBuilder.buildResourceUniqueId(resourceName,
- // "0.1"), sdncUserDetails.getUserId());
- RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, sdncUserDetails);
- AssertJUnit.assertTrue(createResource.getErrorCode().intValue() == 201);
- String resourceId = ResponseParser.getUniqueIdFromResponse(createResource);
- resourceDetails.setUniqueId(resourceId);
-
- return resourceDetails;
-
- }
-
- @Test
- public void putReqToCreateUriNotAllowed() throws Exception {
- String url = String.format(Urls.CREATE_PROPERTY, config.getCatalogBeHost(), config.getCatalogBePort(),
- getResourceId(resourceDetails));
- RestResponse propertyErrorResponse = httpRequest.httpSendByMethod(url, "PUT", body, headersMap);
- List<String> variables = Arrays.asList();
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.NOT_ALLOWED.name(), variables,
- propertyErrorResponse.getResponse());
- }
-
- @Test
- public void getReqToCreateUriNotAllowed() throws Exception {
- String url = String.format(Urls.CREATE_PROPERTY, config.getCatalogBeHost(), config.getCatalogBePort(),
- getResourceId(resourceDetails));
- RestResponse propertyErrorResponse = httpRequest.httpSendGet(url, headersMap);
- List<String> variables = Arrays.asList();
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.NOT_ALLOWED.name(), variables,
- propertyErrorResponse.getResponse());
- }
-
- @Test
- public void deleteReqToCreateUriNotAllowed() throws Exception {
- String url = String.format(Urls.CREATE_PROPERTY, config.getCatalogBeHost(), config.getCatalogBePort(),
- getResourceId(resourceDetails));
- RestResponse propertyErrorResponse = httpRequest.httpSendDelete(url, headersMap);
- List<String> variables = Arrays.asList();
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.NOT_ALLOWED.name(), variables,
- propertyErrorResponse.getResponse());
- }
-
- @Test
- public void postReqToUpdateUriNotAllowed() throws Exception {
- String url = String.format(Urls.UPDATE_PROPERTY, config.getCatalogBeHost(), config.getCatalogBePort(),
- getResourceId(resourceDetails), getPropertyId(resourceDetails, property));
- RestResponse propertyErrorResponse = httpRequest.httpSendPost(url, body, headersMap);
- List<String> variables = Arrays.asList();
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.NOT_ALLOWED.name(), variables,
- propertyErrorResponse.getResponse());
- }
-
- @Test
- public void deleteReqPropertyNotFound() throws Exception {
- String unknownPropertyId = getPropertyId(resourceDetails, property) + "111";
- String url = String.format(Urls.DELETE_PROPERTY, config.getCatalogBeHost(), config.getCatalogBePort(),
- getResourceId(resourceDetails), unknownPropertyId);
- RestResponse propertyErrorResponse = httpRequest.httpSendDelete(url, headersMap);
- List<String> variables = Arrays.asList("");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.PROPERTY_NOT_FOUND.name(), variables,
- propertyErrorResponse.getResponse());
- }
-
- @Test
- public void updateReqPropertyNotFound() throws Exception {
- String unknownPropertyId = getPropertyId(resourceDetails, property) + "111";
- String url = String.format(Urls.UPDATE_PROPERTY, config.getCatalogBeHost(), config.getCatalogBePort(),
- getResourceId(resourceDetails), unknownPropertyId);
- RestResponse propertyErrorResponse = httpRequest.httpSendByMethod(url, "PUT", body, headersMap);
- List<String> variables = Arrays.asList("");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.PROPERTY_NOT_FOUND.name(), variables,
- propertyErrorResponse.getResponse());
- }
-
- @Test
- public void modifierNotTheStateOwner() throws Exception {
- // Operation Not Allowed ----");
- User sdncUserDetails2 = createUser("tu5555", "Test", "User", "tu5555@intl.sdc.com", "DESIGNER");
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncUserDetails2.getUserId());
- property.setPropertyDescription("new description");
- body = property.propertyToJsonString();
- String url = String.format(Urls.UPDATE_PROPERTY, config.getCatalogBeHost(), config.getCatalogBePort(),
- getResourceId(resourceDetails), getPropertyId(resourceDetails, property));
- RestResponse propertyErrorResponse = httpRequest.httpSendByMethod(url, "PUT", body, headersMap);
- List<String> variables = Arrays.asList();
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), variables,
- propertyErrorResponse.getResponse());
-
- }
-
- @Test
- public void postReqInvalidContent() throws Exception {
- body = "invalid";
- String url = String.format(Urls.CREATE_PROPERTY, config.getCatalogBeHost(), config.getCatalogBePort(),
- getResourceId(resourceDetails), getPropertyId(resourceDetails, property));
- RestResponse propertyErrorResponse = httpRequest.httpSendPost(url, body, headersMap);
-
- List<String> variables = Arrays.asList();
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_CONTENT.name(), variables,
- propertyErrorResponse.getResponse());
- }
-
- @Test
- public void putReqInvalidContent() throws Exception {
-
- // Create property
- RestResponse createPropertyResponse = PropertyRestUtils.createProperty(getResourceId(resourceDetails), body,
- sdncDesignerDetails);
- assertTrue("Expected result code - 201, received - " + createPropertyResponse.getErrorCode(),
- createPropertyResponse.getErrorCode() == 201);
-
- body = "invalid";
-
- String url = String.format(Urls.UPDATE_PROPERTY, config.getCatalogBeHost(), config.getCatalogBePort(),
- getResourceId(resourceDetails), getPropertyId(resourceDetails, property));
-
- RestResponse propertyErrorResponse = httpRequest.httpSendByMethod(url, "PUT", body, headersMap);
-
- List<String> variables = Arrays.asList();
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_CONTENT.name(), variables,
- propertyErrorResponse.getResponse());
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/CheckGetResource.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/CheckGetResource.java
deleted file mode 100644
index 6bae08b2bd..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/CheckGetResource.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.resource;
-
-import fj.data.Either;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.openecomp.sdc.common.util.SerializationUtils;
-
-public class CheckGetResource {
-
- public void checkGetVmmsc6() throws Exception {
-
- try {
-
- System.out.println("dddd");
- RestResponse getResource = ResourceRestUtils.getResource("96eb6583-2822-448b-a284-bfc144fa627e");
-
- Resource resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
-
- Either<byte[], Boolean> serialize = SerializationUtils.serializeExt(resource);
-
- SerializationUtils.deserializeExt(serialize.left().value(), Resource.class, "ffff");
-
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/CreateResourceApiTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/CreateResourceApiTest.java
deleted file mode 100644
index 0549eaa042..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/CreateResourceApiTest.java
+++ /dev/null
@@ -1,2194 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.resource;
-
-import com.google.gson.Gson;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.LifecycleStateEnum;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.*;
-import org.openecomp.sdc.ci.tests.datatypes.enums.*;
-import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedResourceAuditJavaObject;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.DbUtils;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.ci.tests.utils.general.Convertor;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.*;
-import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
-import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
-import org.openecomp.sdc.ci.tests.utils.validation.ResourceValidationUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.annotations.Test;
-
-import java.util.*;
-
-import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_SUCCESS;
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertNotNull;
-
-/**
- * @author yshlosberg
- *
- */
-public class CreateResourceApiTest extends ComponentBaseTest {
-
- private static Logger log = LoggerFactory.getLogger(CreateResourceApiTest.class.getName());
-
- String contentTypeHeaderData = "application/json";
- String acceptHeaderDate = "application/json";
- String resourceVersion = "0.1";
-
- @Rule
- public static TestName name = new TestName();
-
- public CreateResourceApiTest() {
- super(name, CreateResourceApiTest.class.getName());
- }
-
- @Test
- public void createResourceTest() throws Exception {
-
- // init ADMIN user
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-
- // ResourceReqDetails resourceDetails = new
- // ResourceReqDetails(resourceName, description, resourceTags, category,
- // derivedFrom, vendorName, vendorRelease, contactId, icon);
- ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
- String resourceName = resourceDetails.getName();
- resourceDetails.setTags(Arrays.asList(resourceName, resourceName, resourceName, resourceName, "tag2", "tag2"));
- // create resource
- RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
-
- // validate response
- assertNotNull("check response object is not null after create resource", createResponse);
- assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
- assertEquals("Check response code after create resource", 201, createResponse.getErrorCode().intValue());
-
- // validate response
- ResourceRespJavaObject resourceRespJavaObject = Convertor.constructFieldsForRespValidation(resourceDetails,
- resourceVersion);
- resourceRespJavaObject.setLifecycleState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
- resourceRespJavaObject.setAbstractt("false");
- ResourceValidationUtils.validateResp(createResponse, resourceRespJavaObject);
-
- // validate get response
- RestResponse resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails,
- resourceDetails.getUniqueId());
- ResourceValidationUtils.validateResp(resourceGetResponse, resourceRespJavaObject);
-
- // validate audit
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
- .constructFieldsForAuditValidation(resourceDetails, resourceVersion);
- String auditAction = "Create";
- expectedResourceAuditJavaObject.setAction(auditAction);
- expectedResourceAuditJavaObject.setPrevVersion("");
- expectedResourceAuditJavaObject.setPrevState("");
- expectedResourceAuditJavaObject.setStatus("201");
- expectedResourceAuditJavaObject.setDesc("OK");
-
- AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
- }
-
- @Test
- public void createResourceNonDefaultResourceTypeTest() throws Exception {
-
- // init ADMIN user
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-
- ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
- String resourceType = ResourceTypeEnum.CP.toString();
- resourceDetails.setResourceType(resourceType);
- // create resource
- RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
-
- // validate response
- assertNotNull("check response object is not null after create resource", createResponse);
- assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
- assertEquals("Check response code after create resource", 201, createResponse.getErrorCode().intValue());
-
- // validate response
- ResourceRespJavaObject resourceRespJavaObject = Convertor.constructFieldsForRespValidation(resourceDetails,
- resourceVersion);
- resourceRespJavaObject.setLifecycleState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
- resourceRespJavaObject.setAbstractt("false");
- resourceRespJavaObject.setResourceType(resourceType);
- ResourceValidationUtils.validateResp(createResponse, resourceRespJavaObject);
-
- // validate get response
- RestResponse resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails,
- resourceDetails.getUniqueId());
- ResourceValidationUtils.validateResp(resourceGetResponse, resourceRespJavaObject);
-
- // validate audit
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
- .constructFieldsForAuditValidation(resourceDetails, resourceVersion);
- String auditAction = "Create";
- expectedResourceAuditJavaObject.setAction(auditAction);
- expectedResourceAuditJavaObject.setPrevVersion("");
- expectedResourceAuditJavaObject.setPrevState("");
- expectedResourceAuditJavaObject.setStatus("201");
- expectedResourceAuditJavaObject.setDesc("OK");
-
- AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
- }
-
- @Test
- public void createResourceTest_costAndLicenseType() throws Exception {
-
- // init ADMIN user
-
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-
- // set resource details
- String resourceName = "CISCO4572";
- String description = "description";
- // Duplicate tags are allowed and should be de-duplicated by the server
- // side
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add(resourceName);
- resourceTags.add(resourceName);
- resourceTags.add(resourceName);
- resourceTags.add("tag2");
- resourceTags.add("tag2");
- String category = ServiceCategoriesEnum.VOIP.getValue();
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
- String vendorName = "Oracle";
- String vendorRelease = "1.5";
- String contactId = "jh0003";
- String icon = "myICON";
-
- ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
- // Adding cost and licenseType
- resourceDetails.setCost("12355.345");
- resourceDetails.setLicenseType("User");
-
- // create resource
- RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
-
- // validate response
- assertNotNull("check response object is not null after create resource", createResponse);
- assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
- assertEquals("Check response code after create resource", 201, createResponse.getErrorCode().intValue());
-
- // validate response
- String resourceVersion = "0.1";
- ResourceRespJavaObject resourceRespJavaObject = Convertor.constructFieldsForRespValidation(resourceDetails,
- resourceVersion);
- resourceRespJavaObject.setLifecycleState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
- resourceRespJavaObject.setAbstractt("false");
- ResourceValidationUtils.validateResp(createResponse, resourceRespJavaObject);
-
- // validate get response
-
- RestResponse resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails,
- resourceDetails.getUniqueId());
- ResourceValidationUtils.validateResp(resourceGetResponse, resourceRespJavaObject);
-
- }
-
- // ////Benny
- @Test
- public void createResourceTest_CostIsMissing() throws Exception {
-
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- // set resource details
- String resourceName = "CISCO4572";
- String description = "description";
- // Duplicate tags are allowed and should be de-duplicated by the server
- // side
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add(resourceName);
- resourceTags.add(resourceName);
- resourceTags.add(resourceName);
- resourceTags.add("tag2");
- resourceTags.add("tag2");
- String category = ServiceCategoriesEnum.VOIP.getValue();
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
- String vendorName = "Oracle";
- String vendorRelease = "1.5";
- String contactId = "jh0003";
- String icon = "myICON";
-
- ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
- // Adding cost and licenseType
- // resourceDetails.setCost("12355.345");
- resourceDetails.setLicenseType("User");
-
- // create resource
- RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
- assertNotNull("check response object is not null after create resource", createResponse);
- assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
- assertEquals("Check response code after create resource", 201, createResponse.getErrorCode().intValue());
-
- // validate response
- String resourceVersion = "0.1";
- ResourceRespJavaObject resourceRespJavaObject = Convertor.constructFieldsForRespValidation(resourceDetails,
- resourceVersion);
- resourceRespJavaObject.setLifecycleState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
- resourceRespJavaObject.setAbstractt("false");
- ResourceValidationUtils.validateResp(createResponse, resourceRespJavaObject);
-
- // validate get response
- RestResponse resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails,
- resourceDetails.getUniqueId());
- ResourceValidationUtils.validateResp(resourceGetResponse, resourceRespJavaObject);
- }
-
- @Test
- public void createResourceTest_LicenseTypeMissing() throws Exception {
-
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- // set resource details
- String resourceName = "CISCO4572";
- String description = "description";
- // Duplicate tags are allowed and should be de-duplicated by the server
- // side
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add(resourceName);
- resourceTags.add(resourceName);
- resourceTags.add(resourceName);
- resourceTags.add("tag2");
- resourceTags.add("tag2");
- String category = ServiceCategoriesEnum.VOIP.getValue();
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
- String vendorName = "Oracle";
- String vendorRelease = "1.5";
- String contactId = "jh0003";
- String icon = "myICON";
-
- ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
- // Adding cost and licenseType
- resourceDetails.setCost("12355.345");
- // resourceDetails.setLicenseType("User");
-
- // create resource
- RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
- assertNotNull("check response object is not null after create resource", createResponse);
- assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
- assertEquals("Check response code after create resource", 201, createResponse.getErrorCode().intValue());
-
- // validate response
- String resourceVersion = "0.1";
- ResourceRespJavaObject resourceRespJavaObject = Convertor.constructFieldsForRespValidation(resourceDetails,
- resourceVersion);
- resourceRespJavaObject.setLifecycleState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
- resourceRespJavaObject.setAbstractt("false");
- ResourceValidationUtils.validateResp(createResponse, resourceRespJavaObject);
-
- // validate get response
- RestResponse resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails,
- resourceDetails.getUniqueId());
- ResourceValidationUtils.validateResp(resourceGetResponse, resourceRespJavaObject);
- }
-
- @Test
- public void createResourceTest_LicenseType_Installation() throws Exception {
-
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- // set resource details
- String resourceName = "CISCO4572";
- String description = "description";
- // Duplicate tags are allowed and should be de-duplicated by the server
- // side
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add(resourceName);
- resourceTags.add(resourceName);
- resourceTags.add(resourceName);
- resourceTags.add("tag2");
- resourceTags.add("tag2");
- String category = ServiceCategoriesEnum.VOIP.getValue();
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
- String vendorName = "Oracle";
- String vendorRelease = "1.5";
- String contactId = "jh0003";
- String icon = "myICON";
-
- ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
- // Adding cost and licenseType
- resourceDetails.setCost("99999.999");
- resourceDetails.setLicenseType("Installation");
-
- // create resource
- RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
- assertNotNull("check response object is not null after create resource", createResponse);
- assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
- assertEquals("Check response code after create resource", 201, createResponse.getErrorCode().intValue());
-
- // validate response
- String resourceVersion = "0.1";
- ResourceRespJavaObject resourceRespJavaObject = Convertor.constructFieldsForRespValidation(resourceDetails,
- resourceVersion);
- resourceRespJavaObject.setLifecycleState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
- resourceRespJavaObject.setAbstractt("false");
- ResourceValidationUtils.validateResp(createResponse, resourceRespJavaObject);
-
- // validate get response
- RestResponse resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails,
- resourceDetails.getUniqueId());
- ResourceValidationUtils.validateResp(resourceGetResponse, resourceRespJavaObject);
- }
-
- @Test
- public void createResourceTest_LicenseType_CPU() throws Exception {
-
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- // set resource details
- String resourceName = "CISCO4572";
- String description = "description";
- // Duplicate tags are allowed and should be de-duplicated by the server
- // side
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add(resourceName);
- resourceTags.add(resourceName);
- resourceTags.add(resourceName);
- resourceTags.add("tag2");
- resourceTags.add("tag2");
- String category = ServiceCategoriesEnum.VOIP.getValue();
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
- String vendorName = "Oracle";
- String vendorRelease = "1.5";
- String contactId = "jh0003";
- String icon = "myICON";
-
- ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
- // Adding cost and licenseType
- resourceDetails.setCost("0.0");
- resourceDetails.setLicenseType("CPU");
-
- // create resource
- RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
- assertNotNull("check response object is not null after create resource", createResponse);
- assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
- assertEquals("Check response code after create resource", 201, createResponse.getErrorCode().intValue());
-
- // validate response
- String resourceVersion = "0.1";
- ResourceRespJavaObject resourceRespJavaObject = Convertor.constructFieldsForRespValidation(resourceDetails,
- resourceVersion);
- resourceRespJavaObject.setLifecycleState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
- resourceRespJavaObject.setAbstractt("false");
- ResourceValidationUtils.validateResp(createResponse, resourceRespJavaObject);
-
- // validate get response
- RestResponse resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails,
- resourceDetails.getUniqueId());
- ResourceValidationUtils.validateResp(resourceGetResponse, resourceRespJavaObject);
- }
-
- @Test
- public void createResourceTest_LicenseType_Uppercase() throws Exception {
-
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- // set resource details
- String resourceName = "CISCO4572";
- String description = "description";
- // Duplicate tags are allowed and should be de-duplicated by the server
- // side
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add(resourceName);
- resourceTags.add(resourceName);
- resourceTags.add(resourceName);
- resourceTags.add("tag2");
- resourceTags.add("tag2");
- String category = ServiceCategoriesEnum.VOIP.getValue();
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
- String vendorName = "Oracle";
- String vendorRelease = "1.5";
- String contactId = "jh0003";
- String icon = "myICON";
-
- ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
- // Adding cost and licenseType
- resourceDetails.setCost("0.0");
- resourceDetails.setLicenseType("INSTALLATION");
-
- // create resource
- RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
- assertNotNull("check response object is not null after create resource", createResponse);
- assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
- assertEquals("Check response code after create resource", 400, createResponse.getErrorCode().intValue());
- assertEquals("Check response code after create resource", "Bad Request", createResponse.getResponseMessage());
- }
-
- @Test
- public void createResourceTest_LicenseType_Invalid() throws Exception {
-
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- // set resource details
- String resourceName = "CISCO4572";
- String description = "description";
- // Duplicate tags are allowed and should be de-duplicated by the server
- // side
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add(resourceName);
- resourceTags.add(resourceName);
- resourceTags.add(resourceName);
- resourceTags.add("tag2");
- resourceTags.add("tag2");
- String category = ServiceCategoriesEnum.VOIP.getValue();
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
- String vendorName = "Oracle";
- String vendorRelease = "1.5";
- String contactId = "jh0003";
- String icon = "myICON";
-
- ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
- // Adding cost and licenseType
- resourceDetails.setCost("0.0");
- resourceDetails.setLicenseType("CPUUU");
-
- // create resource
- RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
- assertNotNull("check response object is not null after create resource", createResponse);
- assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
- assertEquals("Check response code after create resource", 400, createResponse.getErrorCode().intValue());
- assertEquals("Check response code after create resource", "Bad Request", createResponse.getResponseMessage());
- }
-
- @Test
- public void createResourceTest_CostValidation_noNumeric() throws Exception {
-
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- // set resource details
- String resourceName = "CISCO4572";
- String description = "description";
- // Duplicate tags are allowed and should be de-duplicated by the server
- // side
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add(resourceName);
- resourceTags.add(resourceName);
- resourceTags.add(resourceName);
- resourceTags.add("tag2");
- resourceTags.add("tag2");
- String category = ServiceCategoriesEnum.VOIP.getValue();
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
- String vendorName = "Oracle";
- String vendorRelease = "1.5";
- String contactId = "jh0003";
- String icon = "myICON";
-
- ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
- // Adding cost and licenseType
- resourceDetails.setCost("12355.345");
- resourceDetails.setLicenseType("User");
- resourceDetails.setCost("12355.34b");
- // create resource
- RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
- assertNotNull("check response object is not null after create resource", createResponse);
- assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
- assertEquals("Check response code after create resource", 400, createResponse.getErrorCode().intValue());
- assertEquals("Check response code after create resource", "Bad Request",
- createResponse.getResponseMessage().toString());
-
- }
-
- @Test
- public void createResourceTest_CostValidation_valueLength() throws Exception {
-
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- // set resource details
- String resourceName = "CISCO4572";
- String description = "description";
- // Duplicate tags are allowed and should be de-duplicated by the server
- // side
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add(resourceName);
- resourceTags.add(resourceName);
- resourceTags.add(resourceName);
- resourceTags.add("tag2");
- resourceTags.add("tag2");
- String category = ServiceCategoriesEnum.VOIP.getValue();
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
- String vendorName = "Oracle";
- String vendorRelease = "1.5";
- String contactId = "jh0003";
- String icon = "myICON";
- ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
- // Adding cost and licenseType
- resourceDetails.setCost("12355.345");
- resourceDetails.setLicenseType("User");
-
- // Adding invalid cost
- resourceDetails.setCost("12355.3434");
- // create resource
- RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
- assertNotNull("check response object is not null after create resource", createResponse);
- assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
- assertEquals("Check response code after create resource", 400, createResponse.getErrorCode().intValue());
- assertEquals("Check response code after create resource", "Bad Request",
- createResponse.getResponseMessage().toString());
- }
-
- @Test
- public void createResourceTest_CostValidation_PriceLimitations() throws Exception {
-
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- // set resource details
- String resourceName = "CISCO4572";
- String description = "description";
- // Duplicate tags are allowed and should be de-duplicated by the server
- // side
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add(resourceName);
- resourceTags.add(resourceName);
- resourceTags.add(resourceName);
- resourceTags.add("tag2");
- resourceTags.add("tag2");
- String category = ServiceCategoriesEnum.VOIP.getValue();
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
- String vendorName = "Oracle";
- String vendorRelease = "1.5";
- String contactId = "jh0003";
- String icon = "myICON";
- ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
- // Adding cost and licenseType
- resourceDetails.setCost("12355.345");
- resourceDetails.setLicenseType("User");
-
- // Adding invalid cost
- RestResponse createResponse;
- // create resource
-
- resourceDetails.setCost("000000.000");
- createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
- createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
- assertNotNull("check response object is not null after create resource", createResponse);
- assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
- assertEquals("Check response code after create resource", 400, createResponse.getErrorCode().intValue());
- assertEquals("Check response code after create resource", "Bad Request",
- createResponse.getResponseMessage().toString());
-
- /*
- * resourceDetails.setCost("0550.457"); createResponse =
- * resourceUtils.createResource(resourceDetails, sdncModifierDetails);
- * assertNotNull("check response object is not null after create resource"
- * , createResponse);
- * assertNotNull("check error code exists in response after create resource"
- * , createResponse.getErrorCode());
- * assertEquals("Check response code after create resource", 400,
- * createResponse.getErrorCode().intValue());
- * assertEquals("Check response code after create resource",
- * "Bad Request", createResponse.getResponseMessage().toString());
- */
-
- resourceDetails.setCost("1");
- createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
- assertNotNull("check response object is not null after create resource", createResponse);
- assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
- assertEquals("Check response code after create resource", 400, createResponse.getErrorCode().intValue());
- assertEquals("Check response code after create resource", "Bad Request",
- createResponse.getResponseMessage().toString());
-
- resourceDetails.setCost("123555.340");
- createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
- createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
- assertNotNull("check response object is not null after create resource", createResponse);
- assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
- assertEquals("Check response code after create resource", 400, createResponse.getErrorCode().intValue());
- assertEquals("Check response code after create resource", "Bad Request",
- createResponse.getResponseMessage().toString());
-
- resourceDetails.setCost("123.4570");
- createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
- assertNotNull("check response object is not null after create resource", createResponse);
- assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
- assertEquals("Check response code after create resource", 400, createResponse.getErrorCode().intValue());
- assertEquals("Check response code after create resource", "Bad Request",
- createResponse.getResponseMessage().toString());
-
- resourceDetails.setCost("123555.30");
- createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
- assertNotNull("check response object is not null after create resource", createResponse);
- assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
- assertEquals("Check response code after create resource", 400, createResponse.getErrorCode().intValue());
- assertEquals("Check response code after create resource", "Bad Request",
- createResponse.getResponseMessage().toString());
-
- resourceDetails.setCost("123.5550");
- createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
- assertNotNull("check response object is not null after create resource", createResponse);
- assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
- assertEquals("Check response code after create resource", 400, createResponse.getErrorCode().intValue());
- assertEquals("Check response code after create resource", "Bad Request",
- createResponse.getResponseMessage().toString());
-
- }
-
- @Test
- public void createResourceTest_CostIsNull() throws Exception {
-
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- // set resource details
- String resourceName = "CISCO4572";
- String description = "description";
- // Duplicate tags are allowed and should be de-duplicated by the server
- // side
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add(resourceName);
- resourceTags.add(resourceName);
- resourceTags.add(resourceName);
- resourceTags.add("tag2");
- resourceTags.add("tag2");
- String category = ServiceCategoriesEnum.VOIP.getValue();
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
- String vendorName = "Oracle";
- String vendorRelease = "1.5";
- String contactId = "jh0003";
- String icon = "myICON";
-
- ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
- // Adding cost and licenseType
- resourceDetails.setCost("12355.345");
- resourceDetails.setLicenseType("User");
- resourceDetails.setCost("");
- // create resource
- RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
- assertNotNull("check response object is not null after create resource", createResponse);
- assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
- assertEquals("Check response code after create resource", 400, createResponse.getErrorCode().intValue());
- assertEquals("Check response code after create resource", "Bad Request", createResponse.getResponseMessage());
-
- }
-
- @Test
- public void createResourceTest_LicenseIsNull() throws Exception {
-
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- // set resource details
- String resourceName = "CISCO4572";
- String description = "description";
- // Duplicate tags are allowed and should be de-duplicated by the server
- // side
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add(resourceName);
- resourceTags.add(resourceName);
- resourceTags.add(resourceName);
- resourceTags.add("tag2");
- resourceTags.add("tag2");
- String category = ServiceCategoriesEnum.VOIP.getValue();
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
- String vendorName = "Oracle";
- String vendorRelease = "1.5";
- String contactId = "jh0003";
- String icon = "myICON";
-
- ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
- // Adding cost and licenseType
- resourceDetails.setCost("12355.345");
- resourceDetails.setLicenseType("User");
- resourceDetails.setLicenseType("");
- // create resource
- RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
- assertNotNull("check response object is not null after create resource", createResponse);
- assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
- assertEquals("Check response code after create resource", 400, createResponse.getErrorCode().intValue());
- assertEquals("Check response code after create resource", "Bad Request", createResponse.getResponseMessage());
-
- }
-
- @Test
- public void createResourceTest_uri_methods() throws Exception {
-
- // init ADMIN user
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-
- // set resource details
- ResourceReqDetails resourceDetails = createRandomResource();
-
- Config config = Utils.getConfig();
-
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
-
- Gson gson = new Gson();
- String userBodyJson = gson.toJson(resourceDetails);
- log.debug(userBodyJson);
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.CREATE_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort());
-
- RestResponse createResourceResponse2 = http.httpSendByMethod(url, "PUT", userBodyJson, headersMap);
-
- // validate response
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.NOT_ALLOWED.name());
-
- assertNotNull("check response object is not null after create resource", createResourceResponse2);
- assertNotNull("check error code exists in response after create resource",
- createResourceResponse2.getErrorCode());
- assertEquals("Check response code after create resource", errorInfo.getCode(),
- createResourceResponse2.getErrorCode());
-
- List<String> variables = Arrays.asList();
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.NOT_ALLOWED.name(), variables,
- createResourceResponse2.getResponse());
-
- }
-
- private ResourceReqDetails createRandomResource() {
- String resourceName = "CISCO4";
- String description = "description";
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add(resourceName);
- String category = ServiceCategoriesEnum.VOIP.getValue();
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
- String vendorName = "Oracle";
- String vendorRelease = "1.5";
- String contactId = "jh0003";
- String icon = "myICON";
-
- ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
- return resourceDetails;
- }
-
- @Test
- public void createResource_role_tester() throws Exception {
-
- // init TESTER user
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
-
- ResourceReqDetails resourceDetails2 = createRandomResource();
-
- // create resource
- RestResponse restResponse2 = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
-
- // validate response
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESTRICTED_OPERATION.name());
-
- assertNotNull("check response object is not null after create resouce", restResponse2);
- assertNotNull("check error code exists in response after create resource", restResponse2.getErrorCode());
- assertEquals("Check response code after create service", errorInfo.getCode(), restResponse2.getErrorCode());
-
- List<String> variables = Arrays.asList();
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), variables,
- restResponse2.getResponse());
-
- // validate audit
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
- .constructFieldsForAuditValidation(resourceDetails2, resourceVersion);
- String auditAction = "Create";
- expectedResourceAuditJavaObject.setAction(auditAction);
- expectedResourceAuditJavaObject.setModifierUid(UserRoleEnum.TESTER.getUserId());
- expectedResourceAuditJavaObject.setModifierName(UserRoleEnum.TESTER.getUserName());
- expectedResourceAuditJavaObject.setPrevState("");
- expectedResourceAuditJavaObject.setCurrState("");
- expectedResourceAuditJavaObject.setPrevVersion("");
- expectedResourceAuditJavaObject.setCurrVersion("");
- expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
-
- String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
- expectedResourceAuditJavaObject.setDesc(auditDesc);
-
- AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
-
- }
-
- // TODO DE171450(to check)
- @Test
- public void createResource_role_DESIGNER() throws Exception {
-
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- ResourceReqDetails resourceDetails = createRandomResource();
- RestResponse restResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
- // validate response
- assertNotNull("check response object is not null after create resource", restResponse);
- assertNotNull("check error code exists in response after create resource", restResponse.getErrorCode());
- assertEquals(
- "Check response code after create resource, response message is: " + restResponse.getResponseMessage(),
- 201, restResponse.getErrorCode().intValue());
-
- }
-
- @Test
- public void createResource_missing_header() throws Exception {
- // init ADMIN user
-
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-
- ResourceReqDetails resourceDetails = createRandomResource();
-
- // set null in userId header
- sdncModifierDetails.setUserId(null);
-
- // create resource
-
- RestResponse restResponse2 = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
-
- // validate response
-
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_INFORMATION.name());
-
- assertNotNull("check response object is not null after create resouce", restResponse2);
- assertNotNull("check error code exists in response after create resource", restResponse2.getErrorCode());
- assertEquals("Check response code after create service", errorInfo.getCode(), restResponse2.getErrorCode());
-
- List<String> variables = Arrays.asList();
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_INFORMATION.name(), variables,
- restResponse2.getResponse());
-
- // //validate audit
- //
- // ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject =
- // resourceUtils.constructFieldsForAuditValidation(resourceDetails,resourceVersion);
- //
- // String auditAction="Create";
- // expectedResourceAuditJavaObject.setAction(auditAction);
- // expectedResourceAuditJavaObject.setModifierUid("null null");
- // expectedResourceAuditJavaObject.setModifierName("null null");
- // expectedResourceAuditJavaObject.setPrevState("");
- // expectedResourceAuditJavaObject.setCurrState("");
- // expectedResourceAuditJavaObject.setPrevVersion("");
- // expectedResourceAuditJavaObject.setCurrVersion("");
- // expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
- //
- // String auditDesc =
- // AuditValidationUtils.buildAuditDescription(errorInfo, variables);
- // expectedResourceAuditJavaObject.setDesc(auditDesc);
- //
- // AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
- // auditAction);
- // TODO: yshlosberg enable back
-
- }
-
- @Test
- public void createResource_existing_resource() throws Exception {
- // init ADMIN user
-
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-
- // ResourceReqDetails resourceDetails = createRandomResource();
- ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
-
- // create resource
- RestResponse restResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
-
- // validate response
- assertNotNull("check response object is not null after create resource", restResponse);
- assertNotNull("check error code exists in response after create resource", restResponse.getErrorCode());
- assertEquals("Check response code after create resource", 201, restResponse.getErrorCode().intValue());
-
- // set resource details
- ResourceReqDetails resourceDetails2 = ElementFactory.getDefaultResource();
- resourceDetails2.setName(resourceDetails.getName());
-
- // clean ES DB
- DbUtils.cleanAllAudits();
-
- // create resource
- RestResponse restResponse2 = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
-
- // validate response
-
- ErrorInfo errorInfo = ErrorValidationUtils
- .parseErrorConfigYaml(ActionStatus.COMPONENT_NAME_ALREADY_EXIST.name());
-
- assertNotNull("check response object is not null after create resouce", restResponse2);
- assertNotNull("check error code exists in response after create resource", restResponse2.getErrorCode());
- assertEquals("Check response code after create service", errorInfo.getCode(), restResponse2.getErrorCode());
-
- List<String> variables = Arrays.asList("Resource", resourceDetails2.getName());
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_NAME_ALREADY_EXIST.name(), variables,
- restResponse2.getResponse());
-
- // validate audit
-
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
- .constructFieldsForAuditValidation(resourceDetails, resourceVersion);
-
- String auditAction = "Create";
- expectedResourceAuditJavaObject.setAction(auditAction);
- expectedResourceAuditJavaObject.setCurrState("");
- expectedResourceAuditJavaObject.setCurrVersion("");
- expectedResourceAuditJavaObject.setPrevState("");
- expectedResourceAuditJavaObject.setPrevVersion("");
- expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
-
- String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
- expectedResourceAuditJavaObject.setDesc(auditDesc);
-
- AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
-
- }
-
- @Test
- public void createResourceTest_without_category() throws Exception {
-
- // init ADMIN user
-
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- ;
-
- // set resource details
- String resourceName = "CISCO4";
- String description = "description";
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add(resourceName);
- String category = ServiceCategoriesEnum.VOIP.getValue();
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
- String vendorName = "Oracle";
- String vendorRelease = "1.5";
- String contactId = "jh0003";
- String icon = "myICON";
-
- // set resource details
- category = null;
-
- ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
-
- // create resource
-
- RestResponse restResponse2 = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
-
- // validate response
-
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_MISSING_CATEGORY.name());
-
- assertNotNull("check response object is not null after create resouce", restResponse2);
- assertNotNull("check error code exists in response after create resource", restResponse2.getErrorCode());
- assertEquals("Check response code after create service", errorInfo.getCode(), restResponse2.getErrorCode());
-
- List<String> variables = Arrays.asList("Resource");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_CATEGORY.name(), variables,
- restResponse2.getResponse());
-
- // validate audit
-
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
- .constructFieldsForAuditValidation(resourceDetails, resourceVersion);
-
- String auditAction = "Create";
- expectedResourceAuditJavaObject.setAction(auditAction);
- expectedResourceAuditJavaObject.setCurrState("");
- expectedResourceAuditJavaObject.setCurrVersion("");
- expectedResourceAuditJavaObject.setPrevState("");
- expectedResourceAuditJavaObject.setPrevVersion("");
- expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
-
- String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
- expectedResourceAuditJavaObject.setDesc(auditDesc);
-
- AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
-
- }
-
- @Test
- public void createResourceTest_empty_category() throws Exception {
-
- // init ADMIN user
-
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-
- // set resource details
- String resourceName = "CISCO4";
- String description = "description";
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add(resourceName);
- String category = ServiceCategoriesEnum.VOIP.getValue();
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
- String vendorName = "Oracle";
- String vendorRelease = "1.5";
- String contactId = "jh0003";
- String icon = "myICON";
-
- // set resource details
- category = "";
-
- ResourceReqDetails resourceDetails2 = new ResourceReqDetails(resourceName, description, resourceTags, category,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
-
- // create resource
-
- RestResponse restResponse2 = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
-
- // validate response
-
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_MISSING_CATEGORY.name());
-
- assertNotNull("check response object is not null after create resouce", restResponse2);
- assertNotNull("check error code exists in response after create resource", restResponse2.getErrorCode());
- assertEquals("Check response code after create service", errorInfo.getCode(), restResponse2.getErrorCode());
-
- List<String> variables = Arrays.asList("Resource");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_CATEGORY.name(), variables,
- restResponse2.getResponse());
-
- // validate audit
-
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
- .constructFieldsForAuditValidation(resourceDetails2, resourceVersion);
-
- String auditAction = "Create";
- expectedResourceAuditJavaObject.setAction(auditAction);
- expectedResourceAuditJavaObject.setCurrState("");
- expectedResourceAuditJavaObject.setCurrVersion("");
- expectedResourceAuditJavaObject.setPrevState("");
- expectedResourceAuditJavaObject.setPrevVersion("");
- expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
-
- String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
- expectedResourceAuditJavaObject.setDesc(auditDesc);
-
- AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
-
- }
-
- @Test
- public void createResourceTest_without_tags() throws Exception {
-
- // init ADMIN user
-
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- ;
-
- // set resource details
- String resourceName = "CISCO4";
- String description = "description";
- ArrayList<String> resourceTags = new ArrayList<String>();
-
- String category = ServiceCategoriesEnum.VOIP.getValue();
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
- String vendorName = "Oracle";
- String vendorRelease = "1.5";
- String contactId = "jh0003";
- String icon = "myICON";
-
- ResourceReqDetails resourceDetails2 = new ResourceReqDetails(resourceName, description, resourceTags, category,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
-
- // create resource
- RestResponse restResponse2 = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
-
- // validate response
-
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_MISSING_TAGS.name());
-
- assertNotNull("check response object is not null after create resouce", restResponse2);
- assertNotNull("check error code exists in response after create resource", restResponse2.getErrorCode());
- assertEquals("Check response code after create service", errorInfo.getCode(), restResponse2.getErrorCode());
-
- List<String> variables = Arrays.asList();
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_TAGS.name(), variables,
- restResponse2.getResponse());
-
- // validate audit
-
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
- .constructFieldsForAuditValidation(resourceDetails2, resourceVersion);
-
- String auditAction = "Create";
- expectedResourceAuditJavaObject.setAction(auditAction);
- expectedResourceAuditJavaObject.setCurrState("");
- expectedResourceAuditJavaObject.setCurrVersion("");
- expectedResourceAuditJavaObject.setPrevState("");
- expectedResourceAuditJavaObject.setPrevVersion("");
- expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
-
- String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
- expectedResourceAuditJavaObject.setDesc(auditDesc);
-
- AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
-
- }
-
- // TODO DE171450(to check)
- @Test
- public void createResourceTest_with_multiple_tags() throws Exception {
-
- // init ADMIN user
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-
- // // set resource details
- // String resourceName = "CISCO4";
- // String description = "description";
- // ArrayList<String> resourceTags = new ArrayList<String>();
- // resourceTags.add(resourceName);
- // resourceTags.add("tag2");
- // String category = ResourceServiceCategoriesEnum.VOIP.getValue();
- // ArrayList<String> derivedFrom = new ArrayList<String>();
- // derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
- // String vendorName = "Oracle";
- // String vendorRelease = "1.5";
- // String icon = "myICON";
- ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
- resourceDetails.setTags(Arrays.asList(resourceDetails.getName(), "tag2"));
-
- // create resource
- RestResponse restResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
-
- // validate response
- assertNotNull("check response object is not null after create resource", restResponse);
- assertNotNull("check error code exists in response after create resource", restResponse.getErrorCode());
- assertEquals("Check response code after create resource", 201, restResponse.getErrorCode().intValue());
-
- }
-
- @Test
- public void createResourceTest_empty_tag() throws Exception {
-
- // init ADMIN user
-
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-
- // set resource details
- String resourceName = "CISCO4";
- String description = "description";
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add("");
- String category = ServiceCategoriesEnum.VOIP.getValue();
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
- String vendorName = "Oracle";
- String vendorRelease = "1.5";
- String contactId = "jh0003";
- String icon = "myICON";
-
- ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
-
- // create resource
- RestResponse restResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
-
- // validate response
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_FIELD_FORMAT.name());
-
- assertNotNull("check response object is not null after create resouce", restResponse);
- assertNotNull("check error code exists in response after create resource", restResponse.getErrorCode());
- assertEquals("Check response code after create resource", errorInfo.getCode(), restResponse.getErrorCode());
-
- List<String> variables = Arrays.asList("Resource", "tag");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_FIELD_FORMAT.name(), variables,
- restResponse.getResponse());
-
- // validate audit
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
- .constructFieldsForAuditValidation(resourceDetails, resourceVersion);
-
- String auditAction = "Create";
- expectedResourceAuditJavaObject.setAction(auditAction);
- expectedResourceAuditJavaObject.setPrevState("");
- expectedResourceAuditJavaObject.setPrevVersion("");
- expectedResourceAuditJavaObject.setCurrState("");
- expectedResourceAuditJavaObject.setCurrVersion("");
- expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
-
- String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
- expectedResourceAuditJavaObject.setDesc(auditDesc);
-
- AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
-
- }
-
- @Test
- public void createResourceTest_with_empty_vendorName() throws Exception {
- // init ADMIN user
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-
- // set resource details
- String resourceName = "CISCO4";
- String description = "description";
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add(resourceName);
- String category = ServiceCategoriesEnum.VOIP.getValue();
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
- String vendorName = "Oracle";
- String vendorRelease = "1.5";
- String contactId = "jh0003";
- String icon = "myICON";
-
- // set resource details
- vendorName = "";
-
- ResourceReqDetails resourceDetails2 = new ResourceReqDetails(resourceName, description, resourceTags, category,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
-
- // create resource
- RestResponse restResponse2 = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
-
- // validate response
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_VENDOR_NAME.name());
-
- assertNotNull("check response object is not null after create resouce", restResponse2);
- assertNotNull("check error code exists in response after create resource", restResponse2.getErrorCode());
- assertEquals("Check response code after create service", errorInfo.getCode(), restResponse2.getErrorCode());
-
- List<String> variables = Arrays.asList();
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_VENDOR_NAME.name(), variables,
- restResponse2.getResponse());
-
- // validate audit
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
- .constructFieldsForAuditValidation(resourceDetails2, resourceVersion);
- String auditAction = "Create";
- expectedResourceAuditJavaObject.setAction(auditAction);
- expectedResourceAuditJavaObject.setPrevState("");
- expectedResourceAuditJavaObject.setPrevVersion("");
- expectedResourceAuditJavaObject.setCurrState("");
- expectedResourceAuditJavaObject.setCurrVersion("");
- expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
-
- String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
- expectedResourceAuditJavaObject.setDesc(auditDesc);
-
- AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
-
- }
-
- @Test
- public void createResourceTest_without_vendorName() throws Exception {
- // init ADMIN user
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-
- // set resource details
- String resourceName = "CISCO4";
- String description = "description";
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add(resourceName);
- String category = ServiceCategoriesEnum.VOIP.getValue();
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
- String vendorName = "Oracle";
- String vendorRelease = "1.5";
- String contactId = "jh0003";
- String icon = "myICON";
-
- // set resource details
- vendorName = null;
-
- ResourceReqDetails resourceDetails2 = new ResourceReqDetails(resourceName, description, resourceTags, category,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
-
- // create resource
-
- RestResponse restResponse2 = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
-
- // validate response
- assertNotNull("check response object is not null after create resource", restResponse2);
- assertNotNull("check error code exists in response after create resource", restResponse2.getErrorCode());
- assertEquals("Check response code after create resource", 400, restResponse2.getErrorCode().intValue());
-
- List<String> variables = Arrays.asList();
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_VENDOR_NAME.name(), variables,
- restResponse2.getResponse());
-
- }
-
- @Test
- public void createResourceTest_with_empty_vendorRelease() throws Exception {
- // init ADMIN user
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-
- // set resource details
- String resourceName = "CISCO4";
- String description = "description";
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add(resourceName);
- String category = ServiceCategoriesEnum.VOIP.getValue();
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add("root");
- String vendorName = "Oracle";
- String vendorRelease = "1.5";
- String contactId = "jh0003";
- String icon = "myICON";
-
- // set resource details
- vendorRelease = "";
-
- ResourceReqDetails resourceDetails2 = new ResourceReqDetails(resourceName, description, resourceTags, category,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
-
- // create resource
-
- RestResponse restResponse2 = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
-
- // validate response
-
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_VENDOR_RELEASE.name());
-
- assertNotNull("check response object is not null after create resouce", restResponse2);
- assertNotNull("check error code exists in response after create resource", restResponse2.getErrorCode());
- assertEquals("Check response code after create service", errorInfo.getCode(), restResponse2.getErrorCode());
-
- List<String> variables = Arrays.asList();
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_VENDOR_RELEASE.name(), variables,
- restResponse2.getResponse());
-
- // validate audit
-
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
- .constructFieldsForAuditValidation(resourceDetails2, resourceVersion);
-
- String auditAction = "Create";
- expectedResourceAuditJavaObject.setAction(auditAction);
- expectedResourceAuditJavaObject.setPrevState("");
- expectedResourceAuditJavaObject.setPrevVersion("");
- expectedResourceAuditJavaObject.setCurrState("");
- expectedResourceAuditJavaObject.setCurrVersion("");
- expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
-
- String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
- expectedResourceAuditJavaObject.setDesc(auditDesc);
-
- AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
-
- }
-
- @Test
- public void createResourceTest_without_vendorRelease() throws Exception {
- // init ADMIN user
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-
- // set resource details
- String resourceName = "CISCO4";
- String description = "description";
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add(resourceName);
- String category = ServiceCategoriesEnum.VOIP.getValue();
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
- String vendorName = "Oracle";
- String vendorRelease = "1.5";
- String contactId = "jh0003";
- String icon = "myICON";
-
- // set resource details
- vendorRelease = null;
-
- ResourceReqDetails resourceDetails2 = new ResourceReqDetails(resourceName, description, resourceTags, category,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
-
- // create resource
-
- RestResponse restResponse2 = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
-
- // validate response
-
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_VENDOR_RELEASE.name());
-
- assertNotNull("check response object is not null after create resouce", restResponse2);
- assertNotNull("check error code exists in response after create resource", restResponse2.getErrorCode());
- assertEquals("Check response code after create service", errorInfo.getCode(), restResponse2.getErrorCode());
-
- List<String> variables = Arrays.asList();
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_VENDOR_RELEASE.name(), variables,
- restResponse2.getResponse());
-
- // validate audit
-
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
- .constructFieldsForAuditValidation(resourceDetails2, resourceVersion);
-
- String auditAction = "Create";
- expectedResourceAuditJavaObject.setAction(auditAction);
- expectedResourceAuditJavaObject.setPrevState("");
- expectedResourceAuditJavaObject.setPrevVersion("");
- expectedResourceAuditJavaObject.setCurrState("");
- expectedResourceAuditJavaObject.setCurrVersion("");
- expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
-
- String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
- expectedResourceAuditJavaObject.setDesc(auditDesc);
-
- AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
-
- }
-
- @Test
- public void createResourceTest_with_empty_contactId() throws Exception {
- // init ADMIN user
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-
- // set resource details
- String resourceName = "CISCO4";
- String description = "description";
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add(resourceName);
- String category = ServiceCategoriesEnum.VOIP.getValue();
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
- String vendorName = "Oracle";
- String vendorRelease = "1.5";
- String contactId = "jh0003";
- String icon = "myICON";
-
- // set resource details
- contactId = "";
-
- ResourceReqDetails resourceDetails2 = new ResourceReqDetails(resourceName, description, resourceTags, category,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
-
- // create resource
-
- RestResponse restResponse2 = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
-
- // validate response
-
- ErrorInfo errorInfo = ErrorValidationUtils
- .parseErrorConfigYaml(ActionStatus.COMPONENT_MISSING_CONTACT.name());
-
- assertNotNull("check response object is not null after create resouce", restResponse2);
- assertNotNull("check error code exists in response after create resource", restResponse2.getErrorCode());
- assertEquals("Check response code after create service", errorInfo.getCode(), restResponse2.getErrorCode());
-
- List<String> variables = Arrays.asList("Resource");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_CONTACT.name(), variables,
- restResponse2.getResponse());
-
- // validate audit
-
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
- .constructFieldsForAuditValidation(resourceDetails2, resourceVersion);
-
- String auditAction = "Create";
- expectedResourceAuditJavaObject.setAction(auditAction);
- expectedResourceAuditJavaObject.setPrevState("");
- expectedResourceAuditJavaObject.setPrevVersion("");
- expectedResourceAuditJavaObject.setCurrState("");
- expectedResourceAuditJavaObject.setCurrVersion("");
- expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
-
- String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
- expectedResourceAuditJavaObject.setDesc(auditDesc);
-
- AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
-
- }
-
- @Test
- public void createResourceTest_without_contactId() throws Exception {
- // init ADMIN user
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-
- // set resource details
- String resourceName = "CISCO4";
- String description = "description";
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add(resourceName);
- String category = ServiceCategoriesEnum.VOIP.getValue();
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
- String vendorName = "Oracle";
- String vendorRelease = "1.5";
- String contactId = "jh0003";
- String icon = "myICON";
-
- // set resource details
- contactId = null;
-
- ResourceReqDetails resourceDetails2 = new ResourceReqDetails(resourceName, description, resourceTags, category,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
-
- // create resource
-
- RestResponse restResponse2 = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
-
- // validate response
-
- ErrorInfo errorInfo = ErrorValidationUtils
- .parseErrorConfigYaml(ActionStatus.COMPONENT_MISSING_CONTACT.name());
-
- assertNotNull("check response object is not null after create resouce", restResponse2);
- assertNotNull("check error code exists in response after create resource", restResponse2.getErrorCode());
- assertEquals("Check response code after create service", errorInfo.getCode(), restResponse2.getErrorCode());
-
- List<String> variables = Arrays.asList("Resource");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_CONTACT.name(), variables,
- restResponse2.getResponse());
-
- // validate audit
-
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
- .constructFieldsForAuditValidation(resourceDetails2, resourceVersion);
-
- String auditAction = "Create";
- expectedResourceAuditJavaObject.setAction(auditAction);
- expectedResourceAuditJavaObject.setPrevState("");
- expectedResourceAuditJavaObject.setPrevVersion("");
- expectedResourceAuditJavaObject.setCurrState("");
- expectedResourceAuditJavaObject.setCurrVersion("");
- expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
-
- String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
- expectedResourceAuditJavaObject.setDesc(auditDesc);
-
- AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
-
- }
-
- @Test
- public void createResourceTest_with_empty_icon() throws Exception {
- // init ADMIN user
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-
- // set resource details
- String resourceName = "CISCO4";
- String description = "description";
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add(resourceName);
- String category = ServiceCategoriesEnum.VOIP.getValue();
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
- String vendorName = "Oracle";
- String vendorRelease = "1.5";
- String contactId = "jh0003";
- String icon = "myICON";
-
- // set resource details
- icon = "";
-
- ResourceReqDetails resourceDetails2 = new ResourceReqDetails(resourceName, description, resourceTags, category,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
-
- // create resource
-
- RestResponse restResponse2 = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
-
- // validate response
-
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_MISSING_ICON.name());
-
- assertNotNull("check response object is not null after create resouce", restResponse2);
- assertNotNull("check error code exists in response after create resource", restResponse2.getErrorCode());
- assertEquals("Check response code after create service", errorInfo.getCode(), restResponse2.getErrorCode());
-
- List<String> variables = Arrays.asList("Resource");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_ICON.name(), variables,
- restResponse2.getResponse());
-
- // validate audit
-
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
- .constructFieldsForAuditValidation(resourceDetails2, resourceVersion);
-
- String auditAction = "Create";
- expectedResourceAuditJavaObject.setAction(auditAction);
- expectedResourceAuditJavaObject.setPrevState("");
- expectedResourceAuditJavaObject.setPrevVersion("");
- expectedResourceAuditJavaObject.setCurrState("");
- expectedResourceAuditJavaObject.setCurrVersion("");
- expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
-
- String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
- expectedResourceAuditJavaObject.setDesc(auditDesc);
-
- AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
-
- }
-
- @Test
- public void createResourceTest_without_icon() throws Exception {
- // init ADMIN user
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-
- // set resource details
- String resourceName = "CISCO4";
- String description = "description";
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add(resourceName);
- String category = ServiceCategoriesEnum.VOIP.getValue();
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
- String vendorName = "Oracle";
- String vendorRelease = "1.5";
- String contactId = "jh0003";
- String icon = "myICON";
-
- // set resource details
- icon = null;
-
- ResourceReqDetails resourceDetails2 = new ResourceReqDetails(resourceName, description, resourceTags, category,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
-
- // create resource
-
- RestResponse restResponse2 = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
-
- // validate response
-
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_MISSING_ICON.name());
-
- assertNotNull("check response object is not null after create resouce", restResponse2);
- assertNotNull("check error code exists in response after create resource", restResponse2.getErrorCode());
- assertEquals("Check response code after create service", errorInfo.getCode(), restResponse2.getErrorCode());
-
- List<String> variables = Arrays.asList("Resource");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_ICON.name(), variables,
- restResponse2.getResponse());
-
- // validate audit
-
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
- .constructFieldsForAuditValidation(resourceDetails2, resourceVersion);
-
- String auditAction = "Create";
- expectedResourceAuditJavaObject.setAction(auditAction);
- expectedResourceAuditJavaObject.setPrevState("");
- expectedResourceAuditJavaObject.setPrevVersion("");
- expectedResourceAuditJavaObject.setCurrState("");
- expectedResourceAuditJavaObject.setCurrVersion("");
- expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
-
- String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
- expectedResourceAuditJavaObject.setDesc(auditDesc);
-
- AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
-
- }
-
- @Test
- public void createResourceTest_with_empty_description() throws Exception {
- // init ADMIN user
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-
- // set resource details
- String resourceName = "CISCO4";
- String description = "description";
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add(resourceName);
- String category = ServiceCategoriesEnum.VOIP.getValue();
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
- String vendorName = "Oracle";
- String vendorRelease = "1.5";
- String contactId = "jh0003";
- String icon = "myICON";
-
- // set resource details
- description = "";
-
- ResourceReqDetails resourceDetails2 = new ResourceReqDetails(resourceName, description, resourceTags, category,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
-
- // create resource
-
- RestResponse restResponse2 = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
-
- // validate response
-
- ErrorInfo errorInfo = ErrorValidationUtils
- .parseErrorConfigYaml(ActionStatus.COMPONENT_MISSING_DESCRIPTION.name());
-
- assertNotNull("check response object is not null after create resouce", restResponse2);
- assertNotNull("check error code exists in response after create resource", restResponse2.getErrorCode());
- assertEquals("Check response code after create service", errorInfo.getCode(), restResponse2.getErrorCode());
-
- List<String> variables = Arrays.asList("Resource");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_DESCRIPTION.name(), variables,
- restResponse2.getResponse());
-
- // validate audit
-
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
- .constructFieldsForAuditValidation(resourceDetails2, resourceVersion);
-
- String auditAction = "Create";
- expectedResourceAuditJavaObject.setAction(auditAction);
- expectedResourceAuditJavaObject.setPrevState("");
- expectedResourceAuditJavaObject.setPrevVersion("");
- expectedResourceAuditJavaObject.setCurrState("");
- expectedResourceAuditJavaObject.setCurrVersion("");
- expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
-
- String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
- expectedResourceAuditJavaObject.setDesc(auditDesc);
-
- AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
-
- }
-
- @Test
- public void createResourceTest_without_description() throws Exception {
- // init ADMIN user
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-
- // set resource details
- String resourceName = "CISCO4";
- String description = "description";
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add(resourceName);
- String category = ServiceCategoriesEnum.VOIP.getValue();
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
- String vendorName = "Oracle";
- String vendorRelease = "1.5";
- String contactId = "jh0003";
- String icon = "myICON";
-
- // set resource details
- description = null;
-
- ResourceReqDetails resourceDetails2 = new ResourceReqDetails(resourceName, description, resourceTags, category,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
-
- // create resource
-
- RestResponse restResponse2 = ResourceRestUtils.createResource(resourceDetails2, sdncModifierDetails);
-
- // validate response
-
- ErrorInfo errorInfo = ErrorValidationUtils
- .parseErrorConfigYaml(ActionStatus.COMPONENT_MISSING_DESCRIPTION.name());
-
- assertNotNull("check response object is not null after create resouce", restResponse2);
- assertNotNull("check error code exists in response after create resource", restResponse2.getErrorCode());
- assertEquals("Check response code after create service", errorInfo.getCode(), restResponse2.getErrorCode());
-
- List<String> variables = Arrays.asList("Resource");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_DESCRIPTION.name(), variables,
- restResponse2.getResponse());
-
- // validate audit
-
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
- .constructFieldsForAuditValidation(resourceDetails2, resourceVersion);
-
- String auditAction = "Create";
- expectedResourceAuditJavaObject.setAction(auditAction);
- expectedResourceAuditJavaObject.setPrevState("");
- expectedResourceAuditJavaObject.setPrevVersion("");
- expectedResourceAuditJavaObject.setCurrState("");
- expectedResourceAuditJavaObject.setCurrVersion("");
- expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
-
- String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
- expectedResourceAuditJavaObject.setDesc(auditDesc);
-
- AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
-
- }
-
- @Test
- public void createAndGetResourceByNameAndVersion() throws Exception {
-
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- ResourceReqDetails resourceDetailsComp = ElementFactory.getDefaultResource("testresourceComp",
- NormativeTypesEnum.COMPUTE, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, sdncModifierDetails.getUserId());
-
- // create resource
- RestResponse createResponse = ResourceRestUtils.createResource(resourceDetailsComp, sdncModifierDetails);
- // validate response
- assertEquals("Check response code after create resource", 201, createResponse.getErrorCode().intValue());
-
- String resourceVersion = "0.1";
- ResourceRespJavaObject resourceRespJavaObject = Convertor.constructFieldsForRespValidation(resourceDetailsComp,
- resourceVersion);
- resourceRespJavaObject.setLifecycleState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
- resourceRespJavaObject.setAbstractt("false");
- ResourceValidationUtils.validateResp(createResponse, resourceRespJavaObject);
-
- // validate get response
- RestResponse resourceGetResponse = ResourceRestUtils.getResourceByNameAndVersion(
- sdncModifierDetails.getUserId(), resourceDetailsComp.getName(), resourceDetailsComp.getVersion());
- assertEquals("Check response code after delete resource", 200, resourceGetResponse.getErrorCode().intValue());
- // Resource resource =
- // ResourceRestUtils.parseResourceFromListResp(resourceGetResponse);
- ResourceValidationUtils.validateResp(resourceGetResponse, resourceRespJavaObject);
- // resourceDetailsComp.setUniqueId(resource.getUniqueId());
-
- }
-
- @Test
- public void createResourceResourceTypeNotExistsTest() throws Exception {
-
- // init ADMIN user
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-
- ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
- String resourceType = "NOT EXISTS";
- resourceDetails.setResourceType(resourceType);
- // create resource
- RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
-
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_CONTENT.name());
-
- assertNotNull("check response object is not null after create resouce", createResponse);
- assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
- assertEquals("Check response code after create service", errorInfo.getCode(), createResponse.getErrorCode());
-
- List<String> variables = new ArrayList<>();
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_CONTENT.name(), variables,
- createResponse.getResponse());
-
- // validate audit
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = Convertor
- .constructFieldsForAuditValidation(resourceDetails, resourceVersion);
- String auditAction = "Create";
- expectedResourceAuditJavaObject.setAction(auditAction);
- expectedResourceAuditJavaObject.setPrevState("");
- expectedResourceAuditJavaObject.setPrevVersion("");
- expectedResourceAuditJavaObject.setCurrState("");
- expectedResourceAuditJavaObject.setCurrVersion("");
- expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
-
- String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
- expectedResourceAuditJavaObject.setDesc(auditDesc);
- AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject, auditAction, null, false);
- }
-
- @Test
- public void createResourceResourceTypeEmptyTest() throws Exception {
-
- // init ADMIN user
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-
- ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
- // String resourceType = "";
- // resourceDetails.setResourceType(resourceType);
- // create resource
- RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
-
- // ErrorInfo errorInfo =
- // ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_CONTENT.name());
- //
- // assertNotNull("check response object is not null after create
- // resouce", createResponse);
- // assertNotNull("check error code exists in response after create
- // resource", createResponse.getErrorCode());
- // assertEquals("Check response code after create service",
- // errorInfo.getCode(), createResponse.getErrorCode());
- //
- // List<String> variables = new ArrayList<>();
- // ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_CONTENT.name(),
- // variables, createResponse.getResponse());
- //
- // // validate audit
- // ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject =
- // Convertor.constructFieldsForAuditValidation(resourceDetails,
- // resourceVersion);
- // String auditAction = "Create";
- // expectedResourceAuditJavaObject.setAction(auditAction);
- // expectedResourceAuditJavaObject.setPrevState("");
- // expectedResourceAuditJavaObject.setPrevVersion("");
- // expectedResourceAuditJavaObject.setCurrState("");
- // expectedResourceAuditJavaObject.setCurrVersion("");
- // expectedResourceAuditJavaObject.setResourceName("");
- // expectedResourceAuditJavaObject.setModifierUid(ElementFactory.getDefaultUser(UserRoleEnum.ADMIN).getUserId());
- // expectedResourceAuditJavaObject.setModifierName(ElementFactory.getDefaultUser(UserRoleEnum.ADMIN).getFullName());
- // expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
- //
- // String auditDesc =
- // AuditValidationUtils.buildAuditDescription(errorInfo, variables);
- // expectedResourceAuditJavaObject.setDesc(auditDesc);
- // AuditValidationUtils.validateAudit(expectedResourceAuditJavaObject,
- // auditAction, null, false);
- }
-
- @Test
- public void checkInvariantUuidIsImmutable() throws Exception {
- // choose the user to create resource
- User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
- String invariantUuidDefinedByUser = "!!!!!!!!!!!!!!!!!!!!!!!!";
- resourceDetails.setInvariantUUID(invariantUuidDefinedByUser);
- String resourceName = resourceDetails.getName();
- resourceDetails.setTags(Arrays.asList(resourceName, resourceName, resourceName, resourceName, "tag2", "tag2"));
- // create resource
- RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, sdncUserDetails);
- BaseRestUtils.checkStatusCode(createResponse, "create request failed", false, 201);
- // validate response
- assertNotNull("check response object is not null after create resource", createResponse);
- assertNotNull("check error code exists in response after create resource", createResponse.getErrorCode());
- assertEquals("Check response code after create resource", 201, createResponse.getErrorCode().intValue());
-
- Resource resourceCreation = ResponseParser.convertResourceResponseToJavaObject(createResponse.getResponse());
- String invariantUUIDcreation = resourceCreation.getInvariantUUID();
- // validate response
- ResourceRespJavaObject resourceRespJavaObject = Convertor.constructFieldsForRespValidation(resourceDetails,
- resourceVersion);
- resourceRespJavaObject.setLifecycleState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
- resourceRespJavaObject.setAbstractt("false");
- ResourceValidationUtils.validateResp(createResponse, resourceRespJavaObject);
-
- // validate get response
- RestResponse resourceGetResponse = ResourceRestUtils.getResource(sdncUserDetails,
- resourceDetails.getUniqueId());
- BaseRestUtils.checkSuccess(resourceGetResponse);
- Resource resourceGetting = ResponseParser
- .convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
- ResourceValidationUtils.validateResp(resourceGetResponse, resourceRespJavaObject);
- String invariantUUIDgetting = resourceGetting.getInvariantUUID();
- assertEquals(invariantUUIDcreation, invariantUUIDgetting);
-
- // Update resource with new invariant UUID
- RestResponse restResponseUpdate = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncUserDetails,
- resourceDetails.getUniqueId());
- BaseRestUtils.checkSuccess(restResponseUpdate);
- Resource updatedResource = ResponseParser.convertResourceResponseToJavaObject(restResponseUpdate.getResponse());
- String invariantUUIDupdating = updatedResource.getInvariantUUID();
- assertEquals(invariantUUIDcreation, invariantUUIDupdating);
-
- // Do checkin
- RestResponse restResponseCheckin = LifecycleRestUtils.changeResourceState(resourceDetails, sdncUserDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
- BaseRestUtils.checkSuccess(restResponseCheckin);
- Resource checkinResource = ResponseParser
- .convertResourceResponseToJavaObject(restResponseCheckin.getResponse());
- String invariantUUIDcheckin = checkinResource.getInvariantUUID();
- String version = checkinResource.getVersion();
- assertEquals(invariantUUIDcreation, invariantUUIDcheckin);
- assertEquals(version, "0.1");
-
- // Do checkout
- RestResponse restResponseCheckout = LifecycleRestUtils.changeResourceState(resourceDetails, sdncUserDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
- BaseRestUtils.checkSuccess(restResponseCheckout);
- Resource ResourceResource = ResponseParser
- .convertResourceResponseToJavaObject(restResponseCheckout.getResponse());
- String invariantUUIDcheckout = ResourceResource.getInvariantUUID();
- version = ResourceResource.getVersion();
- assertEquals(invariantUUIDcreation, invariantUUIDcheckout);
- assertEquals(version, "0.2");
-
- /*// do certification request
- RestResponse restResponseCertificationRequest = LifecycleRestUtils.changeResourceState(resourceDetails,
- sdncUserDetails, resourceDetails.getVersion(), LifeCycleStatesEnum.CERTIFICATIONREQUEST);
- BaseRestUtils.checkSuccess(restResponseCertificationRequest);
- Resource certificationRequestResource = ResponseParser
- .convertResourceResponseToJavaObject(restResponseCertificationRequest.getResponse());
- String invariantUUIDcertificationRequest = certificationRequestResource.getInvariantUUID();
- version = certificationRequestResource.getVersion();
- assertEquals(invariantUUIDcreation, invariantUUIDcertificationRequest);
- assertEquals(version, "0.2");
-
- // start certification
- RestResponse restResponseStartCertification = LifecycleRestUtils.changeResourceState(resourceDetails,
- sdncUserDetails, resourceDetails.getVersion(), LifeCycleStatesEnum.STARTCERTIFICATION);
- BaseRestUtils.checkSuccess(restResponseStartCertification);
- Resource startCertificationRequestResource = ResponseParser
- .convertResourceResponseToJavaObject(restResponseStartCertification.getResponse());
- String invariantUUIDStartCertification = startCertificationRequestResource.getInvariantUUID();
- version = startCertificationRequestResource.getVersion();
- assertEquals(invariantUUIDcreation, invariantUUIDStartCertification);
- assertEquals(version, "0.2");*/
-
- // certify
- RestResponse restResponseCertify = LifecycleRestUtils.changeResourceState(resourceDetails, sdncUserDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CERTIFY);
- BaseRestUtils.checkSuccess(restResponseCertify);
- Resource certifyResource = ResponseParser
- .convertResourceResponseToJavaObject(restResponseCertify.getResponse());
- String invariantUUIDcertify = certifyResource.getInvariantUUID();
- version = certifyResource.getVersion();
- assertEquals(invariantUUIDcreation, invariantUUIDcertify);
- assertEquals(version, "1.0");
-
- }
-
- // US672129 BENNY
-
- private void getResourceValidateInvariantUuid(String resourceUniqueId, String invariantUUIDcreation)
- throws Exception {
- RestResponse getResource = ResourceRestUtils.getResource(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- resourceUniqueId);
- BaseRestUtils.checkSuccess(getResource);
- Resource resource = ResponseParser.parseToObjectUsingMapper(getResource.getResponse(), Resource.class);
- assertEquals(invariantUUIDcreation, resource.getInvariantUUID());
- }
-
- @Test
- public void resourceInvariantUuid() throws Exception {
-
- User designerUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- User testerUser = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
- ResourceReqDetails resourceDetails = ElementFactory.getDefaultResourceByType("VF200", NormativeTypesEnum.ROOT,
- ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, designerUser.getUserId(), ResourceTypeEnum.VF.toString());
- ServiceReqDetails serviceDetails = ElementFactory.getDefaultService("newtestservice1",
- ServiceCategoriesEnum.MOBILITY, designerUser.getUserId(),
- ServiceInstantiationType.A_LA_CARTE.getValue());
-
- // ResourceReqDetails resourceDetails =
- // ElementFactory.getDefaultResource();
- resourceDetails.setInvariantUUID("kokomoko");
- RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, designerUser);
- assertEquals("Check response code after create resource", BaseRestUtils.STATUS_CODE_CREATED,
- createResponse.getErrorCode().intValue());
- Resource resource = ResponseParser.parseToObjectUsingMapper(createResponse.getResponse(), Resource.class);
- String invariantUUIDcreation = resource.getInvariantUUID(); // generated
- // when the
- // component
- // is
- // created
- // and never
- // changed
- // get resource and verify InvariantUuid is not changed
- getResourceValidateInvariantUuid(resource.getUniqueId(), invariantUUIDcreation);
-
- // Update resource with new invariant UUID
- resourceDetails.setInvariantUUID("1234567890");
- RestResponse updateResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, designerUser,
- resourceDetails.getUniqueId());
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS,
- updateResponse.getErrorCode().intValue());
- getResourceValidateInvariantUuid(resource.getUniqueId(), invariantUUIDcreation);
-
- // checkIn resource
- RestResponse restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, designerUser,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
- assertEquals(invariantUUIDcreation, ResponseParser.getInvariantUuid(restResponse));
- getResourceValidateInvariantUuid(resource.getUniqueId(), invariantUUIDcreation);
-
- // checkIn resource
- restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, designerUser,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
- assertEquals(invariantUUIDcreation, ResponseParser.getInvariantUuid(restResponse));
- getResourceValidateInvariantUuid(resource.getUniqueId(), invariantUUIDcreation);
- /*// certification request
- restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, designerUser,
- LifeCycleStatesEnum.CERTIFICATIONREQUEST);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
- assertEquals(invariantUUIDcreation, ResponseParser.getInvariantUuid(restResponse));
- getResourceValidateInvariantUuid(resource.getUniqueId(), invariantUUIDcreation);
- // start certification
- restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, testerUser,
- LifeCycleStatesEnum.STARTCERTIFICATION);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
- assertEquals(invariantUUIDcreation, ResponseParser.getInvariantUuid(restResponse));
- getResourceValidateInvariantUuid(resource.getUniqueId(), invariantUUIDcreation);*/
- // certify
- restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, designerUser, LifeCycleStatesEnum.CERTIFY);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
- assertEquals(invariantUUIDcreation, ResponseParser.getInvariantUuid(restResponse));
- getResourceValidateInvariantUuid(resource.getUniqueId(), invariantUUIDcreation);
- // update resource
- restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, designerUser,
- LifeCycleStatesEnum.CHECKOUT);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
- resourceDetails.setDescription("updatedDescription");
- resourceDetails.setVendorRelease("1.2.3.4");
- updateResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, designerUser,
- resourceDetails.getUniqueId());
- assertEquals(BaseRestUtils.STATUS_CODE_SUCCESS, updateResponse.getErrorCode().intValue());
- getResourceValidateInvariantUuid(resourceDetails.getUniqueId(), invariantUUIDcreation);
-
- /*// certification request
- restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, designerUser,
- LifeCycleStatesEnum.CERTIFICATIONREQUEST);
- assertEquals(BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
- getResourceValidateInvariantUuid(resourceDetails.getUniqueId(), invariantUUIDcreation);*/
-
- // checkout resource
- restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, designerUser,
- LifeCycleStatesEnum.CHECKOUT);
- assertEquals(BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
- getResourceValidateInvariantUuid(resourceDetails.getUniqueId(), invariantUUIDcreation);
-
- /*// certification request
- restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, designerUser,
- LifeCycleStatesEnum.CERTIFICATIONREQUEST);
- assertEquals(BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
- getResourceValidateInvariantUuid(resourceDetails.getUniqueId(), invariantUUIDcreation);
- // start certification
- restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, testerUser,
- LifeCycleStatesEnum.STARTCERTIFICATION);
- assertEquals(STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
- getResourceValidateInvariantUuid(resourceDetails.getUniqueId(), invariantUUIDcreation);
-
- // cancel certification
- restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, testerUser,
- LifeCycleStatesEnum.CANCELCERTIFICATION);
- assertEquals(STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
- getResourceValidateInvariantUuid(resourceDetails.getUniqueId(), invariantUUIDcreation);
-
- // start certification
- restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, testerUser,
- LifeCycleStatesEnum.STARTCERTIFICATION);
- assertEquals(STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
- getResourceValidateInvariantUuid(resourceDetails.getUniqueId(), invariantUUIDcreation);
-
- // failure
- restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, testerUser,
- LifeCycleStatesEnum.FAILCERTIFICATION);
- assertEquals(STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
- getResourceValidateInvariantUuid(resourceDetails.getUniqueId(), invariantUUIDcreation);*/
-
- // upload artifact
- restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, designerUser,
- LifeCycleStatesEnum.CHECKOUT);
- ArtifactReqDetails artifactDetails = ElementFactory.getDefaultArtifact();
- ArtifactRestUtils.addInformationalArtifactToResource(artifactDetails, designerUser,
- resourceDetails.getUniqueId());
- assertEquals(STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
- getResourceValidateInvariantUuid(resourceDetails.getUniqueId(), invariantUUIDcreation);
-
- // checkIn resource
- restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, designerUser,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_SUCCESS, restResponse.getErrorCode().intValue());
- // create instance
- RestResponse createServiceResponse = ServiceRestUtils.createService(serviceDetails, designerUser);
- ResourceRestUtils.checkCreateResponse(createServiceResponse);
- ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory
- .getComponentResourceInstance(resourceDetails);
- RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
- resourceInstanceReqDetails, designerUser, serviceDetails.getUniqueId(), ComponentTypeEnum.SERVICE);
- assertEquals("Check response code ", BaseRestUtils.STATUS_CODE_CREATED,
- createResourceInstanceResponse.getErrorCode().intValue());
- getResourceValidateInvariantUuid(resourceDetails.getUniqueId(), invariantUUIDcreation);
-
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/GetAllResourceVersions.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/GetAllResourceVersions.java
deleted file mode 100644
index 1b58c4e235..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/GetAllResourceVersions.java
+++ /dev/null
@@ -1,580 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.resource;
-
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
-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.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.DbUtils;
-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.rest.ResourceRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.AssertJUnit;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertTrue;
-
-public class GetAllResourceVersions extends ComponentBaseTest {
-
- private static Logger logger = LoggerFactory.getLogger(GetAllResourceVersions.class.getName());
- protected User designerDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- protected User adminModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-
- protected ResourceReqDetails resourceDetails;
-
- public static TestName name = new TestName();
-
- public GetAllResourceVersions() {
- super(name, GetAllResourceVersions.class.getName());
-
- }
-
- //// NEW
-
- protected void deleteAllVersionOfResource() throws Exception {
- RestResponse response = null;
-
- String[] versions = { "0.1", "0.2", "0.3", "0.4", "0.5", "0.6", "1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "2.0",
- "2.1", "2.2", "2.3", "2.4", "2.5", "3.0", "4.0", "4.1" };
-
- for (String version : versions) {
-
- response = ResourceRestUtils.deleteResourceByNameAndVersion(designerDetails,
- resourceDetails.getName().toUpperCase(), version);
- AssertJUnit.assertTrue("delete request returned status:" + response.getErrorCode(),
- response.getErrorCode() == 204 || response.getErrorCode() == 404);
-
- response = ResourceRestUtils.deleteResourceByNameAndVersion(designerDetails, resourceDetails.getName(),
- version);
- AssertJUnit.assertTrue("delete request returned status:" + response.getErrorCode(),
- response.getErrorCode() == 204 || response.getErrorCode() == 404);
-
- }
- }
-
- @BeforeMethod
- public void init() throws Exception {
- resourceDetails = defineResourse();
- deleteAllVersionOfResource();
-
- }
-
- @AfterMethod
- public void endOfTests() throws Exception {
- deleteAllVersionOfResource();
- }
-
- protected ResourceReqDetails defineResourse() {
- String resourceName = "cisco4";
- String description = "description";
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add(resourceName);
- // String category = ServiceCategoriesEnum.MOBILITY.getValue();
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add("tosca.nodes.Root");
- String vendorName = "Oracle";
- String vendorRelease = "1.5";
- String contactId = "jh0003";
- String icon = "myICON";
-
- ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, null,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
- resourceDetails.addCategoryChain(ResourceCategoryEnum.GENERIC_INFRASTRUCTURE.getCategory(),
- ResourceCategoryEnum.GENERIC_INFRASTRUCTURE.getSubCategory());
-
- return resourceDetails;
- }
-
- @Test
- public void getResourceAllVersions_version15() throws Exception {
- // create resource
- Map<String, String> origVersionsMap = new HashMap<String, String>();
- RestResponse restResponse = createResource(designerDetails, resourceDetails);
- AssertJUnit.assertTrue("create request returned status:" + restResponse.getErrorCode(),
- restResponse.getErrorCode() == 201);
- String resourceName = resourceDetails.getName();
- // resourceUtils.addResourceMandatoryArtifacts(designerDetails,
- // restResponse);
-
- // change resource version to 0.5
- RestResponse checkoutResource;
- for (int x = 0; x < 4; x++) {
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
- AssertJUnit.assertEquals("Check response code after checkout resource", 200,
- checkoutResource.getErrorCode().intValue());
-
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
- AssertJUnit.assertEquals("Check response code after checkout resource", 200,
- checkoutResource.getErrorCode().intValue());
- }
-
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
- AssertJUnit.assertEquals("Check response code after checkout resource", 200,
- checkoutResource.getErrorCode().intValue());
- /*checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CERTIFICATIONREQUEST);
- AssertJUnit.assertEquals("Check response code after checkout resource", 200,
- checkoutResource.getErrorCode().intValue());
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.STARTCERTIFICATION);
- AssertJUnit.assertEquals("Check response code after checkout resource", 200,
- checkoutResource.getErrorCode().intValue());*/
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CERTIFY);
- AssertJUnit.assertEquals("Check response code after checkout resource", 200,
- checkoutResource.getErrorCode().intValue());
- origVersionsMap.put(resourceDetails.getVersion(), resourceDetails.getUniqueId());
- // change resource version to 1.5
- for (int x = 0; x < 5; x++) {
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
- origVersionsMap.put(resourceDetails.getVersion(), resourceDetails.getUniqueId());
- AssertJUnit.assertEquals("Check response code after checkout resource", 200,
- checkoutResource.getErrorCode().intValue());
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
- AssertJUnit.assertEquals("Check response code after checkout resource", 200,
- checkoutResource.getErrorCode().intValue());
- }
-
- // validate get response
- RestResponse resourceGetResponse = ResourceRestUtils.getResource(designerDetails,
- resourceDetails.getUniqueId());
- Resource res = ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
- Map<String, String> getVersionsMap = res.getAllVersions();
- AssertJUnit.assertTrue(origVersionsMap.equals(getVersionsMap));
-
- }
-
- protected RestResponse createResource(User sdncModifierDetails, ResourceReqDetails resourceDetails)
- throws Exception {
- // clean ES DB
- DbUtils.cleanAllAudits();
-
- // create resource
- RestResponse restResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
-
- // validate response
- AssertJUnit.assertNotNull("check response object is not null after create resource", restResponse);
- AssertJUnit.assertNotNull("check error code exists in response after create resource",
- restResponse.getErrorCode());
- AssertJUnit.assertEquals("Check response code after create resource", 201,
- restResponse.getErrorCode().intValue());
-
- return restResponse;
- }
-
- @Test
- public void getResourceAllVersions_version05() throws Exception {
-
- // create resource
- RestResponse restResponse = createResource(designerDetails, resourceDetails);
- Map<String, String> origVersionsMap = new HashMap<String, String>();
- origVersionsMap.put(resourceDetails.getVersion(), resourceDetails.getUniqueId());
- // resourceUtils.addResourceMandatoryArtifacts(designerDetails,
- // restResponse);
- // change resource version to 0.5
- RestResponse checkoutResource;
-
- logger.debug("Changing resource life cycle ");
- for (int x = 0; x < 4; x++) {
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkout resource", 200,
- checkoutResource.getErrorCode().intValue());
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
- assertEquals("Check response code after checkout resource", 200,
- checkoutResource.getErrorCode().intValue());
- origVersionsMap.put(resourceDetails.getVersion(), resourceDetails.getUniqueId());
- }
- // validate get response
- RestResponse resourceGetResponse = ResourceRestUtils.getResource(designerDetails,
- resourceDetails.getUniqueId());
- Resource res = ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
- Map<String, String> getVersionsMap = res.getAllVersions();
- assertTrue(origVersionsMap.equals(getVersionsMap));
-
- }
-
- @Test
- public void getResourceAllVersions_version01() throws Exception {
- // create resource
- RestResponse restResponse = createResource(designerDetails, resourceDetails);
- String resourceName = resourceDetails.getName();
-
- Map<String, String> origVersionsMap = new HashMap<String, String>();
- origVersionsMap.put(resourceDetails.getVersion(), resourceDetails.getUniqueId());
-
- // resourceUtils.addResourceMandatoryArtifacts(designerDetails,
- // restResponse);
-
- // validate get response
- RestResponse resourceGetResponse = ResourceRestUtils.getResource(designerDetails,
- resourceDetails.getUniqueId());
- Resource res = ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
- Map<String, String> getVersionsMap = res.getAllVersions();
- assertTrue(origVersionsMap.equals(getVersionsMap));
-
- }
-
- @Test
- public void getResourceAllVersions_version25() throws Exception {
-
- Map<String, String> origVersionsMap = new HashMap<String, String>();
-
- // create resource
- RestResponse restResponse = createResource(designerDetails, resourceDetails);
- assertTrue("create request returned status:" + restResponse.getErrorCode(), restResponse.getErrorCode() == 201);
- String resourceName = resourceDetails.getName();
- // resourceUtils.addResourceMandatoryArtifacts(designerDetails,
- // restResponse);
-
- // change resource version to 0.5
- RestResponse checkoutResource;
- for (int x = 0; x < 4; x++) {
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkout resource", 200,
- checkoutResource.getErrorCode().intValue());
-
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
- assertEquals("Check response code after checkout resource", 200,
- checkoutResource.getErrorCode().intValue());
- }
-
- // resource version 1.0
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-/* checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CERTIFICATIONREQUEST);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.STARTCERTIFICATION);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());*/
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CERTIFY);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
- origVersionsMap.put(resourceDetails.getVersion(), resourceDetails.getUniqueId());
-
- // change resource version to 1.5
- for (int x = 0; x < 5; x++) {
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
- assertEquals("Check response code after checkout resource", 200,
- checkoutResource.getErrorCode().intValue());
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkout resource", 200,
- checkoutResource.getErrorCode().intValue());
- }
-
- // resource version 2.0
-/* checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CERTIFICATIONREQUEST);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.STARTCERTIFICATION);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());*/
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CERTIFY);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
- origVersionsMap.put(resourceDetails.getVersion(), resourceDetails.getUniqueId());
-
- // change resource version to 2.5
- for (int x = 0; x < 5; x++) {
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
- assertEquals("Check response code after checkout resource", 200,
- checkoutResource.getErrorCode().intValue());
- origVersionsMap.put(resourceDetails.getVersion(), resourceDetails.getUniqueId());
-
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkout resource", 200,
- checkoutResource.getErrorCode().intValue());
- }
-
- // validate get response
- RestResponse resourceGetResponse = ResourceRestUtils.getResource(designerDetails,
- resourceDetails.getUniqueId());
- Resource res = ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
- Map<String, String> getVersionsMap = res.getAllVersions();
- assertTrue(origVersionsMap.equals(getVersionsMap));
-
- }
-
- @Test
- public void getResourceAllVersions_ReadyForCertification_version05() throws Exception {
- Map<String, String> origVersionsMap = new HashMap<String, String>();
- // create resource
- RestResponse restResponse = createResource(designerDetails, resourceDetails);
- assertTrue("create request returned status:" + restResponse.getErrorCode(), restResponse.getErrorCode() == 201);
- origVersionsMap.put(resourceDetails.getVersion(), resourceDetails.getUniqueId());
- String resourceName = resourceDetails.getName();
- // resourceUtils.addResourceMandatoryArtifacts(designerDetails,
- // restResponse);
-
- // change resource version to 0.5
- RestResponse checkoutResource;
- for (int x = 0; x < 4; x++) {
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkout resource", 200,
- checkoutResource.getErrorCode().intValue());
-
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
- assertEquals("Check response code after checkout resource", 200,
- checkoutResource.getErrorCode().intValue());
- origVersionsMap.put(resourceDetails.getVersion(), resourceDetails.getUniqueId());
- }
-
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
- /*checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CERTIFICATIONREQUEST);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());*/
-
- // validate get response
- RestResponse resourceGetResponse = ResourceRestUtils.getResource(designerDetails,
- resourceDetails.getUniqueId());
- Resource res = ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
- Map<String, String> getVersionsMap = res.getAllVersions();
- assertTrue(origVersionsMap.equals(getVersionsMap));
-
- }
-
- @Test
- public void getResourceAllVersions_CertifactionInProgress_version05() throws Exception {
- Map<String, String> origVersionsMap = new HashMap<>();
- // create resource
- RestResponse restResponse = createResource(designerDetails, resourceDetails);
- assertTrue("create request returned status:" + restResponse.getErrorCode(), restResponse.getErrorCode() == 201);
- origVersionsMap.put(resourceDetails.getVersion(), resourceDetails.getUniqueId());
-
- String resourceName = resourceDetails.getName();
- // resourceUtils.addResourceMandatoryArtifacts(designerDetails,
- // restResponse);
-
- // change resource version to 0.5
- RestResponse checkoutResource;
- for (int x = 0; x < 4; x++) {
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkout resource", 200,
- checkoutResource.getErrorCode().intValue());
-
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
- assertEquals("Check response code after checkout resource", 200,
- checkoutResource.getErrorCode().intValue());
- origVersionsMap.put(resourceDetails.getVersion(), resourceDetails.getUniqueId());
- }
-
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-/* checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CERTIFICATIONREQUEST);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.STARTCERTIFICATION);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());*/
-
- // validate get response
- RestResponse resourceGetResponse = ResourceRestUtils.getResource(designerDetails,
- resourceDetails.getUniqueId());
- Resource res = ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
- Map<String, String> getVersionsMap = res.getAllVersions();
- assertTrue(origVersionsMap.equals(getVersionsMap));
-
- }
-
- @Test
- public void getResourceAllVersions_Certified_version10() throws Exception {
-
- Map<String, String> origVersionsMap = new HashMap<String, String>();
-
- // create resource
- RestResponse restResponse = createResource(designerDetails, resourceDetails);
- assertTrue("create request returned status:" + restResponse.getErrorCode(), restResponse.getErrorCode() == 201);
- String resourceName = resourceDetails.getName();
- // resourceUtils.addResourceMandatoryArtifacts(designerDetails,
- // restResponse);
-
- // change resource version to 0.5
- RestResponse checkoutResource;
- for (int x = 0; x < 4; x++) {
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkout resource", 200,
- checkoutResource.getErrorCode().intValue());
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
- assertEquals("Check response code after checkout resource", 200,
- checkoutResource.getErrorCode().intValue());
-
- }
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-/* checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CERTIFICATIONREQUEST);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.STARTCERTIFICATION);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());*/
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CERTIFY);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
- origVersionsMap.put(resourceDetails.getVersion(), resourceDetails.getUniqueId());
- // validate get response
- RestResponse resourceGetResponse = ResourceRestUtils.getResource(designerDetails,
- resourceDetails.getUniqueId());
- Resource res = ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
- Map<String, String> getVersionsMap = res.getAllVersions();
- assertTrue(origVersionsMap.equals(getVersionsMap));
-
- }
-
- @Test
- public void getResourceAllVersions_Certified_version20() throws Exception {
-
- Map<String, String> origVersionsMap = new HashMap<String, String>();
-
- // create resource
- RestResponse restResponse = createResource(designerDetails, resourceDetails);
- assertTrue("create request returned status:" + restResponse.getErrorCode(), restResponse.getErrorCode() == 201);
- String resourceName = resourceDetails.getName();
- // resourceUtils.addResourceMandatoryArtifacts(designerDetails,
- // restResponse);
-
- // change resource version to 0.5
- RestResponse checkoutResource;
- for (int x = 0; x < 4; x++) {
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkout resource", 200,
- checkoutResource.getErrorCode().intValue());
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
- assertEquals("Check response code after checkout resource", 200,
- checkoutResource.getErrorCode().intValue());
- }
-
- // get to version 1.0
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-/* checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CERTIFICATIONREQUEST);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.STARTCERTIFICATION);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());*/
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CERTIFY);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
- origVersionsMap.put(resourceDetails.getVersion(), resourceDetails.getUniqueId());
-
- // change resource version to 1.5
- for (int x = 0; x < 4; x++) {
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
- assertEquals("Check response code after checkout resource", 200,
- checkoutResource.getErrorCode().intValue());
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, designerDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkout resource", 200,
- checkoutResource.getErrorCode().intValue());
- }
-
- // get to version 1.0
-/* checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CERTIFICATIONREQUEST);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.STARTCERTIFICATION);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());*/
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CERTIFY);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
- origVersionsMap.put(resourceDetails.getVersion(), resourceDetails.getUniqueId());
-
- // validate get response
- RestResponse resourceGetResponse = ResourceRestUtils.getResource(designerDetails,
- resourceDetails.getUniqueId());
- Resource res = ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
- Map<String, String> getVersionsMap = res.getAllVersions();
- assertTrue(origVersionsMap.equals(getVersionsMap));
-
- }
-
- @Test
- public void getResourceAllVersions_ResourceNotFound() throws Exception {
-
- RestResponse resourceGetResponse = ResourceRestUtils.getResource(designerDetails, "123456789");
- assertEquals("Check response code after checkout resource", 404, resourceGetResponse.getErrorCode().intValue());
-
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/ResourceApiTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/ResourceApiTest.java
deleted file mode 100644
index 1b50e7f1c2..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/ResourceApiTest.java
+++ /dev/null
@@ -1,368 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.resource;
-
-import com.google.gson.Gson;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClients;
-import org.apache.http.util.EntityUtils;
-import org.json.simple.JSONArray;
-import org.json.simple.JSONObject;
-import org.json.simple.JSONValue;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.CatalogRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.openecomp.sdc.ci.tests.utils.validation.ResourceValidationUtils;
-import org.testng.annotations.Test;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-
-import static org.testng.AssertJUnit.*;
-
-public class ResourceApiTest extends ComponentBaseTest {
-
- protected final String contentTypeHeaderData = "application/json";
- protected final String acceptHeaderDate = "application/json";
-
- @Rule
- public static TestName name = new TestName();
-
- public ResourceApiTest() {
- super(name, ResourceApiTest.class.getName());
- }
-
- // Keep
- @Test
- public void updateResourceMetadataSuccess() throws Exception {
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- sdncModifierDetails.setUserId("jh0003");
- RestResponse restResponse = createResourceForUpdate(sdncModifierDetails);
- Resource resourceRespJavaObject = ResponseParser
- .convertResourceResponseToJavaObject(restResponse.getResponse());
-
- Config config = Utils.getConfig();
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
-
- // set resource details
- ResourceReqDetails resourceDetails = new ResourceReqDetails();
- resourceDetails.setDescription("updatedDescription");
- ArrayList<String> resourceTags = new ArrayList<String>();
- // Duplicate tags are allowed and should be de-duplicated by the server
- // side
- resourceTags.add(resourceRespJavaObject.getName());
- resourceTags.add("tag1");
- resourceTags.add("tag1");
- resourceTags.add("tag2");
- resourceTags.add("tag2");
- resourceDetails.setTags(resourceTags);
- resourceDetails.addCategoryChain(ResourceCategoryEnum.NETWORK_L2_3_ROUTERS.getCategory(),
- ResourceCategoryEnum.NETWORK_L2_3_ROUTERS.getSubCategory());
- resourceDetails.setVendorName("OracleUp");
- resourceDetails.setVendorRelease("1.5Up");
- resourceDetails.setContactId("pe1116");
-
- resourceDetails.setIcon(resourceRespJavaObject.getIcon());
- resourceDetails.setName(resourceRespJavaObject.getName());
- resourceDetails.setDerivedFrom(resourceRespJavaObject.getDerivedFrom());
-
- // ResourceReqDetails resourceDetails = new
- // ResourceReqDetails(resourceName, description, resourceTags, category,
- // derivedFrom, vendorName, vendorRelease, contactId, null);
-
- Gson gson = new Gson();
- String userBodyJson = gson.toJson(resourceDetails);
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.UPDATE_RESOURCE_METADATA, config.getCatalogBeHost(), config.getCatalogBePort(),
- resourceRespJavaObject.getUniqueId());
- RestResponse updateResourceResponse = http.httpSendByMethod(url, "PUT", userBodyJson, headersMap);
-
- // resourceDetails.setResourceName(resourceRespJavaObject.getResourceName());
- ResourceValidationUtils.validateResourceReqVsResp(resourceDetails,
- ResponseParser.convertResourceResponseToJavaObject(updateResourceResponse.getResponse()));
-
- // Delete resource
- deleteResource(resourceRespJavaObject.getUniqueId(), sdncModifierDetails.getUserId());
-
- }
-
- protected void deleteResource(String resourceUniqueId, String httpCspUserId) throws Exception {
- RestResponse res = ResourceRestUtils.deleteResource(resourceUniqueId, httpCspUserId);
-
- // System.out.println("Delete resource was finished with response: " +
- // res.getErrorCode());
- }
-
- protected RestResponse createResourceForUpdate(User sdncModifierDetails) throws Exception {
-
- ResourceReqDetails resourceDetails = getResourceObj();
-
- // create resource
- return ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
-
- }
-
- public ResourceReqDetails getResourceObj() {
- // set resource details
- String resourceName = "ResourceForUpdate" + (int) (Math.random() * 100);
- String description = "description";
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add(resourceName);
- // String category = ResourceCategoriesEnum.MOBILITY.getValue();
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add("tosca.nodes.Root");
- String vendorName = "Oracle";
- String vendorRelease = "1.5";
- String contactId = "pe1116";
- String icon = "myICON";
-
- ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, null,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
- resourceDetails.addCategoryChain(ResourceCategoryEnum.GENERIC_INFRASTRUCTURE.getCategory(),
- ResourceCategoryEnum.GENERIC_INFRASTRUCTURE.getSubCategory());
- return resourceDetails;
- }
-
- // -------------------------------------------------------------------
-
- protected ResourceReqDetails defineResourse_Benny(int n) {
- String resourceName = "cisco" + String.valueOf(n);
- String description = "description";
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add("tag1");
- String category = ServiceCategoriesEnum.MOBILITY.getValue();
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add("tosca.nodes.Root");
- String vendorName = "Oracle";
- String vendorRelease = "1.5";
- String contactId = "jh0003";
- String icon = "borderElement";
-
- ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
-
- return resourceDetails;
- }
-
- @Test
- public void getAllAbstractResources() throws Exception {
- RestResponse abstractResources = CatalogRestUtils.getAbstractResources();
-
- int status = abstractResources.getErrorCode();
- assertTrue(status == 200);
- String json = abstractResources.getResponse();
- JSONArray array = (JSONArray) JSONValue.parse(json);
- for (Object o : array) {
- JSONObject value = (JSONObject) o;
- Boolean element = (Boolean) value.get("abstract");
- assertTrue(element);
- }
-
- }
-
- @Test
- public void getAllNotAbstractResources() throws Exception {
- CloseableHttpClient httpclient = HttpClients.createDefault();
- try {
- String url = String.format(Urls.GET_ALL_NOT_ABSTRACT_RESOURCES, config.getCatalogBeHost(),
- config.getCatalogBePort());
- HttpGet httpget = new HttpGet(url);
-
- httpget.addHeader(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
-
- httpget.addHeader(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
-
- httpget.addHeader(HttpHeaderEnum.USER_ID.getValue(),
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER).getUserId());
-
- // System.out.println("Executing request " +
- // httpget.getRequestLine());
- CloseableHttpResponse response = httpclient.execute(httpget);
- int status = response.getStatusLine().getStatusCode();
- assertTrue(status == 200);
- try {
- String json = EntityUtils.toString(response.getEntity());
- JSONArray array = (JSONArray) JSONValue.parse(json);
- for (Object o : array) {
- JSONObject value = (JSONObject) o;
- Boolean element = (Boolean) value.get("abstract");
- assertTrue(!element);
- }
-
- } finally {
- response.close();
- }
- } finally {
- httpclient.close();
- }
- }
-
- @Test
- public void updateResourceMetadata_methodNotAllowed() throws Exception {
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- Config config = Utils.getConfig();
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
-
- // set resource details
- String resourceName = "ResForUpdate";
- String description = "updatedDescription";
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add("tag1");
- resourceTags.add("tag2");
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add("tosca.nodes.root");
- String category = ServiceCategoriesEnum.VOIP.getValue();
- String vendorName = "OracleUp";
- String vendorRelease = "1.5Up";
- String contactId = "pe1117";
- String icon = "myICON.jpgUp";
-
- ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
-
- Gson gson = new Gson();
- String userBodyJson = gson.toJson(resourceDetails);
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.UPDATE_RESOURCE_METADATA, config.getCatalogBeHost(), config.getCatalogBePort(),
- "NotExistsId");
-
- RestResponse updateResourceResponse = http.httpSendByMethod(url, "POST", userBodyJson, headersMap);
-
- assertNotNull("Check error code exists in response after wrong update resource",
- updateResourceResponse.getErrorCode());
- assertEquals("Check error code after update resource", 405, updateResourceResponse.getErrorCode().intValue());
- }
-
- @Test
- public void validateResourceNameTest() throws Exception {
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- sdncModifierDetails.setUserId("jh0003");
-
- ResourceReqDetails resourceDetails = getResourceObj();
-
- // create resource
- RestResponse restResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
- Resource resourceRespJavaObject = ResponseParser
- .convertResourceResponseToJavaObject(restResponse.getResponse());
- CloseableHttpClient httpclient = HttpClients.createDefault();
- try {
-
- // check invalid
- String url = String.format(Urls.VALIDATE_RESOURCE_NAME, config.getCatalogBeHost(),
- config.getCatalogBePort(), resourceDetails.getName());
-
- HttpGet httpget = new HttpGet(url);
-
- httpget.addHeader(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
-
- httpget.addHeader(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
-
- httpget.addHeader(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
-
- // System.out.println("Executing request " +
- // httpget.getRequestLine());
- CloseableHttpResponse response = httpclient.execute(httpget);
- int status = response.getStatusLine().getStatusCode();
- assertTrue(status == 200);
- try {
- String json = EntityUtils.toString(response.getEntity());
- JSONObject object = (JSONObject) JSONValue.parse(json);
- Boolean element = (Boolean) object.get("isValid");
- assertTrue(!element);
-
- } finally {
- response.close();
- }
- // check valid
- url = String.format(Urls.VALIDATE_RESOURCE_NAME, config.getCatalogBeHost(), config.getCatalogBePort(),
- resourceDetails.getName() + "temp");
-
- httpget = new HttpGet(url);
-
- httpget.addHeader(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
-
- httpget.addHeader(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
-
- httpget.addHeader(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
-
- // System.out.println("Executing request " +
- // httpget.getRequestLine());
- response = httpclient.execute(httpget);
- status = response.getStatusLine().getStatusCode();
- assertTrue(status == 200);
- try {
- String json = EntityUtils.toString(response.getEntity());
- JSONObject object = (JSONObject) JSONValue.parse(json);
- Boolean element = (Boolean) object.get("isValid");
- assertTrue(element);
-
- } finally {
- response.close();
- }
- } finally {
- httpclient.close();
- }
-
- // Delete resource
- ResourceRestUtils.deleteResource(resourceDetails, sdncModifierDetails, "0.1");
-
- }
-
- // -------------------------------------------------------------------
- // //Benny Tal
- // @Test
- // public void createResource_Benny() throws Exception {
- // for (int i = 0; i < 100; i++) {
- // ResourceReqDetails resourceDetails = defineResourse_Benny(i);
- //
- // ResourceRestUtils.createResource(resourceDetails,
- // UserUtils.getDesignerDetails());
- // // resourceUtils.deleteResource(resourceDetails,
- // UserUtils.getDesignerDetails(), "0.1");
- // }
- // }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/SampleDataProvider.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/SampleDataProvider.java
deleted file mode 100644
index 8b8c6533cb..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/SampleDataProvider.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.resource;
-
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
-import org.testng.ITestContext;
-import org.testng.annotations.DataProvider;
-
-import java.io.IOException;
-
-public class SampleDataProvider {
-
- @DataProvider
- public static Object[][] getResourceByType(ITestContext context) throws IOException, Exception {
- return new Object[][] {
- { AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true) },
- { AtomicOperationUtils.createResourceByType(ResourceTypeEnum.CP, UserRoleEnum.DESIGNER, true) },
- { AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VL, UserRoleEnum.DESIGNER, true) } };
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/SimultaneousApiTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/SimultaneousApiTest.java
deleted file mode 100644
index df72d355be..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/SimultaneousApiTest.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.resource;
-
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.testng.annotations.Test;
-
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-public class SimultaneousApiTest extends ComponentBaseTest {
-
- protected static ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource();
-
- @Rule
- public static TestName name = new TestName();
-
- static String httpCspUserId = "km2000";
- static String userFirstName = "Kot";
- static String userLastName = "Matroskin";
- static String email = "km2000@intl.sdc.com";
- static String role = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN).getRole();
-
- public SimultaneousApiTest() {
- super(name, SimultaneousApiTest.class.getName());
-
- }
-
- public static class WorkerThread implements Runnable {
- CountDownLatch countDownLatch;
- int threadIndex;
-
- public WorkerThread(int threadIndex, CountDownLatch countDownLatch) {
- this.threadIndex = threadIndex;
- this.countDownLatch = countDownLatch;
- }
-
- @Override
- public void run() {
- System.out.println("**** Thread started " + threadIndex);
- try {
- RestResponse createResource = ResourceRestUtils.createResource(resourceDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- String id = ResponseParser.getUniqueIdFromResponse(createResource);
- // System.out.println("**** Thread " + threadIndex + " create
- // resource status " + createResource.getErrorCode() + " id = "
- // + id + " error " + createResource.getResponse());
- // assertEquals("**** create resource: " +
- // createResource.getErrorCode() + " thread " + threadIndex,
- // 201, status);
- } catch (Exception e) {
- // System.out.println("**** Thread " + threadIndex + " exception
- // " + e);
- }
- countDownLatch.countDown();
- // System.out.println("**** Thread finished " + threadIndex);
-
- }
-
- // public void run_() {
- // System.out.println("**** Thread started " + threadIndex);
- // try {
- // UserUtils userUtils = new UserUtils();
- // User userDetails = new User(userFirstName, userLastName,
- // httpCspUserId, email, role , 0L);
- // RestResponse response =
- // userUtils.createUserTowardsCatalogBe(userDetails,
- // userUtils.getUserDetailesAdmin());
- // System.out.println("**** Thread " + threadIndex + " create resource
- // status " + response.getErrorCode() + " response " +
- // response.getResponse());
- //// assertEquals("**** create resource: " +
- // createResource.getErrorCode() + " thread " + threadIndex, 201,
- // status);
- // } catch (Exception e) {
- // System.out.println("**** Thread " + threadIndex + " exception " + e);
- // }
- // countDownLatch.countDown();
- // System.out.println("**** Thread finished " + threadIndex);
- //
- // }
- }
-
- @Test
- public void create2Resources() throws InterruptedException {
- int threadCount = 5;
- CountDownLatch countDownLatch = new CountDownLatch(threadCount);
- ExecutorService executor = Executors.newFixedThreadPool(threadCount);
- for (int i = 0; i < threadCount; i++) {
- Runnable worker = new WorkerThread(i + 1, countDownLatch);
- executor.execute(worker);
- }
- countDownLatch.await();
- // System.out.println(" finished ");
-
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/UpdateResourceMetadataTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/UpdateResourceMetadataTest.java
deleted file mode 100644
index 7b959d8ddf..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/UpdateResourceMetadataTest.java
+++ /dev/null
@@ -1,2635 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.resource;
-
-import com.google.gson.Gson;
-import org.json.JSONException;
-import org.json.JSONObject;
-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.LifecycleStateEnum;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.*;
-import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedResourceAuditJavaObject;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.DbUtils;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
-import org.openecomp.sdc.ci.tests.utils.validation.ResourceValidationUtils;
-import org.openecomp.sdc.common.util.ValidationUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.AssertJUnit;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.io.FileNotFoundException;
-import java.util.*;
-
-import static org.testng.AssertJUnit.*;
-
-public class UpdateResourceMetadataTest extends ComponentBaseTest {
- private static Logger logger = LoggerFactory.getLogger(UpdateResourceMetadataTest.class.getName());
- protected List<String> Empty_List = new ArrayList<String>();
- protected String extendedChars;
-
- protected final String contentTypeHeaderData = "application/json";
- protected final String acceptHeaderDate = "application/json";
- protected final String CHARSET_ISO_8859 = "charset=ISO-8859-1";
-
- public static TestName name = new TestName();
- protected User sdncModifierDetails;
- protected ResourceReqDetails resourceDetails;
-
- public UpdateResourceMetadataTest() {
- super(name, UpdateResourceMetadataTest.class.getName());
-
- }
-
- public String extendedCharsStringBuilder() throws Exception {
- char[] extendedCharsArray = new char[128];
- char ch = 128;
- for (int i = 0; i < extendedCharsArray.length - 1; i++) {
- extendedCharsArray[i] = ch;
- ch++;
- }
- extendedChars = new String(extendedCharsArray);
- return extendedChars;
-
- }
-
- @BeforeMethod
- public void setup() throws Exception {
- sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- resourceDetails = defineResourse();
-
- }
-
- // Keep
- @Test
- public void UpdateDerivedFromSuccess() throws Exception {
-
- String oldDerivedFromName = NormativeTypesEnum.ROOT.getNormativeName();
- String newDerivedFromName = NormativeTypesEnum.SOFTWARE_COMPONENT.getNormativeName();
-
- // Getting both derived from resources for validation
- /*
- * RestResponse resourceByNameAndVersion =
- * resourceUtils.getResourceByNameAndVersion(sdncModifierDetails,
- * oldDerivedFromName, "1.0");
- * assertEquals("Check response code after get database normative", 200,
- * resourceByNameAndVersion.getErrorCode().intValue()); Resource
- * databaseNormative =
- * resourceUtils.parseResourceResp(resourceByNameAndVersion);
- *
- * resourceByNameAndVersion =
- * resourceUtils.getResourceByNameAndVersion(sdncModifierDetails,
- * newDerivedFromName, "1.0");
- * assertEquals("Check response code after get database normative", 200,
- * resourceByNameAndVersion.getErrorCode().intValue()); Resource
- * lbNormative =
- * resourceUtils.parseResourceResp(resourceByNameAndVersion);
- */
-
- // Derived from set to Database
- List<String> derivedFrom = new ArrayList<>();
- derivedFrom.add(oldDerivedFromName);
- resourceDetails.setDerivedFrom(derivedFrom);
-
- RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
- AssertJUnit.assertEquals("Check response code after create resource", 201,
- restResponse.getErrorCode().intValue());
- Resource currentResource = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
-
- derivedFrom.clear();
- derivedFrom.add(newDerivedFromName);
- RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails,
- sdncModifierDetails, currentResource.getUniqueId(), "");
- AssertJUnit.assertEquals("Check response code after create resource", 200,
- updatedRestResponse.getErrorCode().intValue());
-
- }
-
- protected ResourceReqDetails defineUpdateResourceWithNonUpdatableFields(Resource resourceBeforeUpdate) {
- ResourceReqDetails updatedResourceDetails = defineUpdatedResourse(resourceBeforeUpdate.getName());
-
- updatedResourceDetails.setVersion("mumu");
- updatedResourceDetails.setIsAbstract(true);
- updatedResourceDetails.setIsHighestVersion(true);
- updatedResourceDetails.setCreatorUserId("df4444");
- updatedResourceDetails.setCreatorFullName("John Doe");
- updatedResourceDetails.setLastUpdaterUserId("gf5646");
- updatedResourceDetails.setLastUpdaterFullName("Viktor Tzoy");
- updatedResourceDetails.setCreationDate(new Long(4444));
- updatedResourceDetails.setLastUpdateDate(new Long("534535"));
- updatedResourceDetails.setLifecycleState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN);
- updatedResourceDetails.setCost("6.1");
- updatedResourceDetails.setLicenseType("Installation");
- updatedResourceDetails.setUUID("dfsfsdf");
- return updatedResourceDetails;
- }
-
- public void UpdateResourceNotFoundTest() throws Exception {
- // init ADMIN user
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-
- String resourceName = "cisco4";
- // update resource
- String description = "updatedDescription";
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add("tag2");
- String category = ServiceCategoriesEnum.MOBILITY.getValue();
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
- String vendorName = "newOracle";
- String vendorRelease = "2.5";
- String contactId = "jh0003";
- String icon = "myICON";
-
- ResourceReqDetails updatedResourceDetails = new ResourceReqDetails(resourceName, description, resourceTags,
- category, derivedFrom, vendorName, vendorRelease, contactId, icon);
- updatedResourceDetails.setUniqueId("dummyId");
- RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails,
- sdncModifierDetails, "0.1");
-
- // validate response
- AssertJUnit.assertNotNull("check response object is not null after update resource", updatedRestResponse);
- AssertJUnit.assertNotNull("check error code exists in response after update resource",
- updatedRestResponse.getErrorCode());
- AssertJUnit.assertEquals("Check response code after update resource", 404,
- updatedRestResponse.getErrorCode().intValue());
- // String resourceId =
- // UniqueIdBuilder.buildResourceUniqueId(resourceName, "0.1");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESOURCE_NOT_FOUND.name(), Arrays.asList("dummyId"),
- updatedRestResponse.getResponse());
-
- resourceName = "";
- // resourceId = UniqueIdBuilder.buildResourceUniqueId(resourceName,
- // "0.1");
- updatedResourceDetails = defineUpdatedResourse(resourceName);
- updatedResourceDetails.setUniqueId("dummyId");
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails, sdncModifierDetails,
- "0.1");
- AssertJUnit.assertNotNull("check response object is not null after update resource", updatedRestResponse);
- AssertJUnit.assertNotNull("check error code exists in response after update resource",
- updatedRestResponse.getErrorCode());
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESOURCE_NOT_FOUND.name(), Arrays.asList("dummyId"),
- updatedRestResponse.getResponse());
-
- }
-
- public char[] getInValidChars() throws Exception {
-
- char[] extendedCharsArray = new char[59];
- char ch = 1;
- for (int i = 0; i < 44; i++) {
- extendedCharsArray[i] = ch;
- ch++;
- }
- ch = 58;
- for (int i = 44; i < 51; i++) {
- extendedCharsArray[i] = ch;
- ch++;
- }
- ch = 91;
- for (int i = 51; i < 55; i++) {
- extendedCharsArray[i] = ch;
- ch++;
- }
- ch = 123;
- for (int i = 55; i < 59; i++) {
- extendedCharsArray[i] = ch;
- ch++;
- }
- return extendedCharsArray;
- }
-
- public char[] getTagInValidFormatChars() throws Exception {
- // Tag format is the same as defined for "Resource Name" :
- // Allowed characters: Alphanumeric (a-zA-Z0-9), space (' '), underscore
- // ('_'), dash ('-'), dot ('.')
- char[] notValidCharsArray = new char[30];
- char ch = 33;
- for (int i = 0; i < 12; i++) {
- notValidCharsArray[i] = ch;
- ch++;
- }
- notValidCharsArray[13] = 47;
- ch = 58;
- for (int i = 14; i < 21; i++) {
- notValidCharsArray[i] = ch;
- ch++;
- }
- ch = 91;
- for (int i = 21; i < 24; i++) {
- notValidCharsArray[i] = ch;
- ch++;
- }
- notValidCharsArray[24] = 96;
- ch = 123;
- for (int i = 25; i < 30; i++) {
- notValidCharsArray[i] = ch;
- ch++;
- }
- return notValidCharsArray;
- }
-
- public void Validation_UpdateWithIncompleteJsonBodyTest() throws Exception {
- // init ADMIN user
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-
- // define and create resource
- ResourceReqDetails resourceDetails = defineResourse();
- ResourceRestUtils.deleteResourceByNameAndVersion(sdncModifierDetails, resourceDetails.getName(), "0.1");
- ResourceRestUtils.deleteResourceByNameAndVersion(sdncModifierDetails, resourceDetails.getName(), "1.0");
- ResourceRestUtils.deleteResourceByNameAndVersion(sdncModifierDetails, resourceDetails.getName(), "1.1");
-
- RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
- String resourceId = resourceDetails.getUniqueId();
- resourceDetails.setUniqueId(ResponseParser.getUniqueIdFromResponse(restResponse));
-
- // build Json Object
- JSONObject jsonObject = JsonObjectBuilder(resourceDetails);
-
- List<String> resource = new ArrayList<>();
- resource.add("Resource");
-
- // remove Description
- UpdateAndValidateWithIncompletedJsonBody(sdncModifierDetails, jsonObject, resourceId, "description",
- ActionStatus.COMPONENT_MISSING_DESCRIPTION.name(), resource);
- // remove Tags
- UpdateAndValidateWithIncompletedJsonBody(sdncModifierDetails, jsonObject, resourceId, "tags",
- ActionStatus.COMPONENT_MISSING_TAGS.name(), Empty_List);
- // remove Category
- UpdateAndValidateWithIncompletedJsonBody(sdncModifierDetails, jsonObject, resourceId, "category",
- ActionStatus.COMPONENT_MISSING_CATEGORY.name(), resource);
- // remove VendorName
- UpdateAndValidateWithIncompletedJsonBody(sdncModifierDetails, jsonObject, resourceId, "vendorName",
- ActionStatus.MISSING_VENDOR_NAME.name(), Empty_List);
- // remove VendorRelease
- UpdateAndValidateWithIncompletedJsonBody(sdncModifierDetails, jsonObject, resourceId, "vendorRelease",
- ActionStatus.MISSING_VENDOR_RELEASE.name(), Empty_List);
- // remove AT&T Contact
- UpdateAndValidateWithIncompletedJsonBody(sdncModifierDetails, jsonObject, resourceId, "contactId",
- ActionStatus.COMPONENT_MISSING_CONTACT.name(), resource);
-
- // get resource with original name. original metadata should be returned
- RestResponse getRestResponse = ResourceRestUtils.getResource(sdncModifierDetails, "0.1");
- // validate response
- AssertJUnit.assertNotNull("check response object is not null after get resource", getRestResponse);
- AssertJUnit.assertNotNull("check error code exists in response after get resource",
- getRestResponse.getErrorCode());
- AssertJUnit.assertEquals("Check response code after update resource", 200,
- getRestResponse.getErrorCode().intValue());
-
- // parse updated response to javaObject
- Resource getResourceRespJavaObject = ResponseParser
- .convertResourceResponseToJavaObject(getRestResponse.getResponse());
- // validate that metadata was not changed
- ResourceValidationUtils.validateResourceReqVsResp(resourceDetails, getResourceRespJavaObject);
-
- ResourceRestUtils.deleteResourceByNameAndVersion(sdncModifierDetails, resourceDetails.getName(), "0.1");
- ResourceRestUtils.deleteResourceByNameAndVersion(sdncModifierDetails, resourceDetails.getName(), "1.0");
- ResourceRestUtils.deleteResourceByNameAndVersion(sdncModifierDetails, resourceDetails.getName(), "1.1");
- }
-
- // End of validation tests
- // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
- protected ResourceReqDetails defineUpdatedResourse(String resourceName) {
- String description = "updatedDescription";
- ArrayList<String> resourceTags = new ArrayList<String>();
- // Duplicate tags are allowed and should be de-duplicated by server side
- resourceTags.add(resourceName);
- resourceTags.add("tag1");
- resourceTags.add("tag1");
- resourceTags.add("tag2");
- resourceTags.add("tag2");
- String category = ServiceCategoriesEnum.VOIP.getValue();
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());
- String vendorName = "updatedOracle";
- String vendorRelease = "3.5";
- String contactId = "jh0001";
- String icon = "myUpdatedICON";
-
- ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, category,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
- resourceDetails.addCategoryChain(ResourceCategoryEnum.GENERIC_INFRASTRUCTURE.getCategory(),
- ResourceCategoryEnum.GENERIC_INFRASTRUCTURE.getSubCategory());
-
- return resourceDetails;
- }
-
- protected ResourceReqDetails defineResourse() {
- String resourceName = "cisco4";
- String description = "description";
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add(resourceName);
- ArrayList<String> derivedFrom = new ArrayList<String>();
- derivedFrom.add(NormativeTypesEnum.ROOT.getNormativeName());// "tosca.nodes.Root");
- String vendorName = "Oracle";
- String vendorRelease = "1.5";
- String contactId = "jh0003";
- String icon = "objectStorage";
-
- ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, null,
- derivedFrom, vendorName, vendorRelease, contactId, icon);
- resourceDetails.addCategoryChain(ResourceCategoryEnum.GENERIC_INFRASTRUCTURE.getCategory(),
- ResourceCategoryEnum.GENERIC_INFRASTRUCTURE.getSubCategory());
-
- return resourceDetails;
- }
-
- protected RestResponse createResource(User sdncModifierDetails, ResourceReqDetails resourceDetails)
- throws Exception {
- // clean ES DB
- DbUtils.cleanAllAudits();
-
- // create resource
- RestResponse restResponse = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
-
- // validate response
- AssertJUnit.assertNotNull("check response object is not null after create resource", restResponse);
- AssertJUnit.assertNotNull("check error code exists in response after create resource",
- restResponse.getErrorCode());
- AssertJUnit.assertEquals("Check response code after create resource", 201,
- restResponse.getErrorCode().intValue());
-
- return restResponse;
- }
-
- protected RestResponse TryUpdateByAnotherVerb(ResourceReqDetails updatedResourceDetails, User sdncModifierDetails,
- String uri) throws Exception {
- // delete resource
- Config config;
- RestResponse ResourceResponse;
- try {
- config = Utils.getConfig();
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.UPDATE_RESOURCE_METADATA, config.getCatalogBeHost(),
- config.getCatalogBePort(), updatedResourceDetails.getName() + ".0.1");
-
- if (uri == "GET") {
- ResourceResponse = http.httpSendGet(url, headersMap);
- } else if (uri == "POST") {
- Gson gson = new Gson();
- String userBodyJson = gson.toJson(updatedResourceDetails);
- ResourceResponse = http.httpSendPost(url, userBodyJson, headersMap);
- } else if (uri == "DELETE") {
- ResourceResponse = http.httpSendDelete(url, headersMap);
- } else
- return null;
-
- return ResourceResponse;
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- }
-
- return null;
-
- }
-
- protected JSONObject JsonObjectBuilder(ResourceReqDetails resourceDetails) throws JSONException {
- // json object: resourceName and icon are must
- JSONObject jObject = new JSONObject();
-
- List<String> tagsList = Arrays.asList(resourceDetails.getName());
- List<String> derivedFromList = Arrays.asList("[tosca.nodes.Root]");
-
- jObject.put("name", resourceDetails.getName());
- jObject.put("description", "updatedDescription");
- jObject.put("tags", tagsList);
- jObject.put("category", ServiceCategoriesEnum.VOIP.getValue());
- jObject.put("derivedFrom", derivedFromList);
- jObject.put("vendorName", "newOracle");
- jObject.put("vendorRelease", "1.5");
- jObject.put("contactId", "jh0003");
- jObject.put("icon", resourceDetails.getIcon());
-
- return jObject;
- }
-
- protected JSONObject RemoveFromJsonObject(JSONObject jObject, String removedPropery) {
- jObject.remove(removedPropery);
-
- return jObject;
- }
-
- // purpose: function for controlling json body fields and validating
- // response
- protected void UpdateAndValidateWithIncompletedJsonBody(User sdncModifierDetails, JSONObject jsonObject,
- String resourceId, String removedField, String errorMessage, List<String> variables) throws Exception {
-
- JSONObject jObject = new JSONObject(jsonObject, JSONObject.getNames(jsonObject));
- // remove description from jsonObject
- jObject = RemoveFromJsonObject(jObject, removedField);
- // update with incomplete body.
- RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(jObject.toString(),
- sdncModifierDetails, resourceId);
- // validate response
- AssertJUnit.assertNotNull("check response object is not null after update resource", updatedRestResponse);
- AssertJUnit.assertNotNull("check error code exists in response after update resource",
- updatedRestResponse.getErrorCode());
- ErrorValidationUtils.checkBodyResponseOnError(errorMessage, variables, updatedRestResponse.getResponse());
-
- }
-
- // purpose: function for validating error response
- protected void UpdateAndValidate(User sdncModifierDetails, ResourceReqDetails resourceDetails,
- String recievedMessage, List<String> variables) throws Exception {
- RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails,
- sdncModifierDetails, "0.1");
- // validate response
- AssertJUnit.assertNotNull("check response object is not null after update resource", updatedRestResponse);
- AssertJUnit.assertNotNull("check error code exists in response after update resource",
- updatedRestResponse.getErrorCode());
- ErrorValidationUtils.checkBodyResponseOnError(recievedMessage, variables, updatedRestResponse.getResponse());
-
- }
-
- protected void parseResponseAndValidateNonUpdatable(ResourceReqDetails resourceDetails, RestResponse restResponse)
- throws Exception {
- // parse response to javaObject
- Resource updatedResourceRespJavaObject = ResponseParser
- .convertResourceResponseToJavaObject(restResponse.getResponse());
- AssertJUnit.assertTrue(
- !resourceDetails.getIsHighestVersion().equals(updatedResourceRespJavaObject.isHighestVersion()));
- AssertJUnit.assertTrue(!resourceDetails.getVersion().equals(updatedResourceRespJavaObject.getName()));
- AssertJUnit.assertTrue(!resourceDetails.getIsAbstract().equals(updatedResourceRespJavaObject.isAbstract()));
- AssertJUnit.assertTrue(
- !resourceDetails.getCreatorUserId().equals(updatedResourceRespJavaObject.getCreatorUserId()));
- AssertJUnit.assertTrue(
- !resourceDetails.getCreatorFullName().equals(updatedResourceRespJavaObject.getCreatorFullName()));
- AssertJUnit.assertTrue(
- !resourceDetails.getLastUpdateDate().equals(updatedResourceRespJavaObject.getLastUpdateDate()));
- AssertJUnit
- .assertTrue(!resourceDetails.getCreationDate().equals(updatedResourceRespJavaObject.getCreationDate()));
- AssertJUnit.assertTrue(
- !resourceDetails.getLastUpdaterUserId().equals(updatedResourceRespJavaObject.getLastUpdaterUserId()));
- AssertJUnit.assertTrue(!resourceDetails.getLastUpdaterFullName()
- .equals(updatedResourceRespJavaObject.getLastUpdaterFullName()));
- AssertJUnit.assertTrue(
- !resourceDetails.getLifecycleState().equals(updatedResourceRespJavaObject.getLifecycleState()));
- AssertJUnit.assertTrue(!resourceDetails.getCost().equals(updatedResourceRespJavaObject.getCost()));
- AssertJUnit
- .assertTrue(!resourceDetails.getLicenseType().equals(updatedResourceRespJavaObject.getLicenseType()));
- AssertJUnit.assertTrue(!resourceDetails.getUUID().equals(updatedResourceRespJavaObject.getUUID()));
-
- }
-
- protected void parseResponseAndValidate(ResourceReqDetails ResourceDetails, RestResponse restResponse)
- throws Exception {
- // parse response to javaObject
- Resource updatedResourceRespJavaObject = ResponseParser
- .convertResourceResponseToJavaObject(restResponse.getResponse());
- // validate request vs response
- ResourceValidationUtils.validateResourceReqVsResp(ResourceDetails, updatedResourceRespJavaObject);
- }
-
- public ExpectedResourceAuditJavaObject constructFieldsForAuditValidation(ResourceReqDetails resourceDetails,
- String resourceVersion) {
-
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
-
- expectedResourceAuditJavaObject.setAction("Checkout");
- expectedResourceAuditJavaObject.setModifierUid(UserRoleEnum.ADMIN.getUserId());
- expectedResourceAuditJavaObject.setModifierName(UserRoleEnum.ADMIN.getUserName());
- expectedResourceAuditJavaObject.setStatus("200.0");
- expectedResourceAuditJavaObject.setDesc("OK");
- expectedResourceAuditJavaObject.setResourceName(resourceDetails.getName().toLowerCase());
- expectedResourceAuditJavaObject.setResourceType("Resource");
- expectedResourceAuditJavaObject.setPrevVersion(String.valueOf(Float.parseFloat(resourceVersion) - 0.1f));
- expectedResourceAuditJavaObject.setCurrVersion(resourceVersion);
- expectedResourceAuditJavaObject.setPrevState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
- expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
-
- return expectedResourceAuditJavaObject;
-
- }
-
- public enum FieldToValidate {
- contactId, Tags, VendorName, VendorRelease, Description
- }
-
- @Test
- public void UpdateBy_postTest() throws Exception {
-
- RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
- String resourceName = resourceDetails.getName();
-
- // update resource - without changing resourceName
- ResourceReqDetails updatedResourceDetails = defineUpdatedResourse(resourceName);
-
- RestResponse updatedRestResponse = TryUpdateByAnotherVerb(updatedResourceDetails, sdncModifierDetails, "POST");
-
- // validate response
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.NOT_ALLOWED.name(), Empty_List,
- updatedRestResponse.getResponse());
-
- RestResponse getRestResponse = ResourceRestUtils.getResource(sdncModifierDetails,
- resourceDetails.getUniqueId());
- assertNotNull("check response object is not null after update resource", getRestResponse);
- parseResponseAndValidate(resourceDetails, getRestResponse);
-
- }
-
- @Test
- public void UpdateBy_getTest() throws Exception {
-
- RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
- String resourceName = resourceDetails.getName();
-
- // update resource - without changing resourceName
- ResourceReqDetails updatedResourceDetails = defineUpdatedResourse(resourceName);
- RestResponse updatedRestResponse = TryUpdateByAnotherVerb(updatedResourceDetails, sdncModifierDetails, "GET");
-
- // validate response
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.NOT_ALLOWED.name(), Empty_List,
- updatedRestResponse.getResponse());
-
- RestResponse getRestResponse = ResourceRestUtils.getResource(sdncModifierDetails,
- resourceDetails.getUniqueId());
- assertNotNull("check response object is not null after update resource", getRestResponse);
- parseResponseAndValidate(resourceDetails, getRestResponse);
-
- }
-
- @Test
- public void UpdateBy_deleteTest() throws Exception {
-
- RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
- String resourceName = resourceDetails.getName();
-
- // update resource - without changing resourceName
- ResourceReqDetails updatedResourceDetails = defineUpdatedResourse(resourceName);
- RestResponse updatedRestResponse = TryUpdateByAnotherVerb(updatedResourceDetails, sdncModifierDetails,
- "DELETE");
-
- // validate response
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.NOT_ALLOWED.name(), Empty_List,
- updatedRestResponse.getResponse());
-
- RestResponse getRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails,
- resourceDetails.getUniqueId(), "");
- assertNotNull("check response object is not null after update resource", getRestResponse);
- parseResponseAndValidate(resourceDetails, getRestResponse);
-
- }
-
- // TODO DE
- // @Ignore("")
- @Test
- public void UpdateWithInvaldJsonBodyTest() throws Exception {
-
- RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
- resourceDetails.setUniqueId(ResponseParser.getUniqueIdFromResponse(restResponse));
- String resourceId = resourceDetails.getUniqueId();
-
- // update Descirption value
- String description = "updatedDescription";
-
- // send update with incompleted json, only description string
- RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(description, sdncModifierDetails,
- resourceId);
-
- // validate response
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- assertEquals("check error code after update resource", 400, updatedRestResponse.getErrorCode().intValue());
-
- RestResponse getRestResponse = ResourceRestUtils.getResource(sdncModifierDetails,
- resourceDetails.getUniqueId());
- assertNotNull("check response object is not null after update resource", getRestResponse);
- parseResponseAndValidate(resourceDetails, getRestResponse);
-
- }
-
- // @Test
- // public void UpdateResourceModifierNotOwnerStateTest() throws Exception {
- //
- //
- // RestResponse restResponse = createResource(sdncModifierDetails,
- // resourceDetails);
- // String resourceName = resourceDetails.getName();
- //
- // // new user parameters
- // String userFirstName = "Kot";
- // String userLastName = "Matroskin";
- // String role = "ADMIN";
- // User sdncUserDetails = new User(userFirstName, userLastName,
- // httpCspUserId, email, role,null);
- // RestResponse deleteUserResponse = userUtils.deleteUser(sdncUserDetails,
- // ElementFactory.getDefaultUser(UserRoleEnum.ADMIN));
- //
- // RestResponse createUserResponse = UserUtils.createUser(sdncUserDetails,
- // ElementFactory.getDefaultUser(UserRoleEnum.ADMIN));
- //
- // User updatedSdncModifierDetails = new User(userFirstName, userLastName,
- // httpCspUserId, email,role,null);
- // ResourceReqDetails updatedResourceDetails =
- // defineUpdatedResourse(resourceName);
- // RestResponse updatedRestResponse =
- // ResourceRestUtils.updateResource(updatedResourceDetails,
- // updatedSdncModifierDetails, resourceDetails.getUniqueId(), "");
- //
- // // validate response
- // assertNotNull("check response object is not null after update resource",
- // updatedRestResponse);
- // assertNotNull("check error code exists in response after update
- // resource", updatedRestResponse.getErrorCode());
- // ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(),
- // Empty_List, updatedRestResponse.getResponse());
- //
- // RestResponse getRestResponse =
- // ResourceRestUtils.getResource(sdncModifierDetails,
- // resourceDetails.getUniqueId());
- // assertNotNull("check response object is not null after update resource",
- // getRestResponse);
- // parseResponseAndValidate(resourceDetails, getRestResponse);
- //
- //
- // }
-
- @Test
- public void UpdateResourceNameSensitiveTest() throws Exception {
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- String resourceBaseVersion = "0.1";
- String resourceName = "Ab";
- ResourceReqDetails updatedResourceDetails = defineUpdatedResourse(resourceName);
- // Delete resources
- RestResponse response = null;
- response = ResourceRestUtils.deleteResourceByNameAndVersion(sdncModifierDetails,
- updatedResourceDetails.getName(), "0.1");
- BaseRestUtils.checkDeleteResponse(response);
- response = ResourceRestUtils.deleteResourceByNameAndVersion(sdncModifierDetails,
- updatedResourceDetails.getName(), "0.2");
- BaseRestUtils.checkDeleteResponse(response);
-
- RestResponse restResponse = createResource(sdncModifierDetails, updatedResourceDetails);
- assertEquals("create resource failed", 201, restResponse.getErrorCode().intValue());
-
- // check-in Resource
- logger.debug("Changing resource life cycle ");
- RestResponse checkoutResource = LifecycleRestUtils.changeResourceState(updatedResourceDetails,
- sdncModifierDetails, resourceBaseVersion, LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-
- // String resourceCertifyVersion = "0.1";
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(updatedResourceDetails, sdncModifierDetails,
- resourceBaseVersion, LifeCycleStatesEnum.CHECKOUT);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-
- updatedResourceDetails.setName("ABC_-bt.aT");
- ArrayList<String> resourceTag = new ArrayList<String>();
- resourceTag.add(0, "ABC_-bt.aT");
- updatedResourceDetails.setTags(resourceTag);
- RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails,
- sdncModifierDetails, updatedResourceDetails.getUniqueId(), "");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
- parseResponseAndValidate(updatedResourceDetails, updatedRestResponse);
-
- // Delete resources
- response = ResourceRestUtils.deleteResourceByNameAndVersion(sdncModifierDetails,
- updatedResourceDetails.getName(), "0.1");
- BaseRestUtils.checkDeleteResponse(response);
- response = ResourceRestUtils.deleteResourceByNameAndVersion(sdncModifierDetails,
- updatedResourceDetails.getName(), "0.2");
- BaseRestUtils.checkDeleteResponse(response);
-
- }
-
- @Test
- public void UpdateIcon_InegativeFlow() throws Exception {
-
- RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
- String resourceName = resourceDetails.getName();
-
- List<String> resourceList = new ArrayList<String>();
- resourceList.add(0, "Resource");
- // check InValid Characters
- char[] notValidCharsArray = new char[59];
- notValidCharsArray = getInValidChars();
- // update metadata details
- ResourceReqDetails updatedResourceDetails = defineUpdatedResourse(resourceName);
- RestResponse updatedRestResponse;
-
- for (int i = 0; i < notValidCharsArray.length; i++) {
- // change icon of metadata
- updatedResourceDetails.setIcon("MyIcon" + notValidCharsArray[i]);
- // PUT request
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails, sdncModifierDetails,
- resourceDetails.getUniqueId(), "");
- // validate response
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource",
- updatedRestResponse.getErrorCode());
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_ICON.name(), resourceList,
- updatedRestResponse.getResponse());
- assertEquals("Check response code after updating resource icon", 400,
- updatedRestResponse.getErrorCode().intValue());
- assertEquals("Check response code after updating resource icon", "Bad Request",
- updatedRestResponse.getResponseMessage().toString());
-
- }
-
- // empty icon
- String updateIcon = "";
- updatedResourceDetails.setIcon(updateIcon);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails, sdncModifierDetails,
- resourceDetails.getUniqueId(), "");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_ICON.name(), resourceList,
- updatedRestResponse.getResponse());
-
- // Icon length more then 25 characters
- resourceList.add(1, "25");
- updatedResourceDetails.setIcon("1234567890_-qwertyuiopASDNNN");
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails, sdncModifierDetails,
- resourceDetails.getUniqueId(), "");
- // validate response
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_ICON_EXCEEDS_LIMIT.name(), resourceList,
- updatedRestResponse.getResponse());
- assertEquals("Check response code after create resource", 400, updatedRestResponse.getErrorCode().intValue());
- assertEquals("Check response code after updating resource icon", "Bad Request",
- updatedRestResponse.getResponseMessage().toString());
-
- // get resource with original name. original metadata should be returned
- RestResponse getRestResponse = ResourceRestUtils.getResource(sdncModifierDetails,
- resourceDetails.getUniqueId());
- // validate response
- assertNotNull("check response object is not null after get resource", getRestResponse);
- assertNotNull("check error code exists in response after get resource", getRestResponse.getErrorCode());
- assertEquals("Check response code after update resource", 200, getRestResponse.getErrorCode().intValue());
-
- // parse updated response to javaObject
- Resource getResourceRespJavaObject = ResponseParser
- .convertResourceResponseToJavaObject(getRestResponse.getResponse());
- // validate that metadata was not changed
- ResourceValidationUtils.validateResourceReqVsResp(resourceDetails, getResourceRespJavaObject);
-
- }
-
- @Test
- public void UpdateResource_NoTagsEqualToResourceName() throws Exception {
-
- User adminModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- String resourceBaseVersion = "0.1";
-
- // create resource
- RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
- String resourceName = resourceDetails.getName();
-
- ResourceReqDetails updatedResourceDetails = defineResourse();
- updatedResourceDetails.setName("updatedResourceName");
- List<String> tags = updatedResourceDetails.getTags();
-
- for (Iterator<String> iter = tags.listIterator(); iter.hasNext(); ) {
- String a = iter.next();
- if (a.equals("updatedResourceName")) {
- iter.remove();
- }
- }
-
- RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails,
- sdncModifierDetails, resourceDetails.getUniqueId(), "");
- // validate response
- List<String> resourceList = new ArrayList<String>();
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_TAGS_NO_COMP_NAME.name(),
- resourceList, updatedRestResponse.getResponse());
- assertEquals("Check response code after updating resource icon", 400,
- updatedRestResponse.getErrorCode().intValue());
-
- // get resource with original name. original metadata should be returned
- RestResponse getRestResponse = ResourceRestUtils.getResource(sdncModifierDetails,
- resourceDetails.getUniqueId());
- // validate response
- assertNotNull("check response object is not null after get resource", getRestResponse);
- assertNotNull("check error code exists in response after get resource", getRestResponse.getErrorCode());
- assertEquals("Check response code after update resource", 200, getRestResponse.getErrorCode().intValue());
- // parse updated response to javaObject
- Resource getResourceRespJavaObject = ResponseParser
- .convertResourceResponseToJavaObject(getRestResponse.getResponse());
- // validate that metadata was not changed
- ResourceValidationUtils.validateResourceReqVsResp(resourceDetails, getResourceRespJavaObject);
-
- }
-
- @Test
- public void UpdateResourceName_negativeFlow() throws Exception {
- // The validation are done in Tag's validation
- User sdncAdminModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-
- RestResponse updatedRestResponse;
- RestResponse restResponse = createResource(sdncAdminModifierDetails, resourceDetails);
- assertEquals("create resource failed", 201, restResponse.getErrorCode().intValue());
- String uniqueId = resourceDetails.getUniqueId();
- String resourceName = resourceDetails.getName();
- // check InValid Characters
- char[] notValidCharsArray = new char[59];
- notValidCharsArray = getInValidChars();
- ArrayList<String> resource_Name = new ArrayList<String>();
- List<String> resourceList = new ArrayList<String>();
-
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceList.add(0, "Resource");
-
- // update metadata details
- ResourceReqDetails updatedResourceDetails = defineUpdatedResourse(resourceName);
- for (int i = 0; i < notValidCharsArray.length; i++, resource_Name.clear()) {
- if (i != 1 && i != 46
- && /*
- * i != 8 && i != 9 && i != 10 && i != 11 && i != 12 &&
- */ i != 31) // space ("") and dot(.)
- {
- // change resourceName parameter
- updatedResourceDetails.setName("UpdatedResourceName" + notValidCharsArray[i]);
- resource_Name.add("UpdatedResourceName" + notValidCharsArray[i]);
- updatedResourceDetails.setTags(resource_Name);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails,
- sdncAdminModifierDetails, uniqueId, "");
- // validate response
- // ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_TAG.name(),
- // Empty_List, updatedRestResponse.getResponse());
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_COMPONENT_NAME.name(), resourceList,
- updatedRestResponse.getResponse());
-
- }
- }
-
- // resourceName length more then 50 characters
- // Duplicate tags are allowed and should be de-duplicated by server side
- resource_Name.add(resourceName);
- resource_Name.add("tag1");
- resource_Name.add("tag1");
- resource_Name.add("tag2");
- resource_Name.add("tag2");
-
- resourceList.add(1, "1024");
- // updatedResourceDetails.setName("123456789012345678901234567890123456789012345678901");
- updatedResourceDetails.setName(new String(new char[1025]).replace("\0", "a"));
- // resource_Name.add("123456789012345678901234567890123456789012345678901");
- updatedResourceDetails.setTags(resource_Name);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails, sdncAdminModifierDetails,
- uniqueId, "");
- // validate response
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_NAME_EXCEEDS_LIMIT.name(), resourceList,
- updatedRestResponse.getResponse());
-
- // get resource with original name. original metadata should be returned
- RestResponse getRestResponse = ResourceRestUtils.getResource(sdncAdminModifierDetails,
- resourceDetails.getUniqueId());
- // validate response
- assertNotNull("check response object is not null after get resource", getRestResponse);
- assertNotNull("check error code exists in response after get resource", getRestResponse.getErrorCode());
- assertEquals("Check response code after update resource", 200, getRestResponse.getErrorCode().intValue());
- // parse updated response to javaObject
- Resource getResourceRespJavaObject = ResponseParser
- .convertResourceResponseToJavaObject(getRestResponse.getResponse());
- // validate that metadata was not changed
- ResourceValidationUtils.validateResourceReqVsResp(resourceDetails, getResourceRespJavaObject);
-
- // delete resource
- RestResponse response = ResourceRestUtils.deleteResourceByNameAndVersion(sdncAdminModifierDetails,
- updatedResourceDetails.getName(), "0.1");
- BaseRestUtils.checkDeleteResponse(response);
- }
-
- @Test
- public void UpdateResourceInformation_NotCheckedOut() throws Exception {
-
- String resourceBaseVersion = "0.1";
- List<String> resourceList = new ArrayList<String>();
-
- RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
- String resourceName = resourceDetails.getName();
-
- // CheckIn Resource
- logger.debug("Changing resource life cycle ");
- RestResponse checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
- resourceBaseVersion, LifeCycleStatesEnum.CHECKIN); // NOT_CERTIFIED_CHECKIN
- assertNotNull("check response object is not null after checkout resource", checkoutResource);
- assertNotNull("check error code exists in response after checkIn resource", checkoutResource.getErrorCode());
- assertEquals("Check response code after checkin resource", 200, checkoutResource.getErrorCode().intValue());
-
- ResourceReqDetails updatedResourceDetails = defineUpdatedResourse(resourceName);
-
- RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails,
- sdncModifierDetails, resourceDetails.getUniqueId(), "");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), resourceList,
- updatedRestResponse.getResponse());
- assertEquals("Check response code after updating resource icon", 409,
- updatedRestResponse.getErrorCode().intValue());
-
- // get resource with original name. original metadata should be returned
- RestResponse getRestResponse = ResourceRestUtils.getResource(sdncModifierDetails,
- resourceDetails.getUniqueId());
- // validate response
- assertNotNull("check response object is not null after get resource", getRestResponse);
- assertNotNull("check error code exists in response after get resource", getRestResponse.getErrorCode());
- assertEquals("Check response code after update resource", 200, getRestResponse.getErrorCode().intValue());
-
- // parse updated response to javaObject
- Resource getResourceRespJavaObject = ResponseParser
- .convertResourceResponseToJavaObject(getRestResponse.getResponse());
- // validate that metadata was not changed
- ResourceValidationUtils.validateResourceReqVsResp(resourceDetails, getResourceRespJavaObject);
-
- }
-
- @Test
- public void UpdateResourceInformation_resourceVersion_11() throws Exception {
-
- User adminModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- String resourceBaseVersion = "0.1";
-
- // create resource
- RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
- String resourceName = resourceDetails.getName();
-
- // resourceUtils.addResourceMandatoryArtifacts(sdncModifierDetails,
- // restResponse);
-
- // Certify Resource
- logger.debug("Changing resource life cycle ");
- RestResponse checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
- resourceBaseVersion, LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-
- /*logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
- resourceBaseVersion, LifeCycleStatesEnum.CERTIFICATIONREQUEST);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceBaseVersion, LifeCycleStatesEnum.STARTCERTIFICATION);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());*/
-
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceBaseVersion, LifeCycleStatesEnum.CERTIFY);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-
- String resourceCertifyVersion = "1.0";
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-
- ResourceReqDetails updatedResourceDetails = defineUpdatedResourse(resourceName);
-
- RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails,
- sdncModifierDetails, resourceDetails.getUniqueId(), "");
- // validate response
- List<String> resourceList = new ArrayList<String>();
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), resourceList,
- updatedRestResponse.getResponse());
- // assertEquals("Check response code after updating resource icon", 409,
- // updatedRestResponse.getErrorCode().intValue());
-
- // get resource with original name. original metadata should be returned
- RestResponse getRestResponse = ResourceRestUtils.getResource(sdncModifierDetails,
- resourceDetails.getUniqueId());
- // validate response
- assertNotNull("check response object is not null after get resource", getRestResponse);
-
- assertNotNull("check error code exists in response after get resource", getRestResponse.getErrorCode());
-
- assertEquals("Check response code after update resource", 200, getRestResponse.getErrorCode().intValue());
- // parse updated response to javaObject
- Resource getResourceRespJavaObject = ResponseParser
- .convertResourceResponseToJavaObject(getRestResponse.getResponse());
- // validate that metadata was not changed
- ResourceValidationUtils.validateResourceReqVsResp(resourceDetails, getResourceRespJavaObject);
-
- }
-
- @Test
- public void UpdateResourceInformation_resourceVersion_02() throws Exception {
-
- String resourceBaseVersion = "0.1";
-
- // create resource
- RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
- String resourceName = resourceDetails.getName();
-
- // resourceUtils.addResourceMandatoryArtifacts(sdncModifierDetails,
- // restResponse);
-
- // Certify Resource
- logger.debug("Changing resource life cycle ");
- RestResponse checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
- resourceBaseVersion, LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-
- // String resourceCertifyVersion = "0.1";
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
- resourceBaseVersion, LifeCycleStatesEnum.CHECKOUT);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-
- ResourceReqDetails updatedResourceDetails = defineUpdatedResourse(resourceName);
-
- RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails,
- sdncModifierDetails, resourceDetails.getUniqueId(), "");
- // validate response
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- assertEquals("Check response code after updating resource icon", 200,
- updatedRestResponse.getErrorCode().intValue());
-
- // get resource with original name. original metadata should be returned
- RestResponse getRestResponse = ResourceRestUtils.getResource(sdncModifierDetails,
- resourceDetails.getUniqueId());
- // validate response
- assertNotNull("check response object is not null after get resource", getRestResponse);
- assertNotNull("check error code exists in response after get resource", getRestResponse.getErrorCode());
- assertEquals("Check response code after update resource", 200, getRestResponse.getErrorCode().intValue());
-
- // parse updated response to javaObject
- Resource getResourceRespJavaObject = ResponseParser
- .convertResourceResponseToJavaObject(getRestResponse.getResponse());
- // validate that metadata was not changed
- ResourceValidationUtils.validateResourceReqVsResp(updatedResourceDetails, getResourceRespJavaObject);
-
- // delete resource
- RestResponse response = ResourceRestUtils.deleteResourceByNameAndVersion(sdncModifierDetails,
- updatedResourceDetails.getName(), "0.1");
- BaseRestUtils.checkDeleteResponse(response);
- response = ResourceRestUtils.deleteResourceByNameAndVersion(sdncModifierDetails,
- updatedResourceDetails.getName(), "0.2");
- BaseRestUtils.checkDeleteResponse(response);
-
- }
-
- @Test
- public void UpdateResourceIcon_resourceVersion_11() throws Exception {
- // Can be changed only if major version is "0".
-
- User adminModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- String resourceBaseVersion = "0.1";
-
- // create resource
- RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
- String resourceName = resourceDetails.getName();
-
- // resourceUtils.addResourceMandatoryArtifacts(sdncModifierDetails,
- // restResponse);
-
- // Certify Resource
- logger.debug("Changing resource life cycle ");
- RestResponse checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
- resourceBaseVersion, LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-
- /*logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
- resourceBaseVersion, LifeCycleStatesEnum.CERTIFICATIONREQUEST);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceBaseVersion, LifeCycleStatesEnum.STARTCERTIFICATION);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());*/
-
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceBaseVersion, LifeCycleStatesEnum.CERTIFY);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-
- String resourceCertifyVersion = "1.0";
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
- resourceCertifyVersion, LifeCycleStatesEnum.CHECKOUT);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-
- // ResourceReqDetails updatedResourceDetails =
- // defineUpdatedResourse(resourceName);
- ResourceReqDetails updatedResourceDetails = defineResourse();
- // updatedResourceDetails.setVendorName("updatedVandorName");
- updatedResourceDetails.setIcon("updatedIcon");
-
- RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails,
- sdncModifierDetails, resourceDetails.getUniqueId(), "");
- // validate response
- List<String> resourceList = new ArrayList<String>();
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESOURCE_ICON_CANNOT_BE_CHANGED.name(), resourceList,
- updatedRestResponse.getResponse());
-
- // get resource with original name. original metadata should be returned
- RestResponse getRestResponse = ResourceRestUtils.getResource(sdncModifierDetails,
- resourceDetails.getUniqueId());
- // validate response
- assertNotNull("check response object is not null after get resource", getRestResponse);
- assertNotNull("check error code exists in response after get resource", getRestResponse.getErrorCode());
- assertEquals("Check response code after update resource", 200, getRestResponse.getErrorCode().intValue());
- // parse updated response to javaObject
- Resource getResourceRespJavaObject = ResponseParser
- .convertResourceResponseToJavaObject(getRestResponse.getResponse());
- // validate that metadata was not changed
- ResourceValidationUtils.validateResourceReqVsResp(resourceDetails, getResourceRespJavaObject);
-
- }
-
- @Test
- public void UpdateResourceVandorName_resourceVersion_11() throws Exception {
- // Can be changed only if the major resource version is "0".
- User adminModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- String resourceBaseVersion = "0.1";
-
- // create resource
- RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
- String resourceName = resourceDetails.getName();
-
- // resourceUtils.addResourceMandatoryArtifacts(sdncModifierDetails,
- // restResponse);
-
- // Certify Resource
- logger.debug("Changing resource life cycle ");
- RestResponse checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
- resourceBaseVersion, LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-
- /*logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
- resourceBaseVersion, LifeCycleStatesEnum.CERTIFICATIONREQUEST);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceBaseVersion, LifeCycleStatesEnum.STARTCERTIFICATION);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());*/
-
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceBaseVersion, LifeCycleStatesEnum.CERTIFY);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-
- String resourceCertifyVersion = "1.0";
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
- resourceCertifyVersion, LifeCycleStatesEnum.CHECKOUT);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-
- // ResourceReqDetails updatedResourceDetails =
- // defineUpdatedResourse(resourceName);
- ResourceReqDetails updatedResourceDetails = defineResourse();
-
- updatedResourceDetails.setVendorName("updatedVandorName");
-
- RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails,
- sdncModifierDetails, resourceDetails.getUniqueId(), "");
- // validate response
- List<String> resourceList = new ArrayList<String>();
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESOURCE_VENDOR_NAME_CANNOT_BE_CHANGED.name(),
- resourceList, updatedRestResponse.getResponse());
- assertEquals("Check response code after updating resource icon", 400,
- updatedRestResponse.getErrorCode().intValue());
-
- // get resource with original name. original metadata should be returned
- RestResponse getRestResponse = ResourceRestUtils.getResource(sdncModifierDetails,
- resourceDetails.getUniqueId());
- // validate response
- assertNotNull("check response object is not null after get resource", getRestResponse);
- assertNotNull("check error code exists in response after get resource", getRestResponse.getErrorCode());
- assertEquals("Check response code after update resource", 200, getRestResponse.getErrorCode().intValue());
- // parse updated response to javaObject
- Resource getResourceRespJavaObject = ResponseParser
- .convertResourceResponseToJavaObject(getRestResponse.getResponse());
- // validate that metadata was not changed
- ResourceValidationUtils.validateResourceReqVsResp(resourceDetails, getResourceRespJavaObject);
-
- }
-
- @Test
- public void UpdateResourceName_resourceVersion_11() throws Exception {
- // Can be changed only if the major resource version is "0".
- User adminModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- String resourceBaseVersion = "0.1";
-
- // create resource
- RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
- assertEquals("create resource failed", 201, restResponse.getErrorCode().intValue());
- String resourceName = resourceDetails.getName();
-
- // resourceUtils.addResourceMandatoryArtifacts(sdncModifierDetails,
- // restResponse);
-
- // Certify Resource
- logger.debug("Changing resource life cycle ");
- RestResponse checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
- resourceBaseVersion, LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-
- /*logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
- resourceBaseVersion, LifeCycleStatesEnum.CERTIFICATIONREQUEST);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceBaseVersion, LifeCycleStatesEnum.STARTCERTIFICATION);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());*/
-
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceBaseVersion, LifeCycleStatesEnum.CERTIFY);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-
- String resourceCertifyVersion = "1.0";
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
- resourceCertifyVersion, LifeCycleStatesEnum.CHECKOUT);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-
- /*
- * //ResourceReqDetails updatedResourceDetails =
- * defineUpdatedResourse(resourceName); ResourceReqDetails
- * updatedResourceDetails = defineResourse();
- *
- * updatedResourceDetails.setResourceName("updatedResourceName");
- * updatedResourceDetails.setIcon("updatedResourceName");
- */
- resourceDetails.setName("updatedResourceName");
- List<String> tagList = new ArrayList<String>();
- tagList.add(0, "updatedResourceName");
- resourceDetails.setTags(tagList);
-
- RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails,
- sdncModifierDetails, resourceDetails.getUniqueId(), "");
- // validate response
- List<String> resourceList = new ArrayList<String>();
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESOURCE_NAME_CANNOT_BE_CHANGED.name(), resourceList,
- updatedRestResponse.getResponse());
-
- }
-
- @Test
- public void UpdateResourceTag_resourceVersion_11() throws Exception {
- // Tag Can be updated when major version is "0".
- User adminModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- String resourceBaseVersion = "0.1";
-
- // create resource
- RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
- String resourceName = resourceDetails.getName();
-
- // resourceUtils.addResourceMandatoryArtifacts(sdncModifierDetails,
- // restResponse);
-
- // Certify Resource
- logger.debug("Changing resource life cycle ");
- RestResponse checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
- resourceBaseVersion, LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-
- /*logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
- resourceBaseVersion, LifeCycleStatesEnum.CERTIFICATIONREQUEST);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceBaseVersion, LifeCycleStatesEnum.STARTCERTIFICATION);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());*/
-
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceBaseVersion, LifeCycleStatesEnum.CERTIFY);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-
- String resourceCertifyVersion = "1.0";
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
- resourceCertifyVersion, LifeCycleStatesEnum.CHECKOUT);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-
- // ResourceReqDetails updatedResourceDetails =
- // defineUpdatedResourse(resourceName);
- ResourceReqDetails updatedResourceDetails = defineResourse();
- // updatedResourceDetails.setVendorName("updatedVandorName");
-
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add("NewTag");
- resourceTags.add(resourceDetails.getName());
-
- updatedResourceDetails.setTags(resourceTags);
-
- RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails,
- sdncModifierDetails, resourceDetails.getUniqueId(), "");
- // validate response
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
-
- RestResponse getRestResponse = ResourceRestUtils.getResource(sdncModifierDetails,
- resourceDetails.getUniqueId());
- assertNotNull("check response object is not null after update resource", getRestResponse);
- parseResponseAndValidate(updatedResourceDetails, getRestResponse);
-
- }
-
- @Test
- public void UpdateAllowedParames_resourceVersion_11() throws Exception {
-
- // Tag, contactId, vendorRelease,tags And description - Can be also
- // updated when major version is NOT "0".
- User adminModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- String resourceBaseVersion = "0.1";
-
- // create resource
- RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
-
- // resourceUtils.addResourceMandatoryArtifacts(sdncModifierDetails,
- // restResponse);
-
- // Certify Resource
- logger.debug("Changing resource life cycle ");
- RestResponse checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
- resourceBaseVersion, LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-
- /*logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
- resourceBaseVersion, LifeCycleStatesEnum.CERTIFICATIONREQUEST);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceBaseVersion, LifeCycleStatesEnum.STARTCERTIFICATION);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());*/
-
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceBaseVersion, LifeCycleStatesEnum.CERTIFY);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-
- String resourceCertifyVersion = "1.0";
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
- resourceCertifyVersion, LifeCycleStatesEnum.CHECKOUT);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-
- // ResourceReqDetails updatedResourceDetails =
- // defineUpdatedResourse(resourceName);
- ResourceReqDetails updatedResourceDetails = defineResourse();
- // updatedResourceDetails.setVendorName("updatedVandorName");
-
- // updated allowed parameters when major resource version is NOT "0"
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add("NewTag");
- resourceTags.add(resourceDetails.getName());
- updatedResourceDetails.setTags(resourceTags);
- updatedResourceDetails.setDescription("UpdatedDescription");
- updatedResourceDetails.setVendorRelease("5.1");
- updatedResourceDetails.setContactId("bt750h");
-
- RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails,
- sdncModifierDetails, resourceDetails.getUniqueId(), "");
- // validate response
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
-
- RestResponse getRestResponse = ResourceRestUtils.getResource(sdncModifierDetails,
- resourceDetails.getUniqueId());
- assertNotNull("check response object is not null after update resource", getRestResponse);
- parseResponseAndValidate(updatedResourceDetails, getRestResponse);
-
- }
-
- @Test
- public void UpdateResourceDerivedFrom_resourceVersion_11() throws Exception {
- // DerivedFrom parameter - Can be updated when major version is "0".
- User adminModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- String resourceBaseVersion = "0.1";
-
- // create resource
- RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
- String resourceName = resourceDetails.getName();
-
- // resourceUtils.addResourceMandatoryArtifacts(sdncModifierDetails,
- // restResponse);
-
- // Certify Resource
- logger.debug("Changing resource life cycle ");
- RestResponse checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
- resourceBaseVersion, LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-
- /*logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
- resourceBaseVersion, LifeCycleStatesEnum.CERTIFICATIONREQUEST);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceBaseVersion, LifeCycleStatesEnum.STARTCERTIFICATION);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());*/
-
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, adminModifierDetails,
- resourceBaseVersion, LifeCycleStatesEnum.CERTIFY);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-
- String resourceCertifyVersion = "1.0";
- logger.debug("Changing resource life cycle ");
- checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
- resourceCertifyVersion, LifeCycleStatesEnum.CHECKOUT);
- assertEquals("Check response code after checkout resource", 200, checkoutResource.getErrorCode().intValue());
-
- // ResourceReqDetails updatedResourceDetails =
- // defineUpdatedResourse(resourceName);
- ResourceReqDetails updatedResourceDetails = defineResourse();
- ArrayList<String> drivenFrom = new ArrayList<String>();
- drivenFrom.add(0, "tosca.nodes.Container.Application");
- updatedResourceDetails.setDerivedFrom(drivenFrom);
-
- RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails,
- sdncModifierDetails, resourceDetails.getUniqueId(), "");
- // validate response
- List<String> resourceList = new ArrayList<String>();
- ResourceRestUtils.checkSuccess(updatedRestResponse);
-
- // get resource with original name. original metadata should be returned
- RestResponse getRestResponse = ResourceRestUtils.getResource(sdncModifierDetails,
- resourceDetails.getUniqueId());
- // validate response
- assertNotNull("check response object is not null after get resource", getRestResponse);
- assertNotNull("check error code exists in response after get resource", getRestResponse.getErrorCode());
- assertEquals("Check response code after update resource", 200, getRestResponse.getErrorCode().intValue());
- // parse updated response to javaObject
- Resource getResourceRespJavaObject = ResponseParser
- .convertResourceResponseToJavaObject(getRestResponse.getResponse());
- // validate that metadata was not changed
- ResourceValidationUtils.validateResourceReqVsResp(resourceDetails, getResourceRespJavaObject);
-
- }
-
- @Test
- public void UpdateResource_vendorNameValidation() throws Exception {
-
- RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
- assertEquals("Check response code after create resource", 201, restResponse.getErrorCode().intValue());
- String updatedVendorName = "";
- String uniqueId = resourceDetails.getUniqueId();
- resourceDetails.setVendorName(updatedVendorName);
- RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails,
- sdncModifierDetails, uniqueId, "");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_VENDOR_NAME.name(), Empty_List,
- updatedRestResponse.getResponse());
-
- // update resource vendorName metadata: 1 characters
- updatedVendorName = " ";
- // set vendorName
- resourceDetails.setVendorName(updatedVendorName);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_VENDOR_NAME.name(), Empty_List,
- updatedRestResponse.getResponse());
-
- // update resource vendorName metadata: 25 characters
- updatedVendorName = "Verification and validati";
- // set vendorName
- resourceDetails.setVendorName(updatedVendorName);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
- parseResponseAndValidate(resourceDetails, updatedRestResponse);
-
- // update resource vendorName metadata: 26 characters
- updatedVendorName = "Verification and validatii";
- // set vendorName
- List<String> myList = new ArrayList<String>();
- myList.add(0, "25");
- resourceDetails.setVendorName(updatedVendorName);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.VENDOR_NAME_EXCEEDS_LIMIT.name(), myList,
- updatedRestResponse.getResponse());
-
- // update resource VendorRelease metadata: forbidden characters
- updatedVendorName = "A1<";
- // set vendorName
- resourceDetails.setVendorName(updatedVendorName);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_NAME.name(), Empty_List,
- updatedRestResponse.getResponse());
-
- updatedVendorName = "A1>";
- // set vendorName
- resourceDetails.setVendorName(updatedVendorName);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_NAME.name(), Empty_List,
- updatedRestResponse.getResponse());
-
- updatedVendorName = "A1:";
- // set vendorName
- resourceDetails.setVendorName(updatedVendorName);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_NAME.name(), Empty_List,
- updatedRestResponse.getResponse());
-
- updatedVendorName = "A1\"";
- // set vendorName
- resourceDetails.setVendorName(updatedVendorName);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_NAME.name(), Empty_List,
- updatedRestResponse.getResponse());
-
- updatedVendorName = "A1/";
- // set vendorName
- resourceDetails.setVendorName(updatedVendorName);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_NAME.name(), Empty_List,
- updatedRestResponse.getResponse());
-
- updatedVendorName = "A1\\";
- // set vendorName
- resourceDetails.setVendorName(updatedVendorName);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_NAME.name(), Empty_List,
- updatedRestResponse.getResponse());
-
- updatedVendorName = "A1|";
- // set vendorName
- resourceDetails.setVendorName(updatedVendorName);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_NAME.name(), Empty_List,
- updatedRestResponse.getResponse());
-
- updatedVendorName = "A1?";
- // set vendorName
- resourceDetails.setVendorName(updatedVendorName);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_NAME.name(), Empty_List,
- updatedRestResponse.getResponse());
-
- updatedVendorName = "A1*";
- // set vendorName
- resourceDetails.setVendorName(updatedVendorName);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_NAME.name(), Empty_List,
- updatedRestResponse.getResponse());
-
- // update resource vendorName metadata: null
- updatedVendorName = null;
- // set vendorName
- resourceDetails.setVendorName(updatedVendorName);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_VENDOR_NAME.name(), Empty_List,
- updatedRestResponse.getResponse());
-
- }
-
- @Test
- public void UpdateResource_vendorReleaseValidation() throws Exception {
-
- RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
- assertEquals("Check response code after create resource", 201, restResponse.getErrorCode().intValue());
- RestResponse updatedRestResponse;
- String uniqueId = resourceDetails.getUniqueId();
- String updatedVendorRelease;
- // set VendorRelease
-
- // update resource VendorRelease metadata: 1 characters
- updatedVendorRelease = "1";
- // set VendorRelease
- resourceDetails.setVendorRelease(updatedVendorRelease);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
- parseResponseAndValidate(resourceDetails, updatedRestResponse);
-
- // update resource VendorRelease metadata: 25 characters
- updatedVendorRelease = "(!#1.00000000000000000000";
- // set VendorRelease
- resourceDetails.setVendorRelease(updatedVendorRelease);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
- parseResponseAndValidate(resourceDetails, updatedRestResponse);
-
- // update resource VendorRelease metadata: 26 characters
- updatedVendorRelease = "(!#1.000000000000000000005";// set VendorRelease
- resourceDetails.setVendorRelease(updatedVendorRelease);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.VENDOR_RELEASE_EXCEEDS_LIMIT.name(),
- Arrays.asList("" + ValidationUtils.VENDOR_RELEASE_MAX_LENGTH), updatedRestResponse.getResponse());
-
- // UpdateAndValidate(sdncModifierDetails, resourceDetails,
- // ActionStatus.VENDOR_RELEASE_EXCEEDS_LIMIT.name(),
- // Arrays.asList(""+ValidationUtils.VENDOR_RELEASE_MAX_LENGTH));
-
- // update resource VendorRelease metadata: forbidden characters
- updatedVendorRelease = "A1<";
- // set VendorRelease
- resourceDetails.setVendorRelease(updatedVendorRelease);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_RELEASE.name(), Empty_List,
- updatedRestResponse.getResponse());
-
- updatedVendorRelease = "A1>";
- // set VendorRelease
- resourceDetails.setVendorRelease(updatedVendorRelease);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_RELEASE.name(), Empty_List,
- updatedRestResponse.getResponse());
-
- updatedVendorRelease = "A1:";
- // set VendorRelease
- resourceDetails.setVendorRelease(updatedVendorRelease);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_RELEASE.name(), Empty_List,
- updatedRestResponse.getResponse());
-
- updatedVendorRelease = "A1\"";
- // set VendorRelease
- resourceDetails.setVendorRelease(updatedVendorRelease);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_RELEASE.name(), Empty_List,
- updatedRestResponse.getResponse());
-
- updatedVendorRelease = "A1/";
- // set VendorRelease
- resourceDetails.setVendorRelease(updatedVendorRelease);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_RELEASE.name(), Empty_List,
- updatedRestResponse.getResponse());
-
- updatedVendorRelease = "A1\\";
- // set VendorRelease
- resourceDetails.setVendorRelease(updatedVendorRelease);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_RELEASE.name(), Empty_List,
- updatedRestResponse.getResponse());
-
- updatedVendorRelease = "A1|";
- // set VendorRelease
- resourceDetails.setVendorRelease(updatedVendorRelease);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_RELEASE.name(), Empty_List,
- updatedRestResponse.getResponse());
-
- updatedVendorRelease = "A1?";
- // set VendorRelease
- resourceDetails.setVendorRelease(updatedVendorRelease);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_RELEASE.name(), Empty_List,
- updatedRestResponse.getResponse());
-
- updatedVendorRelease = "A1*";
- // set VendorRelease
- resourceDetails.setVendorRelease(updatedVendorRelease);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_VENDOR_RELEASE.name(), Empty_List,
- updatedRestResponse.getResponse());
-
- // update resource VendorRelease metadata: null
- updatedVendorRelease = null;
- // set VendorRelease
- resourceDetails.setVendorRelease(updatedVendorRelease);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_VENDOR_RELEASE.name(), Empty_List,
- updatedRestResponse.getResponse());
-
- }
-
- @Test
- public void UpdateResource_contactIdValidation() throws Exception { // [a-zA-Z]{2}[0-9]{3}[a-zA-Z0-9]{1}
- // (6
- // characters
- // now,
- // may
- // be
- // expanded
- // up
- // to
- // 8
- // characters
- // in
- // the
- // future).
- // Convert
- // Upper
- // case
- // character
- // to
- // lower
- // case
- RestResponse updatedRestResponse;
-
- RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
- assertEquals("Check response code after create resource", 201, restResponse.getErrorCode().intValue());
- String uniqueId = resourceDetails.getUniqueId();
-
- List<String> myList = new ArrayList<String>();
- myList.add(0, "Resource");
- String updatedcontactId = "";
- resourceDetails.setContactId(updatedcontactId);
-
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_CONTACT.name(), myList,
- updatedRestResponse.getResponse());
-
- updatedcontactId = "ab12345";
- resourceDetails.setContactId(updatedcontactId);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), myList,
- updatedRestResponse.getResponse());
-
- updatedcontactId = " ";
- resourceDetails.setContactId(updatedcontactId);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_CONTACT.name(), myList,
- updatedRestResponse.getResponse());
-
- updatedcontactId = "ab 50h";
- resourceDetails.setContactId(updatedcontactId);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), myList,
- updatedRestResponse.getResponse());
-
- updatedcontactId = "ab123c";
- resourceDetails.setContactId(updatedcontactId);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
- parseResponseAndValidate(resourceDetails, updatedRestResponse);
-
- updatedcontactId = "cd789E";
- resourceDetails.setContactId(updatedcontactId);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
-
- resourceDetails.setContactId(updatedcontactId.toLowerCase());
- parseResponseAndValidate(resourceDetails, updatedRestResponse);
-
- updatedcontactId = "ef4567";
- resourceDetails.setContactId(updatedcontactId);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
- parseResponseAndValidate(resourceDetails, updatedRestResponse);
-
- updatedcontactId = "AA012A";
- resourceDetails.setContactId(updatedcontactId);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
-
- resourceDetails.setContactId(updatedcontactId.toLowerCase());
- parseResponseAndValidate(resourceDetails, updatedRestResponse);
-
- updatedcontactId = "CD012c";
- resourceDetails.setContactId(updatedcontactId);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
-
- resourceDetails.setContactId(updatedcontactId.toLowerCase());
- parseResponseAndValidate(resourceDetails, updatedRestResponse);
-
- updatedcontactId = "EF0123";
- resourceDetails.setContactId(updatedcontactId);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
-
- resourceDetails.setContactId(updatedcontactId.toLowerCase());
- parseResponseAndValidate(resourceDetails, updatedRestResponse);
-
- ////////////////////////////// **************//////////////////////////////
- List<String> resource = Arrays.asList("Resource");
- updatedcontactId = "01345a";
- resourceDetails.setContactId(updatedcontactId);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), myList,
- updatedRestResponse.getResponse());
-
- updatedcontactId = "0y000B";
- resourceDetails.setContactId(updatedcontactId);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), myList,
- updatedRestResponse.getResponse());
-
- updatedcontactId = "Y1000b";
- resourceDetails.setContactId(updatedcontactId);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), myList,
- updatedRestResponse.getResponse());
-
- updatedcontactId = "abxyzC";
- resourceDetails.setContactId(updatedcontactId);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), myList,
- updatedRestResponse.getResponse());
-
- updatedcontactId = "cdXYZc";
- resourceDetails.setContactId(updatedcontactId);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), myList,
- updatedRestResponse.getResponse());
-
- updatedcontactId = "efXY1D";
- resourceDetails.setContactId(updatedcontactId);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), myList,
- updatedRestResponse.getResponse());
-
- updatedcontactId = "EFabcD";
- resourceDetails.setContactId(updatedcontactId);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), myList,
- updatedRestResponse.getResponse());
-
- updatedcontactId = "EFABCD";
- resourceDetails.setContactId(updatedcontactId);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), myList,
- updatedRestResponse.getResponse());
-
- updatedcontactId = "EFABC1";
- resourceDetails.setContactId(updatedcontactId);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), myList,
- updatedRestResponse.getResponse());
-
- updatedcontactId = "efui1D";
- resourceDetails.setContactId(updatedcontactId);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), myList,
- updatedRestResponse.getResponse());
-
- updatedcontactId = "efui1!";
- resourceDetails.setContactId(updatedcontactId);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), myList,
- updatedRestResponse.getResponse());
-
- updatedcontactId = "ef555!";
- resourceDetails.setContactId(updatedcontactId);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), myList,
- updatedRestResponse.getResponse());
-
- updatedcontactId = ",f555";
- resourceDetails.setContactId(updatedcontactId);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), myList,
- updatedRestResponse.getResponse());
-
- updatedcontactId = "EF55.5";
- resourceDetails.setContactId(updatedcontactId);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), myList,
- updatedRestResponse.getResponse());
-
- // update resource contactId metadata: extended character set (128–255)
- resourceDetails.setContactId(extendedCharsStringBuilder());
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CONTACT.name(), myList,
- updatedRestResponse.getResponse());
-
- // update resource contactId metadata: null
- updatedcontactId = null;
- resourceDetails.setContactId(updatedcontactId);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_CONTACT.name(), myList,
- updatedRestResponse.getResponse());
-
- }
-
- @Test
- public void UpdateResource_TagsFieldValidation() throws Exception {
- RestResponse updatedRestResponse;
- // define and create resource
-
- RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
- assertEquals("Check response code after create resource", 201, restResponse.getErrorCode().intValue());
- String uniqueId = resourceDetails.getUniqueId();
-
- String updatedTagField = "";
- ArrayList<String> resourceTags = new ArrayList<String>();
- resourceTags.add(updatedTagField);
- // set description
- resourceDetails.setTags(resourceTags);
- List<String> variables = Arrays.asList("Resource", "tag");
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_FIELD_FORMAT.name(), variables,
- updatedRestResponse.getResponse());
-
- // update resource tags metadata: empty
- resourceTags = new ArrayList<String>();
- // set Tags
- resourceDetails.setTags(resourceTags);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_TAGS.name(), Empty_List,
- updatedRestResponse.getResponse());
-
- // update resource description metadata: 1 characters
- updatedTagField = "A";
- resourceTags = new ArrayList<String>();
- resourceTags.add(updatedTagField);
- resourceTags.add(resourceDetails.getName());
- // set description
- resourceDetails.setTags(resourceTags);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
- parseResponseAndValidate(resourceDetails, updatedRestResponse);
-
- // OK - tag up to 50 chars
- updatedTagField = "The Indian-crested.porcupine_The Indian cresteddds";
- resourceTags.add(updatedTagField);
- resourceDetails.setTags(resourceTags);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
- parseResponseAndValidate(resourceDetails, updatedRestResponse);
-
- // OK - sum is 1024, 50x20+48+20(commas)+6(cisco4 - resource name)
- String updatedTagField1 = "The Indian-crested.porcupine_The Indian crestedd01";
- String updatedTagField2 = "The Indian-crested.porcupine_The Indian crestedd02";
- String updatedTagField3 = "The Indian-crested.porcupine_The Indian crestedd03";
- String updatedTagField4 = "The Indian-crested.porcupine_The Indian crestedd04";
- String updatedTagField5 = "The Indian-crested.porcupine_The Indian crestedd05";
- String updatedTagField6 = "The Indian-crested.porcupine_The Indian crestedd06";
- String updatedTagField7 = "The Indian-crested.porcupine_The Indian crestedd07";
- String updatedTagField8 = "The Indian-crested.porcupine_The Indian crestedd08";
- String updatedTagField9 = "The Indian-crested.porcupine_The Indian crestedd09";
- String updatedTagField10 = "The Indian-crested.porcupine_The Indian crestedd10";
- String updatedTagField11 = "The Indian-crested.porcupine_The Indian crestedd11";
- String updatedTagField12 = "The Indian-crested.porcupine_The Indian crestedd12";
- String updatedTagField13 = "The Indian-crested.porcupine_The Indian crestedd13";
- String updatedTagField14 = "The Indian-crested.porcupine_The Indian crestedd14";
- String updatedTagField15 = "The Indian-crested.porcupine_The Indian crestedd15";
- String updatedTagField16 = "The Indian-crested.porcupine_The Indian crestedd16";
- String updatedTagField17 = "The Indian-crested.porcupine_The Indian crestedd17";
- String updatedTagField18 = "The Indian-crested.porcupine_The Indian crestedd18";
- String updatedTagField19 = "The Indian-crested.porcupine_The Indian crestaa";
-
- resourceTags = new ArrayList<String>();
- resourceTags.add(updatedTagField);
- resourceTags.add(updatedTagField1);
- resourceTags.add(updatedTagField2);
- resourceTags.add(updatedTagField3);
- resourceTags.add(updatedTagField4);
- resourceTags.add(updatedTagField5);
- resourceTags.add(updatedTagField6);
- resourceTags.add(updatedTagField7);
- resourceTags.add(updatedTagField8);
- resourceTags.add(updatedTagField9);
- resourceTags.add(updatedTagField10);
- resourceTags.add(updatedTagField11);
- resourceTags.add(updatedTagField12);
- resourceTags.add(updatedTagField13);
- resourceTags.add(updatedTagField14);
- resourceTags.add(updatedTagField15);
- resourceTags.add(updatedTagField16);
- resourceTags.add(updatedTagField17);
- resourceTags.add(updatedTagField18);
- resourceTags.add(updatedTagField19);
- resourceTags.add(resourceDetails.getName());
- // set description
- resourceDetails.setTags(resourceTags);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
- parseResponseAndValidate(resourceDetails, updatedRestResponse);
-
- // Add another tag-exceeds limit
- resourceTags.add("d");
- resourceDetails.setTags(resourceTags);
- ArrayList<String> myArray = new ArrayList<String>();
- myArray.add(0, "1024");
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_TAGS_EXCEED_LIMIT.name(), myArray,
- updatedRestResponse.getResponse());
-
- // Tag exceeds limit - 51
- resourceTags = new ArrayList<String>();
- updatedTagField = "The Indian-crested.porcupine_The Indian crestedddsw";
- resourceTags.add(updatedTagField);
- resourceTags.add(resourceDetails.getName());
- // set description
- resourceDetails.setTags(resourceTags);
- myArray.remove(0);
- myArray.add(0, "50");
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_SINGLE_TAG_EXCEED_LIMIT.name(), myArray,
- updatedRestResponse.getResponse());
-
- }
-
- @Test
- public void UpdateResource_DesriptionFieldValidation() throws Exception {
- // define and create resource
- RestResponse updatedRestResponse;
-
- RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
- String uniqueId = resourceDetails.getUniqueId();
- assertEquals("Check response code after create resource", 201, restResponse.getErrorCode().intValue());
- List<String> resource = new ArrayList<>();
- resource.add("Resource");
- // update resource description metadata: 0 characters
- String updatedDescription = "";
- // set description
- resourceDetails.setDescription(updatedDescription);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_DESCRIPTION.name(), resource,
- updatedRestResponse.getResponse());
-
- // update resource description metadata: null
- updatedDescription = null;
- // set description
- resourceDetails.setDescription(updatedDescription);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_DESCRIPTION.name(), resource,
- updatedRestResponse.getResponse());
-
- // update resource description metadata: 1 characters
- updatedDescription = "A";
- // set description
- resourceDetails.setDescription(updatedDescription);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
- parseResponseAndValidate(resourceDetails, updatedRestResponse);
-
- // update resource description metadata: 1024 characters
- updatedDescription = "The Indian crested porcupine *{Hystrix indica}*, or Indian porcupine is a member of the Old World porcupines."
- + "It is quite an adaptable rodent, found throughout southern Asia and the Middle East."
- + "It is tolerant of several different habitats: mountains, tropical and subtropical grasslands, scrublands, and forests."
- + "It is a large rodent, growing more than 0.9 m = (3 ft) long and weighing 14.5 kg = (32 lb)! [citation needed] It is covered in multiple layers of quills."
- + "The longest quills grow from its shoulders to about a third of the animal's length."
- + "Its tail is covered in short, hollow quills that can rattle when threatened."
- + "It has broad feet and long claws for digging. When attacked, the Indian crested porcupine raises its quills and rattles the hollow quills on its tail."
- + "If the predator persists past these threats, the porcupine launches a backwards assault, hoping to stab its attacker with its quills."
- + "It does this so effectively that most brushes between predators and the Indian porcupine end in death or severe injury";
- // set description
- resourceDetails.setDescription(updatedDescription);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
- parseResponseAndValidate(resourceDetails, updatedRestResponse);
-
- // update resource description metadata: 1025 characters
- updatedDescription = "The Indian crested porcupine *{Hystrix indica}*, or Indian porcupine is a member of the Old World porcupines."
- + "It is quite an adaptable rodent, found throughout southern Asia and the Middle East."
- + "It is tolerant of several different habitats: mountains, tropical and subtropical grasslands, scrublands, and forests."
- + "It is a large rodent, growing more than 0.9 m = (3 ft) long and weighing 14.5 kg = (32 lb)! [citation needed] It is covered in multiple layers of quills."
- + "The longest quills grow from its shoulders to about a third of the animal's length."
- + "Its tail is covered in short, hollow quills that can rattle when threatened."
- + "It has broad feet and long claws for digging. When attacked, the Indian crested porcupine raises its quills and rattles the hollow quills on its tail."
- + "If the predator persists past these threats, the porcupine launches a backwards assault, hoping to stab its attacker with its quills."
- + "It does this so effectively that most brushes between predators and the Indian porcupine end in death or severe injury.";
- // set description
- resourceDetails.setDescription(updatedDescription);
- resource.add(1, "1024");
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails, sdncModifierDetails, uniqueId,
- "");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_DESCRIPTION_EXCEEDS_LIMIT.name(), resource,
- updatedRestResponse.getResponse());
-
- }
-
- @Test
- public void UpdateResource_TagsFormatValidation() throws Exception {
- char[] notValidCharsArray = getTagInValidFormatChars();
-
- RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
- assertEquals("Check recourse created ", 201, restResponse.getErrorCode().intValue());
- String resourceName = resourceDetails.getName();
-
- // update tag details
- ResourceReqDetails updatedResourceDetails = defineUpdatedResourse(resourceName);
- ArrayList<String> resourceTags = new ArrayList<String>();
-
- String updatedTagField;
- RestResponse updatedRestResponse;
- List<String> variables = Arrays.asList("Resource", "tag");
-
- for (int i = 0; i < notValidCharsArray.length; i++) {
- updatedTagField = "UpdatedTag" + notValidCharsArray[i];
- resourceTags = new ArrayList<String>();
- resourceTags.add(updatedTagField);
- resourceTags.add(resourceDetails.getName());
- // set description
- updatedResourceDetails.setTags(resourceTags);
-
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails, sdncModifierDetails,
- resourceDetails.getUniqueId(), "");
- // validate response
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource",
- updatedRestResponse.getErrorCode());
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_FIELD_FORMAT.name(), variables,
- updatedRestResponse.getResponse());
- assertEquals("Check response code after updating resource icon", 400,
- updatedRestResponse.getErrorCode().intValue());
- assertEquals("Check response code after updating resource icon", "Bad Request",
- updatedRestResponse.getResponseMessage().toString());
-
- }
-
- }
-
- @Test
- public void UpdateResourceCategory_negativeFlow() throws Exception {
-
- RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
- assertEquals("Check response code after update resource", 201, restResponse.getErrorCode().intValue());
- Resource resourceBeforeUpdate = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
- String uniqueID = resourceDetails.getUniqueId();
-
- // Update resource Category Successfully
- ResourceReqDetails updatedResourceDetails = resourceDetails;
-
- updatedResourceDetails.removeAllCategories();
- updatedResourceDetails.addCategoryChain(ServiceCategoriesEnum.MOBILITY.getValue(),
- ResourceCategoryEnum.APPLICATION_L4_DATABASE.getSubCategory());
- RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails,
- sdncModifierDetails, resourceDetails.getUniqueId(), "");
-
- // validate response
- List<String> resourceList = new ArrayList<String>();
- resourceList.add(0, "Resource");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CATEGORY.name(), resourceList,
- updatedRestResponse.getResponse());
- assertEquals("Check response code after updating resource", 400, updatedRestResponse.getErrorCode().intValue());
-
- // Updating resource category
- updatedResourceDetails = defineUpdateResourceWithNonUpdatableFields(resourceBeforeUpdate);
- updatedResourceDetails.addCategory("");
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails, sdncModifierDetails,
- resourceDetails.getUniqueId(), "");
- // validate response
- resourceList = new ArrayList<String>();
- resourceList.add(0, "Resource");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_CATEGORY.name(), resourceList,
- updatedRestResponse.getResponse());
- assertEquals("Check response code after updating resource", 400, updatedRestResponse.getErrorCode().intValue());
-
- // Updating resource category
- updatedResourceDetails = defineUpdateResourceWithNonUpdatableFields(resourceBeforeUpdate);
- updatedResourceDetails.addCategory("XXXXXX");
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails, sdncModifierDetails,
- resourceDetails.getUniqueId(), "");
- // validate response
- resourceList = new ArrayList<String>();
- resourceList.add(0, "Resource");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_CATEGORY.name(), resourceList,
- updatedRestResponse.getResponse());
- assertEquals("Check response code after updating resource", 400, updatedRestResponse.getErrorCode().intValue());
-
- // CheckIn Resource
- logger.debug("Changing resource life cycle ");
- RestResponse checkoutResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKIN); // NOT_CERTIFIED_CHECKIN
- assertEquals("Check response code after checkin resource", 200, checkoutResource.getErrorCode().intValue());
-
- // Update resource Category
- updatedResourceDetails = defineUpdateResourceWithNonUpdatableFields(resourceBeforeUpdate);
- updatedResourceDetails.addCategory(ServiceCategoriesEnum.VOIP.getValue());
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails, sdncModifierDetails,
- resourceDetails.getUniqueId(), "");
- // verify response
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), Empty_List,
- updatedRestResponse.getResponse());
- assertEquals("Check response code after updating resource", 409, updatedRestResponse.getErrorCode().intValue());
-
- // CheckIn Resource
- logger.debug("Changing resource life cycle ");
- RestResponse checkinResource = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT); // NOT_CERTIFIED_CHECKIN
- assertNotNull("check response object is not null after checkout resource", checkoutResource);
- assertNotNull("check error code exists in response after checkIn resource", checkoutResource.getErrorCode());
- assertEquals("Check response code after checkin resource", 200, checkoutResource.getErrorCode().intValue());
-
- RestResponse getRestResponse = ResourceRestUtils.getResource(sdncModifierDetails, uniqueID);
- assertNotNull("check response object is not null after update resource", getRestResponse);
- parseResponseAndValidate(resourceDetails, getRestResponse);
-
- }
-
- @Test
- public void UpdateResourceCategorySuccessfully() throws Exception {
-
- RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
- assertEquals("Check response code after update resource", 201, restResponse.getErrorCode().intValue());
- Resource resourceBeforeUpdate = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
-
- // Update resource Category Successfully
- ResourceReqDetails updatedResourceDetails = resourceDetails;
-
- updatedResourceDetails.removeAllCategories();
- updatedResourceDetails.addCategoryChain(ResourceCategoryEnum.APPLICATION_L4_DATABASE.getCategory(),
- ResourceCategoryEnum.APPLICATION_L4_DATABASE.getSubCategory());
- RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails,
- sdncModifierDetails, resourceDetails.getUniqueId(), "");
-
- // validate response
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- assertEquals("Check response code after update resource", 200, updatedRestResponse.getErrorCode().intValue());
- // parseResponseAndValidateNonUpdatable(updatedResourceDetails,
- // updatedRestResponse);
- parseResponseAndValidate(updatedResourceDetails, updatedRestResponse);
-
- // validate category updated
- assertTrue(updatedResourceDetails.getCategories().get(0).getName()
- .equals(ResourceCategoryEnum.APPLICATION_L4_DATABASE.getCategory()));
-
- RestResponse getRestResponse = ResourceRestUtils.getResource(sdncModifierDetails,
- resourceDetails.getUniqueId());
- assertNotNull("check response object is not null after update resource", getRestResponse);
- parseResponseAndValidate(updatedResourceDetails, getRestResponse);
-
- ResourceRestUtils.deleteResourceByNameAndVersion(sdncModifierDetails, updatedResourceDetails.getName(), "0.1");
- }
-
- // Benny
-
- @Test
- public void Validation_UpdateIcon() throws Exception {
- // Fields to update (Forbidden)
- String _updatedIcon = "mySecondIcon.Jpg";
-
- // administrator permissions
- User sdncAdminModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-
- // define and create resource
- ResourceRestUtils.deleteResourceByNameAndVersion(sdncAdminModifierDetails, resourceDetails.getName(), "0.1");
-
- RestResponse restResponse = createResource(sdncAdminModifierDetails, resourceDetails);
- assertEquals("Check response code after create resource", 201, restResponse.getErrorCode().intValue());
- String resourceName = resourceDetails.getName();
-
- // update metadata details
- ResourceReqDetails updatedResourceDetails = defineUpdatedResourse(resourceName);
- // change icon of metadata
- updatedResourceDetails.setIcon(_updatedIcon);
- // PUT request
- RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails,
- sdncAdminModifierDetails, resourceDetails.getUniqueId(), "");
-
- // validate response
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_INVALID_ICON.name(),
- Arrays.asList("Resource"), updatedRestResponse.getResponse());
-
- // empty icon
- _updatedIcon = "";
- updatedResourceDetails.setIcon(_updatedIcon);
- updatedRestResponse = ResourceRestUtils.updateResourceMetadata(updatedResourceDetails, sdncAdminModifierDetails,
- resourceDetails.getUniqueId(), "");
- assertNotNull("check response object is not null after update resource", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_MISSING_ICON.name(),
- Arrays.asList("Resource"), updatedRestResponse.getResponse());
-
- // get resource with original name. original metadata should be returned
- RestResponse getRestResponse = ResourceRestUtils.getResource(sdncAdminModifierDetails,
- resourceDetails.getUniqueId());
- // validate response
- assertNotNull("check response object is not null after get resource", getRestResponse);
- assertNotNull("check error code exists in response after get resource", getRestResponse.getErrorCode());
- assertEquals("Check response code after update resource", 200, getRestResponse.getErrorCode().intValue());
-
- // parse updated response to javaObject
- Resource getResourceRespJavaObject = ResponseParser
- .convertResourceResponseToJavaObject(getRestResponse.getResponse());
- // validate that metadata was not changed
- ResourceValidationUtils.validateResourceReqVsResp(resourceDetails, getResourceRespJavaObject);
-
- ResourceRestUtils.deleteResourceByNameAndVersion(sdncAdminModifierDetails, updatedResourceDetails.getName(),
- "0.1");
-
- }
-
- @Test
- public void UpdateResourceTypeSuccess() throws Exception {
- // LCS is CheckOut
- String newResourceType = ResourceTypeEnum.VL.toString();
- String currentResourceType = resourceDetails.getResourceType();
- RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
- assertEquals("Check response code after create resource", 201, restResponse.getErrorCode().intValue());
- Resource currentResourceJavaObject = ResponseParser
- .convertResourceResponseToJavaObject(restResponse.getResponse());
-
- resourceDetails.setResourceType(newResourceType);
- RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails,
- sdncModifierDetails, currentResourceJavaObject.getUniqueId(), "");
- assertEquals("Check response code after create resource", 200, updatedRestResponse.getErrorCode().intValue());
- Resource updatedResourceJavaObject = ResponseParser
- .convertResourceResponseToJavaObject(updatedRestResponse.getResponse());
- // assertTrue("Check resource type after update resource",
- // updatedResourceJavaObject.getResourceType().toString().equals(resourceType));
- assertTrue("Check resource type after update resource",
- updatedResourceJavaObject.getResourceType().toString().equals(currentResourceType));
-
- }
-
- @Test
- public void UpdateResourceTypeAndNameSuccess() throws Exception {
- // LCS is CheckOut
- String newResourceType = ResourceTypeEnum.VL.toString();
- String currentResourceType = resourceDetails.getResourceType();
- String newResourceName = "new Name";
-
- RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
- assertEquals("Check response code after create resource", 201, restResponse.getErrorCode().intValue());
- Resource currentResourceJavaObject = ResponseParser
- .convertResourceResponseToJavaObject(restResponse.getResponse());
-
- resourceDetails.setResourceType(newResourceType);
- resourceDetails.setName(newResourceName);
- List<String> tags = resourceDetails.getTags();
- tags.add(newResourceName);
- resourceDetails.setTags(tags);
-
- RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails,
- sdncModifierDetails, currentResourceJavaObject.getUniqueId(), "");
- assertEquals("Check response code after create resource", 200, updatedRestResponse.getErrorCode().intValue());
- Resource updatedResourceJavaObject = ResponseParser
- .convertResourceResponseToJavaObject(updatedRestResponse.getResponse());
- assertTrue("Check resource type after update resource",
- updatedResourceJavaObject.getResourceType().toString().equals(currentResourceType));
- assertTrue("Check resource name after update resource",
- updatedResourceJavaObject.getName().equals(newResourceName));
-
- }
-
- @Test
- public void UpdateResourceTypeAfterResourceCertification() throws Exception {
-
- String newResourceType = ResourceTypeEnum.VF.toString();
- String currentResourceType = resourceDetails.getResourceType();
- RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
- assertEquals("Check response code after create resource", 201, restResponse.getErrorCode().intValue());
- Resource currentResourceJavaObject = ResponseParser
- .convertResourceResponseToJavaObject(restResponse.getResponse());
-
- resourceDetails.setResourceType(newResourceType);
- restResponse = LifecycleRestUtils.certifyResource(resourceDetails);
- assertEquals("Check response code after resource CheckIn", 200, restResponse.getErrorCode().intValue());
- restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
- LifeCycleStatesEnum.CHECKOUT);
- assertEquals("Check response code after resource CheckIn", 200, restResponse.getErrorCode().intValue());
- currentResourceJavaObject = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
-
- RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails,
- sdncModifierDetails, currentResourceJavaObject.getUniqueId(), "");
- assertEquals("Check response code after create resource", 200, updatedRestResponse.getErrorCode().intValue());
- Resource updatedResourceJavaObject = ResponseParser
- .convertResourceResponseToJavaObject(updatedRestResponse.getResponse());
- // assertTrue("Check resource type after update resource",
- // updatedResourceJavaObject.getResourceType().toString().equals(newResourceType));
- assertTrue("Check resource type after update resource",
- updatedResourceJavaObject.getResourceType().toString().equals(currentResourceType));
-
- }
-
- @Test
- public void UpdateResourceTypeCheckInLCS() throws Exception {
-
- String resourceType = ResourceTypeEnum.VL.toString();
- RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
- assertEquals("Check response code after create resource", 201, restResponse.getErrorCode().intValue());
- Resource currentResourceJavaObject = ResponseParser
- .convertResourceResponseToJavaObject(restResponse.getResponse());
-
- resourceDetails.setResourceType(resourceType);
- restResponse = LifecycleRestUtils.changeResourceState(resourceDetails, sdncModifierDetails,
- LifeCycleStatesEnum.CHECKIN);
- assertEquals("Check response code after resource CheckIn", 200, restResponse.getErrorCode().intValue());
-
- RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails,
- sdncModifierDetails, currentResourceJavaObject.getUniqueId(), "");
-
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESTRICTED_OPERATION.name());
-
- assertNotNull("check response object is not null after create resouce", updatedRestResponse);
- assertNotNull("check error code exists in response after create resource", updatedRestResponse.getErrorCode());
- assertEquals("Check response code after create resource", errorInfo.getCode(),
- updatedRestResponse.getErrorCode());
-
- List<String> variables = new ArrayList<>();
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), variables,
- updatedRestResponse.getResponse());
-
- }
-
- @Test
- public void UpdateResourceTypeCertifiedLCS() throws Exception {
-
- String resourceType = ResourceTypeEnum.VL.toString();
- RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
- assertEquals("Check response code after create resource", 201, restResponse.getErrorCode().intValue());
- Resource currentResourceJavaObject = ResponseParser
- .convertResourceResponseToJavaObject(restResponse.getResponse());
-
- restResponse = LifecycleRestUtils.certifyResource(resourceDetails);
- assertEquals("Check response code after resource CheckIn", 200, restResponse.getErrorCode().intValue());
-
- resourceDetails.setResourceType(resourceType);
- RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails,
- sdncModifierDetails, currentResourceJavaObject.getUniqueId(), "");
-
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESTRICTED_OPERATION.name());
-
- assertNotNull("check response object is not null after create resouce", updatedRestResponse);
- assertNotNull("check error code exists in response after create resource", updatedRestResponse.getErrorCode());
- assertEquals("Check response code after create resource", errorInfo.getCode(),
- updatedRestResponse.getErrorCode());
-
- List<String> variables = new ArrayList<>();
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_OPERATION.name(), variables,
- updatedRestResponse.getResponse());
-
- }
-
- @Test
- public void UpdateResourceTypeInvalidType() throws Exception {
-
- String resourceType = "INVALID TYPE";
- RestResponse restResponse = createResource(sdncModifierDetails, resourceDetails);
- assertEquals("Check response code after create resource", 201, restResponse.getErrorCode().intValue());
- Resource currentResourceJavaObject = ResponseParser
- .convertResourceResponseToJavaObject(restResponse.getResponse());
-
- resourceDetails.setResourceType(resourceType);
- RestResponse updatedRestResponse = ResourceRestUtils.updateResourceMetadata(resourceDetails,
- sdncModifierDetails, currentResourceJavaObject.getUniqueId(), "");
-
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_CONTENT.name());
-
- assertNotNull("check response object is not null after update resouce", updatedRestResponse);
- assertNotNull("check error code exists in response after update resource", updatedRestResponse.getErrorCode());
- assertEquals("Check response code after update resource", errorInfo.getCode(),
- updatedRestResponse.getErrorCode());
-
- List<String> variables = new ArrayList<>();
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_CONTENT.name(), variables,
- updatedRestResponse.getResponse());
-
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/VFResourceInstanceNameCRUD.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/VFResourceInstanceNameCRUD.java
deleted file mode 100644
index 82a894f4eb..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/VFResourceInstanceNameCRUD.java
+++ /dev/null
@@ -1,473 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.resource;
-
-import com.google.gson.Gson;
-import fj.data.Either;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.ComponentInstance;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
-import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-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.*;
-import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertTrue;
-
-public class VFResourceInstanceNameCRUD extends ComponentBaseTest {
-
- protected static ServiceReqDetails serviceDetails;
- protected static ResourceReqDetails resourceDetailsVFC;
- protected static ResourceReqDetails resourceDetailsVL;
- protected static ResourceReqDetails resourceDetailsVF;
- protected static ResourceReqDetails resourceDetailsCP;
- protected static ComponentInstanceReqDetails resourceInstanceReqDetailsVF;
- protected static ComponentInstanceReqDetails resourceInstanceReqDetailsVFC;
- protected static ComponentInstanceReqDetails resourceInstanceReqDetailsVL;
- protected static ComponentInstanceReqDetails resourceInstanceReqDetailsCP;
- protected static User sdncDesignerDetails1;
- protected static User sdncTesterDeatails1;
- protected static User sdncAdminDetails1;
- protected static ArtifactReqDetails heatArtifactDetails;
- protected static ArtifactReqDetails defaultArtifactDetails;
- protected static int maxLength = 50;
- protected static Resource resourceVF = null;
-
- @Rule
- public static TestName name = new TestName();
-
- public VFResourceInstanceNameCRUD() {
- super(name, VFResourceInstanceNameCRUD.class.getName());
- }
-
- @BeforeMethod
-
- public void init() throws Exception {
-
- // serviceDetails = ElementFactory.getDefaultService();
- // resourceDetailsVFC =
- // ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VFC.toString(),
- // "resourceVFC");
- // resourceDetailsVF =
- // ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF.toString(),
- // "resourceVF3");
- // resourceDetailsVL =
- // ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VL.toString(),
- // "resourceVL");
- // resourceDetailsCP =
- // ElementFactory.getDefaultResourceByType(ResourceTypeEnum.CP.toString(),
- // "resourceCP");
- sdncDesignerDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- sdncTesterDeatails1 = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
- sdncAdminDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- // heatArtifactDetails =
- // ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
-
- Either<Resource, RestResponse> resourceDetailsCP_01e = AtomicOperationUtils
- .createResourceByType(ResourceTypeEnum.CP, UserRoleEnum.DESIGNER, true);
- AtomicOperationUtils.changeComponentState(resourceDetailsCP_01e.left().value(), UserRoleEnum.DESIGNER,
- LifeCycleStatesEnum.CHECKIN, true);
- resourceDetailsCP = new ResourceReqDetails(resourceDetailsCP_01e.left().value());
- Either<Resource, RestResponse> resourceDetailsVL_01e = AtomicOperationUtils
- .createResourceByType(ResourceTypeEnum.VL, UserRoleEnum.DESIGNER, true);
- AtomicOperationUtils.changeComponentState(resourceDetailsVL_01e.left().value(), UserRoleEnum.DESIGNER,
- LifeCycleStatesEnum.CHECKIN, true);
- resourceDetailsVL = new ResourceReqDetails(resourceDetailsVL_01e.left().value());
- Either<Resource, RestResponse> resourceDetailsVF_01e = AtomicOperationUtils
- .createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true);
- resourceDetailsVF = new ResourceReqDetails(resourceDetailsVF_01e.left().value());
- Either<Resource, RestResponse> resourceDetailsVFC_01e = AtomicOperationUtils
- .createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true);
- AtomicOperationUtils.changeComponentState(resourceDetailsVFC_01e.left().value(), UserRoleEnum.DESIGNER,
- LifeCycleStatesEnum.CHECKIN, true);
- resourceDetailsVFC = new ResourceReqDetails(resourceDetailsVFC_01e.left().value());
-
- resourceInstanceReqDetailsVFC = ElementFactory.getDefaultComponentInstance("VFC", resourceDetailsVFC);
- resourceInstanceReqDetailsVF = ElementFactory.getDefaultComponentInstance("VF", resourceDetailsVF);
- resourceInstanceReqDetailsVL = ElementFactory.getDefaultComponentInstance("VL", resourceDetailsVL);
- resourceInstanceReqDetailsCP = ElementFactory.getDefaultComponentInstance("CP", resourceDetailsCP);
- sdncDesignerDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- sdncTesterDeatails1 = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
- sdncAdminDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-
- }
-
- @Test
- public void addResourceInstanceToVF() throws Exception {
-
- createVFWithCertifiedResourceInstance(resourceDetailsCP, resourceInstanceReqDetailsCP);
- // validate RI name
- List<ComponentInstance> resourceInstances = resourceVF.getComponentInstances();
- List<String> resourceInstanceListName = new ArrayList<String>();
- for (int i = 0; i < resourceInstances.size(); i++) {
- resourceInstanceListName.add(resourceInstances.get(i).getName());
- }
- List<String> resourceInstanceExpectedListName = new ArrayList<String>();
- resourceInstanceExpectedListName.add(resourceInstanceReqDetailsCP.getName() + " 1");
- String message = "resource instance name";
- Utils.compareArrayLists(resourceInstanceListName, resourceInstanceExpectedListName, message);
-
- }
-
- @Test
- public void updateResourceInstanceName() throws Exception {
-
- // update resource instance name
- String resourceInstanceUpdatedName = "resource New 2";
-
- ResourceReqDetails updatedResourceDetailsVLC = changeResouceName(resourceDetailsVFC,
- resourceInstanceUpdatedName);
- createVFWithCertifiedResourceInstance(updatedResourceDetailsVLC, resourceInstanceReqDetailsVFC);
-
- resourceInstanceReqDetailsVFC.setName(resourceInstanceUpdatedName);
- RestResponse updateResourceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(
- resourceInstanceReqDetailsVFC, sdncDesignerDetails1, resourceVF.getUniqueId(),
- ComponentTypeEnum.RESOURCE);
- assertTrue(updateResourceInstanceResponse.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
-
- resourceVF = convertResourceGetResponseToJavaObject(resourceDetailsVF);
-
- // validate RI name
- List<ComponentInstance> resourceInstances = resourceVF.getComponentInstances();
- List<String> resourceInstanceListName = new ArrayList<String>();
- for (int i = 0; i < resourceInstances.size(); i++) {
- resourceInstanceListName.add(resourceInstances.get(i).getName());
- }
- List<String> resourceInstanceExpectedListName = new ArrayList<String>();
- resourceInstanceExpectedListName.add(resourceInstanceUpdatedName);
- String message = "resource instance name";
- Utils.compareArrayLists(resourceInstanceListName, resourceInstanceExpectedListName, message);
-
- }
-
- @Test
- public void updateResourceInstanceNameToNextGeneratedName() throws Exception {
-
- // update resource instance name
- String resourceInstanceUpdatedName = resourceInstanceReqDetailsCP.getName() + " 2";
-
- ResourceReqDetails updatedResourceDetailsVL = changeResouceName(resourceDetailsVL, resourceInstanceUpdatedName);
- createVFWithCertifiedResourceInstance(updatedResourceDetailsVL, resourceInstanceReqDetailsVL);
- resourceInstanceReqDetailsCP.setName(resourceInstanceUpdatedName);
-
- // add second resource instance
- RestResponse response = ComponentInstanceRestUtils.createComponentInstance(resourceInstanceReqDetailsCP,
- sdncDesignerDetails1, resourceVF);
- assertEquals("Check response code after create RI", 201, response.getErrorCode().intValue());
- resourceVF = convertResourceGetResponseToJavaObject(resourceDetailsVF);
-
- // validate RI name
- List<ComponentInstance> resourceInstances = resourceVF.getComponentInstances();
- List<String> resourceInstanceListName = new ArrayList<String>();
- for (int i = 0; i < resourceInstances.size(); i++) {
- resourceInstanceListName.add(resourceInstances.get(i).getName());
- }
- List<String> resourceInstanceExpectedListName = new ArrayList<String>();
- resourceInstanceExpectedListName.add(resourceInstanceReqDetailsVL.getName() + " 1");
- resourceInstanceExpectedListName.add(resourceInstanceReqDetailsCP.getName() + " 2");
- String message = "resource instance name";
- Utils.compareArrayLists(resourceInstanceListName, resourceInstanceExpectedListName, message);
-
- }
-
- @Test
- public void normolizeUpdatedResourceInstanceName() throws Exception {
-
- String resourceInstanceUpdatedName = "resource new - .2";
- String normalizedName = "resourcenew2";
-
- ResourceReqDetails updatedResourceDetailsVL = changeResouceName(resourceDetailsVL, resourceInstanceUpdatedName);
-
- createVFWithCertifiedResourceInstance(updatedResourceDetailsVL, resourceInstanceReqDetailsVL);
- // update resource instance name
- resourceInstanceReqDetailsCP.setName(resourceInstanceUpdatedName);
-
- // add second resource instance
- RestResponse response = ComponentInstanceRestUtils.createComponentInstance(resourceInstanceReqDetailsCP,
- sdncDesignerDetails1, resourceVF);
- assertEquals("Check response code after create RI", 201, response.getErrorCode().intValue());
- resourceVF = convertResourceGetResponseToJavaObject(resourceDetailsVF);
-
- // validate RI name
- List<ComponentInstance> resourceInstances = resourceVF.getComponentInstances();
- List<String> resourceInstanceListName = new ArrayList<String>();
- for (int i = 0; i < resourceInstances.size(); i++) {
- resourceInstanceListName.add(resourceInstances.get(i).getName());
- }
- List<String> resourceInstanceExpectedListName = new ArrayList<String>();
- resourceInstanceExpectedListName.add(resourceInstanceReqDetailsVL.getName() + " 1");
- resourceInstanceExpectedListName.add(resourceInstanceReqDetailsCP.getName() + " 2");
- String message = "resource instance name";
- Utils.compareArrayLists(resourceInstanceListName, resourceInstanceExpectedListName, message);
-
- }
-
- @Test
- public void updatedResourceInstanceNameToEmpty() throws Exception {
-
- createVFWithCertifiedResourceInstance(resourceDetailsVL, resourceInstanceReqDetailsVL);
- String resourceInstanceUpdatedName = "";
- String resourceInstancePreviousName = resourceDetailsCP.getName();
-
- // add second resource instance
- RestResponse response = ComponentInstanceRestUtils.createComponentInstance(resourceInstanceReqDetailsCP,
- sdncDesignerDetails1, resourceVF);
- assertEquals("Check response code after create RI", 201, response.getErrorCode().intValue());
- resourceVF = convertResourceGetResponseToJavaObject(resourceDetailsVF);
-
- resourceInstanceReqDetailsCP.setName(resourceInstanceUpdatedName);
- RestResponse updateResourceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(
- resourceInstanceReqDetailsCP, sdncDesignerDetails1, resourceVF.getUniqueId(),
- ComponentTypeEnum.RESOURCE);
- assertEquals("Check response code after RI update request", 200,
- updateResourceInstanceResponse.getErrorCode().intValue());
- // change request
- // ErrorInfo errorInfo =
- // Utils.parseYaml(ActionStatus.MISSING_COMPONENT_NAME.name());
- // utils.validateResponseCode(updateResourceInstanceResponse,
- // errorInfo.getCode(), "update resource instance");
- //
- // List<String> variables = Arrays.asList("Resource Instance");
- // ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.MISSING_COMPONENT_NAME.name(),
- // variables, updateResourceInstanceResponse.getResponse());
-
- resourceVF = convertResourceGetResponseToJavaObject(resourceDetailsVF);
-
- // validate RI name
- List<ComponentInstance> resourceInstances = resourceVF.getComponentInstances();
- List<String> resourceInstanceListName = new ArrayList<String>();
- for (int i = 0; i < resourceInstances.size(); i++) {
- resourceInstanceListName.add(resourceInstances.get(i).getName());
- }
- List<String> resourceInstanceExpectedListName = new ArrayList<String>();
- resourceInstanceExpectedListName.add(resourceInstanceReqDetailsVL.getName() + " 1");
- resourceInstanceExpectedListName.add(resourceInstancePreviousName + " 3");
- String message = "resource instance name";
- Utils.compareArrayLists(resourceInstanceListName, resourceInstanceExpectedListName, message);
-
- }
-
- @Test
- public void updatedResourceNameLengthExceedMaximumCharacters() throws Exception {
-
- String resourceInstancePreviousName = resourceDetailsCP.getName();
- // update resource instance name
- String resourceInstanceUpdatedName = "a";
- for (int i = 0; i < maxLength; i++) {
- resourceInstanceUpdatedName += "b";
- }
- // ResourceReqDetails updatedResourceDetailsVL =
- // changeResouceName(resourceDetailsVL, resourceInstanceUpdatedName);
-
- createVFWithCertifiedResourceInstance(resourceDetailsVL, resourceInstanceReqDetailsVL);
- // add second resource instance
- RestResponse response = ComponentInstanceRestUtils.createComponentInstance(resourceInstanceReqDetailsCP,
- sdncDesignerDetails1, resourceVF);
- assertEquals("Check response code after create RI", 201, response.getErrorCode().intValue());
- resourceVF = convertResourceGetResponseToJavaObject(resourceDetailsVF);
-
- String prevName = resourceInstanceReqDetailsCP.getName();
- resourceInstanceReqDetailsCP.setName(resourceInstanceUpdatedName);
- RestResponse updateResourceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(
- resourceInstanceReqDetailsCP, sdncDesignerDetails1, resourceVF.getUniqueId(),
- ComponentTypeEnum.RESOURCE);
- ErrorInfo errorInfo = ErrorValidationUtils
- .parseErrorConfigYaml(ActionStatus.COMPONENT_NAME_EXCEEDS_LIMIT.name());
- // utils.validateResponseCode(updateResourceInstanceResponse,
- // errorInfo.getCode(), "update resource instance");
-
- List<String> variables = Arrays.asList("Resource Instance", "50");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_NAME_EXCEEDS_LIMIT.name(), variables,
- updateResourceInstanceResponse.getResponse());
-
- resourceInstanceReqDetailsCP.setName(prevName);
- // validate RI name
- List<ComponentInstance> resourceInstances = resourceVF.getComponentInstances();
- List<String> resourceInstanceListName = new ArrayList<String>();
- for (int i = 0; i < resourceInstances.size(); i++) {
- resourceInstanceListName.add(resourceInstances.get(i).getName());
- }
- List<String> resourceInstanceExpectedListName = new ArrayList<String>();
- resourceInstanceExpectedListName.add(resourceInstanceReqDetailsVL.getName() + " 1");
- resourceInstanceExpectedListName.add(resourceInstanceReqDetailsCP.getName() + " 2");
- String message = "resource instance name";
- Utils.compareArrayLists(resourceInstanceListName, resourceInstanceExpectedListName, message);
-
- }
-
- @Test
- public void updatedResourceNameWithUnSupportedCharacters() throws Exception {
-
- createVFWithCertifiedResourceInstance(resourceDetailsVL, resourceInstanceReqDetailsVL);
- String resourceInstancePreviousName = resourceDetailsCP.getName();
- // update resource instance name
- String resourceInstanceUpdatedName = "a???<>";
-
- // add second resource instance
- RestResponse response = ComponentInstanceRestUtils.createComponentInstance(resourceInstanceReqDetailsCP,
- sdncDesignerDetails1, resourceVF);
- assertEquals("Check response code after create RI", 201, response.getErrorCode().intValue());
- resourceVF = convertResourceGetResponseToJavaObject(resourceDetailsVF);
-
- String prevValue = resourceInstanceReqDetailsCP.getName();
- resourceInstanceReqDetailsCP.setName(resourceInstanceUpdatedName);
- RestResponse updateResourceInstanceResponse = ComponentInstanceRestUtils.updateComponentInstance(
- resourceInstanceReqDetailsCP, sdncDesignerDetails1, resourceVF.getUniqueId(),
- ComponentTypeEnum.RESOURCE);
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_COMPONENT_NAME.name());
- // ResourceRestUtils.validateResponseCode(updateResourceInstanceResponse,
- // errorInfo.getCode(), "update resource instance");
-
- List<String> variables = Arrays.asList("Resource Instance");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_COMPONENT_NAME.name(), variables,
- updateResourceInstanceResponse.getResponse());
-
- resourceInstanceReqDetailsCP.setName(prevValue);
-
- // validate RI name
- List<ComponentInstance> resourceInstances = resourceVF.getComponentInstances();
- List<String> resourceInstanceListName = new ArrayList<String>();
- for (int i = 0; i < resourceInstances.size(); i++) {
- resourceInstanceListName.add(resourceInstances.get(i).getName());
- }
- List<String> resourceInstanceExpectedListName = new ArrayList<String>();
- resourceInstanceExpectedListName.add(resourceInstanceReqDetailsVL.getName() + " 1");
- resourceInstanceExpectedListName.add(resourceInstanceReqDetailsCP.getName() + " 2");
- String message = "resource instance name";
- Utils.compareArrayLists(resourceInstanceListName, resourceInstanceExpectedListName, message);
-
- }
-
- private static ResourceReqDetails changeResouceName(ResourceReqDetails resourceDet,
- String resourceInstanceUpdatedName) throws Exception {
-
- ResourceReqDetails updatedResourceDetails = new ResourceReqDetails();
- updatedResourceDetails = resourceDet;
- updatedResourceDetails.setName(resourceInstanceUpdatedName);
- List<String> tags = new ArrayList<String>();
- tags.add(resourceInstanceUpdatedName);
- updatedResourceDetails.setTags(tags);
- Gson gson = new Gson();
- String updatedResourceBodyJson = gson.toJson(updatedResourceDetails);
- RestResponse response = LifecycleRestUtils.changeResourceState(resourceDet, sdncDesignerDetails1,
- resourceDet.getVersion(), LifeCycleStatesEnum.CHECKOUT);
- assertTrue("change LS state to CHECKOUT, returned status:" + response.getErrorCode(),
- response.getErrorCode() == 200);
- response = ResourceRestUtils.updateResourceMetadata(updatedResourceBodyJson, sdncDesignerDetails1,
- updatedResourceDetails.getUniqueId());
- assertEquals("Check response code after updateresource name", 200, response.getErrorCode().intValue());
- response = LifecycleRestUtils.changeResourceState(updatedResourceDetails, sdncDesignerDetails1,
- resourceDet.getVersion(), LifeCycleStatesEnum.CHECKIN);
-
- return updatedResourceDetails;
-
- }
-
- // private Component changeResouceName(Resource resourceDet, String
- // resourceInstanceUpdatedName) throws Exception{
- //
- // User defaultUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- // Resource updatedResourceDetails = resourceDet;
- // RestResponse response =
- // LifecycleRestUtils.changeComponentState(updatedResourceDetails,
- // defaultUser, LifeCycleStatesEnum.CHECKOUT, "state changed");
- // assertTrue("change LS state to CHECKOUT, returned status:" +
- // response.getErrorCode(),response.getErrorCode() == 200);
- // updatedResourceDetails.setName(resourceInstanceUpdatedName);
- // List<String> tags = new ArrayList<String>();
- // tags.add(resourceInstanceUpdatedName);
- // updatedResourceDetails.setTags(tags);
- // Gson gson = new Gson();
- // ResourceReqDetails resourceReqDetails = new
- // ResourceReqDetails(updatedResourceDetails);
- // String updatedResourceBodyJson = gson.toJson(resourceReqDetails);
- // response = ResourceRestUtils.updateResource(updatedResourceBodyJson,
- // defaultUser, updatedResourceDetails.getUniqueId());
- // assertEquals("Check response code after updateresource name", 200,
- // response.getErrorCode().intValue());
- // response =
- // LifecycleRestUtils.changeComponentState(updatedResourceDetails,
- // defaultUser, LifeCycleStatesEnum.CHECKIN, "state changed");
- // assertEquals("Check response code after updateresource name", 200,
- // response.getErrorCode().intValue());
- //
- // return updatedResourceDetails;
- //
- // }
-
- private void createVFWithCertifiedResourceInstance(ResourceReqDetails resourceDetails,
- ComponentInstanceReqDetails resourceInstanceReqDetails) throws Exception {
-
- RestResponse response = LifecycleRestUtils.changeResourceState(resourceDetails, sdncDesignerDetails1,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
- assertEquals("Check response code after CHECKOUT", 200, response.getErrorCode().intValue());
-
- // add heat artifact to resource and certify
- ArtifactReqDetails heatArtifactDetails = ElementFactory
- .getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
- response = ArtifactRestUtils.addInformationalArtifactToResource(heatArtifactDetails, sdncDesignerDetails1,
- resourceDetails.getUniqueId());
- assertTrue("add HEAT artifact to resource request returned status:" + response.getErrorCode(),
- response.getErrorCode() == 200);
- response = LifecycleRestUtils.certifyResource(resourceDetails);
- assertEquals("Check response code after CERTIFY request", 200, response.getErrorCode().intValue());
-
- resourceVF = convertResourceGetResponseToJavaObject(resourceDetailsVF);
-
- resourceInstanceReqDetails.setComponentUid(resourceDetails.getUniqueId());
- response = ComponentInstanceRestUtils.createComponentInstance(resourceInstanceReqDetails, sdncDesignerDetails1,
- resourceVF);
- assertEquals("Check response code after create RI", 201, response.getErrorCode().intValue());
-
- resourceVF = convertResourceGetResponseToJavaObject(resourceDetailsVF);
- }
-
- protected Resource convertResourceGetResponseToJavaObject(ResourceReqDetails resourceDetails) throws IOException {
- RestResponse response = ResourceRestUtils.getResource(resourceDetails, sdncDesignerDetails1);
- assertEquals("Check response code after get resource", 200, response.getErrorCode().intValue());
- return ResponseParser.convertResourceResponseToJavaObject(response.getResponse());
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/ValidateExtendedVfData.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/ValidateExtendedVfData.java
deleted file mode 100644
index c731b59184..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/resource/ValidateExtendedVfData.java
+++ /dev/null
@@ -1,309 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.resource;
-
-import fj.data.Either;
-import org.json.simple.JSONArray;
-import org.json.simple.JSONObject;
-import org.json.simple.JSONValue;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.ComponentInstance;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-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.rest.ResourceRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.util.List;
-
-import static org.testng.AssertJUnit.assertNotNull;
-import static org.testng.AssertJUnit.assertTrue;
-
-public class ValidateExtendedVfData extends ComponentBaseTest {
-
- protected Resource resourceDetailsVF;
- protected Resource resourceDetailsCP_01;
- protected Resource resourceDetailsVL_01;
- protected Resource resourceDetailsVFCcomp;
-
- protected User sdncUserDetails;
-
- @Rule
- public static TestName name = new TestName();
-
- public ValidateExtendedVfData() {
- super(name, ValidateExtendedVfData.class.getName());
- }
-
- @BeforeMethod
- public void create() throws Exception {
-
- sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
-
- Either<Resource, RestResponse> resourceDetailsVFe = AtomicOperationUtils
- .createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true);
- resourceDetailsVF = resourceDetailsVFe.left().value();
- Either<Resource, RestResponse> resourceDetailsCP_01e = AtomicOperationUtils
- .createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.CP, NormativeTypesEnum.PORT,
- ResourceCategoryEnum.GENERIC_DATABASE, UserRoleEnum.DESIGNER, true);
- resourceDetailsCP_01 = resourceDetailsCP_01e.left().value();
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT, resourceDetailsCP_01, UserRoleEnum.DESIGNER,
- true, true);
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT_VOL, resourceDetailsCP_01,
- UserRoleEnum.DESIGNER, true, true);
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT_VOL, resourceDetailsCP_01,
- UserRoleEnum.DESIGNER, true, true);
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT_NET, resourceDetailsCP_01,
- UserRoleEnum.DESIGNER, true, true);
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.OTHER, resourceDetailsCP_01, UserRoleEnum.DESIGNER,
- true, true);
- AtomicOperationUtils.changeComponentState(resourceDetailsCP_01, UserRoleEnum.DESIGNER,
- LifeCycleStatesEnum.CERTIFY, true);
- Either<Resource, RestResponse> resourceDetailsVL_01e = AtomicOperationUtils
- .createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VL, NormativeTypesEnum.NETWORK,
- ResourceCategoryEnum.GENERIC_NETWORK_ELEMENTS, UserRoleEnum.DESIGNER, true);
- resourceDetailsVL_01 = resourceDetailsVL_01e.left().value();
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT, resourceDetailsVL_01, UserRoleEnum.DESIGNER,
- true, true);
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT_VOL, resourceDetailsVL_01,
- UserRoleEnum.DESIGNER, true, true);
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT_VOL, resourceDetailsVL_01,
- UserRoleEnum.DESIGNER, true, true);
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT_NET, resourceDetailsVL_01,
- UserRoleEnum.DESIGNER, true, true);
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.OTHER, resourceDetailsVL_01, UserRoleEnum.DESIGNER,
- true, true);
- AtomicOperationUtils.changeComponentState(resourceDetailsVL_01, UserRoleEnum.DESIGNER,
- LifeCycleStatesEnum.CERTIFY, true);
-
- Either<Resource, RestResponse> resourceDetailsVFCcompE = AtomicOperationUtils
- .createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.COMPUTE,
- ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, UserRoleEnum.DESIGNER, true);
- resourceDetailsVFCcomp = resourceDetailsVFCcompE.left().value();
- AtomicOperationUtils.changeComponentState(resourceDetailsVFCcomp, UserRoleEnum.DESIGNER,
- LifeCycleStatesEnum.CERTIFY, true);
-
- ComponentInstance resourceDetailsCP_01ins = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(resourceDetailsCP_01, resourceDetailsVF,
- UserRoleEnum.DESIGNER, true)
- .left().value();
- ComponentInstance resourceDetailsVL_01ins = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(resourceDetailsVL_01, resourceDetailsVF,
- UserRoleEnum.DESIGNER, true)
- .left().value();
- ComponentInstance resourceDetailsVFCcomp_ins = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(resourceDetailsVFCcomp, resourceDetailsVF,
- UserRoleEnum.DESIGNER, true)
- .left().value();
-
- resourceDetailsVF = AtomicOperationUtils.getResourceObject(resourceDetailsVF, UserRoleEnum.DESIGNER);
- AtomicOperationUtils.associate2ResourceInstances(resourceDetailsVF, resourceDetailsCP_01ins,
- resourceDetailsVL_01ins, AssocType.LINKABLE.getAssocType(), UserRoleEnum.DESIGNER, true);
- AtomicOperationUtils.associate2ResourceInstances(resourceDetailsVF, resourceDetailsCP_01ins,
- resourceDetailsVFCcomp_ins, AssocType.BINDABLE.getAssocType(), UserRoleEnum.DESIGNER, true);
-
- }
-
- @Test
- public void getResourceLatestVersion() throws Exception {
-
- RestResponse response = LifecycleRestUtils.changeComponentState(resourceDetailsVF, sdncUserDetails,
- LifeCycleStatesEnum.CHECKIN);
- assertTrue("change LC state to CHECKIN, returned status:" + response.getErrorCode(),
- response.getErrorCode() == 200);
- // resourceDetailsVF =
- // AtomicOperationUtils.getResourceObject(resourceDetailsVF,
- // UserRoleEnum.DESIGNER);
- RestResponse getResourceLatestVersionResponse = ResourceRestUtils.getResourceLatestVersionList(sdncUserDetails);
- assertTrue("response code is not 200, returned :" + getResourceLatestVersionResponse.getErrorCode(),
- getResourceLatestVersionResponse.getErrorCode() == 200);
-
- List<Resource> resourceList = ResourceRestUtils
- .restResponseToResourceObjectList(getResourceLatestVersionResponse.getResponse());
- Resource resource = ResourceRestUtils.getResourceObjectFromResourceListByUid(resourceList,
- resourceDetailsVF.getUniqueId());
-
- callAllCheckMethods(resource);
- }
-
- @Test
- public void getFollowedResources() throws Exception {
-
- RestResponse response = LifecycleRestUtils.changeComponentState(resourceDetailsVF, sdncUserDetails,
- LifeCycleStatesEnum.CHECKIN);
- assertTrue("change LC state to CHECKIN, returned status:" + response.getErrorCode(),
- response.getErrorCode() == 200);
- // resourceDetailsVF =
- // AtomicOperationUtils.getResourceObject(resourceDetailsVF,
- // UserRoleEnum.DESIGNER);
- resourceDetailsVF = AtomicOperationUtils.getResourceObject(resourceDetailsVF, UserRoleEnum.DESIGNER);
-
- RestResponse getFollowedResourcesResponse = ResourceRestUtils.getFollowedList(sdncUserDetails);
- String json = getFollowedResourcesResponse.getResponse();
- JSONObject jsonResp = (JSONObject) JSONValue.parse(json);
- JSONArray resources = (JSONArray) jsonResp.get("resources");
-
- List<Resource> resourceList = ResourceRestUtils.restResponseToResourceObjectList(resources.toString());
- Resource resource = ResourceRestUtils.getResourceObjectFromResourceListByUid(resourceList,
- resourceDetailsVF.getUniqueId());
- // TODO if get followed list Api should return full object data?
- // callAllCheckMethods(resource);
- }
-
- @Test
- public void lifeCycleChekInRequest() throws Exception {
-
- RestResponse response = LifecycleRestUtils.changeComponentState(resourceDetailsVF, sdncUserDetails,
- LifeCycleStatesEnum.CHECKIN);
- assertTrue("change LC state to CHECKIN, returned status:" + response.getErrorCode(),
- response.getErrorCode() == 200);
- // resourceDetailsVF =
- // AtomicOperationUtils.getResourceObject(resourceDetailsVF,
- // UserRoleEnum.DESIGNER);
- resourceDetailsVF = AtomicOperationUtils.getResourceObject(resourceDetailsVF, UserRoleEnum.DESIGNER);
-
- Resource resource = ResponseParser.convertResourceResponseToJavaObject(response.getResponse());
- callAllCheckMethods(resource);
- }
-
- @Test
- public void lifeCycleChekOutRequest() throws Exception {
-
- RestResponse response = LifecycleRestUtils.changeComponentState(resourceDetailsVF, sdncUserDetails,
- LifeCycleStatesEnum.CHECKIN);
- assertTrue("change LC state to CHECKIN, returned status:" + response.getErrorCode(),
- response.getErrorCode() == 200);
- response = LifecycleRestUtils.changeComponentState(resourceDetailsVF, sdncUserDetails,
- LifeCycleStatesEnum.CHECKOUT);
- assertTrue("change LC state to CHECKOUT, returned status:" + response.getErrorCode(),
- response.getErrorCode() == 200);
- resourceDetailsVF = AtomicOperationUtils.getResourceObject(resourceDetailsVF, UserRoleEnum.DESIGNER);
-
- Resource resource = ResponseParser.convertResourceResponseToJavaObject(response.getResponse());
- callAllCheckMethods(resource);
- }
-
- /*@Test
- public void lifeCycleRequestForCertification() throws Exception {
-
- RestResponse response = LifecycleRestUtils.changeComponentState(resourceDetailsVF, sdncUserDetails,
- LifeCycleStatesEnum.CHECKIN);
- assertTrue("change LC state to CHECKIN, returned status:" + response.getErrorCode(),
- response.getErrorCode() == 200);
- response = LifecycleRestUtils.changeComponentState(resourceDetailsVF, sdncUserDetails,
- LifeCycleStatesEnum.CERTIFICATIONREQUEST);
- assertTrue("change LC state to CERTIFICATIONREQUEST, returned status:" + response.getErrorCode(),
- response.getErrorCode() == 200);
- resourceDetailsVF = AtomicOperationUtils.getResourceObject(resourceDetailsVF, UserRoleEnum.DESIGNER);
-
- Resource resource = ResponseParser.convertResourceResponseToJavaObject(response.getResponse());
- callAllCheckMethods(resource);
- }*/
-
- @Test
- public void lifeCycleCertificationRequest() throws Exception {
-
- RestResponse response = AtomicOperationUtils
- .changeComponentState(resourceDetailsVF, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, false)
- .getRight();
- assertTrue("change LC state to CERTIFY, returned status:" + response.getErrorCode(),
- response.getErrorCode() == 200);
- resourceDetailsVF = AtomicOperationUtils.getResourceObject(resourceDetailsVF, UserRoleEnum.DESIGNER);
-
- Resource resource = ResponseParser.convertResourceResponseToJavaObject(response.getResponse());
- callAllCheckMethods(resource);
- }
-
- @Test
- public void checkGetResourceAfterCertificationRequest() throws Exception {
-
- RestResponse response = AtomicOperationUtils
- .changeComponentState(resourceDetailsVF, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, false)
- .getRight();
- assertTrue("change LC state to CERTIFY, returned status:" + response.getErrorCode(),
- response.getErrorCode() == 200);
- resourceDetailsVF = AtomicOperationUtils.getResourceObject(resourceDetailsVF, UserRoleEnum.DESIGNER);
-
- callAllCheckMethods(resourceDetailsVF);
- }
-
- @Test
- public void updateResourceMetadata() throws Exception {
-
- resourceDetailsVF.setDescription("stamStam");
- ResourceReqDetails resourceDetailsVFreqD = new ResourceReqDetails(resourceDetailsVF);
- RestResponse updateResourceResponse = ResourceRestUtils.updateResourceMetadata(resourceDetailsVFreqD,
- sdncUserDetails, resourceDetailsVF.getUniqueId());
- assertTrue("response code is not 200, returned :" + updateResourceResponse.getErrorCode(),
- updateResourceResponse.getErrorCode() == 200);
-
- Resource resource = ResponseParser.convertResourceResponseToJavaObject(updateResourceResponse.getResponse());
-
- callAllCheckMethods(resource);
- }
-
- private void checkResourceInstances(Resource resource) {
- assertNotNull("resource component Instances list is null ", resource.getComponentInstances());
- assertTrue("resource component Instances list is empty ", !resource.getComponentInstances().equals(""));
- }
-
- private void checkResourceInstancesProperties(Resource resource) {
- assertNotNull("component Instances properies list is null ", resource.getComponentInstancesProperties());
- assertTrue("component Instances properies list is empty ",
- !resource.getComponentInstancesProperties().equals(""));
- }
-
- private void checkResourceInstancesRelations(Resource resource) {
- assertNotNull("component Instances Relations list is null ", resource.getComponentInstancesRelations());
- assertTrue("component Instances Relations list is empty ",
- !resource.getComponentInstancesRelations().equals(""));
- }
-
- private void checkResourceCapabilities(Resource resource) {
- assertNotNull("component Instances Capabilities list is null ", resource.getCapabilities());
- assertTrue("component Instances Capabilities list is empty ", !resource.getCapabilities().equals(""));
- }
-
- private void checkResourceRequirements(Resource resource) {
- assertNotNull("component Instances Requirements list is null ", resource.getRequirements());
- assertTrue("component Instances Requirements list is empty ", !resource.getRequirements().equals(""));
- }
-
- private void callAllCheckMethods(Resource resource) {
-
- checkResourceInstances(resource);
- checkResourceInstancesProperties(resource);
- checkResourceInstancesRelations(resource);
- checkResourceCapabilities(resource);
- checkResourceRequirements(resource);
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/GetAllServiceVersions.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/GetAllServiceVersions.java
deleted file mode 100644
index a0091f9a7a..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/GetAllServiceVersions.java
+++ /dev/null
@@ -1,350 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.service;
-
-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.Component;
-import org.openecomp.sdc.be.model.Service;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
-import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.execute.lifecycle.LCSbaseTest;
-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.rest.ResponseParser;
-import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
-import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertTrue;
-
-public class GetAllServiceVersions extends ComponentBaseTest {
- protected ResourceReqDetails resourceDetails;
- protected ServiceReqDetails serviceDetails;
- protected User sdncDesignerDetails;
- protected User sdncDesignerDetails2;
- protected User sdncAdminDetails;
- protected User sdncGovernorDeatails;
- protected User sdncTesterDetails;
- protected User sdncOpsDetails;
- protected ComponentInstanceReqDetails resourceInstanceReqDetails;
- protected Component resourceDetailsVFCcomp;
- protected Service serviceServ;
-
- @Rule
- public static TestName name = new TestName();
-
- public GetAllServiceVersions() {
- super(name, GetAllServiceVersions.class.getName());
- ;
- }
-
- @BeforeMethod
- public void setUp() throws Exception {
-
- sdncDesignerDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- sdncDesignerDetails2 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER2);
- sdncAdminDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- sdncGovernorDeatails = ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR);
- sdncTesterDetails = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
- sdncOpsDetails = ElementFactory.getDefaultUser(UserRoleEnum.OPS);
- resourceDetailsVFCcomp = AtomicOperationUtils
- .createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT, resourceDetailsVFCcomp, UserRoleEnum.DESIGNER,
- true, true);
-
- AtomicOperationUtils.changeComponentState(resourceDetailsVFCcomp, UserRoleEnum.DESIGNER,
- LifeCycleStatesEnum.CERTIFY, true);
- serviceServ = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceDetailsVFCcomp, serviceServ,
- UserRoleEnum.DESIGNER, true);
-
- serviceDetails = new ServiceReqDetails(serviceServ);
-
- }
-
- @Test
- public void GetAllServiceVersions_Version05() throws Exception {
-
- Map<String, String> origVersionsMap = new HashMap<String, String>();
- origVersionsMap.put(serviceDetails.getVersion(), serviceDetails.getUniqueId());
- for (int x = 0; x < 4; x++) {
- LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
- LifeCycleStatesEnum.CHECKIN);
- LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
- LifeCycleStatesEnum.CHECKOUT);
- origVersionsMap.put(serviceDetails.getVersion(), serviceDetails.getUniqueId());
-
- }
- // validate get response
- RestResponse serviceGetResponse = ServiceRestUtils.getService(serviceDetails, sdncDesignerDetails);
- Service res = ResponseParser.convertServiceResponseToJavaObject(serviceGetResponse.getResponse());
- Map<String, String> getVersionsMap = res.getAllVersions();
- assertTrue(origVersionsMap.equals(getVersionsMap));
-
- }
-
- @Test
- public void GetAllServiceVersions_Version01() throws Exception {
-
- Map<String, String> origVersionsMap = new HashMap<String, String>();
- origVersionsMap.put(serviceDetails.getVersion(), serviceDetails.getUniqueId());
-
- RestResponse serviceGetResponse = ServiceRestUtils.getService(serviceDetails, sdncDesignerDetails);
- Service res = ResponseParser.convertServiceResponseToJavaObject(serviceGetResponse.getResponse());
- Map<String, String> getVersionsMap = res.getAllVersions();
- assertTrue(origVersionsMap.equals(getVersionsMap));
- }
-
- @Test
- public void GetAllServiceVersions_Version15() throws Exception {
- // addMandatoryArtifactsToService();
- Map<String, String> origVersionsMap = new HashMap<String, String>();
- for (int x = 0; x < 4; x++) {
- LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
- LifeCycleStatesEnum.CHECKIN);
- LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
- LifeCycleStatesEnum.CHECKOUT);
- }
-
- RestResponse changeServiceState = LCSbaseTest.certifyService(serviceDetails, sdncDesignerDetails);
- // serviceServ.setUniqueId(serviceDetails.getUniqueId());
- // RestResponse changeServiceState =
- // AtomicOperationUtils.changeComponentState(serviceServ,
- // UserRoleEnum.ADMIN, LifeCycleStatesEnum.CERTIFY, false).getRight();
-
- assertTrue("certify service request returned status:" + changeServiceState.getErrorCode(),
- changeServiceState.getErrorCode() == 200);
- origVersionsMap.put(serviceDetails.getVersion(), serviceDetails.getUniqueId());
-
- for (int x = 0; x < 5; x++) {
- LifecycleRestUtils.changeServiceState(serviceDetails, sdncAdminDetails, serviceDetails.getVersion(),
- LifeCycleStatesEnum.CHECKOUT);
- LifecycleRestUtils.changeServiceState(serviceDetails, sdncAdminDetails, serviceDetails.getVersion(),
- LifeCycleStatesEnum.CHECKIN);
- origVersionsMap.put(serviceDetails.getVersion(), serviceDetails.getUniqueId());
-
- }
-
- // validate get response
- RestResponse serviceGetResponse = ServiceRestUtils.getService(serviceDetails, sdncAdminDetails);
- Service res = ResponseParser.convertServiceResponseToJavaObject(serviceGetResponse.getResponse());
- Map<String, String> getVersionsMap = res.getAllVersions();
- assertTrue(origVersionsMap.equals(getVersionsMap));
- }
-
- @Test
- public void GetAllServiceVersions_Version25() throws Exception {
- // addMandatoryArtifactsToService();
- Map<String, String> origVersionsMap = new HashMap<String, String>();
- for (int x = 0; x < 4; x++) {
- LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
- LifeCycleStatesEnum.CHECKIN);
- LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
- LifeCycleStatesEnum.CHECKOUT);
- }
-
- // getting to version 1.0
- RestResponse changeServiceState = LCSbaseTest.certifyService(serviceDetails, sdncDesignerDetails);
- assertTrue("certify service request returned status:" + changeServiceState.getErrorCode(),
- changeServiceState.getErrorCode() == 200);
- origVersionsMap.put(serviceDetails.getVersion(), serviceDetails.getUniqueId());
-
- // getting to version 1.5
- for (int x = 0; x < 5; x++) {
- LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
- LifeCycleStatesEnum.CHECKIN);
- LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
- LifeCycleStatesEnum.CHECKOUT);
- }
-
- // getting to version 2.0
- changeServiceState = LCSbaseTest.certifyService(serviceDetails, sdncDesignerDetails);
- assertTrue("certify service request returned status:" + changeServiceState.getErrorCode(),
- changeServiceState.getErrorCode() == 200);
- origVersionsMap.put(serviceDetails.getVersion(), serviceDetails.getUniqueId());
-
- // getting to version 2.5
- for (int x = 0; x < 5; x++) {
- LifecycleRestUtils.changeServiceState(serviceDetails, sdncAdminDetails, serviceDetails.getVersion(),
- LifeCycleStatesEnum.CHECKIN);
- LifecycleRestUtils.changeServiceState(serviceDetails, sdncAdminDetails, serviceDetails.getVersion(),
- LifeCycleStatesEnum.CHECKOUT);
- origVersionsMap.put(serviceDetails.getVersion(), serviceDetails.getUniqueId());
- }
-
- // validate get response
- RestResponse serviceGetResponse = ServiceRestUtils.getService(serviceDetails, sdncAdminDetails);
- Service res = ResponseParser.convertServiceResponseToJavaObject(serviceGetResponse.getResponse());
- Map<String, String> getVersionsMap = res.getAllVersions();
- assertTrue(origVersionsMap.equals(getVersionsMap));
- }
-
- @Test
- public void GetAllServiceVersions_ReadyForCertification_version05() throws Exception {
- // addMandatoryArtifactsToService();
- Map<String, String> origVersionsMap = new HashMap<String, String>();
- origVersionsMap.put(serviceDetails.getVersion(), serviceDetails.getUniqueId());
- for (int x = 0; x < 4; x++) {
- LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
- LifeCycleStatesEnum.CHECKIN);
- LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
- LifeCycleStatesEnum.CHECKOUT);
- origVersionsMap.put(serviceDetails.getVersion(), serviceDetails.getUniqueId());
- }
-
- LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
- LifeCycleStatesEnum.CHECKIN);
- LifecycleRestUtils.changeServiceState(serviceDetails, sdncAdminDetails, serviceDetails.getVersion(),
- LifeCycleStatesEnum.CERTIFICATIONREQUEST);
-
- // validate get response
- RestResponse serviceGetResponse = ServiceRestUtils.getService(serviceDetails, sdncAdminDetails);
- Service res = ResponseParser.convertServiceResponseToJavaObject(serviceGetResponse.getResponse());
- Map<String, String> getVersionsMap = res.getAllVersions();
- assertTrue(origVersionsMap.equals(getVersionsMap));
- }
-
- @Test
- public void GetAllServiceVersions_CertifactionInProgress_version05() throws Exception {
- // addMandatoryArtifactsToService();
- Map<String, String> origVersionsMap = new HashMap<String, String>();
- origVersionsMap.put(serviceDetails.getVersion(), serviceDetails.getUniqueId());
- for (int x = 0; x < 4; x++) {
- LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
- LifeCycleStatesEnum.CHECKIN);
- LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
- LifeCycleStatesEnum.CHECKOUT);
- origVersionsMap.put(serviceDetails.getVersion(), serviceDetails.getUniqueId());
- }
-
- LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
- LifeCycleStatesEnum.CHECKIN);
- LifecycleRestUtils.changeServiceState(serviceDetails, sdncAdminDetails, serviceDetails.getVersion(),
- LifeCycleStatesEnum.CERTIFICATIONREQUEST);
- LifecycleRestUtils.changeServiceState(serviceDetails, sdncAdminDetails, serviceDetails.getVersion(),
- LifeCycleStatesEnum.STARTCERTIFICATION);
-
- // validate get response
- RestResponse serviceGetResponse = ServiceRestUtils.getService(serviceDetails, sdncAdminDetails);
- Service res = ResponseParser.convertServiceResponseToJavaObject(serviceGetResponse.getResponse());
- Map<String, String> getVersionsMap = res.getAllVersions();
- assertTrue(origVersionsMap.equals(getVersionsMap));
- }
-
- @Test
- public void GetAllServiceVersions_Certified_version10() throws Exception {
- // addMandatoryArtifactsToService();
- Map<String, String> origVersionsMap = new HashMap<String, String>();
- // get to version 0.5
- for (int x = 0; x < 4; x++) {
- LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
- LifeCycleStatesEnum.CHECKIN);
- LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
- LifeCycleStatesEnum.CHECKOUT);
-
- }
-
- // get version 1.0
- RestResponse changeServiceState = LCSbaseTest.certifyService(serviceDetails, sdncDesignerDetails);
- assertTrue("certify service request returned status:" + changeServiceState.getErrorCode(),
- changeServiceState.getErrorCode() == 200);
- origVersionsMap.put(serviceDetails.getVersion(), serviceDetails.getUniqueId());
-
- // validate get response
- RestResponse serviceGetResponse = ServiceRestUtils.getService(serviceDetails, sdncAdminDetails);
- Service res = ResponseParser.convertServiceResponseToJavaObject(serviceGetResponse.getResponse());
- Map<String, String> getVersionsMap = res.getAllVersions();
- assertTrue(origVersionsMap.equals(getVersionsMap));
- }
-
- @Test
- public void GetAllServiceVersions_Certified_version20() throws Exception {
- // addMandatoryArtifactsToService();
- Map<String, String> origVersionsMap = new HashMap<String, String>();
- // get to version 0.5
- for (int x = 0; x < 4; x++) {
- LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
- LifeCycleStatesEnum.CHECKIN);
- LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
- LifeCycleStatesEnum.CHECKOUT);
- }
-
- // get version 1.0
- RestResponse changeServiceState = LCSbaseTest.certifyService(serviceDetails, sdncDesignerDetails);
- assertTrue("certify service request returned status:" + changeServiceState.getErrorCode(),
- changeServiceState.getErrorCode() == 200);
- origVersionsMap.put(serviceDetails.getVersion(), serviceDetails.getUniqueId());
-
- // get version 1.5
- for (int x = 0; x < 4; x++) {
- LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
- LifeCycleStatesEnum.CHECKIN);
- LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerDetails, serviceDetails.getVersion(),
- LifeCycleStatesEnum.CHECKOUT);
- }
-
- // get version 2.0
- changeServiceState = LCSbaseTest.certifyService(serviceDetails, sdncDesignerDetails);
- assertTrue("certify service request returned status:" + changeServiceState.getErrorCode(),
- changeServiceState.getErrorCode() == 200);
- origVersionsMap.put(serviceDetails.getVersion(), serviceDetails.getUniqueId());
-
- // validate get response
- RestResponse serviceGetResponse = ServiceRestUtils.getService(serviceDetails, sdncAdminDetails);
- Service res = ResponseParser.convertServiceResponseToJavaObject(serviceGetResponse.getResponse());
- Map<String, String> getVersionsMap = res.getAllVersions();
- assertTrue(origVersionsMap.equals(getVersionsMap));
- }
-
- @Test
- public void GetAllServiceVersions_ServiceNotFound() throws Exception {
-
- RestResponse serviceGetResponse = ServiceRestUtils.getService("123456789", sdncAdminDetails);
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.SERVICE_NOT_FOUND.name());
- assertEquals("Check response code after get service without cache", errorInfo.getCode(),
- serviceGetResponse.getErrorCode());
-
- List<String> variables = Arrays.asList("123456789");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.SERVICE_NOT_FOUND.name(), variables,
- serviceGetResponse.getResponse());
-
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/GetComponentAuditApiTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/GetComponentAuditApiTest.java
deleted file mode 100644
index 544a7b1b63..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/service/GetComponentAuditApiTest.java
+++ /dev/null
@@ -1,362 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.service;
-
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import fj.data.Either;
-import org.apache.http.HttpStatus;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
-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.FileUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.*;
-import org.openecomp.sdc.common.api.Constants;
-import org.openecomp.sdc.common.datastructure.AuditingFieldsKey;
-import org.openecomp.sdc.common.datastructure.Wrapper;
-import org.testng.AssertJUnit;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import static org.testng.AssertJUnit.assertTrue;
-
-public class GetComponentAuditApiTest extends ComponentBaseTest {
-
- public static final String SERVICES_API = "services";
- public static final String RESOURCES_API = "resources";
-
- protected User sdncAdminUser;
- protected User sdncDesignerUser;
- protected User sdncTesterUser;
-
- @Rule
- public static TestName name = new TestName();
-
- public GetComponentAuditApiTest() {
- super(name, GetComponentAuditApiTest.class.getName());
- }
-
- // in case tests fail, run this method as test to create mapping in ES
- public void updateElasticSearchMapping() throws IOException {
- Either<String, Exception> fileContentUTF8 = FileUtils
- .getFileContentUTF8("src\\test\\resources\\CI\\other\\mapping.json");
- AssertJUnit.assertTrue(fileContentUTF8.isLeft());
-
- final String ES_TEMPLATE_URL = "http://%s:%s/_template/audit_template";
- String url = String.format(ES_TEMPLATE_URL, config.getEsHost(), config.getEsPort());
-
-// RestResponse sendHttpPost = new HttpRequest().sendHttpPost(url, fileContentUTF8.left().value(), null);
- RestResponse sendHttpPost = new HttpRequest().httpSendPost(url, fileContentUTF8.left().value(), null);
- AssertJUnit.assertTrue(sendHttpPost.getErrorCode() == HttpStatus.SC_OK);
- }
-
- @BeforeMethod
- public void init() {
- sdncAdminUser = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- sdncDesignerUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- sdncTesterUser = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
- ;
-
- }
-
- @Test
- public void testServiceAuditCertifiedVersion() throws Exception {
-
- ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
- Wrapper<String> versionZeroOneIDWrapper = new Wrapper<String>(),
- versionZeroTwoIDWrapper = new Wrapper<String>();
-
- createBasicServiceForAudit(versionZeroOneIDWrapper, versionZeroTwoIDWrapper, serviceDetails, true);
- // First Certification
-
- LifecycleRestUtils.certifyService(serviceDetails);
- // LCSbaseTest.certifyService(serviceDetails);
- AssertJUnit.assertTrue(serviceDetails.getVersion().equals("1.0"));
-
- // Second Certification
- increaseServiceVersion(serviceDetails, "1.1");
- increaseServiceVersion(serviceDetails, "1.2");
- increaseServiceVersion(serviceDetails, "1.3");
- increaseServiceVersion(serviceDetails, "1.4");
- LifecycleRestUtils.certifyService(serviceDetails);
- AssertJUnit.assertTrue(serviceDetails.getVersion().equals("2.0"));
- String certifiedId = serviceDetails.getUniqueId();
- LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerUser, LifeCycleStatesEnum.CHECKOUT);
- LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerUser, LifeCycleStatesEnum.CHECKIN);
-
- JsonElement element = getAuditJson(SERVICES_API, certifiedId);
- // audits kept: 5*check ins + 4*check outs + 2*artifact payload
- // updates(tosca) + certification request + certification start +
- // certification success
- // + 3 A&AI(ArtifactDelete, ArtifactUpload, ArtifactUpdate)
- List<String> actions = new ArrayList<>();
- JsonArray jsonArray = element.getAsJsonArray();
- for( int i =0 ; i < jsonArray.size(); i++){
- actions.add(jsonArray.get(i).getAsJsonObject().get(AuditingFieldsKey.AUDIT_ACTION.getDisplayName()).getAsString());
- }
- long checkinCount = actions.stream().filter( e -> e.equals(AuditingActionEnum.CHECKIN_RESOURCE.getName())).count();
- assertTrue(checkinCount == 5);
-
- long checkOutCount = actions.stream().filter( e -> e.equals(AuditingActionEnum.CHECKOUT_RESOURCE.getName())).count();
- assertTrue(checkOutCount == 4);
-
- long certificationRequestCount = actions.stream().filter( e -> e.equals(AuditingActionEnum.CERTIFICATION_REQUEST_RESOURCE.getName())).count();
- assertTrue(certificationRequestCount == 1);
-
- long certificationStartCount = actions.stream().filter( e -> e.equals(AuditingActionEnum.START_CERTIFICATION_RESOURCE.getName())).count();
- assertTrue(certificationStartCount == 1);
-
- long certificationSuccessCount = actions.stream().filter( e -> e.equals(AuditingActionEnum.CERTIFICATION_SUCCESS_RESOURCE.getName())).count();
- assertTrue(certificationSuccessCount == 1);
-
-
- }
-
- protected void certifyResource(ResourceReqDetails defaultResource) throws IOException {
-/* RestResponse response = LifecycleRestUtils.changeResourceState(defaultResource, sdncDesignerUser,
- LifeCycleStatesEnum.CERTIFICATIONREQUEST);
- AssertJUnit.assertTrue(response.getErrorCode() == HttpStatus.SC_OK);
- response = LifecycleRestUtils.changeResourceState(defaultResource, sdncTesterUser,
- LifeCycleStatesEnum.STARTCERTIFICATION);
- AssertJUnit.assertTrue(response.getErrorCode() == HttpStatus.SC_OK);*/
- RestResponse response = LifecycleRestUtils.changeResourceState(defaultResource, sdncTesterUser, LifeCycleStatesEnum.CERTIFY);
- AssertJUnit.assertTrue(response.getErrorCode() == HttpStatus.SC_OK);
- }
-
- protected JsonElement getAuditJson(String componentType, String componentId) throws IOException {
- Map<String, String> headers = new HashMap<String, String>() {
- {
- put(Constants.USER_ID_HEADER, UserRoleEnum.ADMIN.getUserId());
- }
- };
- String url = String.format(Urls.GET_COMPONENT_AUDIT_RECORDS, config.getCatalogBeHost(),
- config.getCatalogBePort(), componentType, componentId);
-
- RestResponse httpSendGet = new HttpRequest().httpSendGet(url, headers);
- AssertJUnit.assertTrue(httpSendGet.getErrorCode() == HttpStatus.SC_OK);
- JsonElement element = ResponseParser.parseToObject(httpSendGet.getResponse(), JsonElement.class);
- AssertJUnit.assertTrue(element.isJsonArray());
- return element;
- }
-
- protected void createBasicServiceForAudit(Wrapper<String> versionZeroOneIDWrapper,
- Wrapper<String> versionZeroTwoIDWrapper, ServiceReqDetails serviceDetails, Boolean withResInst)
- throws Exception {
-
- User designerUser = sdncDesignerUser;
-
- RestResponse response = ServiceRestUtils.createService(serviceDetails, designerUser);
- AssertJUnit.assertTrue(response.getErrorCode() == HttpStatus.SC_CREATED);
- versionZeroOneIDWrapper.setInnerElement(serviceDetails.getUniqueId());
-
- if (withResInst) {
- Resource resourceObj = AtomicOperationUtils
- .createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT, resourceObj, UserRoleEnum.DESIGNER, true,
- true);
- AtomicOperationUtils.changeComponentState(resourceObj, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY,
- true);
- ResourceReqDetails resource = new ResourceReqDetails(resourceObj);
- ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory.getDefaultComponentInstance();
- resourceInstanceReqDetails.setComponentUid(resource.getUniqueId());
- ComponentInstanceRestUtils.createComponentInstance(resourceInstanceReqDetails, sdncDesignerUser,
- serviceDetails.getUniqueId(), ComponentTypeEnum.SERVICE);
-
- // ServiceUtils.createCertResourceWithDeploymentArt(serviceDetails,
- // "myResource");
- }
-
- response = LifecycleRestUtils.changeServiceState(serviceDetails, designerUser, LifeCycleStatesEnum.CHECKIN);
- AssertJUnit.assertTrue(response.getErrorCode() == HttpStatus.SC_OK);
- AssertJUnit.assertTrue(serviceDetails.getVersion().equals("0.1"));
-
- response = LifecycleRestUtils.changeServiceState(serviceDetails, designerUser, LifeCycleStatesEnum.CHECKOUT);
- AssertJUnit.assertTrue(response.getErrorCode() == HttpStatus.SC_OK);
- // ServiceUtils.addServiceDeploymentArtifact(serviceDetails.getUniqueId(),
- // designerUser);
- versionZeroTwoIDWrapper.setInnerElement(serviceDetails.getUniqueId());
- AssertJUnit.assertTrue(serviceDetails.getVersion().equals("0.2"));
- response = LifecycleRestUtils.changeServiceState(serviceDetails, designerUser, LifeCycleStatesEnum.CHECKIN);
- AssertJUnit.assertTrue(response.getErrorCode() == HttpStatus.SC_OK);
-
- increaseServiceVersion(serviceDetails, "0.3");
-
- increaseServiceVersion(serviceDetails, "0.4");
-
- increaseServiceVersion(serviceDetails, "0.5");
-
- }
-
- protected void increaseServiceVersion(ServiceReqDetails serviceDetails, String excpectedVersion) throws Exception {
- RestResponse response = LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerUser,
- LifeCycleStatesEnum.CHECKOUT);
- AssertJUnit.assertTrue(response.getErrorCode() == HttpStatus.SC_OK);
- AssertJUnit.assertTrue(serviceDetails.getVersion().equals(excpectedVersion));
- response = LifecycleRestUtils.changeServiceState(serviceDetails, sdncDesignerUser, LifeCycleStatesEnum.CHECKIN);
- AssertJUnit.assertTrue(response.getErrorCode() == HttpStatus.SC_OK);
- }
-
- protected void createBasicResourceForAudit(Wrapper<String> versionOnePointTwoIDWrapper,
- ResourceReqDetails defaultResource) throws Exception {
-
- RestResponse response = ResourceRestUtils.createResource(defaultResource, sdncDesignerUser);
- AssertJUnit.assertTrue(response.getErrorCode() == HttpStatus.SC_CREATED);
-
- // ArtifactDefinition artifactDef = new
- // ArtifactUtils().constructDefaultArtifactInfo();
- // response = resourceUtils.add_artifact(defaultResource,
- // sdncDesignerUser, defaultResource.getVersion(), artifactDef);
- // assertTrue(response.getErrorCode() == HttpStatus.SC_OK);
-
- ArtifactReqDetails heatArtifactDetails = ElementFactory
- .getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
- response = ArtifactRestUtils.addInformationalArtifactToResource(heatArtifactDetails, sdncDesignerUser,
- defaultResource.getUniqueId());
- AssertJUnit.assertTrue("add HEAT artifact to resource request returned status:" + response.getErrorCode(),
- response.getErrorCode() == 200);
-
- response = LifecycleRestUtils.changeResourceState(defaultResource, sdncDesignerUser,
- LifeCycleStatesEnum.CHECKIN);
-
- increaseResourceVersion(defaultResource, "0.2");
-
- increaseResourceVersion(defaultResource, "0.3");
-
- increaseResourceVersion(defaultResource, "0.4");
-
- increaseResourceVersion(defaultResource, "0.5");
-
- certifyResource(defaultResource);
- AssertJUnit.assertTrue(response.getErrorCode() == HttpStatus.SC_OK);
- AssertJUnit.assertTrue(defaultResource.getVersion().equals("1.0"));
-
- increaseResourceVersion(defaultResource, "1.1");
-
- increaseResourceVersion(defaultResource, "1.2");
- versionOnePointTwoIDWrapper.setInnerElement(defaultResource.getUniqueId());
-
- increaseResourceVersion(defaultResource, "1.3");
-
- increaseResourceVersion(defaultResource, "1.4");
-
- }
-
- protected void increaseResourceVersion(ResourceReqDetails defaultResource, String expectedVersion)
- throws IOException {
- RestResponse response = LifecycleRestUtils.changeResourceState(defaultResource, sdncDesignerUser,
- LifeCycleStatesEnum.CHECKOUT);
- AssertJUnit.assertTrue(response.getErrorCode() == HttpStatus.SC_OK);
- AssertJUnit.assertTrue(defaultResource.getVersion().equals(expectedVersion));
- response = LifecycleRestUtils.changeResourceState(defaultResource, sdncDesignerUser,
- LifeCycleStatesEnum.CHECKIN);
- AssertJUnit.assertTrue(response.getErrorCode() == HttpStatus.SC_OK);
- }
-
- @Test
- public void testServiceAuditLastUncertifiedVersion() throws Exception {
-
- ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
- Wrapper<String> versionZeroOneIDWrapper = new Wrapper<String>(),
- versionZeroTwoIDWrapper = new Wrapper<String>();
-
- createBasicServiceForAudit(versionZeroOneIDWrapper, versionZeroTwoIDWrapper, serviceDetails, false);
-
- JsonElement element = getAuditJson(SERVICES_API, versionZeroTwoIDWrapper.getInnerElement());
-
- assertTrue(element.getAsJsonArray().size() == 3);
-
- }
-
- @Test
- public void testServiceAuditFirstUncertifiedVersion() throws Exception {
-
- ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
- Wrapper<String> versionZeroOneIDWrapper = new Wrapper<String>(),
- versionZeroTwoIDWrapper = new Wrapper<String>();
-
- createBasicServiceForAudit(versionZeroOneIDWrapper, versionZeroTwoIDWrapper, serviceDetails, false);
-
- JsonElement element = getAuditJson(SERVICES_API, versionZeroOneIDWrapper.getInnerElement());
-
- assertTrue(element.getAsJsonArray().size() == 3);
-
- }
-
- @Test
- public void testResourceAuditUncertifiedVersion() throws Exception {
-
- ResourceReqDetails defaultResource = ElementFactory.getDefaultResource();
- Wrapper<String> versionOnePointTwoIDWrapper = new Wrapper<String>();
-
- createBasicResourceForAudit(versionOnePointTwoIDWrapper, defaultResource);
-
- JsonElement element = getAuditJson(RESOURCES_API, versionOnePointTwoIDWrapper.getInnerElement());
-
- assertTrue(element.getAsJsonArray().size() == 3);
-
- }
-
- @Test
- public void testResourceAuditCertifiedVersion() throws Exception {
-
- ResourceReqDetails defaultResource = ElementFactory.getDefaultResource();
- Wrapper<String> versionOnePointTwoIDWrapper = new Wrapper<String>();
-
- createBasicResourceForAudit(versionOnePointTwoIDWrapper, defaultResource);
-
- certifyResource(defaultResource);
- assertTrue(defaultResource.getVersion().equals("2.0"));
- String certifiedId = defaultResource.getUniqueId();
-
- increaseResourceVersion(defaultResource, "2.1");
-
- increaseResourceVersion(defaultResource, "2.2");
-
- JsonElement element = getAuditJson(RESOURCES_API, certifiedId);
-
- assertTrue(element.getAsJsonArray().size() == 13);
-
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/user/ActivateDeActivateDeleteUser.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/user/ActivateDeActivateDeleteUser.java
deleted file mode 100644
index df1e6b2a6e..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/user/ActivateDeActivateDeleteUser.java
+++ /dev/null
@@ -1,740 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.user;
-
-import com.google.gson.*;
-import com.google.gson.reflect.TypeToken;
-import org.apache.http.HttpStatus;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.dao.utils.UserStatusEnum;
-import org.openecomp.sdc.be.model.LifecycleStateEnum;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceRespJavaObject;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
-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.expected.ExpectedUserCRUDAudit;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.users.UserResponseMessageEnum;
-import org.openecomp.sdc.ci.tests.utils.DbUtils;
-import org.openecomp.sdc.ci.tests.utils.general.Convertor;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.*;
-import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
-import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
-import org.openecomp.sdc.ci.tests.utils.validation.ResourceValidationUtils;
-import org.openecomp.sdc.ci.tests.utils.validation.UserValidationUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.AssertJUnit;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.util.*;
-import java.util.Map.Entry;
-
-import static org.testng.AssertJUnit.*;
-
-/**
- * @author alitvinsky
- *
- */
-public class ActivateDeActivateDeleteUser extends ComponentBaseTest {
- private static Logger logger = LoggerFactory.getLogger(ActivateDeActivateDeleteUser.class.getName());
- protected Gson gson = new Gson();
- protected User sdncAdminUser;
-
- @BeforeMethod
- public void init() {
- sdncAdminUser = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-
- }
-
- @Rule
- public static TestName name = new TestName();
-
- public ActivateDeActivateDeleteUser() {
- super(name, ActivateDeActivateDeleteUser.class.getName());
- }
-
- @Test
- public void authorizeDeActivatedUser() throws Exception {
-
- User sdncUserDetails = getDefaultUserDetails();
-
- try {
-
- UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
- DbUtils.cleanAllAudits();
-
- RestResponse createUserResponse = UserRestUtils.createUser(sdncUserDetails, sdncAdminUser);
- validateSuccessCreateUserResponse(sdncUserDetails, createUserResponse);
-
- // deActivate created user
- RestResponse deActivateUserResponse = UserRestUtils.deActivateUser(sdncUserDetails, sdncAdminUser);
- sdncUserDetails.setStatus(UserStatusEnum.INACTIVE);
- validateSuccessDeActivateUserResponse(sdncUserDetails, deActivateUserResponse);
-
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.USER_INACTIVE.name());
- RestResponse getUserResponse = UserRestUtils.getUser(sdncUserDetails, sdncAdminUser);
-
- AssertJUnit.assertEquals("Check response code after deActive user", errorInfo.getCode(),
- getUserResponse.getErrorCode());
-
- List<String> variables = Arrays.asList(sdncUserDetails.getUserId());
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.USER_INACTIVE.name(), variables,
- getUserResponse.getResponse());
-
- // clean audit before authorization test
- DbUtils.cleanAllAudits();
-
- // Perform login from WebSeal
- User sealUserDetails = sdncUserDetails;
- RestResponse authorizedUserResponse = UserRestUtils.authorizedUserTowardsCatalogBeQA(sealUserDetails);
-
- // validate response
-
- ErrorInfo errorInfo2 = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESTRICTED_ACCESS.name());
-
- AssertJUnit.assertNotNull("check response object is not null after user login", authorizedUserResponse);
- AssertJUnit.assertNotNull("check error code exists in response after user login",
- authorizedUserResponse.getErrorCode());
- AssertJUnit.assertEquals("Check response code after deActive user", errorInfo2.getCode(),
- authorizedUserResponse.getErrorCode());
-
- List<String> variables2 = Arrays.asList();
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.RESTRICTED_ACCESS.name(), variables2,
- authorizedUserResponse.getResponse());
-
- // validate against ES DB
-
- UserValidationUtils.validateDataAgainstAuditDB_access(sealUserDetails,
- DbUtils.parseAuditRespByAction("Access"), authorizedUserResponse, errorInfo2, variables2);
-
- } finally {
- UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
- }
-
- }
-
- public User getDefaultUserDetails() {
-
- String httpCspUserId = "km2000";
- String userFirstName = "Kot";
- String userLastName = "May";
- String email = "km2000@intl.sdc.com";
- String role = UserRoleEnum.ADMIN.name();
- User sdncUserDetails = new User(userFirstName, userLastName, httpCspUserId, email, role, null);
-
- return sdncUserDetails;
- }
-
- public void validateSuccessCreateUserResponse(User sdncUserDetails, RestResponse createUserResponse)
- throws Exception {
-
- AssertJUnit.assertNotNull("check response object is not null after create user", createUserResponse);
- AssertJUnit.assertNotNull("check error code exists in response after create user",
- createUserResponse.getErrorCode());
- AssertJUnit.assertEquals("Check response code after create user", HttpStatus.SC_CREATED,
- createUserResponse.getErrorCode().intValue());
-
- UserValidationUtils.validateUserDetailsOnResponse(sdncUserDetails, createUserResponse.getResponse());
- // UserRestUtils.validateAddUserAuditMessage(sdncUserDetails,
- // sdncAdminUser, String.valueOf(HttpStatus.SC_CREATED),
- // UserResponseMessageEnum.SUCCESS_MESSAGE.getValue(),
- // UserRestUtils.getAddUserAuditMessage("AddUser"));
- String addUser = "AddUser";
- ExpectedUserCRUDAudit constructFieldsForAuditValidation = Convertor.constructFieldsForAuditValidation(addUser,
- sdncAdminUser, ActionStatus.CREATED, sdncUserDetails, null);
- AuditValidationUtils.validateAddUserAudit(constructFieldsForAuditValidation, addUser);
-
- RestResponse getUserResponse = UserRestUtils.getUser(sdncUserDetails, sdncAdminUser);
- UserValidationUtils.validateUserDetailsOnResponse(sdncUserDetails, getUserResponse.getResponse());
-
- }
-
- public void validateSuccessDeActivateUserResponse(User sdncUserDetails, RestResponse deActivateUserResponse)
- throws Exception {
-
- AssertJUnit.assertNotNull("check response object is not null after deActive user", deActivateUserResponse);
- AssertJUnit.assertNotNull("check error code exists in response after deActive user",
- deActivateUserResponse.getErrorCode());
- AssertJUnit.assertEquals("Check response code after deActive user", 200,
- deActivateUserResponse.getErrorCode().intValue());
-
- UserValidationUtils.validateUserDetailsOnResponse(sdncUserDetails, deActivateUserResponse.getResponse());
-
- String deleteUser = "DeleteUser";
- ExpectedUserCRUDAudit constructFieldsForAuditValidation = Convertor
- .constructFieldsForAuditValidation(deleteUser, sdncAdminUser, ActionStatus.OK, null, sdncUserDetails);
- AuditValidationUtils.validateAddUserAudit(constructFieldsForAuditValidation, deleteUser);
-
- }
-
- // US498322 - Add Status Field to USER
-
- @Test
- public void createNewUser() throws Exception {
-
- User sdncUserDetails = getDefaultUserDetails();
- try {
-
- UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
- DbUtils.cleanAllAudits();
-
- RestResponse createUserResponse = UserRestUtils.createUser(sdncUserDetails, sdncAdminUser);
- validateSuccessCreateUserResponse(sdncUserDetails, createUserResponse);
-
- } finally {
- UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
- }
-
- }
-
- @Test
- public void createDefaultUser() throws Exception {
-
- User sdncUserDetails = getDefaultUserDetails();
- sdncUserDetails.setFirstName(null);
- sdncUserDetails.setLastName(null);
- sdncUserDetails.setEmail(null);
- sdncUserDetails.setRole(null);
-
- try {
-
- UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
- DbUtils.cleanAllAudits();
-
- RestResponse createUserResponse = UserRestUtils.createUser(sdncUserDetails, sdncAdminUser);
- validateSuccessCreateUserResponse(sdncUserDetails, createUserResponse);
-
- } finally {
- UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
- }
-
- }
-
- @Test
- public void createTesterUser() throws Exception {
-
- User sdncUserDetails = getDefaultUserDetails();
- sdncUserDetails.setLastName(null);
- sdncUserDetails.setRole(UserRoleEnum.TESTER.name());
-
- try {
-
- UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
- DbUtils.cleanAllAudits();
-
- RestResponse createUserResponse = UserRestUtils.createUser(sdncUserDetails, sdncAdminUser);
- validateSuccessCreateUserResponse(sdncUserDetails, createUserResponse);
-
- } finally {
- UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
- }
-
- }
-
- @Test
- public void deActivateCreatedAdminUser() throws Exception {
-
- User sdncUserDetails = getDefaultUserDetails();
-
- try {
-
- UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
- DbUtils.cleanAllAudits();
-
- RestResponse createUserResponse = UserRestUtils.createUser(sdncUserDetails, sdncAdminUser);
- validateSuccessCreateUserResponse(sdncUserDetails, createUserResponse);
-
- // deActivate created user
- RestResponse deActivateUserResponse = UserRestUtils.deActivateUser(sdncUserDetails, sdncAdminUser);
- sdncUserDetails.setStatus(UserStatusEnum.INACTIVE);
- validateSuccessDeActivateUserResponse(sdncUserDetails, deActivateUserResponse);
-
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.USER_INACTIVE.name());
-
- RestResponse getUserResponse = UserRestUtils.getUser(sdncUserDetails, sdncAdminUser);
-
- assertEquals("Check response code after get user", errorInfo.getCode(), getUserResponse.getErrorCode());
-
- List<String> variables = Arrays.asList(sdncUserDetails.getUserId());
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.USER_INACTIVE.name(), variables,
- getUserResponse.getResponse());
-
- } finally {
- UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
- }
-
- }
-
- @Test
- public void deActivateTheSameUserTwice() throws Exception {
-
- User sdncUserDetails = getDefaultUserDetails();
-
- try {
-
- UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
- DbUtils.cleanAllAudits();
-
- RestResponse createUserResponse = UserRestUtils.createUser(sdncUserDetails, sdncAdminUser);
- validateSuccessCreateUserResponse(sdncUserDetails, createUserResponse);
-
- // deActivate created user
- RestResponse deActivateUserResponse = UserRestUtils.deActivateUser(sdncUserDetails, sdncAdminUser);
- sdncUserDetails.setStatus(UserStatusEnum.INACTIVE);
- validateSuccessDeActivateUserResponse(sdncUserDetails, deActivateUserResponse);
-
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.USER_INACTIVE.name());
-
- RestResponse getUserResponse = UserRestUtils.getUser(sdncUserDetails, sdncAdminUser);
-
- assertEquals("Check response code after deActive user", errorInfo.getCode(),
- getUserResponse.getErrorCode());
-
- List<String> variables = Arrays.asList(sdncUserDetails.getUserId());
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.USER_INACTIVE.name(), variables,
- getUserResponse.getResponse());
-
- // deActivate the same user once time more
- RestResponse deActivateUserResponse2 = UserRestUtils.deActivateUser(sdncUserDetails, sdncAdminUser);
- ErrorInfo errorInfo2 = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.USER_INACTIVE.name());
- assertEquals("Check response code after deActive user", errorInfo2.getCode(),
- deActivateUserResponse2.getErrorCode());
-
- List<String> variables2 = Arrays.asList(sdncUserDetails.getUserId());
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.USER_INACTIVE.name(), variables2,
- deActivateUserResponse2.getResponse());
-
- } finally {
- UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
- }
-
- }
-
- @Test
- public void createAgainDeActivatedUser() throws Exception {
-
- User sdncUserDetails = getDefaultUserDetails();
-
- try {
-
- UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
- DbUtils.cleanAllAudits();
-
- RestResponse createUserResponse = UserRestUtils.createUser(sdncUserDetails, sdncAdminUser);
- validateSuccessCreateUserResponse(sdncUserDetails, createUserResponse);
-
- // deActivate created user
- RestResponse deActivateUserResponse = UserRestUtils.deActivateUser(sdncUserDetails, sdncAdminUser);
- sdncUserDetails.setStatus(UserStatusEnum.INACTIVE);
- validateSuccessDeActivateUserResponse(sdncUserDetails, deActivateUserResponse);
-
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.USER_INACTIVE.name());
- RestResponse getUserResponse = UserRestUtils.getUser(sdncUserDetails, sdncAdminUser);
-
- assertEquals("Check response code after deActive user", errorInfo.getCode(),
- getUserResponse.getErrorCode());
-
- List<String> variables = Arrays.asList(sdncUserDetails.getUserId());
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.USER_INACTIVE.name(), variables,
- getUserResponse.getResponse());
-
- // create the user with the same UserId(details) as deActivated user
- DbUtils.cleanAllAudits();
-
- RestResponse createUserResponse2 = UserRestUtils.createUser(sdncUserDetails, sdncAdminUser);
- ErrorInfo errorInfo2 = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.USER_INACTIVE.name());
- assertEquals("Check response code after deActive user", errorInfo2.getCode(),
- createUserResponse2.getErrorCode());
-
- List<String> variables2 = Arrays.asList(sdncUserDetails.getUserId());
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.USER_INACTIVE.name(), variables2,
- createUserResponse2.getResponse());
-
- } finally {
- UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
- }
-
- }
-
- // very not recommend to run this test, resources/services may be zombie
- // @Test
- public void deActivateLastAdminUser() throws Exception {
-
- try {
-
- // send get all ADMIN user request toward BE
- RestResponse getAllAdminUsers = UserRestUtils.getAllAdminUsers(sdncAdminUser);
-
- assertNotNull("check response object is not null after create user", getAllAdminUsers);
- assertNotNull("check error code exists in response after create user", getAllAdminUsers.getErrorCode());
- assertEquals("Check response code after create user", 200, getAllAdminUsers.getErrorCode().intValue());
-
- TypeToken<List<User>> typeToken = new TypeToken<List<User>>() {
- };
- List<User> listOfUsersOnResponse = gson.fromJson(getAllAdminUsers.getResponse(), typeToken.getType());
- logger.debug("listOfUsers: {}", listOfUsersOnResponse);
-
- // build map of all Admin users from listOfUsersOnResponse from
- // response
- Map<String, User> mapAllUsersOnResponse = new HashMap<String, User>();
- for (User sdncUser : listOfUsersOnResponse) {
- mapAllUsersOnResponse.put(sdncUser.getUserId(), sdncUser);
- }
-
- // remove from mapAllUsersOnResponse map one of admin users
- mapAllUsersOnResponse.remove(sdncAdminUser.getUserId());
- logger.debug("map Of all Admin users exclude one : {}", mapAllUsersOnResponse);
-
- // deActivate all Admin users from the userIdAllAdminList list
- for (Entry<String, User> entry : mapAllUsersOnResponse.entrySet()) {
- UserRestUtils.deActivateUser(entry.getValue(), sdncAdminUser);
- }
-
- // deActivate last Admin user user
- RestResponse deActivateUserResponse = UserRestUtils.deActivateUser(sdncAdminUser, sdncAdminUser);
-
- ErrorInfo errorInfo = ErrorValidationUtils
- .parseErrorConfigYaml(ActionStatus.DELETE_USER_ADMIN_CONFLICT.name());
-
- assertEquals("Check response code after deActive user", errorInfo.getCode(),
- deActivateUserResponse.getErrorCode());
-
- List<String> variables = Arrays.asList();
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.DELETE_USER_ADMIN_CONFLICT.name(), variables,
- deActivateUserResponse.getResponse());
-
- } finally {
- // UserRestUtils.deleteUser(UserRestUtils.getAdminDetails2(),
- // sdncAdminUser);
- // UserRestUtils.deleteUser(UserRestUtils.getAdminDetails3(),
- // sdncAdminUser);
- // UserRestUtils.createUser(UserRestUtils.getAdminDetails2(),
- // sdncAdminUser);
- // UserRestUtils.createUser(UserRestUtils.getAdminDetails3(),
- // sdncAdminUser);
- }
-
- }
-
- // test check the resource accessibility via catalog view, resource was
- // created by user which was deActivated
-
- @Test
- public void resourceAccessibility() throws Exception {
-
- User sdncUserDetails = getDefaultUserDetails();
- ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource("tosca.nodes.newresource4test4",
- NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, "jh0003");
- String resourceBaseVersion = "0.1";
-
- try {
- // Delete resource
- // resourceUtils.deleteResource_allVersions(resourceDetails,
- // sdncAdminUser);
- UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
-
- DbUtils.cleanAllAudits();
- RestResponse createUserResponse = UserRestUtils.createUser(sdncUserDetails, sdncAdminUser);
- validateSuccessCreateUserResponse(sdncUserDetails, createUserResponse);
-
- // ------------------------Start create
- // resource---------------------------------------------------------------------------------
-
- // create resource
- RestResponse createResponse = ResourceRestUtils.createResource(resourceDetails, sdncUserDetails);
- assertEquals("Check response code after create", 201, createResponse.getErrorCode().intValue());
-
- Resource createdResource = ResponseParser.convertResourceResponseToJavaObject(createResponse.getResponse());
-
- RestResponse resourceGetResponse = ResourceRestUtils.getResource(sdncUserDetails,
- createdResource.getUniqueId());
- assertEquals("Check response code after get", 200, resourceGetResponse.getErrorCode().intValue());
-
- // validate get response
- ResourceRespJavaObject resourceRespJavaObject = Convertor.constructFieldsForRespValidation(resourceDetails,
- resourceBaseVersion);
- resourceRespJavaObject.setLifecycleState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
- resourceRespJavaObject.setAbstractt("false");
- resourceRespJavaObject.setCreatorUserId(sdncUserDetails.getUserId());
- resourceRespJavaObject.setLastUpdaterUserId(sdncUserDetails.getUserId());
-
- resourceRespJavaObject
- .setCreatorFullName(sdncUserDetails.getFirstName() + " " + sdncUserDetails.getLastName());
- resourceRespJavaObject
- .setLastUpdaterFullName(sdncUserDetails.getFirstName() + " " + sdncUserDetails.getLastName());
-
- ResourceValidationUtils.validateResp(resourceGetResponse, resourceRespJavaObject);
-
- // ------------------------End create
- // resource---------------------------------------------------------------------------------
-
- // clean audit before authorization test
- DbUtils.cleanAllAudits();
-
- // deActivate created user
- RestResponse deActivateUserResponse = UserRestUtils.deActivateUser(sdncUserDetails, sdncAdminUser);
- sdncUserDetails.setStatus(UserStatusEnum.INACTIVE);
- validateSuccessDeActivateUserResponse(sdncUserDetails, deActivateUserResponse);
-
- UserValidationUtils.validateDeleteUserAuditMessage(sdncUserDetails, sdncAdminUser, "200",
- UserResponseMessageEnum.SUCCESS_MESSAGE.getValue(),
- UserValidationUtils.getAddUserAuditMessage("DeleteUser"));
-
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.USER_INACTIVE.name());
- RestResponse getUserResponse = UserRestUtils.getUser(sdncUserDetails, sdncAdminUser);
-
- assertEquals("Check response code after deActive user", errorInfo.getCode(),
- getUserResponse.getErrorCode());
-
- List<String> variables = Arrays.asList(sdncUserDetails.getUserId());
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.USER_INACTIVE.name(), variables,
- getUserResponse.getResponse());
-
- // checking if created resource is accessible
- DbUtils.cleanAllAudits();
-
- RestResponse getCatalogDataResponse = CatalogRestUtils.getCatalog(sdncAdminUser.getUserId());
-
- // validate response
-
- assertNotNull("check response object is not null after user login", getCatalogDataResponse);
- assertNotNull("check error code exists in response after user login",
- getCatalogDataResponse.getErrorCode());
- assertEquals("Check response code after deActive user", 200,
- getCatalogDataResponse.getErrorCode().intValue());
-
- // expected resource list
- List<String> resourceExpectedUniqIdList = new ArrayList<String>();
- resourceExpectedUniqIdList.add(resourceDetails.getUniqueId());
- logger.debug("resourceExpectedUniqIdList: {}", resourceExpectedUniqIdList);
-
- compareResourceUniqIdList(getCatalogDataResponse.getResponse(), resourceExpectedUniqIdList, true);
-
- } finally {
- // resourceUtils.deleteResource_allVersions(resourceDetails,
- // sdncAdminUser);
- UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
- }
-
- }
-
- // test check the resource accessibility via catalog view, resource was
- // created by user which was deActivated
-
- @Test
- public void resourceAccessibilityOnImport() throws Exception {
-
- User sdncUserDetails = getDefaultUserDetails();
- ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource("importResource4test",
- NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, "jh0003");
- resourceDetails.addCategoryChain(ResourceCategoryEnum.GENERIC_DATABASE.getCategory(),
- ResourceCategoryEnum.GENERIC_DATABASE.getSubCategory());
- // String resourceBaseVersion = "1.0";
-
- try {
- // Delete resource
- // resourceUtils.deleteResource_allVersions(resourceDetails,
- // sdncAdminUser);
- RestResponse deleteUserResponse = UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
- assertTrue("delete user request failed",
- deleteUserResponse.getErrorCode() == 200 || deleteUserResponse.getErrorCode() == 404);
- DbUtils.cleanAllAudits();
- RestResponse createUserResponse = UserRestUtils.createUser(sdncUserDetails, sdncAdminUser);
- validateSuccessCreateUserResponse(sdncUserDetails, createUserResponse);
-
- // ------------------------Start import
- // resource---------------------------------------------------------------------------------
-
- // import new resource with CERTIFIED state
- User importer = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN2);
- RestResponse importResponse = ImportRestUtils.importResourceByName(resourceDetails, importer);
-
- assertNotNull("check response object is not null after create user", importResponse);
- assertNotNull("check error code exists in response after create user", importResponse.getErrorCode());
- assertEquals("Check response code after create user", 201, importResponse.getErrorCode().intValue());
-
- // ------------------------End import
- // resource---------------------------------------------------------------------------------
-
- // clean audit before authorization test
- DbUtils.cleanAllAudits();
-
- // deActivate created user
- RestResponse deActivateUserResponse = UserRestUtils.deActivateUser(sdncUserDetails, sdncAdminUser);
- sdncUserDetails.setStatus(UserStatusEnum.INACTIVE);
- validateSuccessDeActivateUserResponse(sdncUserDetails, deActivateUserResponse);
-
- UserValidationUtils.validateDeleteUserAuditMessage(sdncUserDetails, sdncAdminUser, "200",
- UserResponseMessageEnum.SUCCESS_MESSAGE.getValue(),
- UserValidationUtils.getAddUserAuditMessage("DeleteUser"));
-
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.USER_INACTIVE.name());
- RestResponse getUserResponse = UserRestUtils.getUser(sdncUserDetails, sdncAdminUser);
-
- assertEquals("Check response code after deActive user", errorInfo.getCode(),
- getUserResponse.getErrorCode());
-
- List<String> variables = Arrays.asList(sdncUserDetails.getUserId());
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.USER_INACTIVE.name(), variables,
- getUserResponse.getResponse());
-
- // checking if created resource is accessible
- DbUtils.cleanAllAudits();
-
- RestResponse getCatalogDataResponse = CatalogRestUtils.getCatalog(sdncAdminUser.getUserId());
-
- // validate response
-
- assertNotNull("check response object is not null after user login", getCatalogDataResponse);
- assertNotNull("check error code exists in response after user login",
- getCatalogDataResponse.getErrorCode());
- assertEquals("Check response code after deActive user", 200,
- getCatalogDataResponse.getErrorCode().intValue());
-
- // expected resource list
- List<String> resourceExpectedUniqIdList = new ArrayList<String>();
- resourceExpectedUniqIdList.add(resourceDetails.getUniqueId());
- logger.debug("resourceExpectedUniqIdList: {}", resourceExpectedUniqIdList);
-
- compareResourceUniqIdList(getCatalogDataResponse.getResponse(), resourceExpectedUniqIdList, true);
-
- } finally {
- // resourceUtils.deleteResource_allVersions(resourceDetails,
- // sdncAdminUser);
- UserRestUtils.deleteUser(sdncUserDetails, sdncAdminUser, true);
- }
-
- }
-
- public void compareServiceUniqIdList(String response, List<String> expectedList, boolean flag) {
-
- JsonElement jelement = new JsonParser().parse(response);
- JsonObject jobject = jelement.getAsJsonObject();
- JsonArray serviceArray = (JsonArray) jobject.get("services");
- logger.debug("{}", serviceArray);
- assertTrue("expected service count: " + expectedList.size() + " or more" + ", actual: " + serviceArray.size(),
- serviceArray.size() >= expectedList.size());
-
- // build service list from response
- List<ServiceReqDetails> serviceReqDetailsListOnResponse = new ArrayList<ServiceReqDetails>();
- for (int i = 0; i < serviceArray.size(); i++) {
- ServiceReqDetails json = gson.fromJson(serviceArray.get(i), ServiceReqDetails.class);
- serviceReqDetailsListOnResponse.add(json);
- }
- }
-
- public void compareResourceUniqIdList(String response, List<String> expectedList, boolean flag) {
-
- JsonElement jelement = new JsonParser().parse(response);
- JsonObject jobject = jelement.getAsJsonObject();
- JsonArray resourceArray = (JsonArray) jobject.get("resources");
- logger.debug("{}", resourceArray);
- assertTrue("expected resource count: " + expectedList.size() + " or more" + ", actual: " + resourceArray.size(),
- resourceArray.size() >= expectedList.size());
-
- // build resource list from response
- List<ResourceReqDetails> resourceReqDetailsListOnResponse = new ArrayList<ResourceReqDetails>();
- for (int i = 0; i < resourceArray.size(); i++) {
- ResourceReqDetails json = gson.fromJson(resourceArray.get(i), ResourceReqDetails.class);
- resourceReqDetailsListOnResponse.add(json);
- }
-
- logger.debug("ResourceReqDetails list on response: {}", resourceReqDetailsListOnResponse);
-
- List<String> resourceActualUniqIdList = new ArrayList<String>();
- for (ResourceReqDetails resource : resourceReqDetailsListOnResponse) {
- resourceActualUniqIdList.add(resource.getUniqueId());
- }
- logger.debug("resourceActualUniqIdList on response: {}", resourceActualUniqIdList);
- logger.debug("resourceExpectedUniqIdList on response: {}", expectedList);
-
- if (flag) {
- assertTrue("actual list does not contain expected list",
- resourceActualUniqIdList.containsAll(expectedList));
- } else {
- assertFalse("actual list contains non expected list elements",
- resourceActualUniqIdList.containsAll(expectedList));
- }
- }
-
- // public User getDefaultUserDetails(){
- //
- // String userFirstName = "Kot";
- // String userLastName = "May";
- // String role = UserRoleEnum.ADMIN.name();
- // User sdncUserDetails = new User(userFirstName, userLastName,
- // httpCspUserId, email, role,null);
- //
- // return sdncUserDetails;
- // }
- //
- // public void validateSuccessCreateUserResponse(User sdncUserDetails,
- // RestResponse createUserResponse) throws Exception{
- //
- // assertNotNull("check response object is not null after create user",
- // createUserResponse);
- // assertNotNull("check error code exists in response after create user",
- // createUserResponse.getErrorCode());
- // assertEquals("Check response code after create user",
- // HttpStatus.SC_CREATED, createUserResponse.getErrorCode().intValue());
- //
- // UserRestUtils.validateUserDetailsOnResponse(sdncUserDetails,
- // createUserResponse.getResponse());
- // UserRestUtils.validateAddUserAuditMessage(sdncUserDetails, sdncAdminUser,
- // String.valueOf(HttpStatus.SC_CREATED),
- // UserResponseMessageEnum.SUCCESS_MESSAGE.getValue(),
- // UserRestUtils.getAddUserAuditMessage("AddUser"));
- // RestResponse getUserResponse = UserRestUtils.getUser(sdncUserDetails,
- // sdncAdminUser);
- // UserRestUtils.validateUserDetailsOnResponse(sdncUserDetails,
- // getUserResponse.getResponse());
- //
- // }
- //
- // public void validateSuccessDeActivateUserResponse(User sdncUserDetails,
- // RestResponse deActivateUserResponse) throws Exception{
- //
- // assertNotNull("check response object is not null after deActive user",
- // deActivateUserResponse);
- // assertNotNull("check error code exists in response after deActive user",
- // deActivateUserResponse.getErrorCode());
- // assertEquals("Check response code after deActive user", 200,
- // deActivateUserResponse.getErrorCode().intValue());
- //
- // UserRestUtils.validateUserDetailsOnResponse(sdncUserDetails,
- // deActivateUserResponse.getResponse());
- // UserRestUtils.validateDeleteUserAuditMessage(sdncUserDetails,
- // sdncAdminUser, "200", UserResponseMessageEnum.SUCCESS_MESSAGE.getValue(),
- // UserRestUtils.getAddUserAuditMessage("DeleteUser"));
- //
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/executeOnUGN/distributionClient/ClientConfiguration.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/executeOnUGN/distributionClient/ClientConfiguration.java
deleted file mode 100644
index c80f6c612d..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/executeOnUGN/distributionClient/ClientConfiguration.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.executeOnUGN.distributionClient;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class ClientConfiguration {
-
- private String asdcAddress;
- private String user;
- private String password;
- private Integer pollingInterval;
- private Integer pollingTimeout;
- private List<String> relevantArtifactTypes;
- private String consumerGroup;
- private String environmentName;
- private String consumerID;
-
- public ClientConfiguration() {
-
- super();
-
- this.asdcAddress = "localhost:8443";
- this.consumerID = "mso-123456";
- this.consumerGroup = "mso-group";
- this.environmentName = "PROD";
- this.password = "password";
- this.pollingInterval = 20;
- this.pollingTimeout = 20;
- this.relevantArtifactTypes = new ArrayList<String>();
- this.relevantArtifactTypes.add("SHELL");
- this.user = "mso-user";
- }
-
- public String getAsdcAddress() {
- return asdcAddress;
- }
-
- public void setAsdcAddress(String asdcAddress) {
- this.asdcAddress = asdcAddress;
- }
-
- public String getUser() {
- return user;
- }
-
- public void setUser(String user) {
- this.user = user;
- }
-
- public String getPassword() {
- return password;
- }
-
- public void setPassword(String password) {
- this.password = password;
- }
-
- public int getPollingInterval() {
- return pollingInterval;
- }
-
- public void setPollingInterval(Integer pollingInterval) {
- this.pollingInterval = pollingInterval;
- }
-
- public int getPollingTimeout() {
- return pollingTimeout;
- }
-
- public void setPollingTimeout(Integer pollingTimeout) {
- this.pollingTimeout = pollingTimeout;
- }
-
- public List<String> getRelevantArtifactTypes() {
- return relevantArtifactTypes;
- }
-
- public void setRelevantArtifactTypes(List<String> relevantArtifactTypes) {
- this.relevantArtifactTypes = relevantArtifactTypes;
- }
-
- public String getConsumerGroup() {
- return consumerGroup;
- }
-
- public void setConsumerGroup(String consumerGroup) {
- this.consumerGroup = consumerGroup;
- }
-
- public String getEnvironmentName() {
- return environmentName;
- }
-
- public void setEnvironmentName(String environmentName) {
- this.environmentName = environmentName;
- }
-
- public String getComsumerID() {
- return consumerID;
- }
-
- public void setComsumerID(String comsumerID) {
- this.consumerID = comsumerID;
- }
-
- public ClientConfiguration(String asdcAddress, String user, String password, Integer pollingInterval,
- Integer pollingTimeout, List<String> relevantArtifactTypes, String consumerGroup, String environmentName,
- String comsumerID) {
- super();
- this.asdcAddress = asdcAddress;
- this.user = user;
- this.password = password;
- this.pollingInterval = pollingInterval;
- this.pollingTimeout = pollingTimeout;
- this.relevantArtifactTypes = relevantArtifactTypes;
- this.consumerGroup = consumerGroup;
- this.environmentName = environmentName;
- this.consumerID = comsumerID;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/preRequisites/ComplexResourceBaseTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/preRequisites/ComplexResourceBaseTest.java
deleted file mode 100644
index 32f355d14c..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/preRequisites/ComplexResourceBaseTest.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.preRequisites;
-
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.execute.lifecycle.LCSbaseTest;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.*;
-import org.testng.annotations.BeforeMethod;
-
-import java.io.IOException;
-
-import static org.testng.AssertJUnit.*;
-
-public class ComplexResourceBaseTest extends ComponentBaseTest {
-
- protected ServiceReqDetails serviceDetails;
- protected ResourceReqDetails resourceDetailsVFC;
- protected ResourceReqDetails resourceDetailsVL;
- protected ResourceReqDetails resourceDetailsVF;
- protected ResourceReqDetails resourceDetailsCP;
- protected ComponentInstanceReqDetails resourceInstanceReqDetailsVF;
- protected ComponentInstanceReqDetails resourceInstanceReqDetailsVFC;
- protected ComponentInstanceReqDetails resourceInstanceReqDetailsVL;
- protected ComponentInstanceReqDetails resourceInstanceReqDetailsCP;
- protected User sdncDesignerDetails1;
- protected User sdncTesterDeatails1;
- protected User sdncAdminDetails1;
- protected ArtifactReqDetails heatArtifactDetails;
-
- protected ArtifactReqDetails defaultArtifactDetails;
- protected int maxLength = 50;
- protected Resource resourceVF = null;
-
- @Rule
- public static TestName name = new TestName();
-
- public ComplexResourceBaseTest() {
- super(name, ComplexResourceBaseTest.class.getName());
- }
-
- @BeforeMethod
- public void before() throws Exception {
-
- initializeMembers();
-
- createComponents();
-
- }
-
- public void initializeMembers() throws IOException, Exception {
-
- serviceDetails = ElementFactory.getDefaultService();
- resourceDetailsVFC = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VFC, "resourceVFC");
- resourceDetailsVF = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, "resourceVF3");
- resourceDetailsVL = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VL, "resourceVL");
- resourceDetailsCP = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.CP, "resourceCP");
- sdncDesignerDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- sdncTesterDeatails1 = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
- sdncAdminDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- heatArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
-
- }
-
- protected void createComponents() throws Exception {
-
- RestResponse response = ServiceRestUtils.createService(serviceDetails, sdncDesignerDetails1);
- assertTrue("create request returned status:" + response.getErrorCode(), response.getErrorCode() == 201);
- assertNotNull("service uniqueId is null:", serviceDetails.getUniqueId());
-
- response = ResourceRestUtils.createResource(resourceDetailsVFC, sdncDesignerDetails1);
- assertTrue("create request returned status:" + response.getErrorCode(), response.getErrorCode() == 201);
- assertNotNull("resource uniqueId is null:", resourceDetailsVFC.getUniqueId());
- response = LifecycleRestUtils.changeResourceState(resourceDetailsVFC, sdncDesignerDetails1,
- resourceDetailsVFC.getVersion(), LifeCycleStatesEnum.CHECKIN);
- assertTrue("change LS state to CHECKIN, returned status:" + response.getErrorCode(),
- response.getErrorCode() == 200);
-
- response = ResourceRestUtils.createResource(resourceDetailsVF, sdncDesignerDetails1);
- assertTrue("create request returned status:" + response.getErrorCode(), response.getErrorCode() == 201);
- assertNotNull("resource uniqueId is null:", resourceDetailsVF.getUniqueId());
-
- response = ResourceRestUtils.createResource(resourceDetailsCP, sdncDesignerDetails1);
- assertTrue("create request returned status:" + response.getErrorCode(), response.getErrorCode() == 201);
- assertNotNull("resource uniqueId is null:", resourceDetailsCP.getUniqueId());
- response = LifecycleRestUtils.changeResourceState(resourceDetailsCP, sdncDesignerDetails1,
- resourceDetailsCP.getVersion(), LifeCycleStatesEnum.CHECKIN);
- assertTrue("change LS state to CHECKIN, returned status:" + response.getErrorCode(),
- response.getErrorCode() == 200);
-
- response = ResourceRestUtils.createResource(resourceDetailsVL, sdncDesignerDetails1);
- assertTrue("create request returned status:" + response.getErrorCode(), response.getErrorCode() == 201);
- assertNotNull("resource uniqueId is null:", resourceDetailsVL.getUniqueId());
- response = LifecycleRestUtils.changeResourceState(resourceDetailsVL, sdncDesignerDetails1,
- resourceDetailsVL.getVersion(), LifeCycleStatesEnum.CHECKIN);
- assertTrue("change LS state to CHECKIN, returned status:" + response.getErrorCode(),
- response.getErrorCode() == 200);
-
- resourceInstanceReqDetailsVFC = ElementFactory.getDefaultComponentInstance("VFC", resourceDetailsVFC);
- resourceInstanceReqDetailsVF = ElementFactory.getDefaultComponentInstance("VF", resourceDetailsVF);
- resourceInstanceReqDetailsVL = ElementFactory.getDefaultComponentInstance("VL", resourceDetailsVL);
- resourceInstanceReqDetailsCP = ElementFactory.getDefaultComponentInstance("CP", resourceDetailsCP);
-
- }
-
- protected void createVFWithCertifiedResourceInstance(ResourceReqDetails resourceDetails,
- ComponentInstanceReqDetails resourceInstanceReqDetails) throws Exception {
-
- RestResponse response = LifecycleRestUtils.changeResourceState(resourceDetails, sdncDesignerDetails1,
- resourceDetails.getVersion(), LifeCycleStatesEnum.CHECKOUT);
- assertEquals("Check response code after CHECKOUT", 200, response.getErrorCode().intValue());
-
- // add heat artifact to resource and certify
- ArtifactReqDetails heatArtifactDetails = ElementFactory
- .getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
- response = ArtifactRestUtils.addInformationalArtifactToResource(heatArtifactDetails, sdncDesignerDetails1,
- resourceDetails.getUniqueId());
- assertTrue("add HEAT artifact to resource request returned status:" + response.getErrorCode(),
- response.getErrorCode() == 200);
- response = LCSbaseTest.certifyResource(resourceDetails, sdncDesignerDetails1);
- assertEquals("Check response code after CERTIFY request", 200, response.getErrorCode().intValue());
-
- resourceVF = convertResourceGetResponseToJavaObject(resourceDetailsVF);
-
- resourceInstanceReqDetails.setComponentUid(resourceDetails.getUniqueId());
- response = ComponentInstanceRestUtils.createComponentInstance(resourceInstanceReqDetails, sdncDesignerDetails1,
- resourceVF);
- assertEquals("Check response code after create RI", 201, response.getErrorCode().intValue());
-
- resourceVF = convertResourceGetResponseToJavaObject(resourceDetailsVF);
- }
-
- protected Resource convertResourceGetResponseToJavaObject(ResourceReqDetails resourceDetails) throws IOException {
- RestResponse response = ResourceRestUtils.getResource(resourceDetails, sdncDesignerDetails1);
- assertEquals("Check response code after get resource", 200, response.getErrorCode().intValue());
- return ResponseParser.convertResourceResponseToJavaObject(response.getResponse());
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/preRequisites/DownloadArtifactBaseTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/preRequisites/DownloadArtifactBaseTest.java
deleted file mode 100644
index b02f211767..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/preRequisites/DownloadArtifactBaseTest.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.preRequisites;
-
-
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.model.Service;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.execute.lifecycle.LCSbaseTest;
-import org.openecomp.sdc.ci.tests.utils.ArtifactUtils;
-import org.openecomp.sdc.ci.tests.utils.DbUtils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.*;
-import org.testng.AssertJUnit;
-import org.testng.annotations.BeforeMethod;
-
-import java.io.IOException;
-
-public class DownloadArtifactBaseTest extends ComponentBaseTest {
-
- protected ResourceReqDetails downloadResourceDetails;
- protected ServiceReqDetails serviceDetails;
- protected ComponentInstanceReqDetails resourceInstanceReqDetails;
- protected User sdncUserDetails;
- protected User sdncDesignerDetails1;
- protected ArtifactReqDetails heatArtifactDetails;
-
- protected ArtifactReqDetails defaultArtifactDetails;
-
- protected ArtifactUtils artifactUtils;
- protected Service service;
-
- public DownloadArtifactBaseTest(TestName testName, String className) {
- super(testName, className);
- }
-
- @BeforeMethod
- public void before() throws Exception {
-
- initializeMembers();
- createComponents();
-
- }
-
- public void initializeMembers() throws IOException, Exception {
- downloadResourceDetails = ElementFactory.getDefaultResource();
- serviceDetails = ElementFactory.getDefaultService();
- sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- sdncDesignerDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- heatArtifactDetails = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
- resourceInstanceReqDetails = ElementFactory.getDefaultComponentInstance();
-
- }
-
- protected void createComponents() throws Exception {
-
- RestResponse response = ResourceRestUtils.createResource(downloadResourceDetails, sdncUserDetails);
- AssertJUnit.assertTrue("create request returned status:" + response.getErrorCode(),
- response.getErrorCode() == 201);
- AssertJUnit.assertNotNull("resource uniqueId is null:", downloadResourceDetails.getUniqueId());
-
- ArtifactReqDetails heatArtifactDetails = ElementFactory
- .getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
- response = ArtifactRestUtils.addInformationalArtifactToResource(heatArtifactDetails, sdncUserDetails,
- downloadResourceDetails.getUniqueId());
- AssertJUnit.assertTrue("add HEAT artifact to resource request returned status:" + response.getErrorCode(),
- response.getErrorCode() == 200);
-
- // certified resource
- response = LCSbaseTest.certifyResource(downloadResourceDetails, sdncDesignerDetails1);
- AssertJUnit.assertTrue("certify resource request returned status:" + response.getErrorCode(),
- response.getErrorCode() == 200);
-
- response = ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
- AssertJUnit.assertTrue("create request returned status:" + response.getErrorCode(),
- response.getErrorCode() == 201);
- AssertJUnit.assertNotNull("service uniqueId is null:", serviceDetails.getUniqueId());
-
- // add resource instance with HEAT deployment artifact to the service
- resourceInstanceReqDetails.setComponentUid(downloadResourceDetails.getUniqueId());
- response = ComponentInstanceRestUtils.createComponentInstance(resourceInstanceReqDetails, sdncUserDetails,
- serviceDetails.getUniqueId(), ComponentTypeEnum.SERVICE);
- AssertJUnit.assertTrue("response code is not 201, returned: " + response.getErrorCode(),
- response.getErrorCode() == 201);
-
- response = ServiceRestUtils.getService(serviceDetails, sdncUserDetails);
- AssertJUnit.assertTrue("response code is not 200, returned: " + response.getErrorCode(),
- response.getErrorCode() == 200);
- service = ResponseParser.convertServiceResponseToJavaObject(response.getResponse());
-
- DbUtils.cleanAllAudits();
-
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/preRequisites/SimpleOneRsrcOneServiceTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/preRequisites/SimpleOneRsrcOneServiceTest.java
deleted file mode 100644
index 913b2852ac..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/preRequisites/SimpleOneRsrcOneServiceTest.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.preRequisites;
-
-
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.ArtifactUtils;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
-import org.testng.annotations.BeforeMethod;
-
-import java.io.IOException;
-
-import static org.testng.AssertJUnit.assertTrue;
-
-public abstract class SimpleOneRsrcOneServiceTest extends ComponentBaseTest {
-
- protected ResourceReqDetails resourceDetails;
- protected ServiceReqDetails serviceDetails;
- protected ComponentInstanceReqDetails resourceInstanceReqDetails;
- protected ArtifactReqDetails heatArtifactDetails1;
-
- private static final String heatExtension = "yaml";
- private static final String yangXmlExtension = "xml";
- private static final String muranoPkgExtension = "zip";
- private static final String extension = null;
- private final String folderName = "heatEnv";
-
- protected User sdncDesignerDetails;
- protected ArtifactReqDetails defaultArtifactDetails;
-
- protected ArtifactUtils artifactUtils;
- protected Utils utils;
-
- private static RestResponse createServiceResponse;
-
- public SimpleOneRsrcOneServiceTest(TestName testName, String className) {
- super(testName, className);
- }
-
- @BeforeMethod
- public void before() throws Exception {
-
- initializeMembers();
- createComponents();
-
- }
-
- public void initializeMembers() throws IOException, Exception {
- sdncDesignerDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- resourceDetails = ElementFactory.getDefaultResource();
- serviceDetails = ElementFactory.getDefaultService();
- heatArtifactDetails1 = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
- resourceInstanceReqDetails = ElementFactory.getDefaultComponentInstance("resourceInstanceReqDetails");
- }
-
- protected void createComponents() throws Exception {
-
- RestResponse response = ResourceRestUtils.createResource(resourceDetails, sdncDesignerDetails);
- assertTrue("create request returned status:" + response.getErrorCode(), response.getErrorCode() == 201);
-
- response = ServiceRestUtils.createService(serviceDetails, sdncDesignerDetails);
- assertTrue("create request returned status:" + response.getErrorCode(), response.getErrorCode() == 201);
-
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/requirements/RequirementsTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/requirements/RequirementsTest.java
deleted file mode 100644
index 51894e7ec1..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/requirements/RequirementsTest.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright © 2016-2018 European Support Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openecomp.sdc.ci.tests.requirements;
-
-import org.junit.Assert;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.model.RequirementDefinition;
-import org.openecomp.sdc.be.model.Service;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.datatypes.RequirementDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.RequirementsUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Test;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import static org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils.getServiceObject;
-
-public class RequirementsTest extends ComponentBaseTest {
- @Rule
- public static final TestName name = new TestName();
-
- private ServiceReqDetails component;
- private User user = null;
-
- public RequirementsTest() {
- super(name, RequirementsTest.class.getName());
- }
-
- @BeforeTest
- public void init() throws Exception {
- user = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- component = ElementFactory.getDefaultService();
- component.setName("comp_req" + Math.random());
- ServiceRestUtils.createService(component, user);
- }
-
- @Test
- public void createRequirementTest() throws Exception {
-
- RequirementDetails requirement = createRequirement();
- RestResponse restResponse = RequirementsUtils.createRequirement(component.getUniqueId(),
- Collections.singletonList(requirement), user);
- logger.info("createRequirement Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- @Test(dependsOnMethods = "createRequirementTest")
- public void updateRequirementTest() throws Exception {
-
- RequirementDetails requirement = createRequirement();
- requirement.setMaxOccurrences("10");
- requirement.setMinOccurrences("4");
- RestResponse restResponse = RequirementsUtils.updateRequirement(component.getUniqueId(),
- Collections.singletonList(requirement), user);
- logger.info("updateRequirement Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- @Test(dependsOnMethods = "updateRequirementTest")
- public void getRequirementTest() throws Exception {
- Service service = getServiceObject(component.getUniqueId());
-
- List<RequirementDefinition> requirementDefinitionList = service.getRequirements().values()
- .stream().flatMap(Collection::stream).collect(Collectors.toList());
-
- RestResponse restResponse = RequirementsUtils.getRequirement(component.getUniqueId(),
- requirementDefinitionList.get(0).getUniqueId(), user);
- logger.info("getRequirementTest Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- @Test(dependsOnMethods = "getRequirementTest")
- public void deleteRequirementTest() throws Exception {
- Service service = getServiceObject(component.getUniqueId());
-
- List<RequirementDefinition> requirementDefinitionList = service.getRequirements().values()
- .stream().flatMap(Collection::stream).collect(Collectors.toList());
-
- RestResponse restResponse = RequirementsUtils.deleteRequirement(component.getUniqueId(),
- requirementDefinitionList.get(0).getUniqueId(), user);
- logger.info("deleteRequirementTest Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- private RequirementDetails createRequirement() {
- RequirementDetails requirementDetails = new RequirementDetails();
- requirementDetails.setName("req" + Math.random());
- requirementDetails.setCapability("tosca.capabilities.network.Bindable");
-
- return requirementDetails;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/rules/MyTestWatcher.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/rules/MyTestWatcher.java
deleted file mode 100644
index bb2d2d579b..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/rules/MyTestWatcher.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.rules;
-
-import org.junit.rules.TestWatcher;
-import org.junit.runner.Description;
-import org.openecomp.sdc.ci.tests.api.AttSdcTest;
-
-public class MyTestWatcher extends TestWatcher {
-
- AttSdcTest odlTest;
-
- public MyTestWatcher(AttSdcTest odlTest) {
- this.odlTest = odlTest;
- }
-
- /**
- * Invoked when a test succeeds
- *
- * @param description
- */
- @Override
- protected void succeeded(Description description) {
- String testName = description.getMethodName();
- odlTest.addTestSummary(testName, true);
-
- }
-
- /**
- * Invoked when a test fails
- *
- * @param e
- * @param description
- */
- @Override
- protected void failed(Throwable e, Description description) {
- String testName = description.getMethodName();
- odlTest.addTestSummary(testName, false, e);
- }
-
- /**
- * Invoked when a test is about to start
- *
- * @param description
- */
- @Override
- protected void starting(Description description) {
- // System.out.println("protected void starting(Description description)
- // {");
- this.odlTest.getLogger().debug("Start running test {}", description.getMethodName());
- }
-
- /**
- * Invoked when a test method finishes (whether passing or failing)
- *
- * @param description
- */
- @Override
- protected void finished(Description description) {
- // System.out.println("protected void finished(Description description)
- // {");
- this.odlTest.getLogger().debug("Finish running test {}", description.getMethodName());
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/run/StartTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/run/StartTest.java
deleted file mode 100644
index 4bd8f58a08..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/run/StartTest.java
+++ /dev/null
@@ -1,278 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.run;
-
-
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.core.LoggerContext;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.TestNG;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-
-public class StartTest {
-
- // private List<Class<? extends AttSdcTest>> testClasses = new
- // ArrayList<Class<? extends AttSdcTest>>();
- public static long timeOfTest = 0;
-
- public static boolean debug = false;
-
- public static AtomicBoolean loggerInitialized = new AtomicBoolean(false);
-
- protected static Logger logger = null;
-
- public static void main(String[] args) {
-
- String debugEnabled = System.getProperty("debug");
- if (debugEnabled != null && debugEnabled.equalsIgnoreCase("true")) {
- debug = true;
- }
- System.out.println("Debug mode is " + (debug ? "enabled" : "disabled"));
-
- enableLogger();
-
- Config config = null;
- try {
- config = Utils.getConfig();
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- }
-
- if (config == null) {
- logger.error("Failed to configuration file of ci tests.");
- System.exit(1);
- }
-
- TestNG testng = new TestNG();
-
- List<String> suites = new ArrayList<String>();
- suites.add("testSuites/" + args[0]);
- testng.setTestSuites(suites);
- testng.setUseDefaultListeners(true);
- testng.setOutputDirectory("target/");
-
- testng.run();
-
- }
-
- public StartTest() {
- logger = LoggerFactory.getLogger(StartTest.class.getName());
- }
-
- public static void enableLogger() {
-
- if (false == loggerInitialized.get()) {
-
- loggerInitialized.set(true);
-
- String log4jPropsFile = System.getProperty("log4j.configuration");
- if (System.getProperty("os.name").contains("Windows")) {
- String logProps = "src/main/resources/ci/conf/log4j2.properties";
- if (log4jPropsFile == null) {
- System.setProperty("targetlog", "target/");
- log4jPropsFile = logProps;
- }
-
- }
-
- LoggerContext context = (org.apache.logging.log4j.core.LoggerContext) LogManager.getContext(false);
- File file = new File(log4jPropsFile);
- context.setConfigLocation(file.toURI());
-
- }
- }
-
- private List<Class> getClassesForPackage(String pkgname) {
-
- List<Class> classes = new ArrayList<Class>();
-
- // Get a File object for the package
- File directory = null;
- String fullPath;
- String relPath = pkgname.replace('.', '/');
-
- // System.out.println("ClassDiscovery: Package: " + pkgname +
- // " becomes Path:" + relPath);
-
- URL resource = ClassLoader.getSystemClassLoader().getResource(relPath);
-
- // System.out.println("ClassDiscovery: Resource = " + resource);
- if (resource == null) {
- throw new RuntimeException("No resource for " + relPath);
- }
- fullPath = resource.getFile();
- // System.out.println("ClassDiscovery: FullPath = " + resource);
-
- if (debug) {
- System.out.println("fullPath is " + fullPath);
- }
-
- try {
- directory = new File(resource.toURI());
- } catch (URISyntaxException e) {
- throw new RuntimeException(
- pkgname + " (" + resource
- + ") does not appear to be a valid URL / URI. Strange, since we got it from the system...",
- e);
- } catch (IllegalArgumentException e) {
- directory = null;
- }
- // System.out.println("ClassDiscovery: Directory = " + directory);
-
- if (directory != null && directory.exists()) {
-
- // Get the list of the files contained in the package
- String[] files = directory.list();
- for (int i = 0; i < files.length; i++) {
-
- // we are only interested in .class files
- if (files[i].endsWith(".class") && false == files[i].contains("$")) {
-
- // removes the .class extension
- String className = pkgname + '.' + files[i].substring(0, files[i].length() - 6);
-
- // System.out.println("ClassDiscovery: className = " +
- // className);
-
- if (debug) {
- System.out.println("ClassDiscovery: className = " + className);
- }
-
- try {
- Class clas = Class.forName(className);
- boolean isAddToRun = false;
- Method[] methods = clas.getMethods();
- for (Method method : methods) {
- Annotation[] anns = method.getAnnotations();
- for (Annotation an : anns) {
- if (an.annotationType().getSimpleName().equalsIgnoreCase("Test")) {
- isAddToRun = true;
- break;
- }
- }
- }
- if (isAddToRun)
- classes.add(clas);
- } catch (ClassNotFoundException e) {
- throw new RuntimeException("ClassNotFoundException loading " + className);
- }
- }
- }
- } else {
- try {
- String jarPath = fullPath.replaceFirst("[.]jar[!].*", ".jar").replaceFirst("file:", "");
-
- if (debug) {
- System.out.println("jarPath is " + jarPath);
- }
-
- JarFile jarFile = new JarFile(jarPath);
- Enumeration<JarEntry> entries = jarFile.entries();
- while (entries.hasMoreElements()) {
- JarEntry entry = entries.nextElement();
- String entryName = entry.getName();
- if (entryName.startsWith(relPath) && entryName.length() > (relPath.length() + "/".length())) {
-
- // System.out.println("ClassDiscovery: JarEntry: " +
- // entryName);
- String className = entryName.replace('/', '.').replace('\\', '.').replace(".class", "");
-
- // System.out.println("ClassDiscovery: className = " +
- // className);
-
- if (false == className.contains("$")) {
-
- if (debug) {
- System.out.println("ClassDiscovery: className = " + className);
- }
-
- try {
- Class clas = Class.forName(className);
- boolean isAddToRun = false;
- Method[] methods = clas.getMethods();
- for (Method method : methods) {
- Annotation[] anns = method.getAnnotations();
- for (Annotation an : anns) {
- if (an.annotationType().getSimpleName().equalsIgnoreCase("Test")) {
- isAddToRun = true;
- break;
- }
- }
- }
- if (isAddToRun)
- classes.add(clas);
- } catch (ClassNotFoundException e) {
- throw new RuntimeException("ClassNotFoundException loading " + className);
- }
- }
- }
- }
- jarFile.close();
-
- } catch (IOException e) {
- throw new RuntimeException(pkgname + " (" + directory + ") does not appear to be a valid package", e);
- }
- }
- return classes;
- }
-
- private void addTableHead(StringBuilder results) {
- results.append("<tr>");
- results.append("<th>").append("Unit Test").append("</th>");
- results.append("<th>").append("Result").append("</th>");
- results.append("</tr>");
- }
-
- // private void addUnitTestResult(StringBuilder results,
- // Class<? extends AttSdcTest> testClass, Result unitTestResult) {
- //
- // boolean isSuccess = unitTestResult.wasSuccessful();
- //
- // String result = (isSuccess) ? "success" : "fail";
- // String fileName = FileUtils.getFileName(testClass.getName());
- // results.append("<tr>");
- // //
- // results.append("<td>").append(FileUtils.getFileName(testClass.getName())).append("</td>");
- // results.append("<td class=\"name\">")
- // .append("<a href=\"" + fileName + timeOfTest + ".html\">"
- // + fileName + "</a>").append("</td>");
- // results.append("<td class=\"" + result + "\">").append(result)
- // .append("</td>");
- // results.append("</tr>");
- // }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/run/StartTest2backup.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/run/StartTest2backup.java
deleted file mode 100644
index cbaf8be40b..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/run/StartTest2backup.java
+++ /dev/null
@@ -1,411 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.run;
-
-
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.core.LoggerContext;
-import org.junit.runner.JUnitCore;
-import org.junit.runner.Result;
-import org.junit.runner.notification.Failure;
-import org.openecomp.sdc.ci.tests.api.AttSdcTest;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.ci.tests.utils.general.FileUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-
-public class StartTest2backup {
-
- private List<Class<? extends AttSdcTest>> testClasses = new ArrayList<Class<? extends AttSdcTest>>();
- public static long timeOfTest = 0;
-
- public static boolean debug = false;
-
- public static AtomicBoolean loggerInitialized = new AtomicBoolean(false);
-
- protected static Logger logger = null;
-
- public static void main(String[] args) {
-
- String debugEnabled = System.getProperty("debug");
- if (debugEnabled != null && debugEnabled.equalsIgnoreCase("true")) {
- debug = true;
- }
- System.out.println("Debug mode is " + (debug ? "enabled" : "disabled"));
-
- enableLogger();
-
- Config config = null;
- try {
- config = Utils.getConfig();
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- }
-
- if (config == null) {
- logger.error("Failed to configuration file of ci tests.");
- System.exit(1);
- }
-
- List<String> packagesToRun = config.getPackages();
- if (packagesToRun == null || true == packagesToRun.isEmpty()) {
- logger.error("No package was configured to be executed.");
- System.exit(2);
- }
- StartTest2backup tests = new StartTest2backup();
-
- boolean stopOnClassFailure = false;
- String stopOnClassFailureStr = System.getProperty("stopOnClassFailure");
- if (stopOnClassFailureStr != null && stopOnClassFailureStr.equalsIgnoreCase("true")) {
- stopOnClassFailure = true;
- } else {
- Boolean stopOnClassFailureObj = config.isStopOnClassFailure();
- if (stopOnClassFailureObj != null) {
- stopOnClassFailure = stopOnClassFailureObj.booleanValue();
- }
- }
-
- tests.start(packagesToRun, stopOnClassFailure);
- }
-
- public StartTest2backup() {
- logger = LoggerFactory.getLogger(StartTest2backup.class.getName());
- }
-
- public static void enableLogger() {
-
- if (false == loggerInitialized.get()) {
-
- loggerInitialized.set(true);
-
- String log4jPropsFile = System.getProperty("log4j.configuration");
- if (System.getProperty("os.name").contains("Windows")) {
- String logProps = "src/main/resources/ci/conf/log4j2.properties";
- if (log4jPropsFile == null) {
- System.setProperty("targetlog", "target/");
- log4jPropsFile = logProps;
- }
-
- }
-
- LoggerContext context = (org.apache.logging.log4j.core.LoggerContext) LogManager.getContext(false);
- File file = new File(log4jPropsFile);
- context.setConfigLocation(file.toURI());
- }
- }
-
- public void start(List<String> packages, boolean exitOnFailure) {
-
- boolean success = true;
- StringBuilder results = new StringBuilder();
- Result result;
-
- if (packages == null) {
- return;
- }
-
- for (String packageName : packages) {
- // List<Class> classesForPackage =
- // getClassesForPackage("org.openecomp.sdc.ci.tests.execute");
- List<Class> classesForPackage = getClassesForPackage(packageName);
- if (classesForPackage != null && false == classesForPackage.isEmpty()) {
- for (Class testUnit : classesForPackage) {
- testClasses.add(testUnit);
- }
- }
- }
-
- System.out.println(testClasses);
-
- // tsetClasses.add(LogValidatorTest.class);
- // tsetClasses.add(AttNorthboundTest.class);
-
- results.append(
- "<Html><head><style>th{background-color: gray;color: white;height: 30px;}td {color: black;height: 30px;}.fail {background-color: #FF5555;width: 100px;text-align: center;}.success {background-color: #00FF00;width: 100px;text-align: center;}.name {width: 200px;background-color: #F0F0F0;}.message {width: 300px;background-color: #F0F0F0;}</style></head><body>");
-
- Calendar calendar = Calendar.getInstance();
- timeOfTest = calendar.getTimeInMillis();
- SimpleDateFormat date_format = new SimpleDateFormat("MMM dd yyyy HH:mm:ss");
- results.append("<br/><h2> This report generated on " + date_format.format(calendar.getTime()) + "</h2><br/>");
-
- results.append("<table>");
- addTableHead(results);
-
- int size = testClasses.size();
- int index = 0;
-
- int totalRunTests = 0;
- int totalFailureTests = 0;
- int totalIgnoreTests = 0;
- int numOfFailureClasses = 0;
- for (Class<? extends AttSdcTest> testClass : testClasses) {
-
- index++;
-
- StringBuilder builder = new StringBuilder();
- String str = "***************************************************************************";
- builder.append(str + "\n");
- String current = "class " + index + "/" + size + " failure(" + numOfFailureClasses + ") + RUNS("
- + totalRunTests + ")" + " FAILURES(" + totalFailureTests + ") IGNORED(" + totalIgnoreTests + ")";
- int interval = ((str.length() - current.length() - 2) / 2);
- String substring = str.substring(0, interval);
- builder.append(substring + " " + current + " " + substring + "\n");
- builder.append(str + "\n");
-
- System.out.println(builder.toString());
-
- logger.debug(builder.toString());
- logger.debug("Going to run test class {}", testClass.getName());
-
- result = JUnitCore.runClasses(testClass);
- if (result.wasSuccessful() == false) {
- numOfFailureClasses++;
- }
- logger.debug("Test class {} finished {}",testClass.getName(),(result.wasSuccessful() ? "OK." : " WITH ERROR."));
- List<Failure> failures = result.getFailures();
- if (failures != null) {
- for (Failure failure : failures) {
- logger.error("Test class {} failure test {}-{}",testClass.getName(),failure.getTestHeader(),failure.getTrace());
- }
- }
- int runsPerClass = result.getRunCount();
- int failuresPerClass = result.getFailureCount();
- int ignoredPerClass = result.getIgnoreCount();
-
- totalRunTests += runsPerClass;
- totalFailureTests += failuresPerClass;
- totalIgnoreTests += ignoredPerClass;
-
- logger.debug("class {} Failed tests {} %",testClass.getName(),(failuresPerClass * 1.0) / runsPerClass * 100);
- logger.debug("class {} Ignored tests {} %",testClass.getName(),(ignoredPerClass * 1.0) / runsPerClass * 100);
-
- // List<Failure> failures = result.getFailures();
- // if (failures != null) {
- // for (Failure failure : failures) {
- // System.err.println("9999999999" + failure.getTestHeader());
- // }
- // }
-
- addUnitTestResult(results, testClass, result);
- success &= result.wasSuccessful();
-
- if (numOfFailureClasses > 0) {
- // if (exitOnFailure) {
- if (exitOnFailure) {
- break;
- }
- }
- }
-
- results.append("</table>");
- results.append("<br/><h2> Tests Summary: </h2><br/>");
- results.append("Total Runs : " + totalRunTests + "<br/>");
- results.append("Total Failure : " + totalFailureTests + "<br/>");
- results.append("Total: " + totalFailureTests + "/" + totalRunTests + "<br/>");
- results.append("</html>");
-
- FileUtils.writeToFile(Config.instance().getOutputFolder() + File.separator + Config.instance().getReportName(),
- results.toString());
-
- if (!success) {
- System.out.println("FAILURE");
- logger.error("Failure tests : {} %",((totalFailureTests + totalIgnoreTests) * 1.0) / (totalRunTests + totalIgnoreTests));
- logger.error("Ignored tests : {} %",(totalIgnoreTests * 1.0) / (totalRunTests + totalIgnoreTests));
- System.exit(1);
- }
-
- System.out.println("SUCCESS");
- }
-
- private List<Class> getClassesForPackage(String pkgname) {
-
- List<Class> classes = new ArrayList<Class>();
-
- // Get a File object for the package
- File directory = null;
- String fullPath;
- String relPath = pkgname.replace('.', '/');
-
- // System.out.println("ClassDiscovery: Package: " + pkgname +
- // " becomes Path:" + relPath);
-
- URL resource = ClassLoader.getSystemClassLoader().getResource(relPath);
-
- // System.out.println("ClassDiscovery: Resource = " + resource);
- if (resource == null) {
- throw new RuntimeException("No resource for " + relPath);
- }
- fullPath = resource.getFile();
- // System.out.println("ClassDiscovery: FullPath = " + resource);
-
- if (debug) {
- System.out.println("fullPath is " + fullPath);
- }
-
- try {
- directory = new File(resource.toURI());
- } catch (URISyntaxException e) {
- throw new RuntimeException(
- pkgname + " (" + resource
- + ") does not appear to be a valid URL / URI. Strange, since we got it from the system...",
- e);
- } catch (IllegalArgumentException e) {
- directory = null;
- }
- // System.out.println("ClassDiscovery: Directory = " + directory);
-
- if (directory != null && directory.exists()) {
-
- // Get the list of the files contained in the package
- String[] files = directory.list();
- for (int i = 0; i < files.length; i++) {
-
- // we are only interested in .class files
- if (files[i].endsWith(".class") && false == files[i].contains("$")) {
-
- // removes the .class extension
- String className = pkgname + '.' + files[i].substring(0, files[i].length() - 6);
-
- // System.out.println("ClassDiscovery: className = " +
- // className);
-
- if (debug) {
- System.out.println("ClassDiscovery: className = " + className);
- }
-
- try {
- Class clas = Class.forName(className);
- boolean isAddToRun = false;
- Method[] methods = clas.getMethods();
- for (Method method : methods) {
- Annotation[] anns = method.getAnnotations();
- for (Annotation an : anns) {
- if (an.annotationType().getSimpleName().equalsIgnoreCase("Test")) {
- isAddToRun = true;
- break;
- }
- }
- }
- if (isAddToRun)
- classes.add(clas);
- } catch (ClassNotFoundException e) {
- throw new RuntimeException("ClassNotFoundException loading " + className);
- }
- }
- }
- } else {
- try {
- String jarPath = fullPath.replaceFirst("[.]jar[!].*", ".jar").replaceFirst("file:", "");
-
- if (debug) {
- System.out.println("jarPath is " + jarPath);
- }
-
- JarFile jarFile = new JarFile(jarPath);
- Enumeration<JarEntry> entries = jarFile.entries();
- while (entries.hasMoreElements()) {
- JarEntry entry = entries.nextElement();
- String entryName = entry.getName();
- if (entryName.startsWith(relPath) && entryName.length() > (relPath.length() + "/".length())) {
-
- // System.out.println("ClassDiscovery: JarEntry: " +
- // entryName);
- String className = entryName.replace('/', '.').replace('\\', '.').replace(".class", "");
-
- // System.out.println("ClassDiscovery: className = " +
- // className);
-
- if (false == className.contains("$")) {
-
- if (debug) {
- System.out.println("ClassDiscovery: className = " + className);
- }
-
- try {
- Class clas = Class.forName(className);
- boolean isAddToRun = false;
- Method[] methods = clas.getMethods();
- for (Method method : methods) {
- Annotation[] anns = method.getAnnotations();
- for (Annotation an : anns) {
- if (an.annotationType().getSimpleName().equalsIgnoreCase("Test")) {
- isAddToRun = true;
- break;
- }
- }
- }
- if (isAddToRun)
- classes.add(clas);
- } catch (ClassNotFoundException e) {
- throw new RuntimeException("ClassNotFoundException loading " + className);
- }
- }
- }
- }
- jarFile.close();
-
- } catch (IOException e) {
- throw new RuntimeException(pkgname + " (" + directory + ") does not appear to be a valid package", e);
- }
- }
- return classes;
- }
-
- private void addTableHead(StringBuilder results) {
- results.append("<tr>");
- results.append("<th>").append("Unit Test").append("</th>");
- results.append("<th>").append("Result").append("</th>");
- results.append("</tr>");
- }
-
- private void addUnitTestResult(StringBuilder results, Class<? extends AttSdcTest> testClass,
- Result unitTestResult) {
-
- boolean isSuccess = unitTestResult.wasSuccessful();
-
- String result = (isSuccess) ? "success" : "fail";
- String fileName = FileUtils.getFileName(testClass.getName());
- results.append("<tr>");
- // results.append("<td>").append(FileUtils.getFileName(testClass.getName())).append("</td>");
- results.append("<td class=\"name\">")
- .append("<a href=\"" + fileName + timeOfTest + ".html\">" + fileName + "</a>").append("</td>");
- results.append("<td class=\"" + result + "\">").append(result).append("</td>");
- results.append("</tr>");
- }
-
-}
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
deleted file mode 100644
index f3d48bfeff..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/CrudE2E.java
+++ /dev/null
@@ -1,271 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.sanity;
-
-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.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.*;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-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.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-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());
-
- public Component resourceDetailsVFCcomp_01;
- public Component resourceDetailsVFCsoft_01;
- public Component resourceDetailsCP_01;
- public Component resourceDetailsVL_01;
- public Component resourceDetailsVF_01;
- public Component resourceDetailsVF_02;
-
- public ComponentInstance resourceDetailsVFC1compIns1;
- public ComponentInstance resourceDetailsVFC1softIns1;
- public ComponentInstance resourceDetailsCP1ins_01;
- public ComponentInstance resourceDetailsVL1ins_01;
- public ComponentInstance resourceDetailsVF1ins_01;
- public Component defaultService1;
- private List<String> variablesAsList = new ArrayList<String>();
-
- @Rule
- public static TestName name = new TestName();
-
- public CrudE2E() {
- super(name, CrudE2E.class.getName());
- }
-
- @Test
- public void complexScenario() throws Exception {
-
- User designer = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
-
- //////// create defaultService1 ///////////////////////
-
- Either<Service, RestResponse> createDefaultService1e = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true);
- defaultService1 = createDefaultService1e.left().value();
-
- //////// create VFC1 (resourceDetailsVFCcomp_01) DerivedFrom COMPUTE
- //////// type add all possible informational artifacts and change state
- //////// to CERTIFY////////
- Either<Resource, RestResponse> resourceDetailsVFCcompE = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.COMPUTE, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, UserRoleEnum.DESIGNER,
- true);
- resourceDetailsVFCcomp_01 = resourceDetailsVFCcompE.left().value();
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.CHEF, resourceDetailsVFCcomp_01, UserRoleEnum.DESIGNER, false, true);
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.PUPPET, resourceDetailsVFCcomp_01, UserRoleEnum.DESIGNER, false, true);
- // AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.SHELL_SCRIPT,
- // resourceDetailsVFCcomp_01, UserRoleEnum.DESIGNER, false, true);
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.YANG, resourceDetailsVFCcomp_01, UserRoleEnum.DESIGNER, false, true);
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.YANG_XML, resourceDetailsVFCcomp_01, UserRoleEnum.DESIGNER, false, true);
- // AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT,
- // resourceDetailsVFCcomp_01, UserRoleEnum.DESIGNER, false, true);
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.DG_XML, resourceDetailsVFCcomp_01, UserRoleEnum.DESIGNER, false, true);
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.MURANO_PKG, resourceDetailsVFCcomp_01, UserRoleEnum.DESIGNER, false, true);
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.OTHER, resourceDetailsVFCcomp_01, UserRoleEnum.DESIGNER, false, true);
- AtomicOperationUtils.changeComponentState(resourceDetailsVFCcomp_01, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
-
- //////// create VFC2 (resourceDetailsVFCsoft_01) DerivedFrom SOFTWARE
- //////// type and change state to CERTIFY////////
- Either<Resource, RestResponse> resourceDetailsVFCsoftE = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.SOFTWARE_COMPONENT, ResourceCategoryEnum.GENERIC_DATABASE, UserRoleEnum.DESIGNER,
- true);
- resourceDetailsVFCsoft_01 = resourceDetailsVFCsoftE.left().value();
- AtomicOperationUtils.changeComponentState(resourceDetailsVFCsoft_01, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
-
- //////// create CP1 (resourceDetailsVFCsoft_01) DerivedFrom PORT type
- //////// and change state to CHECKIN////////
- Either<Resource, RestResponse> resourceDetailsCP_01e = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.CP, NormativeTypesEnum.PORT, ResourceCategoryEnum.GENERIC_DATABASE, UserRoleEnum.DESIGNER, true);
- resourceDetailsCP_01 = resourceDetailsCP_01e.left().value();
- AtomicOperationUtils.changeComponentState(resourceDetailsCP_01, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
-
- //////// create VL1 (resourceDetailsVFCsoft_01) DerivedFrom NETWORK type
- //////// and change state to CERTIFY////////
- Either<Resource, RestResponse> resourceDetailsVL_01e = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VL, NormativeTypesEnum.NETWORK, ResourceCategoryEnum.GENERIC_NETWORK_ELEMENTS, UserRoleEnum.DESIGNER,
- true);
- resourceDetailsVL_01 = resourceDetailsVL_01e.left().value();
- AtomicOperationUtils.changeComponentState(resourceDetailsVL_01, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
-
- //////// create VF1 (resourceDetailsVFCcomp_01) DerivedFrom COMPUTE type
- //////// add all possible deployment and informational artifacts
- //////// //////////
- Either<Resource, RestResponse> resourceDetailsVF_01e = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, UserRoleEnum.DESIGNER, true);
- resourceDetailsVF_01 = resourceDetailsVF_01e.left().value();
- ArtifactDefinition heatArtifact = AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT, resourceDetailsVF_01, UserRoleEnum.DESIGNER, true, true).left().value();
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT_VOL, resourceDetailsVF_01, UserRoleEnum.DESIGNER, true, true);
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT_NET, resourceDetailsVF_01, UserRoleEnum.DESIGNER, true, true);
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.OTHER, resourceDetailsVF_01, UserRoleEnum.DESIGNER, true, true);
-
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.CHEF, resourceDetailsVF_01, UserRoleEnum.DESIGNER, false, true);
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.PUPPET, resourceDetailsVF_01, UserRoleEnum.DESIGNER, false, true);
- // AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.SHELL_SCRIPT,
- // resourceDetailsVF_01, UserRoleEnum.DESIGNER, false, true);
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.YANG, resourceDetailsVF_01, UserRoleEnum.DESIGNER, false, true);
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.YANG_XML, resourceDetailsVF_01, UserRoleEnum.DESIGNER, false, true);
- // AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.HEAT,
- // resourceDetailsVF_01, UserRoleEnum.DESIGNER, false, true);
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.DG_XML, resourceDetailsVF_01, UserRoleEnum.DESIGNER, false, true);
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.MURANO_PKG, resourceDetailsVF_01, UserRoleEnum.DESIGNER, false, true);
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.OTHER, resourceDetailsVF_01, UserRoleEnum.DESIGNER, false, true);
-
- //////// Add VFC1 VFC2 CP and VL to VF container /////////////
- resourceDetailsVFC1compIns1 = AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceDetailsVFCcomp_01, resourceDetailsVF_01, UserRoleEnum.DESIGNER, true).left().value();
- resourceDetailsVFC1softIns1 = AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceDetailsVFCsoft_01, resourceDetailsVF_01, UserRoleEnum.DESIGNER, true).left().value();
- resourceDetailsCP1ins_01 = AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceDetailsCP_01, resourceDetailsVF_01, UserRoleEnum.DESIGNER, true).left().value();
- resourceDetailsVL1ins_01 = AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceDetailsVL_01, resourceDetailsVF_01, UserRoleEnum.DESIGNER, true).left().value();
-
- //////// associate cp-vl vl-vfcComp and vfcComp-vfcSoft////////
- resourceDetailsVF_01 = AtomicOperationUtils.getResourceObject(resourceDetailsVF_01, UserRoleEnum.DESIGNER);
- AtomicOperationUtils.associate2ResourceInstances(resourceDetailsVF_01, resourceDetailsCP1ins_01, resourceDetailsVL1ins_01, AssocType.LINKABLE.getAssocType(), UserRoleEnum.DESIGNER, true);
- AtomicOperationUtils.associate2ResourceInstances(resourceDetailsVF_01, resourceDetailsCP1ins_01, resourceDetailsVFC1compIns1, AssocType.BINDABLE.getAssocType(), UserRoleEnum.DESIGNER, true);
- AtomicOperationUtils.associate2ResourceInstances(resourceDetailsVF_01, resourceDetailsVFC1compIns1, resourceDetailsVFC1softIns1, AssocType.NODE.getAssocType(), UserRoleEnum.DESIGNER, true);
-
- //////// download all VF1 artifacts////////
-
- Collection<ArtifactDefinition> artifacts = resourceDetailsVF_01.getDeploymentArtifacts().values();
- List<String> collect = artifacts.stream().filter(p -> p.checkEsIdExist() == true).map(p -> p.getUniqueId()).collect(Collectors.toList());
- artifacts.stream().filter(p -> p.checkEsIdExist() == true).map(p -> p.getUniqueId()).forEach(item -> log.debug(item));
-
- //////// get all VF1 artifacts////////
-
- Collection<List<ComponentInstanceProperty>> componentInstancesProperties = resourceDetailsVF_01.getComponentInstancesProperties().values();
- List<String> collect2 = componentInstancesProperties.stream().filter(p -> p.isEmpty() == false).flatMap(l -> l.stream()).collect(Collectors.toList()).stream().map(p -> p.getUniqueId()).collect(Collectors.toList());
- // PropertyRestUtils.updateProperty(resourceDetailsVF_01.getUniqueId(),
- // propertyId, "1", designer);
- // .forEach((someOtherString) -> {
- // System.out.println("Content With Java: " + someOtherString);
- // });
- // componentInstancesProperties.stream().filter(p ->
- // p.isEmpty()==false).flatMap(l -> l.stream()).map(e ->
- // e.getUniqueId());
- // resourceDetailsVF_01.getComponentInstancesProperties().
-
- // ArtifactDefinition artifactDefinition =
- // resourceDetailsVF_01.getDeploymentArtifacts().get(ArtifactTypeEnum.HEAT.getType().toLowerCase()).getEsId();
- // ArtifactDefinition artifactDefinition =
- // resource.getDeploymentArtifacts().get(depResArtType);
- // ArtifactReqDetails artifacJavaObject =
- // ResponseParser.convertArtifactDefinitionToArtifactReqDetailsObject(artifactDefinition);
- // ArtifactRestUtils.updateDeploymentArtifactToRI(artifactDetails,
- // sdncModifierDetails, resourceInstanceId, serviceId)
-
- //////// certify VF1 - failed due to uncertified CP instance ////////
-
- /*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());*/
-
- //////// certify resources CP1 ////////
- resourceDetailsCP_01 = AtomicOperationUtils.changeComponentState(resourceDetailsCP_01, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- //////// replace VF1 instances with new certified instances (CP1
- //////// replaced) ////////
- Either<Pair<Component, ComponentInstance>, RestResponse> changeComponentInstanceVersion = AtomicOperationUtils.changeComponentInstanceVersion(resourceDetailsVF_01, resourceDetailsCP1ins_01, resourceDetailsCP_01, UserRoleEnum.DESIGNER, true);
- resourceDetailsVF_01 = changeComponentInstanceVersion.left().value().getLeft();
- resourceDetailsCP1ins_01 = changeComponentInstanceVersion.left().value().getRight();
-
- //////// associate cp-vl and cp-vfc1,////////
- AtomicOperationUtils.associate2ResourceInstances(resourceDetailsVF_01, resourceDetailsCP1ins_01, resourceDetailsVL1ins_01, AssocType.LINKABLE.getAssocType(), UserRoleEnum.DESIGNER, true);
- AtomicOperationUtils.associate2ResourceInstances(resourceDetailsVF_01, resourceDetailsCP1ins_01, resourceDetailsVFC1compIns1, AssocType.BINDABLE.getAssocType(), UserRoleEnum.DESIGNER, true);
-
- /////// change VF1 state to CHECK-IN and add it as instance to service1
- /////// container
- resourceDetailsVF_01 = AtomicOperationUtils.changeComponentState(resourceDetailsVF_01, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- resourceDetailsVF1ins_01 = AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceDetailsVF_01, defaultService1, UserRoleEnum.DESIGNER, true).left().value();
-
- //////// distribute service1 - failed due to incorrect LifeCyclestatus
- //////// ////////
- RestResponse distributeService = AtomicOperationUtils.distributeService(defaultService1, false);
- Assert.assertEquals(distributeService, null, "verification failed");
-
- //////// certify service1 - failed due to uncertified instances ////////
- designer = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- /*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();
-
- //////// replace VF1 instances with new certified instances ////////
- changeComponentInstanceVersion = AtomicOperationUtils.changeComponentInstanceVersion(defaultService1, resourceDetailsVF1ins_01, resourceDetailsVF_01, UserRoleEnum.DESIGNER, true);
- resourceDetailsVF_01 = changeComponentInstanceVersion.left().value().getLeft();
- resourceDetailsVFC1compIns1 = changeComponentInstanceVersion.left().value().getRight();
-
- /////// certify service1 ////////
- defaultService1 = AtomicOperationUtils.changeComponentState(defaultService1, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- //////// distribute service1 - successfully ////////
- AtomicOperationUtils.distributeService(defaultService1, true);
-
- /////// create VF2 ////////
-
- Either<Resource, RestResponse> resourceDetailsVF_02e = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, UserRoleEnum.DESIGNER, true);
- resourceDetailsVF_02 = resourceDetailsVF_02e.left().value();
-
- }
-
- // private void updateArtParameterInResource(Resource resource) throws
- // IOException {
- //
- // ArtifactRestUtils.uploadArtifact(artifactDetails, component,
- // sdncModifierDetails)
- //
- // for (String depResArtType : Utils.getListOfDepResArtLabels(true)) {
- // ArtifactDefinition artifactDefinition =
- // resource.getDeploymentArtifacts().get(depResArtType);
- // ArtifactReqDetails artifacJavaObject =
- // ResponseParser.convertArtifactDefinitionToArtifactReqDetailsObject(artifactDefinition);
- //
- // //update parameter
- // List<HeatParameterDefinition> resourceHeatParameters =
- // resource.getDeploymentArtifacts().get(depResArtType).getHeatParameters();
- // for (HeatParameterDefinition heatParameterDefinition :
- // resourceHeatParameters){
- // if (heatParameterDefinition.getName().equals("address")){
- // heatParameterDefinition.setCurrentValue("negev");
- // break;
- // }
- // }
- // artifacJavaObject.setHeatParameters(resourceHeatParameters);
- // artifacJavaObject.setPayloadData(null);
- // RestResponse updateInformationalArtifactToResource =
- // ArtifactRestUtils.updateDeploymentArtifactToResource(artifacJavaObject,
- // sdncDesignerDetails, resource.getUniqueId());
- // assertTrue("response code is not 200, returned: " +
- // updateInformationalArtifactToResource.getErrorCode(),updateInformationalArtifactToResource.getErrorCode()
- // == 200);
- // }
- // }
-
-}
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
deleted file mode 100644
index e6e96ccba8..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/MultipleResourceUpdate.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.sanity;
-
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-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.*;
-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.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
- public static TestName name = new TestName();
-
- public MultipleResourceUpdate() {
- super(name, MultipleResourceUpdate.class.getName());
- }
-
- @Test
- public void simpleScenario() throws Exception {
-
- // Creating VF and Resource instances
- Resource vf = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left()
- .value();
- Resource cp1 = AtomicOperationUtils
- .createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.CP, NormativeTypesEnum.PORT,
- ResourceCategoryEnum.NETWORK_CONNECTIVITY_CON_POINT, UserRoleEnum.DESIGNER, true)
- .left().value();
- Resource cp2 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.CP, UserRoleEnum.DESIGNER, true)
- .left().value();
- Resource vl = AtomicOperationUtils
- .createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VL, NormativeTypesEnum.NETWORK,
- ResourceCategoryEnum.NETWORK_CONNECTIVITY_VIRTUAL_LINK, UserRoleEnum.DESIGNER, true)
- .left().value();
-
- vf.getCreatorUserId();
-
- // Check In Resources
- AtomicOperationUtils.changeComponentState(cp1, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
- AtomicOperationUtils.changeComponentState(cp2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
- AtomicOperationUtils.changeComponentState(vl, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
-
- // CheckIn all other except VF
- ComponentInstance instanceCP1 = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(cp1, vf, UserRoleEnum.DESIGNER, true).left().value();
- ComponentInstance instanceVL = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(vl, vf, UserRoleEnum.DESIGNER, true).left().value();
- ComponentInstance instanceCP2 = AtomicOperationUtils
- .addComponentInstanceToComponentContainer(cp2, vf, UserRoleEnum.DESIGNER, true).left().value();
-
- vf = (Resource) AtomicOperationUtils.getComponentObject(vf, UserRoleEnum.DESIGNER);
-
- // Create Vertex(Link/Associate 2 Resource Instances on Canvas)
- AtomicOperationUtils.associate2ResourceInstances(vf, instanceCP1, instanceVL, AssocType.LINKABLE.getAssocType(),
- UserRoleEnum.DESIGNER, true);
-
- List<ComponentInstanceReqDetails> componentInstanceReqDetailsList = new ArrayList<>();
- componentInstanceReqDetailsList.add(new ComponentInstanceReqDetails(instanceCP1));
- componentInstanceReqDetailsList.add(new ComponentInstanceReqDetails(instanceCP2));
- componentInstanceReqDetailsList.add(new ComponentInstanceReqDetails(instanceVL));
-
- ComponentInstanceReqDetails compInstDet = componentInstanceReqDetailsList.get(0);
- compInstDet.setPosX("150");
- compInstDet.setPosY("150");
- compInstDet = componentInstanceReqDetailsList.get(1);
- compInstDet.setPosX("400");
- compInstDet.setPosY("150");
- compInstDet = componentInstanceReqDetailsList.get(2);
- compInstDet.setPosX("150");
- compInstDet.setPosY("300");
-
- RestResponse response = ComponentInstanceRestUtils.updateMultipleComponentInstance(
- componentInstanceReqDetailsList, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), vf.getUniqueId(),
- vf.getComponentType());
- assertTrue("response code is not 200, returned: " + response.getErrorCode(),
- response.getErrorCode() == ProductRestUtils.STATUS_CODE_SUCCESS);
-
- compInstDet = componentInstanceReqDetailsList.get(0);
- compInstDet.setPosX("350");
- compInstDet.setPosY("350");
- compInstDet = componentInstanceReqDetailsList.get(1);
- compInstDet.setPosX("600");
- compInstDet.setPosY("350");
- compInstDet = componentInstanceReqDetailsList.get(2);
- compInstDet.setPosX("350");
- compInstDet.setPosY("500");
-
- response = ComponentInstanceRestUtils.updateMultipleComponentInstance(componentInstanceReqDetailsList,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), vf.getUniqueId(), vf.getComponentType());
- assertTrue("response code is not 200, returned: " + response.getErrorCode(),
- response.getErrorCode() == ProductRestUtils.STATUS_CODE_SUCCESS);
- }
-}
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
deleted file mode 100644
index 45a5c1c227..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/Onboard.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-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.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.ComponentInstance;
-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.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.api.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.data.providers.OnboardingDataProviders;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
-import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-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.*;
-
-public class Onboard extends ComponentBaseTest {
-
- private String makeDistributionValue;
- private String makeToscaValidationValue;
- @Rule
- public static final TestName name = new TestName();
-
- public Onboard() {
- super(name, Onboard.class.getName());
- }
-
-
-
- @Parameters({ "makeDistribution" })
- @BeforeMethod
- public void beforeTestReadParams(@Optional("true") String makeDistributionReadValue) {
- makeDistributionValue = makeDistributionReadValue;
- logger.info("makeDistributionReadValue - > " + makeDistributionValue);
- }
-
- @Parameters({ "makeToscaValidation" })
- @BeforeClass
- public void makeToscaValidation(@Optional("false") String makeToscaValidationReadValue) {
- makeToscaValidationValue = makeToscaValidationReadValue;
- logger.info("makeToscaValidationReadValue - > " + makeToscaValidationValue);
- }
-
-
- @Test(dataProviderClass = OnboardingDataProviders.class, dataProvider = "VNF_List")
- public void onboardVNFShotFlow(String filePath, String vnfFile) throws Exception {
- setLog(vnfFile);
- runOnboardToDistributionFlow(filePath, vnfFile, ResourceTypeEnum.VF);
- }
-
- @Test(dataProviderClass = OnboardingDataProviders.class, dataProvider = "PNF_List")
- public void onboardPNFFlow(String filePath, String pnfFile) throws Exception {
- setLog(pnfFile);
- runOnboardToDistributionFlow(filePath, pnfFile, ResourceTypeEnum.PNF);
- }
-
- @Test
- public void passTest() {
- System.out.println("print - >" + "test Passed");
- }
-
- private void runOnboardToDistributionFlow(String packageFilePath, String packageFileName, ResourceTypeEnum resourceTypeEnum) throws Exception {
- ExtentTestActions.log(Status.INFO, String.format("Going to onboard the %s %s", resourceTypeEnum.getValue(), packageFileName));
- User user = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- resourceReqDetails.setResourceType(resourceTypeEnum.getValue());
- VendorSoftwareProductObject vendorSoftwareProductObject = OnboardingUtillViaApis.createVspViaApis(resourceReqDetails, packageFilePath, packageFileName, user);
-
- // create VF base on VNF imported from previous step - have, resourceReqDetails object include part of resource metadata
- OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
- resourceReqDetails.setResourceType(resourceTypeEnum.getValue());
- ExtentTestActions.log(Status.INFO, String.format("Create %s %s From VSP", resourceTypeEnum.getValue(), resourceReqDetails.getName()));
- Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails, UserRoleEnum.DESIGNER);
- ExtentTestActions.log(Status.INFO, String.format("Certify %s", resourceTypeEnum.getValue()));
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- //--------------------------SERVICE--------------------------------
- ServiceReqDetails serviceReqDetails = OnboardingUtillViaApis.prepareServiceDetailsBeforeCreate(user);
- ExtentTestActions.log(Status.INFO, String.format("Create Service %s", serviceReqDetails.getName()));
- Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
- ExtentTestActions.log(Status.INFO, String.format("Add %s to Service", resourceTypeEnum.getValue()));
- Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
- addComponentInstanceToComponentContainer.left().value();
- ExtentTestActions.log(Status.INFO,"Certify Service");
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- if (makeDistributionValue.equals("true")) {
- ExtentTestActions.log(Status.INFO, "Distribute Service");
- AtomicOperationUtils.distributeService(service, true);
- }
-
- if (makeToscaValidationValue.equals("true")) {
- ExtentTestActions.log(Status.INFO, "Start tosca validation");
- AtomicOperationUtils.toscaValidation(service ,packageFileName);
- }
-
- ExtentTestActions.log(Status.INFO, String.format("The onboarding process for '%s' finished with success", packageFileName));
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/servicefilter/ServiceFilterTests.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/servicefilter/ServiceFilterTests.java
deleted file mode 100644
index 054648708a..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/servicefilter/ServiceFilterTests.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.servicefilter;
-
-import java.util.Collections;
-
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.PropertyReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceFilterDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.PropertyRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.openecomp.sdc.ci.tests.utils.rest.ServiceFilterUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
-import org.testng.Assert;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Test;
-
-public class ServiceFilterTests extends ComponentBaseTest {
- @Rule
- public static TestName name = new TestName();
-
- private static ServiceReqDetails externalService;
- private static ComponentInstanceReqDetails componentInstanceReqDetails;
- private static User user = null;
-
- public ServiceFilterTests() {
- super(name, ServiceFilterTests.class.getName());
- }
-
- @BeforeTest
- public void init() throws Exception {
- user = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
-
- ServiceReqDetails internalService;
- //Create External Service
- externalService = ElementFactory.getDefaultService();
- externalService.setName("ExternalService" + Math.random());
- ServiceRestUtils.createService(externalService, user);
-
- //Create Internal Service
- internalService = ElementFactory.getDefaultService();
- internalService.setName("InternalService" + Math.random());
- ServiceRestUtils.createService(internalService, user);
-
- //Add property services
- //#PropertyOne
- PropertyReqDetails propertyReqDetails = ElementFactory.getDefaultStringProperty();
- propertyReqDetails.setName("StringProp1");
- String body = propertyReqDetails.propertyToJsonString();
- PropertyRestUtils.createServiceProperty(externalService.getUniqueId(), body, user);
- PropertyRestUtils.createServiceProperty(internalService.getUniqueId(), body, user);
- //#PropertyTwo
- propertyReqDetails.setName("StringProp2");
- body = propertyReqDetails.propertyToJsonString();
- RestResponse response = PropertyRestUtils.createServiceProperty(externalService.getUniqueId(), body, user);
- response = PropertyRestUtils.createServiceProperty(internalService.getUniqueId(), body, user);
-
- //CheckIn internal Service
- response = LifecycleRestUtils.changeServiceState(internalService, user, "0.1",
- LifeCycleStatesEnum.CHECKIN,
- "{\"userRemarks\":\"CheckIn\"}");
- BaseRestUtils.checkSuccess(response);
- if (response.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS) {
- internalService.setUniqueId(ResponseParser.getUniqueIdFromResponse(response));
- }
- //Make internal service as component instance
- componentInstanceReqDetails =
- ElementFactory.getDefaultComponentInstance(internalService.getUniqueId(), "ServiceProxy");
- response = ComponentInstanceRestUtils.createComponentInstance(componentInstanceReqDetails,
- user, externalService.getUniqueId(), ComponentTypeEnum.SERVICE);
- BaseRestUtils.checkCreateResponse(response);
- if (response.getErrorCode() == BaseRestUtils.STATUS_CODE_CREATED) {
- componentInstanceReqDetails.setUniqueId(ResponseParser.getUniqueIdFromResponse(response));
- componentInstanceReqDetails.setName(ResponseParser.getNameFromResponse(response));
- }
- //Mark as dependent
- componentInstanceReqDetails.setDirectives(Collections.singletonList("selectable"));
- response = ComponentInstanceRestUtils.updateComponentInstance(componentInstanceReqDetails,
- user, externalService.getUniqueId(), ComponentTypeEnum.SERVICE);
- BaseRestUtils.checkSuccess(response);
- }
-
- @Test
- public void createServiceFilter() throws Exception {
- //Add Service Filter
- ServiceFilterDetails serviceFilterDetails = ElementFactory.getDefaultEqualOperatorFilter("StringProp1", "value");
- RestResponse restResponse = ServiceFilterUtils.createServiceFilter(externalService.getUniqueId(),
- componentInstanceReqDetails.getUniqueId(), serviceFilterDetails, user);
- logger.info("CreateServiceFilter Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- @Test(dependsOnMethods = "createServiceFilter")
- public void updateServiceFilter() throws Exception {
- //Update Service Filter
- ServiceFilterDetails serviceFilterDetails =
- ElementFactory.getDefaultEqualOperatorFilter("StringProp1", "updated");
- RestResponse restResponse = ServiceFilterUtils.updateServiceFilter(externalService.getUniqueId(),
- componentInstanceReqDetails.getUniqueId(), Collections.singletonList(serviceFilterDetails), user);
- logger.info("UpdateServiceFilter Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- // @Test(dependsOnMethods = "updateServiceFilter")
- public void deleteServiceFilter() throws Exception {
- //Delete Service Filter
- RestResponse restResponse = ServiceFilterUtils.deleteServiceFilter(externalService.getUniqueId(),
- componentInstanceReqDetails.getUniqueId(), 0, user);
- logger.info("DeleteServiceFilter Response Code:" + restResponse.getErrorCode());
- Assert.assertEquals((int) restResponse.getErrorCode(), BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ParametersDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ParametersDefinition.java
deleted file mode 100644
index dbdaff3d0f..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ParametersDefinition.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.tosca.datatypes;
-
-public class ParametersDefinition {
-
- private String type;
- private String description;
- private Object Default;
- private String status;
-// private List<Constraints> constraints;
- private String entry_schema;
- private Object value;
-
- public ParametersDefinition() {
- super();
- }
-
- public ParametersDefinition(String type, String description, Object default1, String status, String entry_schema, Object value) {
- super();
- this.type = type;
- this.description = description;
- Default = default1;
- this.status = status;
- this.entry_schema = entry_schema;
- this.value = value;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public Object getDefault() {
- return Default;
- }
-
- public void setDefault(Object default1) {
- Default = default1;
- }
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
- public String getEntry_schema() {
- return entry_schema;
- }
-
- public void setEntry_schema(String entry_schema) {
- this.entry_schema = entry_schema;
- }
-
- public Object getValue() {
- return value;
- }
-
- public void setValue(Object value) {
- this.value = value;
- }
-
- @Override
- public String toString() {
- return "ParametersDefinition [type=" + type + ", description=" + description + ", Default=" + Default + ", status=" + status + ", entry_schema=" + entry_schema + ", value=" + value + "]";
- }
-
-
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaAnnotationsTypesDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaAnnotationsTypesDefinition.java
deleted file mode 100644
index 968e8dc783..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaAnnotationsTypesDefinition.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.tosca.datatypes;
-
-import org.openecomp.sdc.ci.tests.datatypes.enums.ToscaKeysEnum;
-import org.yaml.snakeyaml.TypeDescription;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class ToscaAnnotationsTypesDefinition extends ToscaTypesDefinition {
-
- public static final String SOURCE_ANNOTATION = "org.openecomp.annotations.Source";
-
- private Map<String, ToscaTypeDefinition> annotation_types = new HashMap<>();
-
- public Map<String, ToscaTypeDefinition> getAnnotation_types() {
- return annotation_types;
- }
-
- public void setAnnotation_types(Map<String, ToscaTypeDefinition> annotation_types) {
- this.annotation_types = annotation_types;
- }
-
- public static TypeDescription getTypeDescription(){
- TypeDescription typeDescription = new TypeDescription(ToscaAnnotationsTypesDefinition.class);
- typeDescription.putListPropertyType(ToscaKeysEnum.IMPORTS.getToscaKey(), String.class);
- typeDescription.putMapPropertyType(ToscaKeysEnum.ANNOTATION_TYPES.getToscaKey(), String.class, ToscaTypeDefinition.class);
- return typeDescription;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaCapabilitiesNodeTemplatesDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaCapabilitiesNodeTemplatesDefinition.java
deleted file mode 100644
index 76c0c86680..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaCapabilitiesNodeTemplatesDefinition.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.tosca.datatypes;
-
-public class ToscaCapabilitiesNodeTemplatesDefinition {
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaDefinition.java
deleted file mode 100644
index 5bbb71b853..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaDefinition.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.tosca.datatypes;
-
-import org.yaml.snakeyaml.TypeDescription;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class ToscaDefinition {
-
- String tosca_definitions_version;
- Map<String, String> metadata = new HashMap<>();
- List<Map<String, ToscaImportsDefinition>> imports = new ArrayList<>();
- Map<String, ToscaNodeTypesDefinition> node_types = new HashMap<>();
- ToscaTopologyTemplateDefinition topology_template = new ToscaTopologyTemplateDefinition();
-
- public ToscaDefinition() {
- super();
- }
-
- public ToscaDefinition(String tosca_definitions_version, Map<String, String> metadata, List<Map<String, ToscaImportsDefinition>> imports, Map<String, ToscaNodeTypesDefinition> node_types,
- ToscaTopologyTemplateDefinition topology_template) {
- super();
- this.tosca_definitions_version = tosca_definitions_version;
- this.metadata = metadata;
- this.imports = imports;
- this.node_types = node_types;
- this.topology_template = topology_template;
- }
-
- public ToscaDefinition(ToscaDefinition toscaDefinition){
- this.tosca_definitions_version = toscaDefinition.tosca_definitions_version;
- this.metadata = new HashMap<>(toscaDefinition.metadata);
- this.imports = new ArrayList<>(toscaDefinition.imports);
- this.node_types = new HashMap<>(toscaDefinition.node_types);
- this.topology_template = new ToscaTopologyTemplateDefinition(toscaDefinition.topology_template);
- }
-
- public List<Map<String, ToscaImportsDefinition>> getImports() {
- return imports;
- }
-
- public void setImports(List<Map<String, ToscaImportsDefinition>> imports) {
- this.imports = imports;
- }
-
- public Map<String, String> getMetadata() {
- return metadata;
- }
-
- public void setMetadata(Map<String, String> metadata) {
- this.metadata = metadata;
- }
-
- public String getTosca_definitions_version() {
- return tosca_definitions_version;
- }
-
- public void setTosca_definitions_version(String tosca_definitions_version) {
- this.tosca_definitions_version = tosca_definitions_version;
- }
-
-
- public Map<String, ToscaNodeTypesDefinition> getNode_types() {
- return node_types;
- }
-
- public void setNode_types(Map<String, ToscaNodeTypesDefinition> node_types) {
- this.node_types = node_types;
- }
-
- public ToscaTopologyTemplateDefinition getTopology_template() {
- return topology_template;
- }
-
- public void setTopology_template(ToscaTopologyTemplateDefinition topology_template) {
- this.topology_template = topology_template;
- }
-
-
-
- //gets Type description for Yaml snake
- public static TypeDescription getTypeDescription(){
- TypeDescription typeDescription = new TypeDescription(ToscaDefinition.class);
- typeDescription.putMapPropertyType("metadata", String.class, String.class);
- typeDescription.putListPropertyType("imports", Map.class);
- typeDescription.putMapPropertyType("node_types", String.class, ToscaNodeTypesDefinition.class);
- return typeDescription;
- }
-
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaGroupPropertyDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaGroupPropertyDefinition.java
deleted file mode 100644
index adab3fa5f8..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaGroupPropertyDefinition.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.tosca.datatypes;
-
-import org.yaml.snakeyaml.TypeDescription;
-
-public class ToscaGroupPropertyDefinition {
-
- public String min_vf_module_instances;
- public String max_vf_module_instances;
- public String vf_module_label;
- public String vfc_list;
- public String vf_module_type;
- public String vf_module_description;
- public String initial_count;
- public String volume_group;
- public String availability_zone_count;
-
- public ToscaGroupPropertyDefinition() {
- }
-
- public String getMin_vf_module_instances() {
- return min_vf_module_instances;
- }
-
- public void setMin_vf_module_instances(String min_vf_module_instances) {
- this.min_vf_module_instances = min_vf_module_instances;
- }
-
- public String getMax_vf_module_instances() {
- return max_vf_module_instances;
- }
-
- public void setMax_vf_module_instances(String max_vf_module_instances) {
- this.max_vf_module_instances = max_vf_module_instances;
- }
-
- public String getVf_module_label() {
- return vf_module_label;
- }
-
- public void setVf_module_label(String vf_module_label) {
- this.vf_module_label = vf_module_label;
- }
-
- public String getVfc_list() {
- return vfc_list;
- }
-
- public void setVfc_list(String vfc_list) {
- this.vfc_list = vfc_list;
- }
-
- public String getVf_module_type() {
- return vf_module_type;
- }
-
- public void setVf_module_type(String vf_module_type) {
- this.vf_module_type = vf_module_type;
- }
-
- public String getVf_module_description() {
- return vf_module_description;
- }
-
- public void setVf_module_description(String vf_module_description) {
- this.vf_module_description = vf_module_description;
- }
-
- public String getInitial_count() {
- return initial_count;
- }
-
- public void setInitial_count(String initial_count) {
- this.initial_count = initial_count;
- }
-
- public String getVolume_group() {
- return volume_group;
- }
-
- public void setVolume_group(String volume_group) {
- this.volume_group = volume_group;
- }
-
- public String getAvailability_zone_count() {
- return availability_zone_count;
- }
-
- public void setAvailability_zone_count(String availability_zone_count) {
- this.availability_zone_count = availability_zone_count;
- }
-
- @Override
- public String toString() {
- return "ToscaGroupPropertyDefinition{" +
- ", min_vf_module_instances='" + min_vf_module_instances + '\'' +
- ", max_vf_module_instances='" + max_vf_module_instances + '\'' +
- ", vf_module_label='" + vf_module_label + '\'' +
- ", vfc_list='" + vfc_list + '\'' +
- ", vf_module_type='" + vf_module_type + '\'' +
- ", vf_module_description='" + vf_module_description + '\'' +
- ", initial_count='" + initial_count + '\'' +
- ", volume_group='" + volume_group + '\'' +
- ", availability_zone_count='" + availability_zone_count + '\'' +
- '}';
- }
-
- //gets Type description for Yaml snake
- public static TypeDescription getTypeDescription(){
- TypeDescription typeDescription = new TypeDescription(ToscaGroupPropertyDefinition.class);
- return typeDescription;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- ToscaGroupPropertyDefinition that = (ToscaGroupPropertyDefinition) o;
-
- if (min_vf_module_instances != null ? !min_vf_module_instances.equals(that.min_vf_module_instances) : that.min_vf_module_instances != null)
- return false;
- if (max_vf_module_instances != null ? !max_vf_module_instances.equals(that.max_vf_module_instances) : that.max_vf_module_instances != null)
- return false;
- if (vf_module_label != null ? !vf_module_label.equals(that.vf_module_label) : that.vf_module_label != null)
- return false;
- if (vfc_list != null ? !vfc_list.equals(that.vfc_list) : that.vfc_list != null) return false;
- if (vf_module_type != null ? !vf_module_type.equals(that.vf_module_type) : that.vf_module_type != null)
- return false;
- if (vf_module_description != null ? !vf_module_description.equals(that.vf_module_description) : that.vf_module_description != null)
- return false;
- if (initial_count != null ? !initial_count.equals(that.initial_count) : that.initial_count != null)
- return false;
- if (volume_group != null ? !volume_group.equals(that.volume_group) : that.volume_group != null) return false;
- return availability_zone_count != null ? availability_zone_count.equals(that.availability_zone_count) : that.availability_zone_count == null;
- }
-
- @Override
- public int hashCode() {
- int result = min_vf_module_instances != null ? min_vf_module_instances.hashCode() : 0;
- result = 31 * result + (max_vf_module_instances != null ? max_vf_module_instances.hashCode() : 0);
- result = 31 * result + (vf_module_label != null ? vf_module_label.hashCode() : 0);
- result = 31 * result + (vfc_list != null ? vfc_list.hashCode() : 0);
- result = 31 * result + (vf_module_type != null ? vf_module_type.hashCode() : 0);
- result = 31 * result + (vf_module_description != null ? vf_module_description.hashCode() : 0);
- result = 31 * result + (initial_count != null ? initial_count.hashCode() : 0);
- result = 31 * result + (volume_group != null ? volume_group.hashCode() : 0);
- result = 31 * result + (availability_zone_count != null ? availability_zone_count.hashCode() : 0);
- return result;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaGroupsTopologyTemplateDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaGroupsTopologyTemplateDefinition.java
deleted file mode 100644
index a536578e09..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaGroupsTopologyTemplateDefinition.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.tosca.datatypes;
-
-import org.yaml.snakeyaml.TypeDescription;
-
-import java.io.Serializable;
-import java.util.List;
-import java.util.Map;
-
-// spec page 102
-
-public class ToscaGroupsTopologyTemplateDefinition extends ToscaServiceGroupsMetadataDefinition implements Serializable {
-
- public static final long serialVersionUID = -6373752349967949120L;
- public String type; // required
- public String description;
- // private Map<String, String> properties;
- public ToscaGroupPropertyDefinition properties;
- public Map<String, String> targets; // required
- public Map<String, Object> interfaces;
- public List<String> members;
- // private Map<String, String> metadata;
-// private ToscaServiceGroupsMetadataDefinition metadata;
-
- public ToscaGroupsTopologyTemplateDefinition() {
- super();
- }
-
-// public ToscaServiceGroupsMetadataDefinition getMetadata() {
-// return metadata;
-// }
-//
- public void setMetadata(ToscaServiceGroupsMetadataDefinition metadata) {
- this.vfModuleModelCustomizationUUID = metadata.vfModuleModelCustomizationUUID;
- this.vfModuleModelInvariantUUID = metadata.vfModuleModelInvariantUUID;
- this.vfModuleModelName = metadata.vfModuleModelName;
- this.vfModuleModelUUID = metadata.vfModuleModelUUID;
- this.vfModuleModelVersion = metadata.vfModuleModelVersion;
- }
-
-
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
-// public Map<String, String> getProperties() {
-// return properties;
-// }
-//
-// public void setProperties(Map<String, String> properties) {
-// this.properties = properties;
-// }
-
- public ToscaGroupPropertyDefinition getProperties() {
- return properties;
- }
-
- public void setProperties(ToscaGroupPropertyDefinition properties) {
- this.properties = properties;
- }
-
- public Map<String, String> getTargets() {
- return targets;
- }
-
- public void setTargets(Map<String, String> targets) {
- this.targets = targets;
- }
-
- public Map<String, Object> getInterfaces() {
- return interfaces;
- }
-
- public void setInterfaces(Map<String, Object> interfaces) {
- this.interfaces = interfaces;
- }
-
- public List<String> getMembers() {
- return members;
- }
-
- public void setMembers(List<String> members) {
- this.members = members;
- }
-
-// public Map<String, String> getMetadata() {
-// return metadata;
-// }
-//
-// public void setMetadata(Map<String, String> metadata) {
-// this.metadata = metadata;
-// }
-
-// @Override
-// public String toString() {
-// return "ToscaGroupsTopologyTemplateDefinition [type=" + type + ", description=" + description + ", properties=" + properties + ", targets=" + targets + ", interfaces=" + interfaces + ", members=" + members + ", metadata=" + metadata
-// + "]";
-// }
-
-
- @Override
- public String toString() {
- return "ToscaGroupsTopologyTemplateDefinition{" +
- "type='" + type + '\'' +
- ", description='" + description + '\'' +
- ", properties=" + properties +
- ", targets=" + targets +
- ", interfaces=" + interfaces +
- ", members=" + members +
- '}';
- }
-
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof ToscaGroupsTopologyTemplateDefinition)) return false;
- if (!super.equals(o)) return false;
-
- ToscaGroupsTopologyTemplateDefinition that = (ToscaGroupsTopologyTemplateDefinition) o;
-
-// if (type != null ? !type.equals(that.type) : that.type != null) return false;
-// if (description != null ? !description.equals(that.description) : that.description != null) return false;
-// if (properties != null ? !properties.equals(that.properties) : that.properties != null) return false;
-// if (targets != null ? !targets.equals(that.targets) : that.targets != null) return false;
-// if (interfaces != null ? !interfaces.equals(that.interfaces) : that.interfaces != null) return false;
-// return members != null ? members.equals(that.members) : that.members == null;
-
- return (properties != null ? properties.equals(that.properties) : false);
- }
-
- //gets Type description for Yaml snake
- public static TypeDescription getTypeDescription(){
- TypeDescription typeDescription = new TypeDescription(ToscaGroupsTopologyTemplateDefinition.class);
-// typeDescription.putMapPropertyType("properties", String.class, Object.class);
-// typeDescription.putListPropertyType("properties", ToscaGroupPropertyDefinition.class);
- typeDescription.putMapPropertyType("interfaces", String.class, Object.class);
- typeDescription.putMapPropertyType("targets", String.class, Object.class);
-// typeDescription.putMapPropertyType("metadata", String.class, String.class);
- typeDescription.putMapPropertyType("metadata", String.class, String.class);
- typeDescription.putListPropertyType("members", String.class);
- return typeDescription;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaImportsDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaImportsDefinition.java
deleted file mode 100644
index c4324bd987..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaImportsDefinition.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.tosca.datatypes;
-
-import org.yaml.snakeyaml.TypeDescription;
-
-public class ToscaImportsDefinition {
-
- private String name;
- private String file;
- private String repository;
- private String namespace_uri;
- private String namespace_prefix;
-
- public ToscaImportsDefinition() {
- super();
- }
-
- public ToscaImportsDefinition(String name, String file, String repository, String namespace_uri, String namespace_prefix) {
- super();
- this.name = name;
- this.file = file;
- this.repository = repository;
- this.namespace_uri = namespace_uri;
- this.namespace_prefix = namespace_prefix;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getFile() {
- return file;
- }
-
- public void setFile(String file) {
- this.file = file;
- }
-
- public String getRepository() {
- return repository;
- }
-
- public void setRepository(String repository) {
- this.repository = repository;
- }
-
- public String getNamespace_uri() {
- return namespace_uri;
- }
-
- public void setNamespace_uri(String namespace_uri) {
- this.namespace_uri = namespace_uri;
- }
-
- public String getNamespace_prefix() {
- return namespace_prefix;
- }
-
- public void setNamespace_prefix(String namespace_prefix) {
- this.namespace_prefix = namespace_prefix;
- }
-
- //gets Type description for Yaml snake
- public static TypeDescription getTypeDescription(){
- TypeDescription typeDescription = new TypeDescription(ToscaImportsDefinition.class);
- return typeDescription;
- }
-
-
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaInputsAnnotation.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaInputsAnnotation.java
deleted file mode 100644
index 4242e483b2..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaInputsAnnotation.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.tosca.datatypes;
-
-import org.yaml.snakeyaml.TypeDescription;
-
-import java.util.Map;
-import java.util.Objects;
-
-public class ToscaInputsAnnotation {
-
- String name;
- String type;
- private Map<String, Object> properties;
-
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public String getType() {
- return type;
- }
- public void setType(String type) {
- this.type = type;
- }
- public Map<String, Object> getProperties() {
- return properties;
- }
- public void setProperties(Map<String, Object> properties) {
- this.properties = properties;
- }
-
-
- //gets Type description for Yaml snake
- public static TypeDescription getTypeDescription(){
- return new TypeDescription(ToscaInputsAnnotation.class);
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- ToscaInputsAnnotation that = (ToscaInputsAnnotation) o;
- return Objects.equals(type, that.type);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(type);
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaInputsTopologyTemplateDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaInputsTopologyTemplateDefinition.java
deleted file mode 100644
index 3f0bac06d4..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaInputsTopologyTemplateDefinition.java
+++ /dev/null
@@ -1,270 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.tosca.datatypes;
-
-import com.google.gson.annotations.SerializedName;
-import org.yaml.snakeyaml.TypeDescription;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-public class ToscaInputsTopologyTemplateDefinition {
-
- public String name;
- public String type;
- public String description;
- public Boolean required;
- public Boolean hidden;
- public Boolean immutable;
- @SerializedName("default")
- public Object Default;
-
- public String status;
- public List<Object> constraints = new ArrayList<>();
- public Map<String, Object> entry_schema;
- public Object value;
- public Map<String, ToscaInputsAnnotation> annotations;
-
- public ToscaInputsTopologyTemplateDefinition(String name, String type, String description, Boolean required, Object default1, String status, List<Object> constraints, Map<String, Object> entry_schema, Object value, Boolean immutable, Boolean hidden, Map<String, ToscaInputsAnnotation> annotations) {
- super();
- this.name = name;
- this.type = type;
- this.description = description;
- this.required = required;
- Default = default1;
- this.status = status;
- this.constraints = constraints;
- this.entry_schema = entry_schema;
- this.value = value;
- this.immutable = immutable;
- this.hidden = hidden;
- this.annotations = annotations;
- }
-
- public ToscaInputsTopologyTemplateDefinition() {
- }
- public ToscaInputsTopologyTemplateDefinition(ToscaInputsTopologyTemplateDefinition definition){
-// this(definition.getName(), definition.getType(), definition.getDescription(), definition.getRequired(), definition.getDefault(), definition.getStatus(), definition.getConstraints(), definition.getEntry_schema(), definition.getValue());
- this.name = definition.name;
- this.type = definition.type;
- this.description = definition.description;
- this.required = definition.required;
- this.Default = definition.Default;
- this.status = definition.status;
- this.constraints = definition.constraints;
- this.entry_schema = definition.entry_schema;
- this.value = definition.value;
- this.immutable = immutable;
- this.hidden = hidden;
- }
-
- public Boolean getHidden() {
- return hidden;
- }
-
- public void setHidden(Boolean hidden) {
- this.hidden = hidden;
- }
-
- public Boolean getImmutable() {
- return immutable;
- }
-
- public void setImmutable(Boolean immutable) {
- this.immutable = immutable;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public Boolean getRequired() {
- return required;
- }
-
- public void setRequired(Boolean required) {
- this.required = required;
- }
-
- public Object getDefault() {
- return Default;
- }
-
- public void setDefault(Object default1) {
- Default = default1;
- }
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
- public List<Object> getConstraints() {
- return constraints;
- }
-
- public void setConstraints(List<Object> constraints) {
- this.constraints = constraints;
- }
-
- public Map<String, Object> getEntry_schema() {
- return entry_schema;
- }
-
- public void setEntry_schema(Map<String, Object> entry_schema) {
- this.entry_schema = entry_schema;
- }
-
- public Object getValue() {
- return value;
- }
-
- public void setValue(Object value) {
- this.value = value;
- }
-
- public Map<String, ToscaInputsAnnotation> getAnnotations() {
- return annotations;
- }
-
- public void setAnnotations(Map<String, ToscaInputsAnnotation> annotations) {
- this.annotations = annotations;
- }
-
- //gets Type description for Yaml snake
- public static TypeDescription getTypeDescription(){
- TypeDescription typeDescription = new TypeDescription(ToscaInputsTopologyTemplateDefinition.class);
- typeDescription.putListPropertyType("constraints", Object.class);
- typeDescription.putMapPropertyType("entry_schema", String.class, Object.class);
- typeDescription.putMapPropertyType("annotations", String.class, ToscaInputsAnnotation.class);
- return typeDescription;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((Default == null) ? 0 : Default.hashCode());
- result = prime * result + ((constraints == null) ? 0 : constraints.hashCode());
- result = prime * result + ((description == null) ? 0 : description.hashCode());
- result = prime * result + ((entry_schema == null) ? 0 : entry_schema.hashCode());
- result = prime * result + ((hidden == null) ? 0 : hidden.hashCode());
- result = prime * result + ((immutable == null) ? 0 : immutable.hashCode());
- result = prime * result + ((name == null) ? 0 : name.hashCode());
- result = prime * result + ((required == null) ? 0 : required.hashCode());
- result = prime * result + ((status == null) ? 0 : status.hashCode());
- result = prime * result + ((type == null) ? 0 : type.hashCode());
- result = prime * result + ((value == null) ? 0 : value.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- ToscaInputsTopologyTemplateDefinition other = (ToscaInputsTopologyTemplateDefinition) obj;
- if (Default == null) {
- if (other.Default != null)
- return false;
- } else if (!Default.equals(other.Default))
- return false;
- if (constraints == null) {
- if (other.constraints != null)
- return false;
- } else if (!constraints.equals(other.constraints))
- return false;
- if (description == null) {
- if (other.description != null)
- return false;
- } else if (!description.equals(other.description))
- return false;
- if (entry_schema == null) {
- if (other.entry_schema != null)
- return false;
- } else if (!entry_schema.equals(other.entry_schema))
- return false;
- if (hidden == null) {
- if (other.hidden != null)
- return false;
- } else if (!hidden.equals(other.hidden))
- return false;
- if (immutable == null) {
- if (other.immutable != null)
- return false;
- } else if (!immutable.equals(other.immutable))
- return false;
- if (name == null) {
- if (other.name != null)
- return false;
- } else if (!name.equals(other.name))
- return false;
- if (required == null) {
- if (other.required != null)
- return false;
- } else if (!required.equals(other.required))
- return false;
- if (status == null) {
- if (other.status != null)
- return false;
- } else if (!status.equals(other.status))
- return false;
- if (type == null) {
- if (other.type != null)
- return false;
- } else if (!type.equals(other.type))
- return false;
- if (value == null) {
- if (other.value != null)
- return false;
- } else if (!value.equals(other.value))
- return false;
- return true;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaMetadataDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaMetadataDefinition.java
deleted file mode 100644
index ceba7adbe4..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaMetadataDefinition.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.tosca.datatypes;
-
-import org.yaml.snakeyaml.TypeDescription;
-
-public class ToscaMetadataDefinition {
-
- private String invariantUUID;
- private String UUID;
- private String name;
- private String description;
- private String type;
- private String category;
- private String subcategory;
- private String resourceVendor;
- private String resourceVendorRelease;
- private String resourceVendorModelNumber;
- private String serviceType;
- private String serviceRole;
- private String serviceEcompNaming;
- private String ecompGeneratedNaming;
- private String namingPolicy;
-
- public ToscaMetadataDefinition(String invariantUUID, String uUID, String name, String description, String type, String category, String subcategory, String resourceVendor, String resourceVendorRelease, String resourceVendorModelNumber,
- String serviceType, String serviceRole, String serviceEcompNaming, String ecompGeneratedNaming, String namingPolicy) {
- super();
- this.invariantUUID = invariantUUID;
- UUID = uUID;
- this.name = name;
- this.description = description;
- this.type = type;
- this.category = category;
- this.subcategory = subcategory;
- this.resourceVendor = resourceVendor;
- this.resourceVendorRelease = resourceVendorRelease;
- this.resourceVendorModelNumber = resourceVendorModelNumber;
- this.serviceType = serviceType;
- this.serviceRole = serviceRole;
- this.serviceEcompNaming = serviceEcompNaming;
- this.ecompGeneratedNaming = ecompGeneratedNaming;
- this.namingPolicy = namingPolicy;
- }
-
- public String getInvariantUUID() {
- return invariantUUID;
- }
-
- public void setInvariantUUID(String invariantUUID) {
- this.invariantUUID = invariantUUID;
- }
-
- public String getUUID() {
- return UUID;
- }
-
- public void setUUID(String uUID) {
- UUID = uUID;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getCategory() {
- return category;
- }
-
- public void setCategory(String category) {
- this.category = category;
- }
-
- public String getSubcategory() {
- return subcategory;
- }
-
- public void setSubcategory(String subcategory) {
- this.subcategory = subcategory;
- }
-
- public String getResourceVendor() {
- return resourceVendor;
- }
-
- public void setResourceVendor(String resourceVendor) {
- this.resourceVendor = resourceVendor;
- }
-
- public String getResourceVendorRelease() {
- return resourceVendorRelease;
- }
-
- public void setResourceVendorRelease(String resourceVendorRelease) {
- this.resourceVendorRelease = resourceVendorRelease;
- }
-
- public String getResourceVendorModelNumber() {
- return resourceVendorModelNumber;
- }
-
- public void setResourceVendorModelNumber(String resourceVendorModelNumber) {
- this.resourceVendorModelNumber = resourceVendorModelNumber;
- }
-
- public String getServiceType() {
- return serviceType;
- }
-
- public void setServiceType(String serviceType) {
- this.serviceType = serviceType;
- }
-
- public String getServiceRole() {
- return serviceRole;
- }
-
- public void setServiceRole(String serviceRole) {
- this.serviceRole = serviceRole;
- }
-
- public String getServiceEcompNaming() {
- return serviceEcompNaming;
- }
-
- public void setServiceEcompNaming(String serviceEcompNaming) {
- this.serviceEcompNaming = serviceEcompNaming;
- }
-
- public String getEcompGeneratedNaming() {
- return ecompGeneratedNaming;
- }
-
- public void setEcompGeneratedNaming(String ecompGeneratedNaming) {
- this.ecompGeneratedNaming = ecompGeneratedNaming;
- }
-
- public String getNamingPolicy() {
- return namingPolicy;
- }
-
- public void setNamingPolicy(String namingPolicy) {
- this.namingPolicy = namingPolicy;
- }
-
- @Override
- public String toString() {
- return "ToscaMetadataDefinition [invariantUUID=" + invariantUUID + ", UUID=" + UUID + ", name=" + name + ", description=" + description + ", type=" + type + ", category=" + category + ", subcategory=" + subcategory
- + ", resourceVendor=" + resourceVendor + ", resourceVendorRelease=" + resourceVendorRelease + ", resourceVendorModelNumber=" + resourceVendorModelNumber + ", serviceType=" + serviceType + ", serviceRole=" + serviceRole
- + ", serviceEcompNaming=" + serviceEcompNaming + ", ecompGeneratedNaming=" + ecompGeneratedNaming + ", namingPolicy=" + namingPolicy + "]";
- }
-
- //gets Type description for Yaml snake
- public static TypeDescription getTypeDescription(){
- TypeDescription typeDescription = new TypeDescription(ToscaMetadataDefinition.class);
- return typeDescription;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaNodeTemplatesTopologyTemplateDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaNodeTemplatesTopologyTemplateDefinition.java
deleted file mode 100644
index 442656ebf6..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaNodeTemplatesTopologyTemplateDefinition.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.tosca.datatypes;
-
-import org.yaml.snakeyaml.TypeDescription;
-
-import java.util.List;
-import java.util.Map;
-
-public class ToscaNodeTemplatesTopologyTemplateDefinition {
-
- private String name;
- private String type;
- private String description;
- private String [] directives;
- private Map<String, Object> properties;
- private Map<String, Object> attributes;
- private List<Map<String, Object>> requirements;
- private Object capabilities;
-// private List<Map<String, Object>> capabilities;
-// private Map<String, ToscaPropertiesNodeTemplatesDefinition> properties;
-// private Map<String, ToscaRequirementsNodeTemplatesDefinition> requirements;
-// private Map<String, ToscaCapabilitiesNodeTemplatesDefinition> capabilities;
- private Map<String, Object> interfaces;
- private Map<String, Object> artifacts;
- private Map<String, Object> node_filter;
- private String copy;
- private Map<String, String> metadata;
-
-
- public ToscaNodeTemplatesTopologyTemplateDefinition() {
- super();
- }
-
- public Object getCapabilities() {
- return capabilities;
- }
-
- public void setCapabilities(Object capabilities) {
- this.capabilities = capabilities;
- }
-
- public Map<String, String> getMetadata() {
- return metadata;
- }
-
- public void setMetadata(Map<String, String> metadata) {
- this.metadata = metadata;
- }
-
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public String[] getDirectives() {
- return directives;
- }
-
- public void setDirectives(String[] directives) {
- this.directives = directives;
- }
-
-
- public Map<String, Object> getProperties() {
- return properties;
- }
-
- public void setProperties(Map<String, Object> properties) {
- this.properties = properties;
- }
-
- public Map<String, Object> getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Map<String, Object> attributes) {
- this.attributes = attributes;
- }
-
- public List<Map<String, Object>> getRequirements() {
- return requirements;
- }
-
- public void setRequirements(List<Map<String, Object>> requirements) {
- this.requirements = requirements;
- }
-
- public Map<String, Object> getInterfaces() {
- return interfaces;
- }
-
- public void setInterfaces(Map<String, Object> interfaces) {
- this.interfaces = interfaces;
- }
-
- public Map<String, Object> getArtifacts() {
- return artifacts;
- }
-
- public void setArtifacts(Map<String, Object> artifacts) {
- this.artifacts = artifacts;
- }
-
- public Map<String, Object> getNode_filter() {
- return node_filter;
- }
-
- public void setNode_filter(Map<String, Object> node_filter) {
- this.node_filter = node_filter;
- }
-
- public String getCopy() {
- return copy;
- }
-
- public void setCopy(String copy) {
- this.copy = copy;
- }
-
- //gets Type description for Yaml snake
- public static TypeDescription getTypeDescription(){
- TypeDescription typeDescription = new TypeDescription(ToscaNodeTemplatesTopologyTemplateDefinition.class);
- typeDescription.putMapPropertyType("properties", String.class, Object.class);
- typeDescription.putListPropertyType("requirements", Map.class);
-// typeDescription.putMapPropertyType("capabilities",String.class, Object.class);
-// typeDescription.putListPropertyType("capabilities", Object.class);
- typeDescription.putMapPropertyType("attributes", String.class, Object.class);
- typeDescription.putMapPropertyType("interfaces", String.class, Object.class);
- typeDescription.putMapPropertyType("artifacts", String.class, Object.class);
- typeDescription.putMapPropertyType("node_filter", String.class, Object.class);
- typeDescription.putMapPropertyType("metadata", String.class, String.class);
- return typeDescription;
- }
-
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaNodeTypesDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaNodeTypesDefinition.java
deleted file mode 100644
index b9d200a252..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaNodeTypesDefinition.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.tosca.datatypes;
-
-import java.util.HashMap;
-import java.util.Map;
-
-// spec page 88
-public class ToscaNodeTypesDefinition {
-
- private String name;
- private String derived_from;
- private String version;
- private String description;
- private Map<String, Object> properties = new HashMap<>();
- private Map<String, Object> attributes = new HashMap<>();
- private Map<String, Object> requirements = new HashMap<>();
- private Map<String, Object> capabilities = new HashMap<>();
- private Map<String, Object> interfaces = new HashMap<>();
- private Map<String, Object> artifacts = new HashMap<>();
-
- public ToscaNodeTypesDefinition() {
- super();
- }
-
- public ToscaNodeTypesDefinition(String name, String derived_from, String version, String description, Map<String, Object> properties, Map<String, Object> attributes, Map<String, Object> requirements, Map<String, Object> capabilities,
- Map<String, Object> interfaces, Map<String, Object> artifacts) {
- super();
- this.name = name;
- this.derived_from = derived_from;
- this.version = version;
- this.description = description;
- this.properties = properties;
- this.attributes = attributes;
- this.requirements = requirements;
- this.capabilities = capabilities;
- this.interfaces = interfaces;
- this.artifacts = artifacts;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getDerived_from() {
- return derived_from;
- }
-
- public void setDerived_from(String derived_from) {
- this.derived_from = derived_from;
- }
-
- public String getVersion() {
- return version;
- }
-
- public void setVersion(String version) {
- this.version = version;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public Map<String, Object> getProperties() {
- return properties;
- }
-
- public void setProperties(Map<String, Object> properties) {
- this.properties = properties;
- }
-
- public Map<String, Object> getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Map<String, Object> attributes) {
- this.attributes = attributes;
- }
-
- public Map<String, Object> getRequirements() {
- return requirements;
- }
-
- public void setRequirements(Map<String, Object> requirements) {
- this.requirements = requirements;
- }
-
- public Map<String, Object> getCapabilities() {
- return capabilities;
- }
-
- public void setCapabilities(Map<String, Object> capabilities) {
- this.capabilities = capabilities;
- }
-
- public Map<String, Object> getInterfaces() {
- return interfaces;
- }
-
- public void setInterfaces(Map<String, Object> interfaces) {
- this.interfaces = interfaces;
- }
-
- public Map<String, Object> getArtifacts() {
- return artifacts;
- }
-
- public void setArtifacts(Map<String, Object> artifacts) {
- this.artifacts = artifacts;
- }
-
-
-
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaOutputsTopologyTemplateDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaOutputsTopologyTemplateDefinition.java
deleted file mode 100644
index b370dd3b6d..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaOutputsTopologyTemplateDefinition.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.tosca.datatypes;
-
-import java.util.Map;
-
-public class ToscaOutputsTopologyTemplateDefinition {
-
- private Map<String, Object> outputs;
-
- public ToscaOutputsTopologyTemplateDefinition() {
- super();
- }
-
- public Map<String, Object> getOutputs() {
- return outputs;
- }
-
- public void setOutputs(Map<String, Object> outputs) {
- this.outputs = outputs;
- }
-
- @Override
- public String toString() {
- return "ToscaOutputsTopologyTemplateDefinition [outputs=" + outputs + "]";
- }
-
-
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaParameterConstants.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaParameterConstants.java
deleted file mode 100644
index 32ccbe3000..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaParameterConstants.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.tosca.datatypes;
-
-public interface ToscaParameterConstants {
-
- String TOSCA_DEFINITION_PATH = "Definitions";
- String ENTRY_DEFINITION = "Entry-Definitions";
- String TOSCA_META_PATH = "TOSCA-Metadata/TOSCA.meta";
- String HEAT_META_PATH = "Artifacts/HEAT.meta";
- String IMPORT_STRUCTURE = "importStructure";
- String NODE_TYPES = "node_types";
- String PROPERTIES = "properties";
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaPoliciesTopologyTemplateDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaPoliciesTopologyTemplateDefinition.java
deleted file mode 100644
index 7ac3e876b4..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaPoliciesTopologyTemplateDefinition.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.tosca.datatypes;
-
-import java.util.Map;
-
-public class ToscaPoliciesTopologyTemplateDefinition {
-
- public ToscaPoliciesTopologyTemplateDefinition() {
- super();
- }
-
- private String type; // required
- private String description;
- private Map<String, Object> properties;
- private Map<String, String> targets;
- public String getType() {
- return type;
- }
- public void setType(String type) {
- this.type = type;
- }
- public String getDescription() {
- return description;
- }
- public void setDescription(String description) {
- this.description = description;
- }
- public Map<String, Object> getProperties() {
- return properties;
- }
- public void setProperties(Map<String, Object> properties) {
- this.properties = properties;
- }
- public Map<String, String> getTargets() {
- return targets;
- }
- public void setTargets(Map<String, String> targets) {
- this.targets = targets;
- }
- @Override
- public String toString() {
- return "ToscaPoliciesTopologyTemplateDefinition [type=" + type + ", description=" + description + ", properties=" + properties + ", targets=" + targets + "]";
- }
-
-
-
-}
-
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaRelationshipTemplatesTopologyTemplateDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaRelationshipTemplatesTopologyTemplateDefinition.java
deleted file mode 100644
index 881f7f587e..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaRelationshipTemplatesTopologyTemplateDefinition.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.tosca.datatypes;
-
-import java.util.Map;
-
-public class ToscaRelationshipTemplatesTopologyTemplateDefinition {
-
- public ToscaRelationshipTemplatesTopologyTemplateDefinition() {
- }
-
- private String type;
- private String description;
- private Map<String, Object> properties;
- private Map<String, Object> attributes;
- private Map<String, Object> interfaces;
- private String copy;
- public String getType() {
- return type;
- }
- public void setType(String type) {
- this.type = type;
- }
- public String getDescription() {
- return description;
- }
- public void setDescription(String description) {
- this.description = description;
- }
- public Map<String, Object> getProperties() {
- return properties;
- }
- public void setProperties(Map<String, Object> properties) {
- this.properties = properties;
- }
- public Map<String, Object> getAttributes() {
- return attributes;
- }
- public void setAttributes(Map<String, Object> attributes) {
- this.attributes = attributes;
- }
- public Map<String, Object> getInterfaces() {
- return interfaces;
- }
- public void setInterfaces(Map<String, Object> interfaces) {
- this.interfaces = interfaces;
- }
- public String getCopy() {
- return copy;
- }
- public void setCopy(String copy) {
- this.copy = copy;
- }
- @Override
- public String toString() {
- return "ToscaRelationshipTemplatesTopologyTemplateDefinition [type=" + type + ", description=" + description + ", properties=" + properties + ", attributes=" + attributes + ", interfaces=" + interfaces + ", copy=" + copy + "]";
- }
-
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaRequirementsNodeTemplatesDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaRequirementsNodeTemplatesDefinition.java
deleted file mode 100644
index bd9f0f0f5e..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaRequirementsNodeTemplatesDefinition.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.tosca.datatypes;
-
-public class ToscaRequirementsNodeTemplatesDefinition {
-
- String name;
- String capability;
- String node;
- String relationship;
-
- public ToscaRequirementsNodeTemplatesDefinition() {
- super();
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getCapability() {
- return capability;
- }
-
- public void setCapability(String capability) {
- this.capability = capability;
- }
-
- public String getNode() {
- return node;
- }
-
- public void setNode(String node) {
- this.node = node;
- }
-
- public String getRelationship() {
- return relationship;
- }
-
- public void setRelationship(String relationship) {
- this.relationship = relationship;
- }
-
- @Override
- public String toString() {
- return "ToscaRequirementsDefinition [name=" + name + ", capability=" + capability + ", node=" + node
- + ", relationship=" + relationship + "]";
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaServiceGroupsMetadataDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaServiceGroupsMetadataDefinition.java
deleted file mode 100644
index 5b50b0e854..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaServiceGroupsMetadataDefinition.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.tosca.datatypes;
-
-import java.io.Serializable;
-
-public class ToscaServiceGroupsMetadataDefinition implements Serializable {
-
- public static final long serialVersionUID = -6373756459974949120L;
-
- public String vfModuleModelName;
- public String vfModuleModelInvariantUUID;
- public String vfModuleModelCustomizationUUID;
- public String vfModuleModelUUID;
- public String vfModuleModelVersion;
-
- public ToscaServiceGroupsMetadataDefinition() {
- super();
- }
-
- public String getVfModuleModelName() {
- return vfModuleModelName;
- }
-
- public void setVfModuleModelName(String vfModuleModelName) {
- this.vfModuleModelName = vfModuleModelName;
- }
-
- public String getVfModuleModelInvariantUUID() {
- return vfModuleModelInvariantUUID;
- }
-
- public void setVfModuleModelInvariantUUID(String vfModuleModelInvariantUUID) {
- this.vfModuleModelInvariantUUID = vfModuleModelInvariantUUID;
- }
-
- public String getVfModuleModelCustomizationUUID() {
- return vfModuleModelCustomizationUUID;
- }
-
- public void setVfModuleModelCustomizationUUID(String vfModuleModelCustomizationUUID) {
- this.vfModuleModelCustomizationUUID = vfModuleModelCustomizationUUID;
- }
-
- public String getVfModuleModelUUID() {
- return vfModuleModelUUID;
- }
-
- public void setVfModuleModelUUID(String vfModuleModelUUID) {
- this.vfModuleModelUUID = vfModuleModelUUID;
- }
-
- public String getVfModuleModelVersion() {
- return vfModuleModelVersion;
- }
-
- public void setVfModuleModelVersion(String vfModuleModelVersion) {
- this.vfModuleModelVersion = vfModuleModelVersion;
- }
-
- @Override
- public String toString() {
- return "ToscaGroupsMetadataDefinition [vfModuleModelName=" + vfModuleModelName + ", vfModuleModelInvariantUUID=" + vfModuleModelInvariantUUID + ", vfModuleModelCustomizationUUID=" + vfModuleModelCustomizationUUID
- + ", vfModuleModelUUID=" + vfModuleModelUUID + ", vfModuleModelVersion=" + vfModuleModelVersion + "]";
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof ToscaServiceGroupsMetadataDefinition)) return false;
-
- ToscaServiceGroupsMetadataDefinition that = (ToscaServiceGroupsMetadataDefinition) o;
-
- if (vfModuleModelName != null ? !vfModuleModelName.equals(that.vfModuleModelName) : that.vfModuleModelName != null)
- return false;
- if (!vfModuleModelInvariantUUID.equals(that.vfModuleModelInvariantUUID)) return false;
- if (vfModuleModelCustomizationUUID != null ? !vfModuleModelCustomizationUUID.equals(that.vfModuleModelCustomizationUUID) : that.vfModuleModelCustomizationUUID != null)
- return false;
- if (vfModuleModelUUID != null ? !vfModuleModelUUID.equals(that.vfModuleModelUUID) : that.vfModuleModelUUID != null)
- return false;
- return vfModuleModelVersion != null ? vfModuleModelVersion.equals(that.vfModuleModelVersion) : that.vfModuleModelVersion == null;
- }
-
- @Override
- public int hashCode() {
- return vfModuleModelInvariantUUID.hashCode();
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaSubstitutionMappingsDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaSubstitutionMappingsDefinition.java
deleted file mode 100644
index d3bb2a03d0..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaSubstitutionMappingsDefinition.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.tosca.datatypes;
-
-import org.yaml.snakeyaml.TypeDescription;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class ToscaSubstitutionMappingsDefinition {
-
- private String node_type;
- private Map<String, Object> requirements = new HashMap<>();
- private Map<String, Object> capabilities = new HashMap<>();
-
- public ToscaSubstitutionMappingsDefinition() {
- super();
- }
-
- public String getNode_type() {
- return node_type;
- }
-
- public void setNode_type(String node_type) {
- this.node_type = node_type;
- }
-
- public Map<String, Object> getRequirements() {
- return requirements;
- }
-
- public void setRequirements(Map<String, Object> requirements) {
- this.requirements = requirements;
- }
-
- public Map<String, Object> getCapabilities() {
- return capabilities;
- }
-
- public void setCapabilities(Map<String, Object> capabilities) {
- this.capabilities = capabilities;
- }
-
-// gets Type description for Yaml snake
- public static TypeDescription getTypeDescription(){
- TypeDescription typeDescription = new TypeDescription(ToscaSubstitutionMappingsDefinition.class);
- typeDescription.putMapPropertyType("requirements", String.class, Object.class);
- typeDescription.putMapPropertyType("capabilities", String.class, Object.class);
- return typeDescription;
- }
-
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaTopologyTemplateDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaTopologyTemplateDefinition.java
deleted file mode 100644
index 9b2996044a..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaTopologyTemplateDefinition.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.tosca.datatypes;
-
-import org.yaml.snakeyaml.TypeDescription;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-// spec page 104
-public class ToscaTopologyTemplateDefinition {
-
- String description;
-// Map<String, Map<String, ToscaInputsDefinition>> inputs;
- Map<String,ToscaNodeTemplatesTopologyTemplateDefinition> node_templates = new HashMap<>();
-// Map<String,ToscaRelationshipTemplatesTopologyTemplateDefinition> relationship_templates;
- Map<String,ToscaGroupsTopologyTemplateDefinition> groups = new HashMap<>();
- Map<String, ToscaInputsTopologyTemplateDefinition> inputs = new HashMap<>();
-// Map<String,ToscaPoliciesTopologyTemplateDefinition> policies;
-// Map<String,ToscaOutputsTopologyTemplateDefinition> outputs;
- ToscaSubstitutionMappingsDefinition substitution_mappings;
-
- public ToscaTopologyTemplateDefinition() {
- super();
- }
-
- public ToscaTopologyTemplateDefinition(ToscaTopologyTemplateDefinition definition) {
- this.description = definition.description;
- this.node_templates = new HashMap<>(definition.node_templates);
- this.groups = new HashMap<String,ToscaGroupsTopologyTemplateDefinition>(definition.groups);
- this.inputs = definition.inputs.entrySet().stream().collect(Collectors.toMap(e -> e.getKey(), e -> new ToscaInputsTopologyTemplateDefinition(e.getValue())));
- this.substitution_mappings = definition.substitution_mappings;
- }
-
- public ToscaTopologyTemplateDefinition(String description, Map<String, ToscaNodeTemplatesTopologyTemplateDefinition> node_templates, Map<String, ToscaGroupsTopologyTemplateDefinition> groups,
- Map<String, ToscaInputsTopologyTemplateDefinition> inputs, ToscaSubstitutionMappingsDefinition substitution_mappings) {
- super();
- this.description = description;
- this.node_templates = node_templates;
- this.groups = groups;
- this.inputs = inputs;
- this.substitution_mappings = substitution_mappings;
-}
-
- public Map<String, ToscaInputsTopologyTemplateDefinition> getInputs() {
- return inputs;
- }
-
- public void setInputs(Map<String, ToscaInputsTopologyTemplateDefinition> inputs) {
- this.inputs = inputs;
- }
-
- public void addInputs(Map<String, ToscaInputsTopologyTemplateDefinition> inputs) {
- this.inputs.putAll(inputs);
- }
-
- public ToscaSubstitutionMappingsDefinition getSubstitution_mappings() {
- return substitution_mappings;
- }
- public void setSubstitution_mappings(ToscaSubstitutionMappingsDefinition substitution_mappings) {
- this.substitution_mappings = substitution_mappings;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
-
- public Map<String, ToscaNodeTemplatesTopologyTemplateDefinition> getNode_templates() {
- return node_templates;
- }
-
- public void setNode_templates(Map<String, ToscaNodeTemplatesTopologyTemplateDefinition> node_templates) {
- this.node_templates = node_templates;
- }
-
- public Map<String, ToscaGroupsTopologyTemplateDefinition> getGroups() {
- return groups;
- }
-
- public void setGroups(Map<String, ToscaGroupsTopologyTemplateDefinition> groups) {
- this.groups = groups;
- }
-
-
- //gets Type description for Yaml snake
- public static TypeDescription getTypeDescription(){
- TypeDescription typeDescription = new TypeDescription(ToscaTopologyTemplateDefinition.class);
- typeDescription.putMapPropertyType("inputs", String.class, ToscaInputsTopologyTemplateDefinition.class);
- typeDescription.putMapPropertyType("node_templates", String.class, ToscaNodeTemplatesTopologyTemplateDefinition.class);
- typeDescription.putMapPropertyType("groups", String.class, ToscaGroupsTopologyTemplateDefinition.class);
- return typeDescription;
- }
-
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaTopologyTemplateDefinition2.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaTopologyTemplateDefinition2.java
deleted file mode 100644
index 5c750c9670..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaTopologyTemplateDefinition2.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.tosca.datatypes;
-
-import java.util.Map;
-
-// spec page 104
-public class ToscaTopologyTemplateDefinition2 {
-
- String description;
- Map<String,Map<String, Object>> inputs;
- Map<String,Object> node_templates;
-// Map<String,ToscaRelationshipTemplatesTopologyTemplateDefinition> relationship_templates;
- Map<String,Object> groups;
-// Map<String,ToscaPoliciesTopologyTemplateDefinition> policies;
-// Map<String,ToscaOutputsTopologyTemplateDefinition> outputs;
-// Map<String,ToscaSubstitutionMappingsDefinition> substitution_mappings;
-
- public ToscaTopologyTemplateDefinition2() {
- super();
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
-
- public Map<String, Map<String, Object>> getInputs() {
- return inputs;
- }
-
- public void setInputs(Map<String, Map<String, Object>> inputs) {
- this.inputs = inputs;
- }
-
- public Map<String, Object> getNode_templates() {
- return node_templates;
- }
-
- public void setNode_templates(Map<String, Object> node_templates) {
- this.node_templates = node_templates;
- }
-
- public Map<String, Object> getGroups() {
- return groups;
- }
-
- public void setGroups(Map<String, Object> groups) {
- this.groups = groups;
- }
-
-
-
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaTypeDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaTypeDefinition.java
deleted file mode 100644
index 66d8350e94..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaTypeDefinition.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.tosca.datatypes;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class ToscaTypeDefinition {
-
- private String description;
- private Map<String, Object> properties = new HashMap<>();
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public Map<String, Object> getProperties() {
- return properties;
- }
-
- public void setProperties(Map<String, Object> properties) {
- this.properties = properties;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaTypesDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaTypesDefinition.java
deleted file mode 100644
index 16292a83f5..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaTypesDefinition.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.tosca.datatypes;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class ToscaTypesDefinition {
-
- private String tosca_definitions_version;
- private List<String> imports = new ArrayList<>();
-
- public String getTosca_definitions_version() {
- return tosca_definitions_version;
- }
-
- public void setTosca_definitions_version(String tosca_definitions_version) {
- this.tosca_definitions_version = tosca_definitions_version;
- }
-
- public List<String> getImports() {
- return imports;
- }
-
- public void setImports(List<String> imports) {
- this.imports = imports;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/VfModuleDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/VfModuleDefinition.java
deleted file mode 100644
index 1d32fc1b12..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/VfModuleDefinition.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.tosca.datatypes;
-
-import java.io.Serializable;
-import java.util.List;
-
-public class VfModuleDefinition extends ToscaGroupsTopologyTemplateDefinition implements Serializable {
-
- private List<String> artifacts;
-
- public static final long serialVersionUID = -6373756459967949586L;
-
- public List<String> getArtifacts() {
- return artifacts;
- }
-
- public void setArtifacts(List<String> artifacts) {
- this.artifacts = artifacts;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof VfModuleDefinition)) return false;
- if (!super.equals(o)) return false;
-
- VfModuleDefinition that = (VfModuleDefinition) o;
-
- return artifacts != null ? artifacts.containsAll(that.artifacts) : that.artifacts == null;
- }
-
- @Override
- public int hashCode() {
- int result = super.hashCode();
- result = 31 * result + (artifacts != null ? artifacts.hashCode() : 0);
- return result;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/model/ToscaMetadataFieldsPresentationEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/model/ToscaMetadataFieldsPresentationEnum.java
deleted file mode 100644
index 8716533555..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/model/ToscaMetadataFieldsPresentationEnum.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.tosca.model;
-
-public class ToscaMetadataFieldsPresentationEnum {
-
- public enum ToscaMetadataFieldsEnum {
-// general
- INVARIANT_UUID ("invariantUUID", ComponentTypeEnum.RESOURCE_SERVICE_NODE_TEMPLATE.value),
- UUID ("UUID", ComponentTypeEnum.RESOURCE_SERVICE_NODE_TEMPLATE.value),
- NAME ("name", ComponentTypeEnum.RESOURCE_SERVICE_NODE_TEMPLATE.value),
- DESCRIPTION ("description", ComponentTypeEnum.RESOURCE_SERVICE_NODE_TEMPLATE.value),
- CATEGORY ("category", ComponentTypeEnum.RESOURCE_SERVICE_NODE_TEMPLATE.value),
- TYPE ("type", ComponentTypeEnum.RESOURCE_SERVICE_NODE_TEMPLATE.value),
-
-// resource
- SUBCATEGORY ("subcategory", ComponentTypeEnum.RESOURCE_NODE_TEMPLATE.value),
- RESOURCE_VENDOR_NAME ("resourceVendor", ComponentTypeEnum.RESOURCE_NODE_TEMPLATE.value),
- RESOURCE_VENDOR_RELEASE ("resourceVendorRelease", ComponentTypeEnum.RESOURCE_NODE_TEMPLATE.value),
- RESOURCE_VENDOR_MODEL_NUMBER ("resourceVendorModelNumber", ComponentTypeEnum.RESOURCE_NODE_TEMPLATE.value),
-
-// service
- SERVICE_TYPE ("serviceType", ComponentTypeEnum.SERVICE.value),
- SERVICE_ROLE ("serviceRole", ComponentTypeEnum.SERVICE.value),
- SERVICE_ECOMP_NAMING ("serviceEcompNaming", ComponentTypeEnum.SERVICE.value),
- ECOMP_GENERATED_NAMING ("ecompGeneratedNaming", ComponentTypeEnum.SERVICE.value),
- NAMING_POLICY ("namingPolicy", ComponentTypeEnum.SERVICE.value),
- INSTANTIATION_TYPE ("instantiationType", ComponentTypeEnum.SERVICE.value),
-
-// node_template
- CUSTOMIZATION_UUID ("customizationUUID", ComponentTypeEnum.NODE_TEMPLATE.value),
- VERSION ("version", ComponentTypeEnum.RESOURCE_GROUP_NODE_TEMPLATE.value),
-
-// service group:
- VF_MODULE_MODEL_NAME ("vfModuleModelName", ComponentTypeEnum.RESOURCE_GROUP_SERVICE_GROUP.value),
- VF_MODULE_MODEL_INVARIANT_UUID ("vfModuleModelInvariantUUID", ComponentTypeEnum.RESOURCE_GROUP_SERVICE_GROUP.value),
- VF_MODULE_MODEL_UUID ("vfModuleModelUUID", ComponentTypeEnum.RESOURCE_GROUP_SERVICE_GROUP.value),
- VF_MODULE_MODEL_VERSION ("vfModuleModelVersion", ComponentTypeEnum.RESOURCE_GROUP_SERVICE_GROUP.value),
-
- VF_MODULE_MODEL_CUSTOMIZATION_UUID ("vfModuleModelCustomizationUUID", ComponentTypeEnum.SERVICE_GROUP.value)
- ;
-
-
-
- public String value;
- public String componentTypes;
-
- private ToscaMetadataFieldsEnum(String value, String componentTypes) {
- this.value = value;
- this.componentTypes = componentTypes;
- }
-
- }
-
-
- public enum ComponentTypeEnum {
-// RESOURCE_SERVICE_NODE_TEMPLATE_RESOURCE_GROUP("resource, service, nodeTemplate, resourceGroup"),
- RESOURCE_SERVICE_NODE_TEMPLATE("resource, service, nodeTemplate"),
- RESOURCE_NODE_TEMPLATE("resource, nodeTemplate"),
- SERVICE("service"),
- NODE_TEMPLATE("nodeTemplate"),
- RESOURCE_GROUP_NODE_TEMPLATE("resourceGroup, nodeTemplate"),
- SERVICE_GROUP("serviceGroup"),
- RESOURCE_GROUP_SERVICE_GROUP("resourceGroup, serviceGroup"),
-
- ;
-
- private String value;
-
- private ComponentTypeEnum(String value) {
- this.value = value;
- }
-
- }
-
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/AddUserAuditMessageInfo.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/AddUserAuditMessageInfo.java
deleted file mode 100644
index 9ca8adee53..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/AddUserAuditMessageInfo.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.users;
-
-public class AddUserAuditMessageInfo {
-
- String TIMESTAMP;
- String ACTION;
- // String MODIFIER_NAME;
- String MODIFIER;
- // String USER_UID;
- // String USER_NAME;
- // String USER_EMAIL;
- // String USER_ROLE;
- String USER;
- String STATUS;
- String DESC;
-
- public AddUserAuditMessageInfo(String timestamp, String action, String modifierName, String modifierUid,
- String user, String status, String desc) {
- super();
- this.TIMESTAMP = timestamp;
- this.ACTION = action;
- // this.MODIFIER_NAME = modifierName;
- this.MODIFIER = modifierUid;
- this.USER = user;
- this.STATUS = status;
- this.DESC = desc;
- }
-
- public AddUserAuditMessageInfo() {
- super();
- }
-
- public String getTIMESTAMP() {
- return TIMESTAMP;
- }
-
- public void setTIMESTAMP(String tIMESTAMP) {
- TIMESTAMP = tIMESTAMP;
- }
-
- public String getACTION() {
- return ACTION;
- }
-
- public void setACTION(String aCTION) {
- ACTION = aCTION;
- }
-
- // public String getMODIFIER_NAME() {
- // return MODIFIER_NAME;
- // }
- // public void setMODIFIER_NAME(String mODIFIER_NAME) {
- // MODIFIER_NAME = mODIFIER_NAME;
- // }
- public String getMODIFIER() {
- return MODIFIER;
- }
-
- public void setMODIFIER(String mODIFIER_UID) {
- MODIFIER = mODIFIER_UID;
- }
-
- public String getUSER() {
- return USER;
- }
-
- public void setUSER(String uSER) {
- USER = uSER;
- }
-
- public String getSTATUS() {
- return STATUS;
- }
-
- public void setSTATUS(String sTATUS) {
- STATUS = sTATUS;
- }
-
- public String getDESC() {
- return DESC;
- }
-
- public void setDESC(String dESC) {
- DESC = dESC;
- }
-
- @Override
- public String toString() {
- return "AddUserAuditMessageInfo [timestamp=" + TIMESTAMP + ", action=" + ACTION + ", modifierUid=" + MODIFIER
- + ", user=" + USER + ", status=" + STATUS + ", desc=" + DESC + "]";
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/UserAuditJavaObject.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/UserAuditJavaObject.java
deleted file mode 100644
index b34d474cf0..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/UserAuditJavaObject.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.users;
-
-public class UserAuditJavaObject {
-
- String TIMESTAMP;
- String ACTION;
- // String MODIFIER_NAME;
- String MODIFIER;
- String USER;
- // String USER_NAME;
- // String USER_EMAIL;
- // String USER_ROLE;
- String STATUS;
- String DESC;
-
- public UserAuditJavaObject(String timestamp, String action, String modifier, String user, String status,
- String desc) {
- super();
- this.TIMESTAMP = timestamp;
- this.ACTION = action;
- // this.MODIFIER_NAME = modifierName;
- this.MODIFIER = modifier;
- this.USER = user;
- // this.USER_NAME = userName;
- // this.USER_EMAIL = userEmail;
- // this.USER_ROLE = userRole;
- this.STATUS = status;
- this.DESC = desc;
- }
-
- public UserAuditJavaObject() {
- super();
- }
-
- public String getTIMESTAMP() {
- return TIMESTAMP;
- }
-
- public void setTIMESTAMP(String tIMESTAMP) {
- TIMESTAMP = tIMESTAMP;
- }
-
- public String getACTION() {
- return ACTION;
- }
-
- public void setACTION(String aCTION) {
- ACTION = aCTION;
- }
-
- // public String getMODIFIER_NAME() {
- // return MODIFIER_NAME;
- // }
- // public void setMODIFIER_NAME(String mODIFIER_NAME) {
- // MODIFIER_NAME = mODIFIER_NAME;
- // }
- public String getMODIFIER() {
- return MODIFIER;
- }
-
- public void setMODIFIER(String mODIFIER_UID) {
- MODIFIER = mODIFIER_UID;
- }
-
- public String getUSER() {
- return USER;
- }
-
- public void setUSER(String uSER) {
- USER = uSER;
- }
-
- // public String getUSER_NAME() {
- // return USER_NAME;
- // }
- // public void setUSER_NAME(String uSER_NAME) {
- // USER_NAME = uSER_NAME;
- // }
- // public String getUSER_EMAIL() {
- // return USER_EMAIL;
- // }
- // public void setUSER_EMAIL(String uSER_EMAIL) {
- // USER_EMAIL = uSER_EMAIL;
- // }
- // public String getUSER_ROLE() {
- // return USER_ROLE;
- // }
- // public void setUSER_ROLE(String uSER_ROLE) {
- // USER_ROLE = uSER_ROLE;
- // }
- public String getSTATUS() {
- return STATUS;
- }
-
- public void setSTATUS(String sTATUS) {
- STATUS = sTATUS;
- }
-
- public String getDESC() {
- return DESC;
- }
-
- public void setDESC(String dESC) {
- DESC = dESC;
- }
-
- @Override
- public String toString() {
- return "UserAuditJavaObject [timestamp=" + TIMESTAMP + ", action=" + ACTION + ", modifier=" + MODIFIER
- + ", user=" + USER + ", status=" + STATUS + ", desc=" + DESC + "]";
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/UserHeaderData.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/UserHeaderData.java
deleted file mode 100644
index 06320bcb5f..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/UserHeaderData.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.users;
-
-public class UserHeaderData {
- String contentType;
- String httpCspUserId;
- String accept;
-
- public UserHeaderData(String contentType, String httpCspUserId, String accept) {
- super();
- this.contentType = contentType;
- this.httpCspUserId = httpCspUserId;
- this.accept = accept;
- }
-
- public String getContentType() {
- return contentType;
- }
-
- public void setContentType(String contentType) {
- this.contentType = contentType;
- }
-
- public String getHttpCspUserId() {
- return httpCspUserId;
- }
-
- public void setHttpCspUserId(String httpCspUserId) {
- this.httpCspUserId = httpCspUserId;
- }
-
- public String getAccept() {
- return accept;
- }
-
- public void setAccept(String accept) {
- this.accept = accept;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/UserResponseMessageEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/UserResponseMessageEnum.java
deleted file mode 100644
index 97a08479f8..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/UserResponseMessageEnum.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.users;
-
-public enum UserResponseMessageEnum {
-
- SUCCESS_MESSAGE("OK"), MISSING_INFORMATION("Error: Missing information"), METHOD_NOT_ALLOWED("Error: Method not allowed"), RESTRICTED_OPERATION("Error: Restricted operation"), USER_ALREADY_EXISTS("Error: User with %s ID already exists"),
- INVALID_EMAIL("Error: Invalid Content. Invalid e-mail address %s"), INVALID_ROLE("Error: Invalid Content. Invalid role %s"), INVALID_CONTENT("Error: Invalid content"), USER_NOT_FOUND("Error: User with %s ID is not found"),
- INTERNAL_SERVER_ERROR("Error: Internal Server Error. Try later again"), ADMINISTARTOR_CAN_BE_DELETED("Error: Administrator can be deleted by other administrator only"), RESTRICTED_ACCESS("Error: Restricted access");
-
- String value;
-
- private UserResponseMessageEnum(String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/WebSealUserDetails.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/WebSealUserDetails.java
deleted file mode 100644
index 609ebf22b7..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/users/WebSealUserDetails.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.users;
-
-public class WebSealUserDetails {
- String firstName;
- String lastName;
- String userId;
- String email;
-
- public WebSealUserDetails() {
- super();
- }
-
- public WebSealUserDetails(String firstName, String lastName, String userId, String emailAddress) {
- super();
- this.firstName = firstName;
- this.lastName = lastName;
- this.userId = userId;
- this.email = emailAddress;
-
- }
-
- public String getFirstName() {
- return firstName;
- }
-
- public void setFirstName(String firstName) {
- this.firstName = firstName;
- }
-
- public String getLastName() {
- return lastName;
- }
-
- public void setLastName(String lastName) {
- this.lastName = lastName;
- }
-
- public String getUserId() {
- return userId;
- }
-
- public void setUserId(String userId) {
- this.userId = userId;
- }
-
- public String getEmailAddress() {
- return email;
- }
-
- public void setEmailAddress(String emailAddress) {
- this.email = emailAddress;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/ArtifactUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/ArtifactUtils.java
deleted file mode 100644
index 12f8ffe984..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/ArtifactUtils.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils;
-
-import org.openecomp.sdc.be.model.ArtifactDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
-import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
-
-public class ArtifactUtils {
-
- public static ArtifactDefinition convertArtifactReqToDefinition(ArtifactReqDetails artifactReq) {
- ArtifactDefinition artifact = new ArtifactDefinition();
- artifact.setArtifactLabel(artifactReq.getArtifactLabel());
- artifact.setArtifactDisplayName(artifactReq.getArtifactDisplayName());
- artifact.setArtifactGroupType(ArtifactGroupTypeEnum.findType(artifactReq.getArtifactGroupType()));
- artifact.setArtifactType(artifactReq.getArtifactType().toUpperCase());
- artifact.setArtifactName(artifactReq.getArtifactName());
- artifact.setDescription(artifactReq.getDescription());
- artifact.setUniqueId(artifactReq.getUniqueId());
- artifact.setTimeout(artifactReq.getTimeout());
- artifact.setEsId(artifactReq.getUniqueId());
-
- return artifact;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/CsarParserUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/CsarParserUtils.java
deleted file mode 100644
index fc717ca79d..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/CsarParserUtils.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils;
-
-import org.apache.commons.codec.binary.Base64;
-import org.json.simple.JSONArray;
-import org.json.simple.JSONObject;
-import org.json.simple.parser.JSONParser;
-import org.json.simple.parser.ParseException;
-import org.junit.Assert;
-import org.openecomp.sdc.be.model.ArtifactUiDownloadData;
-import org.openecomp.sdc.be.model.Component;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.datatypes.GroupHeatMetaDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.HeatMetaFirstLevelDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.PropertyHeatMetaDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.TypeHeatMetaDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaParameterConstants;
-import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.openecomp.sdc.ci.tests.utils.validation.CsarValidationUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import static org.testng.AssertJUnit.assertTrue;
-
-public class CsarParserUtils {
- public static final String CSAR_ARTIFACT = "assettoscacsar";
- private static Logger log = LoggerFactory.getLogger(CsarValidationUtils.class.getName());
-
- public static byte[] downloadComponentCsar(Component csarOwner, User user) throws Exception {
- String artifactUniqeId = csarOwner.getToscaArtifacts().get(CSAR_ARTIFACT).getUniqueId();
- RestResponse csarResponse = ArtifactRestUtils.downloadResourceArtifactInternalApi(csarOwner.getUniqueId(), user, artifactUniqeId);
- Assert.assertNotNull(csarResponse);
- BaseRestUtils.checkSuccess(csarResponse);
- ArtifactUiDownloadData artifactUiDownloadData = ResponseParser.parseToObject(csarResponse.getResponse(),
- ArtifactUiDownloadData.class);
- byte[] fromUiDownload = artifactUiDownloadData.getBase64Contents().getBytes();
- return Base64.decodeBase64(fromUiDownload);
- }
-
- public static List<TypeHeatMetaDefinition> getListTypeHeatMetaDefinition(File csarFileLocation) throws Exception {
-
- String artifactHeatMetaLocation = ToscaParameterConstants.HEAT_META_PATH;
- String csarPayload = ToscaParserUtils.getYamlPayloadFromCsar(csarFileLocation, artifactHeatMetaLocation);
- return getListTypeHeatMetaDefinitionByPayload(csarPayload);
- }
-
- public static List<TypeHeatMetaDefinition> getListTypeHeatMetaDefinition(String csarUUID) throws Exception {
-
- String artifactHeatMetaLocation = ToscaParameterConstants.HEAT_META_PATH;
- String csarPayload = ToscaParserUtils.getCsarPayload(csarUUID, artifactHeatMetaLocation);
- return getListTypeHeatMetaDefinitionByPayload(csarPayload);
- }
-
- public static List<TypeHeatMetaDefinition> getListTypeHeatMetaDefinitionByPayload(String csarPayload) throws ParseException {
- JSONParser parser = new JSONParser();
- if (csarPayload != null) {
- Object parse = parser.parse(csarPayload);
- JSONObject jsonObject = (JSONObject) parse;
- JSONObject jsonObjectImportStructure = (JSONObject) jsonObject.get(ToscaParameterConstants.IMPORT_STRUCTURE);
- List<TypeHeatMetaDefinition> listHeatMetaDefenition = new ArrayList<>();
- listHeatMetaDefenition = getArtifactsByGroup(jsonObjectImportStructure, listHeatMetaDefenition);
- return listHeatMetaDefenition;
- }
- return null;
- }
-
-
- protected static List<TypeHeatMetaDefinition> getArtifactsByGroup(JSONObject jsonObjectImportStructure, List<TypeHeatMetaDefinition> listHeatMetaDefenition) {
-
- @SuppressWarnings("unchecked")
- Set<Object> typeSet = jsonObjectImportStructure.keySet();
- for (Object type : typeSet) {
- TypeHeatMetaDefinition heatMetaDefenition = new TypeHeatMetaDefinition();
- log.debug(type.toString());
- log.debug("{}", jsonObjectImportStructure.get(type));
- JSONArray array = (JSONArray) jsonObjectImportStructure.get(type);
- heatMetaDefenition.setTypeName((String) type);
- List<GroupHeatMetaDefinition> groupHeatMetaDefinitions = new ArrayList<>();
- heatMetaDefenition.setGroupHeatMetaDefinition(fetchArtifactByGroupFromJsonArray(array, groupHeatMetaDefinitions, true, false));
- listHeatMetaDefenition.add(heatMetaDefenition);
- }
- return listHeatMetaDefenition;
- }
-
- protected static List<GroupHeatMetaDefinition> fetchArtifactByGroupFromJsonArray(JSONArray array, List<GroupHeatMetaDefinition> listGroupHeatMetaDefinition, Boolean openNewGroup, Boolean isNested) {
-
- GroupHeatMetaDefinition groupHeatMetaDefinition;
-
- if (array != null) {
- for (int i = 0; i < array.size(); i++) {
- if (openNewGroup) {
- groupHeatMetaDefinition = new GroupHeatMetaDefinition();
- int groupNumber = listGroupHeatMetaDefinition.size() + 1;
- log.debug("groupName={}", groupNumber);
- groupHeatMetaDefinition.setGroup(groupNumber);
- listGroupHeatMetaDefinition.add(groupHeatMetaDefinition);
- PropertyHeatMetaDefinition propertyHeatMetaDefinition = new PropertyHeatMetaDefinition();
- propertyHeatMetaDefinition.setName("isBase");
- propertyHeatMetaDefinition.setValue(false);
- groupHeatMetaDefinition.setPropertyHeatMetaDefinition(propertyHeatMetaDefinition);
- }
- groupHeatMetaDefinition = listGroupHeatMetaDefinition.get(listGroupHeatMetaDefinition.size() - 1);
- JSONObject jsonObject = (JSONObject) array.get(i);
- if (openNewGroup) {
- String groupName;
- int lastIndexOfDot = jsonObject.get("fileName").toString().lastIndexOf(".");
- if(lastIndexOfDot == -1){
- groupName = jsonObject.get("fileName").toString();
- }else {
- groupName = jsonObject.get("fileName").toString().substring(0, lastIndexOfDot);
- }
- groupHeatMetaDefinition.setGroupName(groupName);
- }
- fetchArtifactByGroupFromJsonObject(listGroupHeatMetaDefinition, groupHeatMetaDefinition, jsonObject, isNested);
- }
- }
- return listGroupHeatMetaDefinition;
- }
-
-
- public static void fetchArtifactByGroupFromJsonObject(List<GroupHeatMetaDefinition> listGroupHeatMetaDefinition, GroupHeatMetaDefinition groupHeatMetaDefinition, JSONObject jsonObject, Boolean isNested) {
- @SuppressWarnings("unchecked")
- Set<Object> groupsKey = jsonObject.keySet();
- for (Object groupKey : groupsKey) {
- String groupKeyStr = (String) groupKey;
- if (groupKeyStr.equals("isBase")) {
- PropertyHeatMetaDefinition propertyHeatMetaDefinition = new PropertyHeatMetaDefinition();
- propertyHeatMetaDefinition.setName(groupKeyStr);
- propertyHeatMetaDefinition.setValue((boolean) jsonObject.get(groupKeyStr));
- if (!groupHeatMetaDefinition.getPropertyHeatMetaDefinition().equals(propertyHeatMetaDefinition)) {
- groupHeatMetaDefinition.getPropertyHeatMetaDefinition().setValue((boolean) jsonObject.get(groupKeyStr));
- }
- }
- if (groupKeyStr.equals("fileName")) {
- String artifactName = (String) jsonObject.get(groupKeyStr);
- String artifactType = ArtifactTypeEnum.HEAT_ARTIFACT.getType();
- if(isNested){
- artifactType = ArtifactTypeEnum.HEAT_NESTED.getType();
- }
- if(jsonObject.get("type") != null && isNested == false){
- artifactType = (String) jsonObject.get("type");
- }
- HeatMetaFirstLevelDefinition heatMetaFirstLevelDefinition = new HeatMetaFirstLevelDefinition(artifactName, artifactType, null);
- List<HeatMetaFirstLevelDefinition> listArtifactNames = groupHeatMetaDefinition.getArtifactList();
- listArtifactNames.add(heatMetaFirstLevelDefinition);
- groupHeatMetaDefinition.setArtifactList(listArtifactNames);
- } else {
- if((groupKeyStr.equals("env"))){
- if (jsonObject.get(groupKeyStr) instanceof JSONObject){
- fetchArtifactByGroupFromJsonObject(listGroupHeatMetaDefinition, groupHeatMetaDefinition, (JSONObject) jsonObject.get(groupKeyStr), false);
- }else{
- assertTrue("Expected object is JSONObject, but actual: " + jsonObject.get(groupKeyStr).getClass(), jsonObject.get(groupKeyStr).getClass().equals("JSONObject"));
- }
- }
- if((groupKeyStr.equals("nested"))){
- if (jsonObject.get(groupKeyStr) instanceof JSONArray){
- fetchArtifactByGroupFromJsonArray((JSONArray) jsonObject.get(groupKeyStr), listGroupHeatMetaDefinition, false, true);
- }else{
- assertTrue("Expected object is JSONArray, but actual: " + jsonObject.get(groupKeyStr).getClass(), jsonObject.get(groupKeyStr).getClass().equals("JSONArray"));
- }
-
- }else if (!(groupKeyStr.equals("isBase") || groupKeyStr.equals("type") || groupKeyStr.equals("env"))) {
- if (jsonObject.get(groupKeyStr) instanceof JSONArray){
- fetchArtifactByGroupFromJsonArray((JSONArray) jsonObject.get(groupKeyStr), listGroupHeatMetaDefinition, false, false);
- }else{
- assertTrue("Expected object is JSONArray, but actual: " + jsonObject.get(groupKeyStr).getClass(), jsonObject.get(groupKeyStr).getClass().equals("JSONArray"));
- }
- }
- }
- }
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/CsarToscaTester.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/CsarToscaTester.java
deleted file mode 100644
index be337ba379..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/CsarToscaTester.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils;
-
-import org.onap.sdc.tosca.parser.api.ISdcCsarHelper;
-import org.onap.sdc.tosca.parser.enums.SdcTypes;
-import org.onap.sdc.tosca.parser.exceptions.SdcToscaParserException;
-import org.onap.sdc.tosca.parser.impl.SdcToscaParserFactory;
-import org.onap.sdc.toscaparser.api.Group;
-import org.onap.sdc.toscaparser.api.NodeTemplate;
-import org.onap.sdc.toscaparser.api.elements.Metadata;
-import org.onap.sdc.toscaparser.api.parameters.Input;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-
-public class CsarToscaTester {
-
- public static void processCsar(SdcToscaParserFactory factory, File file) throws SdcToscaParserException {
- ISdcCsarHelper sdcCsarHelper = factory.getSdcCsarHelper(file.getAbsolutePath());
- processCsarImpl(sdcCsarHelper);
-
- }
-
- public static void processCsar(ISdcCsarHelper sdcCsarHelper) throws SdcToscaParserException {
- processCsarImpl(sdcCsarHelper);
-
- }
-
- private static void processCsarImpl(ISdcCsarHelper sdcCsarHelper) {
-
- //Service level
- System.out.println("Invoking sdc-tosca methods on this CSAR....");
- String conformanceLevel = sdcCsarHelper.getConformanceLevel();
- System.out.println("getConformanceLevel() - conformance level is "+conformanceLevel);
- String serviceSubstitutionMappingsTypeName = sdcCsarHelper.getServiceSubstitutionMappingsTypeName();
- System.out.println("serviceSubstitutionMappingsTypeName() - subst mappings type of service is "+serviceSubstitutionMappingsTypeName);
- List<Input> serviceInputs = sdcCsarHelper.getServiceInputs();
- System.out.println("getServiceInputs() - service inputs are "+serviceInputs);
- Metadata serviceMetadata = sdcCsarHelper.getServiceMetadata();
- System.out.println("getServiceMetadata() - service metadata is "+serviceMetadata);
- Map<String, Object> serviceMetadataProperties = sdcCsarHelper.getServiceMetadataProperties();
- System.out.println("getServiceMetadataProperties() - service metadata properties is "+serviceMetadataProperties);
- List<NodeTemplate> allottedResources = sdcCsarHelper.getAllottedResources();
- System.out.println("getAllottedResources() - service allotted resources are "+allottedResources);
- List<NodeTemplate> serviceVfList = sdcCsarHelper.getServiceVfList();
- System.out.println("getServiceVfList() - VF list is "+serviceVfList);
- List<NodeTemplate> serviceNodeTemplateBySdcType = sdcCsarHelper.getServiceNodeTemplateBySdcType(SdcTypes.VF);
- System.out.println("getServiceNodeTemplateBySdcType() - VF list is "+serviceNodeTemplateBySdcType);
- List<NodeTemplate> serviceNodeTemplates = sdcCsarHelper.getServiceNodeTemplates();
- System.out.println("getServiceNodeTemplates() - all node templates list of service is "+serviceNodeTemplates);
-
- serviceVfList.forEach(x -> {
- String nodeTemplateCustomizationUuid = sdcCsarHelper.getNodeTemplateCustomizationUuid(x);
- System.out.println("getNodeTemplateCustomizationUuid() - VF ID is "+nodeTemplateCustomizationUuid);
- String typeOfNodeTemplate = sdcCsarHelper.getTypeOfNodeTemplate(x);
- System.out.println("getTypeOfNodeTemplate() - VF tosca type is "+typeOfNodeTemplate);
- List<Group> vfModulesByVf = sdcCsarHelper.getVfModulesByVf(nodeTemplateCustomizationUuid);
- System.out.println("getVfModulesByVf() - VF modules list is "+vfModulesByVf);
- vfModulesByVf.forEach(y -> {
- List<NodeTemplate> membersOfVfModule = sdcCsarHelper.getMembersOfVfModule(x, y);
- System.out.println("getMembersOfVfModule() - members of VfModule are "+membersOfVfModule);
- });
- List<NodeTemplate> vfcListByVf = sdcCsarHelper.getVfcListByVf(nodeTemplateCustomizationUuid);
- System.out.println("getVfcListByVf() - VFC list is "+vfcListByVf);
- vfcListByVf.forEach(z -> {
- List<NodeTemplate> nodeTemplateBySdcType = sdcCsarHelper.getNodeTemplateBySdcType(z, SdcTypes.CP);
- System.out.println("getNodeTemplateBySdcType() - CP children node templates of this VFC are "+nodeTemplateBySdcType);
- Map<String, Map<String, Object>> cpPropertiesFromVfcAsObject = sdcCsarHelper.getCpPropertiesFromVfcAsObject(z);
- System.out.println("getCpPropertiesFromVfcAsObject() - consolidated CP properties for this VFC are "+cpPropertiesFromVfcAsObject);
- boolean hasTopology = sdcCsarHelper.hasTopology(z);
- System.out.println("hasTopology() - this VFC is "+(hasTopology ? "nested" : "not nested"));
- });
- });
- }
-
- private static void generateReport(String time, String name, String currentCsarDir, List<String> criticalsReport, String type)
- throws IOException {
- FileWriter fw;
- try (FileWriter fileWriter = fw = new FileWriter(new File(currentCsarDir + "/" + criticalsReport.size() + "-" + type + "-" + name + "-" + time + ".txt"))) {
- }
- for (String exception : criticalsReport) {
- fw.write(exception);
- fw.write("\r\n");
- }
- fw.close();
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/DbUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/DbUtils.java
deleted file mode 100644
index 5ba7062f3b..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/DbUtils.java
+++ /dev/null
@@ -1,278 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils;
-
-import com.google.gson.*;
-import org.janusgraph.core.JanusGraphEdge;
-import org.janusgraph.core.JanusGraphFactory;
-import org.janusgraph.core.JanusGraph;
-import org.janusgraph.core.JanusGraphVertex;
-import fj.data.Either;
-import org.apache.tinkerpop.gremlin.structure.Edge;
-import org.apache.tinkerpop.gremlin.structure.Element;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.apache.tinkerpop.gremlin.structure.util.ElementHelper;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.users.UserAuditJavaObject;
-import org.openecomp.sdc.ci.tests.utils.cassandra.CassandraUtils;
-
-import java.io.IOException;
-import java.util.*;
-import java.util.Map.Entry;
-
-public class DbUtils {
-
- private static String janusGraphConfigFilePath;
- private static JanusGraph janusGraph;
-
-
- public static void cleanAllAudits() throws IOException {
- CassandraUtils.truncateAllTables("sdcaudit");
- }
-
- public static RestResponse deleteFromEsDbByPattern(String patternToDelete) throws IOException {
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_SEARCH_DATA_FROM_ES, config.getEsHost(), config.getEsPort(),
- patternToDelete);
- HttpRequest httpRequest = new HttpRequest();
- RestResponse restResponse = httpRequest.httpSendDelete(url, null);
- restResponse.getErrorCode();
- cleanAllAudits();
-
- return restResponse;
- }
-
- public static RestResponse getFromEsByPattern(String patternToGet) throws IOException {
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_SEARCH_DATA_FROM_ES, config.getEsHost(), config.getEsPort(), patternToGet);
- HttpRequest httpRequest = new HttpRequest();
- RestResponse restResponse = httpRequest.httpSendGet(url, null);
- restResponse.getErrorCode();
-
- return restResponse;
- }
-
- public Either<Vertex, Boolean> getVertexByUId(String uid) {
- JanusGraph janusGraph = getJanusGraph();
- Either<Vertex, Boolean> result = Either.right(false);
- // Iterator<Vertex> vertexItr = janusGraph.getVertices().iterator();
-
- Iterator<JanusGraphVertex> vertexItr = janusGraph.query().vertices().iterator();
- while (vertexItr.hasNext()) {
- Vertex vertex = vertexItr.next();
- // String uidFoundVal = vertex.getProperty("uid");
- String uidFoundVal = vertex.value("uid");
- if (uid.equals(uidFoundVal)) {
- result = Either.left(vertex);
- }
- }
- return result;
- }
-
- public static JanusGraphState getCurrentJanusGraphState() {
- JanusGraph janusGraph = getJanusGraph();
- List<Vertex> vertices = new ArrayList<>();
- List<Edge> edges = new ArrayList<>();
- // Iterator<Edge> edgesItr = janusGraph.getEdges().iterator();
- Iterator<JanusGraphEdge> edgesItr = janusGraph.query().edges().iterator();
- // Iterator<Vertex> verticesItr = janusGraph.getVertices().iterator();
- Iterator<JanusGraphVertex> verticesItr = janusGraph.query().vertices().iterator();
- while (edgesItr.hasNext()) {
- edges.add(edgesItr.next());
- }
- while (verticesItr.hasNext()) {
- vertices.add(verticesItr.next());
- }
-
- JanusGraphState currState = new JanusGraphState(edges, vertices);
- return currState;
-
- }
-
- //
- private static JanusGraph getJanusGraph() {
- if (janusGraph == null) {
- janusGraph = JanusGraphFactory.open(janusGraphConfigFilePath);
- }
- return janusGraph;
- }
-
- public void restoreToJanusGraphState(JanusGraphState janusGraphStateToRestoreTo) {
- List<Vertex> verticesToRemove = new ArrayList<>(), verticesToAdd = new ArrayList<>();
- List<Edge> edgesToRemove = new ArrayList<>(), edgesToAdd = new ArrayList<>();
-
- JanusGraphState currentJanusGraphState = getCurrentJanusGraphState();
-
- List<Edge> joinedEdges = new ArrayList<>();
- joinedEdges.addAll(janusGraphStateToRestoreTo.edges);
- joinedEdges.retainAll(currentJanusGraphState.edges);
-
- List<Vertex> joinedVertices = new ArrayList<>();
- joinedVertices.addAll(janusGraphStateToRestoreTo.vertices);
- joinedVertices.retainAll(currentJanusGraphState.vertices);
-
- edgesToRemove.addAll(currentJanusGraphState.edges);
- edgesToRemove.removeAll(joinedEdges);
-
- verticesToRemove.addAll(currentJanusGraphState.vertices);
- verticesToRemove.removeAll(joinedVertices);
-
- edgesToAdd.addAll(janusGraphStateToRestoreTo.edges);
- edgesToAdd.removeAll(joinedEdges);
-
- verticesToAdd.addAll(janusGraphStateToRestoreTo.vertices);
- verticesToAdd.removeAll(joinedVertices);
-
- modifyGraphAccordingToDelta(verticesToRemove, verticesToAdd, edgesToRemove, edgesToAdd);
-
- }
-
- private void modifyGraphAccordingToDelta(List<Vertex> verticesToRemove, List<Vertex> verticesToAdd,
- List<Edge> edgesToRemove, List<Edge> edgesToAdd) {
-
- JanusGraph janusGraph = getJanusGraph();
-
- for (Vertex vertex : verticesToRemove) {
- // janusGraph.removeVertex(vertex);
- vertex.remove();
- }
- for (Vertex vertex : verticesToAdd) {
- JanusGraphVertex janusGraphVertex = janusGraph.addVertex();
- copyProperties(vertex, janusGraphVertex);
- }
-
- for (Edge edge : edgesToRemove) {
- // janusGraph.removeEdge(edge);
- edge.remove();
- }
-
- for (Edge edge : edgesToAdd) {
- // Element addedEdge = janusGraph.addEdge(edge.getId(),
- // edge.getVertex(Direction.OUT), edge.getVertex(Direction.IN),
- // edge.getLabel());
-
- // Edge edge = tGraph.addEdge(null, fromV.left().value(),
- // toV.left().value(), type);
-
- Element addedEdge = edge.outVertex().addEdge(edge.label(), edge.inVertex());
-
- copyProperties(edge, addedEdge);
-
- }
-
- // janusGraph.commit();
- janusGraph.tx().commit();
-
- }
-
- private void copyProperties(Element copyFrom, Element copyTo) {
- // Set<String> properties = copyFrom.getPropertyKeys();
- Set<String> properties = copyFrom.keys();
- for (String propertyKey : properties) {
- // copyTo.setProperty(propertyKey,
- // copyFrom.getProperty(propertyKey));
- copyTo.property(propertyKey, copyFrom.value(propertyKey));
- }
-
- }
-
- public static class JanusGraphState {
- private List<Edge> edges;
- private List<Vertex> vertices;
-
- private JanusGraphState(List<Edge> edges, List<Vertex> vertices) {
- this.edges = edges;
- this.vertices = vertices;
- }
-
- @Override
- public String toString() {
- return "JanusGraphState [edges=" + edges.size() + ", vertices=" + vertices.size() + "]";
- }
-
- }
-
- public void shutDownJanusGraph() {
- if (janusGraph != null) {
- // janusGraph.shutdown();
- janusGraph.close();
- }
- }
-
- public static void setProperties(Element element, Map<String, Object> properties) {
-
- if (properties != null && false == properties.isEmpty()) {
-
- Object[] propertyKeyValues = new Object[properties.size() * 2];
- int i = 0;
- for (Entry<String, Object> entry : properties.entrySet()) {
- propertyKeyValues[i++] = entry.getKey();
- propertyKeyValues[i++] = entry.getValue();
- }
-
- ElementHelper.attachProperties(element, propertyKeyValues);
-
- }
-
- }
-
- public static UserAuditJavaObject parseAuditRespByAction(String action) throws Exception {
-
- // String index = "auditingevents*";
- // String type = "useradminevent";
- // String pattern = "/_search?q=action:\""+action+"\"";
- // String auditingMessage = retrieveAuditMessageByIndexType(index, type,
- // pattern);
- UserAuditJavaObject auditParsedResp = new UserAuditJavaObject();
- Gson gson = new Gson();
-
- String pattern = "/_search?q=ACTION:\"" + action + "\"";
- String auditingMessage = retrieveAuditMessagesByPattern(pattern);
- JsonElement jElement = new JsonParser().parse(auditingMessage);
- JsonObject jObject = jElement.getAsJsonObject();
- JsonObject hitsObject = (JsonObject) jObject.get("hits");
- JsonArray hitsArray = (JsonArray) hitsObject.get("hits");
- // for (int i = 0; i < hitsArray.size();){
- if (hitsArray.size() == 0) {
- return auditParsedResp;
- }
- JsonObject jHitObject = (JsonObject) hitsArray.get(0);
- JsonObject jSourceObject = (JsonObject) jHitObject.get("_source");
-
- auditParsedResp = gson.fromJson(jSourceObject, UserAuditJavaObject.class);
-
- return auditParsedResp;
-
- }
-
- public static String retrieveAuditMessagesByPattern(String pattern) throws IOException {
-
- Config config = Utils.getConfig();
- HttpRequest getAuditingMessage = new HttpRequest();
- String url = String.format(Urls.GET_SEARCH_DATA_FROM_ES, config.getEsHost(), config.getEsPort(), pattern);
- RestResponse restResponse = getAuditingMessage.httpSendGet(url, null);
-
- return restResponse.getResponse();
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/Decoder.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/Decoder.java
deleted file mode 100644
index 3b11388505..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/Decoder.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils;
-
-import org.apache.commons.codec.binary.Base64;
-
-import java.io.BufferedReader;
-import java.io.FileReader;
-import java.io.IOException;
-
-public class Decoder {
-
- public static String encode(byte[] byteArrayToEncode) {
-
- byte[] bytesEncoded = Base64.encodeBase64(byteArrayToEncode);
- String strEncoded = new String(bytesEncoded);
- return strEncoded;
- }
-
- public static String decode(String strEncoded) throws IOException {
-
- byte[] byteDecoded = Base64.decodeBase64(strEncoded);
- String decoded = new String(byteDecoded);
-
- return decoded;
-
- }
-
- public static String readFileToString(String file) throws IOException {
-
- BufferedReader reader = new BufferedReader(new FileReader(file));
- String line = null;
- StringBuilder stringBuilder = new StringBuilder();
- String ls = System.getProperty("line.separator");
-
- while ((line = reader.readLine()) != null) {
- stringBuilder.append(line);
- stringBuilder.append(ls);
- }
- reader.close();
- return stringBuilder.toString();
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/DistributionUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/DistributionUtils.java
deleted file mode 100644
index 479fdcb220..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/DistributionUtils.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils;
-
-import com.clearspring.analytics.util.Pair;
-import com.google.gson.Gson;
-import org.codehaus.jettison.json.JSONArray;
-import org.codehaus.jettison.json.JSONException;
-import org.codehaus.jettison.json.JSONObject;
-import org.openecomp.sdc.be.model.ArtifactDefinition;
-import org.openecomp.sdc.be.model.ComponentInstance;
-import org.openecomp.sdc.be.model.Service;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.DistributionMonitorObject;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceDistributionStatus;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
-
-import java.io.IOException;
-import java.text.ParseException;
-import java.util.*;
-import java.util.Map.Entry;
-
-//import org.openecomp.sdc.be.components.distribution.engine.DistributionStatusNotificationEnum;
-
- public class DistributionUtils extends BaseRestUtils{
-
- final static String serviceDistributionSuffix = "/sdc/v1/catalog/services/";
-
- public static ServiceDistributionStatus getLatestServiceDistributionObject(Service service) throws IOException, ParseException {
- ServiceDistributionStatus serviceDistributionStatus = null;
- RestResponse distributionServiceList = ServiceRestUtils.getDistributionServiceList(service, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- Map<Long, ServiceDistributionStatus> serviveDistributionStatusMap = ResponseParser.convertServiceDistributionStatusToObject(distributionServiceList.getResponse());
- if(serviveDistributionStatusMap.size() != 0){
- serviceDistributionStatus = getLatestServiceDistributionObjectFromMap(serviveDistributionStatusMap);
- return serviceDistributionStatus;
- }
-
- return null;
- }
-
- public static ServiceDistributionStatus getLatestServiceDistributionObjectFromMap(Map<Long, ServiceDistributionStatus> serviceDistributionStatusMap) {
-
- ServiceDistributionStatus serviceDistributionStatus = null;
- if (serviceDistributionStatusMap.size() == 1 ){
- for (Entry<Long, ServiceDistributionStatus> entry : serviceDistributionStatusMap.entrySet()) {
- return entry.getValue();
- }
- }
- else{
- serviceDistributionStatus = getFilteredServiceDistributionObject(serviceDistributionStatusMap);
- }
-
- return serviceDistributionStatus;
- }
-
- private static ServiceDistributionStatus getFilteredServiceDistributionObject(Map<Long, ServiceDistributionStatus> serviceDistributionStatusMap) {
-
- List<Long> list = new ArrayList<Long>();
- list.addAll(serviceDistributionStatusMap.keySet());
- Collections.sort(list);
- return serviceDistributionStatusMap.get(list.get(list.size() - 1));
- }
-
- public static Map<String, String> getArtifactsMapOfDistributedService(Service service) throws Exception{
-
- Map<String, String> expectedDistributionArtifactMap = new HashMap<String, String>();
- expectedDistributionArtifactMap = addServiceDeploymentArtifactToMap(service, expectedDistributionArtifactMap);
- expectedDistributionArtifactMap = addComponentInstancesDeploymentArtifactToMap(service, expectedDistributionArtifactMap);
-
- return expectedDistributionArtifactMap;
- }
-
-
- public static Map<String, String> addServiceDeploymentArtifactToMap(Service service, Map<String, String> distributionArtifactMap){
-
- Map<String, ArtifactDefinition> deploymentArtifacts = service.getDeploymentArtifacts();
- if (deploymentArtifacts != null && deploymentArtifacts.size() > 0){
- for(Entry<String, ArtifactDefinition> artifact : deploymentArtifacts.entrySet()){
- String url = buildServiceDeploymentUrl(service, artifact.getValue().getArtifactName(), artifact.getValue().getArtifactUUID());
- distributionArtifactMap.put(artifact.getKey(), url);
- }
- }
-
- return distributionArtifactMap;
- }
-
- private static String buildServiceDeploymentUrl(Service service, String artifactName, String artifactUUID) {
-// format "/sdc/v1/catalog/services/" + service.getSystemName() + "/" + service.getVersion() + "/artifacts/AAI-" + service.getName() + "-service-1.xml"
- return serviceDistributionSuffix + service.getSystemName() + "/" + service.getVersion() + "/artifacts/" + artifactName;
- }
-
- public static String buildResourceInstanceDeploymentUrl(Service service, String artifactName, String artifactUUID){
-
-// /sdc/v1/catalog/services/Servicefordistribution/1.0 /resourceInstances/nestedfrommarina2 /artifacts/FEAdd_On_Module_vProbeLauncher.yaml
- String resourceInstanceNormalizedName = getResourceInstanceNormalizeName(service, artifactName, artifactUUID );
- return serviceDistributionSuffix + service.getSystemName() + "/" + service.getVersion() + "/resourceInstances/" + resourceInstanceNormalizedName +"/artifacts/" + artifactName;
- }
-
- public static String getResourceInstanceNormalizeName(Service service, String artifactName, String artifactUUID) {
- for (ComponentInstance componentInstance : service.getComponentInstances()){
- for(String key : componentInstance.getDeploymentArtifacts().keySet()){
- if(componentInstance.getDeploymentArtifacts().get(key).getArtifactUUID().equals(artifactUUID)) {
- return componentInstance.getNormalizedName();
- }
- }
- }
- return null;
- }
-
- public static Map<String, String> addComponentInstancesDeploymentArtifactToMap(Service service, Map<String, String> distributionArtifactMap){
-// TODO Andrey create correct method to build RI url
- if(service.getComponentInstances() != null && service.getComponentInstances().size() != 0){
- for(ComponentInstance componentInstance : service.getComponentInstances()){
- if (componentInstance.getDeploymentArtifacts() != null && componentInstance.getDeploymentArtifacts().size() != 0){
- for(Entry<String, ArtifactDefinition> artifact : componentInstance.getDeploymentArtifacts().entrySet()){
- String url = buildResourceInstanceDeploymentUrl(service, artifact.getValue().getArtifactName(), artifact.getValue().getArtifactUUID());;
- distributionArtifactMap.put(artifact.getKey(), url);
- }
- }
- }
- }
-
- return distributionArtifactMap;
- }
-
-
-
- public static RestResponse getDistributionStatus(User sdncModifierDetails, String distributionId) throws IOException {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.DISTRIBUTION_SERVICE_MONITOR, config.getCatalogBeHost(), config.getCatalogBePort(), distributionId);
- return sendGet(url, sdncModifierDetails.getUserId());
-
- }
-
-
- /**
- * @param response
- * @return parsed distribution list of DistributionMonitorObject java objects
- * @throws JSONException
- */
- public static Map<String, List<DistributionMonitorObject>> getSortedDistributionStatus(RestResponse response) throws JSONException{
-
- ArrayList<DistributionMonitorObject> distributionStatusList = new ArrayList<DistributionMonitorObject>();
- String responseString = response.getResponse();
- JSONObject jObject;
- JSONArray jsonArray = null;
- jObject = new JSONObject(responseString);
- jsonArray = jObject.getJSONArray("distributionStatusList");
-
- Gson gson = new Gson();
- for(int i=0; i<jsonArray.length(); i++){
- String jsonElement = jsonArray.get(i).toString();
- DistributionMonitorObject distributionStatus = gson.fromJson(jsonElement, DistributionMonitorObject.class);
- distributionStatusList.add(distributionStatus);
- }
- Map<String, List<DistributionMonitorObject>> sortedDistributionMapByConsumer = sortDistributionStatusByConsumer(distributionStatusList);
-
- return sortedDistributionMapByConsumer;
- }
-
- /**
- * @param distributionStatusList
- * @return sorted distribution map where key is consumer name and value contains list of corresponded DistributionMonitorObject java object
- */
- public static Map<String, List<DistributionMonitorObject>> sortDistributionStatusByConsumer(ArrayList<DistributionMonitorObject> distributionStatusList) {
- // sort distribution status list per consumer
- Map<String, List<DistributionMonitorObject>> distributionStatusMapByConsumer = new HashMap<String, List<DistributionMonitorObject>>();
- for(DistributionMonitorObject distributionListElement : distributionStatusList){
- String key = distributionListElement.getOmfComponentID();
- List<DistributionMonitorObject> list = new ArrayList<>();
- if(distributionStatusMapByConsumer.get(key) != null){
- list = distributionStatusMapByConsumer.get(key);
- list.add(distributionListElement);
- distributionStatusMapByConsumer.put(key, list);
- }else{
- list.add(distributionListElement);
- distributionStatusMapByConsumer.put(key, list);
- }
-
- }
- return distributionStatusMapByConsumer;
- }
-
-
- /**
- * @param pair
- * @return consumer Status map: if map is empty - all consumers successes download and deploy the artifacts,
- * else - return failed consumer status per url
- */
- public static Pair<Boolean, Map<String, List<String>>> verifyDistributionStatus(Map<String, List<DistributionMonitorObject>> map){
-
- Map<String, List<String>> consumerStatusMap = new HashMap<>();
- List<Boolean> flag = new ArrayList<>();
- for (Entry<String, List<DistributionMonitorObject>> distributionMonitor : map.entrySet()){
- int notifiedCount = 0, downloadCount = 0, deployCount = 0;
- List<String> failedList = new ArrayList<>();
- List<DistributionMonitorObject> listValue = distributionMonitor.getValue();
- for(DistributionMonitorObject distributionStatus : listValue){
- String status = distributionStatus.getStatus();
- switch (status) {
- case "NOTIFIED": notifiedCount++;
- break;
- case "NOT_NOTIFIED":
- break;
- case "DOWNLOAD_OK": downloadCount++;
- break;
- case "DEPLOY_OK": deployCount++;
- break;
- default:
- failedList.add("Url " + distributionStatus.getUrl() + " failed with status " + distributionStatus.getStatus());
- break;
- }
- }
- if((notifiedCount != downloadCount || notifiedCount != deployCount) && notifiedCount != 0){
- consumerStatusMap.put(distributionMonitor.getKey(), failedList);
- flag.add(false);
- }
- if(notifiedCount == 0){
- flag.add(true);
- }
- }
-
- if(!flag.contains(false)){
- return Pair.create(true, consumerStatusMap);
- }else{
- return Pair.create(false, consumerStatusMap);
- }
-
- }
-
-
-
- }
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/ReqCap.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/ReqCap.java
deleted file mode 100644
index 55cc748e99..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/ReqCap.java
+++ /dev/null
@@ -1,609 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils;
-
-import org.apache.commons.lang3.tuple.ImmutablePair;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.*;
-import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ComponentReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.*;
-import org.testng.Assert;
-
-import java.io.IOException;
-import java.util.*;
-import java.util.Map.Entry;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-
-import static org.testng.AssertJUnit.*;
-
-public class ReqCap {
-
- public static Map<String, List<CapabilityDefinition>> expectedContainerCapabilities;
- public static Map<String, List<RequirementDefinition>> expectedContainerRequirements;
- public static Map<String, RequirementDefinition> removedRequirements;
- public static Map<String, ImmutablePair<Map<String, List<CapabilityDefinition>>, Map<String, List<RequirementDefinition>>>> expectedContInstReqCap;
-
- public static void verifyVFReqCap(String componentId) throws Exception {
- RestResponse restResponse = ResourceRestUtils.getResource(componentId);
- Resource resource = ResponseParser.parseToObject(restResponse.getResponse(), Resource.class);
- verifyReqCap(resource);
- }
-
- public static void verifyServiceReqCap(String componentId, User sdncDesignerDetails) throws Exception {
- RestResponse restResponse = ServiceRestUtils.getService(componentId, sdncDesignerDetails);
- Service service = ResponseParser.parseToObject(restResponse.getResponse(), Service.class);
- verifyReqCap(service);
- }
-
- public static void verifyProductReqCap(String componentId, User sdncPsDetails1) throws Exception {
- RestResponse restResponse = ProductRestUtils.getProduct(componentId, sdncPsDetails1.getUserId());
- Product product = ResponseParser.parseToObject(restResponse.getResponse(), Product.class);
- verifyReqCap(product);
- }
-
- public static void verifyReqCap(Component actualComponent) {
- verifyContainerReqCap(actualComponent);
- verifyCompInstReqCap(actualComponent);
- }
-
- public RestResponse changeServiceInstanceVersion(String componentUniqueId, String serviceInstanceToReplaceUniqueId,
- String serviceUniqueId, User sdncModifierDetails, ComponentTypeEnum componentType, boolean isHighestLevel)
- throws Exception {
- RestResponse changeResourceInstanceVersion = ProductRestUtils.changeServiceInstanceVersion(componentUniqueId,
- serviceInstanceToReplaceUniqueId, serviceUniqueId, sdncModifierDetails, componentType);
- if (changeResourceInstanceVersion.getErrorCode().equals(BaseRestUtils.STATUS_CODE_SUCCESS) && isHighestLevel) {
- /*
- * // Add RI Capabilities and Requirements to expected MAP -->
- * expectedVfCapabilities and expectedVfRequirements
- *
- * ComponentInstance componentInstance =
- * ResponseParser.parseToObjectUsingMapper(
- * changeResourceInstanceVersion.getResponse(),
- * ComponentInstance.class);
- * addCompInstReqCapToExpected(componentInstance, componentType);
- */
- }
- return changeResourceInstanceVersion;
- }
-
- public static void updateExpectedReqCapAfterChangeLifecycleState(String oldContainerUniqueIdToReplace,
- String newContainerUniqueId) {
-
- // Update of container req/cap
-
- Set<String> compInstKeysToChange = new HashSet<>();
-
- for (String expKey : expectedContainerCapabilities.keySet()) {
- List<CapabilityDefinition> expCapList = expectedContainerCapabilities.get(expKey);
- for (CapabilityDefinition cap : expCapList) {
- String ownerId = cap.getOwnerId();
-
- if (ownerId.contains(oldContainerUniqueIdToReplace)) {
- compInstKeysToChange.add(ownerId);
- cap.setOwnerId(cap.getOwnerId().replaceAll(oldContainerUniqueIdToReplace, newContainerUniqueId));
- }
- }
- }
-
- for (String expKey : expectedContainerRequirements.keySet()) {
- List<RequirementDefinition> expCapList = expectedContainerRequirements.get(expKey);
- for (RequirementDefinition cap : expCapList) {
- String ownerId = cap.getOwnerId();
- if (ownerId.contains(oldContainerUniqueIdToReplace)) {
- compInstKeysToChange.add(ownerId);
- cap.setOwnerId(cap.getOwnerId().replaceAll(oldContainerUniqueIdToReplace, newContainerUniqueId));
- }
- }
- }
-
- // Update of internal comp instances req/cap
- for (String oldKey : compInstKeysToChange) {
- ImmutablePair<Map<String, List<CapabilityDefinition>>, Map<String, List<RequirementDefinition>>> immutablePair = expectedContInstReqCap
- .get(oldKey);
- if (immutablePair != null) {
- expectedContInstReqCap.remove(oldKey);
- String newKey = oldKey.replaceAll(oldContainerUniqueIdToReplace, newContainerUniqueId);
- expectedContInstReqCap.put(newKey, immutablePair);
- }
- }
- }
-
- private static void verifyCompInstReqCap(Component actualComponent) {
- List<ComponentInstance> componentInstances = actualComponent.getComponentInstances();
- if (componentInstances != null) {
- assertEquals(expectedContInstReqCap.size(), componentInstances.size());
- for (ComponentInstance compInst : componentInstances) {
- String uniqueId = compInst.getUniqueId();
- // System.out.println("Verifying req/cap of component instance
- // "+ uniqueId);
- Map<String, List<RequirementDefinition>> actualCompInstReq = compInst.getRequirements();
- if (actualCompInstReq == null) {
- actualCompInstReq = new HashMap<>();
- }
- Map<String, List<CapabilityDefinition>> actualCompInstCap = compInst.getCapabilities();
- if (actualCompInstCap == null) {
- actualCompInstCap = new HashMap<>();
- }
- ImmutablePair<Map<String, List<CapabilityDefinition>>, Map<String, List<RequirementDefinition>>> expReqCap = expectedContInstReqCap
- .get(uniqueId);
- assertNotNull(expReqCap);
- // System.out.println("expected instance requirements:
- // "+expReqCap.right);
- // System.out.println("expected instance capabilities:
- // "+expReqCap.left);
- // System.out.println("actual instance requirements:
- // "+actualCompInstReq);
- // System.out.println("actual instance capabilities:
- // "+actualCompInstCap);
-
- // REQ comparison
- compareReqCapMaps(expReqCap.right, actualCompInstReq);
-
- // CAP comparison
- compareReqCapMaps(expReqCap.left, actualCompInstCap);
- }
-
- } else {
- assertTrue(expectedContInstReqCap.isEmpty());
- }
- }
-
- private static void verifyContainerReqCap(Component actualComponent) {
- Map<String, List<RequirementDefinition>> actualContainerRequirements = actualComponent.getRequirements();
- if (actualContainerRequirements == null) {
- actualContainerRequirements = new HashMap<>();
- }
- Map<String, List<CapabilityDefinition>> actualContainerCapabilities = actualComponent.getCapabilities();
- if (actualContainerCapabilities == null) {
- actualContainerCapabilities = new HashMap<>();
- }
- // System.out.println("Verifying req/cap of container component "+
- // actualComponent.getUniqueId());
- // System.out.println("expected container requirements:
- // "+expectedContainerRequirements);
- // System.out.println("expected container capabilities:
- // "+expectedContainerCapabilities);
- // System.out.println("actual container requirements:
- // "+actualContainerRequirements);
- // System.out.println("actual container capabilities:
- // "+actualContainerCapabilities);
-
- // REQ comparison
- compareReqCapMaps(expectedContainerRequirements, actualContainerRequirements);
-
- // CAP comparison
- compareReqCapMaps(expectedContainerCapabilities, actualContainerCapabilities);
- }
-
- private static <T> void compareReqCapMaps(Map<String, List<T>> expectedMap, Map<String, List<T>> actualMap) {
- assertEquals(expectedMap.size(), actualMap.size());
- for (String expKey : expectedMap.keySet()) {
- List<?> expCapList = expectedMap.get(expKey);
- List<?> actCapList = actualMap.get(expKey);
- assertEquals(expCapList.size(), actCapList.size());
- assertEquals(new HashSet<>(expCapList), new HashSet<>(actCapList));
- }
- }
-
- public static void addCompInstReqCapToExpected(ComponentInstance componentInstance,
- ComponentTypeEnum containerComponentType, User sdncDesignerDetails) throws Exception {
-
- sdncDesignerDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- String uniqueId = componentInstance.getUniqueId();
- String name = componentInstance.getName();
- String originComponentId = componentInstance.getComponentUid();
- RestResponse getResponse = null;
- ComponentTypeEnum compInstType = getCompInstTypeByContainerType(containerComponentType);
- Component component = null;
- if (compInstType == ComponentTypeEnum.RESOURCE) {
- getResponse = ResourceRestUtils.getResource(sdncDesignerDetails, originComponentId);
- ResourceRestUtils.checkSuccess(getResponse);
- component = ResponseParser.parseToObjectUsingMapper(getResponse.getResponse(), Resource.class);
- } else if (compInstType == ComponentTypeEnum.SERVICE) {
- getResponse = ServiceRestUtils.getService(originComponentId, sdncDesignerDetails);
- ResourceRestUtils.checkSuccess(getResponse);
- component = ResponseParser.parseToObjectUsingMapper(getResponse.getResponse(), Service.class);
- } else {
- Assert.fail("Unsupported type - " + containerComponentType);
- }
-
- Map<String, List<RequirementDefinition>> resourceRequirements = component.getRequirements();
- if (resourceRequirements == null) {
- resourceRequirements = new HashMap<>();
- }
-
- Function<Entry<String, List<RequirementDefinition>>, List<RequirementDefinition>> requirementDefinitionMapper = e -> new ArrayList<>(e.getValue().stream().map(item -> new RequirementDefinition(item)).collect(Collectors.toList()));
- Map<String, List<RequirementDefinition>> reqCopy = resourceRequirements.entrySet().stream().collect(Collectors.toMap(e -> e.getKey(), requirementDefinitionMapper));
-
- Map<String, List<CapabilityDefinition>> resourceCapabilities = component.getCapabilities();
- if (resourceCapabilities == null) {
- resourceCapabilities = new HashMap<>();
- }
-
- Function<Entry<String, List<CapabilityDefinition>>, List<CapabilityDefinition>> capabilityDefinitionMapper = e -> new ArrayList<>(e.getValue().stream().map(item -> new CapabilityDefinition(item)).collect(Collectors.toList()));
- Map<String, List<CapabilityDefinition>> capCopy = resourceCapabilities.entrySet().stream().collect(Collectors.toMap(e -> e.getKey(), capabilityDefinitionMapper));
-
- setupContainerExpectedReqCap(uniqueId, name, resourceRequirements, resourceCapabilities);
- if (component.getComponentType().equals(ComponentTypeEnum.RESOURCE)
- && ((Resource) component).getResourceType() != ResourceTypeEnum.VF) {
- setupConstInstExpectedReqCap(uniqueId, name, reqCopy, capCopy);
- }
-
- // adding entry for expected componentInstance
- ImmutablePair<Map<String, List<CapabilityDefinition>>, Map<String, List<RequirementDefinition>>> compInstReqCapPair = new ImmutablePair<Map<String, List<CapabilityDefinition>>, Map<String, List<RequirementDefinition>>>(
- capCopy, reqCopy);
- expectedContInstReqCap.put(uniqueId, compInstReqCapPair);
- }
-
- private static void setupContainerExpectedReqCap(String uniqueId, String name,
- Map<String, List<RequirementDefinition>> componentRequirements,
- Map<String, List<CapabilityDefinition>> componentCapabilities) {
- for (Entry<String, List<RequirementDefinition>> resReq : componentRequirements.entrySet()) {
- List<RequirementDefinition> reqListToAdd = resReq.getValue();
- for (RequirementDefinition requirementDefinition : reqListToAdd) {
- requirementDefinition.setOwnerId(uniqueId);
- requirementDefinition.setOwnerName(name);
- }
- List<RequirementDefinition> expectedReqList = expectedContainerRequirements.get(resReq.getKey());
- if (expectedReqList == null) {
- expectedReqList = reqListToAdd;
- } else {
- expectedReqList.addAll(reqListToAdd);
- }
- expectedContainerRequirements.put(resReq.getKey(), expectedReqList);
- }
-
- for (Entry<String, List<CapabilityDefinition>> resCap : componentCapabilities.entrySet()) {
- List<CapabilityDefinition> capListToAdd = resCap.getValue();
- for (CapabilityDefinition capDefinition : capListToAdd) {
- capDefinition.setOwnerId(uniqueId);
- capDefinition.setOwnerName(name);
- }
- List<CapabilityDefinition> expectedCapList = expectedContainerCapabilities.get(resCap.getKey());
- if (expectedCapList == null) {
- expectedCapList = capListToAdd;
- } else {
- expectedCapList.addAll(capListToAdd);
- }
- expectedContainerCapabilities.put(resCap.getKey(), expectedCapList);
- }
- }
-
- private static void setupConstInstExpectedReqCap(String uniqueId, String name,
- Map<String, List<RequirementDefinition>> componentRequirements,
- Map<String, List<CapabilityDefinition>> componentCapabilities) {
- for (Entry<String, List<RequirementDefinition>> resReq : componentRequirements.entrySet()) {
- List<RequirementDefinition> reqListToAdd = resReq.getValue();
- for (RequirementDefinition requirementDefinition : reqListToAdd) {
- requirementDefinition.setOwnerId(uniqueId);
- requirementDefinition.setOwnerName(name);
- }
- }
-
- for (Entry<String, List<CapabilityDefinition>> resCap : componentCapabilities.entrySet()) {
- List<CapabilityDefinition> capListToAdd = resCap.getValue();
- for (CapabilityDefinition capDefinition : capListToAdd) {
- capDefinition.setOwnerId(uniqueId);
- capDefinition.setOwnerName(name);
- }
- }
- }
-
- private static ComponentTypeEnum getCompInstTypeByContainerType(ComponentTypeEnum componentType) {
- switch (componentType) {
- case RESOURCE:
- return ComponentTypeEnum.RESOURCE;
- case SERVICE:
- return ComponentTypeEnum.RESOURCE;
- case PRODUCT:
- return ComponentTypeEnum.SERVICE;
- default:
- break;
- }
- return null;
- }
-
- public static void deleteCompInstReqCapFromExpected(String componentInstanceId) {
- List<String> entriesRequirementsToRemove = new ArrayList<>();
- List<String> entriesCapabilitiesToRemove = new ArrayList<>();
- for (Entry<String, List<RequirementDefinition>> reqEntry : expectedContainerRequirements.entrySet()) {
- List<RequirementDefinition> reqList = reqEntry.getValue();
- List<RequirementDefinition> reqListToDelete = new ArrayList<>();
- for (RequirementDefinition requirementDefinition : reqList) {
- if (requirementDefinition.getOwnerId().equals(componentInstanceId)) {
- reqListToDelete.add(requirementDefinition);
- }
- }
- reqList.removeAll(reqListToDelete);
- if (reqList.isEmpty()) {
- entriesRequirementsToRemove.add(reqEntry.getKey());
- }
- }
-
- for (String ekey : entriesRequirementsToRemove) {
- expectedContainerRequirements.remove(ekey);
- }
-
- for (Entry<String, List<CapabilityDefinition>> capEntry : expectedContainerCapabilities.entrySet()) {
- List<CapabilityDefinition> capList = capEntry.getValue();
- List<CapabilityDefinition> capListToDelete = new ArrayList<>();
- for (CapabilityDefinition capabilityDefinition : capList) {
- if (capabilityDefinition.getOwnerId().equals(componentInstanceId)) {
- capListToDelete.add(capabilityDefinition);
- }
- }
- capList.removeAll(capListToDelete);
- if (capList.isEmpty()) {
- entriesCapabilitiesToRemove.add(capEntry.getKey());
- }
- }
- for (String ekey : entriesCapabilitiesToRemove) {
- expectedContainerCapabilities.remove(ekey);
- }
-
- expectedContInstReqCap.remove(componentInstanceId);
-
- }
-
- // Automatically updates the expected req/cap of the container
- public static RestResponse createAtomicInstanceForVF(Resource containerDetails, Resource compInstOriginDetails,
- User modifier) throws Exception {
- return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.RESOURCE,
- true);
- }
-
- // Automatically updates the expected req/cap of the container
- public static RestResponse createAtomicInstanceForService(Service containerDetails, Resource compInstOriginDetails,
- User modifier) throws Exception {
- return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.SERVICE,
- true);
- }
-
- // Automatically updates the expected req/cap of the container
- public static RestResponse createVFInstance(Service containerDetails, Resource compInstOriginDetails, User modifier)
- throws Exception {
- return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.SERVICE,
- true);
- }
-
- // Automatically updates the expected req/cap of the container
- public static RestResponse createServiceInstance(Product containerDetails, Service compInstOriginDetails,
- User modifier) throws Exception {
- return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.PRODUCT,
- true);
- }
-
- // Automatically updates the expected req/cap of the container
- public static RestResponse deleteAtomicInstanceForVF(String compInstUniqueId, Resource containerDetails,
- User modifier) throws IOException, Exception {
- return deleteComponentInstance(compInstUniqueId, containerDetails, modifier, ComponentTypeEnum.RESOURCE, true);
- }
-
- // Automatically updates the expected req/cap of the container
- public static RestResponse deleteAtomicInstanceForService(String compInstUniqueId, Service containerDetails,
- User modifier) throws IOException, Exception {
- return deleteComponentInstance(compInstUniqueId, containerDetails, modifier, ComponentTypeEnum.SERVICE, true);
- }
-
- // Automatically updates the expected req/cap of the container
- public static RestResponse deleteVFInstance(String compInstUniqueId, Service containerDetails, User modifier)
- throws IOException, Exception {
- return deleteComponentInstance(compInstUniqueId, containerDetails, modifier, ComponentTypeEnum.SERVICE, true);
-
- }
-
- // Automatically updates the expected req/cap of the container
- public static RestResponse deleteServiceInstance(String compInstUniqueId, Product containerDetails, User modifier)
- throws IOException, Exception {
- return deleteComponentInstance(compInstUniqueId, containerDetails, modifier, ComponentTypeEnum.PRODUCT, true);
- }
-
- // Setup of lower components - Doesn't affect req/cap of the container (for
- // example, setup of VF for testing a Product)
- public static RestResponse createAtomicInstanceForVFDuringSetup(Resource containerDetails,
- Resource compInstOriginDetails, User modifier) throws Exception {
- return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.RESOURCE,
- false);
- }
-
- // Setup of lower components - Doesn't affect req/cap of the container (for
- // example, setup of VF for testing a Product)
- public static RestResponse createAtomicInstanceForServiceDuringSetup(Service containerDetails,
- Resource compInstOriginDetails, User modifier) throws Exception {
- return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.SERVICE,
- false);
- }
-
- // Setup of lower components - Doesn't affect req/cap of the container (for
- // example, setup of VF for testing a Product)
- public static RestResponse createVFInstanceDuringSetup(Service containerDetails, Resource compInstOriginDetails,
- User modifier) throws Exception {
- return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.SERVICE,
- false);
- }
-
- // Setup of lower components - Doesn't affect req/cap of the container (for
- // example, setup of VF for testing a Product)
- public static RestResponse createServiceInstanceDuringSetup(Product containerDetails, Service compInstOriginDetails,
- User modifier) throws Exception {
- return createComponentInstance(containerDetails, compInstOriginDetails, modifier, ComponentTypeEnum.PRODUCT,
- false);
- }
-
- // Setup of lower components - Doesn't affect req/cap of the container (for
- // example, setup of VF for testing a Product)
- public static RestResponse deleteAtomicInstanceForVFDuringSetup(String compInstUniqueId, Resource containerDetails,
- User modifier) throws IOException, Exception {
- return deleteComponentInstance(compInstUniqueId, containerDetails, modifier, ComponentTypeEnum.RESOURCE, false);
- }
-
- // Setup of lower components - Doesn't affect req/cap of the container (for
- // example, setup of VF for testing a Product)
- public static RestResponse deleteAtomicInstanceForServiceDuringSetup(String compInstUniqueId,
- Service containerDetails, User modifier) throws IOException, Exception {
- return deleteComponentInstance(compInstUniqueId, containerDetails, modifier, ComponentTypeEnum.SERVICE, false);
- }
-
- // Setup of lower components - Doesn't affect req/cap of the container (for
- // example, setup of VF for testing a Product)
- public static RestResponse deleteVFInstanceDuringSetup(String compInstUniqueId, Service containerDetails,
- User modifier) throws IOException, Exception {
- return deleteComponentInstance(compInstUniqueId, containerDetails, modifier, ComponentTypeEnum.SERVICE, false);
-
- }
-
- // Setup of lower components - Doesn't affect req/cap of the container (for
- // example, setup of VF for testing a Product)
- public static RestResponse deleteServiceInstanceDuringSetup(String compInstUniqueId, Product containerDetails,
- User modifier) throws IOException, Exception {
- return deleteComponentInstance(compInstUniqueId, containerDetails, modifier, ComponentTypeEnum.PRODUCT, false);
- }
-
- public static Component getComponentAndValidateRIs(Component componentDetails, int numberOfRIs,
- int numberOfRelations, User sdncAdminDetails) throws IOException, Exception {
-
- RestResponse getResponse = null;
- Component component = null;
- if (componentDetails instanceof Resource) {
- getResponse = ResourceRestUtils.getResource(sdncAdminDetails, componentDetails.getUniqueId());
- component = ResponseParser.parseToObjectUsingMapper(getResponse.getResponse(), Resource.class);
- } else if (componentDetails instanceof Service) {
- getResponse = ServiceRestUtils.getService((componentDetails.getUniqueId()), sdncAdminDetails);
- component = ResponseParser.parseToObjectUsingMapper(getResponse.getResponse(), Service.class);
- } else if (componentDetails instanceof Product) {
- getResponse = ProductRestUtils.getProduct(componentDetails.getUniqueId(), sdncAdminDetails.getUserId());
- component = ResponseParser.parseToObjectUsingMapper(getResponse.getResponse(), Product.class);
- } else {
- Assert.fail("Unsupported type of componentDetails - " + componentDetails.getClass().getSimpleName());
- }
- ResourceRestUtils.checkSuccess(getResponse);
- int numberOfActualRIs = component.getComponentInstances() != null ? component.getComponentInstances().size()
- : 0;
- int numberOfActualRelations = component.getComponentInstancesRelations() != null
- ? component.getComponentInstancesRelations().size() : 0;
- assertEquals("Check number of RIs meet the expected number", numberOfRIs, numberOfActualRIs);
- assertEquals("Check number of RI relations meet the expected number", numberOfRelations,
- numberOfActualRelations);
- verifyReqCap(component);
-
- return component;
- }
-
- public static void getComponentAndValidateRIsAfterChangeLifecycleState(String oldComponentUniqueIdToReplace,
- Component componentDetails, int numOfRIs, int numOfRelations, User sdncAdminDetails)
- throws IOException, Exception {
- updateExpectedReqCapAfterChangeLifecycleState(oldComponentUniqueIdToReplace, componentDetails.getUniqueId());
- getComponentAndValidateRIs(componentDetails, numOfRIs, numOfRelations, sdncAdminDetails);
- }
-
- private static RestResponse createComponentInstance(Component containerDetails, Component compInstOriginDetails,
- User modifier, ComponentTypeEnum containerComponentTypeEnum, boolean isHighestLevel)
- throws IOException, Exception {
- ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory
- .getComponentInstance(compInstOriginDetails);
- RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
- resourceInstanceReqDetails, modifier, containerDetails.getUniqueId(), containerComponentTypeEnum);
- if (createResourceInstanceResponse.getErrorCode().equals(BaseRestUtils.STATUS_CODE_CREATED) && isHighestLevel) {
- // Add RI Capabilities and Requirements to expected MAP -->
- // expectedVfCapabilities and expectedVfRequirements
- ComponentInstance componentInstance = ResponseParser
- .parseToObjectUsingMapper(createResourceInstanceResponse.getResponse(), ComponentInstance.class);
- addCompInstReqCapToExpected(componentInstance, containerComponentTypeEnum, modifier);
- }
- return createResourceInstanceResponse;
- }
-
- private static RestResponse deleteComponentInstance(String compInstUniqueId, Component containerDetails,
- User modifier, ComponentTypeEnum componentTypeEnum, boolean isHighestLevel) throws Exception {
- RestResponse deleteResourceInstanceResponse = ComponentInstanceRestUtils.deleteComponentInstance(modifier,
- containerDetails.getUniqueId(), compInstUniqueId, componentTypeEnum);
- if (deleteResourceInstanceResponse.getErrorCode().equals(BaseRestUtils.STATUS_CODE_DELETE) && isHighestLevel) {
- deleteCompInstReqCapFromExpected(compInstUniqueId);
- }
- return deleteResourceInstanceResponse;
- }
-
- public static RestResponse associateComponentInstancesForService(RequirementCapabilityRelDef requirementDef,
- ComponentReqDetails containerDetails, User user) throws IOException {
-
- RestResponse associateInstances = ComponentInstanceRestUtils.associateInstances(requirementDef, user,
- containerDetails.getUniqueId(), ComponentTypeEnum.SERVICE);
- ResourceRestUtils.checkSuccess(associateInstances);
- deleteAssociatedFromExpected(requirementDef);
- return associateInstances;
- }
-
- private static void deleteAssociatedFromExpected(RequirementCapabilityRelDef requirementDef) {
- // removing from requirements
- RelationshipInfo relationship = requirementDef.getRelationships().get(0).getRelation();
- String type = relationship.getRelationship().getType();
- String fromId = requirementDef.getFromNode();
- List<RequirementDefinition> reqList = expectedContainerRequirements.get(type);
- RequirementDefinition toDelete = null;
- if (reqList != null) {
- for (RequirementDefinition reqDef : reqList) {
- if (reqDef.getOwnerId().equals(fromId)) {
- toDelete = reqDef;
- }
- }
- if (toDelete != null) {
- reqList.remove(toDelete);
- if (reqList.isEmpty()) {
- expectedContainerRequirements.remove(type);
- }
- removedRequirements.put(toDelete.getCapability() + " " + toDelete.getOwnerId(), toDelete);
- }
- }
- }
-
- public static void dissociateComponentInstancesForService(RequirementCapabilityRelDef requirementDef,
- ComponentReqDetails containerDetails, User user) throws IOException {
-
- RestResponse dissociateInstances = ComponentInstanceRestUtils.dissociateInstances(requirementDef, user,
- containerDetails.getUniqueId(), ComponentTypeEnum.SERVICE);
- ResourceRestUtils.checkSuccess(dissociateInstances);
- addDissociatedToExpected(requirementDef);
- }
-
- private static void addDissociatedToExpected(RequirementCapabilityRelDef requirementDef) {
- // adding to requirements
- RelationshipInfo relationship = requirementDef.getRelationships().get(0).getRelation();
- String type = relationship.getRelationship().getType();
- String fromId = requirementDef.getFromNode();
- String key = type + " " + fromId;
- RequirementDefinition requirementDefinition = removedRequirements.get(key);
- if (requirementDefinition != null) {
- List<RequirementDefinition> reqList = expectedContainerRequirements.get(type);
- if (reqList == null) {
- reqList = new ArrayList<>();
- expectedContainerRequirements.put(type, reqList);
- }
- reqList.add(requirementDefinition);
- }
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/ToscaParserUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/ToscaParserUtils.java
deleted file mode 100644
index b7eaf99724..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/ToscaParserUtils.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils;
-
-import static org.testng.AssertJUnit.assertNotNull;
-import static org.testng.AssertJUnit.assertTrue;
-import static org.testng.AssertJUnit.fail;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.util.Map;
-import org.apache.commons.collections4.MapUtils;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaDefinition;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaGroupsTopologyTemplateDefinition;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaImportsDefinition;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaInputsTopologyTemplateDefinition;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaMetadataDefinition;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaNodeTemplatesTopologyTemplateDefinition;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaParameterConstants;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaSubstitutionMappingsDefinition;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaTopologyTemplateDefinition;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ImportRestUtils;
-import org.openecomp.sdc.common.http.client.api.HttpResponse;
-import org.openecomp.sdc.common.zip.ZipUtils;
-import org.openecomp.sdc.common.zip.exception.ZipException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.yaml.snakeyaml.Yaml;
-import org.yaml.snakeyaml.constructor.Constructor;
-import org.yaml.snakeyaml.introspector.PropertyUtils;
-
-public class ToscaParserUtils {
-
- private static Logger log = LoggerFactory.getLogger(ToscaParserUtils.class.getName());
-
-
- /**method get csarUUID and send GET API request toward BE
- * @param csarUUID
- * @return
- * @throws Exception
- */
- public static ToscaDefinition parseToscaYamlToJavaObjectByCsarUuid(String csarUUID) throws Exception {
-
- ToscaDefinition toscaDefinition = null;
- String TOSCAMetaLocation = ToscaParameterConstants.TOSCA_META_PATH;
- Map<?, ?> map = getToscaYamlMap(csarUUID, TOSCAMetaLocation);
- assertNotNull("Tosca Entry-Definitions is null", map);
- if (map != null) {
- File definitionYamlLocation = (File) map.get(ToscaParameterConstants.ENTRY_DEFINITION);
- toscaDefinition = parseToscaYamlToJavaObject(definitionYamlLocation);
- }
- return toscaDefinition;
-
- }
-
- /**method read csar from location
- * @param csarNameLocation - full path with csar name
- * @return
- * @throws Exception
- */
- public static ToscaDefinition parseToscaMainYamlToJavaObjectByCsarLocation(File csarNameLocation) throws Exception {
-
- ToscaDefinition toscaDefinition = null;
- String TOSCAMetaLocation = ToscaParameterConstants.TOSCA_META_PATH;
-// read file location of main yaml file(location+name) from TOSCA.meta file by
- Map<?, ?> map = getToscaYamlMap(csarNameLocation, TOSCAMetaLocation);
-
- assertNotNull("Tosca Entry-Definitions is null", map);
-
- String definitionYamlLocation = (String) map.get(ToscaParameterConstants.ENTRY_DEFINITION);
- String csarPayload = getYamlPayloadFromCsar(csarNameLocation, definitionYamlLocation);
- toscaDefinition = parseToscaYamlPayloadToJavaObject(csarPayload);
- return toscaDefinition;
-
- }
-
- public static ToscaDefinition parseToscaAnyYamlToJavaObjectByCsarLocation(File csarNameLocation, String yamlLocation) throws Exception {
-
- ToscaDefinition toscaDefinition = null;
- String csarPayload = getYamlPayloadFromCsar(csarNameLocation, yamlLocation);
- toscaDefinition = parseToscaYamlPayloadToJavaObject(csarPayload);
- return toscaDefinition;
-
- }
-
- public static ToscaDefinition parseToscaYamlToJavaObject(File path) throws Exception {
-
- ToscaDefinition toscaDefinition = null;
-
-// File path = new File("C:/Data/D2.0/TOSCA_Ex/Definitions/tosca_definition_version.yaml");
- FileInputStream fis = null;
- try {
- try (FileInputStream fileInputStream = fis = new FileInputStream(path)) {
- }
-
- } catch (Exception e) {
- System.out.println("Exception: " + e);
- }
-
- Constructor constructor = initToscaDefinitionObject();
-
- Yaml yaml = new Yaml(constructor);
- try {
- toscaDefinition = (ToscaDefinition) yaml.load(fis);
- } catch (Exception e) {
- log.debug("Failed to parse tosca yaml file");
- System.out.println("Exception: " + e);
- } finally {
- fis.close();
- }
- return toscaDefinition;
-
- }
-
- public static ToscaDefinition parseToscaYamlPayloadToJavaObject(String payload){
-
- ToscaDefinition toscaDefinition = null;
- Constructor constructor = initToscaDefinitionObject();
-
- Yaml yaml = new Yaml(constructor);
- try {
- toscaDefinition = (ToscaDefinition) yaml.load(payload);
- } catch (Exception e) {
- log.debug("Failed to parse tosca yaml file", e);
- fail("Exception: " + e);
- }
- return toscaDefinition;
-
- }
-
-
- public static Constructor initToscaDefinitionObject() {
- Constructor toscaStructure = new Constructor(ToscaDefinition.class);
- toscaStructure.addTypeDescription(ToscaDefinition.getTypeDescription());
- toscaStructure.addTypeDescription(ToscaTopologyTemplateDefinition.getTypeDescription());
- toscaStructure.addTypeDescription(ToscaNodeTemplatesTopologyTemplateDefinition.getTypeDescription());
- toscaStructure.addTypeDescription(ToscaGroupsTopologyTemplateDefinition.getTypeDescription());
- toscaStructure.addTypeDescription(ToscaSubstitutionMappingsDefinition.getTypeDescription());
- toscaStructure.addTypeDescription(ToscaImportsDefinition.getTypeDescription());
- toscaStructure.addTypeDescription(ToscaMetadataDefinition.getTypeDescription());
- toscaStructure.addTypeDescription(ToscaInputsTopologyTemplateDefinition.getTypeDescription());
-// Skip properties which are found in YAML, but not found in POJO
- PropertyUtils propertyUtils = new PropertyUtils();
- propertyUtils.setSkipMissingProperties(true);
- toscaStructure.setPropertyUtils(propertyUtils);
- return toscaStructure;
- }
-
- public static Map<?, ?> getToscaYamlMap(String csarUUID, String yamlFileLocation) throws Exception {
- String csarPayload = getCsarPayload(csarUUID, yamlFileLocation);
- if (csarPayload != null) {
- Yaml yaml = new Yaml();
- Map<?, ?> map = (Map<?, ?>) yaml.load(csarPayload);
- return map;
- }
- return null;
- }
-
- public static Map<?, ?> getToscaYamlMap(File csarPath, String yamlFileLocation) throws Exception {
- String csarPayload = getYamlPayloadFromCsar(csarPath, yamlFileLocation);
- if (csarPayload != null) {
- Yaml yaml = new Yaml();
- Map<?, ?> map = (Map<?, ?>) yaml.load(csarPayload);
- return map;
- }
- return null;
- }
-
-
- public static String getCsarPayload(String csarName, String yamlFileLocation) throws Exception {
-
- HttpResponse<byte []> csar = ImportRestUtils.getCsar(csarName, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- assertTrue("Return response code different from 200", csar.getStatusCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
- byte[] data = csar.getResponse();
- return getDataFromZipFileByBytes(yamlFileLocation, data);
-
- }
-
- public static String getYamlPayloadFromCsar(File csarName, String fileLocation) throws IOException, ZipException {
- Path path = csarName.toPath();
- byte[] data = Files.readAllBytes(path);
- return getDataFromZipFileByBytes(fileLocation, data);
- }
-
- /** method get file data from zip data by file location in the zip structure
- * @param fileLocation
- * @param data
- * @return
- */
- public static String getDataFromZipFileByBytes(String fileLocation, byte[] data) throws ZipException {
- if (data == null || data.length == 0) {
- return null;
- }
- final Map<String, byte[]> readZip = ZipUtils.readZip(data, false);
- if (MapUtils.isEmpty(readZip)) {
- return null;
- }
- byte[] artifactsBytes = readZip.get(fileLocation);
- return new String(artifactsBytes, StandardCharsets.UTF_8);
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/ToscaTypesDefinitionUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/ToscaTypesDefinitionUtils.java
deleted file mode 100644
index eab84ae563..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/ToscaTypesDefinitionUtils.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils;
-
-import org.openecomp.sdc.be.model.Component;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaAnnotationsTypesDefinition;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaParameterConstants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.yaml.snakeyaml.Yaml;
-import org.yaml.snakeyaml.constructor.Constructor;
-
-import static org.junit.Assert.assertNotNull;
-import static org.openecomp.sdc.ci.tests.utils.CsarParserUtils.downloadComponentCsar;
-import static org.openecomp.sdc.ci.tests.utils.ToscaParserUtils.getDataFromZipFileByBytes;
-import static org.testng.AssertJUnit.fail;
-
-public class ToscaTypesDefinitionUtils {
-
- private ToscaTypesDefinitionUtils() {
- }
-
- private static final String ANNOTATIONS_TYPE_PATH = ToscaParameterConstants.TOSCA_DEFINITION_PATH + "/annotations.yml";
- private static Logger log = LoggerFactory.getLogger(ToscaTypesDefinitionUtils.class);
-
- public static ToscaAnnotationsTypesDefinition getToscaAnnotationsFromCsar(Component csarOwner, User user) throws Exception {
- byte[] decodeBase64 = downloadComponentCsar(csarOwner, user);
- String dataFromZipFileByBytes = getDataFromZipFileByBytes(ANNOTATIONS_TYPE_PATH, decodeBase64);
- assertNotNull(dataFromZipFileByBytes);
- return parseToscaAnnotationsYml(dataFromZipFileByBytes);
- }
-
- private static ToscaAnnotationsTypesDefinition parseToscaAnnotationsYml(String payload){
- Constructor constructor = initToscaAnnotationDefObject();
- return (ToscaAnnotationsTypesDefinition) parseToscaYamlPayload(payload, constructor);
- }
-
- private static Object parseToscaYamlPayload(String payload, Constructor constructor) {
- Yaml yaml = new Yaml(constructor);
- try {
- return yaml.load(payload);
- } catch (Exception e) {
- log.debug("Failed to parse tosca yaml file", e);
- e.printStackTrace();
- fail("Failed to parse tosca yaml file");
- }
- return null;
- }
-
- private static Constructor initToscaAnnotationDefObject() {
- Constructor toscaStructure = new Constructor(ToscaAnnotationsTypesDefinition.class);
- toscaStructure.addTypeDescription(ToscaAnnotationsTypesDefinition.getTypeDescription());
- return toscaStructure;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/Utils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/Utils.java
deleted file mode 100644
index 73e99011c3..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/Utils.java
+++ /dev/null
@@ -1,751 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils;
-
-import com.google.gson.Gson;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.LogManager;
-import org.openecomp.sdc.be.model.Component;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
-import org.openecomp.sdc.ci.tests.tosca.model.ToscaMetadataFieldsPresentationEnum;
-import org.openecomp.sdc.common.api.ToscaNodeTypeInfo;
-import org.openecomp.sdc.common.api.YamlConstants;
-import org.yaml.snakeyaml.Yaml;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.concurrent.TimeUnit;
-
-import static org.testng.AssertJUnit.*;
-
-public final class Utils {
-
- Gson gson = new Gson();
-
- static Logger logger = LogManager.getLogger(Utils.class);
-
- String contentTypeHeaderData = "application/json";
- String acceptHeaderDate = "application/json";
-
- public Utils() {
- /*
- * super();
- *
- * StartTest.enableLogger(); logger =
- * Logger.getLogger(Utils.class.getName());
- */
-
- }
-
- // public String serviceTopologyPattern = "/topology/topology/%s";
- // public String serviceTopologyTemplatePattern =
- // "/topologytemplate/topologytemplate/%s";
- //
- // public String serviceTopologySearchPattern =
- // "topology/topology/_search?q=%s";
- // public String serviceTopologyTemplateSearchPattern =
- // "topologytemplate/topologytemplate/_search?q=%s";
- //
- // public ArtifactTypeEnum getFileTypeByExtension(String fileName) {
- //
- // String fileExtension = null;
- // if (fileName.matches("(.*)\\.(.*)")) {
- // System.out.println(fileName.substring(fileName.lastIndexOf(".") + 1));
- // fileExtension = fileName.substring(fileName.lastIndexOf(".") + 1);
- // }
- //
- // switch (fileExtension) {
- // case "sh":
- // return ArtifactTypeEnum.SHELL_SCRIPT;
- // case "png":
- // return ArtifactTypeEnum.ICON;
- // case "ppp":
- // return ArtifactTypeEnum.PUPPET;
- // case "yang":
- // return ArtifactTypeEnum.YANG;
- // default:
- // return ArtifactTypeEnum.UNKNOWN;
- // }
- //
- // }
- //
- // public ArrayList<String> getScriptList (List<UploadArtifactInfo>
- // artifactsList){
- //
- // ArrayList<String> scriptNameArray = new ArrayList<>();
- // if (artifactsList != null){
- // for (UploadArtifactInfo fileInArtifactsList : artifactsList){
- // String artifactFileName = fileInArtifactsList.getArtifactName();
- // ArtifactTypeEnum artifactFileType =
- // fileInArtifactsList.getArtifactType();
- // if (! artifactFileType.equals(ArtifactTypeEnum.ICON)){
- // scriptNameArray.add(artifactFileName);
- // }
- // continue;
- // }
- // return scriptNameArray;
- // }
- // return null;
- // }
- //
- //
- // public String getYamlFileLocation(File testResourcesPath) {
- // File[] files = testResourcesPath.listFiles();
- // if (files.length == 0){
- // return null;
- // }else{
- // for (int i = 0; i < files.length; i++){
- // if (files[i].isFile()){
- // return files[i].getAbsoluteFile().toString();
- // }
- // }
- // }
- // return null;
- // }
- //
- // public String readFileContentToString (String fileName) throws
- // IOException {
- //
- // Path path = Paths.get(fileName);
- // String stringFromFile = new String(Files.readAllBytes(path));
- // return stringFromFile;
- //
- //
- // }
- //
- @SuppressWarnings("unchecked")
- public ToscaNodeTypeInfo parseToscaNodeYaml(String fileContent) {
-
- ToscaNodeTypeInfo result = new ToscaNodeTypeInfo();
- Object templateVersion = null;
- Object templateName = null;
-
- if (fileContent != null) {
- Yaml yaml = new Yaml();
-
- Map<String, Object> yamlObject = (Map<String, Object>) yaml.load(fileContent);
-
- templateVersion = yamlObject.get(YamlConstants.TEMPLATE_VERSION);
- if (templateVersion != null) {
- result.setTemplateVersion(templateVersion.toString());
- }
- templateName = yamlObject.get(YamlConstants.TEMPLATE_NAME);
- if (templateName != null) {
- result.setTemplateName(templateName.toString());
- }
- Object nodeTypes = yamlObject.get(YamlConstants.NODE_TYPES);
-
- if (nodeTypes != null) {
- Map<String, Object> nodeTypesMap = (Map<String, Object>) nodeTypes;
- for (Entry<String, Object> entry : nodeTypesMap.entrySet()) {
-
- String nodeName = entry.getKey();
- if (nodeName != null) {
- result.setNodeName(nodeName);
- }
-
- break;
-
- }
- }
-
- }
-
- return result;
- }
-
- //
- //
- // public ArtifactsMetadata getArtifactsMetadata(String response){
- // ArtifactsMetadata artifactsMetadata = new ArtifactsMetadata();
- //
- // artifactsMetadata.setId(getJsonObjectValueByKey(response, "id"));
- // artifactsMetadata.setName(getJsonObjectValueByKey(response, "name"));
- // artifactsMetadata.setType(getJsonObjectValueByKey(response, "type"));
- //
- // artifactsMetadata.setCreator(getJsonObjectValueByKey(response,
- // "creator"));
- // artifactsMetadata.setCreationTime(getJsonObjectValueByKey(response,
- // "creationTime"));
- // artifactsMetadata.setLastUpdateTime(getJsonObjectValueByKey(response,
- // "lastUpdateTime"));
- // artifactsMetadata.setChecksum(getJsonObjectValueByKey(response,
- // "checksum"));
- // artifactsMetadata.setDescription(getJsonObjectValueByKey(response,
- // "description"));
- // artifactsMetadata.setLastUpdater(getJsonObjectValueByKey(response,
- // "lastUpdater"));
- //
- // return artifactsMetadata;
- // }
- //
- public static String getJsonObjectValueByKey(String metadata, String key) {
- JsonElement jelement = new JsonParser().parse(metadata);
-
- JsonObject jobject = jelement.getAsJsonObject();
- Object obj = jobject.get(key);
- if (obj == null) {
- return null;
- } else {
- String value;
- value = (String) jobject.get(key).getAsString();
- return value;
- }
- }
-
- public static Config getConfig() throws FileNotFoundException {
- Config config = Config.instance();
- return config;
- }
-
- public static Config getConfigHandleException() {
- Config config = null;
- try{
- config = Config.instance();
- }catch (Exception e){
- System.out.println("Configuration file not found. " + e);
- }
- return config;
- }
- // public void uploadNormativeTypes() throws IOException{
- // Config config = getConfig();
- // String[] normativeTypes = {"root", "compute", "blockStorage",
- // "softwareComponent", "DBMS", "database", "network", "objectStorage",
- // "webServer", "webApplication"};
- // for( String normativeType : normativeTypes ){
- // uploadComponent(config.getComponentsConfigDir()+File.separator+"normativeTypes"+File.separator+normativeType);
- // }
- //
- // }
- //
- // public void uploadApacheComponent() throws IOException{
- // Config config = getConfig();
- // uploadComponent(config.getComponentsConfigDir()+File.separator+"apache");
- // }
- //
- // public void uploadComponent(String componentDir) throws IOException{
- //
- // //*********************************************upload*************************************************************
- // Config config = getConfig();
- // ZipDirectory zipDirectory = new ZipDirectory();
- // System.out.println(config.getEsHost());
- //
- // List<UploadArtifactInfo> artifactsList = new
- // ArrayList<UploadArtifactInfo>();
- //
- //// read test resources and zip it as byte array
- // byte[] zippedAsByteArray = zipDirectory.zip(componentDir, artifactsList);
- //
- //// encode zipped directory using base64
- // String payload = Decoder.encode(zippedAsByteArray);
- //
- //// zip name build as testName with ".zip" extension
- // String payloadZipName = getPayloadZipName(componentDir);
- //
- //// build json
- // UploadResourceInfo resourceInfo = new UploadResourceInfo(payload,
- // payloadZipName, "description", "category/mycategory", null,
- // artifactsList);
- // String json = new Gson().toJson(resourceInfo);
- //
- //// calculate md5 on the content of json
- // String jsonMd5 =
- // org.apache.commons.codec.digest.DigestUtils.md5Hex(json);
- //
- //// encode the md5 to base64, sent as header in post http request
- // String encodedMd5 = Decoder.encode(jsonMd5.getBytes());
- //
- //// upload component to Elastic Search DB
- // String url = null;
- // HttpRequest http = new HttpRequest();
- //
- // url = String.format(Urls.UPLOAD_ZIP_URL, config.getCatalogFeHost(),
- // config.getCatalogFePort());
- //
- //// Prepare headers to post upload component request
- // HeaderData headerData = new HeaderData(encodedMd5, "application/json",
- // "att", "test", "testIvanovich", "RoyalSeal", "Far_Far_Away",
- // "getResourceArtifactListTest");
- //
- // MustHeaders headers = new MustHeaders(headerData);
- // System.out.println("headers:"+headers.getMap());
- //
- // RestResponse response = http.httpSendPost(url, json, headers.getMap());
- //
- // assertEquals("upload component failed with code " +
- // response.getErrorCode().intValue(),response.getErrorCode().intValue(),
- // 204);
- // }
- //
- // private String getPayloadZipName(String componentDir) {
- // String payloadName;
- // if( componentDir.contains( File.separator) ){
- // String delimiter = null;
- // if( File.separator.equals("\\")){
- // delimiter ="\\\\";
- // }
- // else{
- // delimiter = File.separator;
- // }
- // String[] split = componentDir.split(delimiter);
- // payloadName = split[split.length-1];
- // }
- // else{
- // payloadName = componentDir;
- // }
- // return payloadName+".zip";
- // }
- //
- //
- //
- // public List<UploadArtifactInfo> createArtifactsList(String srcDir) {
- //
- // List<UploadArtifactInfo> artifactsList = new
- // ArrayList<UploadArtifactInfo>();
- // File srcFile = new File(srcDir);
- // addFileToList(srcFile, artifactsList);
- //
- // return artifactsList;
- // }
- //
- // public void addFileToList(File srcFile, List<UploadArtifactInfo>
- // artifactsList) {
- //
- // File[] files = srcFile.listFiles();
- //
- // for (int i = 0; i < files.length; i++) {
- // // if the file is directory, use recursion
- // if (files[i].isDirectory()) {
- // addFileToList(files[i], artifactsList);
- // continue;
- // }
- //
- // String fileName = files[i].getName();
- // String artifactPath = fileName;
- //
- // if ( ! files[i].getName().matches("(.*)\\.y(?)ml($)")) {
- // UploadArtifactInfo uploadArtifactInfo = new UploadArtifactInfo();
- // uploadArtifactInfo.setArtifactName(files[i].getName());
- // String parent = files[i].getParent();
- //
- // if (parent != null) {
- // System.out.println(parent);
- // int lastSepartor = parent.lastIndexOf(File.separator);
- // if (lastSepartor > -1) {
- // String actualParent = parent.substring(lastSepartor + 1);
- // artifactPath = actualParent + "/" + artifactPath;
- // }
- // }
- //
- // uploadArtifactInfo.setArtifactPath(artifactPath);
- // uploadArtifactInfo.setArtifactType(getFileTypeByExtension(fileName));
- // uploadArtifactInfo.setArtifactDescription("description");
- // artifactsList.add(uploadArtifactInfo);
- //
- // System.out.println("artifact list: " + artifactsList);
- //
- // }
- //
- // }
- // }
- //
- //
- // public String buildArtifactListUrl (String nodesType, String
- // templateVersion, String artifactName) throws FileNotFoundException{
- // //"http://172.20.43.132/sdc2/v1/catalog/resources/tosca.nodes.Root/1.0.0.wd03-SNAPSHOT/artifacts/wxs_baseline_compare.sh"
- // Config config = getConfig();
- // return "\"http://" + config.getCatalogBeHost() + ":" +
- // config.getCatalogBePort() + "/sdc2/v1/catalog/resources/" +nodesType +
- // "/" + templateVersion + "/artifacts/" + artifactName +"\"";
- // }
- //
- //
- // public void addTopologyToES(String testFolder, String
- // serviceTopologyPattern) throws IOException{
- // Config config = getConfig();
- // String url = String.format(Urls.ES_URL, config.getEsHost(),
- // config.getEsPort()) + serviceTopologyPattern;
- // String sourceDir =
- // config.getResourceConfigDir()+File.separator+testFolder;
- // Path filePath = FileSystems.getDefault().getPath(sourceDir,
- // "topology.txt");
- // postFileContentsToUrl(url, filePath);
- // }
- //
- // public void addTopologyTemplateToES(String testFolder, String
- // serviceTopologyTemplatePattern) throws IOException{
- // Config config = getConfig();
- // String url = String.format(Urls.ES_URL, config.getEsHost(),
- // config.getEsPort()) + serviceTopologyTemplatePattern;
- // String sourceDir =
- // config.getResourceConfigDir()+File.separator+testFolder;
- // Path filePath = FileSystems.getDefault().getPath(sourceDir,
- // "topologyTemplate.txt");
- // postFileContentsToUrl(url, filePath);
- // }
- //
- //
- // public void postFileContentsToUrl(String url, Path filePath) throws
- // IOException {
- // HttpClientContext localContext = HttpClientContext.create();
- // CloseableHttpResponse response = null;
- //
- // byte[] fileContent = Files.readAllBytes(filePath);
- //
- // try(CloseableHttpClient httpClient = HttpClients.createDefault()){
- // HttpPost httpPost = new HttpPost(url);
- // StringEntity entity = new StringEntity(new String(fileContent) ,
- // ContentType.APPLICATION_JSON);
- // httpPost.setEntity(entity);
- // response = httpClient.execute(httpPost, localContext);
- //
- // }
- // finally{
- // response.close();
- // }
- //
- //
- // }
- //
- //
- //// public boolean isPatternInEsDb(String patternToSearch)throws
- // IOException{
- //// Config config = getConfig();
- //// String url = String.format(Urls.GET_SEARCH_DATA_FROM_ES,
- // config.getEsHost(), config.getEsPort(),patternToSearch);
- //// HttpRequest httpRequest = new HttpRequest();
- //// RestResponse restResponse = httpRequest.httpSendGet(url);
- //// if (restResponse.getErrorCode() == 200){
- //// return true;
- //// }
- //// if (restResponse.getErrorCode() == 404){
- //// return false;
- //// }
- ////
- //// return false;
- //// }
- //
- // public static RestResponse deleteAllDataFromEs() throws IOException{
- // return deleteFromEsDbByPattern("_all");
- // }
- //
-
- //
- // public List<String> buildIdArrayListByTypesIndex (String index, String
- // types) throws IOException{
- //
- // Config config = getConfig();
- // HttpRequest http = new HttpRequest();
- // RestResponse getResponce =
- // http.httpSendGet(String.format(Urls.GET_ID_LIST_BY_INDEX_FROM_ES,
- // config.getEsHost(), config.getEsPort(), index, types), null);
- //
- // List <String> idArray = new ArrayList<String>();
- //
- // JsonElement jelement = new JsonParser().parse(getResponce.getResponse());
- // JsonObject jobject = jelement.getAsJsonObject();
- // JsonObject hitsObject = (JsonObject) jobject.get("hits");
- // JsonArray hitsArray = (JsonArray) hitsObject.get("hits");
- // for (int i = 0; i < hitsArray.size(); i ++){
- // JsonObject idObject = (JsonObject) hitsArray.get(i);
- // String id = idObject.get("_id").toString();
- // id = id.replace("\"", "");
- // idArray.add(id);
- // }
- //
- // return idArray;
- // }
- //
- // public List<String> buildCategoriesTagsListFromJson(String
- // categoriesTagsJson){
- //
- // ArrayList<String> categoriesTagsArray = new ArrayList<>();
- // JsonElement jelement = new JsonParser().parse(categoriesTagsJson);
- // JsonArray jArray = jelement.getAsJsonArray();
- // for (int i = 0; i < jArray.size(); i ++){
- // JsonObject categoriesTagsObject = (JsonObject) jArray.get(i);
- // String categories = categoriesTagsObject.get("name").toString();
- // categoriesTagsArray.add(categories);
- // }
- //
- // return categoriesTagsArray;
- // }
- //
- // public ArrayList <String> getCategoriesFromDb() throws Exception{
- //
- // ArrayList<String> categoriesFromDbArrayList = new ArrayList<>();
- // RestResponse restResponse = new RestResponse();
- // String contentTypeHeaderData = "application/json";
- // String acceptHeaderDate = "application/json";
- //
- // Map<String, String> headersMap = new HashMap<String,String>();
- // headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(),contentTypeHeaderData);
- // headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
- //
- // HttpRequest httpRequest = new HttpRequest();
- // String url = String.format(Urls.QUERY_NEO4J,
- // Config.instance().getNeoHost(), Config.instance().getNeoPort());
- // String body = "{\"statements\" : [ { \"statement\" : \"MATCH
- // (category:category) return (category)\"} ]}";
- // restResponse = httpRequest.httpSendPostWithAuth(url, body, headersMap,
- // Config.instance().getNeoDBusername(),
- // Config.instance().getNeoDBpassword());
- //
- // if (restResponse.getResponse()==null){
- // return categoriesFromDbArrayList;
- // }else{
- // JsonElement jelement = new
- // JsonParser().parse(restResponse.getResponse());
- // JsonObject jobject = jelement.getAsJsonObject();
- // JsonArray resultsArray = (JsonArray) jobject.get("results");
- // JsonObject resObject = (JsonObject) resultsArray.get(0);
- // JsonArray dataArray = (JsonArray) resObject.get("data");
- // for (int i = 0; i < dataArray.size(); i ++){
- // JsonObject rowObject = (JsonObject) dataArray.get(i);
- // JsonArray rowArray = (JsonArray) rowObject.get("row");
- // JsonObject nameObject = (JsonObject) rowArray.get(0);
- // String name = nameObject.get("name").toString();
- //// name = name.replace("\"", "");
- // categoriesFromDbArrayList.add(name);
- // }
- //
- //
- // }
- //
- // return categoriesFromDbArrayList;
- // }
- //
- public static void compareArrayLists(List<String> actualArraylList, List<String> expectedArrayList,
- String message) {
-
- ArrayList<String> actual = new ArrayList<String>(actualArraylList);
- ArrayList<String> expected = new ArrayList<String>(expectedArrayList);
- // assertEquals(message + " count got by rest API not match to " +
- // message + " expected count", expected.size(),actual.size());
- expected.removeAll(actual);
- assertEquals(message + " content got by rest API not match to " + message + " actual content", 0,
- expected.size());
- }
-
- public static Object parseYamlConfig(String pattern) throws FileNotFoundException {
-
- Yaml yaml = new Yaml();
- Config config = getConfig();
- String configurationFile = config.getConfigurationFile();
- File file = new File(configurationFile);
- // File file = new
- // File("../catalog-be/src/main/resources/config/configuration.yaml");
- InputStream inputStream = new FileInputStream(file);
- Map<?, ?> map = (Map<?, ?>) yaml.load(inputStream);
- Object patternMap = (Object) map.get(pattern);
-
- return patternMap;
- }
-
- public static String getDepArtLabelFromConfig(ArtifactTypeEnum artifactTypeEnum) throws FileNotFoundException {
-
- @SuppressWarnings("unchecked")
- Map<String, Object> mapOfDepResArtTypesObjects = (Map<String, Object>) parseYamlConfig(
- "deploymentResourceArtifacts");
- for (Map.Entry<String, Object> iter : mapOfDepResArtTypesObjects.entrySet()) {
- if (iter.getValue().toString().contains(artifactTypeEnum.getType())) {
- return iter.getKey().toLowerCase();
- }
- }
-
- return "defaultLabelName";
- }
-
-
- public static String multipleChar(String ch, int repeat) {
- return StringUtils.repeat(ch, repeat);
- }
-
- public static List<String> getListOfDepResArtLabels(Boolean isLowerCase) throws FileNotFoundException {
-
- List<String> listOfResDepArtTypesFromConfig = new ArrayList<String>();
- @SuppressWarnings("unchecked")
- Map<String, Object> resourceDeploymentArtifacts = (Map<String, Object>) parseYamlConfig(
- "deploymentResourceArtifacts");
- if (resourceDeploymentArtifacts != null) {
-
- if (isLowerCase) {
- for (Map.Entry<String, Object> iter : resourceDeploymentArtifacts.entrySet()) {
- listOfResDepArtTypesFromConfig.add(iter.getKey().toLowerCase());
- }
- } else {
-
- for (Map.Entry<String, Object> iter : resourceDeploymentArtifacts.entrySet()) {
- listOfResDepArtTypesFromConfig.add(iter.getKey());
- }
- }
- }
- return listOfResDepArtTypesFromConfig;
- }
-
- public static List<String> getListOfToscaArtLabels(Boolean isLowerCase) throws FileNotFoundException {
-
- List<String> listOfToscaArtTypesFromConfig = new ArrayList<String>();
- @SuppressWarnings("unchecked")
- Map<String, Object> toscaArtifacts = (Map<String, Object>) parseYamlConfig("toscaArtifacts");
- if (toscaArtifacts != null) {
-
- if (isLowerCase) {
- for (Map.Entry<String, Object> iter : toscaArtifacts.entrySet()) {
- listOfToscaArtTypesFromConfig.add(iter.getKey().toLowerCase());
- }
- } else {
- for (Map.Entry<String, Object> iter : toscaArtifacts.entrySet()) {
- listOfToscaArtTypesFromConfig.add(iter.getKey());
- }
- }
- }
- return listOfToscaArtTypesFromConfig;
- }
-
- //
- // public static List<String> getListOfResDepArtTypes() throws
- // FileNotFoundException {
- //
- // List<String> listOfResDepArtTypesFromConfig = new ArrayList<String>();
- // @SuppressWarnings("unchecked")
- // Map<String, Object> resourceDeploymentArtifacts = (Map<String, Object>)
- // parseYamlConfig("resourceDeploymentArtifacts");
- // for (Map.Entry<String, Object> iter :
- // resourceDeploymentArtifacts.entrySet()) {
- // listOfResDepArtTypesFromConfig.add(iter.getKey());
- // }
- //
- // return listOfResDepArtTypesFromConfig;
- // }
- //
- // public static List<String> getListOfDepResInstArtTypes() throws
- // FileNotFoundException {
- //
- // List<String> listOfResInstDepArtTypesFromConfig = new
- // ArrayList<String>();
- // @SuppressWarnings("unchecked")
- // Map<String, Object> resourceDeploymentArtifacts = (Map<String, Object>)
- // parseYamlConfig("deploymentResourceInstanceArtifacts");
- // for (Map.Entry<String, Object> iter :
- // resourceDeploymentArtifacts.entrySet()) {
- // listOfResInstDepArtTypesFromConfig.add(iter.getKey().toLowerCase());
- // }
- //
- // return listOfResInstDepArtTypesFromConfig;
- // }
- //
- public static List<String> getListOfResPlaceHoldersDepArtTypes() throws FileNotFoundException {
- List<String> listResDepArtTypesFromConfig = new ArrayList<String>();
- List<String> listOfResDepArtLabelsFromConfig = getListOfDepResArtLabels(false);
- assertNotNull("deployment artifact types list is null", listOfResDepArtLabelsFromConfig);
- Object parseYamlConfig = Utils.parseYamlConfig("deploymentResourceArtifacts");
- Map<String, Object> mapOfDepResArtTypesObjects = (Map<String, Object>) Utils
- .parseYamlConfig("deploymentResourceArtifacts");
-
- // assertNotNull("deployment artifact types list is null",
- // mapOfDepResArtTypesObjects);
- if (listOfResDepArtLabelsFromConfig != null) {
- for (String resDepArtType : listOfResDepArtLabelsFromConfig) {
- Object object = mapOfDepResArtTypesObjects.get(resDepArtType);
- if (object instanceof Map<?, ?>) {
- Map<String, Object> map = (Map<String, Object>) object;
- listResDepArtTypesFromConfig.add((String) map.get("type"));
- } else {
- assertTrue("return object does not instance of map", false);
- }
- }
- }
- return listResDepArtTypesFromConfig;
- }
-
- public static Long getEpochTimeFromUTC(String time) throws ParseException {
- SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS zzz");
- java.util.Date date = df.parse(time);
- long epoch = date.getTime();
- return epoch;
- }
-
- public static Long getActionDuration(Runnable func) throws Exception{
- long startTime = System.nanoTime();
- func.run();
- long estimateTime = System.nanoTime();
- Long duration = TimeUnit.NANOSECONDS.toSeconds(estimateTime - startTime);
- return duration;
- }
-
- public static Long getAndValidateActionDuration (Runnable action, int regularTestRunTime){
- Long actualTestRunTime = null;
- try {
- actualTestRunTime = Utils.getActionDuration(() -> {
- try {
- action.run();
- } catch (Throwable throwable) {
- throwable.printStackTrace();
- }
- });
- } catch (Exception e) {
- e.printStackTrace();
- }
- double factor = 1.5;
-
- assertTrue("Expected test run time should be less than " + regularTestRunTime*factor + ", " +
- "actual time is " + actualTestRunTime , regularTestRunTime*factor>actualTestRunTime);
-// SetupCDTest.getExtendTest().log(Status.INFO, "Actual catalog loading time is " + actualTestRunTime + " seconds");
- return actualTestRunTime;
- }
-
-
- public static Map<String, String> generateServiceMetadataToExpectedObject(ServiceReqDetails serviceReqDetails, Component component) {
-
- Map<String, String> metadata = new HashMap<>();
-
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.CATEGORY.value, serviceReqDetails.getCategories().get(0).getName());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.DESCRIPTION.value, serviceReqDetails.getDescription());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.INVARIANT_UUID.value, component.getInvariantUUID());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.TYPE.value, "Service");
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.UUID.value, component.getUUID());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.NAME.value, component.getName());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.INSTANTIATION_TYPE.value, serviceReqDetails.getInstantiationType());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.SERVICE_TYPE.value, serviceReqDetails.getServiceType());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.SERVICE_ROLE.value, serviceReqDetails.getServiceRole());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.NAMING_POLICY.value, serviceReqDetails.getNamingPolicy());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.ECOMP_GENERATED_NAMING.value, serviceReqDetails.getEcompGeneratedNaming().toString());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.SERVICE_ECOMP_NAMING.value, serviceReqDetails.getEcompGeneratedNaming().toString());//equals to ECOMP_GENERATED_NAMING
-
- return metadata;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/cassandra/CassandraUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/cassandra/CassandraUtils.java
deleted file mode 100644
index 20a137d8fa..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/cassandra/CassandraUtils.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.cassandra;
-
-import com.datastax.driver.core.*;
-import com.datastax.driver.core.policies.*;
-import com.datastax.driver.core.querybuilder.QueryBuilder;
-import com.datastax.driver.core.querybuilder.Select;
-import com.datastax.driver.core.querybuilder.Select.Where;
-import org.javatuples.Pair;
-import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.common.datastructure.AuditingFieldsKey;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.FileNotFoundException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-public final class CassandraUtils {
- private static Logger logger = LoggerFactory.getLogger(CassandraUtils.class.getName());
-
- protected static Cluster cluster = null;
- protected static Session session;
-
- public static void initConnection(String keyspace) throws FileNotFoundException {
- List<String> cassandraHosts = new ArrayList<>();
- try {
- cassandraHosts.add(Utils.getConfig().getCassandraHost());
- long reconnectTimeout = 30000;
-
- logger.debug("creating cluster to hosts:{} with reconnect timeout:{}", cassandraHosts, reconnectTimeout);
- Cluster.Builder clusterBuilder = Cluster.builder()
- .withReconnectionPolicy(new ConstantReconnectionPolicy(reconnectTimeout))
- .withRetryPolicy(DefaultRetryPolicy.INSTANCE);
-
- cassandraHosts.forEach(host -> clusterBuilder.addContactPoint(host));
- enableAuthentication(clusterBuilder);
- enableSsl(clusterBuilder);
- setLocalDc(clusterBuilder);
-
- cluster = clusterBuilder.build();
- session = cluster.connect(keyspace);
- } catch (Exception e) {
- logger.info("** CassandraClient isn't connected to {}", cassandraHosts);
- }
- }
-
- private static void enableAuthentication(Cluster.Builder clusterBuilder) throws FileNotFoundException {
- boolean authenticate = Utils.getConfig().getCassandraAuthenticate();
- if (authenticate) {
- String username = Utils.getConfig().getCassandraUsername();
- String password = Utils.getConfig().getCassandraPassword();
- if (username == null || password == null) {
- logger.error("authentication is enabled but username or password were not supplied.");
- } else {
- clusterBuilder.withCredentials(username, password);
- }
-
- }
- }
-
- private static void enableSsl(Cluster.Builder clusterBuilder) throws FileNotFoundException {
- boolean ssl = Utils.getConfig().getCassandraSsl();
- if (ssl) {
- String truststorePath = Utils.getConfig().getCassandraTruststorePath();
- String truststorePassword = Utils.getConfig().getCassandraTruststorePassword();
- if (truststorePath == null || truststorePassword == null) {
- logger.error("ssl is enabled but truststorePath or truststorePassword were not supplied.");
- } else {
- System.setProperty("javax.net.ssl.trustStore", truststorePath);
- System.setProperty("javax.net.ssl.trustStorePassword", truststorePassword);
- clusterBuilder.withSSL();
- }
- }
- }
-
-
- private static void setLocalDc(Cluster.Builder clusterBuilder) throws FileNotFoundException {
- String localDataCenter = Utils.getConfig().getLocalDataCenter();
- if (localDataCenter != null) {
- logger.info("localDatacenter was provided, setting Cassndra clint to use datacenter: {} as local.", localDataCenter);
- LoadBalancingPolicy tokenAwarePolicy = new TokenAwarePolicy(DCAwareRoundRobinPolicy.builder().withLocalDc(localDataCenter).build());
- clusterBuilder.withLoadBalancingPolicy(tokenAwarePolicy);
- } else {
- logger.info("localDatacenter was provided, the driver will use the datacenter of the first contact point that was reached at initialization");
- }
- }
-
- public static void truncateTable(String keyspace, String tableName) throws FileNotFoundException {
-
- if (session == null || session.isClosed()) {
- initConnection(keyspace);
- }
-
- try (Cluster cluster = CassandraUtils.cluster){
-
- if (session != null) {
- session.execute(QueryBuilder.truncate(keyspace, tableName));
- logger.debug("The table {}.{} was cleaned", keyspace, tableName);
- } else {
- throw new RuntimeException("Keyspace " + keyspace + " not connected");
- }
- }
- }
-
- public static void close() {
- if (cluster != null) {
- cluster.close();
- }
- }
-
- public static void truncateAllKeyspaces() throws FileNotFoundException {
- // truncateAllTables(AuditingTypesConstants.ARTIFACT_KEYSPACE);
- truncateAllTables(AuditingTypesConstants.AUDIT_KEYSPACE);
- }
-
- public static void truncateAllTables(String keyspace) throws FileNotFoundException {
-
- if (session == null || session.isClosed()) {
- initConnection(keyspace);
- }
- try {
-
- if (session != null) {
- Metadata metadata = cluster.getMetadata();
- KeyspaceMetadata keyspaceMetadata = metadata.getKeyspace(keyspace);
- if (keyspaceMetadata != null) {
- Collection<TableMetadata> tables = keyspaceMetadata.getTables();
- tables.forEach(table -> {
- session.execute(QueryBuilder.truncate(table));
- logger.debug("Table trunceted - {}", table.getName());
- });
- }
- } else {
- throw new RuntimeException("Keyspace " + keyspace + " not connected");
- }
-
- } finally {
- if (cluster != null) {
- cluster.close();
- }
- }
- }
-
- public static List<Row> fetchFromTable(String keyspace, String tableName, List<Pair<AuditingFieldsKey, String>> fields) throws FileNotFoundException {
-
- List<Pair<String, String>> fieldsConverted = new ArrayList<>();
-
-// fields.forEach(pair -> {
-// Pair<String, String> newPair = new Pair(pair.getValue0().getDisplayName(), pair.getValue1());
-// fieldsConverted.add(newPair);
-// });
-
- fields.forEach(pair -> {
- Pair<String, String> newPair;
- if (pair.getValue0() == AuditingFieldsKey.AUDIT_DISTRIBUTION_RESOURCE_URL) {
- newPair = new Pair<String, String>("RESOURE_URL", pair.getValue1());
-
- } else {
- newPair = new Pair<String, String>(pair.getValue0().getDisplayName(), pair.getValue1());
- }
- fieldsConverted.add(newPair);
-
- });
-
- return fetchFromTableQuery(keyspace, tableName, fieldsConverted);
- }
-
- public static List<Row> fetchFromTableQuery(String keyspace, String tableName, List<Pair<String, String>> fields)
- throws FileNotFoundException {
-
- if (session == null || session.isClosed()) {
- initConnection(keyspace);
- }
- try {
-
- if (session != null) {
- Select select = QueryBuilder.select().all().from(keyspace, tableName);
- if (fields != null) {
- // Set<Entry<AuditingFieldsKey, String>> entrySet =
- // fields.entrySet();
- // fields.
- boolean multiple = (fields.size() > 1) ? true : false;
- Where where = null;
- int size = 0;
-
- for (Pair<String, String> pair : fields) {
- ++size;
- if (size == 1) {
- where = select.where(QueryBuilder.eq(pair.getValue0(), pair.getValue1()));
- } else {
- where.and(QueryBuilder.eq(pair.getValue0(), pair.getValue1()));
- }
- }
- if (multiple) {
- select.allowFiltering();
- }
-
- }
-
- List<Row> rows = session.execute(select).all();
- for (Row row : rows) {
- logger.debug("{}", row);
- }
- return rows;
- }
- } finally {
- // if (cluster != null) {
- // cluster.close();
- // }
- }
- return null;
- }
-
-
-
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/cassandra/CassandraUtils2.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/cassandra/CassandraUtils2.java
deleted file mode 100644
index ebb3b33a87..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/cassandra/CassandraUtils2.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.cassandra;
-
-import com.datastax.driver.core.*;
-import com.datastax.driver.core.querybuilder.QueryBuilder;
-import com.datastax.driver.core.querybuilder.Select;
-import com.datastax.driver.core.querybuilder.Select.Where;
-import org.javatuples.Pair;
-import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.common.datastructure.AuditingFieldsKey;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.FileNotFoundException;
-import java.util.Collection;
-import java.util.List;
-
-public final class CassandraUtils2 {
- private static Logger logger = LoggerFactory.getLogger(CassandraUtils2.class.getName());
-
- public static void truncateTable(String keyspace, String tableName) throws FileNotFoundException {
-
- String cassandraHost = Utils.getConfig().getCassandraHost();
-
- Cluster cluster = null;
- Session session;
-
- try {
- Cluster.Builder clusterBuilder = Cluster.builder().addContactPoint(cassandraHost);
- // authantication
- // clusterBuilder.withCredentials(username,password);
- // ssl
- // System.setProperty("javax.net.ssl.trustStore",truststorePath);
- // System.setProperty("javax.net.ssl.trustStorePassword",truststorePassword);
- // clusterBuilder.withSSL();
- cluster = clusterBuilder.build();
- session = cluster.connect(keyspace);
- if (session != null) {
- session.execute(QueryBuilder.truncate(keyspace, tableName));
- logger.debug("The table {}.{} was cleaned",keyspace,tableName);
- } else {
- throw new RuntimeException("Keyspace " + keyspace + " not connected");
- }
- } finally {
- if (cluster != null) {
- cluster.close();
- }
- }
- }
-
- public static void truncateAllKeyspaces() throws FileNotFoundException {
- truncateAllTables(AuditingTypesConstants.ARTIFACT_KEYSPACE);
- truncateAllTables(AuditingTypesConstants.AUDIT_KEYSPACE);
- }
-
- public static void truncateAllTables(String keyspace) throws FileNotFoundException {
- String cassandraHost = Utils.getConfig().getCassandraHost();
-
- Cluster cluster = null;
- Session session;
-
- try {
- cluster = Cluster.builder().addContactPoint(cassandraHost).build();
- session = cluster.connect(keyspace);
- if (session != null) {
- Metadata metadata = cluster.getMetadata();
- KeyspaceMetadata keyspaceMetadata = metadata.getKeyspace(keyspace);
- if (keyspaceMetadata != null) {
- Collection<TableMetadata> tables = keyspaceMetadata.getTables();
- tables.forEach(table -> {
- session.execute(QueryBuilder.truncate(table));
- logger.debug("Table trunceted - {}", table.getName());
- });
- }
- } else {
- throw new RuntimeException("Keyspace " + keyspace + " not connected");
- }
-
- } finally {
- if (cluster != null) {
- cluster.close();
- }
- }
- }
-
- public static List<Row> fetchFromTable(String keyspace, String tableName,
- List<Pair<AuditingFieldsKey, String>> fields) throws FileNotFoundException {
-
- // List<Pair<AuditingFieldsKey, String>>
- // Map<AuditingFieldsKey, String>
-
- Cluster cluster = null;
- Session session;
- String cassandraHost = Utils.getConfig().getCassandraHost();
-
- try {
- cluster = Cluster.builder().addContactPoint(cassandraHost).build();
- session = cluster.connect(keyspace);
- if (session != null) {
- Select select = QueryBuilder.select().all().from(keyspace, tableName);
- if (fields != null) {
- // Set<Entry<AuditingFieldsKey, String>> entrySet =
- // fields.entrySet();
- // fields.
- boolean multiple = (fields.size() > 1) ? true : false;
- Where where = null;
- int size = 0;
-
- for (Pair<AuditingFieldsKey, String> pair : fields) {
- ++size;
- if (size == 1) {
- where = select.where(QueryBuilder.eq(pair.getValue0().getDisplayName(), pair.getValue1()));
- } else {
- where.and(QueryBuilder.eq(pair.getValue0().getDisplayName(), pair.getValue1()));
- }
- }
- if (multiple) {
- select.allowFiltering();
- }
-
- }
-
- List<Row> rows = session.execute(select).all();
- for (Row row : rows) {
- logger.debug("{}", row);
- }
- return rows;
- }
- } finally {
- if (cluster != null) {
- cluster.close();
- }
- }
- return null;
- }
- //
- // public static void main(String[] args) throws FileNotFoundException {
- // Map<AuditingFieldsKey, String> map = new HashMap<>();
- // map.put(AuditingFieldsKey.AUDIT_ACTION, "Access");
- // map.put(AuditingFieldsKey.AUDIT_STATUS, "200");
- // // CassandraUtils.truncateTable("sdcartifact", "resources");
- //// CassandraUtils.truncateAllTables("sdcaudit");
- // CassandraUtils.fetchFromTable("sdcaudit", "useraccessevent", map );
- // }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/AtomicOperationUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/AtomicOperationUtils.java
deleted file mode 100644
index f0efd96079..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/AtomicOperationUtils.java
+++ /dev/null
@@ -1,1058 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.general;
-
-import com.aventstack.extentreports.Status;
-import com.google.gson.Gson;
-import fj.data.Either;
-import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.lang3.tuple.Pair;
-import org.json.JSONException;
-import org.onap.sdc.tosca.parser.api.ISdcCsarHelper;
-import org.onap.sdc.tosca.parser.impl.SdcToscaParserFactory;
-import org.openecomp.sdc.be.datatypes.elements.ConsumerDataDefinition;
-import org.openecomp.sdc.be.datatypes.enums.AssetTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.*;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.api.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.*;
-import org.openecomp.sdc.ci.tests.datatypes.enums.*;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.execute.lifecycle.LCSbaseTest;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaDefinition;
-import org.openecomp.sdc.ci.tests.utils.CsarToscaTester;
-import org.openecomp.sdc.ci.tests.utils.DistributionUtils;
-import org.openecomp.sdc.ci.tests.utils.ToscaParserUtils;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.ci.tests.utils.rest.*;
-import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
-import org.openecomp.sdc.common.util.GeneralUtility;
-import org.testng.SkipException;
-
-import java.io.File;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.concurrent.TimeUnit;
-import java.util.stream.Collectors;
-
-import static org.junit.Assert.assertFalse;
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertTrue;
-
-public final class AtomicOperationUtils {
-
- static final String basicAuthentication = "Basic Y2k6MTIzNDU2";
-
- private AtomicOperationUtils() {
- throw new UnsupportedOperationException();
- }
-
- // *********** RESOURCE ****************
- /**
- * Import a vfc From tosca file
- *
- * @param filePath
- * @param fileName
- * @return
- * @throws IOException
- * @throws JSONException
- */
- public static Either<Resource, RestResponse> importResource(String filePath, String fileName) {
- try {
- User designer = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- ImportReqDetails importReqDetails = ElementFactory.getDefaultImportResource(ElementFactory.getResourcePrefix());
- importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, filePath, fileName);
- RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, designer, null);
- return buildResourceFromResponse(importResourceResponse);
- } catch (Exception e) {
- throw new AtomicOperationException(e);
- }
- }
-
- public static Either<Resource, RestResponse> importResource(ImportReqDetails importReqDetails, String filePath, String fileName, User userRole, Boolean validateState) {
- try {
- importReqDetails = ImportUtils.getImportResourceDetailsByPathAndName(importReqDetails, filePath, fileName);
- RestResponse importResourceResponse = ResourceRestUtils.createImportResource(importReqDetails, userRole, null);
-
- if (validateState) {
- assertTrue("Import resource failed with error: " + importResourceResponse.getResponse(),importResourceResponse.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED);
- }
-
- if (importResourceResponse.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED) {
- Resource resourceResponseObject = ResponseParser.convertResourceResponseToJavaObject(importResourceResponse.getResponse());
- return Either.left(resourceResponseObject);
- }
- return Either.right(importResourceResponse);
- } catch (Exception e) {
- throw new AtomicOperationException(e);
- }
- }
-
-
- public static Either<Resource, RestResponse> createResourceByType(ResourceTypeEnum resourceType, UserRoleEnum userRole, Boolean validateState) {
- try {
- User defaultUser = ElementFactory.getDefaultUser(userRole);
- ResourceReqDetails defaultResource = ElementFactory.getDefaultResourceByType(resourceType, defaultUser);
- RestResponse resourceResp = ResourceRestUtils.createResource(defaultResource, defaultUser);
-
- if (validateState) {
- assertTrue("Create resource failed with error: " + resourceResp.getResponse(),resourceResp.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED);
- }
-
- if (resourceResp.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED) {
- Resource resourceResponseObject = ResponseParser.convertResourceResponseToJavaObject(resourceResp.getResponse());
- return Either.left(resourceResponseObject);
- }
- return Either.right(resourceResp);
- } catch (Exception e) {
- throw new AtomicOperationException(e);
- }
- }
-
- public static Either<Resource, RestResponse> createResourceByResourceDetails(ResourceReqDetails resourceDetails, UserRoleEnum userRole, Boolean validateState) {
- try {
- User defaultUser = ElementFactory.getDefaultUser(userRole);
- RestResponse resourceResp = ResourceRestUtils.createResource(resourceDetails, defaultUser);
-
- if (validateState) {
- assertTrue("Create resource failed with error: " + resourceResp.getResponse(),resourceResp.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED);
- }
-
- if (resourceResp.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED) {
- Resource resourceResponseObject = ResponseParser.convertResourceResponseToJavaObject(resourceResp.getResponse());
- return Either.left(resourceResponseObject);
- }
- return Either.right(resourceResp);
- } catch (Exception e) {
- throw new AtomicOperationException(e);
- }
- }
-
- public static Either<Resource, RestResponse> createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum resourceType, NormativeTypesEnum normativeTypes, ResourceCategoryEnum resourceCategory, UserRoleEnum userRole, Boolean validateState)
- throws Exception {
- User defaultUser = ElementFactory.getDefaultUser(userRole);
- ResourceReqDetails defaultResource = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(resourceType, normativeTypes, resourceCategory, defaultUser);
- RestResponse resourceResp = ResourceRestUtils.createResource(defaultResource, defaultUser);
-
- if (validateState) {
- assertTrue("Actual Response Code is: " + resourceResp.getErrorCode(), resourceResp.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED);
- }
-
- if (resourceResp.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED) {
- // Resource resourceResponseObject = ResponseParser
- // .convertResourceResponseToJavaObject(resourceResp.getResponse());
- Resource resourceResponseObject = ResponseParser.parseToObjectUsingMapper(resourceResp.getResponse(), Resource.class);
- return Either.left(resourceResponseObject);
- }
- return Either.right(resourceResp);
- }
-
- public static Either<Resource, RestResponse> createResourcesByCustomNormativeTypeAndCatregory(ResourceTypeEnum resourceType, Resource resourceNormativeType, ResourceCategoryEnum resourceCategory, UserRoleEnum userRole, Boolean validateState)
- throws Exception {
- User defaultUser = ElementFactory.getDefaultUser(userRole);
- ResourceReqDetails defaultResource = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(resourceType, resourceNormativeType, resourceCategory, defaultUser);
- RestResponse resourceResp = ResourceRestUtils.createResource(defaultResource, defaultUser);
-
- if (validateState) {
- assertTrue("Create resource failed with error: " + resourceResp.getResponse(), resourceResp.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED);
- }
-
- if (resourceResp.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED) {
- // Resource resourceResponseObject = ResponseParser
- // .convertResourceResponseToJavaObject(resourceResp.getResponse());
- Resource resourceResponseObject = ResponseParser.parseToObjectUsingMapper(resourceResp.getResponse(), Resource.class);
- return Either.left(resourceResponseObject);
- }
- return Either.right(resourceResp);
- }
-
- public static Either<Resource, RestResponse> updateResource(ResourceReqDetails resourceReqDetails, User defaultUser, Boolean validateState) {
- try {
-
- RestResponse resourceResp = ResourceRestUtils.updateResource(resourceReqDetails, defaultUser, resourceReqDetails.getUniqueId());
-
- if (validateState) {
- assertTrue("Update resource failed with error: " + resourceResp.getResponse(),resourceResp.getErrorCode() == ResourceRestUtils.STATUS_CODE_SUCCESS);
- }
-
- if (resourceResp.getErrorCode() == ResourceRestUtils.STATUS_CODE_SUCCESS) {
- Resource resourceResponseObject = ResponseParser.convertResourceResponseToJavaObject(resourceResp.getResponse());
- return Either.left(resourceResponseObject);
- }
- return Either.right(resourceResp);
- } catch (Exception e) {
- throw new AtomicOperationException(e);
- }
- }
-
- // *********** SERVICE ****************
-
- public static Either<Service, RestResponse> createDefaultService(UserRoleEnum userRole, Boolean validateState) throws Exception {
- User defaultUser = ElementFactory.getDefaultUser(userRole);
- ServiceReqDetails serviceDetails = ElementFactory.getDefaultService(defaultUser);
- RestResponse createServiceResp = ServiceRestUtils.createService(serviceDetails, defaultUser);
-
- if (validateState) {
- assertTrue("Create service failed with error: " + createServiceResp.getResponse(),createServiceResp.getErrorCode() == ServiceRestUtils.STATUS_CODE_CREATED);
- }
-
- if (createServiceResp.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED) {
- Service serviceResponseObject = ResponseParser.convertServiceResponseToJavaObject(createServiceResp.getResponse());
- return Either.left(serviceResponseObject);
- }
- return Either.right(createServiceResp);
- }
-
- public static Either<Service, RestResponse> createServiceByCategory(ServiceCategoriesEnum category, UserRoleEnum userRole, Boolean validateState) throws Exception {
- User defaultUser = ElementFactory.getDefaultUser(userRole);
- ServiceReqDetails serviceDetails = ElementFactory.getDefaultService(category, defaultUser);
- RestResponse createServiceResp = ServiceRestUtils.createService(serviceDetails, defaultUser);
-
- if (validateState) {
- assertTrue("Create service failed with error: " + createServiceResp.getResponse(),createServiceResp.getErrorCode() == ServiceRestUtils.STATUS_CODE_CREATED);
- }
-
- if (createServiceResp.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED) {
- Service serviceResponseObject = ResponseParser.convertServiceResponseToJavaObject(createServiceResp.getResponse());
- return Either.left(serviceResponseObject);
- }
- return Either.right(createServiceResp);
- }
-
- public static Either<Service, RestResponse> createCustomService(ServiceReqDetails serviceDetails, UserRoleEnum userRole, Boolean validateState) throws Exception {
- User defaultUser = ElementFactory.getDefaultUser(userRole);
- RestResponse createServiceResp = ServiceRestUtils.createService(serviceDetails, defaultUser);
-
- if (validateState) {
- assertTrue("Create service failed with error: " + createServiceResp.getResponse(),createServiceResp.getErrorCode() == ServiceRestUtils.STATUS_CODE_CREATED);
- }
-
- if (createServiceResp.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED) {
- Service serviceResponseObject = ResponseParser.convertServiceResponseToJavaObject(createServiceResp.getResponse());
- return Either.left(serviceResponseObject);
- }
- return Either.right(createServiceResp);
- }
- // *********** PRODUCT ****************
-
- public static Either<Product, RestResponse> createDefaultProduct(UserRoleEnum userRole, Boolean validateState) throws Exception {
- User defaultUser = ElementFactory.getDefaultUser(userRole);
- ProductReqDetails defaultProduct = ElementFactory.getDefaultProduct();
- RestResponse createProductResp = ProductRestUtils.createProduct(defaultProduct, defaultUser);
-
- if (validateState) {
- assertTrue(createProductResp.getErrorCode() == ProductRestUtils.STATUS_CODE_CREATED);
- }
-
- if (createProductResp.getErrorCode() == ProductRestUtils.STATUS_CODE_CREATED) {
- Product productResponseJavaObject = ResponseParser.convertProductResponseToJavaObject(createProductResp.getResponse());
- return Either.left(productResponseJavaObject);
- }
- return Either.right(createProductResp);
- }
-
- // public static ComponentReqDetails
- // convertCompoentToComponentReqDetails(Component component){
- //
- // ComponentReqDetails componentReqDetails =
- // ElementFactory.getDefaultService();
- // componentReqDetails.setName(component.getName());
- // componentReqDetails.setDescription(component.getDescription());
- // componentReqDetails.setTags(component.getTags());
- // componentReqDetails.setContactId(component.getContactId());
- // componentReqDetails.setIcon(component.getIcon());
- // componentReqDetails.setUniqueId(component.getUniqueId());
- // componentReqDetails.setCreatorUserId(component.getCreatorUserId());
- // componentReqDetails.setCreatorFullName(component.getCreatorFullName());
- // componentReqDetails.setLastUpdaterUserId(component.getLastUpdaterUserId());
- // componentReqDetails.setLastUpdaterFullName(component.getLastUpdaterFullName());
- // componentReqDetails.setCreationDate(component.getCreationDate());
- // componentReqDetails.setLastUpdateDate(component.getLastUpdateDate());
- // componentReqDetails.setLifecycleState(component.getLifecycleState());
- // componentReqDetails.setVersion(component.getVersion());
- // componentReqDetails.setUuid(component.getUUID());
- // componentReqDetails.setCategories(component.getCategories());
- // componentReqDetails.setProjectCode(component.getProjectCode());
- //
- // return componentReqDetails;
- // }
-
- // *********** LIFECYCLE ***************
-
- public static Pair<Component, RestResponse> changeComponentState(Component component, UserRoleEnum userRole, LifeCycleStatesEnum targetState, Boolean validateState) throws Exception {
-
- Boolean isValidationFailed = false;
- RestResponse lifeCycleStatesResponse = null;
- User defaultUser;
-
- LifeCycleStatesEnum currentCompState = LifeCycleStatesEnum.findByCompState(component.getLifecycleState().toString());
-
- if (currentCompState == targetState) {
- component = getComponentObject(component, userRole);
- return Pair.of(component, null);
- }
- String componentType = component.getComponentType().getValue();
- ArrayList<String> lifeCycleStatesEnumList = new ArrayList<>();
- if (currentCompState.equals(LifeCycleStatesEnum.CHECKIN) && targetState.equals(LifeCycleStatesEnum.CHECKOUT)) {
- lifeCycleStatesEnumList.add(LifeCycleStatesEnum.CHECKIN.toString());
- lifeCycleStatesEnumList.add(LifeCycleStatesEnum.CHECKOUT.toString());
- } else {
- lifeCycleStatesEnumList.add(LifeCycleStatesEnum.CHECKOUT.toString());
- lifeCycleStatesEnumList.add(LifeCycleStatesEnum.CHECKIN.toString());
- lifeCycleStatesEnumList.add(LifeCycleStatesEnum.CERTIFY.toString());
- }
- for (int i = 0; i < lifeCycleStatesEnumList.size(); i++) {
- if (lifeCycleStatesEnumList.get(i).equals(currentCompState.name())) {
- int a;
- a = (i == lifeCycleStatesEnumList.size() - 1) ? 0 : i + 1;
- for (int n = a; n < lifeCycleStatesEnumList.size(); n++) {
- defaultUser = ElementFactory.getDefaultUser(userRole);
- lifeCycleStatesResponse = LifecycleRestUtils.changeComponentState(component, defaultUser, LifeCycleStatesEnum.findByState(lifeCycleStatesEnumList.get(n)));
- if (lifeCycleStatesResponse.getErrorCode() != LifecycleRestUtils.STATUS_CODE_SUCCESS)
- isValidationFailed = true;
- if (lifeCycleStatesEnumList.get(n).equals(targetState.toString()) || isValidationFailed) {
- break;
- }
- }
- }
- }
- Component componentJavaObject = getComponentObject(component, userRole);
-
- if (validateState && isValidationFailed) {
- assertTrue("change state to [" + targetState.getState() + "] failed" + lifeCycleStatesResponse.getResponse(), false);
- return Pair.of(componentJavaObject, lifeCycleStatesResponse);
- }
-
- if (isValidationFailed) {
- return Pair.of(componentJavaObject, lifeCycleStatesResponse);
- }
-
- return Pair.of(componentJavaObject, lifeCycleStatesResponse);
- }
-
- public static RestResponse distributeService(Component component, Boolean validateState) throws Exception {
-
- Service service = (Service) component;
-
- User opsUser = ElementFactory.getDefaultUser(UserRoleEnum.OPS);
- User governotUser = ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR);
-
- ServiceReqDetails serviceDetails = new ServiceReqDetails(service);
- RestResponse distributionService = null;
-
- RestResponse approveDistribution = LifecycleRestUtils.changeDistributionStatus(serviceDetails, null, governotUser, "approveService", DistributionStatusEnum.DISTRIBUTED);
- if (approveDistribution.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS) {
- distributionService = LifecycleRestUtils.changeDistributionStatus(serviceDetails, null, opsUser, "approveService", DistributionStatusEnum.DISTRIBUTED);
- }
-
- if (validateState) {
- assertTrue("Distribution approve failed with error: " + approveDistribution.getResponse(),approveDistribution.getErrorCode() == ProductRestUtils.STATUS_CODE_SUCCESS);
- assertTrue("Distribute service failed with error: " + distributionService.getResponse(),distributionService.getErrorCode() == ProductRestUtils.STATUS_CODE_SUCCESS);
- return distributionService;
- }
-
- return distributionService;
- }
-
- public static void toscaValidation(Component component, String vnfFile) throws Exception {
-
- ISdcCsarHelper fdntCsarHelper;
- SdcToscaParserFactory factory = SdcToscaParserFactory.getInstance();
- File csarFile = AssetRestUtils.getToscaModelCsarFile(AssetTypeEnum.SERVICES, component.getUUID() , vnfFile);
- ExtentTestActions.log(Status.INFO, "Tosca parser is going to convert service csar file to ISdcCsarHelper object...");
- fdntCsarHelper = factory.getSdcCsarHelper(csarFile.getAbsolutePath());
- CsarToscaTester.processCsar(fdntCsarHelper);
- ExtentTestActions.log(Status.INFO, String.format("Tosca parser successfully parsed service CSAR"));
-
- }
-
- // *********** ARTIFACTS *****************
-
- public static Either<ArtifactDefinition, RestResponse> uploadArtifactByType(ArtifactTypeEnum artifactType, Component component, UserRoleEnum userRole, Boolean deploymentTrue, Boolean validateState) throws Exception {
-
- User defaultUser = ElementFactory.getDefaultUser(userRole);
- ArtifactReqDetails artifactDetails = ElementFactory.getArtifactByType(null, artifactType, deploymentTrue);
- if (!deploymentTrue)
- artifactDetails.setArtifactGroupType(ArtifactGroupTypeEnum.INFORMATIONAL.getType());
- RestResponse uploadArtifactResp = ArtifactRestUtils.uploadArtifact(artifactDetails, component, defaultUser);
-
- if (validateState) {
- assertTrue("artifact upload failed: " + artifactDetails.getArtifactName(), uploadArtifactResp.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- if (uploadArtifactResp.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS) {
- ArtifactDefinition artifactJavaObject = ResponseParser.convertArtifactDefinitionResponseToJavaObject(uploadArtifactResp.getResponse());
- return Either.left(artifactJavaObject);
- }
- return Either.right(uploadArtifactResp);
- }
-
- // *********** CONTAINERS *****************
- /**
- * Adds Component instance to Component
- *
- * @param compInstParent
- * @param compContainer
- * @return
- */
- public static Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer(Component compInstParent, Component compContainer) {
- return addComponentInstanceToComponentContainer(compInstParent, compContainer, UserRoleEnum.DESIGNER, false);
- }
-
- public static Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer(Component compInstParent,
- Component compContainer,
- UserRoleEnum userRole,
- Boolean validateState) {
- try {
- User defaultUser = ElementFactory.getDefaultUser(userRole);
- ComponentInstanceReqDetails componentInstanceDetails = ElementFactory.getComponentInstance(compInstParent);
- if (componentInstanceDetails.getOriginType() == null){
- componentInstanceDetails.setOriginType(((Resource) compInstParent).getResourceType().toString());
- }
- RestResponse createComponentInstance = ComponentInstanceRestUtils.createComponentInstance(componentInstanceDetails,
- defaultUser, compContainer);
-
- if (validateState) {
- if (createComponentInstance.getErrorCode() == ServiceRestUtils.STATUS_CODE_NOT_FOUND) {
- throw new SkipException("Open bug DE262001");
- } else {
- assertTrue("error - " + createComponentInstance.getErrorCode() + "instead - " +
- ServiceRestUtils.STATUS_CODE_CREATED,
- createComponentInstance.getErrorCode() == ServiceRestUtils.STATUS_CODE_CREATED);
- }
- }
-
- if (createComponentInstance.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED) {
- ComponentInstance componentInstance = ResponseParser
- .convertComponentInstanceResponseToJavaObject(createComponentInstance.getResponse());
- return Either.left(componentInstance);
- }
- return Either.right(createComponentInstance);
- } catch (Exception e) {
- throw new AtomicOperationException(e);
- }
- }
-
- public static Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer(Component compInstParent, Component compContainer, UserRoleEnum userRole, Boolean validateState, String positionX, String positionY) {
- try {
- User defaultUser = ElementFactory.getDefaultUser(userRole);
- ComponentInstanceReqDetails componentInstanceDetails = ElementFactory.getComponentInstance(compInstParent);
- componentInstanceDetails.setPosX(positionX);
- componentInstanceDetails.setPosY(positionY);
- RestResponse createComponentInstance = ComponentInstanceRestUtils.createComponentInstance(componentInstanceDetails, defaultUser, compContainer);
-
- if (validateState) {
- if (createComponentInstance.getErrorCode() == ServiceRestUtils.STATUS_CODE_NOT_FOUND)
- {
- throw new SkipException("Open bug DE262001");
- }
- else{
- assertTrue("error - " + createComponentInstance.getErrorCode() + "instead - " + ServiceRestUtils.STATUS_CODE_CREATED, createComponentInstance.getErrorCode() == ServiceRestUtils.STATUS_CODE_CREATED);
- }
- }
-
- if (createComponentInstance.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED) {
- ComponentInstance componentInstance = ResponseParser.convertComponentInstanceResponseToJavaObject(createComponentInstance.getResponse());
- return Either.left(componentInstance);
- }
- return Either.right(createComponentInstance);
- } catch (Exception e) {
- throw new AtomicOperationException(e);
- }
- }
-
- public static Resource getResourceObject(Component containerDetails, UserRoleEnum userRole) throws Exception {
- // User defaultUser = ElementFactory.getDefaultUser(userRole);
- RestResponse restResponse = ResourceRestUtils.getResource(containerDetails.getUniqueId());
- return ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
- }
-
- public static Resource getResourceObject(String uniqueId) throws Exception {
- RestResponse restResponse = ResourceRestUtils.getResource(uniqueId);
- return ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
- }
-
- public static Resource getResourceObjectByNameAndVersion(UserRoleEnum sdncModifierDetails, String resourceName, String resourceVersion) throws Exception {
- User defaultUser = ElementFactory.getDefaultUser(sdncModifierDetails);
- RestResponse resourceResponse = ResourceRestUtils.getResourceByNameAndVersion(defaultUser.getUserId(), resourceName, resourceVersion);
- return ResponseParser.convertResourceResponseToJavaObject(resourceResponse.getResponse());
- }
-
- public static Service getServiceObject(Component containerDetails, UserRoleEnum userRole) throws Exception {
- User defaultUser = ElementFactory.getDefaultUser(userRole);
- RestResponse serviceResponse = ServiceRestUtils.getService(containerDetails.getUniqueId(), defaultUser);
- return ResponseParser.convertServiceResponseToJavaObject(serviceResponse.getResponse());
- }
-
- public static Service getServiceObjectByNameAndVersion(UserRoleEnum sdncModifierDetails, String serviceName, String serviceVersion) throws Exception {
- User defaultUser = ElementFactory.getDefaultUser(sdncModifierDetails);
- RestResponse serviceResponse = ServiceRestUtils.getServiceByNameAndVersion(defaultUser, serviceName, serviceVersion);
- return ResponseParser.convertServiceResponseToJavaObject(serviceResponse.getResponse());
- }
-
- public static Service getServiceObject(String uniqueId) throws Exception {
- RestResponse serviceResponse = ServiceRestUtils.getService(uniqueId);
- return ResponseParser.convertServiceResponseToJavaObject(serviceResponse.getResponse());
- }
-
- public static Product getProductObject(Component containerDetails, UserRoleEnum userRole) throws Exception {
- User defaultUser = ElementFactory.getDefaultUser(userRole);
- RestResponse productRest = ProductRestUtils.getProduct(containerDetails.getUniqueId(), defaultUser.getUserId());
- return ResponseParser.convertProductResponseToJavaObject(productRest.getResponse());
- }
-
- public static Component getComponentObject(Component containerDetails, UserRoleEnum userRole) throws Exception {
- User defaultUser = ElementFactory.getDefaultUser(userRole);
-
- switch (containerDetails.getComponentType()) {
- case RESOURCE:
- RestResponse restResponse = ResourceRestUtils.getResource(containerDetails.getUniqueId());
- containerDetails = ResponseParser.convertResourceResponseToJavaObject(restResponse.getResponse());
- break;
- case SERVICE:
- RestResponse serviceResponse = ServiceRestUtils.getService(containerDetails.getUniqueId(), defaultUser);
- containerDetails = ResponseParser.convertServiceResponseToJavaObject(serviceResponse.getResponse());
- break;
- case PRODUCT:
- RestResponse productRest = ProductRestUtils.getProduct(containerDetails.getUniqueId(), defaultUser.getUserId());
- containerDetails = ResponseParser.convertProductResponseToJavaObject(productRest.getResponse());
- break;
- default:
- break;
- }
- return containerDetails;
- }
-
- public static Component convertReposnseToComponentObject(Component containerDetails, RestResponse restresponse) {
-
- switch (containerDetails.getComponentType()) {
- case RESOURCE:
- containerDetails = ResponseParser.convertResourceResponseToJavaObject(restresponse.getResponse());
- break;
- case SERVICE:
- containerDetails = ResponseParser.convertServiceResponseToJavaObject(restresponse.getResponse());
- break;
- case PRODUCT:
- containerDetails = ResponseParser.convertProductResponseToJavaObject(restresponse.getResponse());
- break;
- default:
- break;
- }
- return containerDetails;
- }
-
- public static Either<Component, RestResponse> associate2ResourceInstances(Component containerDetails, ComponentInstance fromNode, ComponentInstance toNode, String assocType, UserRoleEnum userRole, Boolean validateState) throws Exception {
-
- User defaultUser = ElementFactory.getDefaultUser(userRole);
- RestResponse associate2ResourceInstancesResponse = ResourceRestUtils.associate2ResourceInstances(containerDetails, fromNode, toNode, assocType, defaultUser);
-
- if (validateState) {
- assertTrue(associate2ResourceInstancesResponse.getErrorCode() == ServiceRestUtils.STATUS_CODE_SUCCESS);
- }
-
- if (associate2ResourceInstancesResponse.getErrorCode() == ResourceRestUtils.STATUS_CODE_SUCCESS) {
-
- switch (containerDetails.getComponentType()) {
- case RESOURCE:
- containerDetails = ResponseParser.convertResourceResponseToJavaObject(associate2ResourceInstancesResponse.getResponse());
- break;
- case SERVICE:
- containerDetails = ResponseParser.convertServiceResponseToJavaObject(associate2ResourceInstancesResponse.getResponse());
- break;
- case PRODUCT:
- containerDetails = ResponseParser.convertProductResponseToJavaObject(associate2ResourceInstancesResponse.getResponse());
- break;
- default:
- break;
- }
-
- return Either.left(containerDetails);
- }
- return Either.right(associate2ResourceInstancesResponse);
-
- }
-
- public static Either<Pair<Component, ComponentInstance>, RestResponse> updateComponentInstance(ComponentInstanceReqDetails componentInstanceReqDetails, User sdncModifierDetails, Component container, boolean validateState) throws Exception {
-
- RestResponse updateComponentInstance = ComponentInstanceRestUtils.updateComponentInstance(componentInstanceReqDetails, sdncModifierDetails, container.getUniqueId(), container.getComponentType());
- if (validateState) {
- assertTrue("Update ComponentInstance failed: " + updateComponentInstance.getResponseMessage(), updateComponentInstance.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
- }
- if (updateComponentInstance.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS) {
- String componentType = container.getComponentType().getValue();
- Component componentObject;
- if(componentType.equals("Resource")){
- componentObject = getResourceObject(container.getUniqueId());
- }else{
- componentObject = getServiceObject(container.getUniqueId());
- }
- ComponentInstance componentInstanceJavaObject = ResponseParser.convertComponentInstanceResponseToJavaObject(updateComponentInstance.getResponse());
- return Either.left(Pair.of(componentObject, componentInstanceJavaObject));
- }
- return Either.right(updateComponentInstance);
- }
-
- public static Either<Pair<Component, ComponentInstance>, RestResponse> changeComponentInstanceVersion(Component containerDetails, ComponentInstance componentInstanceToReplace, Component newInstance, UserRoleEnum userRole, Boolean validateState)
- throws Exception {
- User defaultUser = ElementFactory.getDefaultUser(userRole);
-
- RestResponse changeComponentInstanceVersionResp = ComponentInstanceRestUtils.changeComponentInstanceVersion(containerDetails, componentInstanceToReplace, newInstance, defaultUser);
- if (validateState) {
- assertTrue("change ComponentInstance version failed: " + changeComponentInstanceVersionResp.getResponseMessage(), changeComponentInstanceVersionResp.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- if (changeComponentInstanceVersionResp.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS) {
-
- Component compoenntObject = AtomicOperationUtils.getComponentObject(containerDetails, userRole);
- ComponentInstance componentInstanceJavaObject = ResponseParser.convertComponentInstanceResponseToJavaObject(changeComponentInstanceVersionResp.getResponse());
-
- return Either.left(Pair.of(compoenntObject, componentInstanceJavaObject));
- }
-
- return Either.right(changeComponentInstanceVersionResp);
- }
-
- public static ComponentInstance getComponentInstanceByName(Component component, String name) {
- ComponentInstance componentInstance = component.getComponentInstances()
- .stream()
- .filter(ci->ci.getName().equals(name))
- .findFirst()
- .orElse(null);
- if (componentInstance == null) {
- List<String> componentInstancesNameList = component.getComponentInstances().stream().map(ComponentInstance::getName).collect(Collectors.toList());
- assertFalse("Instance name " + name + " not found in container " + component.getComponentType() + " named [" + component.getName()
- + "]. Component instances available are: " + componentInstancesNameList.toString(), true);
- }
- return componentInstance;
- }
-
- // *********** PROPERTIES *****************
-
- public static Either<ComponentInstanceProperty, RestResponse> addCustomPropertyToResource(PropertyReqDetails propDetails, Resource resourceDetails, UserRoleEnum userRole, Boolean validateState) throws Exception {
-
- User defaultUser = ElementFactory.getDefaultUser(userRole);
- Map<String, PropertyReqDetails> propertyToSend = new HashMap<>();
- propertyToSend.put(propDetails.getName(), propDetails);
- Gson gson = new Gson();
- RestResponse addPropertyResponse = PropertyRestUtils.createProperty(resourceDetails.getUniqueId(), gson.toJson(propertyToSend), defaultUser);
-
- if (validateState) {
- assertTrue("add property to resource failed: " + addPropertyResponse.getErrorCode(), addPropertyResponse.getErrorCode() == BaseRestUtils.STATUS_CODE_CREATED);
- }
-
- if (addPropertyResponse.getErrorCode() == BaseRestUtils.STATUS_CODE_CREATED) {
- ComponentInstanceProperty compInstProp = null;
- String property = ResponseParser.getJsonObjectValueByKey(addPropertyResponse.getResponse(), propDetails.getName());
- compInstProp = (ResponseParser.convertPropertyResponseToJavaObject(property));
- return Either.left(compInstProp);
- }
- return Either.right(addPropertyResponse);
- }
-
- // Benny
- public static Either<ComponentInstanceProperty, RestResponse> updatePropertyOfResource(PropertyReqDetails propDetails, Resource resourceDetails, String propertyUniqueId, UserRoleEnum userRole, Boolean validateState) throws Exception {
-
- User defaultUser = ElementFactory.getDefaultUser(userRole);
- Map<String, PropertyReqDetails> propertyToSend = new HashMap<>();
- propertyToSend.put(propDetails.getName(), propDetails);
- Gson gson = new Gson();
- RestResponse addPropertyResponse = PropertyRestUtils.updateProperty(resourceDetails.getUniqueId(), propertyUniqueId, gson.toJson(propertyToSend), defaultUser);
-
- if (validateState) {
- assertTrue("add property to resource failed: " + addPropertyResponse.getResponseMessage(), addPropertyResponse.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- if (addPropertyResponse.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS) {
- ComponentInstanceProperty compInstProp = null;
- String property = ResponseParser.getJsonObjectValueByKey(addPropertyResponse.getResponse(), propDetails.getName());
- compInstProp = (ResponseParser.convertPropertyResponseToJavaObject(property));
- return Either.left(compInstProp);
- }
- return Either.right(addPropertyResponse);
- }
-
- public static RestResponse deletePropertyOfResource(String resourceId, String propertyId, UserRoleEnum userRole) throws Exception {
- User defaultUser = ElementFactory.getDefaultUser(userRole);
- return PropertyRestUtils.deleteProperty(resourceId, propertyId, defaultUser);
- }
-
- public static Either<ComponentInstanceProperty, RestResponse> addDefaultPropertyToResource(PropertyTypeEnum propertyType, Resource resourceDetails, UserRoleEnum userRole, Boolean validateState) throws Exception {
-
- User defaultUser = ElementFactory.getDefaultUser(userRole);
- PropertyReqDetails propDetails = ElementFactory.getPropertyDetails(propertyType);
- Map<String, PropertyReqDetails> propertyToSend = new HashMap<>();
- propertyToSend.put(propDetails.getName(), propDetails);
- Gson gson = new Gson();
- RestResponse addPropertyResponse = PropertyRestUtils.createProperty(resourceDetails.getUniqueId(), gson.toJson(propertyToSend), defaultUser);
-
- if (validateState) {
- assertTrue("add property to resource failed: " + addPropertyResponse.getResponseMessage(), addPropertyResponse.getErrorCode() == BaseRestUtils.STATUS_CODE_CREATED);
- }
-
- if (addPropertyResponse.getErrorCode() == BaseRestUtils.STATUS_CODE_CREATED) {
- ComponentInstanceProperty compInstProp = null;
- String property = ResponseParser.getJsonObjectValueByKey(addPropertyResponse.getResponse(), propDetails.getName());
- compInstProp = (ResponseParser.convertPropertyResponseToJavaObject(property));
-
- return Either.left(compInstProp);
- }
- return Either.right(addPropertyResponse);
- }
-
- public static Either<GroupDefinition, RestResponse> updateGroupPropertyOnResource(String maxVFModuleInstacesValue, Resource resource, String groupId, User user, Boolean validateState) throws Exception {
-
-// Gson gson = new Gson();
- // Json group property object
- String propertyObjectJson = "[{\"defaultValue\":null,\"description\":\"The maximum instances of this VF-Module\",\"name\":\"max_vf_module_instances\",\"parentUniqueId\":\"org.openecomp.groups.VfModule.1.0.grouptype.max_vf_module_instances\",\"password\":false,\"required\":false,\"schema\":{\"property\":{}},\"type\":\"integer\",\"uniqueId\":\"org.openecomp.groups.VfModule.1.0.grouptype.max_vf_module_instances.property.3\",\"value\":\"" + maxVFModuleInstacesValue + "\",\"definition\":false,\"getInputValues\":null,\"constraints\":null,\"valueUniqueUid\":null,\"ownerId\":\"org.openecomp.groups.VfModule.1.0.grouptype.max_vf_module_instances\"}]";
-// GroupProperty property = gson.fromJson(propertyObjectJson, GroupProperty.class);
- RestResponse updateGroupPropertyResponse = PropertyRestUtils.updateGroupProperty(resource, groupId, propertyObjectJson, user);
-
- if (validateState) {
- assertTrue("update group property to resource failed: " + updateGroupPropertyResponse.getResponseMessage(), updateGroupPropertyResponse.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
- }
-
- if (updateGroupPropertyResponse.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS) {
- GroupDefinition responseGroupDefinition = ResponseParser.convertPropertyResponseToObject(updateGroupPropertyResponse.getResponse());
- return Either.left(responseGroupDefinition);
- }
- return Either.right(updateGroupPropertyResponse);
- }
-
-
- public static RestResponse createDefaultConsumer(Boolean validateState) {
- try {
- ConsumerDataDefinition defaultConsumerDefinition = ElementFactory.getDefaultConsumerDetails();
- RestResponse createResponse = ConsumerRestUtils.createConsumer(defaultConsumerDefinition, ElementFactory.getDefaultUser(UserRoleEnum.ADMIN));
- BaseRestUtils.checkCreateResponse(createResponse);
-
- if (validateState) {
- assertTrue(createResponse.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED);
- }
- return createResponse;
- } catch (Exception e) {
- throw new AtomicOperationException(e);
- }
- }
-
- /**
- * Builds Resource From rest response
- *
- * @param resourceResp
- * @return
- */
- public static Either<Resource, RestResponse> buildResourceFromResponse(RestResponse resourceResp) {
- Either<Resource, RestResponse> result;
- if (resourceResp.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED) {
- Resource resourceResponseObject = ResponseParser.convertResourceResponseToJavaObject(resourceResp.getResponse());
- result = Either.left(resourceResponseObject);
- } else {
- result = Either.right(resourceResp);
- }
- return result;
- }
-
- private static class AtomicOperationException extends RuntimeException {
- private AtomicOperationException(Exception e) {
- super(e);
- }
-
- private static final long serialVersionUID = 1L;
- }
-
- /**
- * Import resource from CSAR
- *
- * @param resourceType
- * @param userRole
- * @param fileName
- * @param filePath
- * @return Resource
- * @throws Exception
- */
- public static Resource importResourceFromCsar(ResourceTypeEnum resourceType, UserRoleEnum userRole, String fileName, String... filePath) throws Exception {
- // Get the CSARs path
- String realFilePath = System.getProperty("user.dir") + File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator + "CI" + File.separator + "csars" ;
- if (filePath != null && filePath.length > 0) {
- StringBuilder result = new StringBuilder();
- for(String currStr: filePath){
- result.append(currStr);
- }
-// realFilePath = Arrays.toString(filePath);
- realFilePath = result.toString();
- }
-
- // Create default import resource & user
- return importResourceFromCsarFile(resourceType, userRole, fileName, realFilePath);
- }
-
- public static Resource importResourceFromCsarFile(ResourceTypeEnum resourceType, UserRoleEnum userRole, String csarFileName, String csarFilePath) throws Exception{
- RestResponse createResource = getCreateResourceRestResponse(resourceType, userRole, csarFileName, csarFilePath);
- BaseRestUtils.checkCreateResponse(createResource);
- return ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
- }
-
- public static Resource importCertifiedResourceFromCsar(ResourceTypeEnum resourceType, UserRoleEnum userRole, String csarFileName, String csarFilePath) throws Exception{
- RestResponse createResource = getCreateCertifiedResourceRestResponse(resourceType, userRole, csarFileName, csarFilePath);
- BaseRestUtils.checkSuccess(createResource);
- return ResponseParser.parseToObjectUsingMapper(createResource.getResponse(), Resource.class);
- }
- public static RestResponse getCreateResourceRestResponse(ResourceTypeEnum resourceType, UserRoleEnum userRole,
- String csarFileName, String csarFilePath) throws IOException, Exception {
-
- ImportReqDetails resourceDetails = buildImportReqDetails(resourceType, csarFileName, csarFilePath);
- User sdncModifierDetails = ElementFactory.getDefaultUser(userRole);
- RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
- return createResource;
- }
-
- public static RestResponse getCreateCertifiedResourceRestResponse(ResourceTypeEnum resourceType, UserRoleEnum userRole,
- String csarFileName, String csarFilePath) throws IOException, Exception {
-
- ImportReqDetails resourceDetails = buildImportReqDetails(resourceType, csarFileName, csarFilePath);
- User sdncModifierDetails = ElementFactory.getDefaultUser(userRole);
- RestResponse response = ResourceRestUtils.createResource(resourceDetails, sdncModifierDetails);
- BaseRestUtils.checkCreateResponse(response);
- return LCSbaseTest.certifyResource(resourceDetails, sdncModifierDetails);
- }
-
- private static ImportReqDetails buildImportReqDetails(ResourceTypeEnum resourceType, String csarFileName, String csarFilePath) throws IOException {
- ImportReqDetails resourceDetails = ElementFactory.getDefaultImportResource();
- Path path = Paths.get(csarFilePath + File.separator + csarFileName);
- byte[] data = Files.readAllBytes(path);
- String payloadName = csarFileName;
- String payloadData = Base64.encodeBase64String(data);
- resourceDetails.setPayloadData(payloadData);
- resourceDetails.setCsarUUID(payloadName);
- resourceDetails.setPayloadName(payloadName);
- resourceDetails.setResourceType(resourceType.name());
- return resourceDetails;
- }
-
- public static Resource updateResourceFromCsar(Resource resource, UserRoleEnum userRole, String csarFileName, String csarFilePath) throws Exception{
- User sdncModifierDetails = ElementFactory.getDefaultUser(userRole);
-
- byte[] data = null;
- Path path = Paths.get(csarFilePath + File.separator + csarFileName);
- data = Files.readAllBytes(path);
- String payloadName = csarFileName;
- String payloadData = Base64.encodeBase64String(data);
- ImportReqDetails resourceDetails = new ImportReqDetails(resource, payloadName, payloadData);
- resourceDetails.setPayloadData(payloadData);
- resourceDetails.setCsarUUID(payloadName);
- resourceDetails.setPayloadName(payloadName);
-
- String userId = sdncModifierDetails.getUserId();
- Config config = Utils.getConfig();
- String url = String.format(Urls.UPDATE_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort(), resource.getUniqueId());
-
- Map<String, String> headersMap = ResourceRestUtils.prepareHeadersMap(userId);
-
- Gson gson = new Gson();
- String userBodyJson = gson.toJson(resourceDetails);
- String calculateMD5 = GeneralUtility.calculateMD5Base64EncodedByString(userBodyJson);
- headersMap.put(HttpHeaderEnum.Content_MD5.getValue(), calculateMD5);
- HttpRequest http = new HttpRequest();
- RestResponse updateResourceResponse = http.httpSendPut(url, userBodyJson, headersMap);
- BaseRestUtils.checkSuccess(updateResourceResponse);
- return ResponseParser.parseToObjectUsingMapper(updateResourceResponse.getResponse(), Resource.class);
- }
-
- public static Either<Resource, RestResponse> importResourceByFileName(ResourceTypeEnum resourceType, UserRoleEnum userRole, String fileName, Boolean validateState, String... filePath) throws IOException {
-
- String realFilePath = System.getProperty("user.dir") + File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator + "CI" + File.separator + "csars" ;
- if (filePath != null && filePath.length > 0) {
- realFilePath = filePath.toString();
- }
-
- try {
- User defaultUser = ElementFactory.getDefaultUser(userRole);
- ResourceReqDetails defaultResource = ElementFactory.getDefaultResource(defaultUser);
- ImportReqDetails defaultImportResource = ElementFactory.getDefaultImportResource(defaultResource);
- ImportUtils.getImportResourceDetailsByPathAndName(defaultImportResource, realFilePath, fileName);
- RestResponse resourceResp = ResourceRestUtils.createResource(defaultImportResource, defaultUser);
-
- if (validateState) {
- assertTrue(resourceResp.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED);
- }
-
- if (resourceResp.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED) {
- Resource resourceResponseObject = ResponseParser.convertResourceResponseToJavaObject(resourceResp.getResponse());
- return Either.left(resourceResponseObject);
- }
- return Either.right(resourceResp);
- } catch (Exception e) {
- throw new AtomicOperationException(e);
- }
- }
-
- public static Either<String, RestResponse> getComponenetArtifactPayload(Component component, String artifactType) throws Exception {
-
- String url;
- Config config = Utils.getConfig();
- if(component.getComponentType().toString().toUpperCase().equals(ComponentTypeEnum.SERVICE.getValue().toUpperCase())){
- url = String.format(Urls.UI_DOWNLOAD_SERVICE_ARTIFACT, config.getCatalogBeHost(), config.getCatalogBePort(), component.getUniqueId(), component.getToscaArtifacts().get(artifactType).getUniqueId());
- }else{
- url = String.format(Urls.UI_DOWNLOAD_RESOURCE_ARTIFACT, config.getCatalogBeHost(), config.getCatalogBePort(), component.getUniqueId(), component.getToscaArtifacts().get(artifactType).getUniqueId());
- }
- String userId = component.getLastUpdaterUserId();
- Map<String, String> headersMap = new HashMap<>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), BaseRestUtils.contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.CACHE_CONTROL.getValue(), BaseRestUtils.cacheControlHeader);
- headersMap.put(HttpHeaderEnum.AUTHORIZATION.getValue(), basicAuthentication);
- headersMap.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), BaseRestUtils.xEcompInstanceId);
- if (userId != null) {
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), userId);
- }
- HttpRequest http = new HttpRequest();
- RestResponse response = http.httpSendGet(url, headersMap);
- if (response.getErrorCode() != BaseRestUtils.STATUS_CODE_SUCCESS && response.getResponse().getBytes() == null && response.getResponse().getBytes().length == 0) {
- return Either.right(response);
- }
- return Either.left(response.getResponse());
-
- }
-
- public static RestResponse getDistributionStatusByDistributionId(String distributionId, Boolean validateState) {
-
- try {
- User defaultUser = ElementFactory.getDefaultUser(UserRoleEnum.OPS);
- RestResponse response = DistributionUtils.getDistributionStatus(defaultUser, distributionId);
-
- if (validateState) {
- assertTrue(response.getErrorCode() == ResourceRestUtils.STATUS_CODE_SUCCESS);
- }
- return response;
-
- } catch (Exception e) {
- throw new AtomicOperationException(e);
- }
- }
-
- public static Either <RestResponse, Map<String, List<DistributionMonitorObject>>> getSortedDistributionStatusMap(Service service, Boolean validateState) {
-
- try {
- ServiceDistributionStatus serviceDistributionObject = DistributionUtils.getLatestServiceDistributionObject(service);
- RestResponse response = getDistributionStatusByDistributionId(serviceDistributionObject.getDistributionID(), true);
- if(validateState) {
- assertTrue(response.getErrorCode() == ResourceRestUtils.STATUS_CODE_SUCCESS);
- }
- if(response.getErrorCode() == ResourceRestUtils.STATUS_CODE_SUCCESS){
- Map<String, List<DistributionMonitorObject>> parsedDistributionStatus = DistributionUtils.getSortedDistributionStatus(response);
- return Either.right(parsedDistributionStatus);
- }
- return Either.left(response);
- } catch (Exception e) {
- throw new AtomicOperationException(e);
- }
-
- }
-
-
- /**
- * @param service
- * @param pollingCount
- * @param pollingInterval
- * Recommended values for service distribution for pollingCount is 4 and for pollingInterval is 15000ms
- * @throws Exception
- */
- public static Boolean distributeAndValidateService(Service service, int pollingCount, int pollingInterval) throws Exception {
- int firstPollingInterval = 30000; //this value define first be polling topic time, should change if DC configuration changed
- Boolean statusFlag = true;
- AtomicOperationUtils.distributeService(service, true);
- TimeUnit.MILLISECONDS.sleep(firstPollingInterval);
- int timeOut = pollingCount * pollingInterval;
- com.clearspring.analytics.util.Pair<Boolean,Map<String,List<String>>> verifyDistributionStatus = null;
-
- while (timeOut > 0) {
- Map<String,List<DistributionMonitorObject>> sortedDistributionStatusMap = AtomicOperationUtils.getSortedDistributionStatusMap(service, true).right().value();
- verifyDistributionStatus = DistributionUtils.verifyDistributionStatus(sortedDistributionStatusMap);
- if(verifyDistributionStatus.left.equals(false)){
- TimeUnit.MILLISECONDS.sleep(pollingInterval);
- timeOut-=pollingInterval;
- }else {
- timeOut = 0;
- }
- }
-
- if((verifyDistributionStatus.right != null && ! verifyDistributionStatus.right.isEmpty())){
- for(Entry<String, List<String>> entry : verifyDistributionStatus.right.entrySet()){
- if(ComponentBaseTest.getExtendTest() != null){
- ComponentBaseTest.getExtendTest().log(Status.INFO, "Consumer: " + entry.getKey() + " failed on following: "+ entry.getValue());
- }else{
- System.out.println("Consumer: [" + entry.getKey() + "] failed on following: "+ entry.getValue());
- }
- }
- statusFlag = false;
- }
- return statusFlag;
- }
-
- public static Boolean distributeAndValidateService(Service service) throws Exception {
- return distributeAndValidateService(service, 10, 10000);
- }
-
- /**
- * @param resource to download csar file via API
- * @return Tosca definition object from main yaml file
- */
- public static ToscaDefinition downloadAndGetToscaMainYamlObjectApi(Resource resource, File filesFolder) throws Exception {
- File vfCsarFileName = new File(File.separator + "VfCsar_" + ElementFactory.generateUUIDforSufix() + ".csar");
- OnboardingUtillViaApis.downloadToscaCsarToDirectory(resource, new File(filesFolder.getPath() + vfCsarFileName));
- return ToscaParserUtils.parseToscaMainYamlToJavaObjectByCsarLocation(new File(filesFolder.getPath() + vfCsarFileName));
- }
-
-
- public static ComponentInstance getServiceComponentInstanceByName(Service service, String name, Boolean validateState){
- List<ComponentInstance> compInstances = service.getComponentInstances();
- for (ComponentInstance instance: compInstances){
- String compName = instance.getName();
- if (compName.equals(name))
- return instance;
- }
- if (validateState) {
- assertEquals("Component instance name " + name + " not found", name, null);
- }
- return null;
- }
-
- public static Pair<Component, ComponentInstance> updateComponentInstanceName(String newName, Component component, String canvasElementName, User user, Boolean validateState) throws Exception {
- ComponentInstanceReqDetails componentInstanceReqDetails = ElementFactory.getDefaultComponentInstance();
- ComponentInstance componentInstanceByName = AtomicOperationUtils.getComponentInstanceByName(component, canvasElementName);
- componentInstanceReqDetails.setName(newName);
- componentInstanceReqDetails.setComponentUid(componentInstanceByName.getComponentUid());
- componentInstanceReqDetails.setUniqueId(componentInstanceByName.getUniqueId());
- return AtomicOperationUtils.updateComponentInstance(componentInstanceReqDetails, user, component, validateState).left().value();
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/Convertor.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/Convertor.java
deleted file mode 100644
index 031d2d8e72..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/Convertor.java
+++ /dev/null
@@ -1,337 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.general;
-
-import org.apache.commons.lang3.StringUtils;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.model.LifecycleStateEnum;
-import org.openecomp.sdc.be.model.Product;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.be.model.category.CategoryDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.*;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedProductAudit;
-import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedResourceAuditJavaObject;
-import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedUserCRUDAudit;
-import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
-import org.openecomp.sdc.common.api.Constants;
-
-import java.io.FileNotFoundException;
-import java.util.ArrayList;
-import java.util.List;
-
-import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_CREATED;
-import static org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils.STATUS_CODE_SUCCESS;
-
-public class Convertor {
- // ***** resource *****
- public static ResourceRespJavaObject constructFieldsForRespValidation(ResourceReqDetails resourceDetails,
- String resourceVersion) {
- return convertToRespObject(resourceDetails, resourceVersion, UserRoleEnum.ADMIN.getUserId(),
- UserRoleEnum.ADMIN.getUserName());
-
- }
-
- public static ResourceRespJavaObject constructFieldsForRespValidation(ResourceReqDetails resourceDetails) {
- return convertToRespObject(resourceDetails, resourceDetails.getVersion(), UserRoleEnum.ADMIN.getUserId(),
- UserRoleEnum.ADMIN.getUserName());
-
- }
-
- public static ResourceRespJavaObject constructFieldsForRespValidation(ResourceReqDetails resourceDetails,
- String resourceVersion, User user) {
- return convertToRespObject(resourceDetails, resourceVersion, user.getUserId(), user.getFullName());
-
- }
-
- private static ResourceRespJavaObject convertToRespObject(ResourceReqDetails resourceDetails,
- String resourceVersion, String userId, String userName) {
- ResourceRespJavaObject resourceRespJavaObject = new ResourceRespJavaObject();
-
- resourceRespJavaObject.setUniqueId(resourceDetails.getUniqueId());
- resourceRespJavaObject.setName(resourceDetails.getName());
- resourceRespJavaObject.setCreatorUserId(resourceDetails.getCreatorUserId());
- resourceRespJavaObject.setCreatorFullName(resourceDetails.getCreatorFullName());
- resourceRespJavaObject.setLastUpdaterUserId(userId);
- resourceRespJavaObject.setLastUpdaterFullName(userName);
- resourceRespJavaObject.setDescription(resourceDetails.getDescription());
- resourceRespJavaObject.setIcon(resourceDetails.getIcon());
- resourceRespJavaObject.setTags(resourceDetails.getTags());
- resourceRespJavaObject.setIsHighestVersion("true");
- resourceRespJavaObject.setCategories(resourceDetails.getCategories());
- resourceRespJavaObject.setLifecycleState(
- resourceDetails.getLifecycleState() != null ? resourceDetails.getLifecycleState().toString()
- : LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.toString());
- // resourceRespJavaObject.setLifecycleState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
- resourceRespJavaObject.setDerivedFrom(resourceDetails.getDerivedFrom());
- resourceRespJavaObject.setVendorName(resourceDetails.getVendorName());
- resourceRespJavaObject.setVendorRelease(resourceDetails.getVendorRelease());
- resourceRespJavaObject.setContactId(resourceDetails.getContactId());
- resourceRespJavaObject.setAbstractt("false");
- resourceRespJavaObject.setVersion(resourceVersion);
- resourceRespJavaObject.setCost(resourceDetails.getCost());
- resourceRespJavaObject.setLicenseType(resourceDetails.getLicenseType());
- resourceRespJavaObject.setResourceType(resourceDetails.getResourceType());
-
- return resourceRespJavaObject;
-
- }
-
- // ********** service **************
-
- // public static ServiceRespJavaObject
- // constructFieldsForRespValidation(ServiceReqDetails serviceDetails, String
- // serviceVersion, User user) {
- // return convertToRespObject(serviceDetails, serviceVersion,
- // user.getUserId(), user.getFullName());
- //
- // }
- //
- // private static ServiceRespJavaObject
- // convertToRespObject(ServiceReqDetails serviceDetails, String
- // serviceVersion, String userId, String userName) {
- // ServiceRespJavaObject serviceRespJavaObject = new
- // ServiceRespJavaObject();
- //
- // serviceRespJavaObject.setUniqueId(serviceDetails.getUniqueId());
- // serviceRespJavaObject.setName(serviceDetails.getName());
- // serviceRespJavaObject.setCreatorUserId(userId);
- // serviceRespJavaObject.setCreatorFullName(userName);
- // serviceRespJavaObject.setLastUpdaterUserId(userId);
- // serviceRespJavaObject.setLastUpdaterFullName(userName);
- // serviceRespJavaObject.setDescription(serviceDetails.getDescription());
- // serviceRespJavaObject.setIcon(serviceDetails.getIcon());
- // serviceRespJavaObject.setCategory(serviceDetails.getCategory());
- // serviceRespJavaObject.setLifecycleState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
- // serviceRespJavaObject.setContactId(serviceDetails.getContactId());
- // serviceRespJavaObject.setVersion(serviceVersion);
- //
- // return serviceRespJavaObject;
- // }
-
- // ********** product **************
-
- public static Product constructFieldsForRespValidation(ProductReqDetails productDetails, String productVersion,
- User user) {
- return convertToRespObject(productDetails, productVersion, user.getUserId(), user.getFullName());
- }
-
- private static Product convertToRespObject(ProductReqDetails productDetails, String productVersion, String userId,
- String userName) {
- Product expectedProduct = new Product();
-
- expectedProduct.setUniqueId(productDetails.getUniqueId());
- expectedProduct.setName(productDetails.getName());
- expectedProduct.setFullName(productDetails.getFullName());
- expectedProduct.setCreatorUserId(productDetails.getCreatorUserId());
- expectedProduct.setCreatorFullName(productDetails.getCreatorFullName());
- expectedProduct.setLastUpdaterUserId(userId);
- expectedProduct.setLastUpdaterFullName(userName);
- expectedProduct.setDescription(productDetails.getDescription());
- // expectedProduct.setIcon(resourceDetails.getIcon());
- expectedProduct.setTags(productDetails.getTags());
- expectedProduct.setHighestVersion(true);
- List<CategoryDefinition> categories = productDetails.getCategories();
- if (categories == null) {
- categories = new ArrayList<>();
- }
- expectedProduct.setCategories(categories);
- expectedProduct.setState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
- expectedProduct.setVersion(productVersion);
- expectedProduct.setContacts(productDetails.getContacts());
- return expectedProduct;
- }
-
- // ***** audit *****
-
- public static ExpectedResourceAuditJavaObject constructFieldsForAuditValidation(ResourceReqDetails resourceDetails,
- String resourceVersion) {
- return convertToAuditObject(resourceDetails, resourceVersion, UserRoleEnum.ADMIN.getUserId(),
- UserRoleEnum.ADMIN.getUserName());
- }
-
- public static ExpectedResourceAuditJavaObject constructFieldsForAuditValidation(
- ResourceReqDetails resourceDetails) {
- return convertToAuditObject(resourceDetails, resourceDetails.getVersion(), UserRoleEnum.ADMIN.getUserId(),
- UserRoleEnum.ADMIN.getUserName());
- }
-
- public static ExpectedResourceAuditJavaObject constructFieldsForAuditValidation(ResourceReqDetails resourceDetails,
- String resourceVersion, User user) {
- return convertToAuditObject(resourceDetails, resourceVersion, user.getUserId(), user.getFullName());
- }
-
- private static ExpectedResourceAuditJavaObject convertToAuditObject(ResourceReqDetails resourceDetails,
- String resourceVersion, String userId, String userName) {
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
-
- expectedResourceAuditJavaObject.setAction("Checkout");
- expectedResourceAuditJavaObject.setModifierName(userName);
- expectedResourceAuditJavaObject.setModifierUid(userId);
- expectedResourceAuditJavaObject.setStatus("200.0");
- expectedResourceAuditJavaObject.setDesc("OK");
- expectedResourceAuditJavaObject.setResourceName(resourceDetails.getName());
- expectedResourceAuditJavaObject.setResourceType("Resource");
- expectedResourceAuditJavaObject.setPrevVersion(String.valueOf(Float.parseFloat(resourceVersion) - 0.1f));
- expectedResourceAuditJavaObject.setCurrVersion(resourceVersion);
- expectedResourceAuditJavaObject.setPrevState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
- expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
- expectedResourceAuditJavaObject.setComment(null);
-
- return expectedResourceAuditJavaObject;
- }
-
- public static ExpectedProductAudit constructFieldsForAuditValidation(Product productDetails, String action,
- User user, ActionStatus actionStatus, String prevVersion, String currVersion, LifecycleStateEnum prevState,
- LifecycleStateEnum currState, String uuid, String... errorMessageParams) throws FileNotFoundException {
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(actionStatus.name());
- return convertToAuditObject(productDetails, action, user, errorInfo, prevVersion, currVersion, prevState,
- currState, uuid, errorMessageParams);
- }
-
- private static ExpectedProductAudit convertToAuditObject(Product productDetails, String action, User user,
- ErrorInfo errorInfo, String prevVersion, String currVersion, LifecycleStateEnum prevState,
- LifecycleStateEnum currState, String uuid, String... errorMessageParams) {
- ExpectedProductAudit expectedProductAudit = new ExpectedProductAudit();
-
- expectedProductAudit.setACTION(action);
- String userUserId = user.getUserId();
- String userFullName;
- if (StringUtils.isEmpty(user.getFirstName()) && StringUtils.isEmpty(user.getLastName())) {
- userFullName = "";
- } else {
- userFullName = user.getFullName();
- }
- if (StringUtils.isEmpty(userUserId)) {
- userUserId = "UNKNOWN";
- }
- expectedProductAudit.setMODIFIER(
- !StringUtils.isEmpty(userFullName) ? userFullName + "(" + userUserId + ")" : "(" + userUserId + ")");
- expectedProductAudit.setSTATUS(Integer.toString(errorInfo.getCode()));
- expectedProductAudit.setDESC(errorInfo.getAuditDesc((Object[]) (errorMessageParams)));
- expectedProductAudit
- .setRESOURCE_NAME(productDetails != null ? productDetails.getName() : Constants.EMPTY_STRING);
- expectedProductAudit.setRESOURCE_TYPE("Product");
- expectedProductAudit.setPREV_VERSION(prevVersion);
- expectedProductAudit.setCURR_VERSION(currVersion);
- expectedProductAudit.setPREV_STATE(prevState != null ? prevState.name() : Constants.EMPTY_STRING);
- expectedProductAudit.setCURR_STATE(currState != null ? currState.name() : Constants.EMPTY_STRING);
- expectedProductAudit.setSERVICE_INSTANCE_ID(uuid);
- return expectedProductAudit;
- }
-
- ////////////////
- // Convertor.constructFieldsForAuditValidationSuccess(addUser,
- //////////////// sdncAdminUser, mechIdUser, null, STATUS_CODE_CREATED);
- public static ExpectedUserCRUDAudit constructFieldsForAuditValidation(String action, User userModifier,
- ActionStatus actionStatus, User userAfter, User userBefore, Object... variables) throws Exception {
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(actionStatus.name());
- ExpectedUserCRUDAudit expectedAddUserAuditJavaObject = new ExpectedUserCRUDAudit();
- expectedAddUserAuditJavaObject.setAction(action);
- expectedAddUserAuditJavaObject.setModifier(
- userModifier.getFirstName() != null ? userModifier.getFullName() + "(" + userModifier.getUserId() + ")"
- : "(" + userModifier.getUserId() + ")");
- String status = Integer.toString(errorInfo.getCode());
- expectedAddUserAuditJavaObject.setStatus(status);
- if (errorInfo.getCode() == STATUS_CODE_SUCCESS || errorInfo.getCode() == STATUS_CODE_CREATED) {
- expectedAddUserAuditJavaObject.setDesc("OK");
- } else {
- expectedAddUserAuditJavaObject.setDesc(errorInfo.getAuditDesc(variables));
- }
- expectedAddUserAuditJavaObject.setUserBefore(userBefore != null
- ? userBefore.getUserId() + ", " + userBefore.getFirstName() + " " + userBefore.getLastName() + ", "
- + userBefore.getEmail() + ", " + userBefore.getRole()
- : Constants.EMPTY_STRING);
- expectedAddUserAuditJavaObject.setUserAfter(userAfter != null
- ? userAfter.getUserId() + ", " + userAfter.getFirstName() + " " + userAfter.getLastName() + ", "
- + userAfter.getEmail() + ", " + userAfter.getRole()
- : Constants.EMPTY_STRING);
- return expectedAddUserAuditJavaObject;
- }
-
- // For RESOURCE and SERVICE same Audit
- public static ExpectedResourceAuditJavaObject constructFieldsForAuditValidation(
- ComponentReqDetails componentDetails, String action, User userModifier, ActionStatus actionStatus,
- String currVersion, String prevVersion, String curState, String prevState, String uuid, String comment,
- Object... variables) throws Exception {
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(actionStatus.name());
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
- expectedResourceAuditJavaObject.setAction(action);
- expectedResourceAuditJavaObject.setMODIFIER(
- userModifier.getFirstName() != null ? userModifier.getFullName() + "(" + userModifier.getUserId() + ")"
- : "(" + userModifier.getUserId() + ")");
- String status = Integer.toString(errorInfo.getCode());
- expectedResourceAuditJavaObject.setStatus(status);
- if (errorInfo.getCode() == STATUS_CODE_SUCCESS || errorInfo.getCode() == STATUS_CODE_CREATED) {
- expectedResourceAuditJavaObject.setDesc("OK");
- } else {
- expectedResourceAuditJavaObject.setDesc(errorInfo.getAuditDesc(variables));
- }
- expectedResourceAuditJavaObject.setCurrState(curState);
- expectedResourceAuditJavaObject.setPrevState(prevState);
- expectedResourceAuditJavaObject.setCurrVersion(currVersion);
- expectedResourceAuditJavaObject.setPrevVersion(prevVersion);
- expectedResourceAuditJavaObject.setComment(comment);
- expectedResourceAuditJavaObject.setSERVICE_INSTANCE_ID(uuid);
- if (componentDetails instanceof ServiceReqDetails) {
- expectedResourceAuditJavaObject.setResourceName(((ServiceReqDetails) componentDetails).getName());
- expectedResourceAuditJavaObject.setResourceType("Service");
- }
- if (componentDetails instanceof ResourceReqDetails) {
- expectedResourceAuditJavaObject.setResourceName(((ResourceReqDetails) componentDetails).getName());
- expectedResourceAuditJavaObject.setResourceType("Resource");
- }
- return expectedResourceAuditJavaObject;
- }
-
- // Distribution Service Audit
- public static ExpectedResourceAuditJavaObject constructFieldsForDistributionAuditValidation(
- ComponentReqDetails componentDetails, String action, User userModifier, ActionStatus actionStatus,
- String currVersion, String distCurrStatus, String distProvStatus, String curState, String uuid,
- String comment, Object... variables) throws Exception {
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(actionStatus.name());
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
- expectedResourceAuditJavaObject.setAction(action);
- expectedResourceAuditJavaObject.setMODIFIER(
- userModifier.getFirstName() != null ? userModifier.getFullName() + "(" + userModifier.getUserId() + ")"
- : "(" + userModifier.getUserId() + ")");
- String status = Integer.toString(errorInfo.getCode());
- expectedResourceAuditJavaObject.setStatus(status);
- if (errorInfo.getCode() == STATUS_CODE_SUCCESS || errorInfo.getCode() == STATUS_CODE_CREATED) {
- expectedResourceAuditJavaObject.setDesc("OK");
- } else {
- expectedResourceAuditJavaObject.setDesc(errorInfo.getAuditDesc(variables));
- }
- expectedResourceAuditJavaObject.setCurrState(curState);
- expectedResourceAuditJavaObject.setCurrVersion(currVersion);
- expectedResourceAuditJavaObject.setDcurrStatus(distCurrStatus);
- expectedResourceAuditJavaObject.setDprevStatus(distProvStatus);
- expectedResourceAuditJavaObject.setComment(comment);
- expectedResourceAuditJavaObject.setSERVICE_INSTANCE_ID(uuid);
- if (componentDetails instanceof ServiceReqDetails) {
- expectedResourceAuditJavaObject.setResourceName(((ServiceReqDetails) componentDetails).getName());
- expectedResourceAuditJavaObject.setResourceType("Service");
- }
- return expectedResourceAuditJavaObject;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/ElementFactory.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/ElementFactory.java
deleted file mode 100644
index 31b8c5b47a..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/ElementFactory.java
+++ /dev/null
@@ -1,1051 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.general;
-
-import org.apache.commons.lang.StringUtils;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.datatypes.elements.ConsumerDataDefinition;
-import org.openecomp.sdc.be.datatypes.enums.AssetTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.OriginTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.*;
-import org.openecomp.sdc.be.model.category.CategoryDefinition;
-import org.openecomp.sdc.be.model.category.GroupingDefinition;
-import org.openecomp.sdc.be.model.category.SubCategoryDefinition;
-import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
-import org.openecomp.sdc.ci.tests.datatypes.*;
-import org.openecomp.sdc.ci.tests.datatypes.enums.*;
-import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedExternalAudit;
-import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedResourceAuditJavaObject;
-import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
-import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
-import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
-import org.openecomp.sdc.common.util.ValidationUtils;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.UUID;
-
-public final class ElementFactory {
-
- private static final String CI_SERVICE = "ciService";
- private static final String CI_RES = "ciRes";
- private static final String CI_PRODUCT = "CiProduct";
- private static String DEFAULT_ARTIFACT_LABEL = "artifact1";
- private static final String RESOURCE_INSTANCE_POS_X = "20";
- private static final String RESOURCE_INSTANCE_POS_Y = "20";
- private static final String RESOURCE_INSTANCE_DESCRIPTION = "description";
-
- private ElementFactory() {
-
- }
-
- // *** Getters ***
-
- public static String getServicePrefix() {
- return CI_SERVICE;
- }
-
- public static String getResourcePrefix() {
- return CI_RES;
- }
-
- public static String getProductPrefix() {
- return CI_PRODUCT;
- }
-
- // *** RESOURCE ***
-
- public static ResourceReqDetails getDefaultResource() {
- return getDefaultResource(CI_RES, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, "jh0003");
- }
-
- public static ResourceReqDetails getDefaultResource(ResourceCategoryEnum category) {
- return getDefaultResource(CI_RES, NormativeTypesEnum.ROOT, category, "jh0003");
- }
-
- public static ResourceReqDetails getDefaultResource(String contactId) {
- return getDefaultResource(CI_RES, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, contactId);
- }
-
- public static ResourceReqDetails getDefaultResource(User modifier) {
- return getDefaultResource(CI_RES, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, modifier.getUserId());
- }
-
- public static ResourceReqDetails getDefaultResource(NormativeTypesEnum derivedFrom, ResourceCategoryEnum category) {
- return getDefaultResource(CI_RES, derivedFrom, category, "jh0003");
- }
-
- public static ResourceReqDetails getDefaultResource(NormativeTypesEnum derivedFrom) {
- return getDefaultResource(CI_RES, derivedFrom, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, "jh0003");
- }
-
- public static ResourceReqDetails getDefaultResource(String resourceName, NormativeTypesEnum derivedFrom) {
- return getDefaultResource(resourceName, derivedFrom, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, "jh0003");
- }
-
- public static ResourceReqDetails getDefaultResource(NormativeTypesEnum derivedFrom, String contactId) {
- return getDefaultResource(CI_RES, derivedFrom, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, contactId);
- }
-
- // New
- public static ResourceReqDetails getDefaultResourceByType(ResourceTypeEnum ResourceType, String resourceName, ResourceCategoryEnum resourceCategory, String vendorName, String vendorModelNumber) {
- return getDefaultResourceByType(resourceName, NormativeTypesEnum.ROOT, resourceCategory, "jh0003", ResourceType.toString(), vendorName, vendorModelNumber);
- }
-
- public static ResourceReqDetails getDefaultResourceByType(ResourceTypeEnum ResourceType, String resourceName) {
- return getDefaultResourceByType(resourceName, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, "jh0003", ResourceType.toString());
- }
-
- public static ResourceReqDetails getDefaultResourceByType(ResourceTypeEnum ResourceType, User user) {
- return getDefaultResourceByType(CI_RES, NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_LOAD_BALANCER, user.getUserId(), ResourceType.toString());
- }
-
- public static ResourceReqDetails getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum resourceType, NormativeTypesEnum normativeTypes, ResourceCategoryEnum resourceCategory, User user) {
- return getDefaultResourceByType(CI_RES, normativeTypes, resourceCategory, user.getUserId(), resourceType.toString());
- }
-
- public static PropertyReqDetails getDefaultMapProperty(PropertyTypeEnum innerType) {
- return getPropertyDetails(innerType);
- }
-
- public static PropertyReqDetails getDefaultMapProperty() {
- return getPropertyDetails(PropertyTypeEnum.STRING_MAP);
- }
-
- public static ResourceReqDetails getDefaultResource(String resourceName, NormativeTypesEnum derived, ResourceCategoryEnum category, String contactId) {
- resourceName = addRandomSuffixToName(resourceName);
- String description = "Represents a generic software component that can be managed and run by a Compute Node Type.";
- ArrayList<String> resourceTags = new ArrayList<>();
- resourceTags.add(resourceName);
-
- ArrayList<String> derivedFrom = new ArrayList<>();
- derivedFrom.add(derived.normativeName);
- String vendorName = "ATT Tosca";
- String vendorRelease = "1.0.0.wd03";
- String icon = "defaulticon";
- ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, null, derivedFrom, vendorName, vendorRelease, contactId, icon);
- resourceDetails.addCategoryChain(category.getCategory(), category.getSubCategory());
- resourceDetails.setResourceVendorModelNumber("vendorNumber-1.5.7");
-
- return resourceDetails;
-
- }
-
- public static ResourceReqDetails getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum resourceType, Resource normativeTypes, ResourceCategoryEnum resourceCategory, User user) {
- return getDefaultResource(CI_RES + resourceType, normativeTypes, resourceCategory, user.getUserId());
- }
-
- public static ResourceReqDetails getDefaultResource(String resourceName, Resource derived, ResourceCategoryEnum category, String contactId) {
- resourceName = addRandomSuffixToName(resourceName);
- String description = "Represents a generic software component that can be managed and run by a Compute Node Type.";
- ArrayList<String> resourceTags = new ArrayList<>();
- resourceTags.add(resourceName);
-
- ArrayList<String> derivedFrom = new ArrayList<>();
- derivedFrom.add(derived.getToscaResourceName());
- String vendorName = "ATT Tosca";
- String vendorRelease = "1.0.0.wd03";
- String icon = "defaulticon";
- ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, null, derivedFrom, vendorName, vendorRelease, contactId, icon);
- resourceDetails.addCategoryChain(category.getCategory(), category.getSubCategory());
-
- return resourceDetails;
-
- }
-
- public static String addRandomSuffixToName(final String name) {
- return name + generateUUIDforSufix();
- }
-
- public static ResourceReqDetails getDefaultResourceByType(String resourceName, NormativeTypesEnum derived, ResourceCategoryEnum category, String contactId, ResourceTypeEnum resourceType) {
- return getDefaultResourceByType(resourceName, derived, category, contactId, resourceType.toString());
- }
-
- // New
- public static ResourceReqDetails getDefaultResourceByType(String resourceName, NormativeTypesEnum derived, ResourceCategoryEnum category, String contactId, String resourceType) {
- resourceName = (resourceName + resourceType + generateUUIDforSufix());
- String description = "Represents a generic software component that can be managed and run by a Compute Node Type.";
- ArrayList<String> resourceTags = new ArrayList<>();
- resourceTags.add(resourceName);
- ArrayList<String> derivedFrom = null;
- if (derived != null) {
- derivedFrom = new ArrayList<String>();
- derivedFrom.add(derived.normativeName);
- }
- String vendorName = "ATT Tosca";
- String vendorRelease = "1.0.0.wd03";
- String icon = "defaulticon";
- ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, null, derivedFrom, vendorName, vendorRelease, contactId, icon, resourceType.toString());
- resourceDetails.addCategoryChain(category.getCategory(), category.getSubCategory());
- resourceDetails.setResourceVendorModelNumber("vendorNumber-1.5.7");
- return resourceDetails;
- }
-
- public static ResourceReqDetails getDefaultResourceByType(String resourceName, NormativeTypesEnum derived, ResourceCategoryEnum category, String contactId, String resourceType, String vendorName, String vendorModelNumber) {
- resourceName = (resourceName + resourceType + generateUUIDforSufix());
-
- String description = "Represents a generic software component that can be managed and run by a Compute Node Type.";
- ArrayList<String> resourceTags = new ArrayList<>();
- resourceTags.add(resourceName);
- ArrayList<String> derivedFrom = null;
- if (derived != null) {
- derivedFrom = new ArrayList<>();
- derivedFrom.add(derived.normativeName);
- }
- String vendorRelease = "1.0.0.wd03";
- String icon = "defaulticon";
- ResourceReqDetails resourceDetails = new ResourceReqDetails(resourceName, description, resourceTags, null, derivedFrom, vendorName, vendorRelease, contactId, icon, resourceType.toString());
- resourceDetails.addCategoryChain(category.getCategory(), category.getSubCategory());
- resourceDetails.setResourceVendorModelNumber(vendorModelNumber);
- return resourceDetails;
- }
-
- public static ResourceReqDetails getRandomCategoryResource() {
- ResourceReqDetails resourceDetails = getDefaultResource(ResourceCategoryEnum.getRandomElement());
- return resourceDetails;
- }
-
- public static ResourceExternalReqDetails getDefaultResourceByType(String resourceName, ResourceCategoryEnum category, String contactId, String resourceType) {
- resourceName = (resourceName + resourceType + generateUUIDforSufix());
- String description = "Represents a generic software component that can be managed and run by a Compute Node Type.";
- ArrayList<String> resourceTags = new ArrayList<>();
- resourceTags.add(resourceName);
- String vendorName = "ATT Tosca";
- String vendorRelease = "1.0.0.wd03";
- String icon = "defaulticon";
- ResourceExternalReqDetails resourceDetails = new ResourceExternalReqDetails(resourceName, description, resourceTags,
- vendorName, vendorRelease, contactId, icon,
- resourceType.toString(), category.getCategory(), category.getSubCategory());
- return resourceDetails;
- }
-
- // New
- public static ImportReqDetails getDefaultImportResourceByType(String resourceName, NormativeTypesEnum derived, ResourceCategoryEnum category, String contactId, String resourceType) {
- resourceName = (resourceName + resourceType + generateUUIDforSufix());
- String description = "Represents a generic software component that can be managed and run by a Compute Node Type.";
- ArrayList<String> resourceTags = new ArrayList<>();
- resourceTags.add(resourceName);
- ArrayList<String> derivedFrom = null;
- if (derived != null) {
- derivedFrom = new ArrayList<>();
- derivedFrom.add(derived.normativeName);
- }
- String vendorName = "ATT Tosca";
- String vendorRelease = "1.0.0.wd03";
- String icon = "defaulticon";
- ImportReqDetails resourceDetails = new ImportReqDetails(resourceName, description, resourceTags, derivedFrom, vendorName, vendorRelease, contactId, icon);
- resourceDetails.addCategoryChain(category.getCategory(), category.getSubCategory());
- return resourceDetails;
- }
- ////
-
- public static ImportReqDetails getDefaultImportResource(ResourceReqDetails resourceReqDetails) {
- ImportReqDetails importReqDetails = new ImportReqDetails(resourceReqDetails.getName(), resourceReqDetails.getDescription(), resourceReqDetails.getTags(), resourceReqDetails.getDerivedFrom(), resourceReqDetails.getVendorName(),
- resourceReqDetails.getVendorRelease(), resourceReqDetails.getContactId(), resourceReqDetails.getIcon());
- importReqDetails.setPayloadName("myCompute.yaml");
- importReqDetails.setCategories(resourceReqDetails.getCategories());
- importReqDetails.setPayloadData(
- "dG9zY2FfZGVmaW5pdGlvbnNfdmVyc2lvbjogdG9zY2Ffc2ltcGxlX3lhbWxfMV8wXzANCm5vZGVfdHlwZXM6IA0KICBjb20uYXR0LmQyLnJlc291cmNlLk15Q29tcHV0ZToNCiAgICBkZXJpdmVkX2Zyb206IHRvc2NhLm5vZGVzLlJvb3QNCiAgICBhdHRyaWJ1dGVzOg0KICAgICAgcHJpdmF0ZV9hZGRyZXNzOg0KICAgICAgICB0eXBlOiBzdHJpbmcNCiAgICAgIHB1YmxpY19hZGRyZXNzOg0KICAgICAgICB0eXBlOiBzdHJpbmcNCiAgICAgIG5ldHdvcmtzOg0KICAgICAgICB0eXBlOiBtYXANCiAgICAgICAgZW50cnlfc2NoZW1hOg0KICAgICAgICAgIHR5cGU6IHRvc2NhLmRhdGF0eXBlcy5uZXR3b3JrLk5ldHdvcmtJbmZvDQogICAgICBwb3J0czoNCiAgICAgICAgdHlwZTogbWFwDQogICAgICAgIGVudHJ5X3NjaGVtYToNCiAgICAgICAgICB0eXBlOiB0b3NjYS5kYXRhdHlwZXMubmV0d29yay5Qb3J0SW5mbw0KICAgIHJlcXVpcmVtZW50czoNCiAgICAgIC0gbG9jYWxfc3RvcmFnZTogDQogICAgICAgICAgY2FwYWJpbGl0eTogdG9zY2EuY2FwYWJpbGl0aWVzLkF0dGFjaG1lbnQNCiAgICAgICAgICBub2RlOiB0b3NjYS5ub2Rlcy5CbG9ja1N0b3JhZ2UNCiAgICAgICAgICByZWxhdGlvbnNoaXA6IHRvc2NhLnJlbGF0aW9uc2hpcHMuQXR0YWNoZXNUbw0KICAgICAgICAgIG9jY3VycmVuY2VzOiBbMCwgVU5CT1VOREVEXSAgDQogICAgY2FwYWJpbGl0aWVzOg0KICAgICAgaG9zdDogDQogICAgICAgIHR5cGU6IHRvc2NhLmNhcGFiaWxpdGllcy5Db250YWluZXINCiAgICAgICAgdmFsaWRfc291cmNlX3R5cGVzOiBbdG9zY2Eubm9kZXMuU29mdHdhcmVDb21wb25lbnRdIA0KICAgICAgZW5kcG9pbnQgOg0KICAgICAgICB0eXBlOiB0b3NjYS5jYXBhYmlsaXRpZXMuRW5kcG9pbnQuQWRtaW4gDQogICAgICBvczogDQogICAgICAgIHR5cGU6IHRvc2NhLmNhcGFiaWxpdGllcy5PcGVyYXRpbmdTeXN0ZW0NCiAgICAgIHNjYWxhYmxlOg0KICAgICAgICB0eXBlOiB0b3NjYS5jYXBhYmlsaXRpZXMuU2NhbGFibGUNCiAgICAgIGJpbmRpbmc6DQogICAgICAgIHR5cGU6IHRvc2NhLmNhcGFiaWxpdGllcy5uZXR3b3JrLkJpbmRhYmxlDQo=");
- return importReqDetails;
- }
-
- public static ImportReqDetails getDefaultImportResource() {
- ResourceReqDetails resourceReqDetails = getDefaultResource();
- ImportReqDetails importReqDetails = new ImportReqDetails(resourceReqDetails.getName(), resourceReqDetails.getDescription(), resourceReqDetails.getTags(), resourceReqDetails.getDerivedFrom(), resourceReqDetails.getVendorName(),
- resourceReqDetails.getVendorRelease(), resourceReqDetails.getContactId(), resourceReqDetails.getIcon());
- importReqDetails.setPayloadName("myCompute.yaml");
- importReqDetails.setCategories(resourceReqDetails.getCategories());
- importReqDetails.setPayloadData(
- "dG9zY2FfZGVmaW5pdGlvbnNfdmVyc2lvbjogdG9zY2Ffc2ltcGxlX3lhbWxfMV8wXzANCm5vZGVfdHlwZXM6IA0KICBjb20uYXR0LmQyLnJlc291cmNlLk15Q29tcHV0ZToNCiAgICBkZXJpdmVkX2Zyb206IHRvc2NhLm5vZGVzLlJvb3QNCiAgICBhdHRyaWJ1dGVzOg0KICAgICAgcHJpdmF0ZV9hZGRyZXNzOg0KICAgICAgICB0eXBlOiBzdHJpbmcNCiAgICAgIHB1YmxpY19hZGRyZXNzOg0KICAgICAgICB0eXBlOiBzdHJpbmcNCiAgICAgIG5ldHdvcmtzOg0KICAgICAgICB0eXBlOiBtYXANCiAgICAgICAgZW50cnlfc2NoZW1hOg0KICAgICAgICAgIHR5cGU6IHRvc2NhLmRhdGF0eXBlcy5uZXR3b3JrLk5ldHdvcmtJbmZvDQogICAgICBwb3J0czoNCiAgICAgICAgdHlwZTogbWFwDQogICAgICAgIGVudHJ5X3NjaGVtYToNCiAgICAgICAgICB0eXBlOiB0b3NjYS5kYXRhdHlwZXMubmV0d29yay5Qb3J0SW5mbw0KICAgIHJlcXVpcmVtZW50czoNCiAgICAgIC0gbG9jYWxfc3RvcmFnZTogDQogICAgICAgICAgY2FwYWJpbGl0eTogdG9zY2EuY2FwYWJpbGl0aWVzLkF0dGFjaG1lbnQNCiAgICAgICAgICBub2RlOiB0b3NjYS5ub2Rlcy5CbG9ja1N0b3JhZ2UNCiAgICAgICAgICByZWxhdGlvbnNoaXA6IHRvc2NhLnJlbGF0aW9uc2hpcHMuQXR0YWNoZXNUbw0KICAgICAgICAgIG9jY3VycmVuY2VzOiBbMCwgVU5CT1VOREVEXSAgDQogICAgY2FwYWJpbGl0aWVzOg0KICAgICAgaG9zdDogDQogICAgICAgIHR5cGU6IHRvc2NhLmNhcGFiaWxpdGllcy5Db250YWluZXINCiAgICAgICAgdmFsaWRfc291cmNlX3R5cGVzOiBbdG9zY2Eubm9kZXMuU29mdHdhcmVDb21wb25lbnRdIA0KICAgICAgZW5kcG9pbnQgOg0KICAgICAgICB0eXBlOiB0b3NjYS5jYXBhYmlsaXRpZXMuRW5kcG9pbnQuQWRtaW4gDQogICAgICBvczogDQogICAgICAgIHR5cGU6IHRvc2NhLmNhcGFiaWxpdGllcy5PcGVyYXRpbmdTeXN0ZW0NCiAgICAgIHNjYWxhYmxlOg0KICAgICAgICB0eXBlOiB0b3NjYS5jYXBhYmlsaXRpZXMuU2NhbGFibGUNCiAgICAgIGJpbmRpbmc6DQogICAgICAgIHR5cGU6IHRvc2NhLmNhcGFiaWxpdGllcy5uZXR3b3JrLkJpbmRhYmxlDQo=");
- return importReqDetails;
- }
-
- public static ImportReqDetails getDefaultImportResource(String name) {
- ResourceReqDetails resourceReqDetails = getDefaultResourceByType(ResourceTypeEnum.VFC, name);
- ImportReqDetails importReqDetails = new ImportReqDetails(resourceReqDetails.getName(), resourceReqDetails.getDescription(), resourceReqDetails.getTags(), resourceReqDetails.getDerivedFrom(), resourceReqDetails.getVendorName(),
- resourceReqDetails.getVendorRelease(), resourceReqDetails.getContactId(), resourceReqDetails.getIcon());
- importReqDetails.setPayloadName("myCompute.yaml");
- importReqDetails.setCategories(resourceReqDetails.getCategories());
- importReqDetails.setPayloadData(
- "dG9zY2FfZGVmaW5pdGlvbnNfdmVyc2lvbjogdG9zY2Ffc2ltcGxlX3lhbWxfMV8wXzANCm5vZGVfdHlwZXM6IA0KICBjb20uYXR0LmQyLnJlc291cmNlLk15Q29tcHV0ZToNCiAgICBkZXJpdmVkX2Zyb206IHRvc2NhLm5vZGVzLlJvb3QNCiAgICBhdHRyaWJ1dGVzOg0KICAgICAgcHJpdmF0ZV9hZGRyZXNzOg0KICAgICAgICB0eXBlOiBzdHJpbmcNCiAgICAgIHB1YmxpY19hZGRyZXNzOg0KICAgICAgICB0eXBlOiBzdHJpbmcNCiAgICAgIG5ldHdvcmtzOg0KICAgICAgICB0eXBlOiBtYXANCiAgICAgICAgZW50cnlfc2NoZW1hOg0KICAgICAgICAgIHR5cGU6IHRvc2NhLmRhdGF0eXBlcy5uZXR3b3JrLk5ldHdvcmtJbmZvDQogICAgICBwb3J0czoNCiAgICAgICAgdHlwZTogbWFwDQogICAgICAgIGVudHJ5X3NjaGVtYToNCiAgICAgICAgICB0eXBlOiB0b3NjYS5kYXRhdHlwZXMubmV0d29yay5Qb3J0SW5mbw0KICAgIHJlcXVpcmVtZW50czoNCiAgICAgIC0gbG9jYWxfc3RvcmFnZTogDQogICAgICAgICAgY2FwYWJpbGl0eTogdG9zY2EuY2FwYWJpbGl0aWVzLkF0dGFjaG1lbnQNCiAgICAgICAgICBub2RlOiB0b3NjYS5ub2Rlcy5CbG9ja1N0b3JhZ2UNCiAgICAgICAgICByZWxhdGlvbnNoaXA6IHRvc2NhLnJlbGF0aW9uc2hpcHMuQXR0YWNoZXNUbw0KICAgICAgICAgIG9jY3VycmVuY2VzOiBbMCwgVU5CT1VOREVEXSAgDQogICAgY2FwYWJpbGl0aWVzOg0KICAgICAgaG9zdDogDQogICAgICAgIHR5cGU6IHRvc2NhLmNhcGFiaWxpdGllcy5Db250YWluZXINCiAgICAgICAgdmFsaWRfc291cmNlX3R5cGVzOiBbdG9zY2Eubm9kZXMuU29mdHdhcmVDb21wb25lbnRdIA0KICAgICAgZW5kcG9pbnQgOg0KICAgICAgICB0eXBlOiB0b3NjYS5jYXBhYmlsaXRpZXMuRW5kcG9pbnQuQWRtaW4gDQogICAgICBvczogDQogICAgICAgIHR5cGU6IHRvc2NhLmNhcGFiaWxpdGllcy5PcGVyYXRpbmdTeXN0ZW0NCiAgICAgIHNjYWxhYmxlOg0KICAgICAgICB0eXBlOiB0b3NjYS5jYXBhYmlsaXRpZXMuU2NhbGFibGUNCiAgICAgIGJpbmRpbmc6DQogICAgICAgIHR5cGU6IHRvc2NhLmNhcGFiaWxpdGllcy5uZXR3b3JrLkJpbmRhYmxlDQo=");
- return importReqDetails;
- }
-
- // *** SERVICE ***
- public static ServiceReqDetails getDefaultService() {
- return getDefaultService(CI_SERVICE, ServiceCategoriesEnum.MOBILITY, "al1976", ServiceInstantiationType.A_LA_CARTE.getValue());
- }
-
- public static ServiceReqDetails getDefaultService(String contactId) {
- return getDefaultService(CI_SERVICE, ServiceCategoriesEnum.MOBILITY, contactId, ServiceInstantiationType.A_LA_CARTE.getValue());
- }
-
- public static ServiceReqDetails getDefaultService(User user) {
- return getDefaultService(CI_SERVICE, ServiceCategoriesEnum.MOBILITY, user.getUserId(), ServiceInstantiationType.A_LA_CARTE.getValue());
- }
-
- public static ServiceReqDetails getDefaultService(ServiceCategoriesEnum category, User user) {
- return getDefaultService(CI_SERVICE, category, user.getUserId(), ServiceInstantiationType.A_LA_CARTE.getValue());
- }
-
- public static ServiceReqDetails getServiceByCategory(ServiceCategoriesEnum category) {
- return getDefaultService(CI_SERVICE, category, "al1976", ServiceInstantiationType.A_LA_CARTE.getValue());
- }
-
- public static ServiceReqDetails getDefaultService(String serviceName, ServiceCategoriesEnum category, String contactId, String instantiationType) {
- serviceName = (serviceName + generateUUIDforSufix());
- ArrayList<String> tags = new ArrayList<>();
- tags.add("serviceTag");
- tags.add("serviceTag1");
- tags.add(serviceName);
- String description = "service Description";
- String icon = "defaulticon";
-
- ServiceReqDetails serviceDetails = new ServiceReqDetails(serviceName, category.getValue(), tags, description, contactId, icon, instantiationType);
-
- return serviceDetails;
- }
-
- public static ServiceReqDetails getRandomCategoryService() {
- ServiceReqDetails serviceReqDetails = getServiceByCategory(ServiceCategoriesEnum.getRandomElement());
- return serviceReqDetails;
- }
-
- // ***** PROPERTY ***
-
- public static PropertyReqDetails getDefaultProperty() {
- return getDefaultProperty("disk_size");
- }
-
- public static PropertyReqDetails getDefaultProperty(String propertyName) {
- PropertyReqDetails property = new PropertyReqDetails();
- property.setName(propertyName);
- property.setPropertyType("integer");
- property.setPropertyRequired(false);
- property.setPropertyDefaultValue("12345");
- property.setPropertyDescription("test property");
- property.setPropertyRangeMax("500");
- property.setPropertyRangeMin("100");
- property.setPropertyPassword(false);
- return property;
- }
-
- public static PropertyReqDetails getDefaultIntegerProperty() {
- return getPropertyDetails(PropertyTypeEnum.INTEGER);
- }
-
- public static PropertyReqDetails getDefaultStringProperty() {
- return getPropertyDetails(PropertyTypeEnum.STRING);
- }
-
- public static PropertyReqDetails getDefaultBooleanProperty() {
- return getPropertyDetails(PropertyTypeEnum.BOOLEAN);
- }
-
- public static PropertyReqDetails getDefaultListProperty() {
- return getPropertyDetails(PropertyTypeEnum.STRING_LIST);
- }
-
- public static PropertyReqDetails getDefaultListProperty(PropertyTypeEnum innerType) {
- return getPropertyDetails(innerType);
- }
-
- public static PropertyReqDetails getPropertyDetails(PropertyTypeEnum propType) {
- return new PropertyReqDetails(propType.getName(), propType.getType(), propType.getValue(), propType.getDescription(), propType.getSchemaDefinition());
- }
-
- // ***** RESOURCE INSTANCE ***
- public static ComponentInstanceReqDetails getDefaultComponentInstance() {
- return getDefaultComponentInstance("resourceInstanceName");
- }
-
- public static ComponentInstanceReqDetails getDefaultComponentInstance(String name) {
- String resourceUid = "resourceId";
- ComponentInstanceReqDetails resourceInstanceDetails = new ComponentInstanceReqDetails(resourceUid, RESOURCE_INSTANCE_DESCRIPTION, RESOURCE_INSTANCE_POS_X, RESOURCE_INSTANCE_POS_Y, name, null);
-
- return resourceInstanceDetails;
-
- }
-
- public static ComponentInstanceReqDetails getDefaultComponentInstance(String name, ComponentReqDetails componentReqDetails) {
- String resourceUid = componentReqDetails.getUniqueId();
- ComponentInstanceReqDetails resourceInstanceDetails = new ComponentInstanceReqDetails(resourceUid, RESOURCE_INSTANCE_DESCRIPTION, RESOURCE_INSTANCE_POS_X, RESOURCE_INSTANCE_POS_Y, name, null);
-
- return resourceInstanceDetails;
-
- }
-
- public static ComponentInstanceReqDetails getDefaultComponentInstance(String serviceUniqueId, String originType) {
- ComponentInstanceReqDetails componentInstanceReqDetails = new ComponentInstanceReqDetails(serviceUniqueId,
- RESOURCE_INSTANCE_DESCRIPTION, RESOURCE_INSTANCE_POS_X, RESOURCE_INSTANCE_POS_Y, null, originType);
-
- componentInstanceReqDetails.setUniqueId(serviceUniqueId + Math.random());
-
- return componentInstanceReqDetails;
-
- }
-
- public static ComponentInstanceReqDetails getComponentResourceInstance(ComponentReqDetails compInstOriginDetails) {
- String compInstName = (compInstOriginDetails.getName() != null ? compInstOriginDetails.getName() : "resourceInstanceName");
- String resourceUid = compInstOriginDetails.getUniqueId();
- ComponentInstanceReqDetails resourceInstanceDetails = new ComponentInstanceReqDetails(resourceUid, RESOURCE_INSTANCE_DESCRIPTION, RESOURCE_INSTANCE_POS_X, RESOURCE_INSTANCE_POS_Y, compInstName, null);
- return resourceInstanceDetails;
-
- }
-
- public static ComponentInstanceReqDetails getComponentInstance(Component compInstOriginDetails) {
- String compInstName = (compInstOriginDetails.getName() != null ? compInstOriginDetails.getName() : "componentInstanceName");
- String compInsUid = compInstOriginDetails.getUniqueId();
- ComponentInstanceReqDetails componentInstanceDetails = new ComponentInstanceReqDetails(compInsUid, RESOURCE_INSTANCE_DESCRIPTION, RESOURCE_INSTANCE_POS_X, RESOURCE_INSTANCE_POS_Y, compInstName, compInstOriginDetails.getComponentType() == ComponentTypeEnum.SERVICE ? OriginTypeEnum.ServiceProxy.name() : null);
- return componentInstanceDetails;
-
- }
-
- //********ServiceFilter**********
- public static ServiceFilterDetails getDefaultEqualOperatorFilter(String propertyName, String valueString) {
- return new ServiceFilterDetails(propertyName, "equal", "static", "static", valueString);
- }
-
- public static ServiceFilterDetails getDefaultFilter(String propertyName, String valueString,
- String operator) {
- return new ServiceFilterDetails(propertyName, operator, "static", "static", valueString);
- }
-
- // ******* USER **********************
- public static User getDefaultUser(UserRoleEnum userRole) {
- User sdncModifierDetails = new User();
- sdncModifierDetails.setUserId(userRole.getUserId());
- sdncModifierDetails.setFirstName(userRole.getFirstName());
- sdncModifierDetails.setLastName(userRole.getLastName());
- return sdncModifierDetails;
- }
-
- public static User getDefaultMechUser() {
- User sdncMechUserDetails = new User();
- sdncMechUserDetails.setUserId("m12345");
- sdncMechUserDetails.setFirstName("Fishi");
- sdncMechUserDetails.setLastName("Shifi");
- sdncMechUserDetails.setEmail("mechId@intl.sdc.com");
- sdncMechUserDetails.setRole("DESIGNER");
- return sdncMechUserDetails;
- }
-
- // ******* CONSUMER **********************
-
- public static ConsumerDataDefinition getDefaultConsumerDetails() {
- ConsumerDataDefinition consumer = new ConsumerDataDefinition();
- consumer.setConsumerName("ci");
- consumer.setConsumerSalt("2a1f887d607d4515d4066fe0f5452a50");
- consumer.setConsumerPassword("0a0dc557c3bf594b1a48030e3e99227580168b21f44e285c69740b8d5b13e33b");
- return consumer;
- }
-
- // *** ARTIFACT ***
- public static ArtifactReqDetails getDefaultArtifact() throws IOException, Exception {
- return getDefaultArtifact(DEFAULT_ARTIFACT_LABEL);
- }
-
- public static ArtifactReqDetails getDefaultArtifact(String artifactLabel) throws IOException, Exception {
- List<String> artifactTypes = ResponseParser.getValuesFromJsonArray(ArtifactRestUtils.getArtifactTypesList());
- String artifactType = artifactTypes.get(0);
-
- return getDefaultArtifact(artifactLabel, artifactType);
- }
-
- public static ArtifactReqDetails getDefaultArtifact(String artifactLabel, String artifactType) throws IOException, Exception {
-
- String artifactName = "testArtifact.sh";
- String artifactDescription = "descriptionTest";
- String payloadData = "dGVzdA=="; // content of file
-
- ArtifactReqDetails artifactDetails = new ArtifactReqDetails(artifactName, artifactType, artifactDescription, payloadData, artifactLabel);
- artifactDetails.setUrl("");
- artifactDetails.setArtifactDisplayName(artifactLabel);
- return artifactDetails;
- }
-
- public static ArtifactReqDetails getServiceApiArtifactDetails(String artifactLabel) throws IOException, Exception {
- ArtifactReqDetails defaultArtifact = getDefaultArtifact(artifactLabel, "OTHER");
- defaultArtifact.setUrl("http://www.apple.com");
- defaultArtifact.setServiceApi(true);
- defaultArtifact.setArtifactDisplayName(StringUtils.capitalize(defaultArtifact.getArtifactLabel()));
- return defaultArtifact;
- }
-
- public static ArtifactReqDetails getDefaultDeploymentArtifactForType(String artifactType) throws IOException, Exception {
- return getArtifactByType(DEFAULT_ARTIFACT_LABEL, artifactType, true, false);
- }
-
- public static ArtifactReqDetails getArtifactByType(ArtifactTypeEnum artifactLabel, ArtifactTypeEnum artifactType, Boolean deploymentTrue) throws IOException, Exception {
- return getArtifactByType(DEFAULT_ARTIFACT_LABEL, artifactType.toString(), deploymentTrue, false);
-
- }
-
- public static ArtifactReqDetails getArtifactByType(String artifactLabel, String artifactType, Boolean deploymentTrue, Boolean updatedPayload) throws IOException, Exception {
- String artifactName;
- String updatedPayloadData =null;
- String payloadData = null;
- Integer timeout = null;
- String url = "";
- String artifactDescription = "descriptionTest";
-
- // PLEASE NOTE!!!
- // The non-default payloads here are real ones according to various
- // types validations,
- // Please don't change them unless you know what you are doing!
-
- ArtifactTypeEnum artifactTypeEnum = ArtifactTypeEnum.findType(artifactType);
-
- /*
- * Missing file type: DCAE_JSON
- */
- switch (artifactTypeEnum) {
- case DCAE_INVENTORY_TOSCA:
- case DCAE_EVENT:
- case APPC_CONFIG:
- case DCAE_DOC:
- case DCAE_TOSCA:
- case HEAT:
- case HEAT_NET:
- case HEAT_VOL: {
- artifactName = generateUUIDforSufix() + artifactType + "_install_apache2.yaml";
- payloadData = "aGVhdF90ZW1wbGF0ZV92ZXJzaW9uOiAyMDEzLTA1LTIzDQoNCmRlc2NyaXB0aW9uOiBTaW1wbGUgdGVtcGxhdGUgdG8gZGVwbG95IGEgc3RhY2sgd2l0aCB0d28gdmlydHVhbCBtYWNoaW5lIGluc3RhbmNlcw0KDQpwYXJhbWV0ZXJzOg0KICBpbWFnZV9uYW1lXzE6DQogICAgdHlwZTogc3RyaW5nDQogICAgbGFiZWw6IEltYWdlIE5hbWUNCiAgICBkZXNjcmlwdGlvbjogU0NPSU1BR0UgU3BlY2lmeSBhbiBpbWFnZSBuYW1lIGZvciBpbnN0YW5jZTENCiAgICBkZWZhdWx0OiBjaXJyb3MtMC4zLjEteDg2XzY0DQogIGltYWdlX25hbWVfMjoNCiAgICB0eXBlOiBzdHJpbmcNCiAgICBsYWJlbDogSW1hZ2UgTmFtZQ0KICAgIGRlc2NyaXB0aW9uOiBTQ09JTUFHRSBTcGVjaWZ5IGFuIGltYWdlIG5hbWUgZm9yIGluc3RhbmNlMg0KICAgIGRlZmF1bHQ6IGNpcnJvcy0wLjMuMS14ODZfNjQNCiAgbmV0d29ya19pZDoNCiAgICB0eXBlOiBzdHJpbmcNCiAgICBsYWJlbDogTmV0d29yayBJRA0KICAgIGRlc2NyaXB0aW9uOiBTQ09ORVRXT1JLIE5ldHdvcmsgdG8gYmUgdXNlZCBmb3IgdGhlIGNvbXB1dGUgaW5zdGFuY2UNCiAgICBoaWRkZW46IHRydWUNCiAgICBjb25zdHJhaW50czoNCiAgICAgIC0gbGVuZ3RoOiB7IG1pbjogNiwgbWF4OiA4IH0NCiAgICAgICAgZGVzY3JpcHRpb246IFBhc3N3b3JkIGxlbmd0aCBtdXN0IGJlIGJldHdlZW4gNiBhbmQgOCBjaGFyYWN0ZXJzLg0KICAgICAgLSByYW5nZTogeyBtaW46IDYsIG1heDogOCB9DQogICAgICAgIGRlc2NyaXB0aW9uOiBSYW5nZSBkZXNjcmlwdGlvbg0KICAgICAgLSBhbGxvd2VkX3ZhbHVlczoNCiAgICAgICAgLSBtMS5zbWFsbA0KICAgICAgICAtIG0xLm1lZGl1bQ0KICAgICAgICAtIG0xLmxhcmdlDQogICAgICAgIGRlc2NyaXB0aW9uOiBBbGxvd2VkIHZhbHVlcyBkZXNjcmlwdGlvbg0KICAgICAgLSBhbGxvd2VkX3BhdHRlcm46ICJbYS16QS1aMC05XSsiDQogICAgICAgIGRlc2NyaXB0aW9uOiBQYXNzd29yZCBtdXN0IGNvbnNpc3Qgb2YgY2hhcmFjdGVycyBhbmQgbnVtYmVycyBvbmx5Lg0KICAgICAgLSBhbGxvd2VkX3BhdHRlcm46ICJbQS1aXStbYS16QS1aMC05XSoiDQogICAgICAgIGRlc2NyaXB0aW9uOiBQYXNzd29yZCBtdXN0IHN0YXJ0IHdpdGggYW4gdXBwZXJjYXNlIGNoYXJhY3Rlci4NCiAgICAgIC0gY3VzdG9tX2NvbnN0cmFpbnQ6IG5vdmEua2V5cGFpcg0KICAgICAgICBkZXNjcmlwdGlvbjogQ3VzdG9tIGRlc2NyaXB0aW9uDQoNCnJlc291cmNlczoNCiAgbXlfaW5zdGFuY2UxOg0KICAgIHR5cGU6IE9TOjpOb3ZhOjpTZXJ2ZXINCiAgICBwcm9wZXJ0aWVzOg0KICAgICAgaW1hZ2U6IHsgZ2V0X3BhcmFtOiBpbWFnZV9uYW1lXzEgfQ0KICAgICAgZmxhdm9yOiBtMS5zbWFsbA0KICAgICAgbmV0d29ya3M6DQogICAgICAgIC0gbmV0d29yayA6IHsgZ2V0X3BhcmFtIDogbmV0d29ya19pZCB9DQogIG15X2luc3RhbmNlMjoNCiAgICB0eXBlOiBPUzo6Tm92YTo6U2VydmVyDQogICAgcHJvcGVydGllczoNCiAgICAgIGltYWdlOiB7IGdldF9wYXJhbTogaW1hZ2VfbmFtZV8yIH0NCiAgICAgIGZsYXZvcjogbTEudGlueQ0KICAgICAgbmV0d29ya3M6DQogICAgICAgIC0gbmV0d29yayA6IHsgZ2V0X3BhcmFtIDogbmV0d29ya19pZCB9";
- updatedPayloadData = "dG9zY2FfZGVmaW5pdGlvbnNfdmVyc2lvbjogdG9zY2Ffc2ltcGxlX3lhbWxfMV8wXzANCg0Kbm9kZV90eXBlczoNCiAgY29tLmF0dC5kMi5yZXNvdXJjZS5jcC5DUDoNCiAgICBkZXJpdmVkX2Zyb206IHRvc2NhLm5vZGVzLm5ldHdvcmsuUG9ydA0KICAgIHByb3BlcnRpZXM6DQogICAgICBpc190YWdnZWQ6DQogICAgICAgIHR5cGU6IGJvb2xlYW4NCiAgICAgICAgcmVxdWlyZWQ6IGZhbHNlDQogICAgICAgIGRlZmF1bHQ6IGZhbHNlDQogICAgICAgIGRlc2NyaXB0aW9uOiANCg0KICAgIHJlcXVpcmVtZW50czoNCiAgICAgIC0gdmlydHVhbExpbms6DQogICAgICAgICAgY2FwYWJpbGl0eTogdG9zY2EuY2FwYWJpbGl0aWVzLm5ldHdvcmsuTGlua2FibGUNCiAgICAgICAgICByZWxhdGlvbnNoaXA6IHRvc2NhLnJlbGF0aW9uc2hpcHMubmV0d29yay5MaW5rc1RvDQogICAgICAtIHZpcnR1YWxCaW5kaW5nOg0KICAgICAgICAgIGNhcGFiaWxpdHk6IHRvc2NhLmNhcGFiaWxpdGllcy5uZXR3b3JrLkJpbmRhYmxlDQogICAgICAgICAgcmVsYXRpb25zaGlwOiB0b3NjYS5yZWxhdGlvbnNoaXBzLm5ldHdvcmsuQmluZHNUbw0KICAgIGNhcGFiaWxpdGllczoNCiAgICAgIGF0dGFjaG1lbnQ6DQogICAgICAgIHR5cGU6IHRvc2NhLmNhcGFiaWxpdGllcy5BdHRhY2htZW50DQogICAgICAgIG9jY3VycmVuY2VzOg0KICAgICAgICAtIDENCiAgICAgICAgLSBVTkJPVU5ERUQNCiAgICAgICAgdHlwZTogdG9zY2EuY2FwYWJpbGl0aWVzLm5ldHdvcmsuQmluZGFibGUNCiAgICAgICAgb2NjdXJyZW5jZXM6DQogICAgICAgIC0gMQ0KICAgICAgICAtIFVOQk9VTkRFRA0KICAgICAgdmlydHVhbF9saW5rYWJsZToNCiAgICAgICAgdHlwZTogY29tLmF0dC5kMi5jYXBhYmlsaXRpZXMuTWV0cmljDQogICAgICBlbmRfcG9pbnQ6DQogICAgICAgIHR5cGU6IHRvc2NhLmNhcGFiaWxpdGllcy5FbmRwb2ludCAgICAgICA=";
- timeout = 60;
- artifactLabel = normalizeArtifactLabel(artifactName);
- break;
- }
- case DCAE_INVENTORY_POLICY:
- case DCAE_INVENTORY_BLUEPRINT:
- case DCAE_INVENTORY_EVENT: {
- artifactName = getDcaeArtifactName(artifactTypeEnum, artifactType);
- payloadData = "will be override later";
- updatedPayloadData = "override";
- timeout = 60;
- artifactLabel = normalizeArtifactLabel(artifactName);
- break;
- }
- case MURANO_PKG: {
- artifactName = artifactType + "org.openstack.Rally.zip";
- payloadData = "ODM4MTRjNzkxZjcwYTlkMjk4ZGQ2ODE4MThmNjg0N2Y=";
- updatedPayloadData = "ODM4MTRjNzkxZjcwYTlkMjk4ZGQ2ODE4MThmMTAwN2Y=";
- break;
- }
- case DCAE_POLICY: {
- artifactName = artifactType + "dcae_policy.emf";
- payloadData = "will be override later";
- updatedPayloadData = "override";
- break;
- }
- case DCAE_INVENTORY_JSON:
- case DCAE_JSON: {
- artifactName = artifactType + "dcae_policy.json";
- payloadData = "ew0KICAiYXJ0aWZhY3RzIjogImRmc2FmIiwNCiAgIm5vcm1hbGl6ZWROYW1lIjogImNpc2VydmljZTBiYzY5ODk2OTQ4ZiIsDQogICJzeXN0ZW1OYW1lIjogIkNpc2VydmljZTBiYzY5ODk2OTQ4ZiIsDQogICJpbnZhcmlhbnRVVUlEIjogIjEzZmJkNzI3LWRjNzUtNDU1OS1iNzEyLWUwMjc5YmY4YTg2MSIsDQogICJhdHRDb250YWN0IjogImNzMDAwOCIsDQogICJuYW1lIjogImNpU2VydmljZTBiYzY5ODk2OTQ4ZiINCn0=";
- updatedPayloadData = "ew0KICAiYXJ0aWZhY3RzIjogIjEyMzQzIiwNCiAgIm5vcm1hbGl6ZWROYW1lIjogIjU0MzUzNCIsDQogICJzeXN0ZW1OYW1lIjogIkNpc2VydmljZTBiYzY5ODk2OTQ4ZiIsDQogICJpbnZhcmlhbnRVVUlEIjogIjEzZmJkNzI3LWRjNzUtNDU1OS1iNzEyLWUwMjc5YmY4YTg2MSIsDQogICJhdHRDb250YWN0IjogImNzMDAwOCIsDQogICJuYW1lIjogImNpU2VydmljZTBiYzY5ODk2OTQ4ZiINCn0=";
- break;
- }
- case PUPPET:
- case CHEF:
- case DG_XML:
- case YANG: {
- artifactName = generateUUIDforSufix() + artifactType + "yangXml.xml";
- payloadData = "PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8ZGF0YT4NCiAgPHNwb3J0cz4NCiAgICA8cGVyc29uPg0KICAgICAgPG5hbWU+TGlvbmVsIEFuZHJlcyBNZXNzaTwvbmFtZT4NCiAgICAgIDxiaXJ0aGRheT4xOTg3LTA2LTI0VDAwOjAwOjAwLTAwOjAwPC9iaXJ0aGRheT4NCiAgICA8L3BlcnNvbj4NCiAgICA8cGVyc29uPg0KICAgICAgPG5hbWU+Q3Jpc3RpYW5vIFJvbmFsZG88L25hbWU+DQogICAgICA8YmlydGhkYXk+MTk4NS0wMi0wNVQwMDowMDowMC0wMDowMDwvYmlydGhkYXk+DQogICAgPC9wZXJzb24+DQogICAgPHRlYW0+DQogICAgICA8bmFtZT5GQyBCYXJjZWxvbmE8L25hbWU+DQogICAgICA8cGxheWVyPg0KICAgICAgICA8bmFtZT5MaW9uZWwgQW5kcmVzIE1lc3NpPC9uYW1lPg0KICAgICAgICA8c2Vhc29uPkNoYW1waW9ucyBMZWFndWUgMjAxNC0yMDE1PC9zZWFzb24+DQogICAgICAgIDxudW1iZXI+MTA8L251bWJlcj4NCiAgICAgICAgPHNjb3Jlcz40Mzwvc2NvcmVzPg0KICAgICAgPC9wbGF5ZXI+DQogICAgPC90ZWFtPg0KICAgIDx0ZWFtPg0KICAgICAgPG5hbWU+UmVhbCBNYWRyaWQ8L25hbWU+DQogICAgICA8cGxheWVyPg0KICAgICAgICA8bmFtZT5DcmlzdGlhbm8gUm9uYWxkbzwvbmFtZT4NCiAgICAgICAgPHNlYXNvbj5DaGFtcGlvbnMgTGVhZ3VlIDIwMTQtMjAxNTwvc2Vhc29uPg0KICAgICAgICA8bnVtYmVyPjc8L251bWJlcj4NCiAgICAgICAgPHNjb3Jlcz40ODwvc2NvcmVzPg0KICAgICAgPC9wbGF5ZXI+DQogICAgPC90ZWFtPg0KICA8L3Nwb3J0cz4NCg0KPC9kYXRhPg==";
- updatedPayloadData = "PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8ZGF0YT4NCiAgPHNwb3J0cz4NCiAgICA8cGVyc29uPg0KICAgICAgPG5hbWU+TGlvbmVsIEFuZHJlcyBNZXNzaTwvbmFtZT4NCiAgICAgIDxiaXJ0aGRheT4xOTkwLTA2LTI0VDAwOjAwOjAwLTAwOjExPC9iaXJ0aGRheT4NCiAgICA8L3BlcnNvbj4NCiAgICA8cGVyc29uPg0KICAgICAgPG5hbWU+Q3Jpc3RpYW5vIFJvbmFsZG88L25hbWU+DQogICAgICA8YmlydGhkYXk+MTk4NS0wMi0wNVQwMDowMDowMC0wMDowMDwvYmlydGhkYXk+DQogICAgPC9wZXJzb24+DQogICAgPHRlYW0+DQogICAgICA8bmFtZT5GQyBCYXJjZWxvbmE8L25hbWU+DQogICAgICA8cGxheWVyPg0KICAgICAgICA8bmFtZT5MaW9uZWwgQW5kcmVzIE1lc3NpPC9uYW1lPg0KICAgICAgICA8c2Vhc29uPkNoYW1waW9ucyBMZWFndWUgMjAxNC0yMDE1PC9zZWFzb24+DQogICAgICAgIDxudW1iZXI+MTA8L251bWJlcj4NCiAgICAgICAgPHNjb3Jlcz40Mzwvc2NvcmVzPg0KICAgICAgPC9wbGF5ZXI+DQogICAgPC90ZWFtPg0KICAgIDx0ZWFtPg0KICAgICAgPG5hbWU+UmVhbCBNYWRyaWQ8L25hbWU+DQogICAgICA8cGxheWVyPg0KICAgICAgICA8bmFtZT5DcmlzdGlhbm8gUm9uYWxkbzwvbmFtZT4NCiAgICAgICAgPHNlYXNvbj5DaGFtcGlvbnMgTGVhZ3VlIDIwMTQtMjAxNTwvc2Vhc29uPg0KICAgICAgICA8bnVtYmVyPjc8L251bWJlcj4NCiAgICAgICAgPHNjb3Jlcz40ODwvc2NvcmVzPg0KICAgICAgPC9wbGF5ZXI+DQogICAgPC90ZWFtPg0KICA8L3Nwb3J0cz4NCg0KPC9kYXRhPg==";
- timeout = 15;
- artifactLabel = normalizeArtifactLabel(artifactName);
- break;
- }
- case VF_LICENSE:
- case VENDOR_LICENSE:
- case MODEL_INVENTORY_PROFILE:
- case MODEL_QUERY_SPEC:
- case VNF_CATALOG:
- case YANG_XML: {
- artifactName = generateUUIDforSufix() + artifactType + "yangXml.xml";
- payloadData = "PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8ZGF0YT4NCiAgPHNwb3J0cz4NCiAgICA8cGVyc29uPg0KICAgICAgPG5hbWU+TGlvbmVsIEFuZHJlcyBNZXNzaTwvbmFtZT4NCiAgICAgIDxiaXJ0aGRheT4xOTg3LTA2LTI0VDAwOjAwOjAwLTAwOjAwPC9iaXJ0aGRheT4NCiAgICA8L3BlcnNvbj4NCiAgICA8cGVyc29uPg0KICAgICAgPG5hbWU+Q3Jpc3RpYW5vIFJvbmFsZG88L25hbWU+DQogICAgICA8YmlydGhkYXk+MTk4NS0wMi0wNVQwMDowMDowMC0wMDowMDwvYmlydGhkYXk+DQogICAgPC9wZXJzb24+DQogICAgPHRlYW0+DQogICAgICA8bmFtZT5GQyBCYXJjZWxvbmE8L25hbWU+DQogICAgICA8cGxheWVyPg0KICAgICAgICA8bmFtZT5MaW9uZWwgQW5kcmVzIE1lc3NpPC9uYW1lPg0KICAgICAgICA8c2Vhc29uPkNoYW1waW9ucyBMZWFndWUgMjAxNC0yMDE1PC9zZWFzb24+DQogICAgICAgIDxudW1iZXI+MTA8L251bWJlcj4NCiAgICAgICAgPHNjb3Jlcz40Mzwvc2NvcmVzPg0KICAgICAgPC9wbGF5ZXI+DQogICAgPC90ZWFtPg0KICAgIDx0ZWFtPg0KICAgICAgPG5hbWU+UmVhbCBNYWRyaWQ8L25hbWU+DQogICAgICA8cGxheWVyPg0KICAgICAgICA8bmFtZT5DcmlzdGlhbm8gUm9uYWxkbzwvbmFtZT4NCiAgICAgICAgPHNlYXNvbj5DaGFtcGlvbnMgTGVhZ3VlIDIwMTQtMjAxNTwvc2Vhc29uPg0KICAgICAgICA8bnVtYmVyPjc8L251bWJlcj4NCiAgICAgICAgPHNjb3Jlcz40ODwvc2NvcmVzPg0KICAgICAgPC9wbGF5ZXI+DQogICAgPC90ZWFtPg0KICA8L3Nwb3J0cz4NCg0KPC9kYXRhPg==";
- updatedPayloadData = "PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8ZGF0YT4NCiAgPHNwb3J0cz4NCiAgICA8cGVyc29uPg0KICAgICAgPG5hbWU+TGlvbmVsIEFuZHJlcyBNZXNzaTwvbmFtZT4NCiAgICAgIDxiaXJ0aGRheT4xOTkwLTA2LTI0VDAwOjAwOjAwLTAwOjExPC9iaXJ0aGRheT4NCiAgICA8L3BlcnNvbj4NCiAgICA8cGVyc29uPg0KICAgICAgPG5hbWU+Q3Jpc3RpYW5vIFJvbmFsZG88L25hbWU+DQogICAgICA8YmlydGhkYXk+MTk4NS0wMi0wNVQwMDowMDowMC0wMDowMDwvYmlydGhkYXk+DQogICAgPC9wZXJzb24+DQogICAgPHRlYW0+DQogICAgICA8bmFtZT5GQyBCYXJjZWxvbmE8L25hbWU+DQogICAgICA8cGxheWVyPg0KICAgICAgICA8bmFtZT5MaW9uZWwgQW5kcmVzIE1lc3NpPC9uYW1lPg0KICAgICAgICA8c2Vhc29uPkNoYW1waW9ucyBMZWFndWUgMjAxNC0yMDE1PC9zZWFzb24+DQogICAgICAgIDxudW1iZXI+MTA8L251bWJlcj4NCiAgICAgICAgPHNjb3Jlcz40Mzwvc2NvcmVzPg0KICAgICAgPC9wbGF5ZXI+DQogICAgPC90ZWFtPg0KICAgIDx0ZWFtPg0KICAgICAgPG5hbWU+UmVhbCBNYWRyaWQ8L25hbWU+DQogICAgICA8cGxheWVyPg0KICAgICAgICA8bmFtZT5DcmlzdGlhbm8gUm9uYWxkbzwvbmFtZT4NCiAgICAgICAgPHNlYXNvbj5DaGFtcGlvbnMgTGVhZ3VlIDIwMTQtMjAxNTwvc2Vhc29uPg0KICAgICAgICA8bnVtYmVyPjc8L251bWJlcj4NCiAgICAgICAgPHNjb3Jlcz40ODwvc2NvcmVzPg0KICAgICAgPC9wbGF5ZXI+DQogICAgPC90ZWFtPg0KICA8L3Nwb3J0cz4NCg0KPC9kYXRhPg==";
- timeout = 0;
- artifactLabel = normalizeArtifactLabel(artifactName);
- break;
- }
- case SNMP_POLL:
- case SNMP_TRAP:
- case DCAE_INVENTORY_DOC:
- case GUIDE:
- case OTHER: {
- artifactName = generateUUIDforSufix() + artifactType + "other.pdf";
- payloadData = "aGVhdF90ZW1wbGF0ZV92ZXJzaW9uOiAyMDEzLTA1LTIzDQoNCmRlc2NyaXB0aW9uOiBTaW1wbGUgdGVtcGxhdGUgdG8gZGVwbG95IGEgc3RhY2sgd2l0aCB0d28gdmlydHVhbCBtYWNoaW5lIGluc3RhbmNlcw0KDQpwYXJhbWV0ZXJzOg0KICBpbWFnZV9uYW1lXzE6DQogICAgdHlwZTogc3RyaW5nDQogICAgbGFiZWw6IEltYWdlIE5hbWUNCiAgICBkZXNjcmlwdGlvbjogU0NPSU1BR0UgU3BlY2lmeSBhbiBpbWFnZSBuYW1lIGZvciBpbnN0YW5jZTENCiAgICBkZWZhdWx0OiBjaXJyb3MtMC4zLjEteDg2XzY0DQogIGltYWdlX25hbWVfMjoNCiAgICB0eXBlOiBzdHJpbmcNCiAgICBsYWJlbDogSW1hZ2UgTmFtZQ0KICAgIGRlc2NyaXB0aW9uOiBTQ09JTUFHRSBTcGVjaWZ5IGFuIGltYWdlIG5hbWUgZm9yIGluc3RhbmNlMg0KICAgIGRlZmF1bHQ6IGNpcnJvcy0wLjMuMS14ODZfNjQNCiAgbmV0d29ya19pZDoNCiAgICB0eXBlOiBzdHJpbmcNCiAgICBsYWJlbDogTmV0d29yayBJRA0KICAgIGRlc2NyaXB0aW9uOiBTQ09ORVRXT1JLIE5ldHdvcmsgdG8gYmUgdXNlZCBmb3IgdGhlIGNvbXB1dGUgaW5zdGFuY2UNCiAgICBoaWRkZW46IHRydWUNCiAgICBjb25zdHJhaW50czoNCiAgICAgIC0gbGVuZ3RoOiB7IG1pbjogNiwgbWF4OiA4IH0NCiAgICAgICAgZGVzY3JpcHRpb246IFBhc3N3b3JkIGxlbmd0aCBtdXN0IGJlIGJldHdlZW4gNiBhbmQgOCBjaGFyYWN0ZXJzLg0KICAgICAgLSByYW5nZTogeyBtaW46IDYsIG1heDogOCB9DQogICAgICAgIGRlc2NyaXB0aW9uOiBSYW5nZSBkZXNjcmlwdGlvbg0KICAgICAgLSBhbGxvd2VkX3ZhbHVlczoNCiAgICAgICAgLSBtMS5zbWFsbA0KICAgICAgICAtIG0xLm1lZGl1bQ0KICAgICAgICAtIG0xLmxhcmdlDQogICAgICAgIGRlc2NyaXB0aW9uOiBBbGxvd2VkIHZhbHVlcyBkZXNjcmlwdGlvbg0KICAgICAgLSBhbGxvd2VkX3BhdHRlcm46ICJbYS16QS1aMC05XSsiDQogICAgICAgIGRlc2NyaXB0aW9uOiBQYXNzd29yZCBtdXN0IGNvbnNpc3Qgb2YgY2hhcmFjdGVycyBhbmQgbnVtYmVycyBvbmx5Lg0KICAgICAgLSBhbGxvd2VkX3BhdHRlcm46ICJbQS1aXStbYS16QS1aMC05XSoiDQogICAgICAgIGRlc2NyaXB0aW9uOiBQYXNzd29yZCBtdXN0IHN0YXJ0IHdpdGggYW4gdXBwZXJjYXNlIGNoYXJhY3Rlci4NCiAgICAgIC0gY3VzdG9tX2NvbnN0cmFpbnQ6IG5vdmEua2V5cGFpcg0KICAgICAgICBkZXNjcmlwdGlvbjogQ3VzdG9tIGRlc2NyaXB0aW9uDQoNCnJlc291cmNlczoNCiAgbXlfaW5zdGFuY2UxOg0KICAgIHR5cGU6IE9TOjpOb3ZhOjpTZXJ2ZXINCiAgICBwcm9wZXJ0aWVzOg0KICAgICAgaW1hZ2U6IHsgZ2V0X3BhcmFtOiBpbWFnZV9uYW1lXzEgfQ0KICAgICAgZmxhdm9yOiBtMS5zbWFsbA0KICAgICAgbmV0d29ya3M6DQogICAgICAgIC0gbmV0d29yayA6IHsgZ2V0X3BhcmFtIDogbmV0d29ya19pZCB9DQogIG15X2luc3RhbmNlMjoNCiAgICB0eXBlOiBPUzo6Tm92YTo6U2VydmVyDQogICAgcHJvcGVydGllczoNCiAgICAgIGltYWdlOiB7IGdldF9wYXJhbTogaW1hZ2VfbmFtZV8yIH0NCiAgICAgIGZsYXZvcjogbTEudGlueQ0KICAgICAgbmV0d29ya3M6DQogICAgICAgIC0gbmV0d29yayA6IHsgZ2V0X3BhcmFtIDogbmV0d29ya19pZCB9";
- updatedPayloadData = "aGVhdF90ZW1wbGF0ZV92ZXJzaW9uOiAyMDE2LTA1LTIzDQoNCmRlc2NyaXB0aW9uOiBTaW1wbGUgdGVtcGxhdGRzYWRzYWRzYWUgdG8gZGVwbG95IGEgc3RhY2sgd2l0aCB0d28gdmlydHVhbCBtYWNoaW5lIGluc3RhbmNlcw0KDQpwYXJhbWV0ZXJzOg0KICBpbWFnZV9uYW1lXzE6DQogICAgdHlwZTogc3RyaW5nDQogICAgbGFiZWw6IEltYWdlIE5hbWUNCiAgICBkZXNjcmlwdGlvbjogU0NPSU1BR0UgU3BlY2lmeSBhbiBpbWFkc2FkYXN3Z2UgbmFtZSBmb3IgaW5zdGFuY2UxDQogICAgZGVmYXVsdDogY2lycm9zLTAuMy4xLXg4Nl82NA0KICBpbWFnZV9uYW1lXzI6DQogICAgdHlwZTogc3RyaW5nDQogICAgbGFiZWw6IEltYWdlIE5hbWUNCiAgICBkZXNjcmlwdGlvbjogU0NPSU1BR0UgU3BlY2lmeSBhbiBpbWFnZSBuYW1lIGZvciBpbnN0YW5jZTINCiAgICBkZWZhdWx0OiBjaXJyb3MtMC4zLjEteDg2XzY0DQogIG5ldHdvcmtfaWQ6DQogICAgdHlwZTogc3RyaW5nDQogICAgbGFiZWw6IE5ldHdvcmsgSUQNCiAgICBkZXNjcmlwdGlvbjogU0NPTkVUV09SSyBOZXR3b3JrIHRvIGJlIHVzZWQgZm9yIHRoZSBjb21wdXRlIGluc3RhbmNlDQogICAgaGlkZGVuOiB0cnVlDQogICAgY29uc3RyYWludHM6DQogICAgICAtIGxlbmd0aDogeyBtaW46IDYsIG1heDogOCB9DQogICAgICAgIGRlc2NyaXB0aW9uOiBQYXNzd29yZCBsZW5ndGggbXVzdCBiZSBiZXR3ZWVuIDYgYW5kIDggY2hhcmFjdGVycy4NCiAgICAgIC0gcmFuZ2U6IHsgbWluOiA2LCBtYXg6IDggfQ0KICAgICAgICBkZXNjcmlwdGlvbjogUmFuZ2UgZGVzY3JpcHRpb24NCiAgICAgIC0gYWxsb3dlZF92YWx1ZXM6DQogICAgICAgIC0gbTEuc21hbGwNCiAgICAgICAgLSBtMS5tZWRpdW0NCiAgICAgICAgLSBtMS5sYXJnZQ0KICAgICAgICBkZXNjcmlwdGlvbjogQWxsb3dlZCB2YWx1ZXMgZGVzY3JpcHRpb24NCiAgICAgIC0gYWxsb3dlZF9wYXR0ZXJuOiAiW2EtekEtWjAtOV0rIg0KICAgICAgICBkZXNjcmlwdGlvbjogUGFzc3dvcmQgbXVzdCBjb25zaXN0IG9mIGNoYXJhY3RlcnMgYW5kIG51bWJlcnMgb25seS4NCiAgICAgIC0gYWxsb3dlZF9wYXR0ZXJuOiAiW0EtWl0rW2EtekEtWjAtOV0qIg0KICAgICAgICBkZXNjcmlwdGlvbjogUGFzc3dvcmQgbXVzdCBzdGFydCB3aXRoIGFuIHVwcGVyY2FzZSBjaGFyYWN0ZXIuDQogICAgICAtIGN1c3RvbV9jb25zdHJhaW50OiBub3ZhLmtleXBhaXINCiAgICAgICAgZGVzY3JpcHRpb246IEN1c3RvbSBkZXNjcmlwdGlvbg0KDQpyZXNvdXJjZXM6DQogIG15X2luc3RhbmNlMToNCiAgICB0eXBlOiBPUzo6Tm92YTo6U2VydmVyDQogICAgcHJvcGVydGllczoNCiAgICAgIGltYWdlOiB7IGdldF9wYXJhbTogaW1hZ2VfbmFtZV8xIH0NCiAgICAgIGZsYXZvcjogbTEuc21hbGwNCiAgICAgIG5ldHdvcmtzOg0KICAgICAgICAtIG5ldHdvcmsgOiB7IGdldF9wYXJhbSA6IG5ldHdvcmtfaWQgfQ0KICBteV9pbnN0YW5jZTI6DQogICAgdHlwZTogT1M6Ok5vdmE6OlNlcnZlcg0KICAgIHByb3BlcnRpZXM6DQogICAgICBpbWFnZTogeyBnZXRfcGFyYW06IGltYWdlX25hbWVfMiB9DQogICAgICBmbGF2b3I6IG0xLnRpbnkNCiAgICAgIG5ldHdvcmtzOg0KICAgICAgICAtIG5ldHdvcmsgOiB7IGdldF9wYXJhbSA6IG5ldHdvcmtfaWQgfQ";
- timeout = 0;
- artifactLabel = normalizeArtifactLabel(artifactName);
- break;
- }
- case SHELL_SCRIPT:
- default: {// dummy
- artifactName = generateUUIDforSufix() + "testArtifact.sh";
- payloadData = "dGVzdA==";
- updatedPayloadData = "YmVzYg==";
- artifactLabel = normalizeArtifactLabel(artifactName);
- break;
- }
- }
- artifactLabel = normalizeArtifactLabel("ci" + artifactName);
-
- ArtifactReqDetails artifactDetails = null;
-
- if (!updatedPayload){
- artifactDetails = new ArtifactReqDetails(artifactName, artifactType, artifactDescription, payloadData, artifactLabel);
- }
- else artifactDetails = new ArtifactReqDetails(artifactName, artifactType, artifactDescription,
- updatedPayloadData, artifactLabel);
-
- artifactDetails.setArtifactGroupType(ArtifactGroupTypeEnum.DEPLOYMENT.getType());
- artifactDetails.setUrl(url);
- artifactDetails.setTimeout(timeout);
- artifactDetails.setArtifactDisplayName(artifactLabel);
- return artifactDetails;
- }
-
- private static String getDcaeArtifactName(ArtifactTypeEnum artifactTypeEnum, String artifactType) {
- String artifactName = null;
- switch (artifactTypeEnum) {
- case DCAE_INVENTORY_TOSCA: {
- artifactName = generateUUIDforSufix() + artifactType + "_toscaSampleArtifact.yml";
- break;
- }
- case DCAE_INVENTORY_JSON: {
- artifactName = generateUUIDforSufix() + artifactType + "_jsonSampleArtifact.json";
- break;
- }
- case DCAE_INVENTORY_POLICY: {
- artifactName = generateUUIDforSufix() + artifactType + "_emfSampleArtifact.emf";
- break;
- }
- case DCAE_INVENTORY_DOC: {
- artifactName = generateUUIDforSufix() + artifactType + "_docSampleArtifact.doc";
- break;
- }
- case DCAE_INVENTORY_BLUEPRINT: {
- artifactName = generateUUIDforSufix() + artifactType + "_bluePrintSampleArtifact.xml";
- break;
- }
- case DCAE_INVENTORY_EVENT: {
- artifactName = generateUUIDforSufix() + artifactType + "_eventSampleArtifact.xml";
- break;
- }
- }
- return artifactName;
- }
-
- // ---------------------Audit message------------------
- public static ExpectedResourceAuditJavaObject getDefaultImportResourceAuditMsgSuccess() {
-
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
- expectedResourceAuditJavaObject.setAction(AuditingActionEnum.IMPORT_RESOURCE.getName());
- expectedResourceAuditJavaObject.setResourceName("defaultImportResourceName.yaml");
- expectedResourceAuditJavaObject.setResourceType("Resource");
- expectedResourceAuditJavaObject.setPrevVersion("");
- expectedResourceAuditJavaObject.setCurrVersion("0.1");
- expectedResourceAuditJavaObject.setModifierName(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER).getFullName());
- expectedResourceAuditJavaObject.setModifierUid(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER).getUserId());
- expectedResourceAuditJavaObject.setPrevState("");
- expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.toString());
- expectedResourceAuditJavaObject.setStatus("201");
- expectedResourceAuditJavaObject.setDesc("OK");
- expectedResourceAuditJavaObject.setToscaNodeType("");
- return expectedResourceAuditJavaObject;
-
- }
-
- public static ExpectedResourceAuditJavaObject getDefaultImportResourceAuditMsgFailure(ErrorInfo errorInfo, List<String> variables) {
-
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
- expectedResourceAuditJavaObject.setAction(AuditingActionEnum.IMPORT_RESOURCE.getName());
- expectedResourceAuditJavaObject.setResourceName("");
- expectedResourceAuditJavaObject.setResourceType("Resource");
- expectedResourceAuditJavaObject.setPrevVersion("");
- expectedResourceAuditJavaObject.setCurrVersion("");
- expectedResourceAuditJavaObject.setModifierName(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER).getFullName());
- expectedResourceAuditJavaObject.setModifierUid(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER).getUserId());
- expectedResourceAuditJavaObject.setPrevState("");
- expectedResourceAuditJavaObject.setCurrState("");
- expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
- expectedResourceAuditJavaObject.setDesc(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
- expectedResourceAuditJavaObject.setToscaNodeType("");
- return expectedResourceAuditJavaObject;
-
- }
-
- public static ExpectedResourceAuditJavaObject getDefaultCertificationRequestAuditMsgSuccess() {
-
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
- expectedResourceAuditJavaObject.setAction(AuditingActionEnum.CERTIFICATION_REQUEST_RESOURCE.getName());
- expectedResourceAuditJavaObject.setResourceName("defaultResourceName");
- expectedResourceAuditJavaObject.setResourceType("Resource");
- expectedResourceAuditJavaObject.setPrevVersion("");
- expectedResourceAuditJavaObject.setCurrVersion("0.1");
- expectedResourceAuditJavaObject.setModifierName(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER).getFullName());
- expectedResourceAuditJavaObject.setModifierUid(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER).getUserId());
- expectedResourceAuditJavaObject.setPrevState("");
- expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.toString());
- expectedResourceAuditJavaObject.setStatus("200");
- expectedResourceAuditJavaObject.setDesc("OK");
- expectedResourceAuditJavaObject.setComment("");
- return expectedResourceAuditJavaObject;
-
- }
-
- public static ExpectedResourceAuditJavaObject getDefaultCertificationRequestAuditMsgFailure(ErrorInfo errorInfo, List<String> variables) {
-
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
- expectedResourceAuditJavaObject.setAction(AuditingActionEnum.CERTIFICATION_REQUEST_RESOURCE.getName());
- expectedResourceAuditJavaObject.setResourceName("");
- expectedResourceAuditJavaObject.setResourceType("Resource");
- expectedResourceAuditJavaObject.setPrevVersion("0.1");
- expectedResourceAuditJavaObject.setCurrVersion("0.1");
- expectedResourceAuditJavaObject.setModifierName(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER).getFullName());
- expectedResourceAuditJavaObject.setModifierUid(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER).getUserId());
- expectedResourceAuditJavaObject.setPrevState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.toString());
- expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.toString());
- expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
- expectedResourceAuditJavaObject.setDesc(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
- expectedResourceAuditJavaObject.setComment("");
- return expectedResourceAuditJavaObject;
-
- }
-
- public static ExpectedExternalAudit getDefaultExternalAuditObject(AssetTypeEnum assetType, AuditingActionEnum action, String query) {
-
- ExpectedExternalAudit expectedExternalAudit = new ExpectedExternalAudit();
- expectedExternalAudit.setACTION(action.getName());
- expectedExternalAudit.setCONSUMER_ID("ci");
- expectedExternalAudit.setRESOURCE_URL("/sdc/v1/catalog/" + assetType.getValue() + (query == null ? "" : query));
- expectedExternalAudit.setSTATUS("200");
- expectedExternalAudit.setDESC("OK");
- return expectedExternalAudit;
-
- }
-
- public static ExpectedExternalAudit getDefaultAssetListAudit(AssetTypeEnum assetType, AuditingActionEnum auditAction) {
-
- // ExpectedExternalAudit expectedAssetListAuditJavaObject = new
- // ExpectedExternalAudit();
- ExpectedExternalAudit expectedAssetListAuditJavaObject = getDefaultExternalAuditObject(assetType, auditAction, null);
- return expectedAssetListAuditJavaObject;
-
- }
-
- public static ExpectedExternalAudit getDefaultFilteredAssetListAudit(AssetTypeEnum assetType, String query) {
-
- // ExpectedExternalAudit expectedAssetListAuditJavaObject = new
- // ExpectedExternalAudit();
- ExpectedExternalAudit expectedAssetListAuditJavaObject = getDefaultExternalAuditObject(assetType, AuditingActionEnum.GET_FILTERED_ASSET_LIST, query);
- return expectedAssetListAuditJavaObject;
-
- }
-
- public static ExpectedExternalAudit getDefaultExternalArtifactAuditSuccess(AssetTypeEnum assetType, AuditingActionEnum action, ArtifactDefinition artifactDefinition, String componentUUID) {
-
- // ExpectedExternalAudit expectedExternalArtifactAudit = new
- // ExpectedExternalAudit();
-
- ExpectedExternalAudit expectedExternalArtifactAudit = getDefaultExternalAuditObject(assetType, action, null);
- expectedExternalArtifactAudit.setMODIFIER(AuditValidationUtils.getModifierString(artifactDefinition.getUpdaterFullName(), artifactDefinition.getUserIdLastUpdater()));
- expectedExternalArtifactAudit.setPREV_ARTIFACT_UUID("");
- expectedExternalArtifactAudit.setCURR_ARTIFACT_UUID(artifactDefinition.getArtifactUUID());
- expectedExternalArtifactAudit.setARTIFACT_DATA(AuditValidationUtils.buildArtifactDataAudit(artifactDefinition));
- expectedExternalArtifactAudit.setRESOURCE_URL(expectedExternalArtifactAudit.getRESOURCE_URL() + "/" + componentUUID + "/artifacts");
- return expectedExternalArtifactAudit;
-
- }
-
- public static ExpectedExternalAudit getDefaultExternalArtifactAuditSuccess(AssetTypeEnum assetType, AuditingActionEnum action, ArtifactDefinition artifactDefinition, Component component) {
-
- //ExpectedExternalAudit expectedExternalArtifactAudit = new ExpectedExternalAudit();
-
- ExpectedExternalAudit expectedExternalArtifactAudit = getDefaultExternalAuditObject(assetType, action, null);
- expectedExternalArtifactAudit.setMODIFIER(AuditValidationUtils.getModifierString(artifactDefinition.getUpdaterFullName(), artifactDefinition.getUserIdLastUpdater()));
- expectedExternalArtifactAudit.setPREV_ARTIFACT_UUID("");
- expectedExternalArtifactAudit.setCURR_ARTIFACT_UUID(artifactDefinition.getArtifactUUID());
- expectedExternalArtifactAudit.setARTIFACT_DATA(AuditValidationUtils.buildArtifactDataAudit(artifactDefinition));
- expectedExternalArtifactAudit.setRESOURCE_URL(expectedExternalArtifactAudit.getRESOURCE_URL() + "/" + component.getUUID() + "/artifacts");
- expectedExternalArtifactAudit.setRESOURCE_NAME(component.getName());
- expectedExternalArtifactAudit.setRESOURCE_TYPE(component.getComponentType().getValue());
- return expectedExternalArtifactAudit;
-
- }
-
- public static ExpectedResourceAuditJavaObject getDefaultCreateResourceExternalAPI(String resourceName) {
-
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
- expectedResourceAuditJavaObject.setAction(AuditingActionEnum.CREATE_RESOURCE_BY_API.getName());
- expectedResourceAuditJavaObject.setResourceName(resourceName);
- expectedResourceAuditJavaObject.setResourceType("Resource");
- expectedResourceAuditJavaObject.setCONSUMER_ID("ci");
- expectedResourceAuditJavaObject.setRESOURCE_URL("/sdc/v1/catalog/resources");
- expectedResourceAuditJavaObject.setMODIFIER("");
- expectedResourceAuditJavaObject.setPrevVersion("");
- expectedResourceAuditJavaObject.setCurrVersion("0.1");
- expectedResourceAuditJavaObject.setPrevState("");
- expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.toString());
- expectedResourceAuditJavaObject.setStatus("201");
- expectedResourceAuditJavaObject.setDesc("OK");
-
- return expectedResourceAuditJavaObject;
-
-
- }
-
- public static ExpectedResourceAuditJavaObject getDefaultChangeAssetLifeCycleExternalAPI(Component resourceAssetStructure, User defaultUser, LifeCycleStatesEnum lifecycleStateEnum, AssetTypeEnum assetTypeEnum) {
-
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
- expectedResourceAuditJavaObject.setAction(AuditingActionEnum.CHANGE_LIFECYCLE_BY_API.getName());
- expectedResourceAuditJavaObject.setResourceName(resourceAssetStructure.getName());
- expectedResourceAuditJavaObject.setResourceType(assetTypeEnum.getCorrespondingComponent());
- expectedResourceAuditJavaObject.setCONSUMER_ID("ci");
- expectedResourceAuditJavaObject.setRESOURCE_URL(String.format("/sdc/v1/catalog/%s/%s/lifecycleState/%s", assetTypeEnum.getValue().toLowerCase(), resourceAssetStructure.getUUID(), lifecycleStateEnum.getState()));
- expectedResourceAuditJavaObject.setMODIFIER(defaultUser.getFullName() + "(" + defaultUser.getUserId() + ")");
- expectedResourceAuditJavaObject.setPrevVersion("0.1");
- expectedResourceAuditJavaObject.setCurrVersion("0.1");
- expectedResourceAuditJavaObject.setPrevState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.toString());
- expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN.toString());
- // TODO: Remove comment
-// expectedResourceAuditJavaObject.setINVARIANT_UUID(resourceAssetStructure.getInvariantUUID());
- // TODO: SERVICE_INSTANCE_ID
- expectedResourceAuditJavaObject.setStatus("201");
- expectedResourceAuditJavaObject.setDesc("OK");
-
- return expectedResourceAuditJavaObject;
-
- }
-
- public static ExpectedResourceAuditJavaObject getDefaultInvalidChangeAssetLifeCycleExternalAPI(String assetUUID, User defaultUser, LifeCycleStatesEnum lifecycleStateEnum, AssetTypeEnum assetTypeEnum) {
-
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
- expectedResourceAuditJavaObject.setAction(AuditingActionEnum.CHANGE_LIFECYCLE_BY_API.getName());
- expectedResourceAuditJavaObject.setResourceName("");
- expectedResourceAuditJavaObject.setResourceType(assetTypeEnum.getCorrespondingComponent());
- expectedResourceAuditJavaObject.setCONSUMER_ID("ci");
- expectedResourceAuditJavaObject.setRESOURCE_URL(String.format("/sdc/v1/catalog/%s/%s/lifecycleState/%s", assetTypeEnum.getValue().toLowerCase(), assetUUID, lifecycleStateEnum.getState()));
- expectedResourceAuditJavaObject.setMODIFIER("");
- expectedResourceAuditJavaObject.setMODIFIER(defaultUser.getFullName() + "(" + defaultUser.getUserId() + ")");
- expectedResourceAuditJavaObject.setPrevVersion("");
- expectedResourceAuditJavaObject.setCurrVersion("");
- expectedResourceAuditJavaObject.setPrevState("");
- expectedResourceAuditJavaObject.setCurrState("");
- expectedResourceAuditJavaObject.setStatus("404");
- expectedResourceAuditJavaObject.setDesc("OK");
-
- return expectedResourceAuditJavaObject;
-
- }
-
- public static ExpectedExternalAudit getDefaultExternalArtifactAuditSuccess(AssetTypeEnum assetType, AuditingActionEnum action, ArtifactDefinition artifactDefinition, String componentUUID, String resourceInstanceName) {
-
- ExpectedExternalAudit expectedExternalArtifactAudit = getDefaultExternalArtifactAuditSuccess(assetType, action, artifactDefinition, componentUUID);
- expectedExternalArtifactAudit.setRESOURCE_URL("/sdc/v1/catalog/" + assetType.getValue() + "/" + componentUUID + "/resourceInstances/" + resourceInstanceName + "/artifacts");
- return expectedExternalArtifactAudit;
- }
-
- public static ExpectedExternalAudit getDefaultExternalArtifactAuditFailure(AssetTypeEnum assetType, AuditingActionEnum action, ArtifactDefinition artifactDefinition, String componentUUID, ErrorInfo errorInfo, List<String> variables) {
-
- // ExpectedExternalAudit expectedExternalArtifactAudit = new
- // ExpectedExternalAudit();
-
- ExpectedExternalAudit expectedExternalArtifactAudit = getDefaultExternalAuditObject(assetType, action, null);
- expectedExternalArtifactAudit.setMODIFIER(AuditValidationUtils.getModifierString(artifactDefinition.getUpdaterFullName(), artifactDefinition.getUserIdLastUpdater()));
- expectedExternalArtifactAudit.setPREV_ARTIFACT_UUID("");
- expectedExternalArtifactAudit.setCURR_ARTIFACT_UUID(artifactDefinition.getArtifactUUID());
- expectedExternalArtifactAudit.setARTIFACT_DATA(AuditValidationUtils.buildArtifactDataAudit(artifactDefinition));
- expectedExternalArtifactAudit.setRESOURCE_URL(expectedExternalArtifactAudit.getRESOURCE_URL() + "/" + componentUUID + "/artifacts");
- expectedExternalArtifactAudit.setSTATUS(errorInfo.getCode().toString());
- expectedExternalArtifactAudit.setDESC(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
- return expectedExternalArtifactAudit;
-
- }
-
- public static ExpectedExternalAudit getDefaultExternalArtifactAuditFailure(AssetTypeEnum assetType, AuditingActionEnum action, ArtifactDefinition artifactDefinition, String componentUUID, ErrorInfo errorInfo, List<String> variables,
- String resourceInstanceName) {
-
- ExpectedExternalAudit expectedExternalArtifactAudit = getDefaultExternalArtifactAuditFailure(assetType, action, artifactDefinition, componentUUID, errorInfo, variables);
- expectedExternalArtifactAudit.setRESOURCE_URL("/sdc/v1/catalog/" + assetType.getValue() + "/" + componentUUID + "/resourceInstances/" + resourceInstanceName + "/artifacts");
- return expectedExternalArtifactAudit;
- }
-
- public static ExpectedExternalAudit getFilteredAssetListAuditCategoryNotFound(AssetTypeEnum assetType, String query, String category) {
-
- // ExpectedExternalAudit expectedAssetListAuditJavaObject = new
- // ExpectedExternalAudit();
- ExpectedExternalAudit expectedAssetListAuditJavaObject = getDefaultExternalAuditObject(assetType, AuditingActionEnum.GET_FILTERED_ASSET_LIST, query);
- expectedAssetListAuditJavaObject.setSTATUS("404");
- ErrorInfo errorInfo = null;
- try {
- errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_CATEGORY_NOT_FOUND.name());
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- }
- String desc = (errorInfo.getMessageId() + ": " + errorInfo.getMessage()).replace("%2", "category").replace("%3", category).replace("%1", "resource");
- expectedAssetListAuditJavaObject.setDESC(desc);
-
- return expectedAssetListAuditJavaObject;
-
- }
-
- public static ExpectedExternalAudit getDefaultAssetMetadataAudit(AssetTypeEnum assetType, Component component) {
-
- ExpectedExternalAudit expectedAssetListAuditJavaObject = new ExpectedExternalAudit();
- expectedAssetListAuditJavaObject = getDefaultExternalAuditObject(assetType, AuditingActionEnum.GET_ASSET_METADATA, null);
- expectedAssetListAuditJavaObject.setRESOURCE_URL(expectedAssetListAuditJavaObject.getRESOURCE_URL() + "/" + component.getUUID() + "/metadata");
- expectedAssetListAuditJavaObject.setRESOURCE_NAME(component.getName());
- expectedAssetListAuditJavaObject.setRESOURCE_TYPE(component.getComponentType().getValue());
- expectedAssetListAuditJavaObject.setSERVICE_INSTANCE_ID(component.getUUID());
- return expectedAssetListAuditJavaObject;
-
- }
-
- public static ExpectedExternalAudit getDefaultAssetMetadataAuditFailure(AssetTypeEnum assetType, String serviceUuid, String resourceType) {
-
- ExpectedExternalAudit expectedAssetListAuditJavaObject = new ExpectedExternalAudit();
- expectedAssetListAuditJavaObject = getDefaultExternalAuditObject(assetType, AuditingActionEnum.GET_ASSET_METADATA, null);
- expectedAssetListAuditJavaObject.setSTATUS("404");
- expectedAssetListAuditJavaObject.setDESC("OK");
- expectedAssetListAuditJavaObject.setRESOURCE_URL(expectedAssetListAuditJavaObject.getRESOURCE_URL() + "/" + serviceUuid + "/metadata");
- expectedAssetListAuditJavaObject.setRESOURCE_TYPE(resourceType);
- expectedAssetListAuditJavaObject.setSERVICE_INSTANCE_ID(serviceUuid);
- return expectedAssetListAuditJavaObject;
-
- }
-
- // Category/Subcategory/Group
- public static CategoryDefinition getDefaultCategory() {
- CategoryDefinition productCategoryDefinition = new CategoryDefinition();
- productCategoryDefinition.setName("CiCateg" + generateUUIDforSufix());
- return productCategoryDefinition;
- }
-
- public static SubCategoryDefinition getDefaultSubCategory() {
- SubCategoryDefinition productSubCategoryDefinition = new SubCategoryDefinition();
- productSubCategoryDefinition.setName("CiSubCateg" + generateUUIDforSufix());
- return productSubCategoryDefinition;
- }
-
- public static GroupingDefinition getDefaultGroup() {
- GroupingDefinition productGroupDefinition = new GroupingDefinition();
- productGroupDefinition.setName("CiGrouping1" + generateUUIDforSufix());
- return productGroupDefinition;
- }
-
- // Product
-
- public static ProductReqDetails getDefaultProduct() {
- return createDefaultProductReqDetails(CI_PRODUCT, null);
- }
-
- public static ProductReqDetails getDefaultProduct(String name) {
- return createDefaultProductReqDetails(name, null);
- }
-
- public static ProductReqDetails getDefaultProduct(CategoryDefinition category) {
- List<CategoryDefinition> categories = new ArrayList<>();
- categories.add(category);
- return createDefaultProductReqDetails(CI_PRODUCT, categories);
- }
-
- public static ProductReqDetails getDefaultProduct(String name, CategoryDefinition category) {
- List<CategoryDefinition> categories = new ArrayList<>();
- categories.add(category);
- return createDefaultProductReqDetails(name, categories);
- }
-
- public static ProductReqDetails getDefaultProduct(List<CategoryDefinition> categories) {
- return createDefaultProductReqDetails(CI_PRODUCT, categories);
- }
-
- public static ProductReqDetails getDefaultProduct(String name, List<CategoryDefinition> categories) {
- return createDefaultProductReqDetails(name, categories);
- }
-
- private static ProductReqDetails createDefaultProductReqDetails(String productName, List<CategoryDefinition> categories) {
- ProductReqDetails product = new ProductReqDetails(productName);
- productName = (productName + generateUUIDforSufix());
- product.setName(productName);
- ArrayList<String> tags = new ArrayList<>();
- tags.add(productName);
- product.setTags(tags);
- product.setProjectCode("12345");
- product.setIcon("myIcon");
- ArrayList<String> contacts = new ArrayList<>();
- // contacts.add(ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST1).getUserId());
- // contacts.add(ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST2).getUserId());
- contacts.add(ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1).getUserId());
- // contacts.add(ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER2).getUserId());
- product.setContacts(contacts);
- product.setContactId(UserRoleEnum.PRODUCT_MANAGER1.getUserId());
- product.setCategories(categories);
- String fullName = "This is my full name: " + productName;
- product.setFullName(fullName);
- String description = "This is product description";
- product.setDescription(description);
- return product;
- }
-
- public static RequirementCapabilityRelDef getReqCapRelation(String fromCompInstId, String toCompInstId, String reqOwnerId, String capOwnerId, String capType, String reqCapName, List<CapabilityDefinition> capList,
- List<RequirementDefinition> reqList) {
- RequirementCapabilityRelDef requirementDef = new RequirementCapabilityRelDef();
- requirementDef.setFromNode(fromCompInstId);
- requirementDef.setToNode(toCompInstId);
- RelationshipInfo relationInfo = new RelationshipInfo();
- relationInfo.setRequirementOwnerId(reqOwnerId);
- relationInfo.setCapabilityOwnerId(capOwnerId);
- relationInfo.setRequirement(reqCapName);
- RelationshipImpl relationImpl = new RelationshipImpl();
- relationImpl.setType(capType);
- relationInfo.setRelationships(relationImpl);
- relationInfo.setCapabilityUid(capList.get(0).getUniqueId());
- relationInfo.setRequirementUid(reqList.get(0).getUniqueId());
- List<CapabilityRequirementRelationship> relationships = new ArrayList<>();
- CapabilityRequirementRelationship relationship = new CapabilityRequirementRelationship();
- relationship.setRelation(relationInfo);
- relationships.add(relationship);
- requirementDef.setRelationships(relationships);
- return requirementDef;
- }
-
- public static String generateUUIDforSufix() {
- final String uniqueSuffix = UUID.randomUUID().toString();
- return uniqueSuffix.split("-")[4];
- }
-
- private static String normalizeArtifactLabel(String label) {
-
- label = label.substring(0, label.indexOf("."));
- String normalizedLabel = ValidationUtils.normalizeArtifactLabel(label);
- return normalizedLabel.substring(0, Math.min(25, normalizedLabel.length()));
-
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/FileHandling.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/FileHandling.java
deleted file mode 100644
index dae13a2c82..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/FileHandling.java
+++ /dev/null
@@ -1,488 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.general;
-
-import static org.testng.AssertJUnit.assertTrue;
-
-import com.aventstack.extentreports.Status;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileWriter;
-import java.io.FilenameFilter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipException;
-import java.util.zip.ZipFile;
-import org.apache.commons.io.FileUtils;
-import org.openecomp.sdc.be.model.DataTypeDefinition;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.datatypes.enums.XnfTypeEnum;
-import org.openecomp.sdc.common.util.GeneralUtility;
-import org.yaml.snakeyaml.Yaml;
-
-public class FileHandling {
-
-// ------------------yaml parser methods----------------------------
- public static Map<?, ?> parseYamlFile(String filePath) throws Exception {
- Yaml yaml = new Yaml();
- File file = new File(filePath);
- InputStream inputStream = new FileInputStream(file);
- Map<?, ?> map = (Map<?, ?>) yaml.load(inputStream);
- return map;
- }
-
- /**
- * The method return map fetched objects by pattern from yaml file
- * @param yamlFile
- * @param pattern
- * @return
- * @throws Exception
- */
- public static Map<String, Object> parseYamlFileToMapByPattern(File yamlFile, String pattern) throws Exception {
- Map<?, ?> yamlFileToMap = FileHandling.parseYamlFile(yamlFile.toString());
- Map<String, Object> objectMap = getObjectMapByPattern(yamlFileToMap, pattern);
- return objectMap;
- }
-
- @SuppressWarnings("unchecked")
- public static Map<String, Object> getObjectMapByPattern(Map<?, ?> parseUpdetedEnvFile, String pattern) {
- Map<String, Object> objectMap = null;
-
- Object objectUpdetedEnvFile = parseUpdetedEnvFile.get(pattern);
- if(objectUpdetedEnvFile instanceof HashMap){
- objectMap = (Map<String, Object>) objectUpdetedEnvFile;
- }
- return objectMap;
- }
-
-
- public static Map<String, DataTypeDefinition> parseDataTypesYaml(String filePath) throws Exception {
- @SuppressWarnings("unchecked")
- Map<String, DataTypeDefinition> dataTypesMap = (Map<String, DataTypeDefinition>) parseYamlFile(filePath);
- return dataTypesMap;
- }
-// -------------------------------------------------------------------------------------------------
-
- /**
- * @param folder, folder name under "Files" folder
- * @return path to given folder from perspective of working directory or sdc-vnfs repository
- */
- public static String getFilePath(String folder) {
- String filepath = System.getProperty("filePath");
- boolean isFilePathEmptyOrNull = (filepath == null || filepath.isEmpty());
-
- // return folder from perspective of sdc-vnfs repository
- if (isFilePathEmptyOrNull && ( System.getProperty("os.name").contains("Windows") || System.getProperty("os.name").contains("Mac"))) {
- return FileHandling.getResourcesFilesPath() + folder + File.separator;
- }
-
- // return folder from perspective of working directory ( in general for nightly run from Linux, should already contain "Files" directory )
- return FileHandling.getBasePath() + "Files" + File.separator + folder + File.separator;
- }
-
- public static String getBasePath() {
- return System.getProperty("user.dir") + File.separator;
- }
-
- public static String getSdcVnfsPath() {
- return getBasePath() + Paths.get("..", "..", "sdc-vnfs").toString();
- }
-
- public static String getDriversPath() {
- return getBasePath() + "src" + File.separator + "main" + File.separator + "resources"
- + File.separator + "ci" + File.separator + "drivers" + File.separator;
- }
-
- public static String getResourcesFilesPath() {
-// return getBasePath() + "src" + File.separator + "main" + File.separator + "resources"
-// + File.separator + "Files" + File.separator;
-
- return getSdcVnfsPath()+ File.separator + "ui-tests" + File.separator + "Files" + File.separator;
- }
-
- public static String getResourcesEnvFilesPath() {
- return getBasePath() + File.separator + "src" + File.separator + "main" + File.separator + "resources"
- + File.separator + "Files" + File.separator + "ResourcesEnvFiles" +File.separator;
- }
-
- public static String getCiFilesPath() {
- return getBasePath() + "src" + File.separator + "main" + File.separator + "resources"
- + File.separator + "ci";
- }
-
- public static String getConfFilesPath() {
- return getCiFilesPath() + File.separator + "conf" + File.separator;
- }
-
- public static String getTestSuitesFilesPath() {
- return getCiFilesPath() + File.separator + "testSuites" + File.separator;
- }
-
- public static String getVnfRepositoryPath() {
- return getFilePath("VNFs");
- }
-
- public static String getXnfRepositoryPath(XnfTypeEnum xnfTypeEnum) {
- return xnfTypeEnum.getValue().equals(XnfTypeEnum.PNF.name()) ? getFilePath("PNFs") : getFilePath("VNFs");
- }
-
- public static String getPortMirroringRepositoryPath() {
- return getFilePath("PortMirroring");
- }
-
- public static File getConfigFile(String configFileName) throws Exception {
- File configFile = new File(FileHandling.getBasePath() + File.separator + "conf" + File.separator + configFileName);
- if (!configFile.exists()) {
- configFile = new File(FileHandling.getConfFilesPath() + configFileName);
- }
- return configFile;
- }
-
- public static Object[] filterFileNamesFromFolder(String filepath, String extension) {
- try {
- File dir = new File(filepath);
- List<String> filenames = new ArrayList<String>();
-
- FilenameFilter extensionFilter = new FilenameFilter() {
- public boolean accept(File dir, String name) {
- return name.endsWith(extension);
- }
- };
-
- if (dir.isDirectory()) {
- for (File file : dir.listFiles(extensionFilter)) {
- filenames.add(file.getName());
- }
- return filenames.toArray();
- }
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- return null;
- }
-
- public static List<String> filterFileNamesListFromFolder(String filepath, String extension) {
- List<String> filenames = new ArrayList<String>();
- try {
- File dir = new File(filepath);
-
- FilenameFilter extensionFilter = new FilenameFilter() {
- public boolean accept(File dir, String name) {
- return name.endsWith(extension);
- }
- };
-
- if (dir.isDirectory()) {
- for (File file : dir.listFiles(extensionFilter)) {
- filenames.add(file.getName());
- }
- return filenames;
- }
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- return filenames;
- }
-
- public static String[] getArtifactsFromZip(String filepath, String zipFilename){
- try {
- ZipFile zipFile = new ZipFile(filepath + File.separator + zipFilename);
- Enumeration<? extends ZipEntry> entries = zipFile.entries();
-
- String[] artifactNames = new String[zipFile.size() - 1];
-
- int i = 0;
- while(entries.hasMoreElements()){
- ZipEntry nextElement = entries.nextElement();
- if (!nextElement.isDirectory()){
- if (!nextElement.getName().equals("MANIFEST.json")){
- String name = nextElement.getName();
- artifactNames[i++] = name;
- }
- }
- }
- zipFile.close();
- return artifactNames;
- } catch(ZipException zipEx) {
- System.err.println("Error in zip file named : " + zipFilename);
- zipEx.printStackTrace();
- } catch (IOException e) {
- System.err.println("Unhandled exception : ");
- e.printStackTrace();
- }
-
- return null;
-
- }
-
- public static List<String> getFileNamesFromZip(String zipFileLocation){
- try{
- ZipFile zipFile = new ZipFile(zipFileLocation);
- Enumeration<? extends ZipEntry> entries = zipFile.entries();
-
- List<String> artifactNames = new ArrayList<>();
-
- int i = 0;
- while(entries.hasMoreElements()){
- ZipEntry nextElement = entries.nextElement();
- if (!nextElement.isDirectory()){
- String name = nextElement.getName();
- artifactNames.add(name);
- }
- }
- zipFile.close();
- return artifactNames;
- }
- catch(ZipException zipEx){
- System.err.println("Error in zip file named : " + zipFileLocation);
- zipEx.printStackTrace();
- } catch (IOException e) {
- System.err.println("Unhandled exception : ");
- e.printStackTrace();
- }
- return null;
- }
-
- public static List<String> getZipFileNamesFromFolder(String filepath) {
- List<String> fileNamesListFromFolder = filterFileNamesListFromFolder(filepath, ".zip");
- fileNamesListFromFolder.addAll(filterFileNamesListFromFolder(filepath, ".csar"));
- return fileNamesListFromFolder;
- }
-
- public static int countFilesInZipFile(String[] artifactsArr, String reqExtension){
- int fileCounter = 0;
- for (String artifact : artifactsArr){
- String extensionFile = artifact.substring(artifact.lastIndexOf(".") + 1 , artifact.length());
- if (extensionFile.equals(reqExtension)){
- fileCounter++;
- }
- }
- return fileCounter;
- }
-
- /**
- * @param dirPath
- * @return last modified file name from dirPath directory
- */
- public static synchronized File getLastModifiedFileNameFromDir(String dirPath){
- File dir = new File(dirPath);
- File[] files = dir.listFiles();
- if (files == null) {
- assertTrue("File not found under directory " + dirPath, false);
- return null;
- }
-
- File lastModifiedFile = files[0];
- for (int i = 1; i < files.length; i++) {
- if(files[i].isDirectory()) {
- continue;
- }
- if (lastModifiedFile.lastModified() < files[i].lastModified()) {
- lastModifiedFile = files[i];
- }
- }
- return lastModifiedFile;
- }
-
- public static void deleteDirectory(String directoryPath) {
- File dir = new File(directoryPath);
- try {
- FileUtils.cleanDirectory(dir);
- } catch (IllegalArgumentException e) {
- System.out.println("Failed to clean " + dir);
- } catch (IOException e) {
- System.out.println("Failed to clean " + dir);
- }
- }
-
- public static void createDirectory(String directoryPath) {
- File directory = new File(String.valueOf(directoryPath));
- if (! directory.exists()){
- directory.mkdir();
- }
- }
-
-
- /**
- * The method append data to existing file, if file not exists - create it
- * @param pathToFile
- * @param text
- * @param leftSpaceCount
- * @throws IOException
- */
- public static synchronized void writeToFile(File pathToFile, Object text, Integer leftSpaceCount) throws IOException{
-
- BufferedWriter bw = null;
- FileWriter fw = null;
- if(!pathToFile.exists()){
- createEmptyFile(pathToFile);
- }
- try {
- fw = new FileWriter(pathToFile, true);
- bw = new BufferedWriter(fw);
- StringBuilder sb = new StringBuilder();
- if(leftSpaceCount > 0 ){
- for(int i = 0; i < leftSpaceCount; i++){
- sb.append(" ");
- }
- }
- bw.write(sb.toString() + text);
- bw.newLine();
- bw.close();
- fw.close();
- } catch (Exception e) {
- ComponentBaseTest.getExtendTest().log(Status.INFO, "Unable to write to flie " + pathToFile);
- }
- }
-
- public static String getCreateDirByName(String dirName) {
- File dir = new File(dirName);
- dir.mkdir();
- if(!dir.exists()) {
- }
-
- return dir.getPath();
- }
-
- public static boolean isFileDownloaded(String downloadPath, String fileName) {
- boolean flag = false;
- File dir = new File(downloadPath);
- File[] dir_contents = dir.listFiles();
- for (int i = 0; i < dir_contents.length; i++) {
- if (dir_contents[i].getName().equals(fileName))
- return flag = true;
- }
- return flag;
- }
-
- public static String getMD5OfFile(File file) throws IOException {
- String content = FileUtils.readFileToString(file);
- String md5 = GeneralUtility.calculateMD5Base64EncodedByString(content);
- return md5;
- }
-
- public static File createEmptyFile(String fileToCreate) {
- File file= new File(fileToCreate);
- try {
- if(file.exists()){
- deleteFile(file);
- }
- file.createNewFile();
- ComponentBaseTest.getExtendTest().log(Status.INFO, "Create file " + fileToCreate);
- } catch (IOException e) {
- ComponentBaseTest.getExtendTest().log(Status.INFO, "Failed to create file " + fileToCreate);
- e.printStackTrace();
- }
- return file;
- }
-
- public static File createEmptyFile(File fileToCreate) {
- try {
- if(fileToCreate.exists()){
- deleteFile(fileToCreate);
- }
- fileToCreate.createNewFile();
- ComponentBaseTest.getExtendTest().log(Status.INFO, "Create file " + fileToCreate);
- } catch (IOException e) {
- ComponentBaseTest.getExtendTest().log(Status.INFO, "Failed to create file " + fileToCreate);
- e.printStackTrace();
- }
- return fileToCreate;
- }
-
- public static void deleteFile(File file){
-
- try{
- if(file.exists()){
- file.deleteOnExit();
- ComponentBaseTest.getExtendTest().log(Status.INFO, "File " + file.getName() + "has been deleted");
- }else{
- ComponentBaseTest.getExtendTest().log(Status.INFO, "Failed to delete file " + file.getName());
- }
- }catch(Exception e){
- e.printStackTrace();
- }
-
- }
-
-
- /**
- * get file list from directory by extension array
- * @param directory
- * @param okFileExtensions
- * @return
- */
- public static List<File> getHeatAndHeatEnvArtifactsFromZip(File directory, String[] okFileExtensions){
-
- List<File> fileList = new ArrayList<>();
- File[] files = directory.listFiles();
-
- for (String extension : okFileExtensions){
- for(File file : files){
- if (file.getName().toLowerCase().endsWith(extension)){
- fileList.add(file);
- }
- }
- }
- return fileList;
- }
-
- public static String getKeyByValueFromPropertyFormatFile(String fullPath, String key) {
- Properties prop = new Properties();
- InputStream input = null;
- String value = null;
- try {
- input = new FileInputStream(fullPath);
- prop.load(input);
- value = (prop.getProperty(key));
-
- } catch (IOException ex) {
- ex.printStackTrace();
- } finally {
- if (input != null) {
- try {
- input.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
-
- return value.replaceAll("\"","");
- }
-
- public static void overWriteExistindDir(String outputCsar) throws IOException {
- String basePath = getBasePath();
- String csarDir = FileHandling.getCreateDirByName("outputCsar");
- FileUtils.cleanDirectory(new File(csarDir));
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/FileUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/FileUtils.java
deleted file mode 100644
index 226c734c91..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/FileUtils.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.general;
-
-import fj.data.Either;
-import org.openecomp.sdc.ci.tests.utils.Decoder;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.File;
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import static org.testng.AssertJUnit.assertTrue;
-
-public class FileUtils {
- static Logger logger = LoggerFactory.getLogger(Utils.class.getName());
-
- public static void writeToFile(String filePath, String content) {
- try {
- Files.write(Paths.get(filePath), content.getBytes());
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- public static String getFileName(String fullyQualified) {
- String fileName = fullyQualified;
-
- int i = fullyQualified.lastIndexOf('.');
- if (i > 0) {
- fileName = fullyQualified.substring(i + 1);
- }
- return fileName;
-
- }
-
- public static Either<String, Exception> getFileContentUTF8(String filePath) {
- Either<String, Exception> eitherResult;
- try {
- String content = new String(Files.readAllBytes(Paths.get(filePath)), StandardCharsets.UTF_8);
- eitherResult = Either.left(content);
- } catch (Exception e) {
- eitherResult = Either.right(e);
- }
- return eitherResult;
- }
-
- public static List<String> getFileListFromBaseDirectoryByTestName(String testResourcesPath) {
-
- File file = new File(testResourcesPath);
- File[] listFiles = file.listFiles();
- if (listFiles != null) {
- List<String> listFileName = new ArrayList<String>();
- for (File newFile : listFiles) {
- if (newFile.isFile()) {
- listFileName.add(newFile.getPath());
- }
- }
- return listFileName;
- }
- assertTrue("directory " + testResourcesPath + " is empty", false);
- return null;
- }
-
- public static String getFilePathFromListByPattern(List<String> fileList, String pattern) {
-
- for (String filePath : fileList) {
- if (filePath.contains(pattern)) {
- return filePath;
- }
- }
- return null;
- }
-
- public static String loadPayloadFileFromListUsingPosition(List<String> listFileName, String pattern,
- Boolean isBase64, int positionInList) throws IOException {
- List<String> newList = new ArrayList<String>(Arrays.asList(listFileName.get(positionInList)));
- return loadPayloadFile(newList, pattern, isBase64);
- }
-
- public static String loadPayloadFile(List<String> listFileName, String pattern, Boolean isBase64) throws IOException {
- String fileName;
- String payload = null;
- fileName = FileUtils.getFilePathFromListByPattern(listFileName, pattern);
- logger.debug("fileName: {}", fileName);
-
- if (fileName != null) {
- payload = Decoder.readFileToString(fileName);
- if (isBase64) {
- payload = Decoder.encode(payload.getBytes());
- }
- } else {
- assertTrue("file to upload not found", false);
- }
- return payload;
- }
-
- public static String getFileNameFromPath(String testResourcesPath) {
-
- File file = new File(testResourcesPath);
- String fileName = null;
- if (file.exists()) {
- return file.getName();
- } else {
- assertTrue("file to upload not found", false);
- }
- return fileName;
-
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/ImportUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/ImportUtils.java
deleted file mode 100644
index 3b1dcdac1e..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/ImportUtils.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.general;
-
-import org.openecomp.sdc.ci.tests.datatypes.ImportReqDetails;
-
-import java.io.IOException;
-import java.util.List;
-
-public class ImportUtils {
-
- public static ImportReqDetails getImportResourceDetailsByPathAndName(ImportReqDetails importReqDetails,
- String filePath, String fileName) throws IOException {
-
- // ImportReqDetails importReqDetails;
- // User sdncUserDetails;
- // String testResourcesPath;
- // ResourceReqDetails resourceDetails;
- // Config config;
- // config = Utils.getConfig();
- //
- // importReqDetails = ElementFactory.getDefaultImportResource();
- // User sdncUserDetails =
- // ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- // ResourceReqDetails resourceDetails =
- // ElementFactory.getDefaultResource();
- // String sourceDir = config.getResourceConfigDir();
- // String testResourcesPath = sourceDir + File.separator + workDir;
- // final String workDir = "importToscaResourceByCreateUrl";
-
- List<String> listFileName = FileUtils.getFileListFromBaseDirectoryByTestName(filePath);
- importReqDetails.setPayloadName(fileName);
- String payloadData = FileUtils.loadPayloadFile(listFileName, fileName, true);
- importReqDetails.setPayloadData(payloadData);
-
- return importReqDetails;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/OnboardingUtillViaApis.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/OnboardingUtillViaApis.java
deleted file mode 100644
index 64a62c5619..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/OnboardingUtillViaApis.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.general;
-
-import com.google.gson.Gson;
-import fj.data.Either;
-import org.apache.commons.codec.binary.Base64;
-import org.openecomp.sdc.be.model.Component;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.VendorLicenseModel;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
-
-import java.io.*;
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import static org.testng.AssertJUnit.assertTrue;
-
-public class OnboardingUtillViaApis {
-
- public static VendorSoftwareProductObject createVspViaApis(ResourceReqDetails resourceReqDetails, String filepath, String vnfFile, User user) throws Exception {
-
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(user);
- return VendorSoftwareProductRestUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile, filepath, user,
- vendorLicenseModel);
- }
-
- public static Resource createResourceFromVSP(ResourceReqDetails resourceDetails) throws Exception {
- Resource resource = AtomicOperationUtils.createResourceByResourceDetails(resourceDetails, UserRoleEnum.DESIGNER, true).left().value();
- return resource;
-
- }
-
- public static Resource createResourceFromVSP(ResourceReqDetails resourceDetails, UserRoleEnum userRole) throws Exception {
- Resource resource = AtomicOperationUtils.createResourceByResourceDetails(resourceDetails, userRole, true).left().value();
- return resource;
-
- }
-
- public static void downloadToscaCsarToDirectory(Component component, File file) {
- try {
- Either<String, RestResponse> componentToscaArtifactPayload = AtomicOperationUtils.getComponenetArtifactPayload(component, "assettoscacsar");
- if(componentToscaArtifactPayload.left().value() != null){
- convertPayloadToFile(componentToscaArtifactPayload.left().value(), file);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
-
- public static void convertPayloadToFile(String payload, File file) throws IOException{
-
- Gson gson = new Gson();
- @SuppressWarnings("unchecked")
- Map<String, String> fromJson = gson.fromJson(payload, Map.class);
- String string = fromJson.get("base64Contents").toString();
- byte[] byteArray = Base64.decodeBase64(string.getBytes(StandardCharsets.UTF_8));
- File downloadedFile = new File(file.getAbsolutePath());
- FileOutputStream fos = new FileOutputStream(downloadedFile);
- fos.write(byteArray);
- fos.flush();
- fos.close();
- }
-
-
- public static void convertPayloadToZipFile(String payload, File file) throws IOException{
-
- byte[] byteArray = payload.getBytes(StandardCharsets.ISO_8859_1);
- File downloadedFile = new File(file.getAbsolutePath());
- FileOutputStream fos = new FileOutputStream(downloadedFile);
- fos.write(byteArray);
- fos.flush();
- fos.close();
-
- System.out.println("");
-
- BufferedInputStream bis = new BufferedInputStream(new ByteArrayInputStream(payload.getBytes(StandardCharsets.ISO_8859_1)));
- String filePath = file.toString();
- BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(new File(filePath)));
- int inByte;
- while((inByte = bis.read()) != -1) bos.write(inByte);
- bis.close();
- bos.close();
- }
-
- public static Either<String, RestResponse> getVendorSoftwareProduct(String vspId, User user, Boolean validateState) throws IOException {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_VENDOR_SOFTWARE_PRODUCT, config.getOnboardingBeHost(), config.getOnboardingBePort(), vspId);
- String userId = user.getUserId();
- Map<String, String> headersMap = OnboardingUtils.prepareHeadersMap(userId);
- headersMap.put(HttpHeaderEnum.X_ECOMP_REQUEST_ID_HEADER.getValue(), "123456");
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), "*/*");
- headersMap.put("Accept-Encoding", "gzip, deflate, br");
- HttpRequest http = new HttpRequest();
- RestResponse response = http.httpSendGet(url, headersMap);
- if (validateState) {
- assertTrue("add property to resource failed: " + response.getResponseMessage(), response.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
- }
- if (response.getErrorCode() != BaseRestUtils.STATUS_CODE_SUCCESS && response.getResponse().getBytes() == null && response.getResponse().getBytes().length == 0) {
- return Either.right(response);
- }
- return Either.left(response.getResponse());
-
- }
-
- public static ResourceReqDetails prepareOnboardedResourceDetailsBeforeCreate(ResourceReqDetails resourceDetails, VendorSoftwareProductObject vendorSoftwareProductObject) {
-
- List<String> tags = new ArrayList<>();
- tags.add(vendorSoftwareProductObject.getName());
- resourceDetails.setCsarUUID(vendorSoftwareProductObject.getVspId());
- resourceDetails.setCsarVersion(vendorSoftwareProductObject.getVersion());
- resourceDetails.setName(vendorSoftwareProductObject.getName());
- resourceDetails.setTags(tags);
- resourceDetails.setDescription(vendorSoftwareProductObject.getDescription());
- resourceDetails.setVendorName(vendorSoftwareProductObject.getVendorName());
- resourceDetails.setResourceType("VF");
- resourceDetails.setResourceVendorModelNumber("666");
- resourceDetails.setContactId(vendorSoftwareProductObject.getAttContact());
-
- return resourceDetails;
- }
-
- public static ServiceReqDetails prepareServiceDetailsBeforeCreate(User user) {
-
- ServiceReqDetails serviceDetails = ElementFactory.getDefaultService(ServiceCategoriesEnum.NETWORK_L4, user);
- serviceDetails.setServiceType("MyServiceType");
- serviceDetails.setServiceRole("MyServiceRole");
- serviceDetails.setNamingPolicy("MyServiceNamingPolicy");
- serviceDetails.setEcompGeneratedNaming(false);
-
- return serviceDetails;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/OnboardingUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/OnboardingUtils.java
deleted file mode 100644
index 1a15f46c08..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/OnboardingUtils.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.general;
-
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.enums.XnfTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-
-import java.util.*;
-
-public class OnboardingUtils {
-
- /**
- * excluded VNF or PNF file list
- */
- public static List<String> excludeXnfList =
-// new ArrayList<>();
- Arrays.asList(
-// DUPLICATE_RESOURCE_ID_IN_DIFFERENT_FILES:
- "2017-376_vMOG_11_1.zip",
- "HeatCandidate_2017-09-20_15-06_66Name_2016-20-visbc1vf-v6.0-(VOIP).zip",
- "1 Apndns-1710-vf v3.0.zip",
- "1 AVPN_vRE_BV_volume-V2.zip",
- "1-Vf-zrdm5bpxtc02-092017-(MOBILITY)_v3.0.zip",
- "1-Mobility_vprobe_fe_11_2_1_vf_(MOBILITY)_v1.0.zip",
-// ORCHESTRATION_NOT_FOUND:
- "1-2017-491-4vshaken-HTTP-CM-vf-(VOIP)_v2.0.zip",
-// did not succeed to create package of new VSP expected:<200> but was:<500>:
- "1-Riverbed-WANx1710VFv_v2.0.zip",
- "1-LMSP_v5-062317_v3.0.zip",
- "1-VF-Cisco-vCSR-1710_v2.0.zip",
- "1-mDNS-preload_1710-0914_v3.0.zip",
- "1-Firewall_170_Pala_Aloto_VF_v2.0.zip",
- "2-mDNS-preload-1710-0914_v3.1VF.zip",
- "1-2016-233_xsp_bfsa_nin2-vf-V1.0-VOIP-10-20.zip",
-// did not succeed to submit new VSP expected:<200> but was:<417>
- "1-VF_vEPDG_v4.0.zip",
- "1-VF-2017-491_9vShaken-F5-LB_v1.0.zip",
- "2-2016-73_Mow-AVPN-vpe-BV-L_v1.0.zip",
- "VF-2017389vTSBCDPA2-v4.0.zip",
- "1-vEPDG_V1.0(3).zip",
- "1-vHSS-EPC-RDM3-Lab-VF-0830_V3.0.zip",
- "2-2016-73_Mow-AVPN-vPE-BV-L_VF_V2.0_1027.zip",
- "1-ADIOD_base_vPE_BV_v9.0.zip",
- "Vhss-epc-rdm3-lab-vf-0921-v2.0-MOBILITY-10-20.zip",
- "1-Vhss-epc-rdm3-lab-vf-0921_VF00816v2.0-MOBILITY-10-20.zip",
- "1-VF-vUSP-CCF-DB-0620_v1.0base_vDB.zip",
- "1-Vusp_vhss-ims_cm-repo1_V1.zip",
- "1-base_vepdg_volume_v4.0.zip",
- "1-Vocg_1710-2017-509(2)_v1.0.zip",
- "1-2016-20-vISBC3VF_v3.0.zip",
- "Apndns-1710-vf-v3.0-10-20.zip",
- "1-VF-EFMC_DBE_Nin_v27.0.zip",
- "2-APNDNS_1710-VF_v4.0.zip",
- "1-Mow_adig_vpe_bv-V3.0.zip",
- "1-VF-2017-488_ADOID_vPE_v9.0.zip",
- "1-MOBT_Nimbus_3_Sprint-1.zip",
- "1-VF-2017-491_9vShaken-CM_v1.0.zip",
- "1-VF_zrdm5bpxtc02_092017_v2.0.zip",
-// Error: TOSCA yaml file %1 cannot be modeled to VF as it does not contain \u0027topology_template
- "1-VF-Checkpoint_vFW-1710_v1.0.zip"
- );
-
- /**
- * additional files to excludeXnfList files for tosca parser tests
- */
- protected static List<String> excludeXnfListForToscaParser = //new ArrayList<String>();
- Arrays.asList(
- "1-Vvig-062017-(MOBILITY)_v5.1.zip",
- "1-Mvm-sbc-1710-092017-(MOBILITY)_v7.0.zip",
- "1-2017-492-5vshaken-SIP-AS-vf-(VOIP)_v2.0.zip",
- "1-201712-488-adiod-vpe-(Layer-0-3)_v2.0.zip",
- "2017-502.zip",
- "1-2017-505-urlb-vhepe-(Layer-0-3)_v2.0.zip",
- "2017-376_vMOG_11_1.zip",
- "HeatCandidate_2017-09-22_01-30_60Name_Vdbe-vsp-15.1x49-d50.3-v3.0-(VOIP).zip",
- "HeatCandidate_2017-09-22_01-42_57Name_2017389vtsbc4vf-v10.0-(VOIP).zip",
- "HeatCandidate_2017-09-20_13-47_68Name_2017-492-5vshaken-SIP-AS-vf-v1.0-(VOIP)_10202017.zip",
- "1-2016-20-visbc3vf-(VOIP)_v2.1.zip",
- "1-2017-404_vUSP_vCCF_AIC3.0-(VOIP)_v6.0.zip",
- "1-2017389vtsbc4vf-(VOIP)_v11.0.zip"
- );
-
- public static String handleFilename(String heatFileName) {
- final String namePrefix = String.format("%sVF%s", ElementFactory.getResourcePrefix(), "Onboarded-");
- final String nameSuffix = "-" + getShortUUID();
-
- String subHeatFileName = heatFileName.substring(0, heatFileName.lastIndexOf("."));
-
- if ((namePrefix + subHeatFileName + nameSuffix).length() >= 50) {
- subHeatFileName = subHeatFileName.substring(0, 50 - namePrefix.length() - nameSuffix.length());
- }
-
- if (subHeatFileName.contains("(") || subHeatFileName.contains(")")) {
- subHeatFileName = subHeatFileName.replace("(", "-");
- subHeatFileName = subHeatFileName.replace(")", "-");
- }
-
- String vnfName = namePrefix + subHeatFileName + nameSuffix;
- return vnfName;
- }
-
-
- public static String getShortUUID() {
- return UUID.randomUUID().toString().split("-")[0];
- }
-
- private static RestResponse actionOnComponent(String vspid, String body, String onboardComponent, User user, String componentVersion) throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.ACTION_ON_COMPONENT, config.getOnboardingBeHost(), config.getOnboardingBePort(), onboardComponent, vspid, componentVersion);
- String userId = user.getUserId();
- Map<String, String> headersMap = prepareHeadersMap(userId);
-
- HttpRequest http = new HttpRequest();
- RestResponse response = http.httpSendPut(url, body, headersMap);
- return response;
- }
-
- public static String getVspValidationConfiguration() throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.VSP_VALIDATION_CONFIGURATION, config.getOnboardingBeHost(), config.getOnboardingBePort());
- Map<String, String> headersMap = prepareHeadersMap("cs0008");
-
- HttpRequest http = new HttpRequest();
- RestResponse response = http.httpSendGet(url, headersMap);
- if(response.getErrorCode().intValue() == 200){
- return ResponseParser.getValueFromJsonResponse(response.getResponse(), "enabled");
- }
- throw new Exception("Cannot get configuration file");
- //return response;
- }
-
- public static String putVspValidationConfiguration(boolean value) throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.VSP_VALIDATION_CONFIGURATION, config.getOnboardingBeHost(), config.getOnboardingBePort());
- Map<String, String> headersMap = prepareHeadersMap("cs0008");
-
- String body = String.format("{\"enabled\": \"%s\"}", value);
-
- HttpRequest http = new HttpRequest();
- RestResponse response = http.httpSendPut(url, body, headersMap);
- if(response.getErrorCode().intValue() == 200){
- return ResponseParser.getValueFromJsonResponse(response.getResponse(), "enabled");
- }
- throw new Exception("Cannot set configuration file");
- //return response;
- }
-
- protected static Map<String, String> prepareHeadersMap(String userId) {
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "application/json");
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), "application/json");
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), userId);
- return headersMap;
- }
-
- /**
- * @return
- * The method returns XNF names list from Files directory under sdc repository
- */
- public static List<String> getXnfNamesFileList(XnfTypeEnum xnfTypeEnum) {
- String filepath = FileHandling.getXnfRepositoryPath(xnfTypeEnum);
- List<String> fileNamesFromFolder = FileHandling.getZipFileNamesFromFolder(filepath);
- fileNamesFromFolder.removeAll(excludeXnfList);
- return fileNamesFromFolder;
- }
-
- /**
- * @param vnfNamesFileList
- * @return divide List according to day of month, if day of month is even as get first half part of the List, else - second
- */
- public static List<String> divideListByDayOfMonth(List<String> vnfNamesFileList){
-
- Calendar cal = Calendar.getInstance();
- int dayOfMonth = cal.get(Calendar.DAY_OF_MONTH)+1;
- int filesCount = vnfNamesFileList.size();
- if(dayOfMonth%2 == 0){
- return vnfNamesFileList.subList(0,filesCount/2);
- }else{
- return vnfNamesFileList.subList(filesCount/2, filesCount);
- }
- }
-
- /**
- * @return
- * The method returns VNF names list from Files directory under sdc-vnfs repository excluding zip files that known as failed in tosca parser
- */
- public static List<String> getVnfNamesFileListExcludeToscaParserFailure() {
- List<String> fileNamesFromFolder = getXnfNamesFileList(XnfTypeEnum.VNF);
- fileNamesFromFolder.removeAll(excludeXnfListForToscaParser);
- return fileNamesFromFolder;
- }
-
-
- public static Object[][] filterObjectArrWithExcludedVnfs(Object[][] objectArr)
- {
- Object[][] filteredArObject = new Object[objectArr.length][];
-
- int index = 0;
-
- for (int i = 0; i < objectArr.length ; i++) {
-
- String vnfSourceFile = (String) objectArr[i][0];
- String vnfUpdateFile = (String) objectArr[i][1];
-
- if(!excludeXnfList.contains(vnfSourceFile) && !excludeXnfList.contains(vnfUpdateFile))
- {
- filteredArObject[index] = new Object[]{vnfSourceFile , vnfUpdateFile };
- index++;
- }
- }
-
- return filteredArObject;
- }
-}
-
- \ No newline at end of file
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/SnmpTypeEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/SnmpTypeEnum.java
deleted file mode 100644
index 366962ef0a..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/SnmpTypeEnum.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.general;
-
-enum SnmpTypeEnum{
- SNMP_POLL ("snmp"),
- SNMP_TRAP ("snmp-trap");
-
- private String value;
-
- public String getValue() {
- return value;
- }
-
- private SnmpTypeEnum(String value) {
- this.value = value;
-}
-
-}
-
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/VendorLicenseModelRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/VendorLicenseModelRestUtils.java
deleted file mode 100644
index 72f8fc1a01..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/VendorLicenseModelRestUtils.java
+++ /dev/null
@@ -1,309 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.general;
-
-import com.aventstack.extentreports.Status;
-import org.json.JSONObject;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.VendorLicenseModel;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-
-import java.util.Arrays;
-import java.util.Map;
-
-import static org.testng.AssertJUnit.assertEquals;
-
-public class VendorLicenseModelRestUtils {
-
- public static void updateVendorLicense(VendorLicenseModel vendorLicenseModel, User user, Boolean isVlmUpdated) throws Exception {
-
-// create major method
- RestResponse creationMethodVendorLicense = creationMethodVendorLicense(vendorLicenseModel, user);
- assertEquals("did not succeed to create method for vendor license", 200, creationMethodVendorLicense.getErrorCode().intValue());
- vendorLicenseModel
- .setVersion(ResponseParser.getValueFromJsonResponse(creationMethodVendorLicense.getResponse(), "id"));
-
- if(isVlmUpdated) {
-// TODO update vlm do nothing
-// commit
- RestResponse commitVendorLicense = commitVendorLicense(vendorLicenseModel, user);
- assertEquals("did not succeed to commit vendor license", 200, commitVendorLicense.getErrorCode().intValue());
- }
-
-// submit
- RestResponse submitVendorLicense = submitVendorLicense(vendorLicenseModel, user);
- assertEquals("did not succeed to submit vendor license", 200, submitVendorLicense.getErrorCode().intValue());
-
- if(ComponentBaseTest.getExtendTest() != null){
- ComponentBaseTest.getExtendTest().log(Status.INFO, "Succeeded in updating the vendor license");
- }
- }
-
- private static RestResponse getVLMComponentByVersion(String vlmId, String vlmVersion, User user) throws Exception{
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_VLM_COMPONENT_BY_VERSION, config.getOnboardingBeHost(),config.getOnboardingBePort(), vlmId,vlmVersion);
- String userId = user.getUserId();
-
- Map<String, String> headersMap = OnboardingUtils.prepareHeadersMap(userId);
-
- HttpRequest http = new HttpRequest();
- RestResponse response = http.httpSendGet(url, headersMap);
- return response;
- }
-
- public static boolean validateVlmExist(String vlmId, String vlmVersion, User user) throws Exception {
- RestResponse restResponse = getVLMComponentByVersion(vlmId, vlmVersion, user);
- assertEquals(String.format("VLM version not updated, reponse code message: %s", restResponse.getResponse()),restResponse.getErrorCode().intValue(),200);
- return (restResponse.getErrorCode()==200);
- }
-
- public static VendorLicenseModel createVendorLicense(User user) throws Exception {
-
- VendorLicenseModel vendorLicenseModel;
-// ComponentBaseTest.getExtendTest().log(Status.INFO, "Starting to create the vendor license");
- String vendorLicenseName = "ciLicense" + OnboardingUtils.getShortUUID();
- RestResponse vendorLicenseResponse = createVendorLicenseModels_1(vendorLicenseName, user);
- assertEquals("did not succeed to create vendor license model", 200, vendorLicenseResponse.getErrorCode().intValue());
- String vendorId = ResponseParser.getValueFromJsonResponse(vendorLicenseResponse.getResponse(), "itemId");
- String versionId = ResponseParser.getValueFromJsonResponse(vendorLicenseResponse.getResponse(), "version:id");
-
- RestResponse vendorKeyGroupsResponse = createVendorKeyGroups_2(vendorId, versionId, user);
- assertEquals("did not succeed to create vendor key groups", 200, vendorKeyGroupsResponse.getErrorCode().intValue());
- String keyGroupId = ResponseParser.getValueFromJsonResponse(vendorKeyGroupsResponse.getResponse(), "value");
-
- RestResponse vendorEntitlementPool = createVendorEntitlementPool_3(vendorId, versionId, user);
- assertEquals("did not succeed to create vendor entitlement pool", 200, vendorEntitlementPool.getErrorCode().intValue());
- String entitlementPoolId = ResponseParser.getValueFromJsonResponse(vendorEntitlementPool.getResponse(), "value");
-
- RestResponse vendorLicenseFeatureGroups = createVendorLicenseFeatureGroups_4(vendorId, versionId, keyGroupId, entitlementPoolId, user);
- assertEquals("did not succeed to create vendor license feature groups", 200, vendorLicenseFeatureGroups.getErrorCode().intValue());
- String featureGroupId = ResponseParser.getValueFromJsonResponse(vendorLicenseFeatureGroups.getResponse(), "value");
-
- RestResponse vendorLicenseAgreement = createVendorLicenseAgreement_5(vendorId, versionId, featureGroupId, user);
- assertEquals("did not succeed to create vendor license agreement", 200, vendorLicenseAgreement.getErrorCode().intValue());
- String vendorLicenseAgreementId = ResponseParser.getValueFromJsonResponse(vendorLicenseAgreement.getResponse(), "value");
-
-// RestResponse checkinVendorLicense = OnboardingUtils.checkinVendorLicense(vendorId, user, versionId);
-// assertEquals("did not succeed to checkin vendor license", 200, checkinVendorLicense.getErrorCode().intValue());
-
- vendorLicenseModel = new VendorLicenseModel(vendorId, vendorLicenseName, vendorLicenseAgreementId, featureGroupId);
- vendorLicenseModel.setVersion(versionId); // Once object created and submitted, his initial version is 1.0
-
- RestResponse submitVendorLicense = submitVendorLicense(vendorLicenseModel, user);
- assertEquals("did not succeed to submit vendor license", 200, submitVendorLicense.getErrorCode().intValue());
-
-// ComponentBaseTest.getExtendTest().log(Status.INFO, "Succeeded in creating the vendor license");
-
- return vendorLicenseModel;
- }
-
- private static RestResponse actionOnComponent(String vspid, String body, String onboardComponent, User user, String componentVersion) throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.ACTION_ON_COMPONENT, config.getOnboardingBeHost(), config.getOnboardingBePort(), onboardComponent, vspid, componentVersion);
- String userId = user.getUserId();
- Map<String, String> headersMap = OnboardingUtils.prepareHeadersMap(userId);
-
- HttpRequest http = new HttpRequest();
- RestResponse response = http.httpSendPut(url, body, headersMap);
- return response;
- }
-
- private static RestResponse createMethodVendorLicense(String vendorId, String body, String onboardComponent, User user, String componentVersion) throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.CREATE_METHOD, config.getOnboardingBeHost(), config.getOnboardingBePort(), onboardComponent, vendorId, componentVersion);
- String userId = user.getUserId();
- Map<String, String> headersMap = OnboardingUtils.prepareHeadersMap(userId);
-
- HttpRequest http = new HttpRequest();
- RestResponse response = http.httpSendPost(url, body, headersMap);
- return response;
- }
-
- public static RestResponse submitVendorLicense(VendorLicenseModel vendorLicenseModel, User user) throws Exception {
- return actionOnComponent(vendorLicenseModel.getVendorId(), "{\"action\":\"Submit\"}", "vendor-license-models", user, vendorLicenseModel
- .getVersion());
- }
-
- /**
- * @param vendorLicenseModel
- * @param user
- * @return
- * checkOut exist VLM method
- * @throws Exception
- */
- public static RestResponse creationMethodVendorLicense(VendorLicenseModel vendorLicenseModel, User user) throws Exception {
- String messageBody = "{\"description\":\"2.0\",\"creationMethod\":\"major\"}";
- return createMethodVendorLicense(vendorLicenseModel.getVendorId(), messageBody, "items", user, vendorLicenseModel
- .getVersion());
- }
-
- public static RestResponse commitVendorLicense(VendorLicenseModel vendorLicenseModel, User user) throws Exception {
- String messageBody = "{\"action\":\"Commit\",\"commitRequest\":{\"message\":\"commit\"}}";
- return actionOnComponent(vendorLicenseModel.getVendorId(), messageBody, "items", user, vendorLicenseModel.getVersion());
- }
-
- public static RestResponse createVendorLicenseModels_1(String name, User user) throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.CREATE_VENDOR_LISENCE_MODELS, config.getOnboardingBeHost(), config.getOnboardingBePort());
- String userId = user.getUserId();
-
- JSONObject jObject = new JSONObject();
- jObject.put("vendorName", name);
- jObject.put("description", "new vendor license model");
- jObject.put("iconRef", "icon");
-
- Map<String, String> headersMap = OnboardingUtils.prepareHeadersMap(userId);
-
- HttpRequest http = new HttpRequest();
- RestResponse response = http.httpSendPost(url, jObject.toString(), headersMap);
- return response;
-
- }
-
- public static RestResponse createVendorLicenseAgreement_5(String vspid, String versionId, String featureGroupId, User user)
- throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.CREATE_VENDOR_LISENCE_AGREEMENT, config.getOnboardingBeHost(), config.getOnboardingBePort(), vspid, versionId);
- String userId = user.getUserId();
-
- JSONObject licenseTermpObject = new JSONObject();
- licenseTermpObject.put("choice", "Fixed_Term");
- licenseTermpObject.put("other", "");
-
- JSONObject jObjectBody = new JSONObject();
- jObjectBody.put("name", "abc");
- jObjectBody.put("description", "new vendor license agreement");
- jObjectBody.put("requirementsAndConstrains", "abc");
- jObjectBody.put("licenseTerm", licenseTermpObject);
- jObjectBody.put("addedFeatureGroupsIds", Arrays.asList(featureGroupId).toArray());
-
- Map<String, String> headersMap = OnboardingUtils.prepareHeadersMap(userId);
-
- HttpRequest http = new HttpRequest();
- RestResponse response = http.httpSendPost(url, jObjectBody.toString(), headersMap);
- return response;
- }
-
- public static RestResponse createVendorLicenseFeatureGroups_4(String vspid, String versionId, String licenseKeyGroupId,
- String entitlementPoolId, User user) throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.CREATE_VENDOR_LISENCE_FEATURE_GROUPS, config.getOnboardingBeHost(), config.getOnboardingBePort(), vspid, versionId);
- String userId = user.getUserId();
-
- JSONObject jObject = new JSONObject();
- jObject.put("name", "xyz");
- jObject.put("description", "new vendor license feature groups");
- jObject.put("partNumber", "123abc456");
-// jObject.put("manufacturerReferenceNumber", "5");
- jObject.put("addedLicenseKeyGroupsIds", Arrays.asList(licenseKeyGroupId).toArray());
- jObject.put("addedEntitlementPoolsIds", Arrays.asList(entitlementPoolId).toArray());
-
- Map<String, String> headersMap = OnboardingUtils.prepareHeadersMap(userId);
-
- HttpRequest http = new HttpRequest();
- RestResponse response = http.httpSendPost(url, jObject.toString(), headersMap);
- return response;
-
- }
-
- public static RestResponse createVendorEntitlementPool_3(String vspid, String versionId, User user) throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.CREATE_VENDOR_LISENCE_ENTITLEMENT_POOL, config.getOnboardingBeHost(), config.getOnboardingBePort(), vspid, versionId);
- String userId = user.getUserId();
-
- JSONObject jEntitlementMetricObject = new JSONObject();
- jEntitlementMetricObject.put("choice", "CPU");
- jEntitlementMetricObject.put("other", "");
-
- JSONObject jAggregationFunctionObject = new JSONObject();
- jAggregationFunctionObject.put("choice", "Peak");
- jAggregationFunctionObject.put("other", "");
-
- JSONObject jOperationalScope = new JSONObject();
- jOperationalScope.put("choices", Arrays.asList("Availability_Zone").toArray());
- jOperationalScope.put("other", "");
-
- JSONObject jTimeObject = new JSONObject();
- jTimeObject.put("choice", "Hour");
- jTimeObject.put("other", "");
-
- JSONObject jObjectBody = new JSONObject();
- jObjectBody.put("name", "def"+ OnboardingUtils.getShortUUID());
- jObjectBody.put("description", "new vendor license entitlement pool");
- jObjectBody.put("type", "Universal");
- jObjectBody.put("thresholdValue", "23");
- jObjectBody.put("thresholdUnits", "Absolute");
- jObjectBody.put("entitlementMetric", jEntitlementMetricObject);
- jObjectBody.put("increments", "abcd");
- jObjectBody.put("aggregationFunction", jAggregationFunctionObject);
- jObjectBody.put("operationalScope", jOperationalScope);
- jObjectBody.put("time", jTimeObject);
- jObjectBody.put("manufacturerReferenceNumber", "123aaa");
-
- Map<String, String> headersMap = OnboardingUtils.prepareHeadersMap(userId);
-
- HttpRequest http = new HttpRequest();
- RestResponse response = http.httpSendPost(url, jObjectBody.toString(), headersMap);
- return response;
- }
-
- public static RestResponse createVendorKeyGroups_2(String vspid, String versionId, User user) throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.CREATE_VENDOR_LISENCE_KEY_GROUPS, config.getOnboardingBeHost(), config.getOnboardingBePort(), vspid, versionId);
- String userId = user.getUserId();
-
- JSONObject jOperationalScope = new JSONObject();
- jOperationalScope.put("choices", Arrays.asList("Tenant").toArray());
- jOperationalScope.put("other", "");
-
- JSONObject jObjectBody = new JSONObject();
- jObjectBody.put("name", "keyGroup" + OnboardingUtils.getShortUUID());
- jObjectBody.put("description", "new vendor license key group");
- jObjectBody.put("operationalScope", jOperationalScope);
- jObjectBody.put("type", "Universal");
-
- Map<String, String> headersMap = OnboardingUtils.prepareHeadersMap(userId);
-
- HttpRequest http = new HttpRequest();
- RestResponse response = http.httpSendPost(url, jObjectBody.toString(), headersMap);
- return response;
- }
-
- public static RestResponse validateUpload(String vspid, User user, String vspVersion) throws Exception {
- String body = null;
- Config config = Utils.getConfig();
- String url = String.format(Urls.VALIDATE_UPLOAD, config.getOnboardingBeHost(), config.getOnboardingBePort(), vspid,vspVersion);
- String userId = user.getUserId();
-
- Map<String, String> headersMap = OnboardingUtils.prepareHeadersMap(userId);
- HttpRequest http = new HttpRequest();
- RestResponse response = http.httpSendPut(url, body, headersMap);
-
- return response;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/VendorSoftwareProductRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/VendorSoftwareProductRestUtils.java
deleted file mode 100644
index 864dd891ac..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/VendorSoftwareProductRestUtils.java
+++ /dev/null
@@ -1,744 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.general;
-
-import com.aventstack.extentreports.Status;
-import com.clearspring.analytics.util.Pair;
-import com.google.gson.Gson;
-import org.apache.commons.io.IOUtils;
-import org.apache.http.HttpEntity;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.entity.mime.MultipartEntityBuilder;
-import org.apache.http.entity.mime.content.FileBody;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClients;
-import org.json.simple.JSONArray;
-import org.json.simple.JSONValue;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.*;
-import org.openecomp.sdc.ci.tests.datatypes.enums.CvfcTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringWriter;
-import java.nio.file.FileSystems;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import static org.testng.AssertJUnit.assertEquals;
-
-public class VendorSoftwareProductRestUtils {
-
- public static VendorSoftwareProductObject createVendorSoftwareProduct(ResourceReqDetails resourceReqDetails, String heatFileName, String filepath, User user, VendorLicenseModel vendorLicenseModel, Map<CvfcTypeEnum, String> cvfcArtifacts)
- throws Exception {
-
- VendorSoftwareProductObject vendorSoftwareProductObject = createVSP(resourceReqDetails, heatFileName, filepath, user,
- vendorLicenseModel);
- if(cvfcArtifacts != null && ! cvfcArtifacts.isEmpty()){
- addCvfcArtifacts(cvfcArtifacts, user, vendorSoftwareProductObject);
- }
- prepareVspForUse(user, vendorSoftwareProductObject, true);
- return vendorSoftwareProductObject;
- }
-
- public static VendorSoftwareProductObject createVendorSoftwareProduct(ResourceReqDetails resourceReqDetails, String heatFileName, String filepath, User user, VendorLicenseModel vendorLicenseModel)
- throws Exception {
-
- Map<CvfcTypeEnum, String> cvfcArtifacts = new HashMap<>();
- return createVendorSoftwareProduct(resourceReqDetails, heatFileName, filepath, user, vendorLicenseModel, cvfcArtifacts);
- }
-
- /**
- * @param user user
- * @param vendorSoftwareProductObject vendorSoftwareProductObject
- * @param isVspUpdated - in case isVspUpdated = false the commit API should not be issued
- * the method do commit, submit and create package
- * @throws Exception
- */
- public static void prepareVspForUse(User user, VendorSoftwareProductObject vendorSoftwareProductObject, Boolean isVspUpdated) throws Exception {
-
- if(isVspUpdated) {
- RestResponse commit = commitVendorSoftwareProduct(vendorSoftwareProductObject, user);
- assertEquals("did not succeed to commit new VSP", 200, commit.getErrorCode().intValue());
- }
- RestResponse submit = submitVendorSoftwareProduct(vendorSoftwareProductObject.getVspId(), user, vendorSoftwareProductObject.getComponentId());
- assertEquals("did not succeed to submit new VSP", 200, submit.getErrorCode().intValue());
-
- RestResponse createPackage = createPackageOfVendorSoftwareProduct(vendorSoftwareProductObject.getVspId(), user, vendorSoftwareProductObject.getComponentId());
- assertEquals("did not succeed to create package of new VSP ", 200, createPackage.getErrorCode().intValue());
-
- }
-
- public static VendorSoftwareProductObject createAndFillVendorSoftwareProduct(ResourceReqDetails resourceReqDetails, String heatFileName, String filePath, User user, VendorLicenseModel vendorLicenseModel, Map<CvfcTypeEnum, String> cvfcArtifacts)
- throws Exception {
-
- VendorSoftwareProductObject createVendorSoftwareProduct = createVendorSoftwareProduct(resourceReqDetails, heatFileName, filePath, user,
- vendorLicenseModel, cvfcArtifacts);
- VendorSoftwareProductObject vendorSoftwareProductObject = fillVendorSoftwareProductObjectWithMetaData(heatFileName, createVendorSoftwareProduct);
- return vendorSoftwareProductObject;
-
- }
-
-
- public static VendorSoftwareProductObject createVSP(ResourceReqDetails resourceReqDetails, String heatFileName, String filepath, User user, VendorLicenseModel vendorLicenseModel) throws Exception {
- String vspName = handleFilename(heatFileName);
-
- if(ComponentBaseTest.getExtendTest() != null){
- ComponentBaseTest.getExtendTest().log(Status.INFO, "Starting to create the vendor software product");
- }
-
- Pair<RestResponse, VendorSoftwareProductObject> createNewVspPair = createNewVendorSoftwareProduct(resourceReqDetails, vspName,
- vendorLicenseModel, user);
- assertEquals("did not succeed to create new VSP", 200,createNewVspPair.left.getErrorCode().intValue());
-
- RestResponse uploadHeatPackage = uploadHeatPackage(filepath, heatFileName, createNewVspPair.right, user);
- assertEquals("did not succeed to upload HEAT package", 200, uploadHeatPackage.getErrorCode().intValue());
-
- RestResponse validateUpload = validateUpload(createNewVspPair.right, user);
- assertEquals("did not succeed to validate upload process, reason: " + validateUpload.getResponse(), 200, validateUpload.getErrorCode().intValue());
-
- return createNewVspPair.right;
- }
-
- public static void updateVspWithVfcArtifacts(String filepath, String updatedSnmpPoll, String updatedSnmpTrap, String componentInstanceId, User user, VendorSoftwareProductObject vendorSoftwareProductObject) throws Exception{
- RestResponse checkout = creationMethodVendorSoftwareProduct(vendorSoftwareProductObject, user);
- assertEquals("did not succeed to checkout new VSP", 200, checkout.getErrorCode().intValue());
-// ExtentTestActions.log(Status.INFO, "Deleting SNMP POLL");
- deleteArtifactByType(componentInstanceId, vendorSoftwareProductObject, user, CvfcTypeEnum.SNMP_POLL);
-// ExtentTestActions.log(Status.INFO, "Deleting SNMP TRAP");
- deleteArtifactByType(componentInstanceId, vendorSoftwareProductObject, user, CvfcTypeEnum.SNMP_TRAP);
- addVFCArtifacts(filepath, updatedSnmpPoll, updatedSnmpTrap, vendorSoftwareProductObject, user, componentInstanceId);
- prepareVspForUse(user, vendorSoftwareProductObject, true);
- }
-
- private static RestResponse deleteArtifactByType(String componentInstanceId, VendorSoftwareProductObject vendorSoftwareProductObject, User user, CvfcTypeEnum snmpType) throws Exception
- {
- Config config = Utils.getConfig();
- String url = String.format(Urls.DELETE_AMDOCS_ARTIFACT_BY_TYPE, config.getOnboardingBeHost(), config.getOnboardingBePort(), vendorSoftwareProductObject.getVspId(), vendorSoftwareProductObject.getComponentId(), componentInstanceId, snmpType.getValue());
- String userId = user.getUserId();
- Map<String, String> headersMap = OnboardingUtils.prepareHeadersMap(userId);
-
- HttpRequest http = new HttpRequest();
- RestResponse response = http.httpSendDelete(url, headersMap);
- return response;
- }
-
- public static void updateVendorSoftwareProductToNextVersion(VendorSoftwareProductObject vendorSoftwareProductObject, User user, Boolean isVspUpdated) throws Throwable {
-
- RestResponse createMethod = creationMethodVendorSoftwareProduct(vendorSoftwareProductObject, user);
- assertEquals("did not succeed to createMethod for new VSP", 200, createMethod.getErrorCode().intValue());
- prepareVspForUse(user,vendorSoftwareProductObject, isVspUpdated);
-
- }
-
- public static String handleFilename(String heatFileName) {
- final String namePrefix = String.format("%sVF%s", ElementFactory.getResourcePrefix(), "Onboarded-");
- final String nameSuffix = "-" + OnboardingUtils.getShortUUID();
-
- String subHeatFileName = heatFileName.substring(0, heatFileName.lastIndexOf("."));
-
- if ((namePrefix + subHeatFileName + nameSuffix).length() >= 50) {
- subHeatFileName = subHeatFileName.substring(0, 50 - namePrefix.length() - nameSuffix.length());
- }
-
- if (subHeatFileName.contains("(") || subHeatFileName.contains(")")) {
- subHeatFileName = subHeatFileName.replace("(", "-");
- subHeatFileName = subHeatFileName.replace(")", "-");
- }
-
- String vnfName = namePrefix + subHeatFileName + nameSuffix;
- return vnfName;
- }
-
- public static String addVFCArtifacts(String filepath, String snmpPoll, String snmpTrap, VendorSoftwareProductObject vendorSoftwareProductObject, User user, String componentInstanceId) throws Exception{
- componentInstanceId = (componentInstanceId == null) ? getVspComponentId(vendorSoftwareProductObject, user) : componentInstanceId;
- if (componentInstanceId != null){
- if (snmpPoll != null){
-// ExtentTestActions.log(Status.INFO, "Adding VFC artifact of type SNMP POLL with the file " + snmpPoll);
- RestResponse uploadSnmpPollArtifact = uploadSnmpPollArtifact(filepath, snmpPoll, vendorSoftwareProductObject, user, componentInstanceId);
- assertEquals("Did not succeed to add SNMP POLL", 200, uploadSnmpPollArtifact.getErrorCode().intValue());
- }
- if (snmpTrap != null){
-// ExtentTestActions.log(Status.INFO, "Adding VFC artifact of type SNMP TRAP with the file " + snmpTrap);
- RestResponse uploadSnmpTrapArtifact = uploadSnmpTrapArtifact(filepath, snmpTrap, vendorSoftwareProductObject, user, componentInstanceId);
- assertEquals("Did not succeed to add SNMP TRAP", 200, uploadSnmpTrapArtifact.getErrorCode().intValue());
- }
- }
-
- return componentInstanceId;
- }
-
- public static String addCvfcArtifacts(Map<CvfcTypeEnum, String> componentVfcArtifacts, User user, VendorSoftwareProductObject vendorSoftwareProductObject) throws Exception{
- String componentInstanceId = getVspComponentId(vendorSoftwareProductObject, user);
- if (componentInstanceId != null){
- for(Map.Entry<CvfcTypeEnum, String> entry : componentVfcArtifacts.entrySet()){
-// ExtentTestActions.log(Status.INFO, "Adding VFC artifact of type " + entry.getKey().getValue() + " with the file " + entry.getValue());
- RestResponse uploadSnmpPollArtifact = uploadCvfcArtifact(entry.getValue(), entry.getKey().getValue(), user, vendorSoftwareProductObject, componentInstanceId);
- assertEquals("Did not succeed to add " + entry.getKey().getValue(), BaseRestUtils.STATUS_CODE_SUCCESS, uploadSnmpPollArtifact.getErrorCode().intValue());
- }
- }
- return componentInstanceId;
- }
-
- public static String addVFCArtifacts(String filepath, String snmpPoll, String snmpTrap, VendorSoftwareProductObject vendorSoftwareProductObject, User user) throws Exception{
- return addVFCArtifacts(filepath, snmpPoll, snmpTrap, vendorSoftwareProductObject, user, null);
- }
-
- public static RestResponse uploadCvfcArtifact(String filepath, String cvfcType, User user, VendorSoftwareProductObject vendorSoftwareProductObject, String componentInstanceId) throws IOException {
- Config config = Utils.getConfig();
- String snmpPollUrl = String.format(Urls.UPLOAD_AMDOCS_ARTIFACT, config.getOnboardingBeHost(),config.getOnboardingBePort(), vendorSoftwareProductObject.getVspId(), vendorSoftwareProductObject.getComponentId(), componentInstanceId, cvfcType);
- return uploadFile(filepath, null, snmpPollUrl, user);
- }
-
-
- private static RestResponse uploadSnmpPollArtifact(String filepath, String zipArtifact, VendorSoftwareProductObject vendorSoftwareProductObject, User user, String componentInstanceId) throws IOException {
- Config config = Utils.getConfig();
- String snmpPollUrl = String.format(Urls.UPLOAD_SNMP_POLL_ARTIFACT, config.getOnboardingBeHost(),config.getOnboardingBePort(), vendorSoftwareProductObject.getVspId(), vendorSoftwareProductObject.getComponentId(), componentInstanceId);
- return uploadFile(filepath, zipArtifact, snmpPollUrl, user);
- }
-
- private static RestResponse uploadSnmpTrapArtifact(String filepath, String zipArtifact, VendorSoftwareProductObject vendorSoftwareProductObject, User user, String vspComponentId) throws IOException {
- Config config = Utils.getConfig();
- String snmpTrapUrl = String.format(Urls.UPLOAD_SNMP_POLL_ARTIFACT, config.getOnboardingBeHost(),config.getOnboardingBePort(), vendorSoftwareProductObject.getVspId(), vendorSoftwareProductObject.getComponentId(), vspComponentId);
- return uploadFile(filepath, zipArtifact, snmpTrapUrl, user);
- }
-
- private static RestResponse deleteSnmpArtifact(String componentId, String vspId, User user, SnmpTypeEnum snmpType) throws Exception
- {
- Config config = Utils.getConfig();
- String url = String.format(Urls.DELETE_AMDOCS_ARTIFACT_BY_TYPE, config.getOnboardingBeHost(),config.getOnboardingBePort(), vspId, componentId, snmpType.getValue());
- String userId = user.getUserId();
-
- Map<String, String> headersMap = OnboardingUtils.prepareHeadersMap(userId);
-
- HttpRequest http = new HttpRequest();
- RestResponse response = http.httpSendDelete(url, headersMap);
- return response;
- }
-
-
- /**
- * @param vendorSoftwareProductObject VendorSoftwareProductObject
- * @param user user object
- * @return return first found component instance Id from list
- * @throws Exception Exception
- */
- private static String getVspComponentId(VendorSoftwareProductObject vendorSoftwareProductObject, User user) throws Exception {
- RestResponse componentList = getVSPComponents(vendorSoftwareProductObject, user);
- String response = componentList.getResponse();
- Map<String, Object> responseMap = (Map<String, Object>) JSONValue.parse(response);
- JSONArray results = (JSONArray)responseMap.get("results");
- for (Object res : results){
- Map<String, Object> componentMap = (Map<String, Object>) JSONValue.parse(res.toString());
- String componentInstanceId = componentMap.get("id").toString();
- return componentInstanceId;
- }
- return null;
- }
-
- private static RestResponse getVSPComponents(VendorSoftwareProductObject vendorSoftwareProductObject, User user) throws Exception{
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_VSP_COMPONENTS, config.getOnboardingBeHost(),config.getOnboardingBePort(), vendorSoftwareProductObject.getVspId(), vendorSoftwareProductObject.getComponentId());
- Map<String, String> headersMap = OnboardingUtils.prepareHeadersMap(user.getUserId());
-
- HttpRequest http = new HttpRequest();
- RestResponse response = http.httpSendGet(url, headersMap);
- return response;
- }
-
-
-
- public static boolean validateVspExist(VendorSoftwareProductObject vendorSoftwareProductObject, User user) throws Exception {
- RestResponse restResponse = getVSPComponentByVersion(vendorSoftwareProductObject, user);
- assertEquals(String.format("Vsp version not updated, reponse message: %s", restResponse.getResponse()),restResponse.getErrorCode().intValue(),200);
- return (restResponse.getErrorCode()==200);
- }
-
-
- private static RestResponse getVSPComponentByVersion(VendorSoftwareProductObject vendorSoftwareProductObject, User user) throws Exception{
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_VSP_COMPONENT_BY_VERSION, config.getOnboardingBeHost(),config.getOnboardingBePort(), vendorSoftwareProductObject.getVspId(), vendorSoftwareProductObject.getComponentId());
- String userId = user.getUserId();
-
- Map<String, String> headersMap = OnboardingUtils.prepareHeadersMap(userId);
-
- HttpRequest http = new HttpRequest();
- RestResponse response = http.httpSendGet(url, headersMap);
- return response;
- }
-
- private static RestResponse actionOnComponent(String vspid, String body, String onboardComponent, User user, String componentVersion) throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.ACTION_ON_COMPONENT, config.getOnboardingBeHost(), config.getOnboardingBePort(), onboardComponent, vspid, componentVersion);
- String userId = user.getUserId();
- Map<String, String> headersMap = OnboardingUtils.prepareHeadersMap(userId);
-
- HttpRequest http = new HttpRequest();
- RestResponse response = http.httpSendPut(url, body, headersMap);
- return response;
- }
-
-// TODO to check if for onboard API ACTION_ARCHIVE_RESTORE_COMPONENT format was added version parameter
-// if yes remove this method and use general actionOnComponent method
- private static RestResponse actionOnComponent(String vspid, String body, String onboardComponent, User user) throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.ACTION_ARCHIVE_RESTORE_COMPONENT, config.getCatalogBeHost(), config.getCatalogBePort(), onboardComponent, vspid);
- String userId = user.getUserId();
- Map<String, String> headersMap = OnboardingUtils.prepareHeadersMap(userId);
-
- HttpRequest http = new HttpRequest();
- RestResponse response = http.httpSendPut(url, body, headersMap);
- return response;
- }
-
- public static Pair<RestResponse, VendorSoftwareProductObject> createNewVendorSoftwareProduct(ResourceReqDetails resourceReqDetails, String vspName, VendorLicenseModel vendorLicenseModel, User user) throws Exception {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.CREATE_VENDOR_SOFTWARE_PRODUCT, config.getOnboardingBeHost(), config.getOnboardingBePort());
- String userId = user.getUserId();
- VendorSoftwareProductObject vendorSoftwareProductObject = new VendorSoftwareProductObject();
- LicensingData licensingData = new LicensingData(
- vendorLicenseModel.getVendorLicenseAgreementId(), Arrays.asList(vendorLicenseModel.getFeatureGroupId()));
- ResourceCategoryEnum resourceCategoryEnum = ResourceCategoryEnum.findEnumNameByValues(resourceReqDetails.getCategories().get(0).getName(), resourceReqDetails.getCategories().get(0).getSubcategories().get(0).getName());
-
- vendorSoftwareProductObject.setName(vspName);
- vendorSoftwareProductObject.setDescription(resourceReqDetails.getDescription());
- vendorSoftwareProductObject.setCategory(resourceCategoryEnum.getCategoryUniqeId());
- vendorSoftwareProductObject.setSubCategory(resourceCategoryEnum.getSubCategoryUniqeId());
- vendorSoftwareProductObject.setOnboardingMethod("NetworkPackage");
- vendorSoftwareProductObject.setVendorName(vendorLicenseModel.getVendorLicenseName());
- vendorSoftwareProductObject.setVendorId(vendorLicenseModel.getVendorId());
- vendorSoftwareProductObject.setIcon("icon");
- vendorSoftwareProductObject.setLicensingData(licensingData);
- vendorSoftwareProductObject.setLicensingVersion(vendorLicenseModel.getVersion());
-
- Map<String, String> headersMap = OnboardingUtils.prepareHeadersMap(userId);
- HttpRequest http = new HttpRequest();
- Gson gson = new Gson();
- String body = gson.toJson(vendorSoftwareProductObject);
-
- RestResponse response = http.httpSendPost(url, body, headersMap);
-
- vendorSoftwareProductObject.setVspId(ResponseParser.getValueFromJsonResponse(response.getResponse(), "itemId"));
- vendorSoftwareProductObject.setComponentId(ResponseParser.getValueFromJsonResponse(response.getResponse(), "version:id"));
-// vendorSoftwareProductObject.setVersion(ResponseParser.getValueFromJsonResponse(response.getResponse(), "version:name"));
- vendorSoftwareProductObject.setAttContact(user.getUserId());
-
- return new Pair<>(response, vendorSoftwareProductObject);
- }
-
- public static RestResponse validateUpload(VendorSoftwareProductObject vendorSoftwareProductObject, User user) throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.VALIDATE_UPLOAD, config.getOnboardingBeHost(), config.getOnboardingBePort(), vendorSoftwareProductObject.getVspId(), vendorSoftwareProductObject.getComponentId());
- String userId = user.getUserId();
-
- Map<String, String> headersMap = OnboardingUtils.prepareHeadersMap(userId);
- HttpRequest http = new HttpRequest();
- RestResponse response = http.httpSendPut(url, null, headersMap);
-
- return response;
- }
-
- public static RestResponse uploadHeatPackage(String filepath, String filename, VendorSoftwareProductObject vendorSoftwareProductObject, User user) throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.UPLOAD_HEAT_PACKAGE, config.getOnboardingBeHost(), config.getOnboardingBePort(), vendorSoftwareProductObject.getVspId(), vendorSoftwareProductObject.getComponentId());
- return uploadFile(filepath, filename, url, user);
- }
-
- private static RestResponse uploadFile(String filepath, String filename, String url, User user) throws IOException{
- CloseableHttpResponse response = null;
-
- MultipartEntityBuilder mpBuilder = MultipartEntityBuilder.create();
- mpBuilder.addPart("upload", new FileBody(getTestZipFile(filepath, filename)));
-
- Map<String, String> headersMap = OnboardingUtils.prepareHeadersMap(user.getUserId());
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "multipart/form-data");
-
- CloseableHttpClient client = HttpClients.createDefault();
- try {
- HttpPost httpPost = new HttpPost(url);
- RestResponse restResponse = new RestResponse();
-
- Iterator<String> iterator = headersMap.keySet().iterator();
- while (iterator.hasNext()) {
- String key = iterator.next();
- String value = headersMap.get(key);
- httpPost.addHeader(key, value);
- }
- httpPost.setEntity(mpBuilder.build());
- response = client.execute(httpPost);
- HttpEntity entity = response.getEntity();
- String responseBody = null;
- if (entity != null) {
- InputStream instream = entity.getContent();
- try {
- StringWriter writer = new StringWriter();
- IOUtils.copy(instream, writer);
- responseBody = writer.toString();
- } finally {
- instream.close();
- }
- }
-
- restResponse.setErrorCode(response.getStatusLine().getStatusCode());
- restResponse.setResponse(responseBody);
-
- return restResponse;
-
- } finally {
- closeResponse(response);
- closeHttpClient(client);
-
- }
- }
-
- private static void closeResponse(CloseableHttpResponse response) {
- try {
- if (response != null) {
- response.close();
- }
- } catch (IOException e) {
- System.out.println(String.format("failed to close client or response: %s", e.getMessage()));
- }
- }
-
- private static void closeHttpClient(CloseableHttpClient client) {
- try {
- if (client != null) {
- client.close();
- }
- } catch (IOException e) {
- System.out.println(String.format("failed to close client or response: %s", e.getMessage()));
- }
- }
-
- private static File getTestZipFile(String filepath, String filename) throws IOException {
- Config config = Utils.getConfig();
- String sourceDir = config.getImportResourceTestsConfigDir();
- java.nio.file.Path filePath;
- if(filename == null){
- filePath = FileSystems.getDefault().getPath(filepath);
- }else{
- filePath = FileSystems.getDefault().getPath(filepath + File.separator + filename);
- }
- return filePath.toFile();
- }
-
- public static RestResponse checkinVendorSoftwareProduct(User user, VendorSoftwareProductObject vendorSoftwareProductObject) throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.UPDATE_VSP, config.getOnboardingBeHost(), config.getOnboardingBePort(), vendorSoftwareProductObject.getVspId(), vendorSoftwareProductObject.getComponentId());
-
- String userId = user.getUserId();
- Map<String, String> headersMap = OnboardingUtils.prepareHeadersMap(userId);
-// unset vspId, componentId, attContact, onboardingMethod
- String vspId = vendorSoftwareProductObject.getVspId();
- String componentId = vendorSoftwareProductObject.getComponentId();
- String attContact = vendorSoftwareProductObject.getAttContact();
- String onboardingMethod = vendorSoftwareProductObject.getOnboardingMethod();
- vendorSoftwareProductObject.setVspId(null);
- vendorSoftwareProductObject.setComponentId(null);
- vendorSoftwareProductObject.setAttContact(null);
- vendorSoftwareProductObject.setOnboardingMethod(null);
- Gson gson = new Gson();
- String body = gson.toJson(vendorSoftwareProductObject);
- HttpRequest http = new HttpRequest();
- RestResponse response = http.httpSendPut(url, body, headersMap);
-// set back vspId, componentId, attContact, onboardingMethod
- vendorSoftwareProductObject.setVspId(vspId);
- vendorSoftwareProductObject.setComponentId(componentId);
- vendorSoftwareProductObject.setAttContact(attContact);
- vendorSoftwareProductObject.setOnboardingMethod(onboardingMethod);
-
- return response;
- }
-
- public static RestResponse commitVendorSoftwareProduct(VendorSoftwareProductObject vendorSoftwareProductObject, User user) throws Exception {
- String messageBody = "{\"action\":\"Commit\",\"commitRequest\":{\"message\":\"commit\"}}";
- return actionOnComponent(vendorSoftwareProductObject.getVspId(), messageBody, "items", user, vendorSoftwareProductObject.getComponentId());
- }
-
- public static RestResponse submitVendorSoftwareProduct(String vspid, User user, String componentId) throws Exception {
- return actionOnComponent(vspid, "{\"action\":\"Submit\"}", "vendor-software-products", user, componentId);
- }
-
- public static RestResponse createPackageOfVendorSoftwareProduct(String vspid, User user, String componentId) throws Exception {
- return actionOnComponent(vspid, "{\"action\":\"Create_Package\"}", "vendor-software-products", user, componentId);
- }
-
- public static RestResponse creationMethodVendorSoftwareProduct(VendorSoftwareProductObject vendorSoftwareProductObject, User user) throws Exception {
- String messageBody = "{\"description\":\"2.0\",\"creationMethod\":\"major\"}";
- return createMethodVendorSoftwareProduct(vendorSoftwareProductObject, messageBody, "items", user);
- }
-
- private static RestResponse createMethodVendorSoftwareProduct(VendorSoftwareProductObject vendorSoftwareProductObject, String body, String onboardComponent, User user) throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.CREATE_METHOD, config.getOnboardingBeHost(), config.getOnboardingBePort(), onboardComponent, vendorSoftwareProductObject.getVspId(), vendorSoftwareProductObject.getComponentId());
- String userId = user.getUserId();
- Map<String, String> headersMap = OnboardingUtils.prepareHeadersMap(userId);
-
- HttpRequest http = new HttpRequest();
- RestResponse response = http.httpSendPost(url, body, headersMap);
- if(response.getErrorCode().intValue() == 200) {
- vendorSoftwareProductObject.setComponentId(ResponseParser.getValueFromJsonResponse(response.getResponse(), "id"));
- }
- return response;
- }
-
- public static VendorSoftwareProductObject updateVSPWithNewVLMParameters(VendorSoftwareProductObject vendorSoftwareProductObject, VendorLicenseModel vendorLicenseModel, User user) throws Exception {
-
- RestResponse createMethod = creationMethodVendorSoftwareProduct(vendorSoftwareProductObject, user);
- assertEquals("did not succeed to checkout new VSP", 200, createMethod.getErrorCode().intValue());
-// vendorSoftwareProductObject.setComponentId(ResponseParser.getValueFromJsonResponse(createMethod.getResponse(), "id"));
-
- String licensingVersion = vendorLicenseModel.getVersion();
- LicensingData licensingData = new LicensingData(
- vendorLicenseModel.getVendorLicenseAgreementId(), Arrays.asList(vendorLicenseModel.getFeatureGroupId()));
- vendorSoftwareProductObject.setVendorId(vendorLicenseModel.getVendorId());
- vendorSoftwareProductObject.setVendorName(vendorLicenseModel.getVendorLicenseName());
- vendorSoftwareProductObject.setLicensingVersion(licensingVersion);
- vendorSoftwareProductObject.setLicensingData(licensingData);
-
- VendorSoftwareProductObjectReqDetails vendorSoftwareProductObjectReqDetails = new VendorSoftwareProductObjectReqDetails(
- vendorSoftwareProductObject.getName(), vendorSoftwareProductObject.getDescription(), vendorSoftwareProductObject.getCategory(),
- vendorSoftwareProductObject.getSubCategory(), vendorSoftwareProductObject.getVendorId(), vendorSoftwareProductObject.getVendorName(),
- vendorSoftwareProductObject.getLicensingVersion(), vendorSoftwareProductObject.getLicensingData(),
- null, null, null, vendorSoftwareProductObject.getIcon() );
-
- Gson gson = new Gson();
- String body = gson.toJson(vendorSoftwareProductObjectReqDetails);
- RestResponse updateResponse = updateVendorSoftwareProduct(vendorSoftwareProductObject, body, user);
- assertEquals("did not succeed to update VSP", 200, updateResponse.getErrorCode().intValue());
-
- prepareVspForUse(user, vendorSoftwareProductObject, true);
-
- return vendorSoftwareProductObject;
- }
-
- public static RestResponse updateVendorSoftwareProduct(VendorSoftwareProductObject vendorSoftwareProductObject, String body, User user) throws Exception {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.UPDATE_VSP, config.getOnboardingBeHost(), config.getOnboardingBePort(), vendorSoftwareProductObject.getVspId(), vendorSoftwareProductObject.getComponentId());
- String userId = user.getUserId();
-
- Map<String, String> headersMap = OnboardingUtils.prepareHeadersMap(userId);
- HttpRequest http = new HttpRequest();
-
- RestResponse response = http.httpSendPut(url, body, headersMap);
- return response;
- }
-
-// private static void importUpdateVSP(Pair<String, Map<String, String>> vsp, boolean isUpdate) throws Exception{
-// String vspName = vsp.left;
-// Map<String, String> vspMetadata = vsp.right;
-// boolean vspFound = HomePage.searchForVSP(vspName);
-//
-// if (vspFound){
-//
-// List<WebElement> elemenetsFromTable = HomePage.getElemenetsFromTable();
-//// WebDriverWait wait = new WebDriverWait(GeneralUIUtils.getDriver(), 30);
-//// WebElement findElement = wait.until(ExpectedConditions.visibilityOf(elemenetsFromTable.get(1)));
-//// findElement.click();
-// elemenetsFromTable.get(1).click();
-// GeneralUIUtils.waitForLoader();
-//
-// if (isUpdate){
-// GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ImportVfRepository.UPDATE_VSP.getValue());
-//
-// }
-// else{
-// GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ImportVfRepository.IMPORT_VSP.getValue());
-// }
-//
-// String lifeCycleState = ResourceGeneralPage.getLifeCycleState();
-// boolean needCheckout = lifeCycleState.equals(LifeCycleStateEnum.CHECKIN.getValue()) || lifeCycleState.equals(LifeCycleStateEnum.CERTIFIED.getValue());
-// if (needCheckout)
-// {
-// try {
-// ResourceGeneralPage.clickCheckoutButton();
-// Assert.assertTrue(ResourceGeneralPage.getLifeCycleState().equals(LifeCycleStateEnum.CHECKOUT.getValue()), "Did not succeed to checkout");
-//
-// } catch (Exception e) {
-// ExtentTestActions.log(Status.ERROR, "Did not succeed to checkout");
-// e.printStackTrace();
-// }
-// GeneralUIUtils.waitForLoader();
-// }
-//
-// //Metadata verification
-// VfVerificator.verifyOnboardedVnfMetadata(vspName, vspMetadata);
-//
-// ExtentTestActions.log(Status.INFO, "Clicking create/update VNF");
-// String duration = GeneralUIUtils.getActionDuration(() -> waitUntilVnfCreated());
-// ExtentTestActions.log(Status.INFO, "Succeeded in importing/updating " + vspName, duration);
-// }
-// else{
-// Assert.fail("Did not find VSP named " + vspName);
-// }
-// }
-
-// private static void waitUntilVnfCreated() {
-// GeneralUIUtils.clickOnElementByTestIdWithoutWait(DataTestIdEnum.GeneralElementsEnum.CREATE_BUTTON.getValue());
-// GeneralUIUtils.waitForLoader(60*10);
-// GeneralUIUtils.waitForAngular();
-// GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.CHECKIN_BUTTON.getValue());
-// }
-//
-// public static void updateVSP(Pair<String, Map<String, String>> vsp) throws Exception{
-// ExtentTestActions.log(Status.INFO, "Updating VSP " + vsp.left);
-// importUpdateVSP(vsp, true);
-// }
-//
-// public static void importVSP(Pair<String, Map<String, String>> vsp) throws Exception{
-// ExtentTestActions.log(Status.INFO, "Importing VSP " + vsp.left);
-// importUpdateVSP(vsp, false);
-// }
-//
-// public static void updateVnfAndValidate(String filepath, Pair<String, Map<String, String>> vsp, String updatedVnfFile, User user) throws Exception, Throwable {
-// ExtentTestActions.log(Status.INFO, String.format("Going to update the VNF with %s......", updatedVnfFile));
-// System.out.println(String.format("Going to update the VNF with %s......", updatedVnfFile));
-//
-// Map<String, String> vspMap = vsp.right;
-// String vspId = vspMap.get("vspId");
-//
-// updateVendorSoftwareProduct(vspId, updatedVnfFile, filepath, user);
-// HomePage.showVspRepository();
-// updateVSP(vsp);
-// ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
-// DeploymentArtifactPage.verifyArtifactsExistInTable(filepath, updatedVnfFile);
-// }
-//
-// public static Pair<String, Map<String, String>> onboardAndValidate(String filepath, String vnfFile, User user) throws Exception {
-// ExtentTestActions.log(Status.INFO, String.format("Going to onboard the VNF %s", vnfFile));
-// System.out.println(String.format("Going to onboard the VNF %s", vnfFile));
-//
-// AmdocsLicenseMembers amdocsLicenseMembers = createVendorLicense(user);
-// Pair<String, Map<String, String>> createVendorSoftwareProduct = createVendorSoftwareProduct(vnfFile, filepath, user, amdocsLicenseMembers);
-// String vspName = createVendorSoftwareProduct.left;
-//
-// DownloadManager.downloadCsarByNameFromVSPRepository(vspName, createVendorSoftwareProduct.right.get("vspId"));
-// File latestFilefromDir = FileHandling.getLastModifiedFileNameFromDir();
-//
-// ExtentTestActions.log(Status.INFO, String.format("Searching for onboarded %s", vnfFile));
-// HomePage.showVspRepository();
-// ExtentTestActions.log(Status.INFO,String.format("Going to import %s", vnfFile.substring(0, vnfFile.indexOf("."))));
-// importVSP(createVendorSoftwareProduct);
-//
-// ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
-//
-// // Verify deployment artifacts
-// Map<String, Object> combinedMap = ArtifactFromCsar.combineHeatArtifacstWithFolderArtifacsToMap(latestFilefromDir.getAbsolutePath());
-//
-// LinkedList<HeatMetaFirstLevelDefinition> deploymentArtifacts = ((LinkedList<HeatMetaFirstLevelDefinition>) combinedMap.get("Deployment"));
-// ArtifactsCorrelationManager.addVNFartifactDetails(vspName, deploymentArtifacts);
-//
-// List<String> heatEnvFilesFromCSAR = deploymentArtifacts.stream().filter(e -> e.getType().equals("HEAT_ENV")).
-// map(e -> e.getFileName()).
-// collect(Collectors.toList());
-//
-// validateDeploymentArtifactsVersion(deploymentArtifacts, heatEnvFilesFromCSAR);
-//
-// DeploymentArtifactPage.verifyArtifactsExistInTable(filepath, vnfFile);
-// return createVendorSoftwareProduct;
-// }
-//
-// public static void validateDeploymentArtifactsVersion(LinkedList<HeatMetaFirstLevelDefinition> deploymentArtifacts,
-// List<String> heatEnvFilesFromCSAR) {
-// String artifactVersion;
-// String artifactName;
-//
-// for(HeatMetaFirstLevelDefinition deploymentArtifact: deploymentArtifacts) {
-// artifactVersion = "1";
-//
-// if(deploymentArtifact.getType().equals("HEAT_ENV")) {
-// continue;
-// } else if(deploymentArtifact.getFileName().contains(".")) {
-// artifactName = deploymentArtifact.getFileName().trim().substring(0, deploymentArtifact.getFileName().lastIndexOf("."));
-// } else {
-// artifactName = deploymentArtifact.getFileName().trim();
-// }
-//
-// if (heatEnvFilesFromCSAR.contains(artifactName + ".env")){
-// artifactVersion = "2";
-// }
-// ArtifactUIUtils.validateArtifactNameVersionType(artifactName, artifactVersion, deploymentArtifact.getType());
-// }
-// }
-
-
- private static VendorSoftwareProductObject fillVendorSoftwareProductObjectWithMetaData(String vnfFile, VendorSoftwareProductObject createVendorSoftwareProduct) {
- VendorSoftwareProductObject vendorSoftwareProductObject = new VendorSoftwareProductObject();
- vendorSoftwareProductObject.setAttContact(createVendorSoftwareProduct.getAttContact());
- vendorSoftwareProductObject.setCategory(createVendorSoftwareProduct.getCategory());
- vendorSoftwareProductObject.setComponentId(createVendorSoftwareProduct.getComponentId());
- vendorSoftwareProductObject.setDescription(createVendorSoftwareProduct.getDescription());
- vendorSoftwareProductObject.setSubCategory(createVendorSoftwareProduct.getSubCategory());
- vendorSoftwareProductObject.setVendorName(createVendorSoftwareProduct.getVendorName());
- vendorSoftwareProductObject.setVspId(createVendorSoftwareProduct.getVspId());
- vendorSoftwareProductObject.setName(createVendorSoftwareProduct.getName());
- String[] arrFileNameAndExtension = vnfFile.split("\\.");
- vendorSoftwareProductObject.setOnboardingMethod("NetworkPackage");
- vendorSoftwareProductObject.setNetworkPackageName(arrFileNameAndExtension[0]);
- vendorSoftwareProductObject.setOnboardingOrigin(arrFileNameAndExtension[1]);
-
- return vendorSoftwareProductObject;
- }
-
- public static void updateVendorSoftwareProductToNextVersion(VendorSoftwareProductObject vendorSoftwareProductObject,
- User user, String filepath,
- String heatFileName) throws Exception {
-
- RestResponse createMethod = creationMethodVendorSoftwareProduct(vendorSoftwareProductObject, user);
- assertEquals("did not succeed to createMethod for new VSP", 200, createMethod.getErrorCode().intValue());
-
- RestResponse uploadHeatPackage = uploadHeatPackage(filepath, heatFileName, vendorSoftwareProductObject, user);
- assertEquals("did not succeed to upload HEAT package", 200, uploadHeatPackage.getErrorCode().intValue());
-
- RestResponse validateUpload = validateUpload(vendorSoftwareProductObject, user);
- assertEquals("did not succeed to validate upload process, reason: " + validateUpload.getResponse(), 200, validateUpload.getErrorCode().intValue());
-
- prepareVspForUse(user,vendorSoftwareProductObject, true);
- }
-
- public static RestResponse archiveVendorSoftwareProduct(VendorSoftwareProductObject vendorSoftwareProductObject, User user) throws Exception {
- String messageBody = "{\"action\":\"ARCHIVE\"}";
- return actionOnComponent(vendorSoftwareProductObject.getVspId(), messageBody, "items", user);
- }
-
- public static RestResponse restoreVendorSoftwareProduct(VendorSoftwareProductObject vendorSoftwareProductObject, User user) throws Exception {
- String messageBody = "{\"action\":\"RESTORE\"}";
- return actionOnComponent(vendorSoftwareProductObject.getVspId(), messageBody, "items", user);
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ArtifactRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ArtifactRestUtils.java
deleted file mode 100644
index 7daf1bd414..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ArtifactRestUtils.java
+++ /dev/null
@@ -1,918 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.rest;
-
-import com.google.gson.Gson;
-import org.apache.commons.codec.binary.Base64;
-import org.json.simple.JSONObject;
-import org.json.simple.JSONValue;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.model.*;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
-import org.openecomp.sdc.common.util.ValidationUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.AssertJUnit;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import static org.testng.AssertJUnit.assertNotNull;
-import static org.testng.AssertJUnit.assertTrue;
-
-public class ArtifactRestUtils extends BaseRestUtils {
- private static Logger logger = LoggerFactory.getLogger(ArtifactRestUtils.class.getName());
-
-
- // External API
- // Delete Artifact on rI of the asset
- public static RestResponse externalAPIDeleteArtifactOfComponentInstanceOnAsset(Component component, User user, ComponentInstance resourceInstance, String artifactUUID) throws IOException {
- Config config = Utils.getConfig();
- String resourceType;
- String resourceUUID = component.getUUID();
- String resourceInstanceName = resourceInstance.getNormalizedName();
-
- System.out.println(component.getComponentType());
-
- if(component.getComponentType().toString().toLowerCase().equals("resource")) {
- resourceType = "resources";
- } else {
- resourceType = "services";
- }
-
- String url = String.format(Urls.DELETE_EXTRNAL_API_DELETE_ARTIFACT_OF_COMPONENTINSTANCE_ON_ASSET, config.getCatalogBeHost(), config.getCatalogBePort(), resourceType, resourceUUID, resourceInstanceName, artifactUUID);
-
- return deleteInformationalArtifact(user, url);
- }
-
- // Delete Artifact of the asset
- public static RestResponse externalAPIDeleteArtifactOfTheAsset(Component component, User user, String artifactUUID) throws IOException {
- Config config = Utils.getConfig();
- String resourceType;
- String resourceUUID = component.getUUID();
-
- System.out.println(component.getComponentType());
-
- if(component.getComponentType().toString().toLowerCase().equals("resource")) {
- resourceType = "resources";
- } else {
- resourceType = "services";
- }
-
- String url = String.format(Urls.DELETE_EXTRNAL_API_DELETE_ARTIFACT_OF_ASSET, config.getCatalogBeHost(), config.getCatalogBePort(), resourceType, resourceUUID, artifactUUID);
-
- RestResponse restResponse = deleteInformationalArtifact(user, url);
-
- return restResponse;
- }
-
-
- // Update Artifact on rI of the asset
- public static RestResponse externalAPIUpdateArtifactOfComponentInstanceOnAsset(Component component, User user, ArtifactReqDetails artifactReqDetails, ComponentInstance resourceInstance, String artifactUUID) throws IOException {
- Config config = Utils.getConfig();
- String resourceType;
- String resourceUUID = component.getUUID();
- String resourceInstanceName = resourceInstance.getNormalizedName();
-
- System.out.println(component.getComponentType());
-
- if(component.getComponentType().toString().toLowerCase().equals("resource")) {
- resourceType = "resources";
- } else {
- resourceType = "services";
- }
-
- String url = String.format(Urls.POST_EXTERNAL_API_UPDATE_ARTIFACT_OF_COMPONENTINSTANCE_ON_ASSET, config.getCatalogBeHost(), config.getCatalogBePort(), resourceType, resourceUUID, resourceInstanceName, artifactUUID);
-
- return updateInformationalArtifact(artifactReqDetails, user, calculateChecksum(artifactReqDetails), url);
- }
-
- // Update Artifact of the asset
- public static RestResponse externalAPIUpdateArtifactOfTheAsset(Component component, User user, ArtifactReqDetails artifactReqDetails, String artifactUUID) throws IOException {
- Config config = Utils.getConfig();
- String resourceType;
- String resourceUUID = component.getUUID();
-
- System.out.println(component.getComponentType());
-
- if(component.getComponentType().toString().toLowerCase().equals("resource")) {
- resourceType = "resources";
- } else {
- resourceType = "services";
- }
-
- String url = String.format(Urls.POST_EXTERNAL_API_UPDATE_ARTIFACT_OF_ASSET, config.getCatalogBeHost(), config.getCatalogBePort(), resourceType, resourceUUID, artifactUUID);
-
- return updateInformationalArtifact(artifactReqDetails, user, calculateChecksum(artifactReqDetails), url);
- }
-
-
- // Upload Artifact on rI of the asset
- public static RestResponse externalAPIUploadArtifactOfComponentInstanceOnAsset(Component component, User user, ArtifactReqDetails artifactReqDetails, ComponentInstance resourceInstance) throws IOException {
- Config config = Utils.getConfig();
- String resourceType;
- String resourceUUID = component.getUUID();
- String resourceInstanceName = resourceInstance.getNormalizedName();
-
- System.out.println(component.getComponentType());
-
- if(component.getComponentType().toString().toLowerCase().equals("resource")) {
- resourceType = "resources";
- } else {
- resourceType = "services";
- }
-
- String url = String.format(Urls.POST_EXTERNAL_API_UPLOAD_ARTIFACT_OF_COMPONENTINSTANCE_ON_ASSET, config.getCatalogBeHost(), config.getCatalogBePort(), resourceType, resourceUUID, resourceInstanceName);
-
- return uploadInformationalArtifact(artifactReqDetails, user, calculateChecksum(artifactReqDetails), url);
- }
-
- // Upload Artifact of the asset
- public static RestResponse externalAPIUploadArtifactOfTheAsset(Component component, User user, ArtifactReqDetails artifactReqDetails) throws IOException {
- Config config = Utils.getConfig();
- String resourceType;
- String resourceUUID = component.getUUID();
-
- System.out.println(component.getComponentType());
-
- if(component.getComponentType().toString().toLowerCase().equals("resource")) {
- resourceType = "resources";
- } else {
- resourceType = "services";
- }
-
- String url = String.format(Urls.POST_EXTERNAL_API_UPLOAD_ARTIFACT_OF_ASSET, config.getCatalogBeHost(), config.getCatalogBePort(), resourceType, resourceUUID);
-
- return uploadInformationalArtifact(artifactReqDetails, user, calculateChecksum(artifactReqDetails), url);
- }
-
-
- // Upload Artifact of the asset with invalid checksum
- public static RestResponse externalAPIUploadArtifactWithInvalidCheckSumOfComponentInstanceOnAsset(Component component, User user, ArtifactReqDetails artifactReqDetails, ComponentInstance resourceInstance) throws IOException {
- Config config = Utils.getConfig();
- String resourceType;
- String resourceUUID = component.getUUID();
- String resourceInstanceName = resourceInstance.getNormalizedName();
-
- System.out.println(component.getComponentType());
-
- if(component.getComponentType().toString().toLowerCase().equals("resource")) {
- resourceType = "resources";
- } else {
- resourceType = "services";
- }
-
- String url = String.format(Urls.POST_EXTERNAL_API_UPLOAD_ARTIFACT_OF_COMPONENTINSTANCE_ON_ASSET, config.getCatalogBeHost(), config.getCatalogBePort(), resourceType, resourceUUID, resourceInstanceName);
-
- return uploadInformationalArtifact(artifactReqDetails, user, calculateChecksum(artifactReqDetails) + "123", url);
- }
-
- // Upload Artifact of the asset with invalid checksum
- public static RestResponse externalAPIUploadArtifactWithInvalidCheckSumOfTheAsset(Component component, User user, ArtifactReqDetails artifactReqDetails) throws IOException {
- Config config = Utils.getConfig();
- String resourceType;
- String resourceUUID = component.getUUID();
-
- System.out.println(component.getComponentType());
-
- if(component.getComponentType().toString().toLowerCase().equals("resource")) {
- resourceType = "resources";
- } else {
- resourceType = "services";
- }
-
- String url = String.format(Urls.POST_EXTERNAL_API_UPLOAD_ARTIFACT_OF_ASSET, config.getCatalogBeHost(), config.getCatalogBePort(), resourceType, resourceUUID);
-
- return uploadInformationalArtifact(artifactReqDetails, user, calculateChecksum(artifactReqDetails) + "123", url);
- }
-
-
- //
- // Testing
- //
- public static RestResponse getResourceDeploymentArtifactExternalAPI(String resourceUUID, String artifactUUID,User sdncModifierDetails, String resourceType) throws IOException {
- Config config = Utils.getConfig();
- String url;
-
- if (resourceType.toUpperCase().equals("SERVICE")) {
- url = String.format(Urls.GET_DOWNLOAD_SERVICE_ARTIFACT_OF_ASSET, config.getCatalogBeHost(), config.getCatalogBePort(), resourceUUID, artifactUUID);
-
- } else {
- url = String.format(Urls.GET_DOWNLOAD_RESOURCE_ARTIFACT_OF_ASSET, config.getCatalogBeHost(), config.getCatalogBePort(), resourceUUID, artifactUUID);
- }
-
- Map<String, String> headersMap = new HashMap<>();
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader);
- headersMap.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), BaseRestUtils.xEcompInstanceId);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(),acceptMultipartHeader);
-
- HttpRequest http = new HttpRequest();
-
- logger.debug("Send GET request to get Resource Assets: {}", url);
- System.out.println("Send GET request to get Resource Assets: " + url);
-
- logger.debug("Request headers: {}", headersMap);
- System.out.println("Request headers: " + headersMap);
-
- RestResponse sendGetResourceAssets = http.httpSendGet(url, headersMap);
-
- return sendGetResourceAssets;
-
- }
-
-
-
- public static RestResponse getComponentInstanceDeploymentArtifactExternalAPI(String resourceUUID, String componentNormalizedName, String artifactUUID,User sdncModifierDetails, String resourceType) throws IOException {
- Config config = Utils.getConfig();
- String url;
-
- if (resourceType.toLowerCase().equals("service")) {
- url = String.format(Urls.GET_DOWNLOAD_SERVICE_ARTIFACT_OF_COMPONENT_INSTANCE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceUUID, componentNormalizedName, artifactUUID);
-
- } else {
- url = String.format(Urls.GET_DOWNLOAD_RESOURCE_ARTIFACT_OF_COMPONENT_INSTANCE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceUUID, componentNormalizedName, artifactUUID);
- }
-
- Map<String, String> headersMap = new HashMap<>();
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader);
- headersMap.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), BaseRestUtils.xEcompInstanceId);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(),acceptMultipartHeader);
-
- HttpRequest http = new HttpRequest();
-
- logger.debug("Send GET request to get Resource Assets: {}", url);
- System.out.println("Send GET request to get Resource Assets: " + url);
-
- logger.debug("Request headers: {}", headersMap);
- System.out.println("Request headers: " + headersMap);
-
- RestResponse sendGetResourceAssets = http.httpSendGet(url, headersMap);
-
- return sendGetResourceAssets;
-
- }
-
-
- //*********** SERVICE ****************
- public static RestResponse getArtifactTypesList() throws IOException {
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_ALL_ARTIFACTS, config.getCatalogBeHost(), config.getCatalogBePort());
-
- return sendGet(url, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER).getUserId());
- }
-
- public static RestResponse addInformationalArtifactToService(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String serviceUid) throws IOException {
- return addInformationalArtifactToService(artifactDetails, sdncModifierDetails, serviceUid, calculateChecksum(artifactDetails));
- }
-
- public static RestResponse addInformationalArtifactToService(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String serviceUid, String checksum) throws IOException {
- Config config = Utils.getConfig();
- String url = String.format(Urls.ADD_ARTIFACT_TO_SERVICE, config.getCatalogBeHost(), config.getCatalogBePort(), serviceUid);
-
- return uploadInformationalArtifact(artifactDetails, sdncModifierDetails, checksum, url);
- }
-
- public static RestResponse downloadServiceArtifact(ServiceReqDetails service, ArtifactReqDetails artifact, User user, Map<String, String> addionalHeaders) throws Exception
- {
-
- return downloadServiceArtifact( service, artifact, user,addionalHeaders,true);
- }
-
- public static RestResponse downloadServiceArtifact(ServiceReqDetails service, ArtifactReqDetails artifact, User user, Map<String, String> addionalHeaders,boolean addEcompHeader) throws Exception
- {
- Config config = Utils.getConfig();
- String relativeUrl = encodeUrlForDownload(String.format(Urls.DISTRIB_DOWNLOAD_SERVICE_ARTIFACT_RELATIVE_URL, ValidationUtils.convertToSystemName(service.getName()), service.getVersion(), ValidationUtils.normalizeFileName(artifact.getArtifactName())));
- String fullUrl = String.format(Urls.DOWNLOAD_SERVICE_ARTIFACT_FULL_URL, config.getCatalogBeHost(),config.getCatalogBePort(), relativeUrl);
-
- return downloadArtifact(fullUrl, user, addionalHeaders,addEcompHeader);
- }
-
- public static RestResponse downloadResourceArtifact(ServiceReqDetails service, ResourceReqDetails resource, ArtifactReqDetails artifact, User user, Map<String, String> addionalHeaders) throws Exception
- {
- return downloadResourceArtifact(service, resource, artifact, user,addionalHeaders, true);
- }
-
- public static RestResponse downloadResourceArtifact(ServiceReqDetails service,ResourceReqDetails resource, ArtifactReqDetails artifact, User user, Map<String, String> addionalHeaders,boolean addEcompHeader) throws Exception
- {
- Config config = Utils.getConfig();
- String relativeUrl = encodeUrlForDownload(String.format(Urls.DISTRIB_DOWNLOAD_RESOURCE_ARTIFACT_RELATIVE_URL, ValidationUtils.convertToSystemName(service.getName()),service.getVersion(),ValidationUtils.convertToSystemName(resource.getName()), resource.getVersion(), ValidationUtils.normalizeFileName(artifact.getArtifactName())));
- String fullUrl = String.format(Urls.DOWNLOAD_RESOURCE_ARTIFACT_FULL_URL, config.getCatalogBeHost(),config.getCatalogBePort(), relativeUrl);
-
- return downloadArtifact(fullUrl, user, addionalHeaders,addEcompHeader);
- }
-
-
-
- public static RestResponse downloadResourceInstanceArtifact(String serviceUniqueId,String resourceInstanceId, User user, String artifactUniqueId) throws Exception
- {
- Config config = Utils.getConfig();
- String url = String.format(Urls.DOWNLOAD_COMPONENT_INSTANCE_ARTIFACT, config.getCatalogBeHost(),config.getCatalogBePort(), serviceUniqueId, resourceInstanceId, artifactUniqueId);
- RestResponse res = sendGet(url, user.getUserId(), null);
- return res;
- }
-
- ////
-
- //update
-
- public static RestResponse updateInformationalArtifactOfServiceByMethod(ArtifactReqDetails artifactReqDetails, String serviceUid, String artifactUid, User sdncModifierDetails, String httpMethod) throws IOException {
- return updateInformationalArtifactOfServiceByMethod(artifactReqDetails, serviceUid, artifactUid, sdncModifierDetails, httpMethod, calculateChecksum(artifactReqDetails));
- }
-
- public static RestResponse updateInformationalArtifactOfServiceByMethod(ArtifactReqDetails artifactReqDetails, String serviceUid, User sdncModifierDetails, String httpMethod) throws IOException {
- return updateInformationalArtifactOfServiceByMethod(artifactReqDetails, serviceUid, artifactReqDetails.getUniqueId(), sdncModifierDetails, httpMethod, calculateChecksum(artifactReqDetails));
- }
-
- public static RestResponse downloadResourceArtifactInternalApi(String resourceId, User user, String artifactUniqeId) throws Exception
- {
- return downloadComponentArtifactInternalApi(resourceId, user, artifactUniqeId, Urls.UI_DOWNLOAD_RESOURCE_ARTIFACT);
- }
-
- public static RestResponse downloadServiceArtifactInternalApi(String componentId, User user, String artifactUniqeId) throws Exception
- {
- return downloadComponentArtifactInternalApi(componentId, user, artifactUniqeId, Urls.UI_DOWNLOAD_SERVICE_ARTIFACT);
- }
- public static RestResponse downloadComponentArtifactInternalApi(String componentId, User user, String artifactUniqeId, String urlTemplate) throws Exception
- {
- Config config = Utils.getConfig();
- String url = String.format(urlTemplate, config.getCatalogBeHost(),config.getCatalogBePort(), componentId, artifactUniqeId);
- RestResponse res = sendGet(url, user.getUserId(), null);
- return res;
- }
-
-// public static RestResponse downloadServiceArtifactInternalApi(String resourceId, User user, String artifactUniqeId) throws Exception
-// {
-// Config config = Utils.getConfig();
-// String url = String.format(Urls.UI_DOWNLOAD_SERVICE_ARTIFACT, config.getCatalogBeHost(),config.getCatalogBePort(), resourceId, artifactUniqeId);
-// RestResponse res = sendGet(url, user.getUserId(), null);
-// return res;
-// }
-
- /*
- public static RestResponse updateInformationalArtifactPayloadOfService(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String serviceUid, String artifactUid, String checksum) throws IOException
- {
- return updateInformationalArtifactOfService(artifactDetails, sdncModifierDetails, serviceUid, artifactUid, checksum, true);
- }
-
- public static RestResponse updateInformationalArtifactMetadataOfService(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String serviceUid, String artifactUid) throws IOException
- {
- return updateInformationalArtifactOfService(artifactDetails, sdncModifierDetails, serviceUid, artifactUid, calculateChecksum(artifactDetails), false);
- }
-
- public static RestResponse updateInformationalArtifactOfService(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String serviceUid, String artifactUid, String checksum, boolean isPayloadUpdate) throws IOException
- {
- Config config = Utils.getConfig();
- Map<String, String> headersMap = getHeadersMap(sdncModifierDetails);
-
- if (isPayloadUpdate){
- headersMap.put(HttpHeaderEnum.Content_MD5.getValue(), checksum);
- }
-
- Gson gson = new Gson();
- String jsonBody = gson.toJson(artifactDetails);
-
- HttpRequest http = new HttpRequest();
-
- String url = String.format(Urls.UPDATE_OR_DELETE_ARTIFACT_OF_SERVICE, config.getCatalogBeHost(),config.getCatalogBePort(), serviceUid, artifactUid);
- RestResponse res = http.httpSendPost(url, jsonBody, headersMap);
- System.out.println("update artifact was finished with response: "+ res.getErrorCode());
- return res;
- }*/
-
-
-
- public static RestResponse updateInformationalArtifactOfServiceByMethod(ArtifactReqDetails artifactReqDetails, String serviceUid, String artifactUid, User sdncModifierDetails, String httpMethod, String checksum) throws IOException
- {
- Config config = Utils.getConfig();
-
- Map<String, String> headersMap = getHeadersMap(sdncModifierDetails);
- headersMap.put(HttpHeaderEnum.Content_MD5.getValue(), checksum);
-
- Gson gson = new Gson();
- String userBodyJson = gson.toJson(artifactReqDetails);
-
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.UPDATE_OR_DELETE_ARTIFACT_OF_SERVICE, config.getCatalogBeHost(),config.getCatalogBePort(), serviceUid, artifactUid);
- RestResponse updateResourceResponse = http.httpSendByMethod(url, httpMethod, userBodyJson, headersMap);
-// System.out.println("update artifact was finished with response: "+ updateResourceResponse.getErrorCode());
-
- return updateResourceResponse;
- }
-
-
- public static Map<String, String> getHeadersMap(User sdncModifierDetails) {
- Map<String, String> headersMap = new HashMap<>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptJsonHeader);
-
- try{
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
- }
- catch(Exception e)
- {
-
- }
-
- return headersMap;
- }
-
- //*********** RESOURCE ****************
- //add
- public static RestResponse addInformationalArtifactToResource(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String resourceUid) throws IOException{
- return addInformationalArtifactToResource(artifactDetails, sdncModifierDetails, resourceUid, calculateChecksum(artifactDetails));
- }
-
- public static RestResponse explicitAddInformationalArtifactToResource(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String resourceUid) throws IOException{
- Config config = Utils.getConfig();
-
-
- String url = String.format(Urls.ADD_ARTIFACT_TO_RESOURCE, config.getCatalogBeHost(),config.getCatalogBePort(), resourceUid);
-
- return uploadInformationalArtifact(artifactDetails, sdncModifierDetails, calculateChecksum(artifactDetails), url);
- }
-
-
- public static RestResponse addInformationalArtifactToResource(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String resourceUid, String checksum) throws IOException{
- Config config = Utils.getConfig();
-
- if (artifactDetails.getArtifactGroupType()!=null && artifactDetails.getArtifactGroupType().equals(ArtifactGroupTypeEnum.DEPLOYMENT.getType())){
- //YANG_XML and OTHER deployment artifact should be added through this API, not updated
- String artifactType = artifactDetails.getArtifactType();
- if (!(ArtifactTypeEnum.YANG_XML.getType().equals(artifactType) ||
- ArtifactTypeEnum.OTHER.getType().equals(artifactType) ||
- ArtifactTypeEnum.VNF_CATALOG.getType().equals(artifactType) ||
- ArtifactTypeEnum.VF_LICENSE.getType().equals(artifactType) ||
- ArtifactTypeEnum.VENDOR_LICENSE.getType().equals(artifactType) ||
- ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType().equals(artifactType) ||
- ArtifactTypeEnum.MODEL_QUERY_SPEC.getType().equals(artifactType) ||
- ArtifactTypeEnum.APPC_CONFIG.getType().equals(artifactType))){
- //return updateInformationalArtifactToResource(artifactDetails, sdncModifierDetails, resourceUid);
- }
- }
- String url = String.format(Urls.ADD_ARTIFACT_TO_RESOURCE, config.getCatalogBeHost(),config.getCatalogBePort(), resourceUid);
-
- return uploadInformationalArtifact(artifactDetails, sdncModifierDetails, checksum, url);
- }
- //update
- public static RestResponse updateInformationalArtifactToResource(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String resourceUid) throws IOException{
- return updateInformationalArtifactToResource(artifactDetails, sdncModifierDetails, resourceUid, calculateChecksum(artifactDetails));
- }
-
- public static RestResponse updateInformationalArtifactToResource(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String resourceUid, String checksum) throws IOException {
- Config config = Utils.getConfig();
- if (artifactDetails.getArtifactGroupType()!=null && artifactDetails.getArtifactGroupType().equals("DEPLOYMENT")){
- RestResponse resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails, resourceUid );
- Resource resourceRespJavaObject = ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
- Map<String, ArtifactDefinition> deploymentArtifacts = resourceRespJavaObject.getDeploymentArtifacts();
- ArtifactDefinition artifactDefinition = deploymentArtifacts.get(artifactDetails.getArtifactLabel());
- artifactDetails.setUniqueId(artifactDefinition.getUniqueId());
- artifactDetails.setArtifactLabel(artifactDefinition.getArtifactLabel());
-
- }
-
- String url = String.format(Urls.UPDATE_OR_DELETE_ARTIFACT_OF_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceUid, artifactDetails.getUniqueId());
-
- return uploadInformationalArtifact(artifactDetails, sdncModifierDetails, calculateChecksum(artifactDetails), url);
- }
-
- public static RestResponse uploadArtifactToPlaceholderOnResource(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String resourceUid, String placeHolderLabel) throws IOException {
- Config config = Utils.getConfig();
- if (artifactDetails.getArtifactLabel() != null && !artifactDetails.getArtifactLabel().isEmpty()){
- RestResponse resourceGetResponse = ResourceRestUtils.getResource(sdncModifierDetails, resourceUid );
- Resource resourceRespJavaObject = ResponseParser.convertResourceResponseToJavaObject(resourceGetResponse.getResponse());
- Map<String, ArtifactDefinition> deploymentArtifacts = resourceRespJavaObject.getDeploymentArtifacts();
- ArtifactDefinition artifactDefinition = deploymentArtifacts.get(artifactDetails.getArtifactLabel());
- AssertJUnit.assertNotNull(artifactDefinition);
- artifactDetails.setUniqueId(artifactDefinition.getUniqueId());
- artifactDetails.setArtifactLabel(artifactDefinition.getArtifactLabel());
-
- }
-
- String url = String.format(Urls.UPDATE_OR_DELETE_ARTIFACT_OF_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceUid, artifactDetails.getUniqueId());
-
- return uploadInformationalArtifact(artifactDetails, sdncModifierDetails, calculateChecksum(artifactDetails), url);
- }
-
- public static RestResponse updateArtifactToResourceInstance(ArtifactDefinition artifactDefinition, User sdncModifierDetails, String resourceInstanceId, String serviceId) throws IOException {
- Config config = Utils.getConfig();
- String url = String.format(Urls.UPDATE_RESOURCE_INSTANCE_ARTIFACT, config.getCatalogBeHost(), config.getCatalogBePort(), serviceId, resourceInstanceId, artifactDefinition.getUniqueId());
- return updateDeploymentArtifact(artifactDefinition, sdncModifierDetails, url);
- }
-
- public static RestResponse updateDeploymentArtifactToResource(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String resourceUid) throws IOException {
- Config config = Utils.getConfig();
- String url = String.format(Urls.UPDATE_OR_DELETE_ARTIFACT_OF_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceUid, artifactDetails.getUniqueId());
-
- return updateDeploymentArtifact(artifactDetails, sdncModifierDetails, url);
- }
-
-
- public static RestResponse updateDeploymentArtifactToRI(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String resourceInstanceId, String serviceId) throws IOException {
- Config config = Utils.getConfig();
- String url = String.format(Urls.UPDATE_RESOURCE_INSTANCE_HEAT_ENV_PARAMS, config.getCatalogBeHost(), config.getCatalogBePort(), serviceId, resourceInstanceId, artifactDetails.getUniqueId());
- return updateDeploymentArtifact(artifactDetails, sdncModifierDetails, url);
- }
-
- //delete
- public static RestResponse deleteArtifactFromResourceInstance (ArtifactDefinition artifactDefinition, User sdncModifierDetails, String resourceUid, String serviceId) throws IOException{
- Config config = Utils.getConfig();
- String url = String.format(Urls.DELETE_RESOURCE_INSTANCE_ARTIFACT, config.getCatalogBeHost(), config.getCatalogBePort(), serviceId, resourceUid, artifactDefinition.getUniqueId());
- return sendDelete(url, sdncModifierDetails.getUserId());
- }
-
- public static RestResponse deleteInformationalArtifactFromResource(String resourceUid, ArtifactReqDetails artifactDetails, User sdncModifierDetails) throws IOException{
- return deleteInformationalArtifactFromResource( resourceUid, artifactDetails.getUniqueId(), sdncModifierDetails);
- }
-
- public static RestResponse deleteInformationalArtifactFromResource( String resourceUid, String artifactId, User sdncModifierDetails) throws IOException{
- Config config = Utils.getConfig();
- String url = String.format(Urls.UPDATE_OR_DELETE_ARTIFACT_OF_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceUid, artifactId);
- return sendDelete(url, sdncModifierDetails.getUserId());
- }
-
- public static RestResponse deleteServiceApiArtifact(ArtifactReqDetails artifactDetails, String serviceUniqueId, User user) throws Exception
- {
- Config config = Utils.getConfig();
- String url = String.format(Urls.UPDATE_DELETE_SERVICE_API_ARTIFACT, config.getCatalogBeHost(),config.getCatalogBePort(), serviceUniqueId, artifactDetails.getUniqueId());
- RestResponse res = sendDelete(url, user.getUserId());
- logger.debug("Deleting api artifact was finished with response: {}", res.getErrorCode());
- logger.debug("Response body: {}", res.getResponseMessage());
- return res;
- }
-
- //*************** RESOURCE INSTANCE **************
- /**
- * Add DCAE artifacts to resource instance.
- * @param artifactDetails
- * @param sdncModifierDetails
- * @param resourceInstanceId
- * @param serviceId
- * @return
- * @throws IOException
- */
- public static RestResponse addArtifactToResourceInstance(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String resourceInstanceId, String serviceId) throws IOException {
- Config config = Utils.getConfig();
- String url = String.format(Urls.ADD_RESOURCE_INSTANCE_ARTIFACT, config.getCatalogBeHost(), config.getCatalogBePort(), serviceId,resourceInstanceId, artifactDetails.getUniqueId());
- return addArtifactToInstance(artifactDetails, sdncModifierDetails, calculateChecksum(artifactDetails), url);
- }
-
- //*************** COMPONENT **************
-
- public static RestResponse uploadDeploymentArtifact(ArtifactReqDetails artifactDetails, Component component, User sdncModifierDetails) throws IOException {
- Config config = Utils.getConfig();
- Map<String, String> additionalHeaders;
- String checksum = ResponseParser.calculateMD5Header(artifactDetails);
- additionalHeaders = new HashMap<>();
- additionalHeaders.put(HttpHeaderEnum.Content_MD5.getValue(), checksum);
-
- ComponentTypeEnum componentType = component.getComponentType();
-
- String url = null;
-
- switch (componentType){
-
- case RESOURCE:
- {
- url = String.format(Urls.UPDATE_OR_DELETE_ARTIFACT_OF_SERVICE, config.getCatalogBeHost(),config.getCatalogBePort(), component.getUniqueId(), artifactDetails.getUniqueId());
-
- break;
- }
- case SERVICE: {
-
- break;
- }
-
- case PRODUCT: {
-
- break;
- }
-
- default: {//dummy
- assertTrue("failed on enum selection", false);
-
- break;
- }
- }
-
-
-
-
- Gson gson = new Gson();
- String jsonBody = gson.toJson(artifactDetails);
-// System.out.println("ArtifactDetails: "+ jsonBody);
-
- RestResponse res = sendPost(url, jsonBody, sdncModifierDetails.getUserId(), acceptHeaderData, additionalHeaders);
- if (res.getErrorCode() == STATUS_CODE_SUCCESS) {
- artifactDetails.setUniqueId(ResponseParser.getUniqueIdFromResponse(res));
- }
-// System.out.println("Add artifact was finished with response: "+ res.getErrorCode());
- return res;
- }
-
- public static RestResponse uploadArtifact(ArtifactReqDetails artifactDetails, Component component, User sdncModifierDetails) throws IOException {
- Config config = Utils.getConfig();
- List<String> placeHolderlst = Utils.getListOfResPlaceHoldersDepArtTypes();
- Map<String, String> additionalHeaders;
- String checksum;
- String url;
-//
-//
-// if (artifactDetails.getArtifactGroupType() != null
-// && artifactDetails.getArtifactGroupType().equals("DEPLOYMENT")
-// && placeHolderlst.contains(artifactDetails.getArtifactType())) {
-// Map<String, ArtifactDefinition> deploymentArtifacts = component.getDeploymentArtifacts();
-// ArtifactDefinition artifactDefinition = deploymentArtifacts.get(artifactDetails.getArtifactLabel());
-// artifactDetails.setUniqueId(artifactDefinition.getUniqueId());
-// artifactDetails.setArtifactLabel(artifactDefinition.getArtifactLabel());
-// checksum = ResponseParser.calculateMD5Header(artifactDetails);
-// additionalHeaders = new HashMap<String, String>();
-// additionalHeaders.put(HttpHeaderEnum.Content_MD5.getValue(), checksum);
-// url = String.format(Urls.UPDATE_ARTIFACT_OF_COMPONENT, config.getCatalogBeHost(),
-// config.getCatalogBePort(), ComponentTypeEnum.findParamByType(component.getComponentType()),
-// component.getUniqueId(), artifactDetails.getUniqueId());
-// }
-//
-// else {
- checksum = ResponseParser.calculateMD5Header(artifactDetails);
- additionalHeaders = new HashMap<>();
- additionalHeaders.put(HttpHeaderEnum.Content_MD5.getValue(), checksum);
- url = String.format(Urls.UPLOAD_DELETE_ARTIFACT_OF_COMPONENT, config.getCatalogBeHost(),
- config.getCatalogBePort(), ComponentTypeEnum.findParamByType(component.getComponentType()),
- component.getUniqueId(), artifactDetails.getUniqueId());
-// }
-
- Gson gson = new Gson();
- String jsonBody = gson.toJson(artifactDetails);
-// System.out.println("ArtifactDetails: "+ jsonBody);
-
- RestResponse res = sendPost(url, jsonBody, sdncModifierDetails.getUserId(), acceptHeaderData, additionalHeaders);
- if (res.getErrorCode() == STATUS_CODE_SUCCESS) {
- artifactDetails.setUniqueId(ResponseParser.getUniqueIdFromResponse(res));
- }
-// System.out.println("Add artifact was finished with response: "+ res.getErrorCode());
- return res;
- }
-
-
-
-
- //*************** PRIVATE **************
- private static RestResponse deleteInformationalArtifact(User sdncModifierDetails, String url) throws IOException {
- Map<String, String> additionalHeaders;
-
- additionalHeaders = new HashMap<>();
-
-
- additionalHeaders.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader);
- additionalHeaders.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), BaseRestUtils.xEcompInstanceId);
-
- return sendDelete(url, sdncModifierDetails.getUserId(), additionalHeaders);
-
-// Gson gson = new Gson();
-//// System.out.println("ArtifactDetails: "+ jsonBody);
-// String jsonBody = gson.toJson(artifactDetails);
-//
-// RestResponse res = sendPost(url, jsonBody, sdncModifierDetails.getUserId(), acceptHeaderData, additionalHeaders);
-// if ((res.getErrorCode() == STATUS_CODE_SUCCESS) || (res.getErrorCode() == STATUS_CODE_CREATED)) {
-// artifactDetails.setUniqueId(ResponseParser.getUniqueIdFromResponse(res));
-// }
-//// System.out.println("Add artifact was finished with response: "+ res.getErrorCode());
-// return res;
- }
-
- private static RestResponse updateInformationalArtifact(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String checksum, String url) throws IOException {
- return uploadInformationalArtifact(artifactDetails, sdncModifierDetails, checksum, url);
- }
-
- private static RestResponse uploadInformationalArtifact(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String checksum, String url) throws IOException {
- Map<String, String> additionalHeaders = null;
- if (checksum != null && !checksum.isEmpty()) {
- additionalHeaders = new HashMap<>();
- additionalHeaders.put(HttpHeaderEnum.Content_MD5.getValue(), checksum);
- }
-
- additionalHeaders.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader);
- additionalHeaders.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), BaseRestUtils.xEcompInstanceId);
-
- Gson gson = new Gson();
-// System.out.println("ArtifactDetails: "+ jsonBody);
- String jsonBody = gson.toJson(artifactDetails);
-
- RestResponse res = sendPost(url, jsonBody, sdncModifierDetails.getUserId(), acceptHeaderData, additionalHeaders);
- if ((res.getErrorCode() == STATUS_CODE_SUCCESS) || (res.getErrorCode() == STATUS_CODE_CREATED)) {
- artifactDetails.setUniqueId(ResponseParser.getUniqueIdFromResponse(res));
- }
-// System.out.println("Add artifact was finished with response: "+ res.getErrorCode());
- return res;
- }
-
- private static RestResponse addArtifactToInstance(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String checksum, String url) throws IOException {
- Map<String, String> additionalHeaders;
- additionalHeaders = new HashMap<>();
- if (checksum != null && !checksum.isEmpty()) {
- additionalHeaders = new HashMap<>();
- additionalHeaders.put(HttpHeaderEnum.Content_MD5.getValue(), checksum);
- }
- additionalHeaders.put(HttpHeaderEnum.ACCEPT.getValue(), "application/json, text/plain, */*");
- additionalHeaders.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "application/json;charset=UTF-8");
-
- Gson gson = new Gson();
- String jsonBody = gson.toJson(artifactDetails);
-
- RestResponse res = sendPost(url, jsonBody, sdncModifierDetails.getUserId(), "application/json, text/plain, */*", additionalHeaders);
- if (res.getErrorCode() == STATUS_CODE_SUCCESS) {
- artifactDetails.setUniqueId(ResponseParser.getUniqueIdFromResponse(res));
- }
- return res;
- }
-
- private static RestResponse updateDeploymentArtifact(ArtifactDefinition artifactDefinition, User sdncModifierDetails, String url) throws IOException {
- Map<String, String> additionalHeaders;
- additionalHeaders = new HashMap<>();
- additionalHeaders.put(HttpHeaderEnum.ACCEPT.getValue(), "application/json, text/plain, */*");
- additionalHeaders.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "application/json;charset=UTF-8");
-
- Gson gson = new Gson();
- String jsonBody = gson.toJson(artifactDefinition);
-
- RestResponse res = sendPost(url, jsonBody, sdncModifierDetails.getUserId(), "application/json, text/plain, */*", additionalHeaders);
- return res;
- }
-
- private static RestResponse updateDeploymentArtifact(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String url) throws IOException {
- Map<String, String> additionalHeaders;
-
- additionalHeaders = new HashMap<>();
- additionalHeaders.put(HttpHeaderEnum.ACCEPT.getValue(), "application/json, text/plain, */*");
- additionalHeaders.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "application/json;charset=UTF-8");
-// additionalHeaders.put(HttpHeaderEnum..getValue(), "application/json;charset=UTF-8");
-
-
- Gson gson = new Gson();
- String jsonBody = gson.toJson(artifactDetails);
-// System.out.println("ArtifactDetails: "+ jsonBody);
-
- RestResponse res = sendPost(url, jsonBody, sdncModifierDetails.getUserId(), "application/json, text/plain, */*", additionalHeaders);
- if (res.getErrorCode() == STATUS_CODE_SUCCESS) {
- artifactDetails.setUniqueId(ResponseParser.getUniqueIdFromResponse(res));
- }
-// System.out.println("Add artifact was finished with response: "+ res.getErrorCode());
- return res;
- }
-
- private static RestResponse downloadArtifact(String url, User user, Map<String, String> addionalHeaders,boolean addEcompHeader) throws IOException
- {
- if(addEcompHeader){
- addionalHeaders.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), BaseRestUtils.xEcompInstanceId);
- }
- return downloadArtifact(url, user, addionalHeaders, acceptOctetStream);
- }
-
- private static RestResponse downloadArtifact(String url, User user, Map<String, String> addionalHeaders, String accept) throws IOException
- {
- addionalHeaders.put(HttpHeaderEnum.ACCEPT.getValue(), accept);
-
- RestResponse res = sendGet(url, user.getUserId(), addionalHeaders);
-// System.out.println("download artifact was finished with response: "+ res.getErrorCode());
-// System.out.println("response is: " + res.getResponse());
- return res;
- }
-
- private static Map<String,Map<String,Object>> getArtifactsListFromResponse(String jsonResponse, String fieldOfArtifactList){
- JSONObject object = (JSONObject)JSONValue.parse(jsonResponse);
- Map<String,Map<String,Object>> map = (Map<String,Map<String,Object>>)object.get(fieldOfArtifactList);
- return map;
- }
-
- public static String calculateChecksum(ArtifactReqDetails artifactDetails) {
- String checksum = null;
- if (artifactDetails.getPayload() != null) {
- checksum = ResponseParser.calculateMD5Header(artifactDetails);
- }
- return checksum;
- }
-
- public static String encodeUrlForDownload(String url){
-
- return url.replaceAll(" ", "%20");
- }
-
- public static String getPartialUrlByArtifactName(ServiceReqDetails serviceDetails,String serviceVersion ,String artifactName){
- return encodeUrlForDownload(String.format(Urls.DISTRIB_DOWNLOAD_SERVICE_ARTIFACT_RELATIVE_URL, ValidationUtils.convertToSystemName(serviceDetails.getName()), serviceVersion, artifactName));
- }
-
- public static String getUniqueIdOfArtifact(RestResponse createResponse, String artifactField, String requieredArtifactLabel) throws Exception
- {
- Map<String, Object> artifact = getArtifactFromRestResponse(createResponse, artifactField, requieredArtifactLabel);
- assertNotNull(artifact);
- return artifact.get("uniqueId").toString();
- }
-
- public static Map<String, Object> getArtifactFromRestResponse(RestResponse response, String artifactField, String requieredArtifactLabel)
- {
- Map<String, Map<String, Object>> map = getArtifactsListFromResponse(response.getResponse(), artifactField);
- return map.get(requieredArtifactLabel);
- }
-
-
-
- public static RestResponse updateInformationalArtifactPayloadOfService(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String serviceUid, String artifactUid) throws IOException
- {
- return updateInformationalArtifactPayloadOfService(artifactDetails, sdncModifierDetails, serviceUid, artifactUid, calculateMD5Header(artifactDetails));
- }
-
- private static RestResponse updateInformationalArtifactPayloadOfService(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String serviceUid, String artifactUid, String checksum) throws IOException
- {
- return updateInformationalArtifactOfService(artifactDetails, sdncModifierDetails, serviceUid, artifactUid, checksum, true);
- }
-
- private static RestResponse updateInformationalArtifactOfService(ArtifactReqDetails artifactDetails, User sdncModifierDetails, String serviceUid, String artifactUid, String checksum, boolean isPayloadUpdate) throws IOException
- {
- Config config = Utils.getConfig();
- Map<String, String> headersMap = prepareHeadersMap(sdncModifierDetails.getUserId());
-
- if (isPayloadUpdate){
- headersMap.put(HttpHeaderEnum.Content_MD5.getValue(), checksum);
- }
-
- Gson gson = new Gson();
- String jsonBody = gson.toJson(artifactDetails);
-
- HttpRequest http = new HttpRequest();
-
- String url = String.format(Urls.UPDATE_OR_DELETE_ARTIFACT_OF_SERVICE, config.getCatalogBeHost(),config.getCatalogBePort(), serviceUid, artifactUid);
- RestResponse res = http.httpSendPost(url, jsonBody, headersMap);
-// System.out.println("update artifact was finished with response: "+ res.getErrorCode());
- return res;
- }
-
- public static String calculateMD5Header(ArtifactReqDetails artifactDetails)
- {
- Gson gson = new Gson();
- String jsonBody = gson.toJson(artifactDetails);
- // calculate MD5 for json body
- return calculateMD5(jsonBody);
-
- }
-
- public static String calculateMD5 (String data){
- String calculatedMd5 = org.apache.commons.codec.digest.DigestUtils.md5Hex(data);
- // encode base-64 result
- byte[] encodeBase64 = Base64.encodeBase64(calculatedMd5.getBytes());
- String encodeBase64Str = new String(encodeBase64);
- return encodeBase64Str;
-
- }
-
-
- /**
- * @param restResponse restResponse object
- * @return readable content(converted from base64)
- * @throws IOException ioexception
- */
- public static String getDecodedArtifactPayloadFromResponse(RestResponse restResponse) throws IOException {
- Gson gson = new Gson();
- Map<String, String> fromJson = gson.fromJson(restResponse.getResponse(), Map.class);
- String payloadData = fromJson.get("base64Contents").toString();
- String decodedPaypload = org.openecomp.sdc.ci.tests.utils.Decoder.decode(payloadData);
- return decodedPaypload;
- }
-
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/AssetRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/AssetRestUtils.java
deleted file mode 100644
index ad70c34628..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/AssetRestUtils.java
+++ /dev/null
@@ -1,621 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.rest;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.gson.*;
-import org.apache.http.HttpEntity;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClients;
-import org.openecomp.sdc.be.datatypes.enums.AssetTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.*;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.*;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
-import org.openecomp.sdc.ci.tests.utils.general.FileHandling;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import static org.testng.AssertJUnit.assertNotNull;
-import static org.testng.AssertJUnit.assertTrue;
-
-public class AssetRestUtils extends BaseRestUtils {
- static Gson gson = new Gson();
- static ObjectMapper objectMapper = new ObjectMapper();
-
- static Logger logger = LoggerFactory.getLogger(AssetRestUtils.class.getName());
- static final String basicAuthentication = "Basic Y2k6MTIzNDU2";
- // /sdc/v1/catalog/{services/resources}/{componentUUID}/artifacts/{artifactUUID}
- static final String COMPONENT_ARTIFACT_URL = "/sdc/v1/catalog/%s/%s/artifacts/%s";
- // /sdc/v1/catalog/{services/resources}/{componentUUID}/resourceInstances/{resourceInstanceName}/artifacts/{artifactUUID}
- static final String RESOURCE_INSTANCE_ARTIFACT_URL = "/sdc/v1/catalog/%s/%s/resourceInstances/%s/artifacts/%s";
-
- public static HttpResponse getComponentToscaModel(AssetTypeEnum assetType, String uuid) throws IOException {
- Config config = Utils.getConfig();
- CloseableHttpClient httpclient = HttpClients.createDefault();
- String url = String.format(Urls.GET_TOSCA_MODEL, config.getCatalogBeHost(), config.getCatalogBePort(),
- assetType.getValue(), uuid);
- HttpGet httpGet = new HttpGet(url);
-
- httpGet.addHeader(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), BaseRestUtils.xEcompInstanceId);
- httpGet.addHeader(HttpHeaderEnum.AUTHORIZATION.getValue(), basicAuthentication);
-
- logger.debug("Send GET request to get Tosca model: {}", url);
-
- return httpclient.execute(httpGet);
- }
-
- public static File getToscaModelCsarFile(AssetTypeEnum assetType, String uuid) throws IOException {
- return getToscaModelCsarFile(assetType, uuid, "");
- }
-
- public static File getToscaModelCsarFile(AssetTypeEnum assetType, String uuid, String fileName) throws IOException {
- File myFile;
- Config config = Utils.getConfig();
- CloseableHttpClient httpclient = HttpClients.createDefault();
- String url = String.format(Urls.GET_TOSCA_MODEL, config.getCatalogBeHost(), config.getCatalogBePort(),
- assetType.getValue(), uuid);
- HttpGet httpGet = new HttpGet(url);
-
- if(fileName.isEmpty()) {
- myFile = new File("tmpCSAR");
- } else {
- String csarDir = FileHandling.getCreateDirByName("outputCsar");
- myFile = new File(csarDir+ File.separator + "tmpCSAR_" + fileName + ".csar");
- }
-
-
- httpGet.addHeader(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), BaseRestUtils.xEcompInstanceId);
- httpGet.addHeader(HttpHeaderEnum.AUTHORIZATION.getValue(), basicAuthentication);
-
- logger.debug("Send GET request to get Tosca model: {}", url);
- CloseableHttpResponse execute = httpclient.execute(httpGet);
-
- HttpEntity entity = execute.getEntity();
- if (entity != null) {
- try (FileOutputStream outstream = new FileOutputStream(myFile)) {
- entity.writeTo(outstream);
- outstream.close();
- }
- }
- return myFile;
- }
-
- public static RestResponse getRestResponseComponentToscaModel(AssetTypeEnum assetType, String uuid) throws IOException {
- Config config = Utils.getConfig();
-
- String url = String.format(Urls.GET_TOSCA_MODEL, config.getCatalogBeHost(), config.getCatalogBePort(),
- assetType.getValue(), uuid);
-
- Map<String, String> headersMap = new HashMap<>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader);
- headersMap.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), BaseRestUtils.xEcompInstanceId);
-
- HttpRequest http = new HttpRequest();
-
- logger.debug("Send GET request to get Resource Assets: {}", url);
- System.out.println("Send GET request to get Resource Assets: " + url);
-
- logger.debug("Request headers: {}", headersMap);
- System.out.println("Request headers: " + headersMap);
-
- RestResponse sendGetResourceAssets = http.httpSendGet(url, headersMap);
-
- return sendGetResourceAssets;
-
- }
-
- public static RestResponse getComponentListByAssetType(boolean isBasicAuthentication, AssetTypeEnum assetType,
- String... filterArrayString) throws IOException {
- Config config = Utils.getConfig();
- Map<String, String> headersMap = new HashMap<>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), BaseRestUtils.contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), BaseRestUtils.acceptHeaderData);
- if (isBasicAuthentication) {
- headersMap.put(HttpHeaderEnum.AUTHORIZATION.getValue(), basicAuthentication);
- }
- headersMap.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), BaseRestUtils.xEcompInstanceId);
-
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.GET_ASSET_LIST, config.getCatalogBeHost(), config.getCatalogBePort(),
- assetType.getValue());
- if (filterArrayString != null && filterArrayString.length > 0) {
- url = buildUrlWithFilter(url, filterArrayString);
- }
-
- RestResponse sendGetResourceAssets = http.httpSendGet(url, headersMap);
-
- return sendGetResourceAssets;
- }
-
- public static RestResponse getFilteredComponentList(AssetTypeEnum assetType, String query) throws IOException {
- Config config = Utils.getConfig();
- Map<String, String> headersMap = new HashMap<>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), BaseRestUtils.contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), BaseRestUtils.acceptHeaderData);
- headersMap.put(HttpHeaderEnum.AUTHORIZATION.getValue(), basicAuthentication);
- headersMap.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), BaseRestUtils.xEcompInstanceId);
-
- HttpRequest http = new HttpRequest();
-
- String url = String.format(Urls.GET_FILTERED_ASSET_LIST, config.getCatalogBeHost(), config.getCatalogBePort(),
- assetType.getValue(), query);
-
- logger.debug("Send GET request to get Resource Assets: {}", url);
- logger.debug("Request headers: {}", headersMap);
-
- RestResponse sendGetResourceAssets = http.httpSendGet(url, headersMap);
-
- return sendGetResourceAssets;
- }
-
- public static String buildUrlWithFilter(String url, String[] filterArrayString) {
- StringBuilder sb = new StringBuilder();
- int length = filterArrayString.length;
- int count = 0;
- for (String filterString : filterArrayString) {
- sb.append(filterString);
- count++;
- if (length != count) {
- sb.append("&");
- }
- }
- return url + "?" + sb;
- }
-
- public static RestResponse getAssetMetadataByAssetTypeAndUuid(boolean isBasicAuthentication,
- AssetTypeEnum assetType, String uuid) throws IOException {
-
- Config config = Utils.getConfig();
- Map<String, String> headersMap = new HashMap<>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), BaseRestUtils.contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), BaseRestUtils.acceptHeaderData);
- if (isBasicAuthentication) {
- headersMap.put(HttpHeaderEnum.AUTHORIZATION.getValue(), basicAuthentication);
- }
- headersMap.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), BaseRestUtils.xEcompInstanceId);
-
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.GET_ASSET_METADATA, config.getCatalogBeHost(), config.getCatalogBePort(),
- assetType.getValue(), uuid);
-
- logger.debug("Send GET request to get Resource Assets: {}", url);
- logger.debug("Request headers: {}", headersMap);
-
- RestResponse sendGetResourceAssets = http.httpSendGet(url, headersMap);
-
- return sendGetResourceAssets;
- }
-
- public static List<ResourceAssetStructure> getResourceAssetList(RestResponse assetResponse) {
- List<ResourceAssetStructure> resourceAssetList = new ArrayList<>();
-
- JsonElement jelement = new JsonParser().parse(assetResponse.getResponse());
- JsonArray componenetArray = (JsonArray) jelement;
- for (JsonElement jElement : componenetArray) {
- ResourceAssetStructure resource = gson.fromJson(jElement, ResourceAssetStructure.class);
- resourceAssetList.add(resource);
- }
- return resourceAssetList;
- }
-
- public static ResourceDetailedAssetStructure getResourceAssetMetadata(RestResponse assetResponse) {
-
- List<ResourceInstanceAssetStructure> resourcesList = new ArrayList<>();
- List<ArtifactAssetStructure> artifactsList = new ArrayList<>();
- ResourceDetailedAssetStructure resourceAssetMetadata = new ResourceDetailedAssetStructure();
- String response = assetResponse.getResponse();
-
- JsonObject jObject = (JsonObject) new JsonParser().parse(response);
- resourceAssetMetadata = gson.fromJson(jObject, ResourceDetailedAssetStructure.class);
-
- setResourceInstanceAssetList(resourcesList, jObject);
- resourceAssetMetadata.setResources(resourcesList);
-
- setArtifactAssetList(artifactsList, jObject);
- resourceAssetMetadata.setArtifacts(artifactsList);
-
- return resourceAssetMetadata;
- }
-
- public static void generalMetadataFieldsValidatior(AssetStructure assetMetadata, Component component) {
-
- assertTrue("Expected resourceUuid is " + component.getUUID() + " actual: " + assetMetadata.getUuid(),
- assetMetadata.getUuid().equals(component.getUUID()));
- assertTrue(
- "Expected resourceInvariantUuid is " + component.getInvariantUUID() + " actual: "
- + assetMetadata.getInvariantUUID(),
- assetMetadata.getInvariantUUID().equals(component.getInvariantUUID()));
- assertTrue("Expected asset name is " + component.getName() + " actual: " + assetMetadata.getName(),
- assetMetadata.getName().equals(component.getName()));
- assertTrue("Expected asset version is " + component.getVersion() + " actual: " + assetMetadata.getVersion(),
- assetMetadata.getVersion().equals(component.getVersion()));
- assertTrue(
- "Expected asset lastUpdaterUserId is " + component.getLastUpdaterUserId() + " actual: "
- + assetMetadata.getLastUpdaterUserId(),
- assetMetadata.getLastUpdaterUserId().equals(component.getLastUpdaterUserId()));
- assertNotNull("Expected asset toscaModel is null", assetMetadata.getToscaModelURL());
- assertTrue(
- "Expected asset category is " + component.getCategories().get(0).getName() + " actual: "
- + assetMetadata.getCategory(),
- assetMetadata.getCategory().equals(component.getCategories().get(0).getName()));
- assertTrue(
- "Expected asset lifeCycleState is " + component.getLifecycleState() + " actual: "
- + assetMetadata.getLifecycleState(),
- assetMetadata.getLifecycleState().equals(component.getLifecycleState().toString()));
-
- }
-
- public static void resourceMetadataValidatior(ResourceDetailedAssetStructure resourceAssetMetadata,
- Resource resource, AssetTypeEnum assetType) throws Exception {
-
- generalMetadataFieldsValidatior(resourceAssetMetadata, resource);
- assertTrue(
- "Expected asset lastUpdaterFullName is " + resource.getLastUpdaterFullName() + " actual: "
- + resourceAssetMetadata.getLastUpdaterFullName(),
- resourceAssetMetadata.getLastUpdaterFullName().equals(resource.getLastUpdaterFullName()));
- assertTrue(
- "Expected asset subCategory is " + resource.getCategories().get(0).getSubcategories().get(0).getName()
- + " actual: " + resourceAssetMetadata.getSubCategory(),
- resourceAssetMetadata.getSubCategory()
- .equals(resource.getCategories().get(0).getSubcategories().get(0).getName()));
- assertTrue(
- "Expected asset toscaResourceName is " + resource.getToscaResourceName() + " actual: "
- + resourceAssetMetadata.getToscaResourceName(),
- resourceAssetMetadata.getToscaResourceName().equals(resource.getToscaResourceName()));
- assertTrue(
- "Expected asset resourceType is " + resource.getResourceType() + " actual: "
- + resourceAssetMetadata.getResourceType(),
- resourceAssetMetadata.getResourceType().equals(resource.getResourceType().toString()));
- resourceInstanceAssetValidator(resourceAssetMetadata.getResources(), resource, assetType);
- // resourceInstanceAssetValidator(resourceAssetMetadata.getResources(),
- // resource);
- artifactAssetValidator(resourceAssetMetadata.getArtifacts(), resource, assetType);
-
- }
-
- public static void serviceMetadataValidatior(ServiceDetailedAssetStructure serviceAssetMetadata, Service service,
- AssetTypeEnum assetType) throws Exception {
-
- generalMetadataFieldsValidatior(serviceAssetMetadata, service);
- assertTrue(
- "Expected asset lastUpdaterFullName is " + service.getLastUpdaterFullName() + " actual: "
- + serviceAssetMetadata.getLastUpdaterFullName(),
- serviceAssetMetadata.getLastUpdaterFullName().equals(service.getLastUpdaterFullName()));
- assertTrue("Expected asset distributionStatus is " + service.getDistributionStatus() + " actual: "
- + serviceAssetMetadata.getDistributionStatus(),
- serviceAssetMetadata.getDistributionStatus().equals(service.getDistributionStatus().toString()));
- resourceInstanceAssetValidator(serviceAssetMetadata.getResources(), service, assetType);
- // resourceInstanceAssetValidator(serviceAssetMetadata.getResources(),
- // service);
- artifactAssetValidator(serviceAssetMetadata.getArtifacts(), service, assetType);
-
- }
-
- private static void artifactAssetValidator(List<ArtifactAssetStructure> artifactAssetStructureList,
- Component component, AssetTypeEnum assetType) {
- Map<String, ArtifactDefinition> componentDeploymentArtifacts = component.getDeploymentArtifacts();
- validateArtifactMetadata(componentDeploymentArtifacts, artifactAssetStructureList, component.getUUID(),
- assetType, null);
- }
-
- private static void validateArtifactMetadata(Map<String, ArtifactDefinition> componentDeploymentArtifacts,
- List<ArtifactAssetStructure> artifactAssetStructureList, String componentUuid, AssetTypeEnum assetType,
- String resourceInstanceName) {
- if(componentDeploymentArtifacts != null){
- for (Entry<String, ArtifactDefinition> componentDeploymentArtifact : componentDeploymentArtifacts.entrySet()) {
- ArtifactAssetStructure artifactAssetStructure = getArtifactMetadata(artifactAssetStructureList,
- componentDeploymentArtifact.getValue().getArtifactUUID());
- ArtifactDefinition componentDeploymentArtifactValue = componentDeploymentArtifact.getValue();
- if (artifactAssetStructure != null) {
- assertTrue(
- "Expected artifact asset artifactName is " + componentDeploymentArtifactValue.getArtifactName()
- + " actual: " + artifactAssetStructure.getArtifactName(),
- componentDeploymentArtifactValue.getArtifactName()
- .equals(artifactAssetStructure.getArtifactName()));
- assertTrue(
- "Expected artifact asset Type is " + componentDeploymentArtifactValue.getArtifactType()
- + " actual: " + artifactAssetStructure.getArtifactType(),
- componentDeploymentArtifactValue.getArtifactType()
- .equals(artifactAssetStructure.getArtifactType()));
- // assertNotNull("Expected artifact asset resourceInvariantUUID
- // is null",
- // resourceInstanceAssetStructure.getResourceInvariantUUID());
- // String expectedArtifactUrl = "/sdc/v1/catalog/" +
- // assetType.getValue() + "/" + componentUuid + "/artifacts/" +
- // componentDeploymentArtifactValue.getArtifactUUID();
- String expectedArtifactUrl = "";
- if (resourceInstanceName == null) {
- expectedArtifactUrl = String.format(COMPONENT_ARTIFACT_URL, assetType.getValue(), componentUuid,
- componentDeploymentArtifactValue.getArtifactUUID());
- } else {
- expectedArtifactUrl = String.format(RESOURCE_INSTANCE_ARTIFACT_URL, assetType.getValue(),
- componentUuid, resourceInstanceName, componentDeploymentArtifactValue.getArtifactUUID());
- }
-
- assertTrue(
- "Expected artifact asset URL is " + expectedArtifactUrl + " actual: "
- + artifactAssetStructure.getArtifactURL(),
- artifactAssetStructure.getArtifactURL().equals(expectedArtifactUrl));
- assertTrue(
- "Expected artifact asset description is " + componentDeploymentArtifactValue.getDescription()
- + " actual: " + artifactAssetStructure.getArtifactDescription(),
- componentDeploymentArtifactValue.getDescription().toString()
- .equals(artifactAssetStructure.getArtifactDescription()));
- assertTrue(
- "Expected artifact asset checkSum is " + componentDeploymentArtifactValue.getArtifactChecksum()
- + " actual: " + artifactAssetStructure.getArtifactChecksum(),
- componentDeploymentArtifactValue.getArtifactChecksum()
- .equals(artifactAssetStructure.getArtifactChecksum()));
- assertTrue(
- "Expected artifact asset version is " + componentDeploymentArtifactValue.getArtifactVersion()
- + " actual: " + artifactAssetStructure.getArtifactVersion(),
- componentDeploymentArtifactValue.getArtifactVersion()
- .equals(artifactAssetStructure.getArtifactVersion()));
- if (componentDeploymentArtifactValue.getTimeout() > 0) {
- assertTrue(
- "Expected artifact asset timeout is " + componentDeploymentArtifactValue.getTimeout()
- + " actual: " + artifactAssetStructure.getArtifactTimeout(),
- componentDeploymentArtifactValue.getTimeout()
- .equals(artifactAssetStructure.getArtifactTimeout()));
- }
-
- } else {
- assertTrue("artifact asset with UUID" + componentDeploymentArtifact.getValue().getArtifactUUID()
- + " not found in get Metadata response", false);
- }
- }
- }else{
- System.out.println("componentDeploymentArtifacts is null");
- logger.debug("componentDeploymentArtifacts is null");
- }
-
- }
-
- private static ArtifactAssetStructure getArtifactMetadata(List<ArtifactAssetStructure> artifactAssetStructureList,
- String artifactUUID) {
- for (ArtifactAssetStructure artifactAssetStructure : artifactAssetStructureList) {
- if (artifactAssetStructure.getArtifactUUID().equals(artifactUUID)) {
- return artifactAssetStructure;
- }
- }
- return null;
- }
-
- private static void resourceInstanceAssetValidator(
- List<ResourceInstanceAssetStructure> resourceInstanceAssetStructures, Component component,
- AssetTypeEnum assetType) throws Exception {
-
- List<ComponentInstance> componentInstances = component.getComponentInstances();
- if (componentInstances != null) {
- for (ComponentInstance componentInstance : componentInstances) {
- ResourceInstanceAssetStructure resourceInstanceAssetStructure = getResourceInstanceMetadata(
- resourceInstanceAssetStructures, componentInstance.getName());
- if (resourceInstanceAssetStructure != null) {
- assertTrue(
- "Expected RI asset resourceName is " + componentInstance.getComponentName() + " actual: "
- + resourceInstanceAssetStructure.getResourceName(),
- componentInstance.getComponentName()
- .equals(resourceInstanceAssetStructure.getResourceName()));
- assertTrue(
- "Expected RI asset Name is " + componentInstance.getName() + " actual: "
- + resourceInstanceAssetStructure.getResourceInstanceName(),
- componentInstance.getName()
- .equals(resourceInstanceAssetStructure.getResourceInstanceName()));
- assertNotNull("Expected RI asset resourceInvariantUUID is null",
- resourceInstanceAssetStructure.getResourceInvariantUUID());
- assertTrue(
- "Expected RI asset resourceVersion is " + componentInstance.getComponentVersion()
- + " actual: " + resourceInstanceAssetStructure.getResourceVersion(),
- componentInstance.getComponentVersion()
- .equals(resourceInstanceAssetStructure.getResourceVersion()));
- assertTrue(
- "Expected RI asset resourceType is " + componentInstance.getOriginType() + " actual: "
- + resourceInstanceAssetStructure.getResoucreType(),
- componentInstance.getOriginType().toString()
- .equals(resourceInstanceAssetStructure.getResoucreType()));
- Resource resource = AtomicOperationUtils.getResourceObject(componentInstance.getComponentUid());
- assertTrue("Expected RI asset resourceUUID is " + resource.getUUID() + " actual: " + resourceInstanceAssetStructure.getResourceUUID(),
- resource.getUUID().equals(resourceInstanceAssetStructure.getResourceUUID()));
- validateArtifactMetadata(componentInstance.getDeploymentArtifacts(),
- resourceInstanceAssetStructure.getArtifacts(), component.getUUID(), assetType,
- componentInstance.getNormalizedName());
- // validateArtifactMetadata(componentInstance.getDeploymentArtifacts(),
- // resourceInstanceAssetStructure.getArtifacts(),
- // component.getUUID(), AssetTypeEnum.RESOURCES);
- } else {
- assertTrue("resourceInstance asset with UUID" + componentInstance.getComponentUid()
- + " not found in get Metadata response", false);
- }
- }
- }
-
- }
-
- // private static ResourceInstanceAssetStructure
- // getResourceInstanceMetadata(List<ResourceInstanceAssetStructure>
- // resourceInstanceAssetStructures, String componentUid) {
- private static ResourceInstanceAssetStructure getResourceInstanceMetadata(
- List<ResourceInstanceAssetStructure> resourceInstanceAssetStructures, String name) {
- for (ResourceInstanceAssetStructure resourceInstanceAssetStructure : resourceInstanceAssetStructures) {
- if (resourceInstanceAssetStructure.getResourceInstanceName().equals(name)) {
- return resourceInstanceAssetStructure;
- }
- }
- return null;
- }
-
- public static ServiceDetailedAssetStructure getServiceAssetMetadata(RestResponse assetResponse) {
-
- List<ResourceInstanceAssetStructure> resourcesList = new ArrayList<>();
- List<ArtifactAssetStructure> artifactsList = new ArrayList<>();
- ServiceDetailedAssetStructure serviceAssetMetadata;
-
- JsonObject jObject = (JsonObject) new JsonParser().parse(assetResponse.getResponse());
- serviceAssetMetadata = gson.fromJson(jObject, ServiceDetailedAssetStructure.class);
-
- setResourceInstanceAssetList(resourcesList, jObject);
- serviceAssetMetadata.setResources(resourcesList);
-
- setArtifactAssetList(artifactsList, jObject);
- serviceAssetMetadata.setArtifacts(artifactsList);
-
- return serviceAssetMetadata;
- }
-
- public static void setArtifactAssetList(List<ArtifactAssetStructure> artifactsList, JsonObject jObject) {
- JsonArray artifactsArray = jObject.getAsJsonArray("artifacts");
- if (artifactsArray != null) {
- for (JsonElement jElement : artifactsArray) {
- ArtifactAssetStructure artifact = gson.fromJson(jElement, ArtifactAssetStructure.class);
- artifactsList.add(artifact);
- }
- }
- }
-
- public static void setResourceInstanceAssetList(List<ResourceInstanceAssetStructure> resourcesList,
- JsonObject jObject) {
- JsonArray resourcesArray = jObject.getAsJsonArray("resources");
- if (resourcesArray != null) {
- for (JsonElement jElement : resourcesArray) {
- ResourceInstanceAssetStructure resource = gson.fromJson(jElement, ResourceInstanceAssetStructure.class);
- resourcesList.add(resource);
- }
- }
- }
-
- public static List<ServiceAssetStructure> getServiceAssetList(RestResponse assetResponse) {
- List<ServiceAssetStructure> serviceAssetList = new ArrayList<>();
-
- JsonElement jelement = new JsonParser().parse(assetResponse.getResponse());
- JsonArray componenetArray = (JsonArray) jelement;
- for (JsonElement jElement : componenetArray) {
- ServiceAssetStructure service = gson.fromJson(jElement, ServiceAssetStructure.class);
- serviceAssetList.add(service);
- }
- return serviceAssetList;
- }
-
- public static List<String> getResourceNamesList(List<ResourceAssetStructure> resourceAssetList) {
- List<String> assetNamesList = new ArrayList<>();
- for (ResourceAssetStructure resourceAsset : resourceAssetList) {
- assetNamesList.add(resourceAsset.getName());
- }
- return assetNamesList;
- }
-
- public static Map<String,String> getResourceAssetMap(RestResponse assetResponse) {
- Map<String,String> resourceAssetMap = new HashMap<>();
-
- JsonElement jelement = new JsonParser().parse(assetResponse.getResponse());
- JsonArray componenetArray = (JsonArray) jelement;
- for (JsonElement jElement : componenetArray) {
- ResourceAssetStructure resource = gson.fromJson(jElement, ResourceAssetStructure.class);
- resourceAssetMap.put(resource.getName(), resource.getVersion());
- }
- return resourceAssetMap;
- }
-
- public static Map<String,String> getResourceListFiltteredByWholeVersion(Map<String,String> resourceAssetList) {
- Map<String,String> assetNamesMap = new HashMap<>();
- for (Entry<String, String> entry : resourceAssetList.entrySet()) {
- String key = entry.getKey();
- String[] parts = entry.getValue().split("\\.");
- String lastOne = parts[parts.length-1];
-
- if (key.contains("CinderVolume") ){
- assetNamesMap.put(key,entry.getValue());
- }
-
- if (lastOne.equals("0") && !key.contains("Ci") ){
- assetNamesMap.put(key,entry.getValue());
- }
- }
-
- return assetNamesMap;
- }
-
- public static List<String> getResourceObjectByNameAndVersionToscaNamesList(Map<String,String> resourceAssetList) throws Exception {
- List<String> assetNamesList = new ArrayList<>();
- for (Entry<String, String> entry : resourceAssetList.entrySet()) {
- System.out.println("fetch data---->"+entry.getKey()+entry.getValue());
- Resource resourceObjectByNameAndVersion = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, entry.getKey(), entry.getValue());
- assetNamesList.add(resourceObjectByNameAndVersion.getToscaResourceName());
-
- }
-
- return assetNamesList;
- }
-
-
- public static List<String> getServiceNamesList(List<ServiceAssetStructure> serviceAssetList) {
- List<String> assetNamesList = new ArrayList<>();
- for (ServiceAssetStructure serviceAsset : serviceAssetList) {
- assetNamesList.add(serviceAsset.getName());
- }
- return assetNamesList;
- }
-
- public static void checkResourceTypeInObjectList(List<ResourceAssetStructure> resourceAssetList, ResourceTypeEnum resourceType) {
- for (ResourceAssetStructure resourceAsset : resourceAssetList) {
- assertTrue("Expected resourceType is " + resourceType.toString() + " actual: " + resourceAsset.getResourceType(),
- resourceAsset.getResourceType().equals(resourceType.toString()));
- }
- }
-
- public static void checkComponentTypeInObjectList(List<ResourceAssetStructure> resourceAssetList, ComponentTypeEnum componentType) {
- ComponentTypeEnum actualComponentType;
- for (ResourceAssetStructure resourceAsset : resourceAssetList) {
- actualComponentType = detectComponentType(resourceAsset);
- assertTrue("Expected componentType is " + componentType.getValue() + " actual: " + actualComponentType.getValue(), actualComponentType.equals(componentType));
- }
- }
-
- private static ComponentTypeEnum detectComponentType(ResourceAssetStructure resourceAsset) {
- String resourceType = resourceAsset.getResourceType();
- if(ResourceTypeEnum.getType(resourceType) !=null){
- return ComponentTypeEnum.RESOURCE;
- }
- return null;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/AutomationUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/AutomationUtils.java
deleted file mode 100644
index 8d39bd1c99..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/AutomationUtils.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.rest;
-
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-
-public class AutomationUtils extends BaseRestUtils {
-
-
- public static String getOnboardVersion() {
- String onboardVersionStr = null;
- try {
-
- RestResponse onboardVersion = CatalogRestUtils.getOnboardVersion();
- onboardVersionStr = ResponseParser.getValueFromJsonResponse(onboardVersion.getResponse() , "Version");
-
- } catch (Exception e) {
- System.out.println("UnknownOnboardVersion");
- }
- return onboardVersionStr != null ? onboardVersionStr : "UnknownOnboardVersion";
-
- }
-
- public static String getOSVersion() {
- String osVersionStr = null;
- try {
- RestResponse osVersion = CatalogRestUtils.getOsVersion();
- osVersionStr = ResponseParser.getVersionFromResponse(osVersion);
-
- } catch (Exception e) {
- System.out.println("UnknownOSversion");
- }
-
- return osVersionStr != null ? osVersionStr : "UnknownOSversion" ;
- }
-
-
-
- public static void createVersionsInfoFile(String filepath, String onboardVersion, String osVersion, String envData, String suiteName) throws IOException {
- File myFoo = new File(filepath);
- try (FileOutputStream fooStream = new FileOutputStream(myFoo, false)) {
- String versions = ("onboardVersion=\"" + onboardVersion + "\"\n" + "osVersion=\"" + osVersion + "\"\n" + "env=\"" + envData + "\"\n" + "suiteName=\"" + suiteName + "\"\n");
- byte[] myBytes = versions.getBytes();
- fooStream.write(myBytes);
- }
- }
-
- public static void createVersionsInfoFile(String filepath, String onboardVersion, String osVersion, String envData, String suiteName, String reportStartTime) throws IOException {
- File myFoo = new File(filepath);
- try (FileOutputStream fooStream = new FileOutputStream(myFoo, false)) {
- String versions = ("onboardVersion=\"" + onboardVersion + "\"\n" + "osVersion=\"" + osVersion + "\"\n" + "env=\"" + envData + "\"\n" + "suiteName=\"" + suiteName + "\"\n" + "reportStartTime=\"" + reportStartTime + "\"\n");
- byte[] myBytes = versions.getBytes();
- fooStream.write(myBytes);
- }
- }
-
- public static void createVersionsInfoFile(String filepath, String onboardVersion, String osVersion, String envData)
- throws IOException {
- createVersionsInfoFile(filepath, onboardVersion, osVersion, envData, null);
- }
-
- public static void addEnvDetailsToReport() throws FileNotFoundException{
-
- Config config = Utils.getConfig();
- config.getUrl();
- }
-
- public static File getConfigFile(String configFileName) throws Exception {
- File configFile = new File(getBasePath() + File.separator + "conf" + File.separator + configFileName);
- if (!configFile.exists()) {
- configFile = new File(getConfFilesPath() + configFileName);
- }
- return configFile;
- }
-
- public static String getCiFilesPath() {
- return getBasePath() + File.separator + "src" + File.separator + "main" + File.separator + "resources"
- + File.separator + "ci";
- }
-
- public static String getConfFilesPath() {
- return getCiFilesPath() + File.separator + "conf" + File.separator;
- }
-
- public static String getTestSuitesFilesPath() {
- return getCiFilesPath() + File.separator + "testSuites" + File.separator;
- }
- public static String getBasePath() {
- return System.getProperty("user.dir");
- }
-
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/BaseRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/BaseRestUtils.java
deleted file mode 100644
index b8ec35f0ff..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/BaseRestUtils.java
+++ /dev/null
@@ -1,268 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.rest;
-
-import org.apache.commons.codec.binary.Base64;
-import org.apache.http.HttpEntity;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClients;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.validation.BaseValidationUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class BaseRestUtils extends BaseValidationUtils {
- public static final String contentTypeHeaderData = "application/json";
- public static final String acceptHeaderData = "application/json";
- public static final String acceptJsonHeader = "application/json";
- public static final String acceptOctetHeader = "application/octet-stream";
- public static final String acceptMultipartHeader = "application/octet-stream";
- public static final String authorizationHeader = "Basic " + Base64.encodeBase64String("ci:123456".getBytes());
- public static final String acceptOctetStream = "application/octet-stream";
- public static final String ecomp = "ecomp";
- public static final String authorizationPrefixString = "Basic ";
- public static final String xEcompInstanceId = "a1bd39f6-d55e-45b2-9207-156216af5cb5";
- public static final String cacheControlHeader = "no-cache";
-
- public static final String RESOURCE_COMPONENT_TYPE = "resources";
- public static final String PRODUCT_COMPONENT_TYPE = "products";
- public static final String SERVICE_COMPONENT_TYPE = "services";
-
- public static final int STATUS_CODE_SUCCESS = 200;
- public static final int STATUS_CODE_CREATED = 201;
- public static final int STATUS_CODE_DELETE = 204;
- public static final int STATUS_CODE_NOT_FOUND = 404;
- public static final int STATUS_CODE_SUCCESS_NO_CONTENT = 204;
- public static final int STATUS_CODE_SUCCESS_DELETE = 204;
- public static final int STATUS_CODE_INVALID_CONTENT = 400;
- public static final int STATUS_CODE_MISSING_DATA = 400;
- public static final int STATUS_CODE_MISSING_INFORMATION = 403;
- public static final int STATUS_CODE_RESTRICTED_ACCESS = 403;
- public static final int STATUS_CODE_ALREADY_EXISTS = 409;
- public static final int STATUS_CODE_RESTRICTED_OPERATION = 409;
- public static final int STATUS_CODE_COMPONENT_NAME_EXCEEDS_LIMIT = 400;
- public static final int STATUS_CODE_MISSING_COMPONENT_NAME = 400;
- public static final int STATUS_CODE_UNSUPPORTED_ERROR = 400;
- public static final int STATUS_CODE_IMPORT_SUCCESS = 201;
- public static final int STATUS_CODE_UPDATE_SUCCESS = 200;
- public static final int RESTRICTED_OPERATION = 409;
- public static final int STATUS_CODE_GET_SUCCESS = 200;
-
- public static final String SUCCESS_MESSAGE = "OK";
- private static Logger logger = LoggerFactory.getLogger(BaseRestUtils.class.getName());
-
- private static byte[] encodeBase64;
-
- // ************* PRIVATE METHODS ************************
-
- public static Map<String, String> prepareHeadersMap(String userId) {
- return prepareHeadersMap(userId, acceptHeaderData);
- }
-
- protected static Map<String, String> prepareHeadersMap(String userId, String accept) {
- Map<String, String> headersMap = new HashMap<>();
- if (contentTypeHeaderData != null) {
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- }
- if (accept != null) {
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), accept);
- }
- if (userId != null) {
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), userId);
- }
-
- return headersMap;
- }
-
- // send request
- // GET
- protected static RestResponse sendGet(String url, String userId) throws IOException {
- return sendGet(url, userId, null);
- }
-
- protected static RestResponse sendGet(String url, String userId, Map<String, String> additionalHeaders)
- throws IOException {
- Map<String, String> headersMap = prepareHeadersMap(userId);
- if (additionalHeaders != null) {
- headersMap.putAll(additionalHeaders);
- }
-
- HttpRequest http = new HttpRequest();
- RestResponse getResourceResponse = http.httpSendGet(url, headersMap);
- return getResourceResponse;
- }
-
- public static RestResponse sendGetAndRemoveHeaders(String url, String userId, List<String> headersToRemove)
- throws IOException {
- Map<String, String> headersMap = prepareHeadersMap(userId);
- if (headersToRemove != null) {
- for (String header : headersToRemove) {
- headersMap.remove(header);
- }
- }
-
- HttpRequest http = new HttpRequest();
- RestResponse getResourceResponse = http.httpSendGet(url, headersMap);
- return getResourceResponse;
- }
-
- // PUT
- protected static RestResponse sendPut(String url, String userBodyJson, String userId, String cont)
- throws IOException {
- Map<String, String> headersMap = prepareHeadersMap(userId, cont);
-
- HttpRequest http = new HttpRequest();
- RestResponse updateResourceResponse = http.httpSendByMethod(url, "PUT", userBodyJson, headersMap);
- return updateResourceResponse;
- }
-
- // POST
- public static RestResponse sendPost(String url, String userBodyJson, String userId, String accept)
- throws IOException {
- return sendPost(url, userBodyJson, userId, accept, null);
- }
-
- protected static RestResponse sendPost(String url, String userBodyJson, String userId, String accept,
- Map<String, String> additionalHeaders) throws IOException {
- Map<String, String> headersMap = prepareHeadersMap(userId, accept);
- if (additionalHeaders != null) {
- headersMap.putAll(additionalHeaders);
- }
- HttpRequest http = new HttpRequest();
- RestResponse postResourceResponse = http.httpSendPost(url, userBodyJson, headersMap);
- return postResourceResponse;
- }
-
- // used form complex requests like import categories..
- protected static RestResponse sendPost(String url, HttpEntity entity, String userId, String accept)
- throws IOException {
- RestResponse postResponse = new RestResponse();
- CloseableHttpResponse response = null;
- CloseableHttpClient client = null;
- try {
- client = HttpClients.createDefault();
- HttpPost httpPost = new HttpPost(url);
-
- httpPost.addHeader("USER_ID", userId);
- httpPost.setEntity(entity);
- response = client.execute(httpPost);
- HttpEntity responseEntity = response.getEntity();
- int statusCode = response.getStatusLine().getStatusCode();
-
- postResponse.setErrorCode(statusCode);
- StringBuilder sb = new StringBuilder();
- try {
- BufferedReader in = new BufferedReader(new InputStreamReader(responseEntity.getContent()));
- String inputLine;
- while ((inputLine = in.readLine()) != null) {
- sb.append(inputLine);
- }
- in.close();
- } catch (Exception e) {
- logger.debug("response body is null");
- }
- postResponse.setResponse(sb.toString());
- } finally {
- try {
- if (response != null) {
- response.close();
- }
-
- } catch (IOException e) {
- logger.debug("failed to close client or response: ", e);
- }
- try {
- if (client != null) {
- client.close();
- }
- } catch (IOException e) {
- logger.debug("failed to close client or response: ", e);
- }
- }
- return postResponse;
- }
-
- // DELETE
- protected static RestResponse sendDelete(String url, String userId) throws IOException {
-// Map<String, String> headersMap = prepareHeadersMap(userId);
-
- return sendDelete(url, userId, null);
- }
-
- protected static RestResponse sendDelete(String url, String userId, Map<String, String> additionalHeaders) throws IOException {
- Map<String, String> headersMap = prepareHeadersMap(userId);
- if (additionalHeaders != null) {
- headersMap.putAll(additionalHeaders);
- }
-
- HttpRequest http = new HttpRequest();
- RestResponse deleteResourceResponse = http.httpSendDelete(url, headersMap);
- return deleteResourceResponse;
- }
-
- /*
- * // ------ protected static Boolean checkErrorCode(RestResponse
- * deleteResponse) { if (deleteResponse.getErrorCode() ==
- * STATUS_CODE_SUCCESS || deleteResponse.getErrorCode() ==
- * STATUS_CODE_DELETE) { return true; } return false; }
- *
- * // *** STATUS CODE VALIDATION UTIITIES **** public static void
- * checkStatusCode(RestResponse response, String assertMessage, boolean AND,
- * int... statuses) { int statusCode = response.getErrorCode(); for (int
- * status : statuses) { if (AND && statusCode != status) {
- * Assert.fail(assertMessage + " status: " + statusCode); } else if
- * (statusCode == status) { return; } } if (!AND) {
- * Assert.fail(assertMessage + " status: " + statusCode); } }
- *
- * public static void checkDeleteResponse(RestResponse response) {
- * checkStatusCode(response,"delete request failed",false,STATUS_CODE_DELETE
- * ,STATUS_CODE_NOT_FOUND, STATUS_CODE_SUCCESS); // STATUS_CODE_SUCCESS for
- * deActivate user }
- *
- * public static void checkCreateResponse(RestResponse response) {
- * checkStatusCode(response, "create request failed", false,
- * STATUS_CODE_CREATED); }
- */
- public static String encodeUrlForDownload(String url) {
- return url.replaceAll(" ", "%20");
- }
-
- public static Map<String, String> addAuthorizeHeader(String userName, String password) {
- String userCredentials = userName + ":" + password;
- encodeBase64 = Base64.encodeBase64(userCredentials.getBytes());
- String encodedUserCredentials = authorizationPrefixString + new String(encodeBase64);
- Map<String, String> authorizationHeader = new HashMap<>();
- authorizationHeader.put(HttpHeaderEnum.AUTHORIZATION.getValue(), encodedUserCredentials);
- return authorizationHeader;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/CapabilityRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/CapabilityRestUtils.java
deleted file mode 100644
index 488ed249f5..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/CapabilityRestUtils.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright © 2016-2018 European Support Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openecomp.sdc.ci.tests.utils.rest;
-
-import com.google.gson.Gson;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.model.Component;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.CapabilityDetails;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-
-import java.util.List;
-
-public class CapabilityRestUtils extends BaseRestUtils {
- private static Gson gson = new Gson();
-
- public static RestResponse createCapability(Component component,
- List<CapabilityDetails> capabilityDetailsList,
- User user) throws Exception{
- Config config = Config.instance();
- String url = String.format(Urls.CREATE_CAPABILITY, config.getCatalogBeHost(), config.getCatalogBePort(),
- ComponentTypeEnum.findParamByType(component.getComponentType()), component.getUniqueId());
-
- String data = "{ \"capabilities\" : {" + "\"" +capabilityDetailsList.get(0).getType()+ "\"" +" : "
- + gson.toJson(capabilityDetailsList) + " } }";
-
- return sendPost(url, data , user.getUserId(), acceptHeaderData);
- }
-
- public static RestResponse updateCapability(Component component,
- List<CapabilityDetails> capabilityDetailsList,
- User user) throws Exception{
- Config config = Config.instance();
- String url = String.format(Urls.UPDATE_CAPABILITY, config.getCatalogBeHost(), config.getCatalogBePort(),
- ComponentTypeEnum.findParamByType(component.getComponentType()), component.getUniqueId());
-
- String data = "{ \"capabilities\" : {" + "\"" +capabilityDetailsList.get(0).getType()+ "\"" +" : "
- + gson.toJson(capabilityDetailsList) + " } }";
-
- return sendPost(url, data , user.getUserId(), acceptHeaderData);
- }
-
- public static RestResponse deleteCapability(Component component,
- String requirementId,
- User user) throws Exception{
- Config config = Config.instance();
- String url = String.format(Urls.DELETE_CAPABILITY, config.getCatalogBeHost(), config.getCatalogBePort(),
- ComponentTypeEnum.findParamByType(component.getComponentType()), component.getUniqueId(), requirementId);
- return sendDelete(url, user.getUserId());
- }
-
- public static RestResponse getCapability(Component component,
- String requirementId,
- User user) throws Exception{
- Config config = Config.instance();
- String url = String.format(Urls.GET_CAPABILITY, config.getCatalogBeHost(), config.getCatalogBePort(),
- ComponentTypeEnum.findParamByType(component.getComponentType()), component.getUniqueId(), requirementId);
- return sendDelete(url, user.getUserId());
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/CatalogRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/CatalogRestUtils.java
deleted file mode 100644
index 304df86199..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/CatalogRestUtils.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.rest;
-
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-public class CatalogRestUtils extends BaseRestUtils {
-
- public static RestResponse getAbstractResources() throws IOException {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_ALL_ABSTRACT_RESOURCES, config.getCatalogBeHost(),
- config.getCatalogBePort());
-
- return sendGet(url, UserRoleEnum.DESIGNER.getUserId());
- }
-
- public static RestResponse getCatalog() throws IOException {
- return getCatalog(UserRoleEnum.DESIGNER.getUserId());
- }
-
- public static RestResponse getCatalog(String userId) throws IOException {
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_CATALOG_DATA, config.getCatalogBeHost(), config.getCatalogBePort());
- return sendGet(url, userId);
- }
-
- public static RestResponse getAllCategoriesTowardsCatalogBe() throws IOException {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_ALL_CATEGORIES, config.getCatalogBeHost(), config.getCatalogBePort(),
- BaseRestUtils.RESOURCE_COMPONENT_TYPE);
-
- return sendGet(url, UserRoleEnum.DESIGNER.getUserId());
- }
-
- public static RestResponse getAllCategoriesTowardsCatalogFeWithUuid(String uuid) throws IOException {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_ALL_CATEGORIES_FE, config.getCatalogFeHost(), config.getCatalogFePort(),
- BaseRestUtils.RESOURCE_COMPONENT_TYPE);
-
- Map<String, String> additionalHeaders = new HashMap<>();
- additionalHeaders.put(HttpHeaderEnum.X_ECOMP_REQUEST_ID_HEADER.getValue(), uuid);
-
- return sendGet(url, UserRoleEnum.DESIGNER.getUserId(), additionalHeaders);
- }
-
- public static RestResponse getOnboardVersion() throws IOException {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.ONBOARD_VERSION, config.getCatalogBeHost(),
- config.getCatalogBePort());
-
- return sendGet(url, UserRoleEnum.DESIGNER.getUserId());
- }
-
- public static RestResponse getOsVersion() throws IOException {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.OS_VERSION, config.getCatalogBeHost(), config.getCatalogBePort());
-
- return sendGet(url, UserRoleEnum.DESIGNER.getUserId());
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/CategoryRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/CategoryRestUtils.java
deleted file mode 100644
index 3e1413a226..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/CategoryRestUtils.java
+++ /dev/null
@@ -1,308 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.rest;
-
-import com.google.gson.Gson;
-import com.google.gson.reflect.TypeToken;
-import org.apache.http.entity.mime.MultipartEntityBuilder;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.be.model.category.CategoryDefinition;
-import org.openecomp.sdc.be.model.category.GroupingDefinition;
-import org.openecomp.sdc.be.model.category.SubCategoryDefinition;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-
-public class CategoryRestUtils extends BaseRestUtils {
-
- private static final int STATUS_CODE_CREATED = 201;
-
- private static Gson gson = new Gson();
-
- public static RestResponse createCategory(CategoryDefinition categoryDefinition, User sdncModifierDetails,
- String categoryType) throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.CREATE_CATEGORY, config.getCatalogBeHost(), config.getCatalogBePort(),
- categoryType);
- String bodyJson = gson.toJson(categoryDefinition);
- RestResponse addCategoryResponse = BaseRestUtils.sendPost(url, bodyJson, sdncModifierDetails.getUserId(),
- acceptHeaderData);
- if (addCategoryResponse.getErrorCode().intValue() == STATUS_CODE_CREATED)
- categoryDefinition.setUniqueId(
- ResponseParser.getValueFromJsonResponse(addCategoryResponse.getResponse(), "uniqueId"));
- return addCategoryResponse;
- }
-
- // GET categories
- public static RestResponse getAllCategories(User sdncModifierDetails, String categoryType) throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_ALL_CATEGORIES, config.getCatalogBeHost(), config.getCatalogBePort(),
- categoryType);
- String userId = sdncModifierDetails.getUserId();
- Map<String, String> headersMap = prepareHeadersMap(userId);
- HttpRequest http = new HttpRequest();
- // System.out.println(url);
- RestResponse getCategotyResponse = http.httpSendGet(url, headersMap);
- return getCategotyResponse;
- }
-
- public static RestResponse getAllCategoriesTowardsFe(User sdncModifierDetails, String categoryType)
- throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_ALL_CATEGORIES_FE, config.getCatalogFeHost(), config.getCatalogFePort(),
- categoryType);
- String userId = sdncModifierDetails.getUserId();
- Map<String, String> headersMap = prepareHeadersMap(userId);
- HttpRequest http = new HttpRequest();
- // System.out.println(url);
- RestResponse getCategotyResponse = http.httpSendGet(url, headersMap);
- return getCategotyResponse;
- }
-
- // Delete Category
- public static RestResponse deleteCategory(String categoryId, String psUserId, String categoryType)
- throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.DELETE_CATEGORY, config.getCatalogBeHost(), config.getCatalogBePort(),
- categoryType, categoryId);
- url = url.replace("#", "%23"); // HEX
- url = url.replace(" ", "%20"); // HEX
- RestResponse deleteCategoryResponse = sendDelete(url, psUserId);
- return deleteCategoryResponse;
- }
-
- public static RestResponse createSubCategory(SubCategoryDefinition subCategory, CategoryDefinition parentCategory,
- User sdncModifierDetails, String categoryType) throws Exception {
- // categoryType = service/resource/product
- Config config = Utils.getConfig();
- String url = String.format(Urls.CREATE_SUB_CATEGORY, config.getCatalogBeHost(), config.getCatalogBePort(),
- categoryType, parentCategory.getUniqueId());
- String bodyJson = gson.toJson(subCategory);
- RestResponse createSubCategoryPost = BaseRestUtils.sendPost(url, bodyJson, sdncModifierDetails.getUserId(),
- acceptHeaderData);
- if (createSubCategoryPost.getErrorCode().intValue() == STATUS_CODE_CREATED)
- subCategory.setUniqueId(
- ResponseParser.getValueFromJsonResponse(createSubCategoryPost.getResponse(), "uniqueId"));
-
- return createSubCategoryPost;
- }
-
- public static RestResponse deleteSubCategory(String subCategoryId, String categoryId, String psUserId,
- String categoryType) throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.DELETE_SUB_CATEGORY, config.getCatalogBeHost(), config.getCatalogBePort(),
- categoryType, categoryId, subCategoryId);
- url = url.replace("#", "%23"); // HEX
- url = url.replace(" ", "%20"); // HEX
- RestResponse deleteSubCategoryResponse = sendDelete(url, psUserId);
- return deleteSubCategoryResponse;
- }
-
- public static RestResponse deleteGrouping(String groupId, String subCategoryId, String categoryId, String psUserId,
- String categoryType) throws Exception {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.DELETE_GROUPING, config.getCatalogBeHost(), config.getCatalogBePort(),
- categoryType, categoryId, subCategoryId, groupId);
- url = url.replace("#", "%23"); // HEX
- url = url.replace(" ", "%20"); // HEX
- RestResponse deleteGroupResponse = sendDelete(url, psUserId);
- return deleteGroupResponse;
- }
-
- public static RestResponse createServiceCategoryHttpCspAtuUidIsMissing(CategoryDefinition categoryDataDefinition,
- User sdncModifierDetails) throws Exception {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.CREATE_CATEGORY, config.getCatalogBeHost(), config.getCatalogBePort(),
- SERVICE_COMPONENT_TYPE);
-
- Map<String, String> headersMap = prepareHeadersMap(sdncModifierDetails.getUserId());
- headersMap.remove("USER_ID");
- Gson gson = new Gson();
- String userBodyJson = gson.toJson(categoryDataDefinition);
- HttpRequest http = new HttpRequest();
- // System.out.println(url);
- // System.out.println(userBodyJson);
- RestResponse createCatergoryResponse = http.httpSendPost(url, userBodyJson, headersMap);
- return createCatergoryResponse;
- }
-
- public static RestResponse createSubCategoryHttpCspAtuUidIsMissing(SubCategoryDefinition subCategory,
- CategoryDefinition parentCategory, User sdncModifierDetails, String categoryType) throws Exception {
- // categoryType = service/resource/product
- Config config = Utils.getConfig();
- String url = String.format(Urls.CREATE_SUB_CATEGORY, config.getCatalogBeHost(), config.getCatalogBePort(),
- categoryType, parentCategory.getUniqueId());
- String userId = sdncModifierDetails.getUserId();
- Map<String, String> headersMap = prepareHeadersMap(userId);
- headersMap.remove("USER_ID");
- Gson gson = new Gson();
- String subCatJson = gson.toJson(subCategory);
- HttpRequest http = new HttpRequest();
- // System.out.println(url);
- // System.out.println(subCatJson);
- RestResponse addCategoryResponse = http.httpSendPost(url, subCatJson, headersMap);
- return addCategoryResponse;
- }
-
- public static RestResponse deleteCatergoryHttpCspAtuUidIsMissing(CategoryDefinition categoryDataDefinition,
- User sdncModifierDetails) throws Exception {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.DELETE_CONSUMER, config.getCatalogBeHost(), config.getCatalogBePort(),
- categoryDataDefinition.getName());
-
- String userId = sdncModifierDetails.getUserId();
- Map<String, String> headersMap = prepareHeadersMap(userId);
- headersMap.remove("USER_ID");
- Gson gson = new Gson();
- String userBodyJson = gson.toJson(categoryDataDefinition);
- HttpRequest http = new HttpRequest();
- // System.out.println(url);
- // System.out.println(userBodyJson);
- RestResponse deleteCategotyResponse = http.httpSendDelete(url, headersMap);
- return deleteCategotyResponse;
- }
-
- public static RestResponse createGrouping(GroupingDefinition grouping, SubCategoryDefinition subCategory,
- CategoryDefinition parentCategory, User sdncModifierDetails, String categoryType) throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.CREATE_GROUPING, config.getCatalogBeHost(), config.getCatalogBePort(),
- categoryType, parentCategory.getUniqueId(), subCategory.getUniqueId());
- String bodyJson = gson.toJson(grouping);
- RestResponse addGroupingResponse = BaseRestUtils.sendPost(url, bodyJson, sdncModifierDetails.getUserId(),
- acceptHeaderData);
- return addGroupingResponse;
- }
-
- public static RestResponse importCategories(MultipartEntityBuilder mpBuilder, String userId) throws IOException {
- Config config = Utils.getConfig();
- String url = String.format(Urls.IMPORT_CATEGORIES, config.getCatalogBeHost(), config.getCatalogBePort());
-
- RestResponse importResponse = BaseRestUtils.sendPost(url, mpBuilder.build(), userId, acceptHeaderData);
- return importResponse;
- }
-
- public static int getMatchingCategoriesNum(RestResponse getAllCategoryRest, CategoryDefinition categoryDefinition) {
- String response = getAllCategoryRest.getResponse();
- Gson gson = new Gson();
- List<CategoryDefinition> categoryDefinitions = gson.fromJson(response,
- new TypeToken<List<CategoryDefinition>>() {
- }.getType());
- int categoriesNum = 0;
- String catName = categoryDefinition.getName();
- for (CategoryDefinition elem : categoryDefinitions) {
- if (elem.getName().equals(catName)) {
- categoryDefinition.setUniqueId(elem.getUniqueId());
- categoriesNum++;
- }
- }
-
- return categoriesNum;
- }
-
- public static int getMatchingSubCategoriesNum(RestResponse getAllCategoryRest, String parentCategoryId,
- SubCategoryDefinition expectedSubCategoryDefinition) {
-
- String response = getAllCategoryRest.getResponse();
- Gson gson = new Gson();
- List<CategoryDefinition> categoryDefinitions = gson.fromJson(response,
- new TypeToken<List<CategoryDefinition>>() {
- }.getType());
- int subCatNum = 0;
- String subCatName = expectedSubCategoryDefinition.getName();
- for (CategoryDefinition elem : categoryDefinitions) {
- if (elem.getUniqueId().equals(parentCategoryId)) {
- List<SubCategoryDefinition> subCategories = elem.getSubcategories();
- if (subCategories != null) {
- for (SubCategoryDefinition subCategoryDataDefinition : subCategories) {
- if (subCatName.equals(subCategoryDataDefinition.getName())) {
- expectedSubCategoryDefinition.setUniqueId(subCategoryDataDefinition.getUniqueId());
- subCatNum++;
- }
- }
- }
-
- }
- }
- return subCatNum;
- }
-
- public static int getMatchingGroupingNum(RestResponse getAllCategoryRest, String parentCategoryId,
- String subCategoryId, GroupingDefinition expectedGroupingDefinition) {
-
- String response = getAllCategoryRest.getResponse();
- Gson gson = new Gson();
- List<CategoryDefinition> categoryDefinitions = gson.fromJson(response,
- new TypeToken<List<CategoryDefinition>>() {
- }.getType());
- int groupingNum = 0;
- String groupingName = expectedGroupingDefinition.getName();
- for (CategoryDefinition elem : categoryDefinitions) {
- if (elem.getUniqueId().equals(parentCategoryId)) {
- List<SubCategoryDefinition> subCategories = elem.getSubcategories();
- if (subCategories != null) {
- for (SubCategoryDefinition subCategoryDataDefinition : subCategories) {
- // if
- // (subCategoryId.equals(subCategoryDataDefinition.getUniqueId()))
- // {
- if (subCategoryId.equals(subCategoryDataDefinition.getUniqueId())
- && subCategoryDataDefinition.getGroupings() != null) {
- List<GroupingDefinition> grouping = subCategoryDataDefinition.getGroupings();
- for (GroupingDefinition groupingDataDefinition : grouping) {
- if (groupingName.equals(groupingDataDefinition.getName())) {
- expectedGroupingDefinition.setUniqueId(groupingDataDefinition.getUniqueId());
- groupingNum++;
- }
- }
-
- }
- }
- }
-
- }
- }
- return groupingNum;
- }
-
- public enum CategoryAuditJsonKeysEnum {
- ACTION("ACTION"), MODIFIER("MODIFIER"), CATEGORY_NAME("CATEGORY_NAME"), SUB_CATEGORY_NAME("SUB_CATEGORY_NAME"), GROUPING_NAME("GROUPING_NAME"), RESOURCE_TYPE("RESOURCE_TYPE"), ECOMP_USER("ECOMP_USER"), STATUS("STATUS"), DESCRIPTION("DESCRIPTION"), DETAILS("DETAILS");
-
- private String auditJsonKeyName;
-
- private CategoryAuditJsonKeysEnum(String auditJsonKeyName) {
- this.auditJsonKeyName = auditJsonKeyName;
- }
-
- public String getAuditJsonKeyName() {
- return auditJsonKeyName.toLowerCase();
- }
- }
-
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ComponentInstanceRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ComponentInstanceRestUtils.java
deleted file mode 100644
index 7cc06de1d8..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ComponentInstanceRestUtils.java
+++ /dev/null
@@ -1,282 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.rest;
-
-import com.google.gson.Gson;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.model.*;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import static org.testng.Assert.assertTrue;
-
-public class ComponentInstanceRestUtils extends BaseRestUtils {
-// public static String acceptHeaderDate = "application/json";
- static Config config = Config.instance();
- public static Gson gson = new Gson();
-
- // 'componentType' can be 'services' or 'resources'
-
- public static RestResponse createComponentInstance(ComponentInstanceReqDetails componentInstanceReqDetails,
- User sdncModifierDetails, Component component) throws Exception {
- return createComponentInstance(componentInstanceReqDetails, sdncModifierDetails, component.getUniqueId(),
- component.getComponentType());
- }
-
- public static RestResponse createComponentInstance(ComponentInstanceReqDetails componentInstanceReqDetails,
- User sdncModifierDetails, String componentId, ComponentTypeEnum componentType) throws Exception {
-
- return createComponentInstance(componentInstanceReqDetails, sdncModifierDetails, componentId,
- ComponentTypeEnum.findParamByType(componentType));
- }
-
- public static RestResponse createComponentInstance(ComponentInstanceReqDetails componentInstanceReqDetails,
- User sdncModifierDetails, String componentId, String componentType) throws Exception {
- Config config = Utils.getConfig();
- String userId = sdncModifierDetails.getUserId();
- String serviceBodyJson = gson.toJson(componentInstanceReqDetails);
- String url = String.format(Urls.CREATE_COMPONENT_INSTANCE, config.getCatalogBeHost(), config.getCatalogBePort(),
- componentType, componentId);
- RestResponse createResourceInstance = sendPost(url, serviceBodyJson, userId, acceptHeaderData);
- if (createResourceInstance.getErrorCode().equals(BaseRestUtils.STATUS_CODE_CREATED)) {
- String uniqueId = ResponseParser.getValueFromJsonResponse(createResourceInstance.getResponse(), "uniqueId");
- componentInstanceReqDetails.setUniqueId(uniqueId);
- // Gson gson = new Gson();
- // ResourceInstanceReqDetails fromJson =
- // gson.fromJson(createResourceInstance.getResponse(),
- // ResourceInstanceReqDetails.class);
- // componentInstanceReqDetails.setUniqueId(fromJson.getUniqueId());
- }
- return createResourceInstance;
- }
-
- public static RestResponse getComponentInstances(ComponentTypeEnum type, String componentId, User user)
- throws IOException {
-
- Config config = Utils.getConfig();
-
- Map<String, String> headersMap = new HashMap<>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderData);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), user.getUserId());
-
- String url = String.format(Urls.GET_COMPONENT_INSTANCES, config.getCatalogBeHost(), config.getCatalogBePort(),
- ComponentTypeEnum.findParamByType(type), componentId);
-
- RestResponse sendGetServerRequest = sendGet(url, user.getUserId(), headersMap);
-
- return sendGetServerRequest;
-
- }
-
- public static RestResponse deleteComponentInstance(User sdncModifierDetails, String componentId,
- String resourceInstanceId, ComponentTypeEnum componentType) throws Exception {
-
- return deleteComponentInstance(sdncModifierDetails, componentId, resourceInstanceId,
- ComponentTypeEnum.findParamByType(componentType));
- }
-
- public static RestResponse deleteComponentInstance(User sdncModifierDetails, String componentId,
- String resourceInstanceId, String componentTypeString) throws Exception {
- Config config = Utils.getConfig();
- String userId = sdncModifierDetails.getUserId();
- String url = String.format(Urls.DELETE_COMPONENT_INSTANCE, config.getCatalogBeHost(), config.getCatalogBePort(),
- componentTypeString, componentId, resourceInstanceId);
- RestResponse sendCreateUserRequest = sendDelete(url, userId);
- return sendCreateUserRequest;
- }
-
- public static RestResponse updateComponentInstance(ComponentInstanceReqDetails componentInstanceReqDetails,
- User sdncModifierDetails, String componentId, ComponentTypeEnum componentType) throws IOException {
-
- Config config = Utils.getConfig();
- String userId = sdncModifierDetails.getUserId();
- String serviceBodyJson = gson.toJson(componentInstanceReqDetails);
- String url = String.format(Urls.UPDATE_COMPONENT_INSTANCE, config.getCatalogBeHost(), config.getCatalogBePort(),
- ComponentTypeEnum.findParamByType(componentType), componentId,
- componentInstanceReqDetails.getUniqueId());
- RestResponse updateResourceInstance = sendPost(url, serviceBodyJson, userId, acceptHeaderData);
- return updateResourceInstance;
- }
-
- //Tal G - CI for New API Multiple Instance Update
- public static RestResponse updateMultipleComponentInstance(
- List<ComponentInstanceReqDetails> componentInstanceReqDetailsList, User sdncModifierDetails,
- String componentId, ComponentTypeEnum componentType) throws IOException {
- Config config = Utils.getConfig();
- String userId = sdncModifierDetails.getUserId();
- String serviceBodyJson = gson.toJson(componentInstanceReqDetailsList.toArray());
- String url = String.format(Urls.UPDATE_MULTIPLE_COMPONENT_INSTANCE, config.getCatalogBeHost(),
- config.getCatalogBePort(), ComponentTypeEnum.findParamByType(componentType), componentId);
- RestResponse updateResourceInstance = sendPost(url, serviceBodyJson, userId, acceptHeaderData);
- return updateResourceInstance;
- }
-
- public static RestResponse associateInstances(RequirementCapabilityRelDef relation, User sdncModifierDetails,
- String componentId, ComponentTypeEnum componentTypeEnum) throws IOException {
-
- Config config = Utils.getConfig();
-
- String componentType = "";
- switch (componentTypeEnum) {
- case RESOURCE:
- componentType = ComponentTypeEnum.RESOURCE_PARAM_NAME;
- break;
- case SERVICE:
- componentType = ComponentTypeEnum.SERVICE_PARAM_NAME;
- break;
- default:
- break;
- }
- String serviceBodyJson = gson.toJson(relation);
- String url = String.format(Urls.ASSOCIATE__RESOURCE_INSTANCE, config.getCatalogBeHost(),
- config.getCatalogBePort(), componentType, componentId);
-
- RestResponse associateInstance = sendPost(url, serviceBodyJson, sdncModifierDetails.getUserId(),
- acceptHeaderData);
- return associateInstance;
-
- }
-
- public static RestResponse dissociateInstances(RequirementCapabilityRelDef relation, User sdncModifierDetails,
- String componentId, ComponentTypeEnum componentTypeEnum) throws IOException {
-
- Config config = Utils.getConfig();
-
- String componentType = "";
- switch (componentTypeEnum) {
- case RESOURCE:
- componentType = ComponentTypeEnum.RESOURCE_PARAM_NAME;
- break;
- case SERVICE:
- componentType = ComponentTypeEnum.SERVICE_PARAM_NAME;
- break;
- default:
- break;
- }
- String serviceBodyJson = gson.toJson(relation);
- String url = String.format(Urls.DISSOCIATE__RESOURCE_INSTANCE, config.getCatalogBeHost(),
- config.getCatalogBePort(), componentType, componentId);
-
- RestResponse associateInstance = sendPut(url, serviceBodyJson, sdncModifierDetails.getUserId(),
- acceptHeaderData);
- return associateInstance;
-
- }
-
- public static void checkComponentInstanceType(RestResponse response, String expectedComponentType) {
- String actualComponentType = ResponseParser.getComponentTypeFromResponse(response);
- assertTrue(expectedComponentType.equals(actualComponentType),
- "Failed. expected: " + expectedComponentType + ", actual: " + actualComponentType + "/");
- }
-
- public static RestResponse updatePropertyValueOnResourceInstance(Component component, ComponentInstance instDetails,
- User user, ComponentInstanceProperty updatedInstanceProperty) throws IOException {
-
- Config config = Utils.getConfig();
-
- Map<String, String> headersMap = new HashMap<>();
-
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderData);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), user.getUserId());
-
- String url = String.format(Urls.UPDATE_PROPERTY_TO_RESOURCE_INSTANCE, config.getCatalogBeHost(),
- config.getCatalogBePort(), ComponentTypeEnum.findParamByType(component.getComponentType()),
- component.getUniqueId(), instDetails.getUniqueId());
- String body = gson.toJson(updatedInstanceProperty);
-
- RestResponse sendGetServerRequest = sendPost(url, body, user.getUserId(), acceptHeaderData);
- return sendGetServerRequest;
-
- }
-
- public static RestResponse changeComponentInstanceVersion(Component container,
- ComponentInstance componentInstanceToReplace, Component newInstance, User sdncModifierDetails)
- throws Exception {
-
- return changeComponentInstanceVersion(container.getUniqueId(), componentInstanceToReplace, newInstance,
- sdncModifierDetails, container.getComponentType());
- }
-
- public static RestResponse changeComponentInstanceVersion(String containerUID,
- ComponentInstance componentInstanceToReplace, Component component, User sdncModifierDetails,
- ComponentTypeEnum componentType) throws IOException {
-
- Config config = Utils.getConfig();
- String resourceUid = ("{\"componentUid\":\"" + component.getUniqueId() + "\"}");
- String url = String.format(Urls.CHANGE__RESOURCE_INSTANCE_VERSION, config.getCatalogBeHost(),
- config.getCatalogBePort(), ComponentTypeEnum.findParamByType(componentType), containerUID,
- componentInstanceToReplace.getUniqueId());
- RestResponse changeResourceInstanceVersion = sendPost(url, resourceUid, sdncModifierDetails.getUserId(),
- acceptHeaderData);
-
- if (changeResourceInstanceVersion.getErrorCode() == 200
- || changeResourceInstanceVersion.getErrorCode() == 201) {
- Gson gson = new Gson();
- // ResourceInstanceReqDetails
- // convertResourceInstanceResponseToJavaObject =
- // ResponseParser.convertResourceInstanceResponseToJavaObject(createResourceInstance.getResponse());
- ComponentInstanceReqDetails fromJson = gson.fromJson(changeResourceInstanceVersion.getResponse(),
- ComponentInstanceReqDetails.class);
-
- componentInstanceToReplace.setUniqueId(fromJson.getUniqueId());
-
- }
-
- return changeResourceInstanceVersion;
-
- }
-
- public static RestResponse changeComponentInstanceVersion(String componentUniqueId,
- String serviceInstanceToReplaceUniqueId, String serviceUniqueId, User sdncModifierDetails,
- ComponentTypeEnum componentType) throws IOException {
- Config config = Utils.getConfig();
- String resourceUid = ("{\"componentUid\":\"" + serviceUniqueId + "\"}");
- String url = String.format(Urls.CHANGE__RESOURCE_INSTANCE_VERSION, config.getCatalogBeHost(),
- config.getCatalogBePort(), ComponentTypeEnum.findParamByType(componentType), componentUniqueId,
- serviceInstanceToReplaceUniqueId);
- RestResponse changeResourceInstanceVersion = sendPost(url, resourceUid, sdncModifierDetails.getUserId(),
- acceptHeaderData);
- return changeResourceInstanceVersion;
-
- }
- public static CapReqDef getInstancesCapabilitiesRequirements(Component component, String userId) throws Exception {
-
- String url = String.format(Urls.GET_INSTANCE_REQUIRMENTS_CAPABILITIES,
- Utils.getConfig().getCatalogBeHost(), Utils.getConfig().getCatalogBePort(),
- ComponentTypeEnum.findParamByType(component.getComponentType()), component.getUniqueId());
-
- RestResponse getComponentReqCap = sendGet(url, userId);
- assertTrue(getComponentReqCap.getErrorCode() == STATUS_CODE_GET_SUCCESS);
- return ResponseParser.parseToObject(getComponentReqCap.getResponse(), CapReqDef.class);
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ComponentRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ComponentRestUtils.java
deleted file mode 100644
index 8fcc67925a..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ComponentRestUtils.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.rest;
-
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.model.CapReqDef;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.ComponentReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ProductReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-
-import java.io.IOException;
-
-public class ComponentRestUtils extends BaseRestUtils {
- public static RestResponse getComponentRequirmentsCapabilities(User sdncModifierDetails,
- ComponentReqDetails componentReqDetails) throws IOException {
- Config config = Utils.getConfig();
- ComponentTypeEnum componentType = null;
- if (componentReqDetails instanceof ResourceReqDetails) {
- componentType = ComponentTypeEnum.RESOURCE;
- } else if (componentReqDetails instanceof ServiceReqDetails) {
- componentType = ComponentTypeEnum.SERVICE;
- } else if (componentReqDetails instanceof ProductReqDetails) {
- componentType = ComponentTypeEnum.PRODUCT;
- }
- String url = String.format(Urls.GET_COMPONENT_REQUIRMENTS_CAPABILITIES, config.getCatalogBeHost(),
- config.getCatalogBePort(), ComponentTypeEnum.findParamByType(componentType),
- componentReqDetails.getUniqueId());
- return sendGet(url, sdncModifierDetails.getUserId());
- }
-
- public static CapReqDef getAndParseComponentRequirmentsCapabilities(User user, ComponentReqDetails componentDetails)
- throws IOException {
- RestResponse getComponentReqCap = getComponentRequirmentsCapabilities(user, componentDetails);
- ResourceRestUtils.checkSuccess(getComponentReqCap);
- CapReqDef capReqDef = ResponseParser.parseToObject(getComponentReqCap.getResponse(), CapReqDef.class);
- return capReqDef;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ConsumerRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ConsumerRestUtils.java
deleted file mode 100644
index 5e35327305..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ConsumerRestUtils.java
+++ /dev/null
@@ -1,246 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.rest;
-
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.gson.Gson;
-import org.openecomp.sdc.be.datatypes.elements.ConsumerDataDefinition;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-
-import java.util.Map;
-
-import static org.testng.AssertJUnit.assertEquals;
-
-public class ConsumerRestUtils extends BaseRestUtils {
-
- public static final int STATUS_CODE_SUCCESS = 200;
- public static final int STATUS_CODE_CREATED = 201;
- public static final int STATUS_CODE_DELETE = 204;
- public static final int STATUS_CODE_NOT_FOUND = 404;
- Utils utils = new Utils();
- private static Long expectedsLastupdatedtime;
- private static Long expectedLastAuthenticationTime;
-
- public static RestResponse createConsumer(ConsumerDataDefinition consumerDataDefinition, User sdncModifierDetails)
- throws Exception {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.CREATE_CONSUMER, config.getCatalogBeHost(), config.getCatalogBePort());
-
- String userId = sdncModifierDetails.getUserId();
-
- Map<String, String> headersMap = prepareHeadersMap(userId);
-
- Gson gson = new Gson();
- String userBodyJson = gson.toJson(consumerDataDefinition);
-
- HttpRequest http = new HttpRequest();
- // System.out.println(url);
- // System.out.println(userBodyJson);
- RestResponse createConsumerResponse = http.httpSendPost(url, userBodyJson, headersMap);
- if (createConsumerResponse.getErrorCode() == STATUS_CODE_CREATED) {
- ConsumerDataDefinition getConsumerDataObject = parseComsumerResp(createConsumerResponse);
- consumerDataDefinition
- .setConsumerDetailsLastupdatedtime(getConsumerDataObject.getConsumerDetailsLastupdatedtime());
- consumerDataDefinition
- .setConsumerLastAuthenticationTime(getConsumerDataObject.getConsumerLastAuthenticationTime());
- consumerDataDefinition.setLastModfierAtuid(getConsumerDataObject.getLastModfierAtuid());
- }
- return createConsumerResponse;
- }
-
- public static RestResponse createConsumerHttpCspAtuUidIsMissing(ConsumerDataDefinition consumerDataDefinition,
- User sdncModifierDetails) throws Exception {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.CREATE_CONSUMER, config.getCatalogBeHost(), config.getCatalogBePort());
-
- String userId = sdncModifierDetails.getUserId();
- Map<String, String> headersMap = prepareHeadersMap(userId);
- headersMap.remove("USER_ID");
- Gson gson = new Gson();
- String userBodyJson = gson.toJson(consumerDataDefinition);
- HttpRequest http = new HttpRequest();
- // System.out.println(url);
- // System.out.println(userBodyJson);
- RestResponse createConsumerResponse = http.httpSendPost(url, userBodyJson, headersMap);
- if (createConsumerResponse.getErrorCode() == STATUS_CODE_CREATED) {
- ConsumerDataDefinition getConsumerDataObject = parseComsumerResp(createConsumerResponse);
- consumerDataDefinition
- .setConsumerDetailsLastupdatedtime(getConsumerDataObject.getConsumerDetailsLastupdatedtime());
- consumerDataDefinition
- .setConsumerLastAuthenticationTime(getConsumerDataObject.getConsumerLastAuthenticationTime());
- consumerDataDefinition.setLastModfierAtuid(getConsumerDataObject.getLastModfierAtuid());
- }
- return createConsumerResponse;
- }
-
- public static RestResponse deleteConsumerHttpCspAtuUidIsMissing(ConsumerDataDefinition consumerDataDefinition,
- User sdncModifierDetails) throws Exception {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.DELETE_CONSUMER, config.getCatalogBeHost(), config.getCatalogBePort(),
- consumerDataDefinition.getConsumerName());
-
- String userId = sdncModifierDetails.getUserId();
- Map<String, String> headersMap = prepareHeadersMap(userId);
- headersMap.remove("USER_ID");
- Gson gson = new Gson();
- String userBodyJson = gson.toJson(consumerDataDefinition);
- HttpRequest http = new HttpRequest();
- // System.out.println(url);
- // System.out.println(userBodyJson);
- RestResponse deleteConsumerResponse = http.httpSendDelete(url, headersMap);
- return deleteConsumerResponse;
- }
-
- public static ConsumerDataDefinition parseComsumerResp(RestResponse restResponse) throws Exception {
-
- String bodyToParse = restResponse.getResponse();
- ObjectMapper mapper = new ObjectMapper();
- mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- try {
- ConsumerDataDefinition component = mapper.readValue(bodyToParse, ConsumerDataDefinition.class);
- return component;
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- return null;
- }
-
- public static RestResponse deleteConsumer(ConsumerDataDefinition consumerDataDefinition, User sdncModifierDetails)
- throws Exception {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.DELETE_CONSUMER, config.getCatalogBeHost(), config.getCatalogBePort(),
- consumerDataDefinition.getConsumerName());
-
- String userId = sdncModifierDetails.getUserId();
-
- Map<String, String> headersMap = prepareHeadersMap(userId);
- HttpRequest http = new HttpRequest();
- // System.out.println(url);
- RestResponse deleteConsumerResponse = http.httpSendDelete(url, headersMap);
- return deleteConsumerResponse;
- }
-
- public static RestResponse getConsumer(ConsumerDataDefinition consumerDataDefinition, User sdncModifierDetails)
- throws Exception {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_CONSUMER, config.getCatalogBeHost(), config.getCatalogBePort(),
- consumerDataDefinition.getConsumerName());
-
- String userId = sdncModifierDetails.getUserId();
-
- Map<String, String> headersMap = prepareHeadersMap(userId);
- HttpRequest http = new HttpRequest();
- // System.out.println(url);
- RestResponse getConsumerResponse = http.httpSendGet(url, headersMap);
- return getConsumerResponse;
- }
-
- public static void validateConsumerReqVsResp(ConsumerDataDefinition consumerDefinition,
- ConsumerDataDefinition getConsumerDataObject) {
-
- String expected;
-
- expected = consumerDefinition.getConsumerName();
- assertEquals("consumer name - ", expected, getConsumerDataObject.getConsumerName());
-
- expected = consumerDefinition.getConsumerPassword().toLowerCase();
- assertEquals("consumer password - ", expected, getConsumerDataObject.getConsumerPassword());
-
- expected = consumerDefinition.getLastModfierAtuid();
- assertEquals("consumer Last Modfier Atuid - ", expected, getConsumerDataObject.getLastModfierAtuid());
-
- expected = consumerDefinition.getConsumerSalt();
- assertEquals("consumer Salt - ", expected, getConsumerDataObject.getConsumerSalt());
-
- expectedsLastupdatedtime = consumerDefinition.getConsumerDetailsLastupdatedtime();
- assertEquals("consumer Last updated time - ", expectedsLastupdatedtime,
- getConsumerDataObject.getConsumerDetailsLastupdatedtime());
-
- expectedLastAuthenticationTime = consumerDefinition.getConsumerLastAuthenticationTime();
- assertEquals("consumer Last authentication time - ", expectedLastAuthenticationTime,
- getConsumerDataObject.getConsumerLastAuthenticationTime());
- }
-
- ///// New
- public enum EcompConsumerAuditJsonKeysEnum {
- ACTION("ACTION"), MODIFIER("MODIFIER"), ECOMP_USER("ECOMP_USER"), STATUS("STATUS"), DESC("DESCRIPTION");
- private String auditJsonKeyName;
-
- private EcompConsumerAuditJsonKeysEnum(String auditJsonKeyName) {
- this.auditJsonKeyName = auditJsonKeyName;
- }
-
- public String getAuditJsonKeyName() {
- return auditJsonKeyName.toLowerCase();
- }
- }
-
- /*
- * protected void resourceArtifatAuditSuccess(String action,
- * ArtifactReqDetails artifact, ResourceReqDetails resourceDetails , User
- * user) throws Exception { ExpectedResourceAuditJavaObject
- * expectedResourceAuditJavaObject =
- * Convertor.constructFieldsForAuditValidation(resourceDetails,
- * resourceDetails.getVersion(), user); String auditAction = action;
- * expectedResourceAuditJavaObject.setAction(auditAction);
- * expectedResourceAuditJavaObject.setPrevState("");
- * expectedResourceAuditJavaObject.setPrevVersion("");
- * expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.
- * NOT_CERTIFIED_CHECKOUT).toString());
- * expectedResourceAuditJavaObject.setStatus("200");
- * expectedResourceAuditJavaObject.setDesc("OK");
- * expectedResourceAuditJavaObject.setArtifactName(artifact.getArtifactName(
- * )); AuditUtils.validateAudit(expectedResourceAuditJavaObject,
- * auditAction, null); }
- */
-
- /*
- * protected void resourceArtifatValidateAuditWithErrorMessage(String
- * actionStatus, ResourceReqDetails resourceDetails, String auditAction,
- * String setCurrState, Object ... variables)throws Exception { ErrorInfo
- * errorInfo = utils.parseYaml(actionStatus);
- * ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject =
- * Convertor.constructFieldsForAuditValidation(resourceDetails,
- * resourceDetails.getVersion(), sdncUserDetails);
- * expectedResourceAuditJavaObject.setAction(auditAction);
- * expectedResourceAuditJavaObject.setPrevState("");
- * expectedResourceAuditJavaObject.setPrevVersion("");
- * expectedResourceAuditJavaObject.setCurrState(setCurrState);
- * expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString())
- * ;
- * expectedResourceAuditJavaObject.setDesc(errorInfo.getAuditDesc(variables)
- * ); expectedResourceAuditJavaObject.setArtifactName("");
- * AuditUtils.validateAudit(expectedResourceAuditJavaObject, auditAction,
- * null); }
- */
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/EcompUserRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/EcompUserRestUtils.java
deleted file mode 100644
index b3a25fd3a0..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/EcompUserRestUtils.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.rest;
-
-import com.google.gson.Gson;
-import org.onap.portalsdk.core.restful.domain.EcompRole;
-import org.onap.portalsdk.core.restful.domain.EcompUser;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.run.StartTest;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class EcompUserRestUtils extends BaseRestUtils {
-
- static Gson gson = new Gson();
-
- static Logger logger = LoggerFactory.getLogger(EcompUserRestUtils.class.getName());
- static String ecompUsername = "12345";
- static String ecompPassword = "12345";
-
- public EcompUserRestUtils() {
- super();
-
- StartTest.enableLogger();
- }
-
- public static RestResponse pushUser(EcompUser ecompUser) throws IOException {
- Config config = Utils.getConfig();
-
- Map<String, String> headersMap = new HashMap<>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), BaseRestUtils.contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), BaseRestUtils.acceptHeaderData);
- headersMap.put(HttpHeaderEnum.ECOMP_USERNAME.getValue(), ecompUsername);
- headersMap.put(HttpHeaderEnum.ECOMP_PASSWORD.getValue(), ecompPassword);
-
- String userBodyJson = gson.toJson(ecompUser);
-
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.ECOMP_PUSH_USER, config.getCatalogBeHost(), config.getCatalogBePort());
-
- logger.debug("Send POST request to create user: {}", url);
- logger.debug("User body: {}", userBodyJson);
- logger.debug("User headers: {}", headersMap);
-
- RestResponse sendPushUserResponse = http.httpSendPost(url, userBodyJson, headersMap);
-
- return sendPushUserResponse;
- }
-
- /*
- * loginId - equals to userId
- */
- public static RestResponse editUser(String loginId, EcompUser ecompUser) throws IOException {
- Config config = Utils.getConfig();
-
- Map<String, String> headersMap = new HashMap<>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), BaseRestUtils.contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), BaseRestUtils.acceptHeaderData);
- headersMap.put(HttpHeaderEnum.ECOMP_USERNAME.getValue(), ecompUsername);
- headersMap.put(HttpHeaderEnum.ECOMP_PASSWORD.getValue(), ecompPassword);
-
- String userBodyJson = gson.toJson(ecompUser);
-
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.ECOMP_EDIT_USER, config.getCatalogBeHost(), config.getCatalogBePort(), loginId);
-
- logger.debug("Send POST request to edit user: {}", url);
- logger.debug("User body: {}", userBodyJson);
- logger.debug("User headers: {}", headersMap);
-
- RestResponse sendEditUserResponse = http.httpSendPost(url, userBodyJson, headersMap);
-
- return sendEditUserResponse;
- }
-
- /*
- * loginId - equals to userId
- */
- public static RestResponse getUser(String loginId) throws IOException {
- Config config = Utils.getConfig();
-
- Map<String, String> headersMap = new HashMap<>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), BaseRestUtils.contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), BaseRestUtils.acceptHeaderData);
- headersMap.put(HttpHeaderEnum.ECOMP_USERNAME.getValue(), ecompUsername);
- headersMap.put(HttpHeaderEnum.ECOMP_PASSWORD.getValue(), ecompPassword);
-
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.ECOMP_GET_USER, config.getCatalogBeHost(), config.getCatalogBePort(), loginId);
-
- logger.debug("Send GET request to get user: {}", url);
- logger.debug("User headers: {}", headersMap);
-
- RestResponse sendGetUserRequest = http.httpSendGet(url, headersMap);
-
- return sendGetUserRequest;
- }
-
- public static RestResponse getAllUsers() throws IOException {
- Config config = Utils.getConfig();
-
- Map<String, String> headersMap = new HashMap<>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), BaseRestUtils.contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), BaseRestUtils.acceptHeaderData);
- headersMap.put(HttpHeaderEnum.ECOMP_USERNAME.getValue(), ecompUsername);
- headersMap.put(HttpHeaderEnum.ECOMP_PASSWORD.getValue(), ecompPassword);
-
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.ECOMP_GET_ALL_USERS, config.getCatalogBeHost(), config.getCatalogBePort());
-
- logger.debug("Send POST request to get all users: {}", url);
- logger.debug("User headers: {}", headersMap);
-
- RestResponse sendGetAllUsersRequest = http.httpSendGet(url, headersMap);
-
- return sendGetAllUsersRequest;
- }
-
- public static RestResponse getAllAvailableRoles() throws IOException {
- Config config = Utils.getConfig();
-
- Map<String, String> headersMap = new HashMap<>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), BaseRestUtils.contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), BaseRestUtils.acceptHeaderData);
- headersMap.put(HttpHeaderEnum.ECOMP_USERNAME.getValue(), ecompUsername);
- headersMap.put(HttpHeaderEnum.ECOMP_PASSWORD.getValue(), ecompPassword);
-
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.ECOMP_GET_ALL_AVAILABLE_ROLES, config.getCatalogBeHost(),
- config.getCatalogBePort());
-
- logger.debug("Send GET request to get all available roles: {}", url);
- logger.debug("User headers: {}", headersMap);
-
- RestResponse sendUpdateUserRequest = http.httpSendGet(url, headersMap);
-
- return sendUpdateUserRequest;
- }
-
- /*
- * loginId - equals to userId
- */
- public static RestResponse pushUserRoles(String loginId, List<EcompRole> roles) throws IOException {
- Config config = Utils.getConfig();
-
- Map<String, String> headersMap = new HashMap<>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), BaseRestUtils.contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), BaseRestUtils.acceptHeaderData);
- headersMap.put(HttpHeaderEnum.ECOMP_USERNAME.getValue(), ecompUsername);
- headersMap.put(HttpHeaderEnum.ECOMP_PASSWORD.getValue(), ecompPassword);
-
- String roleBodyJson = gson.toJson(roles);
- if(roleBodyJson.equals("[{}]")) {
- roleBodyJson = "[]";
- }
-
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.ECOMP_PUSH_USER_ROLES, config.getCatalogBeHost(), config.getCatalogBePort(),
- loginId);
-
- logger.debug("Send POST request to push user role: {}", url);
- logger.debug("Roles body: {}", roleBodyJson);
- logger.debug("Request headers: {}", headersMap);
-
- RestResponse sendpushUserRolesResponse = http.httpSendPost(url, roleBodyJson, headersMap);
-
- return sendpushUserRolesResponse;
- }
-
- /*
- * loginId - equals to userId
- */
- public static RestResponse getUserRoles(String loginId) throws IOException {
- Config config = Utils.getConfig();
-
- Map<String, String> headersMap = new HashMap<>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), BaseRestUtils.contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), BaseRestUtils.acceptHeaderData);
- headersMap.put(HttpHeaderEnum.ECOMP_USERNAME.getValue(), ecompUsername);
- headersMap.put(HttpHeaderEnum.ECOMP_PASSWORD.getValue(), ecompPassword);
-
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.ECOMP_GET_USER_ROLES, config.getCatalogBeHost(), config.getCatalogBePort(),
- loginId);
-
- logger.debug("Send GET request to get user roles: {}", url);
- logger.debug("User headers: {}", headersMap);
-
- RestResponse sendGetUserRolesRequest = http.httpSendGet(url, headersMap);
-
- return sendGetUserRolesRequest;
- }
-
- // TODO !!!!!!!!!!!!!!
- /*
- * Ask Eli if implementation of users is needed DELETE ECOMP USER
- */
-
- /*
- * public static void main(String[] args) { EcompUser ecompUser = new
- * EcompUser(); ecompUser.setFirstName("Test");
- * ecompUser.setLastName("Testovich");
- * ecompUser.setActive(true);
- *
- * EcompRole roleToUpdate = new EcompRole(); roleToUpdate.setId(new
- * Long(6)); roleToUpdate.setName("PRODUCT_STRATEGIST"); List<EcompRole>
- * listOfRoles = new LinkedList<>(); listOfRoles.add(roleToUpdate);
- *
- * try {
- * System.out.println("\n-----------------------------\n Testing pushUser");
- * System.out.println(pushUser(ecompUser));
- * System.out.println("\n-----------------------------\n Testing editUser");
- * System.out.println("\n-----------------------------\n Testing getUser");
- * // System.out.println(getUser(ecompUser.getLoginId())); System.out.
- * println("\n-----------------------------\n Testing getAllUsers"); //
- * System.out.println(getAllUsers()); System.out.
- * println("\n-----------------------------\n Testing getAllAvailableRoles"
- * ); // System.out.println(getAllAvailableRoles().toString()); System.out.
- * println("\n-----------------------------\n Testing pushUserRoles");
- * TODO Auto-generated catch block e.printStackTrace(); } }
- */
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/GroupRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/GroupRestUtils.java
deleted file mode 100644
index e491b3bd17..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/GroupRestUtils.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.rest;
-
-import com.google.gson.Gson;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.model.Component;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-public class GroupRestUtils extends BaseRestUtils {
- static Config config = Config.instance();
- public static Gson gson = new Gson();
-
- public static RestResponse getGroupById(Component component, String groupId, User user) throws IOException {
-
- Config config = Utils.getConfig();
-
- Map<String, String> headersMap = new HashMap<>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderData);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), user.getUserId());
-
- String url = String.format(Urls.GET_GROUP_BY_ID, config.getCatalogBeHost(), config.getCatalogBePort(),
- ComponentTypeEnum.findParamByType(component.getComponentType()), component.getUniqueId(), groupId);
-
- RestResponse sendGetServerRequest = sendGet(url, user.getUserId(), headersMap);
-
- return sendGetServerRequest;
-
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ImportRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ImportRestUtils.java
deleted file mode 100644
index 0edc294693..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ImportRestUtils.java
+++ /dev/null
@@ -1,392 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.rest;
-
-import org.apache.commons.io.IOUtils;
-import org.apache.http.HttpEntity;
-import org.apache.http.client.ClientProtocolException;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.entity.ContentType;
-import org.apache.http.entity.mime.MultipartEntityBuilder;
-import org.apache.http.entity.mime.content.FileBody;
-import org.apache.http.entity.mime.content.StringBody;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClients;
-import org.codehaus.jettison.json.JSONException;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ImportTestTypesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
-import org.openecomp.sdc.common.http.client.api.HttpResponse;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.*;
-import java.nio.file.FileSystems;
-import java.nio.file.Files;
-import java.util.*;
-
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertNotNull;
-
-public class ImportRestUtils extends BaseRestUtils {
-
- private static Logger log = LoggerFactory.getLogger(ImportRestUtils.class.getName());
- private static Properties downloadCsarHeaders = new Properties();
-
- static {
- downloadCsarHeaders.put("Accept", "application/octet-stream");
- }
-
- @SuppressWarnings("unused")
- private static Integer importNormativeResource(NormativeTypesEnum resource, UserRoleEnum userRole)
- throws IOException {
- Config config = Utils.getConfig();
- CloseableHttpResponse response = null;
- MultipartEntityBuilder mpBuilder = MultipartEntityBuilder.create();
-
- mpBuilder.addPart("resourceZip", new FileBody(getTestZipFile(resource.getFolderName())));
- mpBuilder.addPart("resourceMetadata",
- new StringBody(getTestJsonStringOfFile(resource.getFolderName(), resource.getFolderName() + ".json"),
- ContentType.APPLICATION_JSON));
-
- String url = String.format(Urls.IMPORT_RESOURCE_NORMATIVE, config.getCatalogBeHost(),
- config.getCatalogBePort());
-
- CloseableHttpClient client = HttpClients.createDefault();
- try {
- HttpPost httpPost = new HttpPost(url);
- httpPost.addHeader("USER_ID", userRole.getUserId());
- httpPost.setEntity(mpBuilder.build());
- response = client.execute(httpPost);
- return response.getStatusLine().getStatusCode();
- } finally {
- closeResponse(response);
- closeHttpClient(client);
-
- }
- }
-
- /*
- * public static RestResponse importResourceByName(String resourceName, User
- * user) throws IOException { Config config = Utils.getConfig();
- * CloseableHttpResponse response = null; MultipartEntityBuilder mpBuilder =
- * MultipartEntityBuilder.create();
- *
- * mpBuilder.addPart("resourceZip", new
- * FileBody(getTestZipFile(resourceName)));
- * mpBuilder.addPart("resourceMetadata", new
- * StringBody(getTestJsonStringOfFile(resourceName, resourceName + ".json"),
- * ContentType.APPLICATION_JSON));
- *
- * String url = String.format(Urls.IMPORT_RESOURCE_NORMATIVE,
- * config.getCatalogBeHost(), config.getCatalogBePort());
- *
- * CloseableHttpClient client = HttpClients.createDefault(); try { HttpPost
- * httpPost = new HttpPost(url); RestResponse restResponse = new
- * RestResponse(); httpPost.addHeader("USER_ID", user.getUserId());
- * httpPost.setEntity(mpBuilder.build()); response =
- * client.execute(httpPost); HttpEntity entity = response.getEntity();
- * String responseBody = null; if (entity != null) { InputStream instream =
- * entity.getContent(); StringWriter writer = new StringWriter();
- * IOUtils.copy(instream, writer); responseBody = writer.toString(); try {
- *
- * } finally { instream.close(); } }
- *
- * restResponse.setErrorCode(response.getStatusLine().getStatusCode());
- * restResponse.setResponse(responseBody); if (restResponse.getErrorCode()
- * == STATUS_CODE_CREATED ){
- *
- * }
- *
- * return restResponse;
- *
- * } finally { closeResponse(response); closeHttpClient(client);
- *
- * }
- *
- * }
- */
-
- public static RestResponse importResourceByName(ResourceReqDetails resourceDetails, User importer)
- throws Exception {
- Config config = Utils.getConfig();
- CloseableHttpResponse response = null;
- MultipartEntityBuilder mpBuilder = MultipartEntityBuilder.create();
-
- mpBuilder.addPart("resourceZip", new FileBody(getTestZipFile(resourceDetails.getName())));
- mpBuilder.addPart("resourceMetadata",
- new StringBody(getTestJsonStringOfFile(resourceDetails.getName(), resourceDetails.getName() + ".json"),
- ContentType.APPLICATION_JSON));
-
- String url = String.format(Urls.IMPORT_RESOURCE_NORMATIVE, config.getCatalogBeHost(),
- config.getCatalogBePort());
-
- CloseableHttpClient client = HttpClients.createDefault();
- try {
- HttpPost httpPost = new HttpPost(url);
- RestResponse restResponse = new RestResponse();
- httpPost.addHeader("USER_ID", importer.getUserId());
- httpPost.setEntity(mpBuilder.build());
- response = client.execute(httpPost);
- HttpEntity entity = response.getEntity();
- String responseBody = null;
- if (entity != null) {
- InputStream instream = entity.getContent();
- StringWriter writer = new StringWriter();
- IOUtils.copy(instream, writer);
- responseBody = writer.toString();
- try {
-
- } finally {
- instream.close();
- }
- }
-
- restResponse.setErrorCode(response.getStatusLine().getStatusCode());
- restResponse.setResponse(responseBody);
-
- if (restResponse.getErrorCode() == STATUS_CODE_CREATED) {
- resourceDetails.setUUID(ResponseParser.getUuidFromResponse(restResponse));
- resourceDetails.setUniqueId(ResponseParser.getUniqueIdFromResponse(restResponse));
- resourceDetails.setVersion(ResponseParser.getVersionFromResponse(restResponse));
- resourceDetails.setCreatorUserId(importer.getUserId());
- resourceDetails.setCreatorFullName(importer.getFullName());
- }
-
- return restResponse;
-
- } finally {
- closeResponse(response);
- closeHttpClient(client);
-
- }
-
- }
-
- public static RestResponse importNewResourceByName(String resourceName, UserRoleEnum userRole) throws IOException {
- Config config = Utils.getConfig();
-
- MultipartEntityBuilder mpBuilder = MultipartEntityBuilder.create();
-
- mpBuilder.addPart("resourceZip", new FileBody(getTestZipFile(resourceName)));
- mpBuilder.addPart("resourceMetadata", new StringBody(
- getTestJsonStringOfFile(resourceName, resourceName + ".json"), ContentType.APPLICATION_JSON));
- HttpEntity requestEntity = mpBuilder.build();
- String url = String.format(Urls.IMPORT_USER_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort());
- Map<String, String> headers = new HashMap<String, String>();
- headers.put("USER_ID", userRole.getUserId());
-
- return HttpRequest.sendHttpPostWithEntity(requestEntity, url, headers);
- }
-
- public static RestResponse importNormativeResourceByName(String resourceName, UserRoleEnum userRole)
- throws IOException {
- Config config = Utils.getConfig();
-
- MultipartEntityBuilder mpBuilder = MultipartEntityBuilder.create();
-
- mpBuilder.addPart("resourceZip", new FileBody(getTestZipFile(resourceName)));
- mpBuilder.addPart("resourceMetadata", new StringBody(
- getTestJsonStringOfFile(resourceName, resourceName + ".json"), ContentType.APPLICATION_JSON));
- HttpEntity requestEntity = mpBuilder.build();
- String url = String.format(Urls.IMPORT_RESOURCE_NORMATIVE, config.getCatalogBeHost(),
- config.getCatalogBePort());
- Map<String, String> headers = new HashMap<String, String>();
- headers.put("USER_ID", userRole.getUserId());
-
- return HttpRequest.sendHttpPostWithEntity(requestEntity, url, headers);
- }
-
- public static RestResponse importTestResource(ImportTestTypesEnum resource, UserRoleEnum userRole)
- throws IOException {
- Config config = Utils.getConfig();
- CloseableHttpResponse response = null;
- MultipartEntityBuilder mpBuilder = MultipartEntityBuilder.create();
-
- mpBuilder.addPart("resourceZip", new FileBody(getTestZipFile(resource.getFolderName())));
- mpBuilder.addPart("resourceMetadata",
- new StringBody(getTestJsonStringOfFile(resource.getFolderName(), resource.getFolderName() + ".json"),
- ContentType.APPLICATION_JSON));
-
- String url = String.format(Urls.IMPORT_RESOURCE_NORMATIVE, config.getCatalogBeHost(),
- config.getCatalogBePort());
-
- CloseableHttpClient client = HttpClients.createDefault();
- try {
- HttpPost httpPost = new HttpPost(url);
- RestResponse restResponse = new RestResponse();
- httpPost.addHeader("USER_ID", UserRoleEnum.ADMIN.getUserId());
- httpPost.setEntity(mpBuilder.build());
- response = client.execute(httpPost);
- HttpEntity entity = response.getEntity();
- String responseBody = null;
- if (entity != null) {
- InputStream instream = entity.getContent();
- StringWriter writer = new StringWriter();
- IOUtils.copy(instream, writer);
- responseBody = writer.toString();
- try {
-
- } finally {
- instream.close();
- }
- }
-
- restResponse.setErrorCode(response.getStatusLine().getStatusCode());
- // restResponse.setResponse(response.getEntity().toString());
- restResponse.setResponse(responseBody);
- return restResponse;
- } finally {
- closeResponse(response);
- closeHttpClient(client);
-
- }
- }
-
- public static Boolean removeNormativeTypeResource(NormativeTypesEnum current)
- throws FileNotFoundException, IOException, ClientProtocolException {
- User user = new User(UserRoleEnum.ADMIN.getFirstName(), UserRoleEnum.ADMIN.getLastName(),
- UserRoleEnum.ADMIN.getUserId(), null, null, null);
- RestResponse deleteResponse = ResourceRestUtils.deleteResourceByNameAndVersion(user, current.getNormativeName(),
- "1.0");
- if (deleteResponse.getErrorCode() == 200) {
- return true;
- }
- return false;
- }
-
- public static void validateImportTestTypesResp(ImportTestTypesEnum currResource, RestResponse restResponse)
- throws IOException, JSONException {
-
- // assertTrue( status != ResourceUtils.STATUS_CODE_IMPORT_SUCCESS );
-
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(currResource.getActionStatus().name());
-
- assertNotNull("check response object is not null after create service", restResponse);
- assertNotNull("check error code exists in response after create service", restResponse.getErrorCode());
- assertEquals("Check response code after create service", errorInfo.getCode(), restResponse.getErrorCode());
-
- // validate create service response vs actual
- List<String> variables = (currResource.getErrorParams() != null ? currResource.getErrorParams()
- : new ArrayList<String>());
- if (restResponse.getErrorCode() != 200) {
- ErrorValidationUtils.checkBodyResponseOnError(currResource.getActionStatus().name(), variables,
- restResponse.getResponse());
- }
- }
-
- private static String getTestJsonStringOfFile(String folderName, String fileName) throws IOException {
- // String sourceDir = "src/test/resources/CI/importResourceTests";
- Config config = Utils.getConfig();
- String sourceDir = config.getImportResourceTestsConfigDir();
- java.nio.file.Path filePath = FileSystems.getDefault().getPath(sourceDir + File.separator + folderName,
- fileName);
- byte[] fileContent = Files.readAllBytes(filePath);
- String content = new String(fileContent);
- return content;
- }
-
- private static File getTestZipFile(String elementName) throws IOException {
- Config config = Utils.getConfig();
- String sourceDir = config.getImportResourceTestsConfigDir();
- java.nio.file.Path filePath = FileSystems.getDefault().getPath(sourceDir + File.separator + elementName,
- "normative-types-new-" + elementName + ".zip");
- return filePath.toFile();
- }
-
- private static void closeHttpClient(CloseableHttpClient client) {
- try {
- if (client != null) {
- client.close();
- }
- } catch (IOException e) {
- log.debug("failed to close client or response: ", e);
- }
- }
-
- private static void closeResponse(CloseableHttpResponse response) {
- try {
- if (response != null) {
- response.close();
- }
- } catch (IOException e) {
- log.debug("failed to close client or response: {}", e);
- }
- }
-
- public static HttpResponse<byte []> getCsar(String csarUid, User sdncModifierDetails) throws Exception {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_CSAR_USING_SIMULATOR, config.getCatalogBeHost(), config.getCatalogBePort(),
- csarUid);
-
- String userId = sdncModifierDetails.getUserId();
-
- Map<String, String> headersMap = prepareHeadersMap(userId);
-
- // Gson gson = new Gson();
- // String userBodyJson = gson.toJson(resourceDetails);
- HttpRequest http = new HttpRequest();
- // System.out.println(url);
- // System.out.println(userBodyJson);
-
- for (Map.Entry<String, String> mapEntry : headersMap.entrySet()) {
-
- downloadCsarHeaders.put(mapEntry.getKey(), mapEntry.getValue());
- }
- return org.openecomp.sdc.common.http.client.api.HttpRequest.getAsByteArray(url, downloadCsarHeaders);
- }
-
- private static File getGroupTypeZipFile(String elementName) throws IOException {
- Config config = Utils.getConfig();
- String sourceDir = config.getImportResourceTestsConfigDir();
- sourceDir += File.separator + ".." + File.separator + "importTypesTest" + File.separator;
- java.nio.file.Path filePath = FileSystems.getDefault().getPath(sourceDir + File.separator + elementName,
- elementName + ".zip");
- return filePath.toFile();
- }
-
- public static RestResponse importNewGroupTypeByName(String groupTypeName, UserRoleEnum userRole)
- throws IOException {
- Config config = Utils.getConfig();
-
- MultipartEntityBuilder mpBuilder = MultipartEntityBuilder.create();
-
- mpBuilder.addPart("groupTypesZip", new FileBody(getGroupTypeZipFile(groupTypeName)));
- HttpEntity requestEntity = mpBuilder.build();
- String url = String.format(Urls.IMPORT_GROUP_TYPE, config.getCatalogBeHost(), config.getCatalogBePort());
- Map<String, String> headers = new HashMap<String, String>();
- headers.put("USER_ID", userRole.getUserId());
-
- return HttpRequest.sendHttpPostWithEntity(requestEntity, url, headers);
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/InputsRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/InputsRestUtils.java
deleted file mode 100644
index 36fe6e3ea7..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/InputsRestUtils.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.rest;
-
-import com.google.gson.Gson;
-
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.model.Component;
-import org.openecomp.sdc.be.model.ComponentInstInputsMap;
-import org.openecomp.sdc.be.model.ComponentInstance;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * RestUtils for inputs
- *
- * @author il0695
- */
-public class InputsRestUtils extends BaseRestUtils {
-
- @SuppressWarnings("unused")
- private static Logger logger = LoggerFactory.getLogger(InputsRestUtils.class.getName());
-
- /**
- * Add inputs to service
- *
- * @param component
- * @param inputs
- * @param userRole
- * @return {@link org.openecomp.sdc.ci.tests.datatypes.http.RestResponse}
- * @throws Exception
- */
- public static RestResponse addInput(Component component, ComponentInstInputsMap inputs, UserRoleEnum userRole)
- throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.ADD_INPUTS, config.getCatalogBeHost(), config.getCatalogBePort(),
- ComponentTypeEnum.findParamByType(component.getComponentType()), component.getUniqueId());
- String json = new Gson().toJson(inputs);
- return sendPost(url, json, userRole.getUserId(), acceptHeaderData);
- }
-
- /**
- * Update inputs to service
- *
- * @param component
- * @param data
- * @param userRole
- * @return {@link org.openecomp.sdc.ci.tests.datatypes.http.RestResponse}
- * @throws Exception
- */
- public static RestResponse updateInput(Component component, String data, UserRoleEnum userRole) throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.UPDATE_INPUTS, config.getCatalogBeHost(), config.getCatalogBePort(),
- ComponentTypeEnum.findParamByType(component.getComponentType()), component.getUniqueId());
- return sendPost(url, data, userRole.getUserId(), acceptHeaderData);
- }
-
- /**
- * Get all Component inputs
- *
- * @param component
- * @return {@link org.openecomp.sdc.ci.tests.datatypes.http.RestResponse}
- * @throws Exception
- */
- public static RestResponse getComponentInputs(Component component) throws Exception {
- Config config = Utils.getConfig();
- //services/{componentId}/inputs
- String url = String.format(Urls.GET_COMPONENT_INPUTS, config.getCatalogBeHost(), config.getCatalogBePort(),
- component.getUniqueId());
- return sendGet(url, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER).getUserId());
- }
-
- /**
- * Get all inputs of component instance
- *
- * @param parentComponent
- * @param componentInstance
- * @return {@link org.openecomp.sdc.ci.tests.datatypes.http.RestResponse}
- * @throws Exception
- */
- public static RestResponse getComponentInstanceInputs(Component parentComponent,
- ComponentInstance componentInstance) throws Exception {
- Config config = Utils.getConfig();
- //{componentType}/{componentId}/componentInstances/{instanceId}/{originComonentUid}/inputs
- String url =
- String.format(Urls.GET_COMPONENT_INSTANCE_INPUTS, config.getCatalogBeHost(), config.getCatalogBePort(),
- ComponentTypeEnum.findParamByType(parentComponent.getComponentType()),
- parentComponent.getUniqueId(), componentInstance.getUniqueId(),
- componentInstance.getComponentUid());
- return sendGet(url, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER).getUserId());
- }
-
- /**
- * Delete input from component
- *
- * @param parentComponent
- * @param inputId
- * @return {@link org.openecomp.sdc.ci.tests.datatypes.http.RestResponse}
- * @throws Exception
- */
- public static RestResponse deleteInputFromComponent(Component parentComponent, String inputId) throws Exception {
- return deleteInputFromComponent(ComponentTypeEnum.findParamByType(parentComponent.getComponentType()),
- parentComponent.getUniqueId(), inputId);
- }
-
- /**
- * Delete input from component
- *
- * @param componentType
- * @param componentId
- * @param inputUniqueId
- * @return {@link org.openecomp.sdc.ci.tests.datatypes.http.RestResponse}
- * @throws Exception
- */
- public static RestResponse deleteInputFromComponent(String componentType, String componentId, String inputUniqueId)
- throws Exception {
- Config config = Utils.getConfig();
- //{componentType}/{componentId}/delete/{inputId}/input
- String url = String.format(Urls.DELETE_INPUT_BY_ID, config.getCatalogBeHost(), config.getCatalogBePort(),
- componentType, componentId, inputUniqueId);
- return sendDelete(url, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER).getUserId());
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/InterfaceOperationsRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/InterfaceOperationsRestUtils.java
deleted file mode 100644
index 32e731b94f..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/InterfaceOperationsRestUtils.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.rest;
-
-import com.google.gson.Gson;
-import java.io.IOException;
-import java.util.Map;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.model.Component;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class InterfaceOperationsRestUtils extends BaseRestUtils {
-
- @SuppressWarnings("unused")
- private static Logger logger = LoggerFactory.getLogger(InterfaceOperationsRestUtils.class.getName());
-
- public static RestResponse addInterfaceOperations(Component component, Map<String, Object> interfaceDefinitionMap,
- User user) throws IOException {
- Config config = Utils.getConfig();
- String url = String.format(Urls.ADD_INTERFACE_OPERATIONS, config.getCatalogBeHost(), config.getCatalogBePort(),
- ComponentTypeEnum.findParamByType(component.getComponentType()), component.getUniqueId());
- String jsonBody = new Gson().toJson(interfaceDefinitionMap);
- return sendPost(url, jsonBody, user.getUserId(), acceptHeaderData);
- }
-
- public static RestResponse updateInterfaceOperations(Component component,
- Map<String, Object> interfaceDefinitionMap, User user) throws IOException {
- Config config = Utils.getConfig();
- String url =
- String.format(Urls.UPDATE_INTERFACE_OPERATIONS, config.getCatalogBeHost(), config.getCatalogBePort(),
- ComponentTypeEnum.findParamByType(component.getComponentType()), component.getUniqueId());
- String jsonBody = new Gson().toJson(interfaceDefinitionMap);
- return sendPut(url, jsonBody, user.getUserId(), acceptHeaderData);
- }
-
- public static RestResponse getInterfaceOperations(Component component, String interfaceId, String operationIds,
- User user) throws IOException {
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_INTERFACE_OPERATIONS, config.getCatalogBeHost(), config.getCatalogBePort(),
- ComponentTypeEnum.findParamByType(component.getComponentType()), component.getUniqueId(), interfaceId,
- operationIds);
- return sendGet(url, user.getUserId());
- }
-
- public static RestResponse deleteInterfaceOperations(Component component, String interfaceId, String operationIds,
- User user) throws IOException {
- Config config = Utils.getConfig();
- String url =
- String.format(Urls.DELETE_INTERFACE_OPERATIONS, config.getCatalogBeHost(), config.getCatalogBePort(),
- ComponentTypeEnum.findParamByType(component.getComponentType()), component.getUniqueId(),
- interfaceId, operationIds);
- return sendDelete(url, user.getUserId());
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/LifecycleRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/LifecycleRestUtils.java
deleted file mode 100644
index 72cad8c3ca..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/LifecycleRestUtils.java
+++ /dev/null
@@ -1,440 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.rest;
-
-import org.json.simple.JSONObject;
-import org.openecomp.sdc.be.datatypes.enums.AssetTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.model.*;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.ProductReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-public class LifecycleRestUtils extends BaseRestUtils {
- private static Logger logger = LoggerFactory.getLogger(LifecycleRestUtils.class.getName());
- public static final String COMMENT = "comment";
-
- // External APIs
- public static RestResponse checkInResource(String resourceUUID, User sdncModifierDetails) throws IOException {
- String comment = "Chekin resource: " + resourceUUID;
- return changeLifeCycleOfAsset(resourceUUID, AssetTypeEnum.RESOURCES, LifeCycleStatesEnum.CHECKIN, sdncModifierDetails, comment);
- }
-
- public static RestResponse checkInService(String serviceUUID, User sdncModifierDetails) throws IOException {
- String comment = "Chekin service: " + serviceUUID;
- return changeLifeCycleOfAsset(serviceUUID, AssetTypeEnum.SERVICES, LifeCycleStatesEnum.CHECKIN, sdncModifierDetails, comment);
- }
-
- public static RestResponse checkOutResource(String resourceUUID, User sdncModifierDetails) throws IOException {
- String comment = "CheckOut resource: " + resourceUUID;
- return changeLifeCycleOfAsset(resourceUUID, AssetTypeEnum.RESOURCES, LifeCycleStatesEnum.CHECKOUT, sdncModifierDetails, comment);
- }
-
- public static RestResponse checkOutService(String serviceUUID, User sdncModifierDetails) throws IOException {
- String comment = "CheckOut service: " + serviceUUID;
- return changeLifeCycleOfAsset(serviceUUID, AssetTypeEnum.SERVICES, LifeCycleStatesEnum.CHECKOUT, sdncModifierDetails, comment);
- }
-
- public static RestResponse certificationRequestService(String serviceUUID, User sdncModifierDetails) throws IOException {
- String comment = "Certification request service: " + serviceUUID;
- return changeLifeCycleOfAsset(serviceUUID, AssetTypeEnum.SERVICES, LifeCycleStatesEnum.CERTIFICATIONREQUEST, sdncModifierDetails, comment);
- }
-
- /*public static RestResponse certificationRequestResource(String resourceUUID, User sdncModifierDetails) throws IOException {
- String comment = "Certification request resource: " + resourceUUID;
- return changeLifeCycleOfAsset(resourceUUID, AssetTypeEnum.RESOURCES, LifeCycleStatesEnum.CERTIFICATIONREQUEST, sdncModifierDetails, comment);
- }*/
-
- public static RestResponse startTestingService(String serviceUUID, User sdncModifierDetails) throws IOException {
- String comment = "Start testing request service: " + serviceUUID;
- return changeLifeCycleOfAsset(serviceUUID, AssetTypeEnum.SERVICES, LifeCycleStatesEnum.STARTCERTIFICATION, sdncModifierDetails, comment);
- }
-
- public static RestResponse startTestingResource(String resourceUUID, User sdncModifierDetails) throws IOException {
- String comment = "Start testing request resource: " + resourceUUID;
- return changeLifeCycleOfAsset(resourceUUID, AssetTypeEnum.RESOURCES, LifeCycleStatesEnum.STARTCERTIFICATION, sdncModifierDetails, comment);
- }
-
- public static RestResponse certifyService(String serviceUUID, User sdncModifierDetails) throws IOException {
- String comment = "Certify request service: " + serviceUUID;
- return changeLifeCycleOfAsset(serviceUUID, AssetTypeEnum.SERVICES, LifeCycleStatesEnum.CERTIFY, sdncModifierDetails, comment);
- }
-
- public static RestResponse certifyResource(String resourceUUID, User sdncModifierDetails) throws IOException {
- String comment = "Certify request resource: " + resourceUUID;
- return changeLifeCycleOfAsset(resourceUUID, AssetTypeEnum.RESOURCES, LifeCycleStatesEnum.CERTIFY, sdncModifierDetails, comment);
- }
-
-
-
-
-
- private static RestResponse changeLifeCycleOfAsset(String assetUUID, AssetTypeEnum assetTypeEnum, LifeCycleStatesEnum lifeCycleStatesEnum, User sdncModifierDetails, String comment) throws IOException {
- Config config = Utils.getConfig();
- String url = String.format(Urls.POST_EXTERNAL_API_CHANGE_LIFE_CYCLE_OF_ASSET, config.getCatalogBeHost(), config.getCatalogBePort(), assetTypeEnum.getValue(), assetUUID, lifeCycleStatesEnum.getState());
-
- Map<String, String> additionalHeaders = new HashMap<>();
-
- additionalHeaders.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader);
- additionalHeaders.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), BaseRestUtils.xEcompInstanceId);
-
- String jsonBody = "{\"userRemarks\": \"" + comment + "\"}";
-
- RestResponse res = sendPost(url, jsonBody, sdncModifierDetails.getUserId(), acceptHeaderData, additionalHeaders);
-
- return res;
- }
-
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
- public static RestResponse changeResourceState(ResourceReqDetails resourceDetails, User sdncModifierDetails,
- String version, LifeCycleStatesEnum LifeCycleStatesEnum) throws IOException {
- return changeResourceState(resourceDetails, sdncModifierDetails, LifeCycleStatesEnum,
- createLifecycleCommentJson(COMMENT));
- }
-
- public static RestResponse changeResourceState(ResourceReqDetails resourceDetails, User sdncModifierDetails,
- String version, LifeCycleStatesEnum LifeCycleStatesEnum, String LifecycleChangeInfo) throws IOException {
-
- return changeResourceState(resourceDetails, sdncModifierDetails, LifeCycleStatesEnum, LifecycleChangeInfo);
-
- }
-
- public static RestResponse changeResourceState(ResourceReqDetails resourceDetails, User sdncModifierDetails,
- LifeCycleStatesEnum LifeCycleStatesEnum) throws IOException {
-
- return changeResourceState(resourceDetails, sdncModifierDetails, LifeCycleStatesEnum,
- createLifecycleCommentJson(COMMENT));
-
- }
-
- public static RestResponse changeResourceState(ResourceReqDetails resourceDetails, String modifierUserId,
- LifeCycleStatesEnum LifeCycleStatesEnum) throws IOException {
- User user = new User();
- user.setUserId(modifierUserId);
- return changeResourceState(resourceDetails, user, LifeCycleStatesEnum, createLifecycleCommentJson(COMMENT));
- }
-
- private static RestResponse changeResourceState(ResourceReqDetails resourceDetails, User sdncModifierDetails,
- LifeCycleStatesEnum LifeCycleStatesEnum, String LifecycleChangeInfo) throws IOException {
- Config config = Utils.getConfig();
- String url = String.format(Urls.CHANGE_RESOURCE_LIFECYCLE_STATE, config.getCatalogBeHost(),
- config.getCatalogBePort(), resourceDetails.getUniqueId(), LifeCycleStatesEnum);
- // System.out.println("url: " + url);
-
- RestResponse LifeCycleStatesEnumResourceResponse = sendPost(url, LifecycleChangeInfo,
- sdncModifierDetails.getUserId(), acceptHeaderData);
- if (LifeCycleStatesEnumResourceResponse.getErrorCode() == STATUS_CODE_SUCCESS) {
- String stateFromJsonResponse = ResponseParser
- .getValueFromJsonResponse(LifeCycleStatesEnumResourceResponse.getResponse(), "lifecycleState");
- resourceDetails.setVersion(ResponseParser.getVersionFromResponse(LifeCycleStatesEnumResourceResponse));
- resourceDetails.setUniqueId(ResponseParser.getUniqueIdFromResponse(LifeCycleStatesEnumResourceResponse));
- if (stateFromJsonResponse != null) {
- resourceDetails.setLifecycleState(LifecycleStateEnum.valueOf(stateFromJsonResponse));
- }
- }
- return LifeCycleStatesEnumResourceResponse;
- }
-
- public static RestResponse changeServiceState(ServiceReqDetails serviceDetails, User sdncModifierDetails,
- String version, LifeCycleStatesEnum LifeCycleStatesEnum) throws Exception {
- {
- return changeServiceState(serviceDetails, sdncModifierDetails, version, LifeCycleStatesEnum,
- createLifecycleCommentJson(COMMENT));
- }
- }
-
- public static RestResponse changeServiceState(ServiceReqDetails serviceDetails, User sdncModifierDetails,
- LifeCycleStatesEnum LifeCycleStatesEnum) throws Exception {
- {
- return changeServiceState(serviceDetails, sdncModifierDetails, null, LifeCycleStatesEnum,
- createLifecycleCommentJson(COMMENT));
- }
- }
-
- public static RestResponse changeServiceState(ServiceReqDetails serviceDetails, User sdncModifierDetails,
- LifeCycleStatesEnum LifeCycleStatesEnum, String lifecycleChangeInfo) throws Exception {
- {
- return changeServiceState(serviceDetails, sdncModifierDetails, null, LifeCycleStatesEnum,
- lifecycleChangeInfo);
- }
- }
-
- public static RestResponse changeServiceState(ServiceReqDetails serviceDetails, User sdncModifierDetails,
- String version, LifeCycleStatesEnum LifeCycleStatesEnum, String lifecycleChangeInfo) throws Exception {
-
- Config config = Utils.getConfig();
- Map<String, String> headersMap = prepareHeadersMap(sdncModifierDetails);
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.CHANGE_SERVICE_LIFECYCLE_STATE, config.getCatalogBeHost(),
- config.getCatalogBePort(), serviceDetails.getUniqueId(), LifeCycleStatesEnum);
- // System.out.println("url: " + url);
- RestResponse LifeCycleStatesEnumServiceResponse = http.httpSendPost(url, lifecycleChangeInfo, headersMap);
- if (LifeCycleStatesEnumServiceResponse.getErrorCode() == STATUS_CODE_SUCCESS) {
- String serviceUniqueId = ResponseParser
- .getValueFromJsonResponse(LifeCycleStatesEnumServiceResponse.getResponse(), "uniqueId");
- serviceDetails.setUniqueId(serviceUniqueId);
- String serviceVersion = ResponseParser
- .getValueFromJsonResponse(LifeCycleStatesEnumServiceResponse.getResponse(), "version");
- serviceDetails.setVersion(serviceVersion);
- String stateFromJsonResponse = ResponseParser
- .getValueFromJsonResponse(LifeCycleStatesEnumServiceResponse.getResponse(), "lifecycleState");
- serviceDetails.setLifecycleState(LifecycleStateEnum.valueOf(stateFromJsonResponse));
- }
- return LifeCycleStatesEnumServiceResponse;
- }
-
- public static RestResponse changeProductState(Product product, User sdncModifierDetails,
- LifeCycleStatesEnum LifeCycleStatesEnum, String lifecycleChangeInfo) throws Exception {
- {
- return _changeProductState(product, sdncModifierDetails, LifeCycleStatesEnum, lifecycleChangeInfo);
- }
- }
-
- public static RestResponse changeProductState(Product product, User sdncModifierDetails,
- LifeCycleStatesEnum LifeCycleStatesEnum) throws Exception {
- {
- return _changeProductState(product, sdncModifierDetails, LifeCycleStatesEnum, COMMENT);
- }
- }
-
- public static RestResponse changeProductState(ProductReqDetails productDetails, User sdncModifierDetails,
- LifeCycleStatesEnum LifeCycleStatesEnum) throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.CHANGE_PRODUCT_LIFECYCLE_STATE, config.getCatalogBeHost(),
- config.getCatalogBePort(), productDetails.getUniqueId(), LifeCycleStatesEnum);
- RestResponse LifeCycleStatesEnumServiceResponse = sendPost(url, createLifecycleCommentJson(COMMENT),
- sdncModifierDetails.getUserId(), acceptHeaderData);
- if (LifeCycleStatesEnumServiceResponse.getErrorCode() == STATUS_CODE_SUCCESS) {
- String productUniqueId = ResponseParser
- .getValueFromJsonResponse(LifeCycleStatesEnumServiceResponse.getResponse(), "uniqueId");
- productDetails.setUniqueId(productUniqueId);
- String productVersion = ResponseParser
- .getValueFromJsonResponse(LifeCycleStatesEnumServiceResponse.getResponse(), "version");
- productDetails.setVersion(productVersion);
- String newLifecycleState = ResponseParser
- .getValueFromJsonResponse(LifeCycleStatesEnumServiceResponse.getResponse(), "lifecycleState");
- productDetails.setLifecycleState(LifecycleStateEnum.valueOf(newLifecycleState));
- }
- return LifeCycleStatesEnumServiceResponse;
-
- }
-
- public static RestResponse changeComponentState(Component component, User sdncModifierDetails,
- LifeCycleStatesEnum LifeCycleStatesEnum) throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.CHANGE_COMPONENT_LIFECYCLE_STATE, config.getCatalogBeHost(),
- config.getCatalogBePort(), ComponentTypeEnum.findParamByType(component.getComponentType()), component.getUniqueId(), LifeCycleStatesEnum);
- RestResponse LifeCycleStatesEnumServiceResponse = sendPost(url, createLifecycleCommentJson(COMMENT), sdncModifierDetails.getUserId(), acceptHeaderData);
- if (LifeCycleStatesEnumServiceResponse.getErrorCode() == STATUS_CODE_SUCCESS) {
- String productUniqueId = ResponseParser.getValueFromJsonResponse(LifeCycleStatesEnumServiceResponse.getResponse(), "uniqueId");
- component.setUniqueId(productUniqueId);
- String productVersion = ResponseParser.getValueFromJsonResponse(LifeCycleStatesEnumServiceResponse.getResponse(), "version");
- component.setVersion(productVersion);
- String newLifecycleState = ResponseParser.getValueFromJsonResponse(LifeCycleStatesEnumServiceResponse.getResponse(), "lifecycleState");
- component.setLifecycleState(LifecycleStateEnum.valueOf(newLifecycleState));
- }
- return LifeCycleStatesEnumServiceResponse;
-
- }
-
- public static RestResponse certifyResource(ResourceReqDetails resourceDetails) throws Exception {
-
- User designer = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- RestResponse restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), LifeCycleStatesEnum.CHECKIN);
- // if (restResponseResource.getErrorCode() == 200){
-/* restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), LifeCycleStatesEnum.CERTIFICATIONREQUEST);
- // }else
- // return restResponseResource;
- User testerDetails = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
- if (restResponseResource.getErrorCode() == 200) {
- restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails, testerDetails,
- LifeCycleStatesEnum.STARTCERTIFICATION);
- } else
- return restResponseResource;*/
- if (restResponseResource.getErrorCode() == 200) {
- restResponseResource = LifecycleRestUtils.changeResourceState(resourceDetails, designer,
- LifeCycleStatesEnum.CERTIFY);
- if (restResponseResource.getErrorCode() == 200) {
- String newVersion = ResponseParser.getVersionFromResponse(restResponseResource);
- resourceDetails.setVersion(newVersion);
- resourceDetails.setLifecycleState(LifecycleStateEnum.CERTIFIED);
- resourceDetails.setLastUpdaterUserId(designer.getUserId());
- resourceDetails.setLastUpdaterFullName(designer.getFullName());
- String uniqueIdFromRresponse = ResponseParser.getUniqueIdFromResponse(restResponseResource);
- resourceDetails.setUniqueId(uniqueIdFromRresponse);
- }
- }
- return restResponseResource;
- }
-
- public static RestResponse certifyService(ServiceReqDetails serviceDetails) throws Exception {
- RestResponse restResponseService = LifecycleRestUtils.changeServiceState(serviceDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), LifeCycleStatesEnum.CHECKIN);
- // if (restResponseService.getErrorCode() == 200){
- restResponseService = LifecycleRestUtils.changeServiceState(serviceDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), LifeCycleStatesEnum.CERTIFICATIONREQUEST);
- // }else
- // return restResponseService;
- if (restResponseService.getErrorCode() == 200) {
- restResponseService = LifecycleRestUtils.changeServiceState(serviceDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.TESTER), LifeCycleStatesEnum.STARTCERTIFICATION);
- } else
- return restResponseService;
- if (restResponseService.getErrorCode() == 200) {
- User testerDetails = ElementFactory.getDefaultUser(UserRoleEnum.TESTER);
- restResponseService = LifecycleRestUtils.changeServiceState(serviceDetails, testerDetails,
- LifeCycleStatesEnum.CERTIFY);
- if (restResponseService.getErrorCode() == 200) {
- String newVersion = ResponseParser.getVersionFromResponse(restResponseService);
- serviceDetails.setVersion(newVersion);
- serviceDetails.setLifecycleState(LifecycleStateEnum.CERTIFIED);
- serviceDetails.setLastUpdaterUserId(testerDetails.getUserId());
- serviceDetails.setLastUpdaterFullName(testerDetails.getFullName());
- String uniqueIdFromRresponse = ResponseParser.getUniqueIdFromResponse(restResponseService);
- serviceDetails.setUniqueId(uniqueIdFromRresponse);
- }
- }
- return restResponseService;
- }
-
- private static RestResponse _changeProductState(Product product, User sdncModifierDetails,
- LifeCycleStatesEnum LifeCycleStatesEnum, String lifecycleChangeInfo) throws Exception {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.CHANGE_PRODUCT_LIFECYCLE_STATE, config.getCatalogBeHost(),
- config.getCatalogBePort(), product.getUniqueId(), LifeCycleStatesEnum);
- RestResponse LifeCycleStatesEnumServiceResponse = sendPost(url, createLifecycleCommentJson(lifecycleChangeInfo),
- sdncModifierDetails.getUserId(), acceptHeaderData);
-
- return LifeCycleStatesEnumServiceResponse;
- }
-
- public static String createLifecycleCommentJson(String commentContent) {
- String res = null;
- if (commentContent != null) {
- res = "{\"userRemarks\": \"" + commentContent + "\"}";
- }
- return res;
- }
-
- public static void checkLCS_Response(RestResponse response) {
- checkStatusCode(response, "change lifecycle request failed", false, STATUS_CODE_SUCCESS);
- }
-
- private static Map<String, String> prepareHeadersMap(User sdncModifierDetails) {
- Map<String, String> headersMap = new HashMap<>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderData);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
- return headersMap;
- }
-
- public static RestResponse changeDistributionStatus(ServiceReqDetails serviceDetails, String version, User user,
- String userRemarks, DistributionStatusEnum reqDistributionStatus) throws Exception {
- String uniqueId = serviceDetails.getUniqueId();
- Config config = Utils.getConfig();
- String environmentName = "AUTO";
-// String environmentName = ConfigurationManager.getConfigurationManager().getDistributionEngineConfiguration().getEnvironments().get(0);
- DistributionStatusEnum distributionStatusEnum = DistributionStatusEnum.findState(reqDistributionStatus.getValue());
- switch(distributionStatusEnum){
- case DISTRIBUTED:
- String url = String.format(Urls.ACTIVATE_DISTRIBUTION, config.getCatalogBeHost(), config.getCatalogBePort(), uniqueId, environmentName);
- return sendDistrState(user, userRemarks, url);
- default:
- return null;
-
- }
-
-// if (reqDistributionStatus == DistributionStatusEnum.DISTRIBUTION_APPROVED) {
-// return sendApproveDistribution(user, uniqueId, userRemarks);
-// } else if (reqDistributionStatus == DistributionStatusEnum.DISTRIBUTION_REJECTED) {
-// return rejectDistribution(user, userRemarks, uniqueId);
-// } else if (reqDistributionStatus == DistributionStatusEnum.DISTRIBUTED) {
-// Config config = Utils.getConfig();
-// // String url =
-// // String.format("http://%s:%s/sdc2/rest/v1/catalog/services/%s/tempUrlToBeDeleted",
-// // config.getCatalogBeHost(), config.getCatalogBePort(), uniqueId);
-// String url = String.format(Urls.ACTIVATE_DISTRIBUTION, config.getCatalogBeHost(), config.getCatalogBePort(),
-// uniqueId, "PROD");
-// return sendDistrState(user, userRemarks, url);
-// } else
-// return null;
-
- }
-
- public static RestResponse sendApproveDistribution(User sdncModifierDetails, String uniqueId, String userRemarks)
- throws FileNotFoundException, IOException {
- Config config = Utils.getConfig();
- String url = String.format(Urls.APPROVE_DISTRIBUTION, config.getCatalogBeHost(), config.getCatalogBePort(),
- uniqueId);
- return sendDistrState(sdncModifierDetails, userRemarks, url);
- }
-
- public static RestResponse rejectDistribution(ServiceReqDetails serviceDetails, String version, User user,
- String userRemarks) throws Exception {
- return rejectDistribution(user, userRemarks, serviceDetails.getUniqueId());
- }
-
- public static RestResponse rejectDistribution(User user, String userRemarks, String uniqueId)
- throws FileNotFoundException, IOException {
- Config config = Utils.getConfig();
- String url = String.format(Urls.REJECT_DISTRIBUTION, config.getCatalogBeHost(), config.getCatalogBePort(),
- uniqueId);
- return sendDistrState(user, userRemarks, url);
- }
-
- private static RestResponse sendDistrState(User user, String userRemarks, String url) throws IOException {
- Map<String, String> headersMap = prepareHeadersMap(user);
- Map<String, String> userRemarksMap = new HashMap<String, String>();
- userRemarksMap.put("userRemarks", userRemarks);
-
- String serviceBodyJson = new JSONObject().toJSONString(userRemarksMap);
-
- HttpRequest httpRequest = new HttpRequest();
- logger.debug(url);
- logger.debug("Send POST request to create service: {}", url);
- logger.debug("Service body: {}", serviceBodyJson);
- logger.debug("Service headers: {}", headersMap);
- RestResponse rejectDistributionResponse = httpRequest.httpSendPost(url, serviceBodyJson, headersMap);
-
- return rejectDistributionResponse;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ProductRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ProductRestUtils.java
deleted file mode 100644
index 1a59a31ddf..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ProductRestUtils.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.rest;
-
-import com.google.gson.Gson;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.model.LifecycleStateEnum;
-import org.openecomp.sdc.be.model.Product;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.ProductReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-
-public class ProductRestUtils extends BaseRestUtils {
- private static Gson gson = new Gson();
- private static Logger logger = LoggerFactory.getLogger(ProductRestUtils.class.getName());
-
- public static RestResponse createProduct(ProductReqDetails product, User user) throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.CREATE_PRODUCT, config.getCatalogBeHost(), config.getCatalogBePort());
- String serviceBodyJson = gson.toJson(product);
-
- logger.debug("Send POST request to create service: {}", url);
- logger.debug("Service body: {}", serviceBodyJson);
-
- RestResponse res = sendPost(url, serviceBodyJson, user.getUserId(), acceptHeaderData);
- if (res.getErrorCode() == STATUS_CODE_CREATED) {
- product.setUniqueId(ResponseParser.getUniqueIdFromResponse(res));
- product.setVersion(ResponseParser.getVersionFromResponse(res));
- product.setUUID(ResponseParser.getUuidFromResponse(res));
- // Creator details never change after component is created - Ella,
- // 12/1/2016
- product.setCreatorUserId(user.getUserId());
- product.setCreatorFullName(user.getFullName());
- product.setLastUpdaterFullName(user.getFullName());
- product.setLastUpdaterUserId(user.getUserId());
- product.setLastUpdaterFullName(user.getFullName());
- product.setLifecycleState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
- product.setVersion("0.1");
- String lastUpdate = ResponseParser.getValueFromJsonResponse(res.getResponse(), "lastUpdateDate");
- product.setLastUpdateDate(Long.parseLong(lastUpdate, 10));
- product.setCreationDate(Long.parseLong(lastUpdate, 10));
- }
- return res;
- }
-
- public static RestResponse updateProduct(ProductReqDetails product, User user) throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.UPDATE_PRODUCT, config.getCatalogBeHost(), config.getCatalogBePort(),
- product.getUniqueId());
- String serviceBodyJson = gson.toJson(product);
-
- logger.debug("Send POST request to create service: {}", url);
- logger.debug("Service body: {}", serviceBodyJson);
-
- RestResponse res = sendPut(url, serviceBodyJson, user.getUserId(), acceptHeaderData);
- if (res.getErrorCode() == STATUS_CODE_CREATED) {
- product.setUniqueId(ResponseParser.getUniqueIdFromResponse(res));
- product.setVersion(ResponseParser.getVersionFromResponse(res));
- product.setUUID(ResponseParser.getUuidFromResponse(res));
- // Creator details never change after component is created - Ella,
- // 12/1/2016
- product.setCreatorUserId(user.getUserId());
- product.setCreatorFullName(user.getFullName());
- product.setLastUpdaterFullName(user.getFullName());
- product.setLastUpdaterUserId(user.getUserId());
- product.setLastUpdaterFullName(user.getFullName());
- product.setLifecycleState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
- String valueFromJsonResponse = ResponseParser.getValueFromJsonResponse(res.getResponse(), "version");
- product.setVersion(valueFromJsonResponse);
- String lastUpdate = ResponseParser.getValueFromJsonResponse(res.getResponse(), "lastUpdateDate");
- product.setLastUpdateDate(Long.parseLong(lastUpdate, 10));
- product.setCreationDate(Long.parseLong(lastUpdate, 10));
- }
- return res;
- }
-
- public static RestResponse createProduct_Invalid_Json(String userId) throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.CREATE_PRODUCT, config.getCatalogBeHost(), config.getCatalogBePort());
-
- RestResponse res = sendPost(url, "kukumuku", userId, acceptHeaderData);
- return res;
- }
-
- public static RestResponse deleteProduct(String id, String userId) throws IOException {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.DELETE_PRODUCT, config.getCatalogBeHost(), config.getCatalogBePort(), id);
- return sendDelete(url, userId);
- }
-
- public static RestResponse getProduct(String productId) throws Exception {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_PRODUCT, config.getCatalogBeHost(), config.getCatalogBePort(), productId);
- logger.debug("Send GET request to get product: {}", url);
-
- return sendGet(url, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER).getUserId());
- }
-
- public static RestResponse getProduct(String productId, String userId) throws Exception {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_PRODUCT, config.getCatalogBeHost(), config.getCatalogBePort(), productId);
- logger.debug("Send GET request to get product: {}", url);
-
- return sendGet(url, userId);
- }
-
- public static RestResponse getFollowed(String userId) throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_FOLLWED_LIST, config.getCatalogBeHost(), config.getCatalogBePort());
- logger.debug("Send GET request to get user followed page: {}", url);
- return sendGet(url, userId);
-
- }
-
- public static RestResponse changeProductLifeCycle(Product product, User userModifier, LifeCycleStatesEnum lifeCycle)
- throws Exception {
- String checkinComment = "my comment";
- RestResponse changeLifeCycleResponse = LifecycleRestUtils.changeProductState(product, userModifier, lifeCycle,
- checkinComment);
- if (changeLifeCycleResponse.getErrorCode() == STATUS_CODE_SUCCESS) {
- product.setLastUpdaterUserId(userModifier.getUserId());
- product.setLastUpdaterFullName(userModifier.getFullName());
- String latestVersion = ResponseParser.getValueFromJsonResponse(changeLifeCycleResponse.getResponse(),
- "version");
- product.setVersion(latestVersion);
- String lifecycleState = ResponseParser.getValueFromJsonResponse(changeLifeCycleResponse.getResponse(),
- "lifecycleState");
- product.setLifecycleState((LifecycleStateEnum.valueOf(lifecycleState)));
- String uniqueId = ResponseParser.getValueFromJsonResponse(changeLifeCycleResponse.getResponse(),
- "uniqueId");
- product.setUniqueId(uniqueId);
- String lastUpdate = ResponseParser.getValueFromJsonResponse(changeLifeCycleResponse.getResponse(),
- "lastUpdateDate");
- product.setLastUpdateDate((Long.parseLong(lastUpdate, 10)));
- String uuid = ResponseParser.getValueFromJsonResponse(changeLifeCycleResponse.getResponse(), "uuid");
- product.setUUID(uuid);
- }
- return changeLifeCycleResponse;
- }
-
- public static RestResponse changeServiceInstanceVersion(String componentUniqueId,
- String serviceInstanceToReplaceUniqueId, String serviceUniqueId, User sdncModifierDetails,
- ComponentTypeEnum componentType) throws IOException {
- Config config = Utils.getConfig();
- String resourceUid = ("{\"componentUid\":\"" + serviceUniqueId + "\"}");
- String url = String.format(Urls.CHANGE__RESOURCE_INSTANCE_VERSION, config.getCatalogBeHost(),
- config.getCatalogBePort(), ComponentTypeEnum.findParamByType(componentType), componentUniqueId,
- serviceInstanceToReplaceUniqueId);
- RestResponse changeResourceInstanceVersion = sendPost(url, resourceUid, sdncModifierDetails.getUserId(),
- acceptHeaderData);
- return changeResourceInstanceVersion;
-
- }
-
- public static RestResponse getProductByNameAndVersion(String productName, String productVersion, String userId)
- throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_PRODUCT_BY_NAME_AND_VERSION, config.getCatalogBeHost(),
- config.getCatalogBePort(), productName, productVersion);
- logger.debug("Send GET request to get product by name and version: {}", url);
- return sendGet(url, userId);
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/PropertyRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/PropertyRestUtils.java
deleted file mode 100644
index 34a158fe74..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/PropertyRestUtils.java
+++ /dev/null
@@ -1,383 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.rest;
-
-import static org.testng.AssertJUnit.assertNotNull;
-import static org.testng.AssertJUnit.assertNull;
-import static org.testng.AssertJUnit.assertTrue;
-
-import com.google.gson.Gson;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.model.Component;
-import org.openecomp.sdc.be.model.ComponentInstance;
-import org.openecomp.sdc.be.model.ComponentInstanceInput;
-import org.openecomp.sdc.be.model.ComponentInstanceProperty;
-import org.openecomp.sdc.be.model.PropertyDefinition;
-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.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.PropertyObject;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.common.util.GeneralUtility;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class PropertyRestUtils extends BaseRestUtils {
- private static Logger logger = LoggerFactory.getLogger(PropertyRestUtils.class.getName());
-
- public static RestResponse createProperty(String resourceId, String body, User user) throws Exception {
- Config config = Config.instance();
- String url = String.format(Urls.CREATE_PROPERTY, config.getCatalogBeHost(), config.getCatalogBePort(), resourceId);
-
- return sendPost(url, body, user.getUserId(), acceptHeaderData);
- }
-
- public static RestResponse addValueToProperty(String resourceId, String body, User user) throws Exception {
- Config config = Config.instance();
- String url = String.format(Urls.CREATE_PROPERTY, config.getCatalogBeHost(), config.getCatalogBePort(), resourceId);
-
- return sendPut(url, body, user.getUserId(), acceptHeaderData);
- }
-
- public static RestResponse createServiceProperty(String resourceId, String body, User user) throws Exception {
- Config config = Config.instance();
- String url = String.format(Urls.CREATE_SERVICE_PROPERTY, config.getCatalogBeHost(), config.getCatalogBePort(),
- resourceId);
-
- return sendPost(url, body, user.getUserId(), acceptHeaderData);
- }
-
- public static RestResponse updateProperty(String resourceId, String propertyId, String body, User user)
- throws Exception {
- Config config = Config.instance();
-
- String url = String.format(Urls.UPDATE_PROPERTY, config.getCatalogBeHost(), config.getCatalogBePort(),
- resourceId, propertyId);
- return sendPut(url, body, user.getUserId(), acceptHeaderData);
- }
-
- public static RestResponse updateGroupProperty(Component component, String groupId, String body, User user)
- throws Exception {
- Config config = Config.instance();
-
- String url = String.format(Urls.RESOURCE_GROUP_PROPERTY, config.getCatalogBeHost(), config.getCatalogBePort(), component.getUniqueId(), groupId);
- return sendPut(url, body, user.getUserId(), acceptHeaderData);
- }
-
- public static RestResponse getProperty(String resourceId, String propertyId, User user) throws Exception {
- Config config = Config.instance();
- String url = String.format(Urls.GET_PROPERTY, config.getCatalogBeHost(), config.getCatalogBePort(), resourceId,
- propertyId);
- return sendGet(url, user.getUserId());
- }
-
- public static RestResponse deleteProperty(String resourceId, String propertyId, User user) throws Exception {
- Config config = Config.instance();
- String url = String.format(Urls.DELETE_PROPERTY, config.getCatalogBeHost(), config.getCatalogBePort(),
- resourceId, propertyId);
-
- return sendDelete(url, user.getUserId());
- }
-
- public static ComponentInstanceProperty getPropFromListByPropNameAndType(List<ComponentInstanceProperty> propList,
- String propNameToUpdate, String propTypeToUpdate) {
- for (ComponentInstanceProperty componentInstanceProperty : propList) {
- if (componentInstanceProperty.getName().equals(propNameToUpdate)
- && componentInstanceProperty.getType().equals(propTypeToUpdate)) {
- return componentInstanceProperty;
- }
- }
- return null;
- }
-
- public static ComponentInstanceProperty getPropFromListByPropNameTypeAndPath(
- List<ComponentInstanceProperty> propList, String propNameToUpdate, String propTypeToUpdate,
- List<String> path) {
- for (ComponentInstanceProperty componentInstanceProperty : propList) {
- if (componentInstanceProperty.getPath() == null) {
- return getPropFromListByPropNameAndType(propList, propNameToUpdate, propTypeToUpdate);
- }
- if (componentInstanceProperty.getName().equals(propNameToUpdate)
- && componentInstanceProperty.getType().equals(propTypeToUpdate)
- && path.containsAll(componentInstanceProperty.getPath())) {
- return componentInstanceProperty;
- }
- }
- return null;
- }
-
- public static ComponentInstanceProperty getPropFromListByPropIdAndPath(List<ComponentInstanceProperty> propList,
- String propId, List<String> path) {
-
- for (ComponentInstanceProperty componentInstanceProperty : propList) {
- if (path != null) {
- if (componentInstanceProperty.getUniqueId().equals(propId)
- && componentInstanceProperty.getPath().equals(path)) {
- return componentInstanceProperty;
- }
- } else {
- if (componentInstanceProperty.getUniqueId().equals(propId)) {
- return componentInstanceProperty;
- }
- }
- }
- return null;
- }
-
- public static void comparePropertyLists(List<ComponentInstanceProperty> expectedList,
- List<ComponentInstanceProperty> actualList, Boolean isUpdate) {
-
- assertTrue(
- "list size are not equals, expected size is: " + expectedList.size() + " ,actual: " + actualList.size(),
- expectedList.size() == actualList.size());
- Boolean flag = false;
- for (ComponentInstanceProperty expectedcompInstProp : expectedList) {
- for (ComponentInstanceProperty actualcompInstProp : actualList) {
- flag = comparePropertyObjects(expectedcompInstProp, actualcompInstProp, isUpdate);
- if (flag) {
- break;
- }
- }
- }
- // System.out.println("expected: " + expectedList + ", actual: " +
- // actualList);
- logger.debug("expected: {}, actual: {}", expectedList, actualList);
- assertTrue("actual lists does not contain all uniqeIds", flag);
- }
-
- public static Boolean comparePropertyObjects(ComponentInstanceProperty expectedCompInstProp,
- ComponentInstanceProperty actualCompInstProp, Boolean isUpdate) {
- String uniqueId = expectedCompInstProp.getUniqueId();
- String type = expectedCompInstProp.getType();
- String defaulValue = (String) expectedCompInstProp.getDefaultValue();
- if (actualCompInstProp.getUniqueId().equals(uniqueId)
- && actualCompInstProp.getPath().equals(expectedCompInstProp.getPath())) {
- assertTrue("expected type is: " + type + " ,actual: " + actualCompInstProp.getType(),
- actualCompInstProp.getType().equals(type));
- if (defaulValue == null) {
- assertTrue(
- "expected defaulValue is: " + defaulValue + " ,actual: " + actualCompInstProp.getDefaultValue(),
- actualCompInstProp.getDefaultValue() == defaulValue);
- } else {
- assertTrue(
- "expected defaulValue is: " + defaulValue + " ,actual: " + actualCompInstProp.getDefaultValue(),
- actualCompInstProp.getDefaultValue().equals(defaulValue));
- }
- if (isUpdate) {
- assertTrue(
- "actual [Value] parameter " + actualCompInstProp.getName()
- + "should equal to expected [Value]: " + actualCompInstProp.getValue() + " ,Value: "
- + actualCompInstProp.getValue(),
- actualCompInstProp.getValue().equals(expectedCompInstProp.getValue()));
- assertNotNull("valueId is null", actualCompInstProp.getValueUniqueUid());
- } else {
- if (defaulValue == null) {
- assertTrue(
- "actual [Value] parameter " + actualCompInstProp.getName()
- + "should equal to expected [defaultValue]: " + actualCompInstProp.getValue()
- + " ,defaultValue: " + actualCompInstProp.getDefaultValue(),
- actualCompInstProp.getValue() == expectedCompInstProp.getDefaultValue());
- } else {
- assertTrue(
- "actual [Value] parameter " + actualCompInstProp.getName()
- + "should equal to expected [defaultValue]: " + actualCompInstProp.getValue()
- + " ,defaultValue: " + actualCompInstProp.getDefaultValue(),
- actualCompInstProp.getValue().equals(expectedCompInstProp.getDefaultValue()));
- }
- assertNull("valueId is not null", actualCompInstProp.getValueUniqueUid());
- }
- return true;
- }
- return false;
- }
-
- public static List<ComponentInstanceProperty> addResourcePropertiesToList(Resource resource,
- List<ComponentInstanceProperty> listToFill) {
- for (PropertyDefinition prop : resource.getProperties()) {
- listToFill.add(new ComponentInstanceProperty(prop, null, null));
- }
- return listToFill;
- }
-
- public static List<ComponentInstanceProperty> addComponentInstPropertiesToList(Component component,
- List<ComponentInstanceProperty> listToFill, String componentId) {
-
- if (componentId != null) {
- List<ComponentInstanceProperty> list = component.getComponentInstancesProperties().get(componentId);
- for (ComponentInstanceProperty prop : list) {
- ComponentInstanceProperty componentInstanceProperty = new ComponentInstanceProperty(prop, null, null);
- componentInstanceProperty.setPath(prop.getPath());
- componentInstanceProperty.setValueUniqueUid(prop.getValueUniqueUid());
- componentInstanceProperty.setValue(prop.getValue());
- listToFill.add(componentInstanceProperty);
- }
- } else {
- Map<String, List<ComponentInstanceProperty>> componentInstancesProperties = component
- .getComponentInstancesProperties();
- for (Map.Entry<String, List<ComponentInstanceProperty>> componentInstanceProperties : componentInstancesProperties
- .entrySet()) {
- for (ComponentInstanceProperty prop : componentInstanceProperties.getValue()) {
- ComponentInstanceProperty componentInstanceProperty = new ComponentInstanceProperty(prop, null,
- null);
- componentInstanceProperty.setPath(prop.getPath());
- componentInstanceProperty.setValueUniqueUid(prop.getValueUniqueUid());
- componentInstanceProperty.setValue(prop.getValue());
- listToFill.add(componentInstanceProperty);
- }
- }
- }
-
- if (component.getComponentType().getValue().equals("Resource")) {
- for (PropertyDefinition prop : ((Resource) component).getProperties()) {
- listToFill.add(new ComponentInstanceProperty(prop, null, null));
- }
- }
- return listToFill;
- }
-
- public static ComponentInstanceProperty getCompPropInstListByInstIdAndPropName(Component component,
- ComponentInstance componentInstanceDetails, String name, String type) {
- List<ComponentInstanceProperty> propList = component.getComponentInstancesProperties()
- .get(componentInstanceDetails.getUniqueId());
- if (propList != null) {
- return getPropFromListByPropNameAndType(propList, name, type);
- }
- return null;
- }
-
- private static void updatePropertyListWithPathParameter(Resource resource, List<String> path,
- List<ComponentInstanceProperty> expectedPropertyList) {
- List<PropertyDefinition> propertyList = resource.getProperties();
- for (PropertyDefinition propertyDefinition : propertyList) {
- ComponentInstanceProperty propDetailsToRemove = PropertyRestUtils.getPropFromListByPropNameAndType(
- expectedPropertyList, propertyDefinition.getName(), propertyDefinition.getType());
- ComponentInstanceProperty propDetailsToAdd = propDetailsToRemove;
- propDetailsToAdd.setPath(path);
- expectedPropertyList.remove(propDetailsToRemove);
- expectedPropertyList.add(propDetailsToAdd);
- }
- }
-
- private static void updatePropertyListWithPathParameterOnCompInst(Service service, List<String> path,
- List<ComponentInstanceProperty> expectedPropertyList) {
- List<ComponentInstanceProperty> servicePropertyList = new ArrayList<>();
- servicePropertyList = PropertyRestUtils.addComponentInstPropertiesToList(service, servicePropertyList,
- path.get(0));
-
- for (ComponentInstanceProperty serviceCompInstProperty : servicePropertyList) {
- ComponentInstanceProperty propDetailsToRemove = PropertyRestUtils.getPropFromListByPropNameTypeAndPath(
- expectedPropertyList, serviceCompInstProperty.getName(), serviceCompInstProperty.getType(),
- serviceCompInstProperty.getPath());
- ComponentInstanceProperty propDetailsToAdd = propDetailsToRemove;
- List<String> tempPathList = new ArrayList<String>();
- for (String tempPath : path) {
- tempPathList.add(tempPath);
- }
- // path parameter can not contain the same service unique ID twice
- if (propDetailsToAdd.getPath() != null
- && !propDetailsToAdd.getPath().get(0).contains(service.getUniqueId())) {
- if (!propDetailsToAdd.getPath().containsAll(tempPathList)) {
- tempPathList.addAll(propDetailsToAdd.getPath());
- }
- }
- propDetailsToAdd.setPath(tempPathList);
- expectedPropertyList.remove(propDetailsToRemove);
- expectedPropertyList.add(propDetailsToAdd);
- }
- }
-
- public static void updatePropertyListWithPathOnResource(ComponentInstance componentInstDetails, Resource resource,
- List<ComponentInstanceProperty> list, Component container) {
- List<String> path = new ArrayList<>();
- if (container != null) {
- List<ComponentInstance> componentInstances = container.getComponentInstances();
- for (ComponentInstance componentInstance : componentInstances) {
- if (componentInstance.getNormalizedName().equals(componentInstDetails.getNormalizedName())) {
- path.add(componentInstance.getUniqueId());
- break;
- }
- }
-
- } else {
- path.add(componentInstDetails.getUniqueId());
- }
- updatePropertyListWithPathParameter(resource, path, list);
- }
-
- public static void updatePropertyListWithPathOnComponentInstance(ComponentInstance componentInstDetails,
- Service service, List<ComponentInstanceProperty> list) {
- List<String> path = new ArrayList<>();
- path.add(componentInstDetails.getUniqueId());
- updatePropertyListWithPathParameterOnCompInst(service, path, list);
- }
-
- public static RestResponse declareProporties(Component componentObject, Map<String, List<ComponentInstanceInput>> componentInstancesInputs, User sdncModifierDetails)
- throws Exception {
- Config config = Config.instance();
- String url = String.format(Urls.DECLARE_PROPERTIES, config.getCatalogBeHost(), config.getCatalogBePort(), ComponentTypeEnum.findParamByType(componentObject.getComponentType()), componentObject.getUniqueId());
- String userId = sdncModifierDetails.getUserId();
- Map<String, String> headersMap = prepareHeadersMap(userId);
- Map<String, Object> jsonBuilder = new HashMap<>();
- jsonBuilder.put("componentInstanceInputsMap", componentInstancesInputs);
- Gson gson = new Gson();
- String userBodyJson = gson.toJson(jsonBuilder);
- String calculateMD5 = GeneralUtility.calculateMD5Base64EncodedByString(userBodyJson);
- headersMap.put(HttpHeaderEnum.Content_MD5.getValue(), calculateMD5);
- HttpRequest http = new HttpRequest();
- // System.out.println(url);
- // System.out.println(userBodyJson);
- RestResponse declareProportiesResponse = http.httpSendPost(url, userBodyJson, headersMap);
- if (declareProportiesResponse.getErrorCode() == STATUS_CODE_GET_SUCCESS) {
-
- }
- return declareProportiesResponse;
- }
-
- public static RestResponse updateInput(Component componentObject, PropertyObject componentInput, User sdncModifierDetails)
- throws Exception {
- Config config = Config.instance();
- String url = String.format(Urls.UPDATE_INPUT, config.getCatalogBeHost(), config.getCatalogBePort(), componentObject.getUniqueId());
- String userId = sdncModifierDetails.getUserId();
- Map<String, String> headersMap = prepareHeadersMap(userId);
- Gson gson = new Gson();
- String userBodyJson = gson.toJson(componentInput);
- String calculateMD5 = GeneralUtility.calculateMD5Base64EncodedByString(userBodyJson);
- headersMap.put(HttpHeaderEnum.Content_MD5.getValue(), calculateMD5);
- HttpRequest http = new HttpRequest();
- // System.out.println(url);
- // System.out.println(userBodyJson);
- RestResponse declareProportiesResponse = http.httpSendPost(url, userBodyJson, headersMap);
- if (declareProportiesResponse.getErrorCode() == STATUS_CODE_GET_SUCCESS) {
-
- }
- return declareProportiesResponse;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/RequirementsUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/RequirementsUtils.java
deleted file mode 100644
index 4be1d941ce..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/RequirementsUtils.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright © 2016-2018 European Support Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openecomp.sdc.ci.tests.utils.rest;
-
-import com.google.gson.Gson;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.RequirementDetails;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-
-import java.util.List;
-
-public class RequirementsUtils extends BaseRestUtils {
- private static Gson gson = new Gson();
- private static final String COMPONENT_TYPE = "services";
-
- public static RestResponse createRequirement(String componentId,
- List<RequirementDetails> requirementDefinitionList,
- User user) throws Exception{
- Config config = Config.instance();
- String url = String.format(Urls.CREATE_REQUIREMENT, config.getCatalogBeHost(), config.getCatalogBePort(),
- COMPONENT_TYPE, componentId);
-
- String data = "{ \"requirements\" : {" + "\"" +requirementDefinitionList.get(0).getCapability()+ "\"" +" : "
- + gson.toJson(requirementDefinitionList) + " } }";
-
- return sendPost(url, data , user.getUserId(), acceptHeaderData);
- }
-
- public static RestResponse updateRequirement(String componentId,
- List<RequirementDetails> requirementDefinitionList,
- User user) throws Exception{
- Config config = Config.instance();
- String url = String.format(Urls.UPDATE_REQUIREMENT, config.getCatalogBeHost(), config.getCatalogBePort(),
- COMPONENT_TYPE, componentId);
-
- String data = "{ \"requirements\" : {" + "\"" +requirementDefinitionList.get(0).getCapability()+ "\"" +" : "
- + gson.toJson(requirementDefinitionList) + " } }";
-
- return sendPost(url, data , user.getUserId(), acceptHeaderData);
- }
-
- public static RestResponse deleteRequirement(String componentId,
- String requirementId,
- User user) throws Exception{
- Config config = Config.instance();
- String url = String.format(Urls.DELETE_REQUIREMENT, config.getCatalogBeHost(), config.getCatalogBePort(),
- COMPONENT_TYPE, componentId, requirementId);
- return sendDelete(url, user.getUserId());
- }
-
- public static RestResponse getRequirement(String componentId,
- String requirementId,
- User user) throws Exception{
- Config config = Config.instance();
- String url = String.format(Urls.GET_REQUIREMENT, config.getCatalogBeHost(), config.getCatalogBePort(),
- COMPONENT_TYPE, componentId, requirementId);
- return sendDelete(url, user.getUserId());
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtils.java
deleted file mode 100644
index 656ece54f0..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtils.java
+++ /dev/null
@@ -1,668 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.rest;
-
-import com.google.gson.Gson;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonParser;
-import org.apache.http.client.ClientProtocolException;
-import org.json.JSONException;
-import org.json.simple.JSONArray;
-import org.json.simple.JSONObject;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.model.*;
-import org.openecomp.sdc.be.resources.data.RelationshipInstData;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ImportReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.common.util.GeneralUtility;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import static org.testng.AssertJUnit.assertEquals;
-
-public class ResourceRestUtils extends BaseRestUtils {
- private static Logger logger = LoggerFactory.getLogger(ResourceRestUtils.class.getName());
-
- // ****** CREATE *******
-
- public static RestResponse createResource(ResourceReqDetails resourceDetails, User sdncModifierDetails)
- throws Exception {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.CREATE_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort());
-
- String userId = sdncModifierDetails.getUserId();
-
- Map<String, String> headersMap = prepareHeadersMap(userId);
-
- Gson gson = new Gson();
- String userBodyJson = gson.toJson(resourceDetails);
- String calculateMD5 = GeneralUtility.calculateMD5Base64EncodedByString(userBodyJson);
- headersMap.put(HttpHeaderEnum.Content_MD5.getValue(), calculateMD5);
- HttpRequest http = new HttpRequest();
- RestResponse createResourceResponse = http.httpSendPost(url, userBodyJson, headersMap);
- if (createResourceResponse.getErrorCode() == STATUS_CODE_CREATED) {
- resourceDetails.setUUID(ResponseParser.getUuidFromResponse(createResourceResponse));
- resourceDetails.setVersion(ResponseParser.getVersionFromResponse(createResourceResponse));
- resourceDetails.setUniqueId(ResponseParser.getUniqueIdFromResponse(createResourceResponse));
- String lastUpdaterUserId = ResponseParser.getValueFromJsonResponse(createResourceResponse.getResponse(),
- "lastUpdaterUserId");
- resourceDetails.setLastUpdaterUserId(lastUpdaterUserId);
- String lastUpdaterFullName = ResponseParser.getValueFromJsonResponse(createResourceResponse.getResponse(),
- "lastUpdaterFullName");
- resourceDetails.setLastUpdaterFullName(lastUpdaterFullName);
- // Creator details never change after component is created - Ella,
- // 12/1/2016
- resourceDetails.setCreatorUserId(userId);
- resourceDetails.setCreatorFullName(sdncModifierDetails.getFullName());
- }
- return createResourceResponse;
-
- }
-
- public static RestResponse createImportResource(ImportReqDetails importReqDetails, User sdncModifierDetails,
- Map<String, String> additionalHeaders) throws JSONException, IOException {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.CREATE_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort());
- String userId = sdncModifierDetails.getUserId();
-
- Gson gson = new Gson();
- String resourceImportBodyJson = gson.toJson(importReqDetails);
- HttpRequest http = new HttpRequest();
-
- Map<String, String> headersMap = prepareHeadersMap(userId);
- if (additionalHeaders != null) {
- headersMap.putAll(additionalHeaders);
- } else {
- headersMap.put(HttpHeaderEnum.Content_MD5.getValue(), ArtifactRestUtils.calculateMD5(resourceImportBodyJson));
- }
-
- RestResponse createResourceResponse = http.httpSendPost(url, resourceImportBodyJson, headersMap);
- if (createResourceResponse.getErrorCode() == STATUS_CODE_CREATED) {
- importReqDetails.setVersion(ResponseParser.getVersionFromResponse(createResourceResponse));
- importReqDetails.setUniqueId(ResponseParser.getUniqueIdFromResponse(createResourceResponse));
- // Creator details never change after component is created - Ella,
- // 12/1/2016
- importReqDetails.setCreatorUserId(userId);
- importReqDetails.setCreatorFullName(sdncModifierDetails.getFullName());
- importReqDetails
- .setToscaResourceName(ResponseParser.getToscaResourceNameFromResponse(createResourceResponse));
- importReqDetails.setDerivedList(ResponseParser.getDerivedListFromJson(createResourceResponse));
- }
- return createResourceResponse;
-
- }
-
- // ***** DELETE ****
- public static RestResponse deleteResource(ResourceReqDetails resourceDetails, User sdncModifierDetails,
- String version) throws IOException {
-
- if (resourceDetails.getUniqueId() != null) {
- Config config = Utils.getConfig();
- String url = String.format(Urls.DELETE_RESOURCE_BY_NAME_AND_VERSION, config.getCatalogBeHost(),
- config.getCatalogBePort(), resourceDetails.getName(), version);
- return sendDelete(url, sdncModifierDetails.getUserId());
- } else {
- return null;
- }
-
- }
-
- public static RestResponse markResourceToDelete(String resourceId, String userId) throws IOException {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.DELETE_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort(),
- resourceId);
- RestResponse sendDelete = sendDelete(url, userId);
-
- return sendDelete;
-
- }
-
- public static RestResponse deleteResource(String resourceId, String userId) throws IOException {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.DELETE_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort(),
- resourceId);
- RestResponse sendDelete = sendDelete(url, userId);
-
- deleteMarkedResources(userId);
-
- return sendDelete;
-
- }
-
- public static void deleteMarkedResources(String userId) throws IOException {
- String url;
- Config config = Utils.getConfig();
- url = String.format(Urls.DELETE_MARKED_RESOURCES, config.getCatalogBeHost(), config.getCatalogBePort());
- sendDelete(url, userId);
- }
-
- public static RestResponse deleteResourceByNameAndVersion(User sdncModifierDetails, String resourceName,
- String resourceVersion) throws IOException {
- Config config = Utils.getConfig();
- String url = String.format(Urls.DELETE_RESOURCE_BY_NAME_AND_VERSION, config.getCatalogBeHost(),
- config.getCatalogBePort(), resourceName, resourceVersion);
- RestResponse sendDelete = sendDelete(url, sdncModifierDetails.getUserId());
-
- deleteMarkedResources(sdncModifierDetails.getUserId());
-
- return sendDelete;
- }
-
- public static Boolean deleteResourceByNameAndVersion(String resourceName, String resourceVersion)
- throws IOException {
- RestResponse deleteResponse = ResourceRestUtils.deleteResourceByNameAndVersion(
- ElementFactory.getDefaultUser(UserRoleEnum.ADMIN), resourceName, resourceVersion);
- return checkErrorCode(deleteResponse);
- }
-
- public static Boolean removeResource(String resourceId)
- throws FileNotFoundException, IOException, ClientProtocolException {
- RestResponse response = deleteResource(resourceId,
- ElementFactory.getDefaultUser(UserRoleEnum.ADMIN).getUserId());
- return checkErrorCode(response);
- }
-
- // ************** GET *************
- public static RestResponse getResource(User sdncModifierDetails, String uniqueId) throws IOException {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort(), uniqueId);
- return sendGet(url, sdncModifierDetails.getUserId());
- }
-
- public static RestResponse getModule(User sdncModifierDetails, String componentId, String moduleId)
- throws IOException {
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_MODULE_BY_ID, config.getCatalogBeHost(), config.getCatalogBePort(),
- componentId, moduleId);
- return sendGet(url, sdncModifierDetails.getUserId());
- }
-
- public static RestResponse getLatestResourceFromCsarUuid(User sdncModifierDetails, String csarUuid)
- throws IOException {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_RESOURCE_BY_CSAR_UUID, config.getCatalogBeHost(), config.getCatalogBePort(),
- csarUuid);
- return sendGet(url, sdncModifierDetails.getUserId());
- }
-
- public static RestResponse getResource(ResourceReqDetails resourceDetails, User sdncModifierDetails)
- throws IOException {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort(),
- resourceDetails.getUniqueId());
- return sendGet(url, sdncModifierDetails.getUserId());
- }
-
- public static RestResponse getResourceByNameAndVersion(String userId, String resourceName, String resourceVersion)
- throws IOException {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_RESOURCE_BY_NAME_AND_VERSION, config.getCatalogBeHost(),
- config.getCatalogBePort(), resourceName, resourceVersion);
-
- return sendGet(url, userId);
- }
-
- public static RestResponse getResourceList(User sdncModifierDetails) throws IOException {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_FOLLWED_LIST, config.getCatalogBeHost(), config.getCatalogBePort());
-
- return sendGet(url, sdncModifierDetails.getUserId());
-
- }
-
- public static RestResponse getResourceListFilterByCategory(User sdncModifierDetails, String componentType, String category) throws IOException {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_FILTERED_ASSET_LIST, config.getCatalogBeHost(), config.getCatalogBePort(), componentType, "category=" + category);
-
- Map<String, String> headersMap = prepareHeadersMap(sdncModifierDetails.getUserId());
- headersMap.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader);
- headersMap.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), BaseRestUtils.xEcompInstanceId);
-
- return sendGet(url, sdncModifierDetails.getUserId(), headersMap);
-
- }
-
- public static RestResponse getResourceListFilterBySubCategory(User sdncModifierDetails, String componentType, String subcategory) throws IOException {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_FILTERED_ASSET_LIST, config.getCatalogBeHost(), config.getCatalogBePort(), componentType, "subCategory=" + subcategory);
-
- Map<String, String> headersMap = prepareHeadersMap(sdncModifierDetails.getUserId());
- headersMap.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader);
- headersMap.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), BaseRestUtils.xEcompInstanceId);
-
- return sendGet(url, sdncModifierDetails.getUserId(), headersMap);
-
- }
-
- public static RestResponse getResourceListFilterByCriteria(User sdncModifierDetails, String componentType, String criteria, String value) throws IOException {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_FILTERED_ASSET_LIST, config.getCatalogBeHost(), config.getCatalogBePort(), componentType, criteria + "=" + value);
-
- Map<String, String> headersMap = prepareHeadersMap(sdncModifierDetails.getUserId());
- headersMap.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader);
- headersMap.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), BaseRestUtils.xEcompInstanceId);
-
- return sendGet(url, sdncModifierDetails.getUserId(), headersMap);
-
- }
-
- public static RestResponse getResource(String resourceId) throws ClientProtocolException, IOException {
- return getResource(ElementFactory.getDefaultUser(UserRoleEnum.ADMIN), resourceId);
- }
-
- public static RestResponse getLatestResourceFromCsarUuid(String csarUuid)
- throws ClientProtocolException, IOException {
- return getLatestResourceFromCsarUuid(ElementFactory.getDefaultUser(UserRoleEnum.ADMIN), csarUuid);
- }
-
- public static RestResponse getResourceLatestVersionList(User sdncModifierDetails) throws IOException {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_RESOURCE_lATEST_VERSION, config.getCatalogBeHost(),
- config.getCatalogBePort());
-
- return sendGet(url, sdncModifierDetails.getUserId());
-
- }
-
- public static RestResponse putAllCategoriesTowardsCatalogFeWithUuidNotAllowed(String uuid) throws IOException {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_ALL_CATEGORIES_FE, config.getCatalogFeHost(), config.getCatalogFePort(),
- BaseRestUtils.RESOURCE_COMPONENT_TYPE);
-
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderData);
- headersMap.put(HttpHeaderEnum.X_ECOMP_REQUEST_ID_HEADER.getValue(), uuid);
- HttpRequest http = new HttpRequest();
-
- logger.debug("Send PUT request to get all categories (should be 405): {}", url);
- return http.httpSendByMethod(url, "PUT", null, headersMap);
- }
-
- public static RestResponse getAllTagsTowardsCatalogBe() throws IOException {
-
- Config config = Utils.getConfig();
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.GET_ALL_TAGS, config.getCatalogBeHost(), config.getCatalogBePort());
-
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderData);
-
- return http.httpSendGet(url, headersMap);
-
- }
-
- public static RestResponse getAllPropertyScopesTowardsCatalogBe() throws IOException {
-
- Config config = Utils.getConfig();
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.GET_PROPERTY_SCOPES_LIST, config.getCatalogBeHost(), config.getCatalogBePort());
-
- Map<String, String> headersMap = new HashMap<>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), BaseRestUtils.contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), BaseRestUtils.acceptHeaderData);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), "cs0008");
-
- return http.httpSendGet(url, headersMap);
-
- }
-
- public static RestResponse getAllArtifactTypesTowardsCatalogBe() throws IOException {
-
- Config config = Utils.getConfig();
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.GET_ALL_ARTIFACTS, config.getCatalogBeHost(), config.getCatalogBePort());
-
- Map<String, String> headersMap = new HashMap<>();
-
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), acceptJsonHeader);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptJsonHeader);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), "cs0008");
-
- return http.httpSendGet(url, headersMap);
-
- }
-
- public static RestResponse getConfigurationTowardsCatalogBe() throws IOException {
-
- Config config = Utils.getConfig();
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.GET_CONFIGURATION, config.getCatalogBeHost(), config.getCatalogBePort());
-
- Map<String, String> headersMap = new HashMap<>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), acceptJsonHeader);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptJsonHeader);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), "cs0008");
-
- return http.httpSendGet(url, headersMap);
-
- }
-
- public static RestResponse sendOptionsTowardsCatalogFeWithUuid() throws IOException {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_ALL_CATEGORIES_FE, config.getCatalogFeHost(), config.getCatalogFePort(),
- BaseRestUtils.RESOURCE_COMPONENT_TYPE);
-
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderData);
- HttpRequest http = new HttpRequest();
-
- logger.debug("Send OPTIONS request for categories: {}", url);
- return http.httpSendByMethod(url, "OPTIONS", null, headersMap);
- }
-
- // ********** UPDATE *************
- public static RestResponse updateResourceMetadata(ResourceReqDetails updatedResourceDetails,
- User sdncModifierDetails, String uniqueId, String encoding) throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.UPDATE_RESOURCE_METADATA, config.getCatalogBeHost(), config.getCatalogBePort(),
- uniqueId);
-
- String ContentTypeString = String.format("%s;%s", contentTypeHeaderData, encoding);
-
- Gson gson = new Gson();
- String userBodyJson = gson.toJson(updatedResourceDetails);
- String userId = sdncModifierDetails.getUserId();
-
- RestResponse updateResourceResponse = sendPut(url, userBodyJson, userId, ContentTypeString);
-
- updatedResourceDetails.setVersion(ResponseParser.getVersionFromResponse(updateResourceResponse));
- updatedResourceDetails.setUniqueId(ResponseParser.getUniqueIdFromResponse(updateResourceResponse));
-
- return updateResourceResponse;
- }
-
- public static RestResponse updateResourceTEST(Resource resource, User sdncModifierDetails, String uniqueId,
- String encoding) throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.UPDATE_RESOURCE_METADATA, config.getCatalogBeHost(), config.getCatalogBePort(),
- uniqueId);
-
- String ContentTypeString = String.format("%s;%s", contentTypeHeaderData, encoding);
-
- Gson gson = new Gson();
- String userBodyJson = gson.toJson(resource);
- String userId = sdncModifierDetails.getUserId();
-
- RestResponse updateResourceResponse = sendPut(url, userBodyJson, userId, ContentTypeString);
-
- // String resourceUniqueId =
- // ResponseParser.getValueFromJsonResponse(updateResourceResponse.getResponse(),
- // "uniqueId");
- // updatedResourceDetails.setUniqueId(resourceUniqueId);
- // String resourceVersion =
- // ResponseParser.getValueFromJsonResponse(updateResourceResponse.getResponse(),
- // "version");
- // updatedResourceDetails.setUniqueId(resourceVersion);
-
- return updateResourceResponse;
- }
-
- public static RestResponse updateResourceMetadata(ResourceReqDetails updatedResourceDetails,
- User sdncModifierDetails, String uniqueId) throws Exception {
- return updateResourceMetadata(updatedResourceDetails, sdncModifierDetails, uniqueId, "");
- }
-
- public static RestResponse updateResourceMetadata(String json, User sdncModifierDetails, String resourceId)
- throws IOException {
- Config config = Utils.getConfig();
- String url = String.format(Urls.UPDATE_RESOURCE_METADATA, config.getCatalogBeHost(), config.getCatalogBePort(),
- resourceId);
- String userId = sdncModifierDetails.getUserId();
-
- RestResponse updateResourceResponse = sendPut(url, json, userId, contentTypeHeaderData);
-
- return updateResourceResponse;
- }
-
- public static RestResponse updateResource(ResourceReqDetails resourceDetails, User sdncModifierDetails,
- String resourceId) throws IOException {
-
- String userId = sdncModifierDetails.getUserId();
- Config config = Utils.getConfig();
- String url = String.format(Urls.UPDATE_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort(),
- resourceId);
-
- Map<String, String> headersMap = prepareHeadersMap(userId);
-
- Gson gson = new Gson();
- String userBodyJson = gson.toJson(resourceDetails);
- String calculateMD5 = GeneralUtility.calculateMD5Base64EncodedByString(userBodyJson);
- headersMap.put(HttpHeaderEnum.Content_MD5.getValue(), calculateMD5);
- HttpRequest http = new HttpRequest();
- RestResponse updateResourceResponse = http.httpSendPut(url, userBodyJson, headersMap);
- if (updateResourceResponse.getErrorCode() == STATUS_CODE_UPDATE_SUCCESS) {
- resourceDetails.setUUID(ResponseParser.getUuidFromResponse(updateResourceResponse));
- resourceDetails.setVersion(ResponseParser.getVersionFromResponse(updateResourceResponse));
- resourceDetails.setUniqueId(ResponseParser.getUniqueIdFromResponse(updateResourceResponse));
- String lastUpdaterUserId = ResponseParser.getValueFromJsonResponse(updateResourceResponse.getResponse(),
- "lastUpdaterUserId");
- resourceDetails.setLastUpdaterUserId(lastUpdaterUserId);
- String lastUpdaterFullName = ResponseParser.getValueFromJsonResponse(updateResourceResponse.getResponse(),
- "lastUpdaterFullName");
- resourceDetails.setLastUpdaterFullName(lastUpdaterFullName);
- resourceDetails.setCreatorUserId(userId);
- resourceDetails.setCreatorFullName(sdncModifierDetails.getFullName());
- }
- return updateResourceResponse;
- }
-
- public static RestResponse createResourceInstance(ResourceReqDetails resourceDetails, User modifier,
- String vfResourceUniqueId) throws Exception {
- ComponentInstanceReqDetails resourceInstanceReqDetails = ElementFactory
- .getComponentResourceInstance(resourceDetails);
- RestResponse createResourceInstanceResponse = ComponentInstanceRestUtils.createComponentInstance(
- resourceInstanceReqDetails, modifier, vfResourceUniqueId, ComponentTypeEnum.RESOURCE);
- ResourceRestUtils.checkCreateResponse(createResourceInstanceResponse);
- return createResourceInstanceResponse;
- }
-
- public static RestResponse associateResourceInstances(JSONObject body, User sdncModifierDetails,
- Component component) throws IOException {
-
- Config config = Utils.getConfig();
- Gson gson = new Gson();
- String bodyJson = gson.toJson(body);
- component.getComponentType();
- String componentType = ComponentTypeEnum.findParamByType(component.getComponentType());
- String url = String.format(Urls.ASSOCIATE__RESOURCE_INSTANCE, config.getCatalogBeHost(),
- config.getCatalogBePort(), componentType, component.getUniqueId());
- return sendPost(url, bodyJson, sdncModifierDetails.getUserId(), null);
-
- }
-
- public static RestResponse getFollowedList(User sdncModifierDetails) throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_FOLLWED_LIST, config.getCatalogBeHost(), config.getCatalogBePort());
- return sendGet(url, sdncModifierDetails.getUserId());
- }
-
- public static List<Resource> restResponseToResourceObjectList(String restResponse) {
- JsonElement jelement = new JsonParser().parse(restResponse);
- JsonArray jsonArray = jelement.getAsJsonArray();
- List<Resource> restResponseArray = new ArrayList<>();
- Resource resource = null;
- for (int i = 0; i < jsonArray.size(); i++) {
- String resourceString = (String) jsonArray.get(i).toString();
- resource = ResponseParser.convertResourceResponseToJavaObject(resourceString);
- restResponseArray.add(resource);
- }
-
- return restResponseArray;
-
- }
-
- public static Resource getResourceObjectFromResourceListByUid(List<Resource> resourceList, String uid) {
- if (resourceList != null && resourceList.size() > 0) {
- for (Resource resource : resourceList) {
- if (resource.getUniqueId().equals(uid))
- return resource;
- }
- } else
- return null;
- return null;
- }
-
- // =======================================resource
- // associate==================================================
- public static RestResponse associate2ResourceInstances(Component container, ComponentInstance fromNode,
- ComponentInstance toNode, String assocType, User sdncUserDetails) throws IOException {
- return associate2ResourceInstances(container, fromNode.getUniqueId(), toNode.getUniqueId(), assocType,
- sdncUserDetails);
- }
-
- public static RestResponse associate2ResourceInstances(Component component, String fromNode, String toNode,
- String assocType, User sdncUserDetails) throws IOException {
-
- RelationshipInstData relationshipInstData = new RelationshipInstData();
- Map<String, List<CapabilityDefinition>> capabilitiesMap = component.getCapabilities();
- Map<String, List<RequirementDefinition>> requirementMap = component.getRequirements();
- List<CapabilityDefinition> capabilitiesList = capabilitiesMap.get(assocType);
- List<RequirementDefinition> requirementList = requirementMap.get(assocType);
-
- RequirementDefinition requirementDefinitionFrom = getRequirementDefinitionByOwnerId(requirementList, fromNode);
- CapabilityDefinition capabilityDefinitionTo = getCapabilityDefinitionByOwnerId(capabilitiesList, toNode);
- relationshipInstData.setCapabilityOwnerId(capabilityDefinitionTo.getOwnerId());
- relationshipInstData.setCapabiltyId(capabilityDefinitionTo.getUniqueId());
- relationshipInstData.setRequirementOwnerId(requirementDefinitionFrom.getOwnerId());
- relationshipInstData.setRequirementId(requirementDefinitionFrom.getUniqueId());
-
- JSONObject assocBody = assocBuilder(relationshipInstData, capabilityDefinitionTo, requirementDefinitionFrom,
- toNode, fromNode);
- return ResourceRestUtils.associateResourceInstances(assocBody, sdncUserDetails, component);
-
- }
-
- private static JSONObject assocBuilder(RelationshipInstData relationshipInstData,
- CapabilityDefinition capabilityDefinitionTo, RequirementDefinition requirementDefinitionFrom, String toNode,
- String fromNode) {
-
- String type = capabilityDefinitionTo.getType();
- String requirement = requirementDefinitionFrom.getName();
- String capability = requirementDefinitionFrom.getName();
-
- JSONObject wrapper = new JSONObject();
- JSONArray relationshipsArray = new JSONArray();
- JSONObject relationship = new JSONObject();
- JSONObject simpleObject = new JSONObject();
-
- relationship.put("type", type);
- simpleObject.put("relationship", relationship);
- simpleObject.put("requirement", requirement);
- simpleObject.put("capability", capability);
- simpleObject.put("capabilityUid", relationshipInstData.getCapabiltyId());
- simpleObject.put("capabilityOwnerId", relationshipInstData.getCapabilityOwnerId());
- simpleObject.put("requirementOwnerId", relationshipInstData.getRequirementOwnerId());
- simpleObject.put("requirementUid", relationshipInstData.getRequirementId());
- relationshipsArray.add(simpleObject);
-
- ArrayList<Object> relationships = new ArrayList<Object>(relationshipsArray);
- wrapper.put("fromNode", fromNode);
- wrapper.put("toNode", toNode);
- wrapper.put("relationships", relationships);
- return wrapper;
-
- }
-
- private static CapabilityDefinition getCapabilityDefinitionByOwnerId(
- List<CapabilityDefinition> capabilityDefinitionList, String ownerId) {
-
- for (CapabilityDefinition capabilityDefinition : capabilityDefinitionList) {
- if (capabilityDefinition.getOwnerId().equals(ownerId)) {
- return capabilityDefinition;
- }
- }
- return null;
- }
-
- private static RequirementDefinition getRequirementDefinitionByOwnerId(
- List<RequirementDefinition> requirementDefinitionList, String ownerId) {
-
- for (RequirementDefinition requirementDefinition : requirementDefinitionList) {
- if (requirementDefinition.getOwnerId().equals(ownerId)) {
- return requirementDefinition;
- }
- }
- return null;
- }
-
- public static String getRiUniqueIdByRiName(Component component, String resourceInstanceName) {
-
- List<ComponentInstance> componentInstances = component.getComponentInstances();
- String name = null;
- for (ComponentInstance componentInstance : componentInstances) {
- if (componentInstance.getName().equals(resourceInstanceName)) {
- name = componentInstance.getUniqueId();
- break;
- }
- }
- return name;
- }
-
- public static Resource convertResourceGetResponseToJavaObject(ResourceReqDetails resourceDetails)
- throws IOException {
- RestResponse response = ResourceRestUtils.getResource(resourceDetails,
- ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- assertEquals("Check response code after get resource", 200, response.getErrorCode().intValue());
- return ResponseParser.convertResourceResponseToJavaObject(response.getResponse());
- }
-
- public static RestResponse changeResourceInstanceVersion(String containerUniqueId, String instanceToReplaceUniqueId,
- String newResourceUniqueId, User sdncModifierDetails, ComponentTypeEnum componentType) throws IOException {
- return ProductRestUtils.changeServiceInstanceVersion(containerUniqueId, instanceToReplaceUniqueId,
- newResourceUniqueId, sdncModifierDetails, componentType);
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtilsExternalAPI.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtilsExternalAPI.java
deleted file mode 100644
index f09b14cc62..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtilsExternalAPI.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.rest;
-
-import com.google.gson.Gson;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceExternalReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.common.util.GeneralUtility;
-
-import java.util.Map;
-
-public class ResourceRestUtilsExternalAPI extends BaseRestUtils {
-
- public static RestResponse createResource(ResourceExternalReqDetails resourceDetails, User sdncModifierDetails)
- throws Exception {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.POST_EXTERNAL_API_CREATE_RESOURCE, config.getCatalogBeHost(), config.getCatalogBePort());
-
- String userId = sdncModifierDetails.getUserId();
- Map<String, String> headersMap = prepareHeadersMap(userId);
-
- Gson gson = new Gson();
- String userBodyJson = gson.toJson(resourceDetails);
- String calculateMD5 = GeneralUtility.calculateMD5Base64EncodedByString(userBodyJson);
- headersMap.put(HttpHeaderEnum.Content_MD5.getValue(), calculateMD5);
- headersMap.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader);
- headersMap.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), BaseRestUtils.xEcompInstanceId);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
-
- HttpRequest http = new HttpRequest();
- RestResponse createResourceResponse = http.httpSendPost(url, userBodyJson, headersMap);
-
- return createResourceResponse;
- }
-
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResponseParser.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResponseParser.java
deleted file mode 100644
index 5254db84fa..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResponseParser.java
+++ /dev/null
@@ -1,698 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.rest;
-
-//import com.fasterxml.jackson.databind.DeserializationFeature;
-//import com.fasterxml.jackson.databind.ObjectMapper;
-//import com.fasterxml.jackson.databind.module.SimpleModule;
-//import com.google.gson.*;
-//import org.apache.commons.codec.binary.Base64;
-//import org.apache.log4j.Logger;
-//import org.codehaus.jackson.JsonNode;
-//
-//import org.json.JSONArray;
-//import org.json.JSONException;
-//import org.json.simple.JSONObject;
-//import org.json.simple.JSONValue;
-//import org.openecomp.sdc.be.model.*;
-//import org.openecomp.sdc.be.model.category.CategoryDefinition;
-//import org.openecomp.sdc.be.model.operations.impl.PropertyOperation.PropertyConstraintJacksonDeserializer;;
-//import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
-//import org.openecomp.sdc.ci.tests.datatypes.ResourceAssetStructure;
-//import org.openecomp.sdc.ci.tests.datatypes.ResourceRespJavaObject;
-//import org.openecomp.sdc.ci.tests.datatypes.ServiceDistributionStatus;
-//import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-//import org.openecomp.sdc.ci.tests.tosca.datatypes.VfModuleDefinition;
-//import org.openecomp.sdc.ci.tests.utils.Utils;
-//import org.yaml.snakeyaml.Yaml;
-//
-//import java.io.ByteArrayInputStream;
-//import java.io.IOException;
-//import java.io.InputStream;
-//import java.text.ParseException;
-//import java.util.*;
-
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.exc.InvalidFormatException;
-import com.fasterxml.jackson.databind.module.SimpleModule;
-import com.google.gson.*;
-import org.apache.commons.codec.binary.Base64;
-import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.LogManager;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.simple.JSONObject;
-import org.json.simple.JSONValue;
-import org.openecomp.sdc.be.model.*;
-import org.openecomp.sdc.be.model.category.CategoryDefinition;
-import org.openecomp.sdc.be.model.operations.impl.PropertyOperation;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceAssetStructure;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceRespJavaObject;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceDistributionStatus;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.VfModuleDefinition;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.yaml.snakeyaml.Yaml;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.text.ParseException;
-import java.util.*;
-
-//import org.codehaus.jackson.JsonNode;
-
-public class ResponseParser {
-
- // comment by Andrey, for test only
- // public static void main(String[] args) {
- // String response =
- // "{\"uniqueId\":\"52eb0139-a855-47b9-a0e6-c90f0a90b1d2\",\"resourceName\":\"importResource4test\",\"resourceVersion\":\"0.1\",\"creatorUserId\":\"jh0003\",\"creatorFullName\":\"Jimmy
- // Hendrix\",\"lastUpdaterUserId\":\"jh0003\",\"lastUpdaterFullName\":\"Jimmy
- // Hendrix\",\"creationDate\":1446742241514,\"lastUpdateDate\":1446742241514,\"description\":\"Represents
- // a generic software component that can be managed and run by a Compute
- // Node
- // Type.\",\"icon\":\"defaulticon\",\"tags\":[\"importResource4test\"],\"category\":\"Generic/Infrastructure\",\"lifecycleState\":\"NOT_CERTIFIED_CHECKOUT\",\"derivedFrom\":[\"tosca.nodes.Root\"],\"artifacts\":{},\"deploymentArtifacts\":{},\"properties\":[{\"uniqueId\":\"52eb0139-a855-47b9-a0e6-c90f0a90b1d2.port\",\"type\":\"integer\",\"required\":false,\"description\":\"the
- // port the DBMS service will listen to for data and
- // requests\",\"password\":false,\"name\":\"port\",\"parentUniqueId\":\"52eb0139-a855-47b9-a0e6-c90f0a90b1d2\",\"definition\":true},{\"uniqueId\":\"52eb0139-a855-47b9-a0e6-c90f0a90b1d2.root_password\",\"type\":\"string\",\"required\":false,\"description\":\"the
- // optional root password for the DBMS
- // service\",\"password\":false,\"name\":\"root_password\",\"parentUniqueId\":\"52eb0139-a855-47b9-a0e6-c90f0a90b1d2\",\"definition\":true}],\"interfaces\":{\"standard\":{\"type\":\"tosca.interfaces.node.lifecycle.Standard\",\"uniqueId\":\"tosca.interfaces.node.lifecycle.standard\",\"operations\":{\"stop\":{\"uniqueId\":\"tosca.interfaces.node.lifecycle.standard.stop\",\"description\":\"Standard
- // lifecycle stop
- // operation.\",\"definition\":false},\"start\":{\"uniqueId\":\"tosca.interfaces.node.lifecycle.standard.start\",\"description\":\"Standard
- // lifecycle start
- // operation.\",\"definition\":false},\"delete\":{\"uniqueId\":\"tosca.interfaces.node.lifecycle.standard.delete\",\"description\":\"Standard
- // lifecycle delete
- // operation.\",\"definition\":false},\"create\":{\"uniqueId\":\"tosca.interfaces.node.lifecycle.standard.create\",\"description\":\"Standard
- // lifecycle create
- // operation.\",\"definition\":false},\"configure\":{\"uniqueId\":\"tosca.interfaces.node.lifecycle.standard.configure\",\"description\":\"Standard
- // lifecycle configure
- // operation.\",\"definition\":false}},\"definition\":false}},\"capabilities\":{\"feature\":{\"uniqueId\":\"capability.8313348e-3623-4f4a-9b8f-d2fbadaf9a31.feature\",\"type\":\"tosca.capabilities.Node\"},\"feature2\":{\"uniqueId\":\"capability.52eb0139-a855-47b9-a0e6-c90f0a90b1d2.feature2\",\"type\":\"tosca.capabilities.Node\"}},\"requirements\":{\"dependency\":{\"uniqueId\":\"8313348e-3623-4f4a-9b8f-d2fbadaf9a31.dependency\",\"capability\":\"tosca.capabilities.Node\",\"node\":\"tosca.nodes.Root\",\"relationship\":\"tosca.relationships.DependsOn\"},\"dependency2\":{\"uniqueId\":\"52eb0139-a855-47b9-a0e6-c90f0a90b1d2.dependency2\",\"capability\":\"tosca.capabilities.Node\",\"node\":\"tosca.nodes.importResource4test\",\"relationship\":\"tosca.relationships.DependsOn\"}},\"vendorName\":\"ATT
- // (Tosca)\",\"vendorRelease\":\"1.0.0.wd03\",\"contactId\":\"jh0003\",\"systemName\":\"Importresource4test\",\"additionalInformation\":[{\"uniqueId\":\"52eb0139-a855-47b9-a0e6-c90f0a90b1d2.additionalinformation\",\"lastCreatedCounter\":0,\"parentUniqueId\":\"52eb0139-a855-47b9-a0e6-c90f0a90b1d2\",\"parameters\":[]}],\"allVersions\":{\"0.1\":\"52eb0139-a855-47b9-a0e6-c90f0a90b1d2\"},\"abstract\":false,\"highestVersion\":true,\"uuid\":\"2e91a2df-b066-49bb-abde-4c1c01e409db\"}";
- // convertResourceResponseToJavaObject(response);
- // }
-
- private static final String INVARIANT_UUID = "invariantUUID";
- public static final String UNIQUE_ID = "uniqueId";
- public static final String VERSION = "version";
- public static final String UUID = "uuid";
- public static final String NAME = "name";
- public static final String ORIGIN_TYPE = "originType";
- public static final String TOSCA_RESOURCE_NAME = "toscaResourceName";
-
- static Logger logger = LogManager.getLogger(ResponseParser.class);
-
- public static String getValueFromJsonResponse(String response, String fieldName) {
- try {
-// JSONObject jsonResp = (JSONObject) JSONValue.parse(response);
- String[] split = fieldName.split(":");
- String fieldValue = response;
-
- for(int i=0; i<split.length; i++) {
- fieldValue = parser(fieldValue, split[i]);
- }
- return fieldValue;
- } catch (Exception e) {
- return null;
- }
-
- }
-
- private static String parser(String response, String field){
- JSONObject fieldValue = (JSONObject) JSONValue.parse(response);
- return fieldValue.get(field).toString();
- }
-
- public static String getUniqueIdFromResponse(RestResponse response) {
- return getValueFromJsonResponse(response.getResponse(), UNIQUE_ID);
- }
-
- public static String getInvariantUuid(RestResponse response) {
- return getValueFromJsonResponse(response.getResponse(), INVARIANT_UUID);
- }
-
- public static String getUuidFromResponse(RestResponse response) {
- return getValueFromJsonResponse(response.getResponse(), UUID);
- }
-
- public static String getNameFromResponse(RestResponse response) {
- return getValueFromJsonResponse(response.getResponse(), NAME);
- }
-
- public static String getVersionFromResponse(RestResponse response) {
- return ResponseParser.getValueFromJsonResponse(response.getResponse(), VERSION);
- }
-
- public static String getComponentTypeFromResponse(RestResponse response) {
- return ResponseParser.getValueFromJsonResponse(response.getResponse(), ORIGIN_TYPE);
- }
-
- public static String getToscaResourceNameFromResponse(RestResponse response) {
- return getValueFromJsonResponse(response.getResponse(), TOSCA_RESOURCE_NAME);
- }
-
- @SuppressWarnings("unchecked")
- public static ResourceRespJavaObject parseJsonListReturnResourceDetailsObj(RestResponse restResponse,
- String resourceType, String searchPattern, String expectedResult) throws Exception {
-
- // Gson gson = new Gson;
-
- JsonElement jElement = new JsonParser().parse(restResponse.getResponse());
- JsonObject jObject = jElement.getAsJsonObject();
- JsonArray arrayOfObjects = (JsonArray) jObject.get(resourceType);
- Gson gson = new Gson();
- Map<String, Object> map = new HashMap<>();
- ResourceRespJavaObject jsonToJavaObject = new ResourceRespJavaObject();
-
- for (int counter = 0; counter < arrayOfObjects.size(); counter++) {
- JsonObject jHitObject = (JsonObject) arrayOfObjects.get(counter);
-
- map = (Map<String, Object>) gson.fromJson(jHitObject.toString(), map.getClass());
- if (map.get(searchPattern).toString().contains(expectedResult)) {
-
- jsonToJavaObject = gson.fromJson(jObject, ResourceRespJavaObject.class);
- break;
- }
- }
- return jsonToJavaObject;
-
- }
-
- private static ObjectMapper newObjectMapper() {
- SimpleModule module = new SimpleModule("customDeserializationModule");
- module.addDeserializer(PropertyConstraint.class, new PropertyOperation.PropertyConstraintJacksonDeserializer());
- return new ObjectMapper()
- .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
- .registerModule(module);
- }
-
- public static Resource convertResourceResponseToJavaObject(String response) {
- ObjectMapper mapper = newObjectMapper();
- Resource resource = null;
- try {
- mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- resource = mapper.readValue(response, Resource.class);
-
- logger.debug(resource.toString());
- } catch (IOException e) {
- try {
- List<Resource> resources = Arrays.asList(mapper.readValue(response.toString(), Resource[].class));
- resource = resources.get(0);
- } catch (Exception e1) {
- e1.printStackTrace();
- }
- }
-
- return resource;
- }
-
- public static ComponentInstanceProperty convertPropertyResponseToJavaObject(String response) {
-
- ObjectMapper mapper = newObjectMapper();
- ComponentInstanceProperty propertyDefinition = null;
- try {
- propertyDefinition = mapper.readValue(response, ComponentInstanceProperty.class);
- logger.debug(propertyDefinition.toString());
- } catch (IOException e) {
- e.printStackTrace();
- }
- return propertyDefinition;
- }
-
- public static GroupDefinition convertPropertyResponseToObject(String response) {
-
- ObjectMapper mapper = newObjectMapper();
- GroupDefinition groupDefinition = null;
- try {
- groupDefinition = mapper.readValue(response, GroupDefinition.class);
- logger.debug(groupDefinition.toString());
- } catch (IOException e) {
- e.printStackTrace();
- }
- return groupDefinition;
- }
-
- public static String toJson(Object object) {
- Gson gson = new Gson();
- return gson.toJson(object);
- }
-
- public static ArtifactDefinition convertArtifactDefinitionResponseToJavaObject(String response) {
- ObjectMapper mapper = new ObjectMapper();
- ArtifactDefinition artifactDefinition = null;
- try {
- mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- artifactDefinition = mapper.readValue(response, ArtifactDefinition.class);
- logger.debug(artifactDefinition.toString());
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- return artifactDefinition;
-
- }
-
- public static ArtifactReqDetails convertArtifactReqDetailsToJavaObject(String response) {
-
- ArtifactReqDetails artifactReqDetails = null;
- Gson gson = new Gson();
- artifactReqDetails = gson.fromJson(response, ArtifactReqDetails.class);
- return artifactReqDetails;
- }
-
- public static <T> T parseToObject(String json, Class<T> clazz) {
- Gson gson = new Gson();
- T object;
- try {
- object = gson.fromJson(json, clazz);
- } catch (Exception e) {
- object = parseToObjectUsingMapper(json, clazz);
- }
- return object;
- }
-
- public static <T> T parseToObjectUsingMapper(String json, Class<T> clazz) {
- // Generic convert
- ObjectMapper mapper = newObjectMapper();
- T object = null;
- try {
- object = mapper.readValue(json, clazz);
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- return object;
- }
-
- public static ArtifactReqDetails convertArtifactDefinitionToArtifactReqDetailsObject(
- ArtifactDefinition artifactDefinition) {
-
- ArtifactReqDetails artifactReqDetails = null;
- Gson gson = new Gson();
- String artDef = gson.toJson(artifactDefinition);
- artifactReqDetails = gson.fromJson(artDef, ArtifactReqDetails.class);
- return artifactReqDetails;
- }
-
- /*public static Service convertServiceResponseToJavaObject(String response) {
-
- ObjectMapper mapper = newObjectMapper();
- Service service = null;
- try {
- service = mapper.readValue(response, Service.class);
- logger.debug(service.toString());
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- return service;
- }*/
- public static Service convertServiceResponseToJavaObject(String response) {
-
- ObjectMapper mapper = newObjectMapper();
- Service service = null;
- try {
- service = mapper.readValue(response, Service.class);
- logger.debug(service.toString());
- //Temporary catch until bug with distribution status fixed
- } catch (InvalidFormatException e) {
- System.out.println("broken service with invalid distribution status : " + response);
- logger.debug("broken service with invalid distribution status : " + response);
- return service;
- } catch(IOException e){
-
- e.printStackTrace();
- }
-
- return service;
-}
-
- public static Product convertProductResponseToJavaObject(String response) {
-
- ObjectMapper mapper = newObjectMapper();
- Product product = null;
- try {
- product = mapper.readValue(response, Product.class);
- logger.debug(product.toString());
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- return product;
- }
-
- public static ComponentInstance convertComponentInstanceResponseToJavaObject(String response) {
-
- ObjectMapper mapper = newObjectMapper();
- ComponentInstance componentInstance = null;
- try {
- componentInstance = mapper.readValue(response, ComponentInstance.class);
- logger.debug(componentInstance.toString());
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- return componentInstance;
- }
-
- public static List<String> getValuesFromJsonArray(RestResponse message) throws Exception {
- List<String> artifactTypesArrayFromApi = new ArrayList<>();
-
- org.json.JSONObject responseObject = new org.json.JSONObject(message.getResponse());
- JSONArray jArr = responseObject.getJSONArray("artifactTypes");
-
- for (int i = 0; i < jArr.length(); i++) {
- org.json.JSONObject jObj = jArr.getJSONObject(i);
- String value = jObj.get("name").toString();
-
- artifactTypesArrayFromApi.add(value);
- }
- return artifactTypesArrayFromApi;
- }
-
- public static String calculateMD5Header(ArtifactReqDetails artifactDetails) {
- Gson gson = new Gson();
- String jsonBody = gson.toJson(artifactDetails);
- // calculate MD5 for json body
- return calculateMD5(jsonBody);
-
- }
-
- public static String calculateMD5(String data) {
- String calculatedMd5 = org.apache.commons.codec.digest.DigestUtils.md5Hex(data);
- // encode base-64 result
- byte[] encodeBase64 = Base64.encodeBase64(calculatedMd5.getBytes());
- String encodeBase64Str = new String(encodeBase64);
- return encodeBase64Str;
-
- }
-
- public static List<Map<String, Object>> getAuditFromMessage(Map<String, Object> auditingMessage) {
- List<Map<String, Object>> auditList = new ArrayList<>();
- auditList.add(auditingMessage);
- return auditList;
- }
-
- public static List<CategoryDefinition> parseCategories(RestResponse getAllCategoriesRest) {
-
- List<CategoryDefinition> categories = new ArrayList<>();
- try {
- JsonElement jElement = new JsonParser().parse(getAllCategoriesRest.getResponse());
- JsonArray cagegories = jElement.getAsJsonArray();
- Iterator<JsonElement> iter = cagegories.iterator();
- while (iter.hasNext()) {
- JsonElement next = iter.next();
- CategoryDefinition category = ResponseParser.parseToObject(next.toString(), CategoryDefinition.class);
- categories.add(category);
- }
-
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- return categories;
- }
-
- public static JSONArray getListFromJson(RestResponse res, String field) throws JSONException {
- String valueFromJsonResponse = getValueFromJsonResponse(res.getResponse(), field);
- JSONArray jArr = new JSONArray(valueFromJsonResponse);
-
- return jArr;
- }
-
- public static List<String> getDerivedListFromJson(RestResponse res) throws JSONException {
- JSONArray listFromJson = getListFromJson(res, "derivedFrom");
- List<String> lst = new ArrayList<>();
- for (int i = 0; i < listFromJson.length(); i++) {
- lst.add(listFromJson.getString(i));
- }
-
- return lst;
- }
-
- public static Map<String, Object> convertStringToMap(String obj) {
- Map<String, Object> object = (Map<String, Object>) JSONValue.parse(obj);
- return object;
- }
-
- public static List<Map<String, Object>> getListOfMapsFromJson(RestResponse res, String field) throws Exception {
- List<Map<String, Object>> list = new ArrayList<>();
- JSONArray listFromJson = getListFromJson(res, field);
- for (int i = 0; i < listFromJson.length(); i++) {
- Map<String, Object> convertStringToMap = convertStringToMap(listFromJson.getString(i));
- list.add(convertStringToMap);
- }
- return list;
-
- }
-
- public static Map<String, Object> getJsonValueAsMap(RestResponse response, String key) {
- String valueField = getValueFromJsonResponse(response.getResponse(), key);
- Map<String, Object> convertToMap = convertStringToMap(valueField);
- return convertToMap;
- }
-
- public static String getJsonObjectValueByKey(String metadata, String key) {
- JsonElement jelement = new JsonParser().parse(metadata);
-
- JsonObject jobject = jelement.getAsJsonObject();
- Object obj = jobject.get(key);
- if (obj == null) {
- return null;
- } else {
- return obj.toString();
- }
- }
-
-// /*public static Map<String, List<Component>> convertCatalogResponseToJavaObject(String response) {
-//
-// // Map<String, ArrayList<Component>> map = new HashMap<String,
-// // ArrayList<Component>>();
-// Map<String, List<Component>> map = new HashMap<>();
-//
-// JsonElement jElement = new JsonParser().parse(response);
-// JsonObject jObject = jElement.getAsJsonObject();
-// JsonArray jArrReousrces = jObject.getAsJsonArray("resources");
-// JsonArray jArrServices = jObject.getAsJsonArray("services");
-// //Product removed
-//// JsonArray jArrProducts = jObject.getAsJsonArray("products");
-// //Product removed
-// if (jArrReousrces != null && jArrServices != null /*&& jArrProducts != null*/){
-//
-//
-// //////// RESOURCE/////////////////////////////
-// ArrayList<Component> restResponseArray = new ArrayList<>();
-// Component component = null;
-// for (int i = 0; i < jArrReousrces.size(); i++) {
-// String resourceString = (String) jArrReousrces.get(i).toString();
-// component = ResponseParser.convertResourceResponseToJavaObject(resourceString);
-// restResponseArray.add(component);
-// }
-//
-// map.put("resources", restResponseArray);
-//
-// ///////// SERVICE/////////////////////////////
-//
-// restResponseArray = new ArrayList<>();
-// component = null;
-// for (int i = 0; i < jArrServices.size(); i++) {
-// String resourceString = (String) jArrServices.get(i).toString();
-// component = ResponseParser.convertServiceResponseToJavaObject(resourceString);
-// restResponseArray.add(component);
-// }
-//
-// map.put("services", restResponseArray);
-////Product removed
-// ///////// PRODUCT/////////////////////////////
-//// restResponseArray = new ArrayList<>();
-//// component = null;
-//// for (int i = 0; i < jArrProducts.size(); i++) {
-//// String resourceString = (String) jArrProducts.get(i).toString();
-//// component = ResponseParser.convertProductResponseToJavaObject(resourceString);
-//// restResponseArray.add(component);
-//// }
-////
-//// map.put("products", restResponseArray);
-////
-// }
-// else {
-// map.put("resources", new ArrayList<>());
-// map.put("services", new ArrayList<>());
-// //Product removed
-//// map.put("products", new ArrayList<>());
-// }
-//
-// return map;
-//
-// }*/
-
- public static Map<String, List<Component>> convertCatalogResponseToJavaObject(String response) {
-
- // Map<String, ArrayList<Component>> map = new HashMap<String,
- // ArrayList<Component>>();
- Map<String, List<Component>> map = new HashMap<>();
-
- JsonElement jElement = new JsonParser().parse(response);
- JsonObject jObject = jElement.getAsJsonObject();
- JsonArray jArrReousrces = jObject.getAsJsonArray("resources");
- JsonArray jArrServices = jObject.getAsJsonArray("services");
- //Product removed
-// JsonArray jArrProducts = jObject.getAsJsonArray("products");
- //Product removed
-
- if (jArrReousrces != null && jArrServices != null /*&& jArrProducts != null*/){
-
-
- //////// RESOURCE/////////////////////////////
- ArrayList<Component> restResponseArray = new ArrayList<>();
- Component component = null;
- for (int i = 0; i < jArrReousrces.size(); i++) {
- String resourceString = (String) jArrReousrces.get(i).toString();
- component = ResponseParser.convertResourceResponseToJavaObject(resourceString);
- restResponseArray.add(component);
- }
-
- map.put("resources", restResponseArray);
-
- ///////// SERVICE/////////////////////////////
-
- restResponseArray = new ArrayList<>();
- component = null;
- for (int i = 0; i < jArrServices.size(); i++) {
- String resourceString = (String) jArrServices.get(i).toString();
- component = ResponseParser.convertServiceResponseToJavaObject(resourceString);
- restResponseArray.add(component);
- }
-
- map.put("services", restResponseArray);
-//Product removed
-
- ///////// PRODUCT/////////////////////////////
-// restResponseArray = new ArrayList<>();
-// component = null;
-// for (int i = 0; i < jArrProducts.size(); i++) {
-// String resourceString = (String) jArrProducts.get(i).toString();
-// component = ResponseParser.convertProductResponseToJavaObject(resourceString);
-// restResponseArray.add(component);
-// }
-//
-
-
-// map.put("products", restResponseArray);
-//
-
- }
- else {
- map.put("resources", new ArrayList<>());
- map.put("services", new ArrayList<>());
- //Product removed
-// map.put("products", new ArrayList<>());
- }
-
- return map;
-
- }
-
- public static Map<Long, ServiceDistributionStatus> convertServiceDistributionStatusToObject(String response) throws ParseException {
-
- Map<Long, ServiceDistributionStatus> serviceDistributionStatusMap = new HashMap<>();
- ServiceDistributionStatus serviceDistributionStatusObject = null;
-
- JsonElement jElement = new JsonParser().parse(response);
- JsonObject jObject = jElement.getAsJsonObject();
- JsonArray jDistrStatusArray = jObject.getAsJsonArray("distributionStatusOfServiceList");
-
- for (int i = 0; i < jDistrStatusArray.size(); i++){
- Gson gson = new Gson();
- String servDistrStatus = gson.toJson(jDistrStatusArray.get(i));
- serviceDistributionStatusObject = gson.fromJson(servDistrStatus, ServiceDistributionStatus.class);
- serviceDistributionStatusMap.put(Utils.getEpochTimeFromUTC(serviceDistributionStatusObject.getTimestamp()), serviceDistributionStatusObject);
- }
-
- return serviceDistributionStatusMap;
-
- }
-
- public static Map<String, String> getPropertiesNameType(RestResponse restResponse)
- throws JSONException {
- Map<String, String> propertiesMap = new HashMap<>();
- JSONArray propertiesList = getListFromJson(restResponse, "properties");
- for (int i = 0; i < propertiesList.length() ; i ++){
- JSONObject prop = (JSONObject) JSONValue.parse(propertiesList.get(i).toString());
- String propName = prop.get("name").toString();
- String propType = prop.get("type").toString();
- propertiesMap.put(propName, propType);
- }
-
- return propertiesMap;
- }
-
- public static ResourceAssetStructure getDataOutOfSearchExternalAPIResponseForResourceName(String response, String resourceName) {
- Gson gson = new Gson();
- JsonElement jsonElement = new JsonParser().parse(response);
- JsonArray jsonArray = jsonElement.getAsJsonArray();
- for(JsonElement jElement: jsonArray) {
- ResourceAssetStructure parsedResponse = gson.fromJson(jElement, ResourceAssetStructure.class);
-
- if(resourceName.contains(parsedResponse.getName()) && parsedResponse.getName().contains(resourceName)) {
- return parsedResponse;
- }
- }
-
- return null;
- }
-
- public static Map<String, VfModuleDefinition> convertVfModuleJsonResponseToJavaObject(String response) {
-
- Yaml yaml = new Yaml();
- InputStream inputStream = null;
- inputStream = new ByteArrayInputStream(response.getBytes());
- List<?> list = (List<?> )yaml.load(inputStream);
- ObjectMapper mapper = new ObjectMapper();
-
- VfModuleDefinition moduleDefinition;
- Map<String, VfModuleDefinition> vfModulesMap = new HashMap<>();
- for (Object obj : list) {
-// TODO Andrey L. uncomment line below in case to ignore on unknown properties, not recommended
- mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- moduleDefinition = mapper.convertValue(obj, VfModuleDefinition.class);
- vfModulesMap.put(moduleDefinition.vfModuleModelName, moduleDefinition);
- }
- return vfModulesMap;
- }
-
- public static InterfaceDefinition convertInterfaceDefinitionResponseToJavaObject(String response) {
- ObjectMapper mapper = new ObjectMapper();
- InterfaceDefinition interfaceDefinition = null;
- try {
- mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- interfaceDefinition = mapper.readValue(response, InterfaceDefinition.class);
- logger.debug(interfaceDefinition.toString());
- }
- catch (IOException e) {
- logger.debug(e);
- }
- return interfaceDefinition;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ServiceFilterUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ServiceFilterUtils.java
deleted file mode 100644
index ce2760a7d3..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ServiceFilterUtils.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.rest;
-
-import com.google.gson.Gson;
-
-import java.util.List;
-
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceFilterDetails;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ServiceFilterUtils extends BaseRestUtils {
-
- private static Logger logger = LoggerFactory.getLogger(ServiceFilterUtils.class.getName());
-
- private static Gson gson = new Gson();
-
- public static RestResponse createServiceFilter(String externalServiceId, String proxyServiceId,
- ServiceFilterDetails serviceFilterDetails,
- User user) throws Exception{
- Config config = Config.instance();
-
- String url = String.format(Urls.CREATE_SERVICE_FILTER, config.getCatalogBeHost(), config.getCatalogBePort(),
- externalServiceId, proxyServiceId);
-
- return sendPost(url, gson.toJson(serviceFilterDetails), user.getUserId(), acceptHeaderData);
- }
-
- public static RestResponse updateServiceFilter(String externalServiceId, String proxyServiceId,
- List<ServiceFilterDetails> serviceFilterDetailsList,
- User user) throws Exception{
- Config config = Config.instance();
-
- String url = String.format(Urls.UPDATE_SERVICE_FILTER, config.getCatalogBeHost(), config.getCatalogBePort(),
- externalServiceId, proxyServiceId);
-
- return sendPut(url, gson.toJson(serviceFilterDetailsList), user.getUserId(), acceptHeaderData);
- }
-
- public static RestResponse deleteServiceFilter(String externalServiceId, String proxyServiceId,
- int constraintIndex,
- User user) throws Exception{
- Config config = Config.instance();
-
- String url = String.format(Urls.DELETE_SERVICE_FILTER, config.getCatalogBeHost(), config.getCatalogBePort(),
- externalServiceId, proxyServiceId, constraintIndex);
-
- return sendDelete(url, user.getUserId());
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ServiceRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ServiceRestUtils.java
deleted file mode 100644
index ec132f0f5a..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ServiceRestUtils.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.rest;
-
-import com.google.gson.Gson;
-import org.json.simple.JSONArray;
-import org.json.simple.JSONObject;
-import org.json.simple.JSONValue;
-import org.openecomp.sdc.be.model.Service;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-public class ServiceRestUtils extends BaseRestUtils {
- private static Logger logger = LoggerFactory.getLogger(ServiceRestUtils.class.getName());
- // ****** CREATE *******
-
- private static Gson gson = new Gson();
-
- public static RestResponse deleteService(String serviceName, String version, User sdncModifierDetails)
- throws IOException {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.DELETE_SERVICE_BY_NAME_AND_VERSION, config.getCatalogBeHost(),
- config.getCatalogBePort(), serviceName, version);
-
- String userId = sdncModifierDetails.getUserId();
- RestResponse sendDelete = sendDelete(url, userId);
- deleteMarkedServices(userId);
- return sendDelete;
- }
-
- public static RestResponse markServiceToDelete(String resourceId, String userId) throws IOException {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.DELETE_SERVICE, config.getCatalogBeHost(), config.getCatalogBePort(), resourceId);
- RestResponse sendDelete = sendDelete(url, userId);
-
- return sendDelete;
-
- }
-
- public static RestResponse deleteServiceById(String serviceId, String userId) throws IOException {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.DELETE_SERVICE, config.getCatalogBeHost(), config.getCatalogBePort(), serviceId);
- RestResponse sendDelete = sendDelete(url, userId);
- deleteMarkedServices(userId);
- return sendDelete;
- }
-
- public static void deleteMarkedServices(String userId) throws IOException {
- String url;
- Config config = Utils.getConfig();
- url = String.format(Urls.DELETE_MARKED_SERVICES, config.getCatalogBeHost(), config.getCatalogBePort());
- sendDelete(url, userId);
- }
-
- public static RestResponse createService(ServiceReqDetails service, User user) throws Exception {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.CREATE_SERVICE, config.getCatalogBeHost(), config.getCatalogBePort());
- String serviceBodyJson = gson.toJson(service);
-
- logger.debug("Send POST request to create service: {}", url);
- logger.debug("Service body: {}", serviceBodyJson);
-
- RestResponse res = sendPost(url, serviceBodyJson, user.getUserId(), acceptHeaderData);
- if (res.getErrorCode() == STATUS_CODE_CREATED) {
- service.setUniqueId(ResponseParser.getUniqueIdFromResponse(res));
- service.setName(ResponseParser.getNameFromResponse(res));
- service.setVersion(ResponseParser.getVersionFromResponse(res));
- service.setUUID(ResponseParser.getUuidFromResponse(res));
- // Creator details never change after component is created - Ella,
- // 12/1/2016
- service.setCreatorUserId(user.getUserId());
- service.setCreatorFullName(user.getFullName());
- }
-
- return res;
- }
-
- public static RestResponse updateService(ServiceReqDetails service, User user) throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.UPDATE_SERVICE_METADATA, config.getCatalogBeHost(), config.getCatalogBePort(),
- service.getUniqueId());
- String serviceBodyJson = gson.toJson(service);
-
- logger.debug("Send PUT request to create service: {}", url);
- logger.debug("Service body: {}", serviceBodyJson);
-
- RestResponse res = sendPut(url, serviceBodyJson, user.getUserId(), acceptHeaderData);
- if (res.getErrorCode() == STATUS_CODE_CREATED) {
- service.setUniqueId(ResponseParser.getUniqueIdFromResponse(res));
- service.setVersion(ResponseParser.getVersionFromResponse(res));
- }
-
- return res;
- }
-
- public static RestResponse getService(String serviceId) throws IOException {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_SERVICE, config.getCatalogBeHost(), config.getCatalogBePort(), serviceId);
- return getServiceFromUrl(url, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), false);
- }
-
- public static RestResponse getServiceToscaArtifacts(String serviceId) throws IOException {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_INSTANCE_TOSCA_ARTIFACTS, config.getCatalogBeHost(),
- config.getCatalogBePort(), "services", serviceId);
- return getServiceFromUrl(url, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), false);
- }
-
- public static RestResponse getService(ServiceReqDetails serviceReqDetails, User sdncModifierDetails)
- throws IOException {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_SERVICE, config.getCatalogBeHost(), config.getCatalogBePort(),
- serviceReqDetails.getUniqueId());
- return getServiceFromUrl(url, sdncModifierDetails, false);
- }
-
- public static RestResponse getService(String serviceId, User sdncModifierDetails) throws IOException {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_SERVICE, config.getCatalogBeHost(), config.getCatalogBePort(), serviceId);
- return getServiceFromUrl(url, sdncModifierDetails, false);
- }
-
- public static RestResponse getServiceByNameAndVersion(User sdncModifierDetails, String serviceName,
- String serviceVersion) throws IOException {
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_SERVICE_BY_NAME_AND_VERSION, config.getCatalogBeHost(),
- config.getCatalogBePort(), serviceName, serviceVersion);
- return getServiceFromUrl(url, sdncModifierDetails, false);
- }
-
- public static RestResponse getServiceFromUrl(String url, User sdncModifierDetails, boolean isCached)
- throws IOException {
- Map<String, String> headersMap = prepareHeadersMap(sdncModifierDetails, isCached);
- HttpRequest http = new HttpRequest();
- logger.debug("Send GET request to create service: {}", url);
- logger.debug("Service headers: {}", headersMap);
- RestResponse sendGetServerRequest = http.httpSendGet(url, headersMap);
-
- return sendGetServerRequest;
- }
-
- public static Map<String, String> prepareHeadersMap(User sdncModifierDetails, boolean isCached) {
- Map<String, String> headersMap = new HashMap<>();
- if (isCached)
- headersMap.put(HttpHeaderEnum.CACHE_CONTROL.getValue(), BaseRestUtils.cacheControlHeader);
-
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), BaseRestUtils.contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), BaseRestUtils.acceptHeaderData);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
- return headersMap;
- }
-
- public static RestResponse approveServiceDistribution(String serviceId, String userId) throws Exception {
- return changeServiceDistributionState(serviceId, userId, Urls.APPROVE_DISTRIBUTION);
- }
-
- public static RestResponse rejectServiceDistribution(String serviceId, String userId) throws Exception {
- return changeServiceDistributionState(serviceId, userId, Urls.REJECT_DISTRIBUTION);
- }
-
- // Benny
- public static RestResponse rejectServiceDistribution(String serviceId, String userId, String comment)
- throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(Urls.REJECT_DISTRIBUTION, config.getCatalogBeHost(), config.getCatalogBePort(),
- serviceId);
- String userBodyJson = gson.toJson(comment);
- return sendPost(url, userBodyJson, userId, BaseRestUtils.acceptHeaderData);
-
- }
-
- private static RestResponse changeServiceDistributionState(String serviceId, String userId, String distributionUrl)
- throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(distributionUrl, config.getCatalogBeHost(), config.getCatalogBePort(), serviceId);
- String defComment = "{ userRemarks : \"this is an test\" }";
- String userBodyJson = gson.toJson(defComment);
- return sendPost(url, userBodyJson, userId, acceptHeaderData);
-
- }
-
- public static RestResponse getServiceLatestVersionList(User sdncModifierDetails) throws IOException {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.GET_SERVICE_lATEST_VERSION, config.getCatalogBeHost(),
- config.getCatalogBePort());
-
- return sendGet(url, sdncModifierDetails.getUserId());
-
- }
-
- public static RestResponse createServiceByHttpMethod(ServiceReqDetails serviceDetails, User sdncModifierDetails,
- String method, String urls) throws IOException {
- Map<String, String> headersMap = prepareHeadersMap(sdncModifierDetails, true);
-
- Config config = Utils.getConfig();
- String serviceBodyJson = gson.toJson(serviceDetails);
- HttpRequest http = new HttpRequest();
- String url = String.format(urls, config.getCatalogBeHost(), config.getCatalogBePort());
- // TODO: ADD AUTHENTICATION IN REQUEST
- logger.debug(url);
- logger.debug("Send {} request to create user: {}",method,url);
- logger.debug("User body: {}", serviceBodyJson);
- logger.debug("User headers: {}", headersMap);
- RestResponse sendCreateUserRequest = http.httpSendByMethod(url, method, serviceBodyJson, headersMap);
-
- return sendCreateUserRequest;
-
- }
-
- public static RestResponse deleteServiceByNameAndVersion(User sdncModifierDetails, String serviceName,
- String serviceVersion) throws IOException {
- Config config = Utils.getConfig();
-
- Map<String, String> headersMap = prepareHeadersMap(sdncModifierDetails, true);
-
- HttpRequest http = new HttpRequest();
-
- String url = String.format(Urls.DELETE_SERVICE_BY_NAME_AND_VERSION, config.getCatalogBeHost(),
- config.getCatalogBePort(), serviceName, serviceVersion);
- RestResponse deleteResponse = http.httpSendDelete(url, headersMap);
-
- deleteMarkedServices(sdncModifierDetails.getUserId());
- return deleteResponse;
- }
-
- public static RestResponse getFollowed(User user) throws Exception {
- Config config = Utils.getConfig();
-
- HttpRequest httpRequest = new HttpRequest();
-
- String url = String.format(Urls.GET_FOLLWED_LIST, config.getCatalogBeHost(), config.getCatalogBePort());
-
- Map<String, String> headersMap = new HashMap<>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), BaseRestUtils.contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), BaseRestUtils.acceptHeaderData);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), user.getUserId());
-
- RestResponse getResourceNotAbstarctResponse = httpRequest.httpSendGet(url, headersMap);
-
- return getResourceNotAbstarctResponse;
- }
-
- public static JSONArray getListArrayFromRestResponse(RestResponse restResponse) {
- String json = restResponse.getResponse();
- JSONObject jsonResp = (JSONObject) JSONValue.parse(json);
- JSONArray servicesArray = (JSONArray) jsonResp.get("services");
-
- logger.debug("services= {}", servicesArray);
-
- return servicesArray;
- }
-
- public static RestResponse getDistributionServiceList(Service service, User user) throws IOException {
-
- Config config = Utils.getConfig();
- String url = String.format(Urls.DISTRIBUTION_SERVICE_LIST, config.getCatalogBeHost(), config.getCatalogBePort(), service.getUUID());
- return getServiceFromUrl(url, user, false);
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/UserRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/UserRestUtils.java
deleted file mode 100644
index 1a5136ef05..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/UserRestUtils.java
+++ /dev/null
@@ -1,298 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.rest;
-
-import com.google.gson.Gson;
-import org.apache.commons.lang.StringUtils;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.run.StartTest;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-public class UserRestUtils extends BaseRestUtils {
-
- static Gson gson = new Gson();
-
- static Logger logger = LoggerFactory.getLogger(UserRestUtils.class.getName());
- static String contentTypeHeaderData = "application/json";
- static String acceptHeaderDate = "application/json";
-
- public UserRestUtils() {
- super();
-
- StartTest.enableLogger();
- }
-
- public static RestResponse createUser(User sdncUserDetails, User sdncModifierDetails) throws IOException {
-
- Config config = Utils.getConfig();
-
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
-
- String userBodyJson = gson.toJson(sdncUserDetails);
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.CREATE_USER, config.getCatalogBeHost(), config.getCatalogBePort());
-
- logger.debug("Send POST request to create user: {}", url);
- logger.debug("User body: {}", userBodyJson);
- logger.debug("User headers: {}", headersMap);
- RestResponse sendCreateUserRequest = http.httpSendPost(url, userBodyJson, headersMap);
-
- return sendCreateUserRequest;
-
- }
-
- public static RestResponse deactivateUser(User sdncUserDetails, User sdncModifierDetails) throws IOException {
- return deleteUser(sdncUserDetails, sdncModifierDetails, true);
- }
-
- public static RestResponse deActivateUser(User sdncUserDetails, User sdncModifierDetails) throws IOException {
- return deleteUser(sdncUserDetails, sdncModifierDetails, false);
- }
-
- public static RestResponse deleteUser(User sdncUserDetails, User sdncModifierDetails, boolean isForceDelete)
- throws IOException {
-
- Config config = Utils.getConfig();
-
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
- if (isForceDelete) {
- headersMap.put(User.FORCE_DELETE_HEADER_FLAG, User.FORCE_DELETE_HEADER_FLAG);
- }
-
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.DELETE_USER, config.getCatalogBeHost(), config.getCatalogBePort(),
- sdncUserDetails.getUserId());
- RestResponse sendDeleteUserRequest = http.httpSendDelete(url, headersMap);
- return sendDeleteUserRequest;
-
- }
-
- public static RestResponse updateUser(User sdncUserDetails, User sdncModifierDetails)
- throws IOException, CloneNotSupportedException {
-
- Config config = Utils.getConfig();
- User user = new User(sdncModifierDetails);
-
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
-
- user.setUserId(StringUtils.EMPTY);
- user.setRole(StringUtils.EMPTY);
-
- Gson gson = new Gson();
- String userBodyJson = gson.toJson(user);
- logger.debug("userBodyJson: {}", userBodyJson);
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.UPDATE_USER, config.getCatalogBeHost(), config.getCatalogBePort(),
- sdncModifierDetails.getUserId());
- RestResponse sendUpdateUserRequest = http.httpSendPost(url, userBodyJson, headersMap);
-
- return sendUpdateUserRequest;
- }
-
- /// Benny
- public static RestResponse updateUserRole(User sdncUserDetails, User sdncModifierDetails, String userIdToUpdate)
- throws IOException {
-
- Config config = Utils.getConfig();
-
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
-
- Gson gson = new Gson();
- String userBodyJson = gson.toJson(sdncUserDetails);
- logger.debug("userBodyJson: {}", userBodyJson);
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.UPDATE_USER_ROLE, config.getCatalogBeHost(), config.getCatalogBePort(),
- userIdToUpdate);
- RestResponse sendUpdateUserRequest = http.httpSendPost(url, userBodyJson, headersMap);
-
- return sendUpdateUserRequest;
-
- }
-
- public static RestResponse getUser(User sdncUserDetails, User sdncModifierDetails) throws IOException {
-
- Config config = Utils.getConfig();
-
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.GET_USER, config.getCatalogBeHost(), config.getCatalogBePort(),
- sdncUserDetails.getUserId());
- RestResponse sendGetUserRequest = http.httpSendGet(url, headersMap);
- return sendGetUserRequest;
-
- }
-
- public static RestResponse getUserRole(User sdncUserDetails, User sdncModifierDetails) throws IOException {
-
- Config config = Utils.getConfig();
-
- Map<String, String> headersMap = new HashMap<>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.GET_USER_ROLE, config.getCatalogBeHost(), config.getCatalogBePort(),
- sdncUserDetails.getUserId());
- RestResponse sendGetUserRequest = http.httpSendGet(url, headersMap);
- return sendGetUserRequest;
-
- }
-
-
-
- public static RestResponse getAllAdminUsers(User sdncModifierDetails) throws IOException {
-
- Config config = Utils.getConfig();
-
- Map<String, String> headersMap = new HashMap<>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
-
- // Gson gson = new Gson();
- // String userBodyJson = gson.toJson(sdncModifierDetails);
- // System.out.println(userBodyJson);
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.GET_ALL_ADMIN_USERS, config.getCatalogBeHost(), config.getCatalogBePort());
- logger.debug("Send following url: {} and headers: {}",url, headersMap.toString());
- RestResponse sendGetUserRequest = http.httpSendGet(url, headersMap);
-
- return sendGetUserRequest;
-
- }
-
- // US571255
- public static RestResponse getUsersByRoles(User sdncModifierDetails, String roles) throws IOException {
-
- Config config = Utils.getConfig();
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
- HttpRequest http = new HttpRequest();
- String url;
- if (roles == "/") {
- url = String.format(Urls.GET_ALL_USERS, config.getCatalogBeHost(), config.getCatalogBePort());
- } else {
- url = String.format(Urls.GET_USERS_BY_ROLES, config.getCatalogBeHost(), config.getCatalogBePort(), roles);
-
- }
- logger.debug("Send following url: {} and headers: {}",url, headersMap.toString());
- RestResponse sendGetUserRequest = http.httpSendGet(url, headersMap);
- return sendGetUserRequest;
- }
-
- public static RestResponse getUsersByRolesHttpCspAtuUidIsMissing(User sdncModifierDetails, String roles)
- throws Exception {
-
- Config config = Utils.getConfig();
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncModifierDetails.getUserId());
- headersMap.remove("USER_ID");
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.GET_USERS_BY_ROLES, config.getCatalogBeHost(), config.getCatalogBePort(),
- roles);
- logger.debug(
- "Send following url without USER_ID header : " + url + " headers: " + headersMap.toString());
-
- RestResponse sendGetUserRequest = http.httpSendGet(url, headersMap);
- return sendGetUserRequest;
- }
-
- public static RestResponse authorizedUserTowardsCatalogBe(User sdncUserDetails) throws IOException {
-
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "application/json");
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), "application/json");
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncUserDetails.getUserId());
- if (sdncUserDetails.getFirstName() != null) {
- headersMap.put(HttpHeaderEnum.HTTP_CSP_FIRSTNAME.getValue(), sdncUserDetails.getFirstName());
- }
- if (sdncUserDetails.getLastName() != null) {
- headersMap.put(HttpHeaderEnum.HTTP_CSP_LASTNAME.getValue(), sdncUserDetails.getLastName());
- }
- if (sdncUserDetails.getEmail() != null) {
- headersMap.put(HttpHeaderEnum.HTTP_CSP_EMAIL.getValue(), sdncUserDetails.getEmail());
- }
-
- logger.debug("headersMap: {}", headersMap.toString());
-
- Config config = Utils.getConfig();
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.AUTHORIZE_USER, config.getCatalogBeHost(), config.getCatalogBePort());
- logger.debug("Send GET request to login as seal user : {}", url);
- return http.httpSendGet(url, headersMap);
- }
-
- public static RestResponse authorizedUserTowardsCatalogBeQA(User sdncUserDetails) throws IOException {
-
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "application/json");
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), "application/json");
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), sdncUserDetails.getUserId());
- if (sdncUserDetails.getFirstName() != null) {
- headersMap.put(HttpHeaderEnum.HTTP_CSP_FIRSTNAME.getValue(), sdncUserDetails.getFirstName());
- }
- if (sdncUserDetails.getLastName() != null) {
- headersMap.put(HttpHeaderEnum.HTTP_CSP_LASTNAME.getValue(), sdncUserDetails.getLastName());
- }
- if (sdncUserDetails.getEmail() != null) {
- headersMap.put(HttpHeaderEnum.HTTP_CSP_EMAIL.getValue(), sdncUserDetails.getEmail());
- }
-
- logger.debug("headersMap: {}", headersMap.toString());
-
- Config config = Utils.getConfig();
- HttpRequest http = new HttpRequest();
- String url = String.format(Urls.AUTHORIZE_USER, config.getCatalogBeHost(), config.getCatalogBePort());
- logger.debug("Send GET request to login as seal user : {}", url);
- return http.httpSendGet(url, headersMap);
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ArtifactValidationUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ArtifactValidationUtils.java
deleted file mode 100644
index 62d491a3b1..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ArtifactValidationUtils.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.validation;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonParser;
-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.resources.data.DAOArtifactData;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.Decoder;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.ci.tests.utils.general.FileUtils;
-import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertTrue;
-
-public class ArtifactValidationUtils {
-
- private static String desc = "description";
- private static String artifactType = "artifactType";
- private static String artifactName = "artifactName";
- private static String artifactChecksum = "artifactChecksum";
- private static String uniqueId = "uniqueId";
- protected Utils utils;
-
- public static void validateInformationalArtifact(ArtifactReqDetails expectedArtifact,
- Map<String, Object> actualArtifact) {
- assertTrue("description is not as expected",
- expectedArtifact.getDescription().equals(actualArtifact.get(desc).toString()));
- assertTrue("artifactType is not as expected",
- expectedArtifact.getArtifactType().toUpperCase().equals(actualArtifact.get(artifactType).toString()));
- assertTrue("artifactName is not as expected",
- expectedArtifact.getArtifactName().equals(actualArtifact.get(artifactName).toString()));
- assertTrue("uniqueId is not as expected",
- expectedArtifact.getUniqueId().equals(actualArtifact.get(uniqueId).toString()));
- assertTrue("description is not as expected", expectedArtifact.getArtifactLabel().toLowerCase()
- .equals(actualArtifact.get("artifactLabel").toString()));
- }
-
- public static void validateArtifactsNumberInComponent(Component component, ArtifactGroupTypeEnum artifactGroupType,
- ArtifactTypeEnum artifactType, int expectedNumber) {
- Map<String, ArtifactDefinition> deploymentArtifacts;
- int counter = 0;
- if (artifactGroupType == ArtifactGroupTypeEnum.DEPLOYMENT) {
- deploymentArtifacts = component.getDeploymentArtifacts();
- } else {
- deploymentArtifacts = component.getArtifacts();
- }
- if (deploymentArtifacts != null) {
- for (ArtifactDefinition artifactDefinition : deploymentArtifacts.values()) {
- if (artifactDefinition.getArtifactType().equals(artifactType.getType())) {
- counter++;
- }
- }
- }
- assertEquals("Unexpected number of " + artifactGroupType.getType() + " artifacts in component", expectedNumber,
- counter);
- }
-
- // Benny
- public static void validateArtifactsNumberInComponentInstance(ComponentInstance componentInstance,
- ArtifactGroupTypeEnum artifactGroupType, ArtifactTypeEnum artifactType, int expectedNumber) {
- Map<String, ArtifactDefinition> deploymentArtifacts = null;
- int counter = 0;
- if (artifactGroupType == ArtifactGroupTypeEnum.DEPLOYMENT) {
- deploymentArtifacts = componentInstance.getDeploymentArtifacts();
- }
- if (deploymentArtifacts != null) {
- for (ArtifactDefinition artifactDefinition : deploymentArtifacts.values()) {
- if (artifactDefinition.getArtifactType().equals(artifactType.getType())) {
- counter++;
- }
- }
- }
- assertEquals("Unexpected number of " + artifactGroupType.getType() + " artifacts in component", expectedNumber,
- counter);
- }
-
- public static DAOArtifactData parseArtifactRespFromES(RestResponse resResponse) throws Exception {
- String bodyToParse = resResponse.getResponse();
- JsonElement jElement = new JsonParser().parse(bodyToParse);
- JsonElement jsourceElement = jElement.getAsJsonObject().get("_source");
-
- ObjectMapper mapper = new ObjectMapper();
-
- return mapper.readValue(jsourceElement.toString(), DAOArtifactData.class);
-
- }
-
- public static void validateArtifactReqVsResp(ArtifactReqDetails expectedArtifactDetails,
- ArtifactDefinition actualArtifactJavaObject) {
- String expected;
-
- expected = expectedArtifactDetails.getArtifactName();
- if (expected == null)
- expected = "";
- assertEquals("artifact name is not correct ", expected, actualArtifactJavaObject.getArtifactName());
-
- expected = expectedArtifactDetails.getArtifactType();
- if (expected == null)
- expected = "";
- assertEquals("artifact type is not correct ", expected, actualArtifactJavaObject.getArtifactType());
-
- expected = expectedArtifactDetails.getDescription();
- if (expected == null)
- expected = "";
- assertEquals("artifact description is not correct ", expected, actualArtifactJavaObject.getDescription());
-
- expected = expectedArtifactDetails.getArtifactLabel();
- if (expected == null || expected == "") {
- expected = expectedArtifactDetails.getArtifactName().toLowerCase().substring(0,
- expectedArtifactDetails.getArtifactName().lastIndexOf("."));
- // expected = tmp.substring(0,
- // artifactInfo.getArtifactName().lastIndexOf("."));
- }
- assertEquals("artifact label is not correct ", expected, actualArtifactJavaObject.getArtifactLabel());
-
- expected = expectedArtifactDetails.getUrl();
- if (expected != "") {
- assertEquals(expected, actualArtifactJavaObject.getApiUrl());
- assertEquals(expectedArtifactDetails.getArtifactDisplayName(),
- actualArtifactJavaObject.getArtifactDisplayName());
- }
-
- // assertEquals(validChecksum,
- // actualArtifactJavaObject.getArtifactChecksum());
-
- // expected = expectedArtifactDetails.getArtifactDisplayName();
- // if (expected != "")
- // {
- // assertEquals(expected,
- // actualArtifactJavaObject.getArtifactDisplayName());
- // }
-
- boolean actual = actualArtifactJavaObject.getMandatory();
- assertEquals(expectedArtifactDetails.isMandatory(), actual);
-
- if (actualArtifactJavaObject.getServiceApi()) {
-
- boolean actual2 = actualArtifactJavaObject.getServiceApi();
- assertEquals(expectedArtifactDetails.isServiceApi(), actual2);
- }
-
- }
-
- public static void validateEsArtifactReqVsResp(ArtifactReqDetails expectedArtifactInfo,
- DAOArtifactData DAOArtifactData) throws Exception {
- String expectedArtifactUid = expectedArtifactInfo.getUniqueId();
- if (expectedArtifactUid == null)
- expectedArtifactUid = "";
- assertEquals("artifact name is not correct ", expectedArtifactUid, DAOArtifactData.getId());
-
- String actualPayload = Decoder.encode(DAOArtifactData.getData().array());
- assertEquals("artifact payloadData is not correct ", expectedArtifactInfo.getPayload(), actualPayload);
- }
-
- public static List<String> getListOfArtifactFromFolder(String folderName) throws IOException, Exception {
- Config config = Utils.getConfig();
- String sourceDir = config.getResourceConfigDir();
- String testResourcesPath = sourceDir + File.separator + folderName;
- List<String> listofFiles = FileUtils.getFileListFromBaseDirectoryByTestName(testResourcesPath);
- return listofFiles;
- }
-
- public static ArtifactReqDetails replaceDefaultArtWithArtFromList_(ArtifactReqDetails heatArtifactDetails,
- String heatExtension, String folderName, int positionInlist) throws IOException, Exception {
-
- Config config = Utils.getConfig();
- String ext = heatExtension;
- String sourceDir = config.getResourceConfigDir();
- String testResourcesPath = sourceDir + File.separator + folderName;
- List<String> listFileName = FileUtils.getFileListFromBaseDirectoryByTestName(testResourcesPath);
- String payload = FileUtils.loadPayloadFile(listFileName, ext, true);
- heatArtifactDetails.setPayload(payload);
- heatArtifactDetails.setArtifactName(listFileName.get(positionInlist) + "." + ext);
- return heatArtifactDetails;
- }
-
- public static ArtifactReqDetails replaceDefaultArtWithArtFromList(ArtifactReqDetails heatArtifactDetails,
- String heatExtension, String folderName, int positionInlist) throws IOException, Exception {
- List<String> listOfArtifactFromFolder = getListOfArtifactFromFolder(folderName);
- String payload = FileUtils.loadPayloadFileFromListUsingPosition(listOfArtifactFromFolder, heatExtension, true,
- positionInlist);
- heatArtifactDetails.setPayload(payload);
- heatArtifactDetails.setArtifactName(heatArtifactDetails.getArtifactType()
- + listOfArtifactFromFolder.get(positionInlist) + "." + heatExtension);
- return heatArtifactDetails;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/AuditValidationUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/AuditValidationUtils.java
deleted file mode 100644
index 1758fce232..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/AuditValidationUtils.java
+++ /dev/null
@@ -1,1005 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.validation;
-
-import com.datastax.driver.core.ColumnDefinitions;
-import com.datastax.driver.core.Row;
-import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.LogManager;
-import org.codehaus.jettison.json.JSONArray;
-import org.codehaus.jettison.json.JSONException;
-import org.codehaus.jettison.json.JSONObject;
-import org.javatuples.Pair;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.datatypes.elements.ConsumerDataDefinition;
-import org.openecomp.sdc.be.model.ArtifactDefinition;
-import org.openecomp.sdc.be.model.LifecycleStateEnum;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.be.model.category.CategoryDefinition;
-import org.openecomp.sdc.be.model.category.GroupingDefinition;
-import org.openecomp.sdc.be.model.category.SubCategoryDefinition;
-import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.AuditEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.AuditJsonKeysEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ComponentType;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
-import org.openecomp.sdc.ci.tests.datatypes.expected.*;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.run.StartTest;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.ci.tests.utils.cassandra.CassandraUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.CategoryRestUtils.CategoryAuditJsonKeysEnum;
-import org.openecomp.sdc.ci.tests.utils.rest.ConsumerRestUtils.EcompConsumerAuditJsonKeysEnum;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.openecomp.sdc.common.api.Constants;
-import org.openecomp.sdc.common.datastructure.AuditingFieldsKey;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.*;
-
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertTrue;
-
-public class AuditValidationUtils {
- protected static Logger logger = LogManager.getLogger(AuditValidationUtils.class);
- private static final String auditKeySpaceName = "sdcaudit";
-
- public AuditValidationUtils() {
- super();
-
- StartTest.enableLogger();
- logger = LogManager.getLogger(AuditValidationUtils.class);
-
- }
-
- public static String buildAuditDescription(ErrorInfo errorInfo, List<String> errorVariablesList) {
- String auditDesc;
- if(errorInfo.getMessageId() != null){
- auditDesc = errorInfo.getMessageId() + ": " + errorInfo.getMessage();
- }else{
- auditDesc = errorInfo.getMessage();
- }
-
-// if(! variables.isEmpty() && variables.get(0) != null && ! variables.get(0).isEmpty()){
-// for (int i = 0; i < variables.size(); i++) {
-// if (auditDesc.contains("%" + (i + 1))) {
-// auditDesc = auditDesc.replace("%" + (i + 1), variables.get(i));
-// }
-// }
-// }
- if(errorVariablesList != null && ! errorVariablesList.isEmpty() && errorVariablesList.get(0) != null){
- for (int i = 0; i < errorVariablesList.size(); i++) {
- if (auditDesc.contains("%" + (i + 1))) {
- auditDesc = auditDesc.replace("%" + (i + 1), errorVariablesList.get(i));
- }
- }
- }
- return auditDesc;
- }
-
- public static String getModifierString(String userName, String uid) {
-
- if (userName.isEmpty() && uid.isEmpty())
- return "(UNKNOWN)";
-
- StringBuilder sb = new StringBuilder();
- sb.append(userName).append("(").append(uid).append(")");
- return sb.toString();
-
- }
-
- public static void validateAuditDownloadExternalAPI(ExpectedResourceAuditJavaObject resourceAuditJavaObject,
- String action, String body, boolean checkAllFields) throws Exception {
- Map<String, Object> actualAuditRecords = parseAuditResourceByAction(action, null);
-
- validateField(actualAuditRecords, AuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
- validateField(actualAuditRecords, AuditJsonKeysEnum.RESOURCE_NAME.getAuditJsonKeyName(), resourceAuditJavaObject.getResourceName());
- validateField(actualAuditRecords, AuditJsonKeysEnum.RESOURCE_TYPE.getAuditJsonKeyName(), resourceAuditJavaObject.getResourceType());
- validateField(actualAuditRecords, AuditJsonKeysEnum.STATUS.getAuditJsonKeyName(), resourceAuditJavaObject.getStatus());
- validateField(actualAuditRecords, AuditJsonKeysEnum.DESCRIPTION.getAuditJsonKeyName(), resourceAuditJavaObject.getDesc());
-
- }
-
- public static void validateAudit(ExpectedResourceAuditJavaObject resourceAuditJavaObject, String action, String body, boolean checkAllFields) throws Exception {
- Map<String, Object> actualAuditRecords = parseAuditResourceByAction(action, null);
-
- if ((resourceAuditJavaObject.getModifierName() != null) && (resourceAuditJavaObject.getModifierUid() != null)) {
- resourceAuditJavaObject.setModifierUid(getModifierString(resourceAuditJavaObject.getModifierName(),
- resourceAuditJavaObject.getModifierUid()));
- }
-
- validateField(actualAuditRecords, AuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
- validateField(actualAuditRecords, AuditJsonKeysEnum.RESOURCE_NAME.getAuditJsonKeyName(), resourceAuditJavaObject.getResourceName());
- validateField(actualAuditRecords, AuditJsonKeysEnum.RESOURCE_TYPE.getAuditJsonKeyName(), resourceAuditJavaObject.getResourceType());
- validateField(actualAuditRecords, AuditJsonKeysEnum.PREV_VERSION.getAuditJsonKeyName(), resourceAuditJavaObject.getPrevVersion());
- validateField(actualAuditRecords, AuditJsonKeysEnum.CURR_VERSION.getAuditJsonKeyName(), resourceAuditJavaObject.getCurrVersion());
-
- validateField(actualAuditRecords, AuditJsonKeysEnum.MODIFIER.getAuditJsonKeyName(), resourceAuditJavaObject.getModifierUid());
- validateField(actualAuditRecords, AuditJsonKeysEnum.PREV_STATE.getAuditJsonKeyName(), resourceAuditJavaObject.getPrevState());
- validateField(actualAuditRecords, AuditJsonKeysEnum.CURR_STATE.getAuditJsonKeyName(), resourceAuditJavaObject.getCurrState());
- validateField(actualAuditRecords, AuditJsonKeysEnum.STATUS.getAuditJsonKeyName(), resourceAuditJavaObject.getStatus());
- validateField(actualAuditRecords, AuditJsonKeysEnum.DESCRIPTION.getAuditJsonKeyName(), resourceAuditJavaObject.getDesc());
- validateField(actualAuditRecords, AuditJsonKeysEnum.COMMENT.getAuditJsonKeyName(), resourceAuditJavaObject.getComment());
- validateField(actualAuditRecords, AuditJsonKeysEnum.TOSCA_NODE_TYPE.getAuditJsonKeyName(), resourceAuditJavaObject.getToscaNodeType());
- validateField(actualAuditRecords, AuditJsonKeysEnum.CURR_ARTIFACT_UUID.getAuditJsonKeyName(), resourceAuditJavaObject.getCurrArtifactUuid());
- validateField(actualAuditRecords, AuditJsonKeysEnum.PREV_ARTIFACT_UUID.getAuditJsonKeyName(), resourceAuditJavaObject.getPrevArtifactUuid());
-
- validateAtifactDataField(actualAuditRecords, AuditJsonKeysEnum.ARTIFACT_DATA.getAuditJsonKeyName(), resourceAuditJavaObject.getArtifactData(), checkAllFields);
- }
-
- public static void validateExternalAudit(ExpectedExternalAudit externalAuditObject, String action, Map<AuditingFieldsKey, String> body) throws Exception {
-
- Map<String, Object> actualAuditRecord = parseAuditResourceByAction(action, body);
-
- validateField(actualAuditRecord, AuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
- validateField(actualAuditRecord, AuditJsonKeysEnum.CONSUMER_ID.getAuditJsonKeyName(), externalAuditObject.getCONSUMER_ID());
- // TODO
- validateField(actualAuditRecord, AuditJsonKeysEnum.RESOURCE_URL.getAuditJsonKeyName(), externalAuditObject.getRESOURCE_URL());
- //TODO
- validateField(actualAuditRecord, AuditJsonKeysEnum.RESOURCE_NAME.getAuditJsonKeyName(), externalAuditObject.getRESOURCE_NAME());
- validateField(actualAuditRecord, AuditJsonKeysEnum.SERVICE_INSTANCE_ID.getAuditJsonKeyName(), externalAuditObject.getSERVICE_INSTANCE_ID());
- //TODO
- validateField(actualAuditRecord, AuditJsonKeysEnum.RESOURCE_TYPE.getAuditJsonKeyName(), externalAuditObject.getRESOURCE_TYPE());
- validateField(actualAuditRecord, AuditJsonKeysEnum.STATUS.getAuditJsonKeyName(), externalAuditObject.getSTATUS());
- validateField(actualAuditRecord, AuditJsonKeysEnum.DESCRIPTION.getAuditJsonKeyName(), externalAuditObject.getDESC());
- //TODO
-// validateField(actualAuditRecord, AuditJsonKeysEnum.MODIFIER.getAuditJsonKeyName(), externalAuditObject.getMODIFIER());
- validateField(actualAuditRecord, AuditJsonKeysEnum.PREV_ARTIFACT_UUID.getAuditJsonKeyName(), externalAuditObject.getPREV_ARTIFACT_UUID());
- validateField(actualAuditRecord, AuditJsonKeysEnum.CURR_ARTIFACT_UUID.getAuditJsonKeyName(), externalAuditObject.getCURR_ARTIFACT_UUID());
- //TODO
- validateField(actualAuditRecord, AuditJsonKeysEnum.ARTIFACT_DATA.getAuditJsonKeyName(), externalAuditObject.getARTIFACT_DATA());
-
- }
-
- public enum ArtifactDataFieldEnum {
- attGroup, artLabel, artType, artName, artTimeout, artPayloadUUID, artVersion, artUUID
- }
-
- private static void validateAtifactDataField(Map<String, Object> map, String auditJsonKeyName,
- String expectedArtifactData, boolean checkAllFields) {
- Map<ArtifactDataFieldEnum, String> expectedArtifactDataFileds = new HashMap<ArtifactDataFieldEnum, String>();
- Map<ArtifactDataFieldEnum, String> actualAtifactDataFileds = new HashMap<ArtifactDataFieldEnum, String>();
- if (expectedArtifactData != null) {
- String[] expected = expectedArtifactData.split(",");
-
- assertTrue("Audit field " + auditJsonKeyName + " not found", map.containsKey(auditJsonKeyName));
- String actualValue = (String) map.get(auditJsonKeyName);
- String[] actual = actualValue.split(",");
-
- if (expected.length == 1 && actual.length == 1) {
- assertEquals(expectedArtifactData, actualValue);
- return;
- }
-
- assertEquals(ArtifactDataFieldEnum.values().length, expected.length);
- assertEquals(ArtifactDataFieldEnum.values().length, actual.length);
-
- for (ArtifactDataFieldEnum field : ArtifactDataFieldEnum.values()) {
-
- expectedArtifactDataFileds.put(field, expected[field.ordinal()]);
- actualAtifactDataFileds.put(field, actual[field.ordinal()]);
- }
- for (Map.Entry<ArtifactDataFieldEnum, String> entry : expectedArtifactDataFileds.entrySet()) {
- ArtifactDataFieldEnum field = entry.getKey();
- if (checkAllFields || (!field.equals(ArtifactDataFieldEnum.artVersion)
- && !field.equals(ArtifactDataFieldEnum.artUUID))) {
- assertTrue("Audit field ArtifactData dosn't containt " + field,
- actualAtifactDataFileds.containsKey(field));
- assertEquals("Audit field ArtifactData dosn't equal " + field,
- expectedArtifactDataFileds.get(field), actualAtifactDataFileds.get(field));
- }
-
- }
- }
- }
-
- // //Benny
- public static void validateEcompConsumerAudit(ExpectedEcomConsumerAudit ecompConsumerAuditJavaObject, String action) throws Exception {
-
- String fixedAction = BaseRestUtils.encodeUrlForDownload(action);
- Map<String, Object> map2 = parseAuditResourceByAction(fixedAction, null);
-
- validateField(map2, EcompConsumerAuditJsonKeysEnum.MODIFIER.getAuditJsonKeyName(), ecompConsumerAuditJavaObject.getModifier());
- validateField(map2, EcompConsumerAuditJsonKeysEnum.ECOMP_USER.getAuditJsonKeyName(), ecompConsumerAuditJavaObject.getEcomUser());
- validateField(map2, EcompConsumerAuditJsonKeysEnum.STATUS.getAuditJsonKeyName(), ecompConsumerAuditJavaObject.getStatus());
- validateField(map2, EcompConsumerAuditJsonKeysEnum.DESC.getAuditJsonKeyName(), ecompConsumerAuditJavaObject.getDesc());
- validateField(map2, EcompConsumerAuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
- }
-
- public static void ecompConsumerAuditSuccess(String action, ConsumerDataDefinition consumerDataDefinition, User user, int status) throws Exception {
- ExpectedEcomConsumerAudit expectedEcomConsumerAuditJavaObject = new ExpectedEcomConsumerAudit();
- expectedEcomConsumerAuditJavaObject.setAction(action);
- expectedEcomConsumerAuditJavaObject.setEcomUser(
- consumerDataDefinition.getConsumerName() + "," + consumerDataDefinition.getConsumerSalt().toLowerCase()
- + "," + consumerDataDefinition.getConsumerPassword().toLowerCase());
- expectedEcomConsumerAuditJavaObject.setStatus(String.valueOf(status));
- expectedEcomConsumerAuditJavaObject.setDesc("OK");
- expectedEcomConsumerAuditJavaObject.setModifier(user.getFullName() + "(" + user.getUserId() + ")");
- AuditValidationUtils.validateEcompConsumerAudit(expectedEcomConsumerAuditJavaObject, action);
- }
-
- public static void createEcompConsumerAuditFailure(String action, ConsumerDataDefinition consumerDataDefinition,
- User user, ActionStatus errorMessage, Object... variables) throws Exception {
- // validate audit
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(errorMessage.name());
- ExpectedEcomConsumerAudit expectedEcomConsumerAuditJavaObject = new ExpectedEcomConsumerAudit();
- expectedEcomConsumerAuditJavaObject.setAction(action);
- expectedEcomConsumerAuditJavaObject.setEcomUser(
- consumerDataDefinition.getConsumerName() + "," + consumerDataDefinition.getConsumerSalt().toLowerCase()
- + "," + consumerDataDefinition.getConsumerPassword().toLowerCase());
- expectedEcomConsumerAuditJavaObject.setStatus(errorInfo.getCode().toString());
- expectedEcomConsumerAuditJavaObject.setDesc(errorInfo.getAuditDesc(variables));
- expectedEcomConsumerAuditJavaObject.setModifier(user.getFullName() + "(" + user.getUserId() + ")");
- AuditValidationUtils.validateEcompConsumerAudit(expectedEcomConsumerAuditJavaObject, action);
- }
-
- public static void deleteEcompConsumerAuditFailure(String action, ConsumerDataDefinition consumerDataDefinition,
- User user, ActionStatus errorMessage, Object... variables) throws Exception {
- // validate audit
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(errorMessage.name());
- ExpectedEcomConsumerAudit expectedEcomConsumerAuditJavaObject = new ExpectedEcomConsumerAudit();
- // String auditAction = ADD_ECOMP_USER_CREDENTIALS_AUDIT_ACTION;
- expectedEcomConsumerAuditJavaObject.setAction(action);
- expectedEcomConsumerAuditJavaObject.setEcomUser(consumerDataDefinition.getConsumerName());
- expectedEcomConsumerAuditJavaObject.setStatus(errorInfo.getCode().toString());
- expectedEcomConsumerAuditJavaObject.setDesc(errorInfo.getAuditDesc(variables));
- expectedEcomConsumerAuditJavaObject.setModifier(user.getFullName() + "(" + user.getUserId() + ")");
- AuditValidationUtils.validateEcompConsumerAudit(expectedEcomConsumerAuditJavaObject, action);
- }
-
- ////////////////////// US571255
- public static void GetListOfUsersByRolesAuditFailure(String action, String roles, int status, User userModifier,
- ActionStatus errorMessage, Object... variables) throws Exception {
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(errorMessage.name());
- ExpectedGetUserListAudit expectedGetListOfUsersAuditJavaObject = new ExpectedGetUserListAudit(); // String
- // auditAction
- // =
- // ADD_ECOMP_USER_CREDENTIALS_AUDIT_ACTION;
- expectedGetListOfUsersAuditJavaObject.setAction(action);
- expectedGetListOfUsersAuditJavaObject.setStatus(String.valueOf(status));
- expectedGetListOfUsersAuditJavaObject.setDesc(errorInfo.getAuditDesc(variables));
-
- expectedGetListOfUsersAuditJavaObject.setDetails(roles);
- if (errorMessage == ActionStatus.USER_INACTIVE || errorMessage == ActionStatus.MISSING_INFORMATION) {
- expectedGetListOfUsersAuditJavaObject.setModifier("(UNKNOWN)");
- } else {
- expectedGetListOfUsersAuditJavaObject
- .setModifier(userModifier.getFullName() + "(" + userModifier.getUserId() + ")");
- }
- AuditValidationUtils.validateAuditGetListOfUsersByRoles(expectedGetListOfUsersAuditJavaObject, action);
- }
-
- public static void GetListOfUsersByRolesAuditSuccess(String action, String roles, User user, int status)
- throws Exception {
- ExpectedGetUserListAudit expectedGetListOfUsersAuditJavaObject = new ExpectedGetUserListAudit();
- expectedGetListOfUsersAuditJavaObject.setAction(action);
- expectedGetListOfUsersAuditJavaObject.setStatus(String.valueOf(status));
- expectedGetListOfUsersAuditJavaObject.setDesc("OK");
- expectedGetListOfUsersAuditJavaObject.setModifier(user.getFullName() + "(" + user.getUserId() + ")");
- expectedGetListOfUsersAuditJavaObject.setDetails(roles);
- validateAuditGetListOfUsersByRoles(expectedGetListOfUsersAuditJavaObject, action);
- }
-
- public static void validateAuditGetListOfUsersByRoles(ExpectedGetUserListAudit GetListOfUsersAuditJavaObject,
- String action) throws Exception {
-
- Map<String, Object> map2 = parseAuditResourceByAction(action, null);
- validateField(map2, AuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
- validateField(map2, AuditJsonKeysEnum.STATUS.getAuditJsonKeyName(), GetListOfUsersAuditJavaObject.getStatus());
- validateField(map2, AuditJsonKeysEnum.MODIFIER.getAuditJsonKeyName(), GetListOfUsersAuditJavaObject.getModifier());
- validateField(map2, AuditJsonKeysEnum.DESCRIPTION.getAuditJsonKeyName(), GetListOfUsersAuditJavaObject.getDesc());
- validateField(map2, AuditJsonKeysEnum.DETAILS.getAuditJsonKeyName(), GetListOfUsersAuditJavaObject.getDetails());
- }
-
- public static void validateAuditImport(ExpectedResourceAuditJavaObject resourceAuditJavaObject, String action) throws Exception {
-
- Map<String, Object> map2 = parseAuditResourceByAction(action, null);
-
- resourceAuditJavaObject.setModifierUid(getModifierString(resourceAuditJavaObject.getModifierName(), resourceAuditJavaObject.getModifierUid()));
-
- validateField(map2, AuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
- validateField(map2, AuditJsonKeysEnum.RESOURCE_TYPE.getAuditJsonKeyName(), resourceAuditJavaObject.getResourceType());
- validateField(map2, AuditJsonKeysEnum.PREV_VERSION.getAuditJsonKeyName(), resourceAuditJavaObject.getPrevVersion());
- validateField(map2, AuditJsonKeysEnum.CURR_VERSION.getAuditJsonKeyName(), resourceAuditJavaObject.getCurrVersion());
- validateField(map2, AuditJsonKeysEnum.MODIFIER.getAuditJsonKeyName(), resourceAuditJavaObject.getModifierUid());
- validateField(map2, AuditJsonKeysEnum.PREV_STATE.getAuditJsonKeyName(), resourceAuditJavaObject.getPrevState());
- validateField(map2, AuditJsonKeysEnum.CURR_STATE.getAuditJsonKeyName(), resourceAuditJavaObject.getCurrState());
- validateField(map2, AuditJsonKeysEnum.STATUS.getAuditJsonKeyName(), resourceAuditJavaObject.getStatus());
- validateField(map2, AuditJsonKeysEnum.DESCRIPTION.getAuditJsonKeyName(), resourceAuditJavaObject.getDesc());
-
- }
-
- public static void validateAuditDistribution(ExpectedResourceAuditJavaObject resourceAuditJavaObject, String action) throws Exception {
-
- Map<String, Object> map2 = parseAuditResourceByAction(action, null);
-
- resourceAuditJavaObject.setModifierUid(getModifierString(resourceAuditJavaObject.getModifierName(), resourceAuditJavaObject.getModifierUid()));
-
- validateField(map2, AuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
- validateField(map2, AuditJsonKeysEnum.RESOURCE_NAME.getAuditJsonKeyName(), resourceAuditJavaObject.getResourceName());
- validateField(map2, AuditJsonKeysEnum.RESOURCE_TYPE.getAuditJsonKeyName(), resourceAuditJavaObject.getResourceType());
- validateField(map2, AuditJsonKeysEnum.CURR_VERSION.getAuditJsonKeyName(), resourceAuditJavaObject.getCurrVersion());
- validateField(map2, AuditJsonKeysEnum.MODIFIER.getAuditJsonKeyName(), resourceAuditJavaObject.getModifierUid());
- validateField(map2, AuditJsonKeysEnum.CURR_STATE.getAuditJsonKeyName(), resourceAuditJavaObject.getCurrState());
- validateField(map2, AuditJsonKeysEnum.DPREV_STATUS.getAuditJsonKeyName(), resourceAuditJavaObject.getDprevStatus());
- validateField(map2, AuditJsonKeysEnum.DCURR_STATUS.getAuditJsonKeyName(), resourceAuditJavaObject.getDcurrStatus());
- validateField(map2, AuditJsonKeysEnum.STATUS.getAuditJsonKeyName(), resourceAuditJavaObject.getStatus());
- validateField(map2, AuditJsonKeysEnum.DESCRIPTION.getAuditJsonKeyName(), resourceAuditJavaObject.getDesc());
- validateField(map2, AuditJsonKeysEnum.COMMENT.getAuditJsonKeyName(), resourceAuditJavaObject.getComment());
- validateField(map2, AuditJsonKeysEnum.DID.getAuditJsonKeyName(), resourceAuditJavaObject.getDistributionId());
-
- }
-
- // Benny
- public static void validateAudit_Distribution(ExpectedResourceAuditJavaObject resourceAuditJavaObject, String action) throws Exception {
-
- List<Map<String, Object>> actionToList = getAuditListByAction(resourceAuditJavaObject.getAction(), 1);
- Map<String, Object> map2 = actionToList.get(0);
- validateField(map2, AuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
- validateField(map2, AuditJsonKeysEnum.RESOURCE_NAME.getAuditJsonKeyName(), resourceAuditJavaObject.getResourceName());
- validateField(map2, AuditJsonKeysEnum.RESOURCE_TYPE.getAuditJsonKeyName(), resourceAuditJavaObject.getResourceType());
- validateField(map2, AuditJsonKeysEnum.CURR_VERSION.getAuditJsonKeyName(), resourceAuditJavaObject.getCurrVersion());
- validateField(map2, AuditJsonKeysEnum.MODIFIER.getAuditJsonKeyName(), resourceAuditJavaObject.getMODIFIER());
- validateField(map2, AuditJsonKeysEnum.CURR_STATE.getAuditJsonKeyName(), resourceAuditJavaObject.getCurrState());
- validateField(map2, AuditJsonKeysEnum.DPREV_STATUS.getAuditJsonKeyName(), resourceAuditJavaObject.getDprevStatus());
- validateField(map2, AuditJsonKeysEnum.DCURR_STATUS.getAuditJsonKeyName(), resourceAuditJavaObject.getDcurrStatus());
- validateField(map2, AuditJsonKeysEnum.STATUS.getAuditJsonKeyName(), resourceAuditJavaObject.getStatus());
- validateField(map2, AuditJsonKeysEnum.DESCRIPTION.getAuditJsonKeyName(), resourceAuditJavaObject.getDesc());
- validateField(map2, AuditJsonKeysEnum.COMMENT.getAuditJsonKeyName(), resourceAuditJavaObject.getComment());
-
- }
-
- public void validateAuditNotification(ExpectedResourceAuditJavaObject resourceAuditJavaObject, String action) throws Exception {
-
- Map<String, Object> map2 = parseAuditResourceByAction(action, null);
-
- resourceAuditJavaObject.setModifierUid(getModifierString(resourceAuditJavaObject.getModifierName(), resourceAuditJavaObject.getModifierUid()));
-
- validateField(map2, AuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
- validateField(map2, AuditJsonKeysEnum.RESOURCE_NAME.getAuditJsonKeyName(), resourceAuditJavaObject.getResourceName());
- validateField(map2, AuditJsonKeysEnum.RESOURCE_TYPE.getAuditJsonKeyName(), resourceAuditJavaObject.getResourceType());
- validateField(map2, AuditJsonKeysEnum.CURR_VERSION.getAuditJsonKeyName(), resourceAuditJavaObject.getCurrVersion());
- validateField(map2, AuditJsonKeysEnum.CURR_STATE.getAuditJsonKeyName(), resourceAuditJavaObject.getCurrState());
- validateField(map2, AuditJsonKeysEnum.STATUS.getAuditJsonKeyName(), resourceAuditJavaObject.getStatus());
- validateField(map2, AuditJsonKeysEnum.DESCRIPTION.getAuditJsonKeyName(), resourceAuditJavaObject.getDesc());
- validateField(map2, AuditJsonKeysEnum.DID.getAuditJsonKeyName(), resourceAuditJavaObject.getDistributionId());
- validateField(map2, AuditJsonKeysEnum.TOPIC_NAME.getAuditJsonKeyName(), resourceAuditJavaObject.getTopicName());
-
- }
-
- public static void validateAudit(ExpectedDistDownloadAudit expectedDistDownloadAudit, String action) throws Exception {
-
- Map<String, Object> map2 = parseAuditResourceByAction(action, null);
-
- validateField(map2, AuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
- validateField(map2, AuditJsonKeysEnum.STATUS.getAuditJsonKeyName(), expectedDistDownloadAudit.getStatus());
- validateField(map2, AuditJsonKeysEnum.DESCRIPTION.getAuditJsonKeyName(), expectedDistDownloadAudit.getDesc());
- validateField(map2, AuditJsonKeysEnum.CONSUMER_ID.getAuditJsonKeyName(), expectedDistDownloadAudit.getConsumerId());
- validateField(map2, AuditJsonKeysEnum.RESOURCE_URL.getAuditJsonKeyName(), expectedDistDownloadAudit.getResourceUrl());
- }
-
- public static void validateAuditExternalSearchAPI(ExpectedExternalAudit expectedDistDownloadAudit, String action, Map<AuditingFieldsKey, String> body)
- throws Exception {
-
- Map<String, Object> map2 = parseAuditResourceByAction(action, body);
-
- validateField(map2, AuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
- validateField(map2, AuditJsonKeysEnum.STATUS.getAuditJsonKeyName(), expectedDistDownloadAudit.getSTATUS());
- validateField(map2, AuditJsonKeysEnum.DESCRIPTION.getAuditJsonKeyName(), expectedDistDownloadAudit.getDESC());
- validateField(map2, AuditJsonKeysEnum.CONSUMER_ID.getAuditJsonKeyName(), expectedDistDownloadAudit.getCONSUMER_ID());
- validateField(map2, AuditJsonKeysEnum.RESOURCE_URL.getAuditJsonKeyName(), expectedDistDownloadAudit.getRESOURCE_URL());
- }
-
- public static void validateAuditExternalCreateResource(ExpectedResourceAuditJavaObject expectedExternalAudit, String action, Map<AuditingFieldsKey, String> body) throws Exception {
- Map<String, Object> map2 = parseAuditResourceByAction(action, body);
-
- validateField(map2, AuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
- validateField(map2, AuditJsonKeysEnum.RESOURCE_NAME.getAuditJsonKeyName(), expectedExternalAudit.getResourceName());
- validateField(map2, AuditJsonKeysEnum.RESOURCE_TYPE.getAuditJsonKeyName(), expectedExternalAudit.getResourceType());
- validateField(map2, AuditJsonKeysEnum.CONSUMER_ID.getAuditJsonKeyName(), expectedExternalAudit.getCONSUMER_ID());
- validateField(map2, AuditJsonKeysEnum.RESOURCE_URL.getAuditJsonKeyName(), expectedExternalAudit.getRESOURCE_URL());
- validateField(map2, AuditJsonKeysEnum.MODIFIER.getAuditJsonKeyName(), expectedExternalAudit.getMODIFIER());
-
- validateField(map2, AuditJsonKeysEnum.PREV_VERSION.getAuditJsonKeyName(), expectedExternalAudit.getPrevVersion());
- validateField(map2, AuditJsonKeysEnum.CURR_VERSION.getAuditJsonKeyName(), expectedExternalAudit.getCurrVersion());
- validateField(map2, AuditJsonKeysEnum.PREV_STATE.getAuditJsonKeyName(), expectedExternalAudit.getPrevState());
- validateField(map2, AuditJsonKeysEnum.CURR_STATE.getAuditJsonKeyName(), expectedExternalAudit.getCurrState());
-
- validateField(map2, AuditJsonKeysEnum.STATUS.getAuditJsonKeyName(), expectedExternalAudit.getStatus());
- validateField(map2, AuditJsonKeysEnum.DESCRIPTION.getAuditJsonKeyName(), expectedExternalAudit.getDesc());
- }
-
- public static void validateAuditExternalChangeAssetLifeCycle(ExpectedResourceAuditJavaObject expectedExternalAudit, String action, Map<AuditingFieldsKey, String> body) throws Exception {
- Map<String, Object> map2 = parseAuditResourceByAction(action, body);
-
- validateField(map2, AuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
- validateField(map2, AuditJsonKeysEnum.DESCRIPTION.getAuditJsonKeyName(), expectedExternalAudit.getDesc());
- validateField(map2, AuditJsonKeysEnum.STATUS.getAuditJsonKeyName(), expectedExternalAudit.getStatus());
-
- validateField(map2, AuditJsonKeysEnum.RESOURCE_TYPE.getAuditJsonKeyName(), expectedExternalAudit.getResourceType());
- validateField(map2, AuditJsonKeysEnum.RESOURCE_NAME.getAuditJsonKeyName(), expectedExternalAudit.getResourceName());
- validateField(map2, AuditJsonKeysEnum.CONSUMER_ID.getAuditJsonKeyName(), expectedExternalAudit.getCONSUMER_ID());
- validateField(map2, AuditJsonKeysEnum.RESOURCE_URL.getAuditJsonKeyName(), expectedExternalAudit.getRESOURCE_URL());
- validateField(map2, AuditJsonKeysEnum.MODIFIER.getAuditJsonKeyName(), expectedExternalAudit.getMODIFIER());
-
- validateField(map2, AuditJsonKeysEnum.PREV_VERSION.getAuditJsonKeyName(), expectedExternalAudit.getPrevVersion());
- validateField(map2, AuditJsonKeysEnum.CURR_VERSION.getAuditJsonKeyName(), expectedExternalAudit.getCurrVersion());
- validateField(map2, AuditJsonKeysEnum.PREV_STATE.getAuditJsonKeyName(), expectedExternalAudit.getPrevState());
- validateField(map2, AuditJsonKeysEnum.CURR_STATE.getAuditJsonKeyName(), expectedExternalAudit.getCurrState());
-
- }
-
- public void validateAuditDeploy(ExpectedResourceAuditJavaObject resourceAuditJavaObject, String action)
- throws Exception {
-
- Map<String, Object> map2 = parseAuditResourceByAction(action, null);
-
- resourceAuditJavaObject.setModifierUid(getModifierString(resourceAuditJavaObject.getModifierName(), resourceAuditJavaObject.getModifierUid()));
-
- validateField(map2, AuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
- validateField(map2, AuditJsonKeysEnum.RESOURCE_NAME.getAuditJsonKeyName(), resourceAuditJavaObject.getResourceName());
- validateField(map2, AuditJsonKeysEnum.RESOURCE_TYPE.getAuditJsonKeyName(), resourceAuditJavaObject.getResourceType());
- validateField(map2, AuditJsonKeysEnum.CURR_VERSION.getAuditJsonKeyName(), resourceAuditJavaObject.getCurrVersion());
- validateField(map2, AuditJsonKeysEnum.MODIFIER.getAuditJsonKeyName(), resourceAuditJavaObject.getModifierUid());
- validateField(map2, AuditJsonKeysEnum.STATUS.getAuditJsonKeyName(), resourceAuditJavaObject.getStatus());
- validateField(map2, AuditJsonKeysEnum.DESCRIPTION.getAuditJsonKeyName(), resourceAuditJavaObject.getDesc());
- validateField(map2, AuditJsonKeysEnum.DID.getAuditJsonKeyName(), resourceAuditJavaObject.getDistributionId());
-
- }
-
- public static void validateAuditProduct(ExpectedProductAudit productExpectedAudit, String action,
- AuditJsonKeysEnum... additionalFields) throws Exception {
-
- Map<String, Object> map2 = parseAuditResourceByAction(action, null);
-
- validateField(map2, AuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
- validateField(map2, AuditJsonKeysEnum.RESOURCE_NAME.getAuditJsonKeyName(), productExpectedAudit.getRESOURCE_NAME());
- validateField(map2, AuditJsonKeysEnum.RESOURCE_TYPE.getAuditJsonKeyName(), productExpectedAudit.getRESOURCE_TYPE());
- validateField(map2, AuditJsonKeysEnum.PREV_VERSION.getAuditJsonKeyName(), productExpectedAudit.getPREV_VERSION());
- validateField(map2, AuditJsonKeysEnum.CURR_VERSION.getAuditJsonKeyName(), productExpectedAudit.getCURR_VERSION());
- validateField(map2, AuditJsonKeysEnum.PREV_STATE.getAuditJsonKeyName(), productExpectedAudit.getPREV_STATE());
- validateField(map2, AuditJsonKeysEnum.CURR_STATE.getAuditJsonKeyName(), productExpectedAudit.getCURR_STATE());
- validateField(map2, AuditJsonKeysEnum.MODIFIER.getAuditJsonKeyName(), productExpectedAudit.getMODIFIER());
- validateField(map2, AuditJsonKeysEnum.STATUS.getAuditJsonKeyName(), productExpectedAudit.getSTATUS());
- validateField(map2, AuditJsonKeysEnum.DESCRIPTION.getAuditJsonKeyName(), productExpectedAudit.getDESC());
- validateField(map2, AuditJsonKeysEnum.SERVICE_INSTANCE_ID.getAuditJsonKeyName(), productExpectedAudit.getSERVICE_INSTANCE_ID());
- if (additionalFields != null) {
- List<AuditJsonKeysEnum> fieldsList = Arrays.asList(additionalFields);
- if (fieldsList.contains(AuditJsonKeysEnum.COMMENT)) {
- validateField(map2, AuditJsonKeysEnum.COMMENT.getAuditJsonKeyName(), productExpectedAudit.getCOMMENT());
- }
- }
- }
-
- private static List<Map<String, Object>> getAuditListByAction(String action, int expectedNumOfAudit)
- throws Exception {
- List<Map<String, Object>> actionToList = parseAuditResourceByActionToList(action, null);
- assertEquals("recieved different audits number than expected", expectedNumOfAudit, actionToList.size());
- return actionToList;
- }
-
- public static void validateAuthenticationAudit(ExpectedAuthenticationAudit expectedAudit) throws Exception {
- List<Map<String, Object>> actionToList = getAuditListByAction(expectedAudit.getAction(), 1);
- assertEquals("expected number of ES action is 1", 1, actionToList.size());
-
- Map<String, Object> map = actionToList.get(0);
- validateField(map, AuditEnum.ACTION.getValue(), expectedAudit.getAction());
- validateField(map, AuditEnum.URL.getValue(), expectedAudit.getUrl());
- validateField(map, AuditEnum.USER.getValue(), expectedAudit.getUser());
- validateField(map, AuditEnum.AUTH_STATUS.getValue(), expectedAudit.getAuthStatus());
- validateField(map, AuditEnum.REALM.getValue(), expectedAudit.getRealm());
-
- }
-
- private static void validateField(Map<String, Object> actualAuditRecord, String jsonField, Object expectedValue) {
- if (expectedValue == null) {
- // || changed to &&
- if (actualAuditRecord.containsKey(jsonField)) {
- assertTrue("Audit field " + jsonField + ": expected null, actual " + actualAuditRecord.get(jsonField),
- actualAuditRecord.get(jsonField).toString().equals("null")
- || actualAuditRecord.get(jsonField).toString().equals(Constants.EMPTY_STRING));
- }
-
- } else {
- assertTrue("Audit field " + jsonField + " not found in actual", actualAuditRecord.containsKey(jsonField));
- Object foundValue = actualAuditRecord.get(jsonField);
- compareElements(expectedValue, foundValue);
- }
- }
-
- public static void compareElements(Object expectedValue, Object foundValue) {
- if (expectedValue instanceof String) {
- assertTrue("Actual value " + foundValue + " is not string", foundValue instanceof String);
- assertTrue("Expected " + "[" + expectedValue +"]" + " not equal to actual [" + foundValue + "]", foundValue.equals(expectedValue));
- }
- /*
- * else if( expectedValue instanceof Number){ assertTrue(foundValue
- * instanceof Number); assertTrue(foundValue == expectedValue); }
- */
- else if (expectedValue instanceof Boolean) {
- assertTrue(foundValue instanceof Boolean);
- assertTrue(foundValue == expectedValue);
- } else if (expectedValue instanceof Map) {
- assertTrue(foundValue instanceof Map);
- Map<String, Object> foundMap = (Map<String, Object>) foundValue;
- Map<String, Object> excpectedMap = (Map<String, Object>) expectedValue;
- assertTrue("size of maps is not equel", foundMap.size() == excpectedMap.size());
- Iterator<String> foundkeyItr = foundMap.keySet().iterator();
- while (foundkeyItr.hasNext()) {
- String foundKey = foundkeyItr.next();
- assertTrue(excpectedMap.containsKey(foundKey));
- compareElements(excpectedMap.get(foundKey), foundMap.get(foundKey));
- }
-
- } else if (expectedValue instanceof List) {
- assertTrue(foundValue instanceof List);
- List<Object> foundList = (List<Object>) foundValue;
- List<Object> excpectedList = (List<Object>) expectedValue;
- assertTrue("size of maps is not equel", foundList.size() == excpectedList.size());
- if( foundList.size() > 0 ){
- final Object elementInList = foundList.get(0);
- if( !(elementInList instanceof List || elementInList instanceof Map) ){
- List<Object> tempList = new ArrayList<>();
- tempList.addAll(foundList);
- for(Object expectedObj : excpectedList){
- if( tempList.contains(expectedObj)){
- tempList.remove(expectedObj);
- }
- else{
- assertTrue(false);
- }
- }
- assertTrue("Lists are not equel", tempList.isEmpty());
- }
- }
-
- } else {
- assertTrue(foundValue.equals(expectedValue));
- }
- }
-
- // public static Map<String, Object> parseAuditResourceByAction(String
- // action, String body) throws Exception {
- //
- // Map auditingMessage = null;
- // auditingMessage = retrieveAuditMessagesByPattern(action, null);
- //
- // return auditingMessage;
- //
- // }
-
- public static Map<String, Object> parseAuditResourceByAction(String action, Map<AuditingFieldsKey, String> body) throws Exception {
-
- Map auditingMessage = null;
- auditingMessage = retrieveAuditMessagesByPattern(action, body, false);
- return auditingMessage;
-
- }
-
- public static List<Map<String, Object>> parseAuditResourceByActionToList(String action,
- Map<AuditingFieldsKey, String> body) throws Exception {
-
- Map auditingMessage = null;
-
- if (body == null || body.isEmpty()) {
- auditingMessage = retrieveAuditMessagesByPattern(action, null, false);
- } else {
- auditingMessage = retrieveAuditMessagesByPattern(action, body, false);
- }
-
- return ResponseParser.getAuditFromMessage(auditingMessage);
- }
-
- public JSONObject buildElasticQueryStringObject(String defaultField, String queryValue) throws JSONException {
-
- JSONObject query_string = new JSONObject();
- JSONObject jSONObject = new JSONObject();
- jSONObject.put("default_field", defaultField);
- jSONObject.put("query", queryValue);
-
- query_string.put("query_string", jSONObject);
-
- return query_string;
- }
-
- public static JSONObject buildElasticQueryBody(List<JSONObject> listObjects) throws JSONException {
-
- JSONObject query = new JSONObject();
- JSONObject bool = new JSONObject();
- JSONObject must = new JSONObject();
- JSONArray mustA = new JSONArray();
-
- for (int i = 0; i < listObjects.size(); i++) {
- JSONObject match = new JSONObject();
- match.put("match", listObjects.get(i));
- mustA.put(match);
-
- }
-
- must.put("must", mustA);
- bool.put("bool", must);
- query.put("query", bool);
-
- return query;
- }
-
- public static String retrieveAuditMessagesUsingBody(String query_string) throws IOException {
-
- Config config = Utils.getConfig();
- HttpRequest getAuditingMessage = new HttpRequest();
- Map<String, String> headersMap = new HashMap<String, String>();
- String body = query_string;
-
- String url = String.format(Urls.GET_SEARCH_DATA_FROM_ES, config.getEsHost(), config.getEsPort(), "_search");
- RestResponse restResponse = getAuditingMessage.httpSendPost(url, body, headersMap);
-
- return restResponse.getResponse();
- }
-
- public static Map<String, String> retrieveAuditMessagesByPattern(String action, Map<AuditingFieldsKey, String> body, Boolean retryFlag)
- throws IOException {
-
- // get cassandra table name by action
- String esType = AuditingActionEnum.fromName(action).getAuditingEsType();
- Map<String, String> resultsMap = new HashMap<String, String>();
-
- List<Pair<AuditingFieldsKey, String>> myFields = new ArrayList<Pair<AuditingFieldsKey, String>>();
- Pair<AuditingFieldsKey, String> myPair = new Pair<AuditingFieldsKey, String>(
- AuditingFieldsKey.AUDIT_ACTION, action);
- myFields.add(0, myPair);
- if (body != null && !body.isEmpty()) {
- for (Map.Entry<AuditingFieldsKey, String> mapElement : body.entrySet()) {
- myFields.add(new Pair<AuditingFieldsKey, String>(mapElement.getKey(), mapElement.getValue()));
- }
- }
-
- List<Row> fetchFromTable = CassandraUtils.fetchFromTable(auditKeySpaceName, esType, myFields);
- if(retryFlag){
- if(fetchFromTable.size() == 0){
- return resultsMap;
- }
- }
-// assertTrue("expected on fetching from data base one record only, actual: " + fetchFromTable.size(), fetchFromTable.size() == 1);
-
-
-
-
- Row row =null;
-
- if (fetchFromTable.size() > 1){
- List<Row> fetchFromTable2 = fetchFromTable;
- fetchFromTable2.sort((p1, p2) -> p1.getTimestamp(1).compareTo(p2.getTimestamp(1)));
- row = fetchFromTable2.get(fetchFromTable2.size() - 1);
- }
- else {row = fetchFromTable.get(0);}
-
- ColumnDefinitions columnDefinitions = row.getColumnDefinitions();
-
- for (int i = 0; i < columnDefinitions.size(); i++) {
- resultsMap.put(columnDefinitions.getName(i), row.getObject(columnDefinitions.getName(i)) == null ? "null"
- : row.getObject(columnDefinitions.getName(i)).toString());
- }
-
- return resultsMap;
- }
-
- public static void categoryAuditSuccess(String action, CategoryDefinition categoryDefinition, User user, int status,
- String resourceType) throws Exception {
- categoryAuditSuccessInternal(action, categoryDefinition, null, null, user, status, resourceType);
- }
-
- public static void categoryAuditFailure(String action, CategoryDefinition categoryDataDefinition, User user,
- ActionStatus errorMessage, int status, String resourceType, Object... variables) throws Exception {
- categoryAuditFailureInternal(action, categoryDataDefinition, null, null, user, errorMessage, status,
- resourceType, variables);
- }
-
- public static void subCategoryAuditSuccess(String action, CategoryDefinition categoryDefinition,
- SubCategoryDefinition subCategoryDefinition, User user, int status, String resourceType) throws Exception {
- categoryAuditSuccessInternal(action, categoryDefinition, subCategoryDefinition, null, user, status,
- resourceType);
- }
-
- public static void groupingAuditSuccess(String action, CategoryDefinition categoryDefinition,
- SubCategoryDefinition subCategoryDefinition, GroupingDefinition groupingDefinition, User user, int status,
- String resourceType) throws Exception {
- categoryAuditSuccessInternal(action, categoryDefinition, subCategoryDefinition, groupingDefinition, user,
- status, resourceType);
- }
-
- public static void subCategoryAuditFailure(String action, CategoryDefinition categoryDataDefinition,
- SubCategoryDefinition subCategoryDefinition, User user, ActionStatus errorMessage, int status,
- String resourceType, Object... variables) throws Exception {
- categoryAuditFailureInternal(action, categoryDataDefinition, subCategoryDefinition, null, user, errorMessage,
- status, resourceType, variables);
- }
-
- // NEW Benny
- public static void groupingAuditFailure(String action, CategoryDefinition categoryDefinition,
- SubCategoryDefinition subCategoryDefinition, GroupingDefinition groupingDefinition, User user,
- ActionStatus errorMessage, int status, String resourceType, Object... variables) throws Exception {
- groupingAuditFailureInternal(action, categoryDefinition, subCategoryDefinition, groupingDefinition, user,
- errorMessage, status, resourceType, variables);
- }
-
- private static void groupingAuditFailureInternal(String action, CategoryDefinition categoryDataDefinition,
- SubCategoryDefinition subCategoryDefinition, GroupingDefinition groupingDefinition, User user,
- ActionStatus errorMessage, int status, String resourceType, Object... variables) throws Exception {
- // validate audit
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(errorMessage.name());
- ExpectedCategoryAudit expectedCatrgoryAuditJavaObject = new ExpectedCategoryAudit();
- expectedCatrgoryAuditJavaObject.setAction(action);
- expectedCatrgoryAuditJavaObject.setModifier(user.getFullName() + "(" + user.getUserId() + ")");
- expectedCatrgoryAuditJavaObject.setCategoryName(categoryDataDefinition.getName());
- String subCategoryName = (subCategoryDefinition != null ? subCategoryDefinition.getName() : Constants.EMPTY_STRING);
- expectedCatrgoryAuditJavaObject.setSubCategoryName(subCategoryName);
- String groupingName = (groupingDefinition != null ? groupingDefinition.getName() : Constants.EMPTY_STRING);
- expectedCatrgoryAuditJavaObject.setGroupingName(groupingName);
- expectedCatrgoryAuditJavaObject.setResourceType(resourceType);
- expectedCatrgoryAuditJavaObject.setStatus(String.valueOf(status));
- expectedCatrgoryAuditJavaObject.setDesc(errorInfo.getAuditDesc(variables));
- AuditValidationUtils.validateCategoryAudit(expectedCatrgoryAuditJavaObject, action);
- }
-
- ///
- private static void categoryAuditSuccessInternal(String action, CategoryDefinition categoryDefinition,
- SubCategoryDefinition subCategoryDefinition, GroupingDefinition groupingDefinition, User user, int status,
- String resourceType) throws Exception {
- // resourceType = Service/Resource/Product
- ExpectedCategoryAudit expectedCatrgoryAuditJavaObject = new ExpectedCategoryAudit();
- expectedCatrgoryAuditJavaObject.setAction(action);
- expectedCatrgoryAuditJavaObject.setModifier(user.getFullName() + "(" + user.getUserId() + ")");
- expectedCatrgoryAuditJavaObject.setCategoryName(categoryDefinition.getName());
- String subCategoryName = (subCategoryDefinition != null ? subCategoryDefinition.getName()
- : Constants.EMPTY_STRING);
- expectedCatrgoryAuditJavaObject.setSubCategoryName(subCategoryName);
- String groupingName = (groupingDefinition != null ? groupingDefinition.getName() : Constants.EMPTY_STRING);
- expectedCatrgoryAuditJavaObject.setGroupingName(groupingName);
- expectedCatrgoryAuditJavaObject.setResourceType(resourceType);
- expectedCatrgoryAuditJavaObject.setStatus(String.valueOf(status));
- expectedCatrgoryAuditJavaObject.setDesc("OK");
- AuditValidationUtils.validateCategoryAudit(expectedCatrgoryAuditJavaObject, action);
- }
-
- ///////////////////////////
- ///// BENNNNNNNNY
- public enum UserAuditJsonKeysEnum {
- ACTION("ACTION"), MODIFIER("MODIFIER"), STATUS("STATUS"), DESC("DESCRIPTION"), USER_AFTER("USER_AFTER"), USER_BEFORE("USER_BEFORE");
- private String auditJsonKeyName;
-
- private UserAuditJsonKeysEnum(String auditJsonKeyName) {
- this.auditJsonKeyName = auditJsonKeyName;
- }
-
- public String getAuditJsonKeyName() {
- return auditJsonKeyName.toLowerCase();
- }
- }
-
- public static void validateAddUserAudit(ExpectedUserCRUDAudit expectedAddUserAuditJavaObject, String action) throws Exception {
-
- List<Map<String, Object>> actionToList = getAuditListByAction(expectedAddUserAuditJavaObject.getAction(), 1);
- Map<String, Object> map = actionToList.get(0);
- validateField(map, UserAuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
- validateField(map, UserAuditJsonKeysEnum.MODIFIER.getAuditJsonKeyName(), expectedAddUserAuditJavaObject.getModifier());
- validateField(map, UserAuditJsonKeysEnum.USER_AFTER.getAuditJsonKeyName(), expectedAddUserAuditJavaObject.getUserAfter());
- validateField(map, UserAuditJsonKeysEnum.USER_BEFORE.getAuditJsonKeyName(), expectedAddUserAuditJavaObject.getUserBefore());
- validateField(map, UserAuditJsonKeysEnum.STATUS.getAuditJsonKeyName(), expectedAddUserAuditJavaObject.getStatus());
- validateField(map, UserAuditJsonKeysEnum.DESC.getAuditJsonKeyName(), expectedAddUserAuditJavaObject.getDesc());
-
- }
-
- private static void categoryAuditFailureInternal(String action, CategoryDefinition categoryDataDefinition,
- SubCategoryDefinition subCategoryDefinition, GroupingDefinition groupingDefinition, User user,
- ActionStatus errorMessage, int status, String resourceType, Object... variables) throws Exception {
- // validate audit
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(errorMessage.name());
- ExpectedCategoryAudit expectedCatrgoryAuditJavaObject = new ExpectedCategoryAudit();
- expectedCatrgoryAuditJavaObject.setAction(action);
- expectedCatrgoryAuditJavaObject.setModifier(user.getFullName() + "(" + user.getUserId() + ")");
- expectedCatrgoryAuditJavaObject.setCategoryName(categoryDataDefinition.getName());
- String subCategoryName = (subCategoryDefinition != null ? subCategoryDefinition.getName() : Constants.EMPTY_STRING);
- expectedCatrgoryAuditJavaObject.setSubCategoryName(subCategoryName);
- String groupingName = (groupingDefinition != null ? groupingDefinition.getName() : Constants.EMPTY_STRING);
- expectedCatrgoryAuditJavaObject.setGroupingName(groupingName);
- expectedCatrgoryAuditJavaObject.setResourceType(resourceType);
- expectedCatrgoryAuditJavaObject.setStatus(String.valueOf(status));
- expectedCatrgoryAuditJavaObject.setDesc(errorInfo.getAuditDesc(variables));
- AuditValidationUtils.validateCategoryAudit(expectedCatrgoryAuditJavaObject, action);
- }
-
- public static void validateGetCategoryHirarchy(ExpectedCategoryAudit expectedCatrgoryAuditJavaObject, String action)
- throws Exception {
-
- List<Map<String, Object>> actionToList = getAuditListByAction(expectedCatrgoryAuditJavaObject.getAction(), 1);
- Map<String, Object> map = actionToList.get(0);
-
- expectedCatrgoryAuditJavaObject.setModifier(getModifierString(expectedCatrgoryAuditJavaObject.getModifierName(),
- expectedCatrgoryAuditJavaObject.getModifierUid()));
- validateField(map, CategoryAuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
- validateField(map, CategoryAuditJsonKeysEnum.MODIFIER.getAuditJsonKeyName(), expectedCatrgoryAuditJavaObject.getModifier());
- validateField(map, CategoryAuditJsonKeysEnum.DETAILS.getAuditJsonKeyName(), expectedCatrgoryAuditJavaObject.getDetails());
- validateField(map, CategoryAuditJsonKeysEnum.STATUS.getAuditJsonKeyName(), expectedCatrgoryAuditJavaObject.getStatus());
- validateField(map, CategoryAuditJsonKeysEnum.DESCRIPTION.getAuditJsonKeyName(), expectedCatrgoryAuditJavaObject.getDesc());
-
- }
-
- public static void validateCategoryAudit(ExpectedCategoryAudit expectedCatrgoryAuditJavaObject, String action)
- throws Exception {
-
- List<Map<String, Object>> actionToList = getAuditListByAction(expectedCatrgoryAuditJavaObject.getAction(), 1);
- Map<String, Object> map = actionToList.get(0);
- validateField(map, CategoryAuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
- validateField(map, CategoryAuditJsonKeysEnum.MODIFIER.getAuditJsonKeyName(), expectedCatrgoryAuditJavaObject.getModifier());
- validateField(map, CategoryAuditJsonKeysEnum.CATEGORY_NAME.getAuditJsonKeyName(), expectedCatrgoryAuditJavaObject.getCategoryName());
- validateField(map, CategoryAuditJsonKeysEnum.SUB_CATEGORY_NAME.getAuditJsonKeyName(), expectedCatrgoryAuditJavaObject.getSubCategoryName());
- validateField(map, CategoryAuditJsonKeysEnum.GROUPING_NAME.getAuditJsonKeyName(), expectedCatrgoryAuditJavaObject.getGroupingName());
- validateField(map, CategoryAuditJsonKeysEnum.RESOURCE_TYPE.getAuditJsonKeyName(), expectedCatrgoryAuditJavaObject.getResourceType());
- validateField(map, CategoryAuditJsonKeysEnum.STATUS.getAuditJsonKeyName(), expectedCatrgoryAuditJavaObject.getStatus());
- validateField(map, CategoryAuditJsonKeysEnum.DESCRIPTION.getAuditJsonKeyName(), expectedCatrgoryAuditJavaObject.getDesc());
- }
-
- public static void GetCategoryHierarchyAuditSuccess(String action, String componentType, User user, int status)
- throws Exception {
- ExpectedGetUserListAudit expectedGetListOfUsersAuditJavaObject = new ExpectedGetUserListAudit();
- expectedGetListOfUsersAuditJavaObject.setAction(action);
- expectedGetListOfUsersAuditJavaObject.setStatus(String.valueOf(status));
- expectedGetListOfUsersAuditJavaObject.setDesc("OK");
- expectedGetListOfUsersAuditJavaObject.setModifier(user.getFullName() + "(" + user.getUserId() + ")");
- expectedGetListOfUsersAuditJavaObject.setDetails(componentType.toLowerCase());
- validateAuditGetListOfUsersByRoles(expectedGetListOfUsersAuditJavaObject, action);
- }
-
- public static String buildArtifactDataAudit(ArtifactDefinition artifactDefinition) {
- StringBuilder sb = new StringBuilder();
- if (artifactDefinition.getTimeout() == null) {
- artifactDefinition.setTimeout(0);
- }
- if (artifactDefinition != null) {
- sb.append(artifactDefinition.getArtifactGroupType() == null ? null
- : artifactDefinition.getArtifactGroupType().getType()).append(",").append("'")
- .append(artifactDefinition.getArtifactLabel()).append("'").append(",")
- .append(artifactDefinition.getArtifactType()).append(",")
- .append(artifactDefinition.getArtifactName()).append(",").append(artifactDefinition.getTimeout())
- .append(",").append(artifactDefinition.getEsId());
- sb.append(",");
- if (artifactDefinition.getArtifactVersion() != null) {
- sb.append(artifactDefinition.getArtifactVersion());
- } else {
- sb.append(" ");
- }
- sb.append(",");
- if (artifactDefinition.getArtifactUUID() != null) {
- sb.append(artifactDefinition.getArtifactUUID());
- } else {
- sb.append(" ");
- }
- }
-
- return sb.toString();
- }
-
-
- public static ExpectedResourceAuditJavaObject expectedArtifactNotFoundAuditObject(String Action, String resourceUid,
- ComponentType resourceType, String artifactUid, User user, String currState, String currVersion)
- throws FileNotFoundException {
- String desc = null;
-
- ExpectedResourceAuditJavaObject expectedAudit = new ExpectedResourceAuditJavaObject();
- expectedAudit.setAction(Action);
- expectedAudit.setResourceName(resourceUid);
- expectedAudit.setResourceType(resourceType.getValue());
- expectedAudit.setPrevVersion("");
- expectedAudit.setCurrVersion(currVersion);
- expectedAudit.setModifierName(user.getFirstName() + " " + user.getLastName());
- expectedAudit.setModifierUid(user.getUserId());
- expectedAudit.setPrevState("");
- expectedAudit.setCurrState(currState);
- expectedAudit.setPrevArtifactUuid("");
- expectedAudit.setCurrArtifactUuid(artifactUid);
- expectedAudit.setArtifactData("");
- expectedAudit.setStatus("404");
-
- desc = buildAuditDescription(
- new ErrorValidationUtils().parseErrorConfigYaml(ActionStatus.ARTIFACT_NOT_FOUND.name()),
- Arrays.asList(""));
-
- expectedAudit.setDesc(desc);
- return expectedAudit;
- }
-
- public static JSONObject filterAuditByUuid(String action, String uuid) throws Exception {
- Map<String, String> actionMap = new HashMap<>();
- actionMap.put("ACTION", action);
- JSONObject actionJsonObject = new JSONObject(actionMap);
- Map<String, String> uuidMap = new HashMap<>();
- uuidMap.put("SERVICE_INSTANCE_ID", uuid);
- JSONObject uuidJsonObject = new JSONObject(uuidMap);
-
- List<JSONObject> filters = new ArrayList<>(Arrays.asList(actionJsonObject, uuidJsonObject));
- JSONObject body = buildElasticQueryBody(filters);
- return body;
- }
-
- public static void validateAudit(ExpectedResourceAuditJavaObject resourceAuditJavaObject, String action) throws Exception {
- List<Map<String, Object>> actionToList = getAuditListByAction(resourceAuditJavaObject.getAction(), 1);
- Map<String, Object> map2 = actionToList.get(0);
- validateField(map2, AuditJsonKeysEnum.ACTION.getAuditJsonKeyName(), action);
- validateField(map2, AuditJsonKeysEnum.RESOURCE_NAME.getAuditJsonKeyName(), resourceAuditJavaObject.getResourceName());
- validateField(map2, AuditJsonKeysEnum.RESOURCE_TYPE.getAuditJsonKeyName(), resourceAuditJavaObject.getResourceType());
- validateField(map2, AuditJsonKeysEnum.PREV_VERSION.getAuditJsonKeyName(), resourceAuditJavaObject.getPrevVersion());
- validateField(map2, AuditJsonKeysEnum.CURR_VERSION.getAuditJsonKeyName(), resourceAuditJavaObject.getCurrVersion());
- validateField(map2, AuditJsonKeysEnum.MODIFIER.getAuditJsonKeyName(), resourceAuditJavaObject.getMODIFIER());
- validateField(map2, AuditJsonKeysEnum.PREV_STATE.getAuditJsonKeyName(), resourceAuditJavaObject.getPrevState());
- validateField(map2, AuditJsonKeysEnum.CURR_STATE.getAuditJsonKeyName(), resourceAuditJavaObject.getCurrState());
- validateField(map2, AuditJsonKeysEnum.STATUS.getAuditJsonKeyName(), resourceAuditJavaObject.getStatus());
- validateField(map2, AuditJsonKeysEnum.DESCRIPTION.getAuditJsonKeyName(), resourceAuditJavaObject.getDesc());
- validateField(map2, AuditJsonKeysEnum.COMMENT.getAuditJsonKeyName(), resourceAuditJavaObject.getComment());
- }
-
- ////// service audit validation/////////////////////
-
- public static ExpectedResourceAuditJavaObject constructFieldsForAuditValidation(ServiceReqDetails serviceReqDetails,
- String serviceVersion, User sdncUserDetails) {
-
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
-
- expectedResourceAuditJavaObject.setAction("Create");
- expectedResourceAuditJavaObject.setModifierUid(sdncUserDetails.getUserId());
- String userFirstLastName = sdncUserDetails.getFirstName() + " " + sdncUserDetails.getLastName();
- expectedResourceAuditJavaObject.setModifierName(userFirstLastName);
- expectedResourceAuditJavaObject.setStatus("200");
- expectedResourceAuditJavaObject.setDesc("OK");
- expectedResourceAuditJavaObject.setResourceName(serviceReqDetails.getName());
- expectedResourceAuditJavaObject.setResourceType("Service");
- expectedResourceAuditJavaObject.setPrevVersion(String.valueOf(Float.parseFloat(serviceVersion) - 0.1f));
- expectedResourceAuditJavaObject.setCurrVersion(serviceVersion);
- expectedResourceAuditJavaObject.setPrevState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
- expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
- expectedResourceAuditJavaObject.setComment(null);
-
- return expectedResourceAuditJavaObject;
-
- }
-
- public static ExpectedResourceAuditJavaObject constructFieldsForAuditValidation(ServiceReqDetails serviceReqDetails,
- String serviceVersion, User sdncUserDetails, ActionStatus errorStatus, List<String> variables)
- throws FileNotFoundException {
-
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = constructFieldsForAuditValidation(
- serviceReqDetails, serviceVersion, sdncUserDetails);
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(errorStatus.name());
-
- expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
- String auditDesc = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
- expectedResourceAuditJavaObject.setDesc(auditDesc);
-
- return expectedResourceAuditJavaObject;
-
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/BaseValidationUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/BaseValidationUtils.java
deleted file mode 100644
index b29fab4c57..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/BaseValidationUtils.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.validation;
-
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.openecomp.sdc.exception.ResponseFormat;
-import org.testng.Assert;
-
-import java.io.FileNotFoundException;
-import java.util.Arrays;
-
-import static org.testng.AssertJUnit.assertEquals;
-
-public class BaseValidationUtils {
-
- public static final int STATUS_CODE_SUCCESS = 200;
- public static final int STATUS_CODE_CREATED = 201;
- public static final int STATUS_CODE_DELETE = 204;
- public static final int STATUS_CODE_NOT_FOUND = 404;
- public static final int STATUS_CODE_SUCCESS_NO_CONTENT = 204;
- public static final int STATUS_CODE_SUCCESS_DELETE = 204;
- public static final int STATUS_CODE_INVALID_CONTENT = 400;
- public static final int STATUS_CODE_MISSING_DATA = 400;
- public static final int STATUS_CODE_MISSING_INFORMATION = 403;
- public static final int STATUS_CODE_RESTRICTED_ACCESS = 403;
- public static final int STATUS_CODE_RESTRICTED_OPERATION = 409;
- public static final int STATUS_CODE_ALREADY_EXISTS = 409;
-
- // ------
- protected static Boolean checkErrorCode(RestResponse deleteResponse) {
- if (deleteResponse.getErrorCode() == STATUS_CODE_SUCCESS
- || deleteResponse.getErrorCode() == STATUS_CODE_DELETE) {
- return true;
- }
- return false;
- }
-
- // *** STATUS CODE VALIDATION UTIITIES ****
- public static void checkStatusCode(RestResponse response, String assertMessage, boolean AND, int... statuses) {
- int statusCode = response.getErrorCode();
- for (int status : statuses) {
- if (AND && statusCode != status) {
- Assert.fail(assertMessage + " status: " + statusCode);
- } else if (statusCode == status) {
- return;
- }
- }
- if (!AND) {
- Assert.fail(assertMessage + " status: " + statusCode);
- }
- }
-
- public static void checkDeleteResponse(RestResponse response) {
- checkStatusCode(response, "delete request failed", false, STATUS_CODE_DELETE, STATUS_CODE_NOT_FOUND,
- STATUS_CODE_SUCCESS); // STATUS_CODE_SUCCESS for deActivate user
- }
-
- public static void checkCreateResponse(RestResponse response) {
- checkStatusCode(response, "create request failed", false, STATUS_CODE_CREATED);
- }
-
- public static void checkSuccess(RestResponse response) {
- checkStatusCode(response, "request failed", false, STATUS_CODE_SUCCESS);
- }
-
- public static void checkErrorResponse(RestResponse errorResponse, ActionStatus actionStatus,
- String... expectedVariables) throws FileNotFoundException {
- // Expected error
- ErrorInfo expectedError = ErrorValidationUtils.parseErrorConfigYaml(actionStatus.name());
- String expectedMessage = expectedError.getMessage();
-
- // Actual error
- ResponseFormat responseFormat = ResponseParser.parseToObjectUsingMapper(errorResponse.getResponse(),
- ResponseFormat.class);
- String actualMessage = responseFormat.getText();
- String[] actualVariables = responseFormat.getVariables();
-
- assertEquals("Unexpected error message", expectedMessage, actualMessage);
- assertEquals("Unexpected error variables", Arrays.asList(expectedVariables), Arrays.asList(actualVariables));
- }
-
- public static void checkErrorMessageResponse(RestResponse errorResponse, ActionStatus actionStatus)
- throws FileNotFoundException {
- // Expected error
- ErrorInfo expectedError = ErrorValidationUtils.parseErrorConfigYaml(actionStatus.name());
- String expectedMessage = expectedError.getMessage();
-
- // Actual error
- ResponseFormat responseFormat = ResponseParser.parseToObjectUsingMapper(errorResponse.getResponse(),
- ResponseFormat.class);
- String actualMessage = responseFormat.getText();
-
- assertEquals("Unexpected error message", expectedMessage, actualMessage);
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/CategoryValidationUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/CategoryValidationUtils.java
deleted file mode 100644
index 71a19eaa06..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/CategoryValidationUtils.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.validation;
-
-import org.json.JSONObject;
-import org.openecomp.sdc.be.model.category.CategoryDefinition;
-import org.openecomp.sdc.be.model.category.GroupingDefinition;
-import org.openecomp.sdc.be.model.category.SubCategoryDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.rest.CategoryRestUtils;
-
-import static org.testng.AssertJUnit.*;
-
-public class CategoryValidationUtils {
-
- public static void verifyCategoryExistInGetResponse(RestResponse getAllCategoryRest,
- CategoryDefinition categoryDefinition) {
-
- int categoriesNum = CategoryRestUtils.getMatchingCategoriesNum(getAllCategoryRest, categoryDefinition);
- assertEquals("category " + categoryDefinition.getName() + " not found during get or found more than once", 1,
- categoriesNum);
- }
-
- public static void verifyCategoryNotExistsInGetResponse(RestResponse getAllCategoryRest,
- CategoryDefinition categoryDefinition) {
-
- int categoriesNum = CategoryRestUtils.getMatchingCategoriesNum(getAllCategoryRest, categoryDefinition);
- assertEquals("category " + categoryDefinition.getName() + " should't be found during get", 0, categoriesNum);
- }
-
- public static void verifySubCategoryExistInGetResponse(RestResponse getAllCategoryRest, String parentCategoryId,
- SubCategoryDefinition expectedSubCategoryDefinition) {
-
- int subCategoriesNum = CategoryRestUtils.getMatchingSubCategoriesNum(getAllCategoryRest, parentCategoryId,
- expectedSubCategoryDefinition);
- assertEquals(
- "sub-category " + expectedSubCategoryDefinition.getName()
- + " not found during get or found more than once for parentId " + parentCategoryId,
- 1, subCategoriesNum);
- }
-
- public static void verifyGroupingExistInGetResponse(RestResponse getAllCategoryRest, String parentCategoryId,
- String subCategoryId, GroupingDefinition expectedGroupingDefinition) {
-
- int groupingNum = CategoryRestUtils.getMatchingGroupingNum(getAllCategoryRest, parentCategoryId, subCategoryId,
- expectedGroupingDefinition);
- assertEquals(
- "sub-category " + expectedGroupingDefinition.getName()
- + " not found during get or found more than once for parentId " + parentCategoryId,
- 1, groupingNum);
- }
-
- public static void verifyGroupingNotExistInGetResponse(RestResponse getAllCategoryRest, String parentCategoryId,
- String subCategoryId, GroupingDefinition expectedGroupingDefinition) {
-
- int groupingNum = CategoryRestUtils.getMatchingGroupingNum(getAllCategoryRest, parentCategoryId, subCategoryId,
- expectedGroupingDefinition);
- assertEquals(
- "sub-category " + expectedGroupingDefinition.getName()
- + " not found during get or found more than once for parentId " + parentCategoryId,
- 0, groupingNum);
- }
-
- public static void verifySubCategoryNotExistsInGetResponse(RestResponse getAllCategoryRest, String parentCategoryId,
- SubCategoryDefinition expectedSubCategoryDefinition) {
-
- int subCategoriesNum = CategoryRestUtils.getMatchingSubCategoriesNum(getAllCategoryRest, parentCategoryId,
- expectedSubCategoryDefinition);
- assertEquals("sub-category " + expectedSubCategoryDefinition.getName()
- + " should't be found during get for parentId " + parentCategoryId, 0, subCategoriesNum);
- }
-
- /// NEE Benny
- public static void validateCreateGroupResponse(RestResponse createSubCategoryRest,
- GroupingDefinition expectedGroupDefinition) throws Exception {
-
- String response = createSubCategoryRest.getResponse();
- JSONObject jobject = new JSONObject(response);
- assertTrue(jobject.get("name").equals(expectedGroupDefinition.getName()));
- assertTrue(jobject.get("normalizedName").equals(expectedGroupDefinition.getNormalizedName()));
- // assertNotNull(jobject.get("normalizedName"));
- assertNotNull(jobject.get("uniqueId"));
- expectedGroupDefinition.setUniqueId(jobject.get("uniqueId").toString());
-
- }
-
- public static void validateCreateSubCategoryResponse(RestResponse createSubCategoryRest,
- SubCategoryDefinition expectedSubCategoryDefinition) throws Exception {
-
- String response = createSubCategoryRest.getResponse();
- JSONObject jobject = new JSONObject(response);
- assertTrue(jobject.get("name").equals(expectedSubCategoryDefinition.getName()));
- assertNotNull(jobject.get("normalizedName"));
- assertNotNull(jobject.get("uniqueId"));
- }
-
- public static void validateCreateCategoryResponse(RestResponse createCategoryRest,
- CategoryDefinition expectedCategoryDefinition) throws Exception {
- String response = createCategoryRest.getResponse();
- JSONObject jobject = new JSONObject(response);
- assertTrue(jobject.get("name").equals(expectedCategoryDefinition.getName()));
- assertTrue(jobject.get("normalizedName").equals(expectedCategoryDefinition.getNormalizedName()));
- assertNotNull(jobject.get("uniqueId"));
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/CsarValidationUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/CsarValidationUtils.java
deleted file mode 100644
index d85e093c17..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/CsarValidationUtils.java
+++ /dev/null
@@ -1,444 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.validation;
-
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.ci.tests.datatypes.GroupHeatMetaDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.HeatMetaFirstLevelDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.TypeHeatMetaDefinition;
-import org.openecomp.sdc.ci.tests.utils.CsarParserUtils;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import static org.testng.AssertJUnit.assertTrue;
-
-public class CsarValidationUtils {
-
- public static void validateCsarVfArtifact(String csarUUID, Resource resource) throws Exception {
-
- List<TypeHeatMetaDefinition> listTypeHeatMetaDefinition = CsarParserUtils.getListTypeHeatMetaDefinition(csarUUID);
- assertTrue(
- "check group count, expected: " + getGroupCount(listTypeHeatMetaDefinition) + ", actual: "
- + resource.getGroups().size(),
- getGroupCount(listTypeHeatMetaDefinition) == resource.getGroups().size());
- assertTrue(
- "check artifact count, expected: " + getArtifactCount(listTypeHeatMetaDefinition, false) + ", actual: "
- + resource.getDeploymentArtifacts().size(),
- getArtifactCount(listTypeHeatMetaDefinition, false) == resource.getDeploymentArtifacts().size());
-
- }
-
- /*public static List<TypeHeatMetaDefinition> getListTypeHeatMetaDefinition(String csarUUID) throws Exception {
-
- String artifactHeatMetaLocation = "Artifacts/HEAT.meta";
- JSONParser parser = new JSONParser();
- String csarPayload = getCsarPayload(csarUUID, artifactHeatMetaLocation);
- if (csarPayload != null) {
- Object parse = parser.parse(csarPayload);
- JSONObject jsonObject = (JSONObject) parse;
- JSONObject jsonObjectImportStructure = (JSONObject) jsonObject.get("importStructure");
- List<TypeHeatMetaDefinition> listHeatMetaDefenition = new ArrayList<TypeHeatMetaDefinition>();
- listHeatMetaDefenition = getArtifactsByGroup(jsonObjectImportStructure, listHeatMetaDefenition);
- return listHeatMetaDefenition;
- }
- return null;
-
- }*/
-
- /*public static List<TypeHeatMetaDefinition> getListTypeHeatMetaDefinition(File csarUUID) throws Exception {
-
- String artifactHeatMetaLocation = "Artifacts/HEAT.meta";
- JSONParser parser = new JSONParser();
- String csarPayload = getCsarPayload(csarUUID, artifactHeatMetaLocation);
- if (csarPayload != null) {
- Object parse = parser.parse(csarPayload);
- JSONObject jsonObject = (JSONObject) parse;
- JSONObject jsonObjectImportStructure = (JSONObject) jsonObject.get("importStructure");
- List<TypeHeatMetaDefinition> listHeatMetaDefenition = new ArrayList<TypeHeatMetaDefinition>();
- listHeatMetaDefenition = getArtifactsByGroup(jsonObjectImportStructure, listHeatMetaDefenition);
- return listHeatMetaDefenition;
- }
- return null;
-
- }*/
-
- private static Integer getGroupCount(List<TypeHeatMetaDefinition> listHeatMetaDefenition) {
- int count = 0;
- for (TypeHeatMetaDefinition typeHeatMetaDefinition : listHeatMetaDefenition) {
- count = count + typeHeatMetaDefinition.getGroupHeatMetaDefinition().size();
- }
- return count;
- }
-
- private static Integer getArtifactCount(List<TypeHeatMetaDefinition> listHeatMetaDefenition, Boolean isEnvIncluded) {
- int count = 0;
- List<HeatMetaFirstLevelDefinition> uniqeArtifactList = new ArrayList<>();
-
- for (TypeHeatMetaDefinition typeHeatMetaDefinition : listHeatMetaDefenition) {
- for (GroupHeatMetaDefinition groupHeatMetaDefinition : typeHeatMetaDefinition
- .getGroupHeatMetaDefinition()) {
- if (isEnvIncluded) {
- count = count + groupHeatMetaDefinition.getArtifactList().size();
- } else {
- for (HeatMetaFirstLevelDefinition fileName : groupHeatMetaDefinition.getArtifactList()) {
- if (!fileName.getFileName().contains(".env") && !uniqeArtifactList.contains(fileName)) {
- uniqeArtifactList.add(fileName);
- count = count + 1;
- }
- }
- }
- }
- }
- return count;
- }
-
- /*protected static List<TypeHeatMetaDefinition> getArtifactsByGroup(JSONObject jsonObjectImportStructure, List<TypeHeatMetaDefinition> listHeatMetaDefenition) {
-
- @SuppressWarnings("unchecked")
- Set<Object> typeSet = jsonObjectImportStructure.keySet();
- for (Object type : typeSet) {
- TypeHeatMetaDefinition heatMetaDefenition = new TypeHeatMetaDefinition();
- log.debug(type.toString());
- log.debug("{}", jsonObjectImportStructure.get(type));
- JSONArray array = (JSONArray) jsonObjectImportStructure.get(type);
- heatMetaDefenition.setTypeName((String) type);
- List<GroupHeatMetaDefinition> groupHeatMetaDefinitions = new ArrayList<GroupHeatMetaDefinition>();
- heatMetaDefenition.setGroupHeatMetaDefinition(fetchArtifactByGroupFromJsonArray(array, groupHeatMetaDefinitions, true, false));
- listHeatMetaDefenition.add(heatMetaDefenition);
- }
- return listHeatMetaDefenition;
- }*/
-
-/* protected static List<GroupHeatMetaDefinition> fetchArtifactByGroupFromJsonArray(JSONArray array, List<GroupHeatMetaDefinition> listGroupHeatMetaDefinition, Boolean openNewGroup, Boolean isNested) {
-
- GroupHeatMetaDefinition groupHeatMetaDefinition;
-
- if (array != null) {
- for (int i = 0; i < array.size(); i++) {
- if (openNewGroup) {
- groupHeatMetaDefinition = new GroupHeatMetaDefinition();
- int groupNumber = listGroupHeatMetaDefinition.size() + 1;
- log.debug("groupName={}", groupNumber);
- groupHeatMetaDefinition.setGroup(groupNumber);
- listGroupHeatMetaDefinition.add(groupHeatMetaDefinition);
- PropertyHeatMetaDefinition propertyHeatMetaDefinition = new PropertyHeatMetaDefinition();
- propertyHeatMetaDefinition.setName("isBase");
- propertyHeatMetaDefinition.setValue(false);
- groupHeatMetaDefinition.setPropertyHeatMetaDefinition(propertyHeatMetaDefinition);
- }
- groupHeatMetaDefinition = listGroupHeatMetaDefinition.get(listGroupHeatMetaDefinition.size() - 1);
- JSONObject jsonObject = (JSONObject) array.get(i);
- fetchArtifactByGroupFromJsonObject(listGroupHeatMetaDefinition, groupHeatMetaDefinition, jsonObject, isNested);
- }
- }
- return listGroupHeatMetaDefinition;
- }*/
-
-
- /*public static void fetchArtifactByGroupFromJsonObject(List<GroupHeatMetaDefinition> listGroupHeatMetaDefinition, GroupHeatMetaDefinition groupHeatMetaDefinition, JSONObject jsonObject, Boolean isNested) {
- @SuppressWarnings("unchecked")
- Set<Object> groupsKey = jsonObject.keySet();
- for (Object groupKey : groupsKey) {
- String groupKeyStr = (String) groupKey;
- if (groupKeyStr.equals("isBase")) {
- PropertyHeatMetaDefinition propertyHeatMetaDefinition = new PropertyHeatMetaDefinition();
- propertyHeatMetaDefinition.setName(groupKeyStr);
- propertyHeatMetaDefinition.setValue((boolean) jsonObject.get(groupKeyStr));
- if (!groupHeatMetaDefinition.getPropertyHeatMetaDefinition().equals(propertyHeatMetaDefinition)) {
- groupHeatMetaDefinition.getPropertyHeatMetaDefinition().setValue((boolean) jsonObject.get(groupKeyStr));
- }
- }
- if (groupKeyStr.equals("fileName")) {
- String artifactName = (String) jsonObject.get(groupKeyStr);
- String artifactType = ArtifactTypeEnum.HEAT_ARTIFACT.getType();
- if(isNested){
- artifactType = ArtifactTypeEnum.HEAT_NESTED.getType();
- }
- if(jsonObject.get("type") != null && isNested == false){
- artifactType = (String) jsonObject.get("type");
- }
- HeatMetaFirstLevelDefinition heatMetaFirstLevelDefinition = new HeatMetaFirstLevelDefinition(artifactName, artifactType);
- List<HeatMetaFirstLevelDefinition> listArtifactNames = groupHeatMetaDefinition.getArtifactList();
- listArtifactNames.add(heatMetaFirstLevelDefinition);
- groupHeatMetaDefinition.setArtifactList(listArtifactNames);
- } else {
- if((groupKeyStr.equals("env"))){
- if (jsonObject.get(groupKeyStr) instanceof JSONObject){
- fetchArtifactByGroupFromJsonObject(listGroupHeatMetaDefinition, groupHeatMetaDefinition, (JSONObject) jsonObject.get(groupKeyStr), false);
- }else{
- assertTrue("Expected object is JSONObject, but actual: " + jsonObject.get(groupKeyStr).getClass(), jsonObject.get(groupKeyStr).getClass().equals("JSONObject"));
- }
- }
- if((groupKeyStr.equals("nested"))){
- if (jsonObject.get(groupKeyStr) instanceof JSONArray){
- fetchArtifactByGroupFromJsonArray((JSONArray) jsonObject.get(groupKeyStr), listGroupHeatMetaDefinition, false, true);
- }else{
- assertTrue("Expected object is JSONArray, but actual: " + jsonObject.get(groupKeyStr).getClass(), jsonObject.get(groupKeyStr).getClass().equals("JSONArray"));
- }
-
- }else if (!(groupKeyStr.equals("isBase") || groupKeyStr.equals("type") || groupKeyStr.equals("env"))) {
- if (jsonObject.get(groupKeyStr) instanceof JSONArray){
- fetchArtifactByGroupFromJsonArray((JSONArray) jsonObject.get(groupKeyStr), listGroupHeatMetaDefinition, false, false);
- }else{
- assertTrue("Expected object is JSONArray, but actual: " + jsonObject.get(groupKeyStr).getClass(), jsonObject.get(groupKeyStr).getClass().equals("JSONArray"));
- }
- }
- }
- }
- }*/
-
- /*public static List<TypeHeatMetaDefinition> getListTypeHeatMetaDefinition(String csarUUID) throws Exception {
-
- String artifactHeatMetaLocation = "Artifacts/HEAT.meta";
- JSONParser parser = new JSONParser();
- String csarPayload = getCsarPayload(csarUUID, artifactHeatMetaLocation);
- if (csarPayload != null) {
- Object parse = parser.parse(csarPayload);
- JSONObject jsonObject = (JSONObject) parse;
- JSONObject jsonObjectImportStructure = (JSONObject) jsonObject.get("importStructure");
- List<TypeHeatMetaDefinition> listHeatMetaDefenition = new ArrayList<TypeHeatMetaDefinition>();
- listHeatMetaDefenition = getArtifactsByGroup(jsonObjectImportStructure, listHeatMetaDefenition);
- return listHeatMetaDefenition;
- }
- return null;
-
- }
-
- protected static List<TypeHeatMetaDefinition> getArtifactsByGroup(JSONObject jsonObjectImportStructure,
- List<TypeHeatMetaDefinition> listHeatMetaDefenition) {
-
- @SuppressWarnings("unchecked")
- Set<Object> typeSet = jsonObjectImportStructure.keySet();
- for (Object type : typeSet) {
- TypeHeatMetaDefinition heatMetaDefenition = new TypeHeatMetaDefinition();
- log.debug(type.toString());
- log.debug("{}", jsonObjectImportStructure.get(type));
- JSONArray array = (JSONArray) jsonObjectImportStructure.get(type);
- heatMetaDefenition.setTypeName((String) type);
- List<GroupHeatMetaDefinition> groupHeatMetaDefinitions = new ArrayList<GroupHeatMetaDefinition>();
- heatMetaDefenition.setGroupHeatMetaDefinition(fetchArtifactByGroup(array, groupHeatMetaDefinitions, true));
- listHeatMetaDefenition.add(heatMetaDefenition);
- }
- return listHeatMetaDefenition;
- }
-
- protected static List<GroupHeatMetaDefinition> fetchArtifactByGroup(JSONArray array,
- List<GroupHeatMetaDefinition> listGroupHeatMetaDefinition, Boolean openNewGroup) {
-
- GroupHeatMetaDefinition groupHeatMetaDefinition;
-
- if (array != null) {
- for (int i = 0; i < array.size(); i++) {
- if (openNewGroup) {
- groupHeatMetaDefinition = new GroupHeatMetaDefinition();
- int groupNumber = listGroupHeatMetaDefinition.size() + 1;
- log.debug("groupName={}", groupNumber);
- groupHeatMetaDefinition.setGroup(groupNumber);
- listGroupHeatMetaDefinition.add(groupHeatMetaDefinition);
- PropertyHeatMetaDefinition propertyHeatMetaDefinition = new PropertyHeatMetaDefinition();
- propertyHeatMetaDefinition.setName("isBase");
- propertyHeatMetaDefinition.setValue(false);
- groupHeatMetaDefinition.setPropertyHeatMetaDefinition(propertyHeatMetaDefinition);
- }
- groupHeatMetaDefinition = listGroupHeatMetaDefinition.get(listGroupHeatMetaDefinition.size() - 1);
- JSONObject jsonObject = (JSONObject) array.get(i);
- @SuppressWarnings("unchecked")
- Set<Object> groupsKey = jsonObject.keySet();
- for (Object groupKey : groupsKey) {
- String groupKeyStr = (String) groupKey;
- if (groupKeyStr.equals("isBase")) {
- PropertyHeatMetaDefinition propertyHeatMetaDefinition = new PropertyHeatMetaDefinition();
- propertyHeatMetaDefinition.setName(groupKeyStr);
- propertyHeatMetaDefinition.setValue((boolean) jsonObject.get(groupKeyStr));
- if (!groupHeatMetaDefinition.getPropertyHeatMetaDefinition()
- .equals(propertyHeatMetaDefinition)) {
- groupHeatMetaDefinition.getPropertyHeatMetaDefinition()
- .setValue((boolean) jsonObject.get(groupKeyStr));
- }
- }
- if (groupKeyStr.equals("fileName") || groupKeyStr.equals("env")) {
- String artifactName = (String) jsonObject.get(groupKeyStr);
- List<String> listArtifactNames = groupHeatMetaDefinition.getArtifactList();
- listArtifactNames.add(artifactName);
- groupHeatMetaDefinition.setArtifactList(listArtifactNames);
- } else {
- if (!groupKeyStr.equals("isBase")) {
- fetchArtifactByGroup((JSONArray) jsonObject.get(groupKeyStr), listGroupHeatMetaDefinition,
- false);
- }
- }
- }
- }
- }
- return listGroupHeatMetaDefinition;
- }
-
- private static Integer getArtifactCount(List<TypeHeatMetaDefinition> listHeatMetaDefenition,
- Boolean isEnvIncluded) {
- int count = 0;
- List<String> uniqeArtifactList = new ArrayList<>();
-
- for (TypeHeatMetaDefinition typeHeatMetaDefinition : listHeatMetaDefenition) {
- for (GroupHeatMetaDefinition groupHeatMetaDefinition : typeHeatMetaDefinition
- .getGroupHeatMetaDefinition()) {
- if (isEnvIncluded) {
- count = count + groupHeatMetaDefinition.getArtifactList().size();
- } else {
- for (String fileName : groupHeatMetaDefinition.getArtifactList()) {
- if (!fileName.contains(".env") && !uniqeArtifactList.contains(fileName)) {
- uniqeArtifactList.add(fileName);
- count = count + 1;
- }
- }
- }
- }
- }
- return count;
- }
-
- private static Integer getGroupCount(List<TypeHeatMetaDefinition> listHeatMetaDefenition) {
- int count = 0;
- for (TypeHeatMetaDefinition typeHeatMetaDefinition : listHeatMetaDefenition) {
- count = count + typeHeatMetaDefinition.getGroupHeatMetaDefinition().size();
- }
- return count;
- }
-
- private static String groupNameBuilder(Resource resource) {
- String separator = "::";
- String module = "module-";
- String groupName = resource.getSystemName() + separator + module;
- return groupName;
- }
-
- public static void validateCsarVfArtifact(String csarUUID, Resource resource) throws Exception {
-
- List<TypeHeatMetaDefinition> listTypeHeatMetaDefinition = getListTypeHeatMetaDefinition(csarUUID);
- assertTrue(
- "check group count, expected: " + getGroupCount(listTypeHeatMetaDefinition) + ", actual: "
- + resource.getGroups().size(),
- getGroupCount(listTypeHeatMetaDefinition) == resource.getGroups().size());
- assertTrue(
- "check artifact count, expected: " + getArtifactCount(listTypeHeatMetaDefinition, false) + ", actual: "
- + resource.getDeploymentArtifacts().size(),
- getArtifactCount(listTypeHeatMetaDefinition, false) == resource.getDeploymentArtifacts().size());
-
- }
-
- public static void validateToscaDefinitonObjectVsResource(ToscaDefinition toscaDefinition, Resource resource)
- throws Exception {
-
- assertTrue(
- "check resource instance count, expected: " + getResourceInstanceCount(toscaDefinition) + ", actual: "
- + resource.getComponentInstances().size(),
- getResourceInstanceCount(toscaDefinition) == resource.getComponentInstances().size());
- assertTrue(
- "check resource instance relation count, expected: " + getResourceInstanceRelationCount(toscaDefinition)
- + ", actual: " + resource.getComponentInstancesRelations().size(),
- getResourceInstanceRelationCount(toscaDefinition) == resource.getComponentInstancesRelations().size());
-
- }
-
- public static Integer getResourceInstanceCount(ToscaDefinition toscaDefinition) {
-
- return toscaDefinition.getTopology_template().getNode_templates().size();
- }
-
- public static Integer getResourceInstanceRelationCount(ToscaDefinition toscaDefinition) {
- int count = 0;
-// List<ToscaNodeTemplatesTopologyTemplateDefinition> toscaNodeTemplatesTopologyTemplateDefinition = toscaDefinition
-// .getTopology_template().getToscaNodeTemplatesTopologyTemplateDefinition();
- Map<String,ToscaNodeTemplatesTopologyTemplateDefinition> toscaNodeTemplatesTopologyTemplateDefinition = toscaDefinition.getTopology_template().getNode_templates();
- for (int i = 0; i < toscaNodeTemplatesTopologyTemplateDefinition.size(); i++) {
-// List<ToscaRequirementsNodeTemplatesDefinition> requirements = toscaNodeTemplatesTopologyTemplateDefinition.get(i).getRequirements();
-
- for(Entry entry: toscaDefinition.getTopology_template().getNode_templates().entrySet() ){
- if (entry.getValue().equals("requirements")){
-
- }
- }
-
- if (requirements != null) {
- for (ToscaRequirementsNodeTemplatesDefinition requirement : requirements) {
- if (requirement.getNode() != null) {
- count = count + 1;
- }
- }
- }
- }
- return count;
- }
-
- // not finished yet
- private static void validateCsarVfgroup(String csarUUID, Resource resource) {
-
- List<GroupDefinition> groups = resource.getGroups();
- for (GroupDefinition groupDefinition : groups) {
- List<String> artifacts = groupDefinition.getArtifacts();
- assertTrue("group description is null", groupDefinition.getDescription() != null);
- assertTrue("InvariantUUID is null", groupDefinition.getInvariantUUID() != null);
- // groupDefinition.getMembers();
- assertTrue(
- "name format mismatch, expected: " + groupNameBuilder(resource) + "[0-9], actual: "
- + groupDefinition.getName(),
- groupDefinition.getName().contains(groupNameBuilder(resource)));
- // groupDefinition.getProperties();
- // groupDefinition.getPropertyValueCounter();
- assertTrue(groupDefinition.getType().equals(getGroupType()));
- }
-
- String expectedCsarUUID = csarUUID;
- // String expectedToscaResourceName = "org.openecomp.resource.vf." +
- // WordUtils.capitalize(resourceDetails.getName().toLowerCase());
- //
- // assertTrue("csarUUID : " + buildAssertMessage(expectedCsarUUID,
- // resource.getCsarUUID()),
- // expectedCsarUUID.equals(resource.getCsarUUID()));
- // assertTrue("toscaResourceName : " +
- // buildAssertMessage(expectedToscaResourceName,
- // resource.getToscaResourceName()),
- // expectedToscaResourceName.equals(resource.getToscaResourceName()));
- //
- // RestResponse getResourceResponse =
- // ResourceRestUtils.getResource(resource.getUniqueId());
- // Resource getResource =
- // ResponseParser.parseToObjectUsingMapper(getResourceResponse.getResponse(),
- // Resource.class);
- // assertTrue("csarUUID : " + buildAssertMessage(expectedCsarUUID,
- // getResource.getCsarUUID()),
- // expectedCsarUUID.equals(getResource.getCsarUUID()));
- // assertTrue("toscaResourceName : " +
- // buildAssertMessage(expectedToscaResourceName,
- // getResource.getToscaResourceName()),
- // expectedToscaResourceName.equals(getResource.getToscaResourceName()));
-
- }
-
- private static String getGroupType() {
- return "org.openecomp.groups.VfModule";
- }
-*/
-
-
-
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/DistributionValidationUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/DistributionValidationUtils.java
deleted file mode 100644
index b6b809a4a3..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/DistributionValidationUtils.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.validation;
-
-import org.openecomp.sdc.be.model.Service;
-import org.openecomp.sdc.ci.tests.utils.DistributionUtils;
-import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
-import org.openecomp.sdc.common.datastructure.AuditingFieldsKey;
-
-import java.io.IOException;
-import java.text.ParseException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import static org.testng.AssertJUnit.assertNotNull;
-
-public class DistributionValidationUtils {
-
- public static Map<String, String> verifyDistributedArtifactDownloadUsingDB(String distributionID, Map<String, String> expectedArtifactsMapOfDistributedService, List<String> distributionStatusEnumList) throws Exception {
-
- String action = "DStatus";
- int timer = 0;
- int timeWaitPerArtifcat = 3;
- if(expectedArtifactsMapOfDistributedService.size() != 0){
- timer = (expectedArtifactsMapOfDistributedService.size()/10*15 + expectedArtifactsMapOfDistributedService.size() * timeWaitPerArtifcat * distributionStatusEnumList.size() + 30) * 1000 ;
- }
- for (String distributionStatusList : distributionStatusEnumList){
- for (Entry<String, String> url : expectedArtifactsMapOfDistributedService.entrySet()){
- Map <AuditingFieldsKey, String> body = new HashMap<>();
- body.put(AuditingFieldsKey.AUDIT_DISTRIBUTION_ID, distributionID);
- body.put(AuditingFieldsKey.AUDIT_DISTRIBUTION_RESOURCE_URL, url.getValue());
- body.put(AuditingFieldsKey.AUDIT_STATUS, distributionStatusList);
- Map<String, String> actualAuditRecord = new HashMap<String, String>();
- actualAuditRecord = AuditValidationUtils.retrieveAuditMessagesByPattern(action, body, true);
- while (timer != 0) {
- if(actualAuditRecord.size() == 0 ){
- Thread.sleep(1000);
- actualAuditRecord = AuditValidationUtils.retrieveAuditMessagesByPattern(action, body, true);
- timer-=1000;
- if(timer == 0 && actualAuditRecord.size() == 0){
- assertNotNull("audit record did not found in DB for artifact url: " + url.getValue(), null);
- }
- }else{
- timer = timer - timeWaitPerArtifcat * 1000;
- break;
- }
-
- }
- }
- }
- return null;
- }
-
- public static void validateDistributedArtifactsByAudit(Service service, List<String> distributionStatusList) throws Exception, IOException, ParseException {
- String distributionID;
- AtomicOperationUtils.distributeService(service, true);
- distributionID = DistributionUtils.getLatestServiceDistributionObject(service).getDistributionID();
- if(distributionID != null){
- Map<String, String> expectedArtifactsMapOfDistributedService = DistributionUtils.getArtifactsMapOfDistributedService(service);
- DistributionValidationUtils.verifyDistributedArtifactDownloadUsingDB(distributionID, expectedArtifactsMapOfDistributedService, distributionStatusList);
- }
- else{
- assertNotNull("distributionID is null", distributionID);
- }
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ErrorValidationUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ErrorValidationUtils.java
deleted file mode 100644
index 4c5533945b..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ErrorValidationUtils.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.validation;
-
-import org.codehaus.jettison.json.JSONException;
-import org.codehaus.jettison.json.JSONObject;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ExceptionEnumType;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.yaml.snakeyaml.Yaml;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-import java.util.List;
-import java.util.Map;
-
-import static org.testng.AssertJUnit.assertEquals;
-
-public class ErrorValidationUtils {
- static Logger logger = LoggerFactory.getLogger(ErrorValidationUtils.class.getName());
-
- public static void checkBodyResponseOnError(String errorType, List<String> variables, String actualResponse)
- throws FileNotFoundException, JSONException {
-
- ErrorInfo errorInfo = parseErrorConfigYaml(errorType);
- JSONObject expectedResponseBody = null;
- if (errorInfo.getMessageId() != null) {
- if (errorInfo.getMessageId().contains("SVC")) {
- expectedResponseBody = restExceptionFormatBuilder(errorInfo.getMessageId(), errorInfo.getMessage(),
- variables, ExceptionEnumType.SERVICE_EXCEPTION.getValue());
- } else {
- expectedResponseBody = restExceptionFormatBuilder(errorInfo.getMessageId(), errorInfo.getMessage(),
- variables, ExceptionEnumType.POLICY_EXCPTION.getValue());
- }
- }
- actualResponse = actualResponse.replaceAll("\\n", "");
- logger.debug("actualResponse - {}", actualResponse);
- logger.debug("expectedResponseBody - {}", expectedResponseBody);
- assertEquals(expectedResponseBody, new JSONObject(actualResponse));
- }
-
- public static String checkUIResponseOnError(String errorType)
- throws FileNotFoundException, JSONException {
-
- ErrorInfo errorInfo = parseErrorConfigYaml(errorType);
- String messageId = errorInfo.getMessageId();
-
- return messageId;
- }
-
- public static JSONObject restExceptionFormatBuilder(String messageId, String text, List<String> variables,
- String type) {
-
- JSONObject simpleElements = new JSONObject();
- JSONObject exceptionType = new JSONObject();
- JSONObject requestError = new JSONObject();
-
- try {
- simpleElements.put("messageId", messageId);
- simpleElements.put("text", text);
- simpleElements.put("variables", variables);
- exceptionType.put(type, simpleElements);
- requestError.put("requestError", exceptionType);
-
- } catch (JSONException e) {
- e.printStackTrace();
- }
-
- return requestError;
-
- }
-
- public static ErrorInfo parseErrorConfigYaml(String error) throws FileNotFoundException {
- Yaml yaml = new Yaml();
- ErrorInfo errInfo = null;
- Config config = Utils.getConfig();
- String errorConfigurationFile = config.getErrorConfigurationFile();
- File file = new File(errorConfigurationFile);
- // File file = new
- // File("../catalog-be/src/main/resources/config/error-configuration.yaml");
- InputStream inputStream = new FileInputStream(file);
- Map<?, ?> map = (Map<?, ?>) yaml.load(inputStream);
- // System.out.println(map.get("errors"));
- @SuppressWarnings("unchecked")
- Map<String, ErrorInfo> errorMap = (Map<String, ErrorInfo>) map.get("errors");
- @SuppressWarnings("unchecked")
- Map<String, Object> errorInfo = (Map<String, Object>) errorMap.get(error);
-
- String message = (String) errorInfo.get("message");
- String messageId = (String) errorInfo.get("messageId");
- int code = (Integer) errorInfo.get("code");
- errInfo = new ErrorInfo(code, message, messageId);
-
- return errInfo;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ProductValidationUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ProductValidationUtils.java
deleted file mode 100644
index f2ef0826f2..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ProductValidationUtils.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.validation;
-
-import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.LogManager;
-import org.json.simple.JSONArray;
-import org.json.simple.JSONObject;
-import org.json.simple.JSONValue;
-import org.openecomp.sdc.be.model.Product;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.be.model.category.CategoryDefinition;
-import org.openecomp.sdc.be.model.category.GroupingDefinition;
-import org.openecomp.sdc.be.model.category.SubCategoryDefinition;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest.ComponentOperationEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.rest.ProductRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import static org.testng.AssertJUnit.*;
-
-public class ProductValidationUtils {
-
- static Logger logger = LogManager.getLogger(ProductValidationUtils.class);
-
- public static void compareExpectedAndActualProducts(Product expectedProduct, Product actualProduct) {
- compareExpectedAndActualProducts(expectedProduct, actualProduct, null);
- }
-
- public static void compareExpectedAndActualProducts(Product expectedProduct, Product actualProduct,
- ComponentOperationEnum operation) {
-
- assertEquals(expectedProduct.getName(), actualProduct.getName());
- assertEquals(expectedProduct.getFullName(), actualProduct.getFullName());
- assertEquals(expectedProduct.getDescription(), actualProduct.getDescription());
-
- List<String> expectedContacts = expectedProduct.getContacts();
- List<String> actualContacts = actualProduct.getContacts();
- assertTrue(
- "Expected contacts:" + Arrays.toString(expectedContacts.toArray()) + ", actual contacts:"
- + Arrays.toString(actualContacts.toArray()),
- expectedContacts.size() == actualContacts.size() && expectedContacts.containsAll(actualContacts)
- && actualContacts.containsAll(expectedContacts));
-
- List<String> expectedTags = expectedProduct.getTags();
- List<String> actualTags = actualProduct.getTags();
- assertTrue(
- "Expected tags:" + Arrays.toString(expectedTags.toArray()) + ", actual tags:"
- + Arrays.toString(actualTags.toArray()),
- expectedTags.size() == actualTags.size() && expectedTags.containsAll(actualTags)
- && actualTags.containsAll(expectedTags));
-
- assertEquals(expectedProduct.getLifecycleState(), actualProduct.getLifecycleState());
- assertEquals(expectedProduct.getVersion(), actualProduct.getVersion());
- assertEquals(expectedProduct.isHighestVersion(), actualProduct.isHighestVersion());
- assertEquals(expectedProduct.getNormalizedName(), actualProduct.getNormalizedName());
-
- compareCategories(expectedProduct, actualProduct);
- assertEquals(expectedProduct.getLastUpdaterUserId(), actualProduct.getLastUpdaterUserId());
- if (operation != null) {
- assertEquals(expectedProduct.getCreatorUserId(), actualProduct.getCreatorUserId());
- }
-
- Long lastUpdateDate = actualProduct.getLastUpdateDate();
- Long creationDate = actualProduct.getCreationDate();
- Map<String, String> allVersions = actualProduct.getAllVersions();
-
- if (operation != null) {
- if (operation == ComponentOperationEnum.UPDATE_COMPONENT
- || operation == ComponentOperationEnum.CHANGE_STATE_CHECKOUT
- || operation == ComponentOperationEnum.CHANGE_STATE_CHECKIN
- || operation == ComponentOperationEnum.CHANGE_STATE_UNDO_CHECKOUT) {
- assertTrue("Last update date:" + lastUpdateDate + ", creation date: " + creationDate,
- lastUpdateDate > 0 && creationDate > 0 && lastUpdateDate > creationDate);
- } else {
- assertTrue("Last update date:" + lastUpdateDate + ", creation date: " + creationDate,
- lastUpdateDate > 0 && lastUpdateDate.equals(creationDate));
- }
- }
-
- // Check UUIDs
- // If just created, no way to test the UUIDs themselves
- // If updated, we expect the UUIDs of actual to match the expected
- String uniqueId = actualProduct.getUniqueId();
- if (operation == ComponentOperationEnum.CREATE_COMPONENT) {
- UUID.fromString(uniqueId);
- UUID.fromString(actualProduct.getUUID());
- UUID.fromString(actualProduct.getInvariantUUID());
- assertTrue(allVersions.size() == 1);
- assertTrue(allVersions.get("0.1").equals(uniqueId));
- } else {
- if (operation == ComponentOperationEnum.CHANGE_STATE_CHECKOUT) {
- assertFalse(expectedProduct.getUniqueId().equals(uniqueId));
- // Assigning the updated uniqueId to expected so that it can be
- // passed to further logic
- expectedProduct.setUniqueId(uniqueId);
- } else if (operation != null) {
- assertTrue(expectedProduct.getUniqueId().equals(uniqueId));
- }
- assertEquals(expectedProduct.getUUID(), actualProduct.getUUID());
- assertEquals(expectedProduct.getInvariantUUID(), actualProduct.getInvariantUUID());
- }
- }
-
- private static void compareCategories(Product expectedProduct, Product actualProduct) {
- List<CategoryDefinition> expectedCategories = expectedProduct.getCategories();
- List<CategoryDefinition> actualCategories = actualProduct.getCategories();
- if (expectedCategories != null && actualCategories != null) {
- int expSize = expectedCategories.size();
- int actSize = actualCategories.size();
-
- assertTrue("Expected size:" + expSize + ", actual size:" + actSize, expSize == actSize);
-
- for (CategoryDefinition actualDefinition : actualCategories) {
- int lastIndexOfCat = expectedCategories.lastIndexOf(actualDefinition);
- assertTrue("Actual category " + actualDefinition + " not found in expected.", lastIndexOfCat != -1);
- CategoryDefinition expectedDefinition = expectedCategories.get(lastIndexOfCat);
- List<SubCategoryDefinition> actualSubcategories = actualDefinition.getSubcategories();
- List<SubCategoryDefinition> expectedSubcategories = expectedDefinition.getSubcategories();
- for (SubCategoryDefinition actualSub : actualSubcategories) {
- lastIndexOfCat = expectedSubcategories.lastIndexOf(actualSub);
- assertTrue("Actual subcategory " + actualSub + " not found in expected.", lastIndexOfCat != -1);
- SubCategoryDefinition expectedSub = expectedSubcategories.get(lastIndexOfCat);
- List<GroupingDefinition> actualGroupings = actualSub.getGroupings();
- List<GroupingDefinition> expectedGroupings = expectedSub.getGroupings();
- for (GroupingDefinition actualGrouping : actualGroupings) {
- lastIndexOfCat = expectedGroupings.lastIndexOf(actualGrouping);
- assertTrue("Actual grouping " + actualSub + " not found in expected.", lastIndexOfCat != -1);
- }
- }
- }
-
- for (CategoryDefinition expectedDefinition : expectedCategories) {
- int lastIndexOfCat = actualCategories.lastIndexOf(expectedDefinition);
- assertTrue("Expected category " + expectedDefinition + " not found in actual.", lastIndexOfCat != -1);
- CategoryDefinition actualDefinition = actualCategories.get(lastIndexOfCat);
- List<SubCategoryDefinition> actualSubcategories = actualDefinition.getSubcategories();
- List<SubCategoryDefinition> expectedSubcategories = expectedDefinition.getSubcategories();
- for (SubCategoryDefinition expectedSub : expectedSubcategories) {
- lastIndexOfCat = actualSubcategories.lastIndexOf(expectedSub);
- assertTrue("Expected subcategory " + expectedSub + " not found in actual.", lastIndexOfCat != -1);
- SubCategoryDefinition actualSub = actualSubcategories.get(lastIndexOfCat);
- List<GroupingDefinition> actualGroupings = actualSub.getGroupings();
- List<GroupingDefinition> expectedGroupings = expectedSub.getGroupings();
- for (GroupingDefinition expectedGrouping : expectedGroupings) {
- lastIndexOfCat = actualGroupings.lastIndexOf(expectedGrouping);
- assertTrue("Expected grouping " + expectedGrouping + " not found in actual.",
- lastIndexOfCat != -1);
- }
- }
- }
- }
- }
-
- public static void verifyProductsNotExistInUserFollowedPage(User user, Product... nonExpectedProducts)
- throws Exception {
- String component = "products";
- Boolean isExist;
- Product nonExpectedProduct;
- RestResponse getFollowedPage = ProductRestUtils.getFollowed(user.getUserId());
- JSONArray followedProductes = getListArrayFromRestResponse(getFollowedPage, component);
- if (followedProductes != null) { // if any product exist in followed
- // page
- for (int i = 0; i < nonExpectedProducts.length; i++) {
- nonExpectedProduct = nonExpectedProducts[i];
- isExist = false;
- for (int k = 0; k < followedProductes.size(); k++) {
- JSONObject jobject = (JSONObject) followedProductes.get(k);
- if (jobject.get("uuid").toString().equals(nonExpectedProduct.getUUID())) {
- isExist = true;
- k = followedProductes.size();
- }
- }
- assertFalse(isExist);
- }
- }
-
- }
-
- public static void checkUserFollowedPage(User user, Product... expectedProducts) throws Exception {
- String component = "products";
- Boolean isExist;
- Product expectedProduct;
- RestResponse getFollowedPage = ProductRestUtils.getFollowed(user.getUserId());
- JSONArray followedProductes = getListArrayFromRestResponse(getFollowedPage, component);
- assertTrue("check if any followedProductes received ", followedProductes != null);
- assertTrue("check if any expectedProducts and followedProductes are the same size",
- expectedProducts.length == followedProductes.size());
- for (int i = 0; i < expectedProducts.length; i++) {
- expectedProduct = expectedProducts[i];
- isExist = false;
- for (int k = 0; k < followedProductes.size(); k++) {
- JSONObject jobject = (JSONObject) followedProductes.get(k);
- // if(jobject.get("uuid").toString().equals(expectedProduct.getUUID()))
- if (jobject.get("uniqueId").toString().equals(expectedProduct.getUniqueId())) {
-
- String productString = jobject.toJSONString();
- Product actualProduct = ResponseParser.parseToObjectUsingMapper(productString, Product.class);
- ProductValidationUtils.compareExpectedAndActualProducts(expectedProduct, actualProduct, null);
- isExist = true;
- k = followedProductes.size();
- }
- }
- assertTrue(isExist);
- }
- }
-
- private static JSONArray getListArrayFromRestResponse(RestResponse restResponse, String lst) {
- String json = restResponse.getResponse();
- JSONObject jsonResp = (JSONObject) JSONValue.parse(json);
- JSONArray resources = (JSONArray) jsonResp.get(lst);
- return resources;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ResourceValidationUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ResourceValidationUtils.java
deleted file mode 100644
index de6d32beed..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ResourceValidationUtils.java
+++ /dev/null
@@ -1,351 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.validation;
-
-import com.google.gson.Gson;
-import org.openecomp.sdc.be.model.ArtifactDefinition;
-import org.openecomp.sdc.be.model.InterfaceDefinition;
-import org.openecomp.sdc.be.model.Operation;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.model.category.CategoryDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceRespJavaObject;
-import org.openecomp.sdc.ci.tests.datatypes.enums.RespJsonKeysEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-
-import java.util.*;
-
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertTrue;
-
-public class ResourceValidationUtils {
-
- public static void validateResourceReqVsResp(ResourceReqDetails resourceDetails,
- ResourceRespJavaObject resourceRespJavaObject) {
-
- String expected;
-
- expected = resourceDetails.getDescription();
- assertEquals("resource description - ", expected, resourceRespJavaObject.getDescription());
-
- expected = resourceDetails.getVendorName();
- assertEquals("resource vendorName - ", expected, resourceRespJavaObject.getVendorName());
-
- expected = resourceDetails.getVendorRelease();
- assertEquals("resource vendorReleaseName - ", expected, resourceRespJavaObject.getVendorRelease());
-
- expected = resourceDetails.getContactId();
- assertEquals("resource contactId - ", expected, resourceRespJavaObject.getContactId());
-
- }
-
- public static void validateResourceReqVsResp(ResourceReqDetails resourceDetails, Resource resourceRespJavaObject) {
-
- String expected;
-
- expected = resourceDetails.getDescription();
- assertEquals("resource description - ", expected, resourceRespJavaObject.getDescription());
-
- expected = resourceDetails.getVendorName();
- assertEquals("resource vendorName - ", expected, resourceRespJavaObject.getVendorName());
-
- expected = resourceDetails.getVendorRelease();
- assertEquals("resource vendorReleaseName - ", expected, resourceRespJavaObject.getVendorRelease());
-
- expected = resourceDetails.getContactId();
- assertEquals("resource contactId - ", expected, resourceRespJavaObject.getContactId());
-
- // Validating deduplication of tags
- List<String> expectedTags = resourceDetails.getTags();
- if (expectedTags != null) {
- Set<String> hs = new LinkedHashSet<>(expectedTags);
- expectedTags.clear();
- expectedTags.addAll(hs);
- List<String> receivedTags = resourceRespJavaObject.getTags();
- assertEquals("resource tags - ", expectedTags, receivedTags);
- }
-
- }
-
- public static void validateModelObjects(Resource expected, Resource actual) throws Exception {
-
- compareElements(expected.getUniqueId(), actual.getUniqueId());
- compareElements(expected.getName(), actual.getName());
- compareElements(expected.getVersion(), actual.getVersion());
- compareElements(expected.getCreatorUserId(), actual.getCreatorUserId());
- compareElements(expected.getCreatorFullName(), actual.getCreatorFullName());
- compareElements(expected.getLastUpdaterUserId(), actual.getLastUpdaterUserId());
- compareElements(expected.getLastUpdaterFullName(), actual.getLastUpdaterFullName());
- compareElements(expected.getCreatorFullName(), actual.getCreatorFullName());
- compareElements(expected.getCreationDate(), actual.getCreationDate());
- compareElements(expected.getLastUpdateDate(), actual.getLastUpdateDate());
- compareElements(expected.getDescription(), actual.getDescription());
- compareElements(expected.getIcon(), actual.getIcon());
- compareElements(expected.getLastUpdateDate(), actual.getLastUpdateDate());
- // TODO compare tags
- compareElements(expected.getCategories(), actual.getCategories());
- compareElements(expected.getLifecycleState(), actual.getLifecycleState());
- compareElements(expected.getVendorName(), actual.getVendorName());
- compareElements(expected.getVendorRelease(), actual.getVendorRelease());
- compareElements(expected.getContactId(), actual.getContactId());
- compareElements(expected.getUUID(), actual.getUUID());
- compareElements(expected.getVersion(), actual.getVersion());
-
- }
-
- public static void validateResp(RestResponse restResponse, ResourceRespJavaObject resourceRespJavaObject)
- throws Exception {
-
- Gson gson = new Gson();
- String response = restResponse.getResponse();
-
- validateResp(response, resourceRespJavaObject, gson);
-
- }
-
- public static void validateResp(String response, ResourceRespJavaObject resourceRespJavaObject, Gson gson) {
-
- Map<String, Object> map = new HashMap<String, Object>();
- map = (Map<String, Object>) gson.fromJson(response, map.getClass());
-
- // De-duplicating the tags list for comparison
- List<String> tags = resourceRespJavaObject.getTags();
- if (tags != null) {
- Set<String> hs = new LinkedHashSet<>(tags);
- tags = new ArrayList<String>(hs);
- resourceRespJavaObject.setTags(tags);
- tags = new ArrayList<String>(hs);
- resourceRespJavaObject.setTags(tags);
- }
-
- validateField(map, RespJsonKeysEnum.RESOURCE_NAME.getRespJsonKeyName(), resourceRespJavaObject.getName());
- validateField(map, RespJsonKeysEnum.RESOURCE_DESC.getRespJsonKeyName(),
- resourceRespJavaObject.getDescription());
- // validateField(map, RespJsonKeysEnum.CATEGORIES.getRespJsonKeyName(),
- // resourceRespJavaObject.getCategories());
- validateField(map, RespJsonKeysEnum.VENDOR_NAME.getRespJsonKeyName(), resourceRespJavaObject.getVendorName());
- validateField(map, RespJsonKeysEnum.VENDOR_RELEASE.getRespJsonKeyName(),
- resourceRespJavaObject.getVendorRelease());
- validateField(map, RespJsonKeysEnum.CONTACT_ID.getRespJsonKeyName(), resourceRespJavaObject.getContactId());
- validateField(map, RespJsonKeysEnum.ICON.getRespJsonKeyName(), resourceRespJavaObject.getIcon());
- validateField(map, RespJsonKeysEnum.IS_ABSTRACT.getRespJsonKeyName(),
- Boolean.valueOf(resourceRespJavaObject.getAbstractt()));
- validateField(map, RespJsonKeysEnum.HIGHEST_VERSION.getRespJsonKeyName(),
- Boolean.valueOf(resourceRespJavaObject.getIsHighestVersion()));
- validateField(map, RespJsonKeysEnum.UNIQUE_ID.getRespJsonKeyName(), resourceRespJavaObject.getUniqueId());
- validateField(map, RespJsonKeysEnum.RESOURCE_VERSION.getRespJsonKeyName(), resourceRespJavaObject.getVersion());
- validateField(map, RespJsonKeysEnum.LIFE_CYCLE_STATE.getRespJsonKeyName(),
- resourceRespJavaObject.getLifecycleState());
- validateField(map, RespJsonKeysEnum.TAGS.getRespJsonKeyName(), tags);
- validateField(map, RespJsonKeysEnum.CREATOR_ATT_UID.getRespJsonKeyName(),
- resourceRespJavaObject.getCreatorUserId());
- validateField(map, RespJsonKeysEnum.CREATOR_FULL_NAME.getRespJsonKeyName(),
- resourceRespJavaObject.getCreatorFullName());
- validateField(map, RespJsonKeysEnum.LAST_UPDATER_ATT_UID.getRespJsonKeyName(),
- resourceRespJavaObject.getLastUpdaterUserId());
- validateField(map, RespJsonKeysEnum.LAST_UPDATER_FULL_NAME.getRespJsonKeyName(),
- resourceRespJavaObject.getLastUpdaterFullName());
- validateField(map, RespJsonKeysEnum.COST.getRespJsonKeyName(), resourceRespJavaObject.getCost());
- validateField(map, RespJsonKeysEnum.LICENSE_TYPE.getRespJsonKeyName(), resourceRespJavaObject.getLicenseType());
- validateField(map, RespJsonKeysEnum.RESOURCE_TYPE.getRespJsonKeyName(),
- resourceRespJavaObject.getResourceType().toString());
- if (resourceRespJavaObject.getResourceType().equals("VF")) {
- validateField(map, RespJsonKeysEnum.DERIVED_FROM.getRespJsonKeyName(), null);
- } else {
- validateField(map, RespJsonKeysEnum.DERIVED_FROM.getRespJsonKeyName(),
- resourceRespJavaObject.getDerivedFrom());
- }
-
- validateCategories(resourceRespJavaObject, map);
-
- String uuid = ResponseParser.getValueFromJsonResponse(response, RespJsonKeysEnum.UUID.getRespJsonKeyName());
- assertTrue("UUID is empty", uuid != null && !uuid.isEmpty());
- }
-
- private static void validateCategories(ResourceRespJavaObject resourceRespJavaObject, Map<String, Object> map) {
- assertTrue(RespJsonKeysEnum.CATEGORIES.getRespJsonKeyName() + " is missing",
- map.containsKey(RespJsonKeysEnum.CATEGORIES.getRespJsonKeyName()));
- Object foundValue = map.get(RespJsonKeysEnum.CATEGORIES.getRespJsonKeyName());
- List<Map<String, Object>> foundList = (List<Map<String, Object>>) foundValue;
- List<CategoryDefinition> excpectedList = resourceRespJavaObject.getCategories();
-
- assertTrue(foundList.size() == excpectedList.size());
- for (int i = 0; i < foundList.size(); i++) {
- CategoryDefinition expCat = excpectedList.get(i);
- Map<String, Object> foun = foundList.get(i);
- assertTrue("expected " + expCat.getName() + " not equal to actual " + foundValue,
- foun.get("name").equals(expCat.getName()));
- }
- }
-
- public static void validateField(Map<String, Object> map, String jsonField, Object expectedValue) {
- if (expectedValue == null) {
- assertTrue(jsonField + " is expected to be null", !map.containsKey(jsonField));
- } else {
- assertTrue(jsonField + " is missing", map.containsKey(jsonField));
- Object foundValue = map.get(jsonField);
- compareElements(expectedValue, foundValue);
- }
- }
-
- public static void compareElements(Object expectedValue, Object foundValue) {
- if (expectedValue instanceof String) {
- assertTrue(foundValue instanceof String);
- assertTrue("expected " + expectedValue + " not equal to actual " + foundValue,
- foundValue.equals(expectedValue));
- }
- /*
- * else if( expectedValue instanceof Number){ assertTrue(foundValue
- * instanceof Number); assertTrue(foundValue == expectedValue); }
- */
- else if (expectedValue instanceof Boolean) {
- assertTrue(foundValue instanceof Boolean);
- assertTrue(foundValue == expectedValue);
- } else if (expectedValue instanceof Map) {
- assertTrue(foundValue instanceof Map);
- Map<String, Object> foundMap = (Map<String, Object>) foundValue;
- Map<String, Object> excpectedMap = (Map<String, Object>) expectedValue;
- assertTrue(foundMap.size() == excpectedMap.size());
- Iterator<String> foundkeyItr = foundMap.keySet().iterator();
- while (foundkeyItr.hasNext()) {
- String foundKey = foundkeyItr.next();
- assertTrue(excpectedMap.containsKey(foundKey));
- compareElements(excpectedMap.get(foundKey), foundMap.get(foundKey));
- }
-
- } else if (expectedValue instanceof List) {
- assertTrue(foundValue instanceof List);
- List<Object> foundList = (List<Object>) foundValue;
- List<Object> excpectedList = (List<Object>) expectedValue;
- assertTrue(foundList.size() == excpectedList.size());
- for (int i = 0; i < foundList.size(); i++) {
- compareElements(excpectedList.get(i), foundList.get(i));
- }
-
- } else {
- assertTrue(foundValue.equals(expectedValue));
- }
- }
-
- public static boolean validateUuidAfterChangingStatus(String oldUuid, String newUuid) {
- return oldUuid.equals(newUuid);
-
- }
-
- public static void validateRespArt(RestResponse restResponse, ResourceRespJavaObject resourceRespJavaObject,
- String interfaze) throws Exception {
-
- Gson gson = new Gson();
- String response = restResponse.getResponse();
-
- Map<String, Object> map = new HashMap<String, Object>();
- map = (Map<String, Object>) gson.fromJson(response, map.getClass());
-
- Resource resource = gson.fromJson(response, Resource.class);
-
- Map<String, ArtifactDefinition> artifacts = resource.getArtifacts();
- Map<String, InterfaceDefinition> interfaces = null;
-
- if (interfaze != null) {
- interfaces = resource.getInterfaces();
- Map<String, Operation> operation = interfaces.get(interfaze).getOperationsMap();
- // operation.get("configure").getUniqueId();
- }
-
- validateField(map, RespJsonKeysEnum.RESOURCE_NAME.getRespJsonKeyName(), resourceRespJavaObject.getName());
- validateField(map, RespJsonKeysEnum.RESOURCE_DESC.getRespJsonKeyName(),
- resourceRespJavaObject.getDescription());
- // validateField(map, RespJsonKeysEnum.CATEGORIES.getRespJsonKeyName(),
- // resourceRespJavaObject.getCategories());
- validateField(map, RespJsonKeysEnum.DERIVED_FROM.getRespJsonKeyName(), resourceRespJavaObject.getDerivedFrom());
- validateField(map, RespJsonKeysEnum.VENDOR_NAME.getRespJsonKeyName(), resourceRespJavaObject.getVendorName());
- validateField(map, RespJsonKeysEnum.VENDOR_RELEASE.getRespJsonKeyName(),
- resourceRespJavaObject.getVendorRelease());
- validateField(map, RespJsonKeysEnum.CONTACT_ID.getRespJsonKeyName(), resourceRespJavaObject.getContactId());
- validateField(map, RespJsonKeysEnum.ICON.getRespJsonKeyName(), resourceRespJavaObject.getIcon());
- validateField(map, RespJsonKeysEnum.IS_ABSTRACT.getRespJsonKeyName(),
- Boolean.valueOf(resourceRespJavaObject.getAbstractt()));
- validateField(map, RespJsonKeysEnum.HIGHEST_VERSION.getRespJsonKeyName(),
- Boolean.valueOf(resourceRespJavaObject.getIsHighestVersion()));
- validateField(map, RespJsonKeysEnum.UNIQUE_ID.getRespJsonKeyName(), resourceRespJavaObject.getUniqueId());
- validateField(map, RespJsonKeysEnum.RESOURCE_VERSION.getRespJsonKeyName(), resourceRespJavaObject.getVersion());
- validateField(map, RespJsonKeysEnum.LIFE_CYCLE_STATE.getRespJsonKeyName(),
- resourceRespJavaObject.getLifecycleState());
- validateField(map, RespJsonKeysEnum.TAGS.getRespJsonKeyName(), resourceRespJavaObject.getTags());
- validateField(map, RespJsonKeysEnum.CREATOR_ATT_UID.getRespJsonKeyName(),
- resourceRespJavaObject.getCreatorUserId());
- validateField(map, RespJsonKeysEnum.CREATOR_FULL_NAME.getRespJsonKeyName(),
- resourceRespJavaObject.getCreatorFullName());
- validateField(map, RespJsonKeysEnum.LAST_UPDATER_ATT_UID.getRespJsonKeyName(),
- resourceRespJavaObject.getLastUpdaterUserId());
- validateField(map, RespJsonKeysEnum.LAST_UPDATER_FULL_NAME.getRespJsonKeyName(),
- resourceRespJavaObject.getLastUpdaterFullName());
-
- // validate number of artifacts
- if (resourceRespJavaObject.getArtifacts() != null) {
-
- // assertEquals("check number of artifacts",
- // resourceRespJavaObject.getArtifacts().size(), artifacts.size());
- int iterNum = -1;
- ArrayList<String> myArtifacats = new ArrayList<String>();
- Iterator it = artifacts.entrySet().iterator();
- while (it.hasNext()) {
- iterNum++;
- Map.Entry pair = (Map.Entry) it.next();
- // System.out.println(pair.getKey() + " = " + pair.getValue());
- ArtifactDefinition myArtifact = artifacts.get(pair.getKey());
- myArtifacats.add(myArtifact.getEsId());
- it.remove(); // avoids a ConcurrentModificationException
- }
- // assertTrue("check service contains
- // artifacts",myArtifacats.containsAll(resourceRespJavaObject.getArtifacts()));
- }
-
- // validate number of interfaces:
-
- if (interfaze != null) {
- assertEquals("check number of interfaces", resourceRespJavaObject.getInterfaces().size(),
- interfaces.size());
- }
-
- }
-
- public static boolean validateResourceIsAbstartct(List<Resource> resourceList, Boolean bool) {
- if (resourceList != null && resourceList.size() > 0) {
- for (Resource resource : resourceList) {
- if (resource.isAbstract().equals(bool))
- continue;
- else
- return false;
- }
- } else
- return false;
- return true;
- }
-
- public static void validateResourceVersion(Resource resource, String expectedVersion) {
- if (resource != null && !resource.equals("")) {
- assertTrue("expected resource version is: " + expectedVersion + ", but actual is: " + resource.getVersion(),
- resource.getVersion().equals(expectedVersion));
- }
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ServiceValidationUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ServiceValidationUtils.java
deleted file mode 100644
index 6c9b839150..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/ServiceValidationUtils.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.validation;
-
-import org.openecomp.sdc.be.model.DistributionStatusEnum;
-import org.openecomp.sdc.be.model.LifecycleStateEnum;
-import org.openecomp.sdc.be.model.Service;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedResourceAuditJavaObject;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Set;
-
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertFalse;
-
-public class ServiceValidationUtils {
-
- public static void validateServiceResponseMetaData(ServiceReqDetails serviceDetails, Service service, User user,
- LifecycleStateEnum lifecycleState) {
- validateServiceResponseMetaData(serviceDetails, service, user, user, lifecycleState);
- }
-
- public static void validateServiceResponseMetaData(ServiceReqDetails expectedService, Service service,
- User creatorUser, User updaterUser, LifecycleStateEnum lifeCycleState) {
- List<String> expectedTags = expectedService.getTags();
- expectedTags.add(expectedService.getName());
- List<String> receivedTags = service.getTags();
- if (expectedTags != null) {
- Set<String> hs = new LinkedHashSet<>(expectedTags);
- expectedTags.clear();
- expectedTags.addAll(hs);
- }
-
- assertEquals("Check service name on response after create service", expectedService.getName(),
- service.getName());
- // check size of list
- assertEquals("Check only 1 category returned on response after create service", 1,
- expectedService.getCategories().size());
- assertEquals("Check service name on response after create service", expectedService.getName(),
- service.getName());
- assertEquals("Check categories on response after create service",
- expectedService.getCategories().get(0).getName(), service.getCategories().get(0).getName());
- assertEquals("Check tag list on response after create service", expectedTags, receivedTags);
- assertEquals("Check description on response after create service", expectedService.getDescription(),
- service.getDescription());
- // assertEquals("Check vendor name on response after create service",
- // expectedService.getVendorName(), service.getVendorName());
- // assertEquals("Check vendor release on response after create service",
- // expectedService.getVendorRelease(), service.getVendorRelease());
- assertEquals("Check attContant name on response after create service",
- expectedService.getContactId().toLowerCase(), service.getContactId());
- assertEquals("Check icon name on response after create service", expectedService.getIcon(), service.getIcon());
- assertEquals("Check LastUpdaterUserId after create service", updaterUser.getUserId(),
- service.getLastUpdaterUserId());
- assertEquals("Check LastUpdaterName after create service",
- updaterUser.getFirstName() + " " + updaterUser.getLastName(), service.getLastUpdaterFullName());
- assertEquals("Check CreatorUserId after create service", creatorUser.getUserId(), service.getCreatorUserId());
- assertEquals("Check CreatorName after create service",
- creatorUser.getFirstName() + " " + creatorUser.getLastName(), service.getCreatorFullName());
- assertEquals("Check version after create service", expectedService.getVersion(), service.getVersion());
- // assertEquals("Check UniqueId after create service", SERVICE_PREFIX +
- // serviceDetails.getServiceName().toLowerCase()+"." +
- // serviceBaseVersion, service.getUniqueId());
- assertFalse("Check uuid after create service", service.getUUID().isEmpty());
-
- // assertTrue("check creation date after create service",
- // service.getCreationDate() != null);
- // assertTrue("check update date after create service",
- // service.getLastUpdateDate() != null);
-
- if (lifeCycleState != null)
- assertEquals("Check LifecycleState after create service", lifeCycleState, service.getLifecycleState());
- else
- assertEquals("Check LifecycleState after create service", LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT,
- service.getLifecycleState());
- }
-
- public static ExpectedResourceAuditJavaObject constructFieldsForAuditValidation(ServiceReqDetails serviceReqDetails,
- String serviceVersion, User sdncUserDetails) {
-
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = new ExpectedResourceAuditJavaObject();
-
- expectedResourceAuditJavaObject.setAction("Create");
- expectedResourceAuditJavaObject.setModifierUid(sdncUserDetails.getUserId());
- String userFirstLastName = sdncUserDetails.getFirstName() + " " + sdncUserDetails.getLastName();
- expectedResourceAuditJavaObject.setModifierName(userFirstLastName);
- expectedResourceAuditJavaObject.setStatus("200");
- expectedResourceAuditJavaObject.setDesc("OK");
- expectedResourceAuditJavaObject.setResourceName(serviceReqDetails.getName());
- expectedResourceAuditJavaObject.setResourceType("Service");
- expectedResourceAuditJavaObject.setPrevVersion(String.valueOf(Float.parseFloat(serviceVersion) - 0.1f));
- expectedResourceAuditJavaObject.setCurrVersion(serviceVersion);
- expectedResourceAuditJavaObject.setPrevState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
- expectedResourceAuditJavaObject.setCurrState((LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT).toString());
- expectedResourceAuditJavaObject.setComment(null);
-
- return expectedResourceAuditJavaObject;
-
- }
-
- public static void validateDistrubtionStatusValue(RestResponse response,
- DistributionStatusEnum expectedDistributionValue) throws Exception {
- String actualDistributionValue = ResponseParser.getValueFromJsonResponse(response.getResponse(),
- "distributionStatus");
- assertEquals(expectedDistributionValue.name(), actualDistributionValue);
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/UserValidationUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/UserValidationUtils.java
deleted file mode 100644
index 58fd4f05d3..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/validation/UserValidationUtils.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utils.validation;
-
-import com.google.gson.*;
-import org.apache.commons.lang.StringUtils;
-import org.openecomp.sdc.be.dao.utils.UserStatusEnum;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.users.AddUserAuditMessageInfo;
-import org.openecomp.sdc.ci.tests.users.UserAuditJavaObject;
-import org.openecomp.sdc.ci.tests.utils.DbUtils;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-
-import java.util.List;
-
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertTrue;
-
-public class UserValidationUtils {
- public static void compareExpectedAndActualUsers(User expected, User actual) {
-
- String actualFirstName = actual.getFirstName();
- String expectedFirstName = expected.getFirstName();
- assertEquals("check user first name - ", expectedFirstName, actualFirstName);
-
- String actualLastName = actual.getLastName();
- String expectedLastName = expected.getLastName();
- assertEquals("check user last name - ", expectedLastName, actualLastName);
-
- String actualUserId = actual.getUserId();
- String expectedUserId = expected.getUserId();
- assertEquals("check user userId - ", expectedUserId, actualUserId);
-
- String actualEmail = actual.getEmail();
- String expectedEmail = expected.getEmail();
- assertEquals("check user email - ", expectedEmail, actualEmail);
-
- Long actualLastLoginTime = actual.getLastLoginTime();
- Long expectedLastLoginTime = expected.getLastLoginTime();
- assertEquals("check user last login time - ", expectedLastLoginTime, actualLastLoginTime);
-
- String actualRole = actual.getRole();
- if (expected.getRole() == null) {
- String expectedRole = UserRoleEnum.DESIGNER.name();
- assertEquals("check user role - ", expectedRole, actualRole);
- } else {
- String expectedRole = expected.getRole();
- assertEquals("check user role - ", expectedRole, actualRole);
- }
-
- UserStatusEnum actualStatus = expected.getStatus();
- UserStatusEnum expectedStatus = expected.getStatus();
- assertEquals("check user status - ", expectedStatus, actualStatus);
- }
-
- public static void validateDeleteUserAuditMessage(User sdncUserDetails, User sdncModifierDetails,
- String responseCode, String responseMessage, AddUserAuditMessageInfo addUserAuditMessageInfo) {
- String action = "DeleteUser";
- validateUserAuditMessage(sdncUserDetails, sdncModifierDetails, responseCode, responseMessage,
- addUserAuditMessageInfo, action);
-
- }
-
- private static void validateUserAuditMessage(User sdncUserDetails, User sdncModifierDetails, String responseCode,
- String responseMessage, AddUserAuditMessageInfo addUserAuditMessageInfo, String expectedAction) {
-
- assertEquals("check audit action - ", expectedAction, addUserAuditMessageInfo.getACTION());
-
- // String expectedModifierFirstLastName =
- // sdncModifierDetails.getFirstName() + " " +
- // sdncModifierDetails.getLastName();
- // assertEquals("check audit modifier name - ",
- // expectedModifierFirstLastName,
- // addUserAuditMessageInfo.getMODIFIER_NAME());
- String fullName = sdncModifierDetails.getFullName();
- if (sdncModifierDetails.getFullName().equals(" ")) {
- fullName = "";
- }
- String expectedModifierId = fullName + "(" + sdncModifierDetails.getUserId() + ")";
- assertEquals("check audit modifier uid - ", expectedModifierId, addUserAuditMessageInfo.getMODIFIER());
-
- String expectedUserFirstLastName = sdncUserDetails.getFirstName() + " " + sdncUserDetails.getLastName();
- if (expectedUserFirstLastName.equals("null null")) {
- expectedUserFirstLastName = "";
- }
-
- String email = (sdncUserDetails.getEmail() == null) ? "" : sdncUserDetails.getEmail();
- String role = (sdncUserDetails.getRole() == null) ? "DESIGNER" : sdncUserDetails.getRole();
-
- String formatedUser = String.format("%s,%s,%s,%s", sdncUserDetails.getUserId(), expectedUserFirstLastName,
- email, role);
-
- //
- // String expectedUserFirstLastName = sdncUserDetails.getFirstName() + "
- // " + sdncUserDetails.getLastName();
- // if (expectedUserFirstLastName.equals("null null")) {
- // expectedUserFirstLastName = "";
- // }
- //
- // String expectedUserFirstLastName = "";
- // expectedUserFirstLastName += sdncUserDetails.getFirstName() == null ?
- // "" : sdncUserDetails.getFirstName();
- // String lastName = sdncUserDetails.getLastName() == null ? "" :
- // sdncUserDetails.getLastName();
- // if (expectedUserFirstLastName.isEmpty()) {
- // expectedUserFirstLastName = lastName;
- // } else {
- // expectedUserFirstLastName += " " + lastName;
- // }
-
- assertEquals("check audit user name - ", formatedUser, addUserAuditMessageInfo.getUSER());
-
- // String expectedUserUid = sdncUserDetails.getUserId();
- // assertEquals("check audit user uid - ", expectedUserUid,
- // addUserAuditMessageInfo.getUSER_UID());
- //
- // String expectedUserEmail = sdncUserDetails.getEmail() == null ? "" :
- // sdncUserDetails.getEmail();
- // //TODO: esofer check with Andrey. Audit return "" but in user we have
- // null
- // assertEquals("check audit user email - ", expectedUserEmail,
- // addUserAuditMessageInfo.getUSER_EMAIL());
- //
- // String expectedUserRole = sdncUserDetails.getRole();
- // if (expectedUserRole ==null){
- // expectedUserRole = "DESIGNER";
- // assertEquals("check audit user role - ", expectedUserRole,
- // addUserAuditMessageInfo.getUSER_ROLE());
- // }else{
- // assertEquals("check audit user role - ", expectedUserRole,
- // addUserAuditMessageInfo.getUSER_ROLE());
- // }
-
- String expectedUserResponseCode = responseCode;
- assertEquals("check audit user response code - ", expectedUserResponseCode,
- addUserAuditMessageInfo.getSTATUS());
-
- String expectedUserResponseMessage = responseMessage;
- assertEquals("check audit user response message - ", expectedUserResponseMessage,
- addUserAuditMessageInfo.getDESC());
-
- }
-
- public static void validateDataAgainstAuditDB_access(User sdncUserDetails, UserAuditJavaObject auditJavaObject,
- RestResponse restResponse, ErrorInfo errorInfo, List<String> variables) {
-
- validateAuditDataAgainstAuditDbInAccess(sdncUserDetails, auditJavaObject, restResponse, errorInfo, variables);
-
- }
-
- public static void validateAuditDataAgainstAuditDbInAccess(User sdncUserDetails,
- UserAuditJavaObject auditJavaObject, RestResponse restResponse, ErrorInfo errorInfo,
- List<String> variables) {
-
- String expected;
-
- expected = "Access";
- assertEquals("ACTION- ", expected, auditJavaObject.getACTION());
-
- if (sdncUserDetails.getFirstName() != StringUtils.EMPTY && sdncUserDetails.getLastName() != StringUtils.EMPTY) {
- expected = sdncUserDetails.getFirstName() + " " + sdncUserDetails.getLastName();
- } else {
- expected = StringUtils.EMPTY;
- }
- String formatedUser = String.format("%s(%s)", expected, sdncUserDetails.getUserId());
- assertTrue(
- "check audit user: expected start with - " + formatedUser + " ,actual - " + auditJavaObject.getUSER(),
- auditJavaObject.getUSER().startsWith(formatedUser));
-
- expected = restResponse.getErrorCode().toString();
- assertEquals("check audit user status code - ", expected, auditJavaObject.getSTATUS());
-
- if (restResponse.getErrorCode() == 200 || restResponse.getErrorCode() == 201) {
- expected = errorInfo.getMessage();
- } else {
- expected = AuditValidationUtils.buildAuditDescription(errorInfo, variables);
- }
-
- assertEquals("check audit user desc - ", expected, auditJavaObject.getDESC());
-
- // expected = sdncUserDetails.getUserId();
- // assertEquals(expected, auditJavaObject.getUSER());
-
- }
-
- public static void validateUserDetailsOnResponse(User sdncUserDetails, String userDetailsOnResponse) {
-
- String actualFirstName = Utils.getJsonObjectValueByKey(userDetailsOnResponse, "firstName");
- String expectedFirstName = sdncUserDetails.getFirstName();
- assertEquals("check user first name - ", expectedFirstName, actualFirstName);
-
- String actualLastName = Utils.getJsonObjectValueByKey(userDetailsOnResponse, "lastName");
- String expectedLastName = sdncUserDetails.getLastName();
- assertEquals("check user last name - ", expectedLastName, actualLastName);
-
- String actualUserId = Utils.getJsonObjectValueByKey(userDetailsOnResponse, "userId");
- String expectedUserId = sdncUserDetails.getUserId();
- assertEquals("check user userId - ", expectedUserId, actualUserId);
-
- String actualEmail = Utils.getJsonObjectValueByKey(userDetailsOnResponse, "email");
- String expectedEmail = sdncUserDetails.getEmail();
- assertEquals("check user email - ", expectedEmail, actualEmail);
-
- String actualRole = Utils.getJsonObjectValueByKey(userDetailsOnResponse, "role");
- if (sdncUserDetails.getRole() == null) {
- String expectedRole = UserRoleEnum.DESIGNER.name();
- assertEquals("check user role - ", expectedRole, actualRole);
- } else {
- String expectedRole = sdncUserDetails.getRole();
- assertEquals("check user role - ", expectedRole, actualRole);
- }
-
- String actualStatus = Utils.getJsonObjectValueByKey(userDetailsOnResponse, "status");
- String expectedStatus = sdncUserDetails.getStatus().name();
- assertEquals("check user status - ", expectedStatus, actualStatus);
-
- }
-
- public static AddUserAuditMessageInfo getAddUserAuditMessage(String action) throws Exception {
-
- Gson gson = new Gson();
- String index = "auditingevents*";
- String type = "useradminevent";
- String pattern = "/_search?q=ACTION:\"" + action + "\"";
- String auditingMessage = DbUtils.retrieveAuditMessagesByPattern(pattern);
- // String auditingMessage = retrieveAuditMessageByIndexType(index, type,
- // pattern);
- JsonElement jElement = new JsonParser().parse(auditingMessage);
- JsonObject jObject = jElement.getAsJsonObject();
- JsonObject hitsObject = (JsonObject) jObject.get("hits");
- JsonArray hitsArray = (JsonArray) hitsObject.get("hits");
- // for (int i = 0; i < hitsArray.size();){
- if (hitsArray != null) {
- JsonObject jHitObject = (JsonObject) hitsArray.get(0);
- JsonObject jSourceObject = (JsonObject) jHitObject.get("_source");
- AddUserAuditMessageInfo addUserAuditMessageInfo = new AddUserAuditMessageInfo();
- addUserAuditMessageInfo = gson.fromJson(jSourceObject, AddUserAuditMessageInfo.class);
- return addUserAuditMessageInfo;
- }
- return null;
-
- }
-
- public static void validateAddUserAuditMessage(User sdncUserDetails, User sdncModifierDetails, String responseCode,
- String responseMessage, AddUserAuditMessageInfo addUserAuditMessageInfo) {
-
- String action = "AddUser";
- validateUserAuditMessage(sdncUserDetails, sdncModifierDetails, responseCode, responseMessage,
- addUserAuditMessageInfo, action);
-
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/AssetLifeCycle.java b/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/AssetLifeCycle.java
deleted file mode 100644
index 427d3774c1..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/AssetLifeCycle.java
+++ /dev/null
@@ -1,740 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.externalApis;
-
-import com.aventstack.extentreports.Status;
-import com.google.gson.Gson;
-import fj.data.Either;
-import org.json.simple.parser.JSONParser;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.datatypes.enums.AssetTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.*;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.*;
-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.*;
-import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.Assert;
-import org.testng.SkipException;
-import org.testng.annotations.DataProvider;
-import org.testng.annotations.Test;
-
-import java.io.FileNotFoundException;
-
-public class AssetLifeCycle extends ComponentBaseTest {
- private static Logger log = LoggerFactory.getLogger(CRUDExternalAPI.class.getName());
- protected static final String UPLOAD_ARTIFACT_PAYLOAD = "UHVUVFktVXNlci1LZXktRmlsZS0yOiBzc2gtcnNhDQpFbmNyeXB0aW9uOiBhZXMyNTYtY2JjDQpDb21tZW5wOA0K";
- protected static final String UPLOAD_ARTIFACT_NAME = "TLV_prv.ppk";
-
- protected Config config = Config.instance();
- protected String contentTypeHeaderData = "application/json";
- protected String acceptHeaderDate = "application/json";
- protected static User defaultUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
-
- protected Gson gson = new Gson();
- protected JSONParser jsonParser = new JSONParser();
-
-
- protected String serviceVersion;
- protected ResourceReqDetails resourceDetails;
- protected User sdncUserDetails;
- protected ServiceReqDetails serviceDetails;
-
- public static final int STATUS_CODE_SUCCESS = getResponseCodeByAction(ActionStatus.OK);
- public static final int STATUS_CODE_CREATED = getResponseCodeByAction(ActionStatus.CREATED);
- public static final int STATUS_CODE_NOT_FOUND = getResponseCodeByAction(ActionStatus.RESOURCE_NOT_FOUND);
- public static final int STATUS_CODE_INVALID_CONTENT = getResponseCodeByAction(ActionStatus.INVALID_CONTENT);
- public static final int STATUS_CODE_MISSING_INFORMATION = getResponseCodeByAction(ActionStatus.MISSING_INFORMATION);
- public static final int STATUS_CODE_ALREADY_EXISTS = getResponseCodeByAction(ActionStatus.RESOURCE_ALREADY_EXISTS);
- public static final Integer RESTRICTED_OPERATION = getResponseCodeByAction(ActionStatus.RESTRICTED_OPERATION);
- public static final int COMPONENT_IN_CHECKOUT_STATE = getResponseCodeByAction(ActionStatus.COMPONENT_IN_CHECKOUT_STATE);
- public static final int COMPONENT_ALREADY_CHECKED_IN = getResponseCodeByAction(ActionStatus.COMPONENT_ALREADY_CHECKED_IN);
- public static final int COMPONENT_NOT_READY_FOR_CERTIFICATION = getResponseCodeByAction(ActionStatus.COMPONENT_NOT_READY_FOR_CERTIFICATION);
- public static final int COMPONENT_SENT_FOR_CERTIFICATION = getResponseCodeByAction(ActionStatus.COMPONENT_SENT_FOR_CERTIFICATION);
- public static final int COMPONENT_IN_CERT_IN_PROGRESS_STATE = getResponseCodeByAction(ActionStatus.COMPONENT_IN_CERT_IN_PROGRESS_STATE);
- public static final int COMPONENT_ALREADY_CERTIFIED = getResponseCodeByAction(ActionStatus.COMPONENT_ALREADY_CERTIFIED);
-
-
-
- public static int getResponseCodeByAction(ActionStatus actionStatus ){
- ErrorInfo errorInfo;
- try {
- errorInfo = ErrorValidationUtils.parseErrorConfigYaml(actionStatus.name());
- return errorInfo.getCode();
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- }
- return 100500;
- }
-
- @Rule
- public static TestName name = new TestName();
-
- public AssetLifeCycle() {
- super(name, AssetLifeCycle.class.getName());
-
- }
-
-
- // US849997 - Story [BE]: External API for asset lifecycle - checkout
- @Test
- public void createResourceCheckInThenCheckOut() throws Exception {
- User defaultUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- ResourceExternalReqDetails defaultResource = ElementFactory.getDefaultResourceByType("ci", ResourceCategoryEnum.TEMPLATE_MONITORING_TEMPLATE, defaultUser.getUserId(), ResourceTypeEnum.VF.toString());
-
- RestResponse restResponse = ResourceRestUtilsExternalAPI.createResource(defaultResource, defaultUser);
- defaultResource.setVersion(String.format("%.1f",0.1));
- ResourceAssetStructure parsedCreatedResponse = gson.fromJson(restResponse.getResponse(), ResourceAssetStructure.class);
-
- restResponse = LifecycleRestUtils.checkInResource(parsedCreatedResponse.getUuid(), defaultUser);
- Assert.assertEquals(restResponse.getErrorCode(), (Integer)STATUS_CODE_CREATED, "Fail to check in.");
-
- Component resourceDetails = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, defaultResource.getName(), defaultResource.getVersion());
- Assert.assertEquals(resourceDetails.getLifecycleState().toString(), LifeCycleStatesEnum.CHECKIN.getComponentState().toString(), "Life cycle state not changed.");
-
- /*// auditing verification
- AuditingActionEnum action = AuditingActionEnum.CHANGE_LIFECYCLE_BY_API;
- Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
- body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, parsedCreatedResponse.getName());
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory.getDefaultChangeAssetLifeCycleExternalAPI(resourceDetails, defaultUser, LifeCycleStatesEnum.CHECKIN, AssetTypeEnum.RESOURCES);
- AuditValidationUtils.validateAuditExternalChangeAssetLifeCycle(expectedResourceAuditJavaObject, action.getName(), body);*/
-
- restResponse = LifecycleRestUtils.checkOutResource(parsedCreatedResponse.getUuid(), defaultUser);
- Assert.assertEquals(restResponse.getErrorCode(), (Integer)STATUS_CODE_CREATED, "Fail to check out.");
-
- resourceDetails = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, defaultResource.getName(), String.format("%.1f", Double.parseDouble(defaultResource.getVersion()) + 0.1));
- Assert.assertEquals(resourceDetails.getLifecycleState().toString(), LifeCycleStatesEnum.CHECKOUT.getComponentState().toString(), "Life cycle state not changed.");
-
- /*// auditing verification
- body = new HashMap<>();
- body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, parsedCreatedResponse.getName());
- body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_CURR_STATE, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.toString());
- expectedResourceAuditJavaObject = ElementFactory.getDefaultChangeAssetLifeCycleExternalAPI(resourceDetails, defaultUser, LifeCycleStatesEnum.CHECKOUT, AssetTypeEnum.RESOURCES);
- expectedResourceAuditJavaObject.setCurrVersion("0.2");
- expectedResourceAuditJavaObject.setPrevState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN.toString());
- expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.toString());
- AuditValidationUtils.validateAuditExternalChangeAssetLifeCycle(expectedResourceAuditJavaObject, action.getName(), body);*/
-
- }
-
- // US849997 - Story [BE]: External API for asset lifecycle - checkout
- @Test
- public void createServiceCheckInThenCheckOut() throws Exception {
- User defaultUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
-
- Component resourceDetails = null;
- Either<Service, RestResponse> createdComponent = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true);
- resourceDetails = createdComponent.left().value();
-
- RestResponse restResponse = LifecycleRestUtils.checkInService(resourceDetails.getUUID(), defaultUser);
- Assert.assertEquals(restResponse.getErrorCode(), (Integer)STATUS_CODE_CREATED, "Fail to check in.");
-
- resourceDetails = AtomicOperationUtils.getServiceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resourceDetails.getName(), resourceDetails.getVersion());
- Assert.assertEquals(resourceDetails.getLifecycleState().toString(), LifeCycleStatesEnum.CHECKIN.getComponentState().toString(), "Life cycle state not changed.");
-
- /*// auditing verification
- AuditingActionEnum action = AuditingActionEnum.CHANGE_LIFECYCLE_BY_API;
- Map <AuditingFieldsKeysEnum, String> body = new HashMap<>();
- body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getName());
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory.getDefaultChangeAssetLifeCycleExternalAPI(resourceDetails, defaultUser, LifeCycleStatesEnum.CHECKIN, AssetTypeEnum.SERVICES);
- AuditValidationUtils.validateAuditExternalChangeAssetLifeCycle(expectedResourceAuditJavaObject, action.getName(), body);*/
-
- restResponse = LifecycleRestUtils.checkOutService(resourceDetails.getUUID(), defaultUser);
- Assert.assertEquals(restResponse.getErrorCode(), (Integer)STATUS_CODE_CREATED, "Fail to check out.");
-
- resourceDetails = AtomicOperationUtils.getServiceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resourceDetails.getName(), String.format("%.1f", Double.parseDouble(resourceDetails.getVersion()) + 0.1));
- Assert.assertEquals(resourceDetails.getLifecycleState().toString(), LifeCycleStatesEnum.CHECKOUT.getComponentState().toString(), "Life cycle state not changed.");
-
- /*// auditing verification
- body = new HashMap<>();
- body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_NAME, resourceDetails.getName());
- body.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_CURR_STATE, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.toString());
- expectedResourceAuditJavaObject = ElementFactory.getDefaultChangeAssetLifeCycleExternalAPI(resourceDetails, defaultUser, LifeCycleStatesEnum.CHECKOUT, AssetTypeEnum.SERVICES);
- expectedResourceAuditJavaObject.setCurrVersion("0.2");
- expectedResourceAuditJavaObject.setPrevState(LifecycleStateEnum.NOT_CERTIFIED_CHECKIN.toString());
- expectedResourceAuditJavaObject.setCurrState(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.toString());
- AuditValidationUtils.validateAuditExternalChangeAssetLifeCycle(expectedResourceAuditJavaObject, action.getName(), body);*/
- }
-
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
- @DataProvider(name="invalidAssetUUID")
- public static Object[][] dataProviderInvalidAssetUUID() {
- return new Object[][] {
- {AssetTypeEnum.SERVICES, LifeCycleStatesEnum.CHECKIN},
- {AssetTypeEnum.RESOURCES, LifeCycleStatesEnum.CHECKIN},
-
- {AssetTypeEnum.SERVICES, LifeCycleStatesEnum.CHECKOUT},
- {AssetTypeEnum.RESOURCES, LifeCycleStatesEnum.CHECKOUT},
-
- {AssetTypeEnum.SERVICES, LifeCycleStatesEnum.CERTIFICATIONREQUEST},
- /*{AssetTypeEnum.RESOURCES, LifeCycleStatesEnum.CERTIFICATIONREQUEST},*/
-
- {AssetTypeEnum.SERVICES, LifeCycleStatesEnum.STARTCERTIFICATION},
- /*{AssetTypeEnum.RESOURCES, LifeCycleStatesEnum.STARTCERTIFICATION},*/
- };
- }
-
- // US849997 - Story [BE]: External API for asset lifecycle - checkout
- @Test(dataProvider="invalidAssetUUID")
- public void invalidAssetUUID(AssetTypeEnum assetTypeEnum, LifeCycleStatesEnum lifeCycleStatesEnum) throws Exception {
- User defaultUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- String assetUUID = "InvalidAssetUUID";
- ErrorInfo errorInfo = null;
-
- RestResponse restResponse = null;
- if(assetTypeEnum.equals(AssetTypeEnum.SERVICES)) {
-
- if(lifeCycleStatesEnum.equals(LifeCycleStatesEnum.CHECKIN)) {
- restResponse = LifecycleRestUtils.checkInService(assetUUID, defaultUser);
- } else if(lifeCycleStatesEnum.equals(LifeCycleStatesEnum.CHECKOUT)) {
- restResponse = LifecycleRestUtils.checkOutService(assetUUID, defaultUser);
- } else if(lifeCycleStatesEnum.equals(LifeCycleStatesEnum.CERTIFICATIONREQUEST)) {
- restResponse = LifecycleRestUtils.certificationRequestService(assetUUID, defaultUser);
- } else if(lifeCycleStatesEnum.equals(LifeCycleStatesEnum.STARTCERTIFICATION)) {
- restResponse = LifecycleRestUtils.startTestingService(assetUUID, defaultUser);
- }
-
- errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.SERVICE_NOT_FOUND.name());
- } else {
-
- if(lifeCycleStatesEnum.equals(LifeCycleStatesEnum.CHECKIN)) {
- restResponse = LifecycleRestUtils.checkInResource(assetUUID, defaultUser);
- } else if(lifeCycleStatesEnum.equals(LifeCycleStatesEnum.CHECKOUT)) {
- restResponse = LifecycleRestUtils.checkOutResource(assetUUID, defaultUser);
- /*} else if(lifeCycleStatesEnum.equals(LifeCycleStatesEnum.CERTIFICATIONREQUEST)) {
- restResponse = LifecycleRestUtils.certificationRequestResource(assetUUID, defaultUser);
- } else if(lifeCycleStatesEnum.equals(LifeCycleStatesEnum.STARTCERTIFICATION)) {
- restResponse = LifecycleRestUtils.startTestingResource(assetUUID, defaultUser);*/
- }
-
- errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESOURCE_NOT_FOUND.name());
-
- }
- Assert.assertEquals(restResponse.getErrorCode(), (Integer)STATUS_CODE_NOT_FOUND, "Asset found.");
-
- }
-
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
- @DataProvider(name="invalidUserCheckinForCheckedOutService")
- public static Object[][] dataProviderInvalidUserCheckinForCheckedOutService() {
- return new Object[][] {
- {ElementFactory.getDefaultUser(UserRoleEnum.TESTER)},
- // TODO: remove comment after talk with renana if it is defect or not
-// {ElementFactory.getDefaultUser(UserRoleEnum.ADMIN)},
- {ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR)},
- {ElementFactory.getDefaultUser(UserRoleEnum.OPS)},
- /*due to those roles are not exists in the system {ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST1)},
- {ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1)},*/
- };
- }
-
- // US849997 - Story [BE]: External API for asset lifecycle - checkout
- @Test(dataProvider="invalidUserCheckinForCheckedOutService")
- public void invalidUserCheckinForCheckedOutService(User defaultUser) throws Exception {
- Component resourceDetails = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
- RestResponse restResponse = LifecycleRestUtils.checkInService(resourceDetails.getUUID(), defaultUser);
- Assert.assertEquals(restResponse.getErrorCode(), RESTRICTED_OPERATION, "Expected for restricted operation.");
-
- }
-
- @DataProvider(name="invalidUserCheckinForCheckedInService")
- public static Object[][] dataProviderInvalidUserCheckinForCheckedInService() {
- return new Object[][] {
- {ElementFactory.getDefaultUser(UserRoleEnum.TESTER)},
- // TODO: remove comment after talk with renana if it is defect or not
-// {ElementFactory.getDefaultUser(UserRoleEnum.ADMIN)},
- {ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR)},
- {ElementFactory.getDefaultUser(UserRoleEnum.OPS)},
- /*due to those roles are not exists in the system {ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST1)},
- {ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1)},*/
- };
- }
-
- // US849997 - Story [BE]: External API for asset lifecycle - checkout
- @Test(dataProvider="invalidUserCheckinForCheckedInService")
- public void invalidUserCheckinForCheckedInService(User defaultUser) throws Exception {
- Component resourceDetails = null;
- Either<Service, RestResponse> createdComponent = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true);
- resourceDetails = createdComponent.left().value();
- resourceDetails = AtomicOperationUtils.changeComponentState(resourceDetails, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- RestResponse restResponse = LifecycleRestUtils.checkInService(resourceDetails.getUUID(), defaultUser);
- Assert.assertEquals(restResponse.getErrorCode(), RESTRICTED_OPERATION, "Expected for restricted operation.");
-
- }
-
- @DataProvider(name="invalidUserCheckoutForCheckedOutService")
- public static Object[][] dataProviderInvalidUserCheckoutForCheckedOutService() {
- return new Object[][] {
- {ElementFactory.getDefaultUser(UserRoleEnum.TESTER)},
- // TODO: remove comment after talk with renana if it is defect or not
-// {ElementFactory.getDefaultUser(UserRoleEnum.ADMIN)},
- {ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR)},
- {ElementFactory.getDefaultUser(UserRoleEnum.OPS)},
- /*due to those roles are not exists in the system {ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST1)},
- {ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1)},*/
- };
- }
-
- // US849997 - Story [BE]: External API for asset lifecycle - checkout
- @Test(dataProvider="invalidUserCheckoutForCheckedOutService")
- public void invalidUserCheckoutForCheckedOutService(User defaultUser) throws Exception {
-
- Component resourceDetails = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
- RestResponse restResponse = LifecycleRestUtils.checkOutService(resourceDetails.getUUID(), defaultUser);
- Assert.assertEquals(restResponse.getErrorCode(), RESTRICTED_OPERATION, "Expected for restricted operation.");
-
- }
-
- @DataProvider(name="invalidUserCheckoutForCheckedInService")
- public static Object[][] dataProviderInvalidUserCheckoutForCheckedInService() {
- return new Object[][] {
- {ElementFactory.getDefaultUser(UserRoleEnum.TESTER)},
- // TODO: remove comment after talk with renana if it is defect or not
-// {ElementFactory.getDefaultUser(UserRoleEnum.ADMIN)},
- {ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR)},
- {ElementFactory.getDefaultUser(UserRoleEnum.OPS)},
- /*due to those roles are not exists in the system {ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST1)},
- {ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1)},*/
- };
- }
-
- // US849997 - Story [BE]: External API for asset lifecycle - checkout
- @Test(dataProvider="invalidUserCheckoutForCheckedInService")
- public void invalidUserCheckoutForCheckedInService(User defaultUser) throws Exception {
- Component resourceDetails = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
- resourceDetails = AtomicOperationUtils.changeComponentState(resourceDetails, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- RestResponse restResponse = LifecycleRestUtils.checkOutService(resourceDetails.getUUID(), defaultUser);
- Assert.assertEquals(restResponse.getErrorCode(), RESTRICTED_OPERATION, "Expected for restricted operation.");
-
- }
-
- @DataProvider(name="invalidUserCheckinForCheckedOutResource")
- public static Object[][] dataProviderInvalidUserCheckinForCheckedOutResource() {
- return new Object[][] {
- {ElementFactory.getDefaultUser(UserRoleEnum.TESTER)},
- // TODO: remove comment after talk with renana if it is defect or not
-// {ElementFactory.getDefaultUser(UserRoleEnum.ADMIN)},
- {ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR)},
- {ElementFactory.getDefaultUser(UserRoleEnum.OPS)},
- /*due to those roles are not exists in the system {ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST1)},
- {ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1)},*/
- };
- }
-
- // US849997 - Story [BE]: External API for asset lifecycle - checkout
- @Test(dataProvider="invalidUserCheckinForCheckedOutResource")
- public void invalidUserCheckinForCheckedOutResource(User defaultUser) throws Exception {
-
- Component resourceDetails = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, UserRoleEnum.DESIGNER, true).left().value();
- RestResponse restResponse = LifecycleRestUtils.checkInResource(resourceDetails.getUUID(), defaultUser);
- Assert.assertEquals(restResponse.getErrorCode(), RESTRICTED_OPERATION, "Expected for restricted operation.");
-
- }
-
- @DataProvider(name="invalidUserCheckinForCheckedInResource")
- public static Object[][] dataProviderInvalidUserCheckinForCheckedInResource() {
- return new Object[][] {
- {ElementFactory.getDefaultUser(UserRoleEnum.TESTER)},
- // TODO: remove comment after talk with renana if it is defect or not
-// {ElementFactory.getDefaultUser(UserRoleEnum.ADMIN)},
- {ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR)},
- {ElementFactory.getDefaultUser(UserRoleEnum.OPS)},
- /*due to those roles are not exists in the system {ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST1)},
- {ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1)},*/
- };
- }
-
- // US849997 - Story [BE]: External API for asset lifecycle - checkout
- @Test(dataProvider="invalidUserCheckinForCheckedInResource")
- public void invalidUserCheckinForCheckedInResource(User defaultUser) throws Exception {
- Component resourceDetails = null;
- Either<Resource, RestResponse> createdComponent = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, UserRoleEnum.DESIGNER, true);
- resourceDetails = createdComponent.left().value();
- resourceDetails = AtomicOperationUtils.changeComponentState(resourceDetails, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
-
- RestResponse restResponse = LifecycleRestUtils.checkInResource(resourceDetails.getUUID(), defaultUser);
- Assert.assertEquals(restResponse.getErrorCode(), RESTRICTED_OPERATION, "Expected for restricted operation.");
- }
-
- @DataProvider(name="invalidUserCheckoutForCheckedOutResource")
- public static Object[][] dataProviderInvalidUserCheckoutForCheckedOutResource() {
- return new Object[][] {
- {ElementFactory.getDefaultUser(UserRoleEnum.TESTER)},
- // TODO: remove comment after talk with renana if it is defect or not
-// {ElementFactory.getDefaultUser(UserRoleEnum.ADMIN)},
- {ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR)},
- {ElementFactory.getDefaultUser(UserRoleEnum.OPS)},
- /*due to those roles are not exists in the system {ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST1)},
- {ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1)},*/
- };
- }
-
- // US849997 - Story [BE]: External API for asset lifecycle - checkout
- @Test(dataProvider="invalidUserCheckoutForCheckedOutResource")
- public void invalidUserCheckoutForCheckedOutResource(User defaultUser) throws Exception {
-
- Component resourceDetails = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, UserRoleEnum.DESIGNER, true).left().value();
- RestResponse restResponse = LifecycleRestUtils.checkOutResource(resourceDetails.getUUID(), defaultUser);
- Assert.assertEquals(restResponse.getErrorCode(), RESTRICTED_OPERATION, "Expected for restricted operation.");
-
- }
-
- @DataProvider(name="invalidUserCheckoutForCheckedInResource")
- public static Object[][] dataProviderInvalidUserCheckoutForCheckedInResource() {
- return new Object[][] {
- {ElementFactory.getDefaultUser(UserRoleEnum.TESTER)},
- // TODO: remove comment after talk with renana if it is defect or not
-// {ElementFactory.getDefaultUser(UserRoleEnum.ADMIN)},
- {ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR)},
- {ElementFactory.getDefaultUser(UserRoleEnum.OPS)},
- /*due to those roles are not exists in the system {ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_STRATEGIST1)},
- {ElementFactory.getDefaultUser(UserRoleEnum.PRODUCT_MANAGER1)},*/
- };
- }
-
- // US849997 - Story [BE]: External API for asset lifecycle - checkout
- @Test(dataProvider="invalidUserCheckoutForCheckedInResource")
- public void invalidUserCheckoutForCheckedInResource(User defaultUser) throws Exception {
-
- Component resourceDetails = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, UserRoleEnum.DESIGNER, true).left().value();
- resourceDetails = AtomicOperationUtils.changeComponentState(resourceDetails, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
-
- RestResponse restResponse = LifecycleRestUtils.checkOutResource(resourceDetails.getUUID(), defaultUser);
- Assert.assertEquals(restResponse.getErrorCode(), RESTRICTED_OPERATION, "Expected for restricted operation.");
-
- }
-
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-
-
-
- @DataProvider(name="invalidStatesForService")
- public static Object[][] dataProviderInvalidStatesForService() {
- return new Object[][] {
- {LifeCycleStatesEnum.CHECKIN, LifeCycleStatesEnum.CHECKIN, COMPONENT_ALREADY_CHECKED_IN, LifecycleStateEnum.NOT_CERTIFIED_CHECKIN, LifecycleStateEnum.NOT_CERTIFIED_CHECKIN, "409", ActionStatus.COMPONENT_ALREADY_CHECKED_IN, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), null},
- {LifeCycleStatesEnum.CHECKOUT, LifeCycleStatesEnum.CHECKOUT, COMPONENT_IN_CHECKOUT_STATE, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, "403", ActionStatus.COMPONENT_IN_CHECKOUT_STATE, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), null},
- {LifeCycleStatesEnum.CERTIFY, LifeCycleStatesEnum.CHECKIN, COMPONENT_ALREADY_CERTIFIED, LifecycleStateEnum.CERTIFIED, LifecycleStateEnum.CERTIFIED, "403", ActionStatus.COMPONENT_ALREADY_CERTIFIED, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER)},
- {LifeCycleStatesEnum.CERTIFY, LifeCycleStatesEnum.CERTIFY, COMPONENT_NOT_READY_FOR_CERTIFICATION, LifecycleStateEnum.CERTIFIED, LifecycleStateEnum.CERTIFIED, "403", ActionStatus.COMPONENT_NOT_READY_FOR_CERTIFICATION, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), null},
- };
- }
-
- // US849997 - Story [BE]: External API for asset lifecycle - checkout
- @Test(dataProvider="invalidStatesForService")
- public void invalidStatesForService(LifeCycleStatesEnum initState, LifeCycleStatesEnum targetState, int errorCode,
- LifecycleStateEnum preState, LifecycleStateEnum currState, String status,
- ActionStatus actionStatus, User user, User operationUser) throws Exception {
-
- getExtendTest().log(Status.INFO, String.format("initState: %s, targetState: %s, errorCode: %s,"
- + " preState: %s, currState: %s, status: %s, actionStatus: %s, user: %s, operationUser: %s", initState, targetState, errorCode, preState,
- currState, status, actionStatus, user, operationUser));
-
-
- Either<Service, RestResponse> createdComponent = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true);
- Component service = createdComponent.left().value();
-
- service = AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, initState, true).getLeft();
-
- RestResponse restResponse = null;
-
- if(targetState.equals(LifeCycleStatesEnum.CHECKOUT)) {
- restResponse = LifecycleRestUtils.checkOutService(service.getUUID(), user);
- } else if(targetState.equals(LifeCycleStatesEnum.CHECKIN)) {
- restResponse = LifecycleRestUtils.checkInService(service.getUUID(), user);
- } else if(targetState.equals(LifeCycleStatesEnum.CERTIFY)) {
- restResponse = LifecycleRestUtils.certifyService(service.getUUID(), user);
- }
-
- Assert.assertEquals(restResponse.getErrorCode(), (Integer)errorCode, "Expected that response code will be equal.");
-
- }
-
- @DataProvider(name="invalidStatesForResource")
- public static Object[][] dataProviderInvalidStatesForResource() {
- return new Object[][] {
- {LifeCycleStatesEnum.CHECKIN, LifeCycleStatesEnum.CHECKIN, COMPONENT_ALREADY_CHECKED_IN, LifecycleStateEnum.NOT_CERTIFIED_CHECKIN, LifecycleStateEnum.NOT_CERTIFIED_CHECKIN, "409", ActionStatus.COMPONENT_ALREADY_CHECKED_IN, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), null},
- /* {LifeCycleStatesEnum.CHECKIN, LifeCycleStatesEnum.STARTCERTIFICATION, COMPONENT_NOT_READY_FOR_CERTIFICATION, LifecycleStateEnum.NOT_CERTIFIED_CHECKIN, LifecycleStateEnum.NOT_CERTIFIED_CHECKIN, "403", ActionStatus.COMPONENT_NOT_READY_FOR_CERTIFICATION, ElementFactory.getDefaultUser(UserRoleEnum.TESTER), null},*/
- {LifeCycleStatesEnum.CHECKIN, LifeCycleStatesEnum.CERTIFY, COMPONENT_NOT_READY_FOR_CERTIFICATION, LifecycleStateEnum.NOT_CERTIFIED_CHECKIN, LifecycleStateEnum.NOT_CERTIFIED_CHECKIN, "403", ActionStatus.COMPONENT_NOT_READY_FOR_CERTIFICATION, ElementFactory.getDefaultUser(UserRoleEnum.TESTER), null},
-
- {LifeCycleStatesEnum.CHECKOUT, LifeCycleStatesEnum.CHECKOUT, COMPONENT_IN_CHECKOUT_STATE, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, "403", ActionStatus.COMPONENT_IN_CHECKOUT_STATE, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), null},
- /* {LifeCycleStatesEnum.CHECKOUT, LifeCycleStatesEnum.STARTCERTIFICATION, COMPONENT_NOT_READY_FOR_CERTIFICATION, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, "403", ActionStatus.COMPONENT_NOT_READY_FOR_CERTIFICATION, ElementFactory.getDefaultUser(UserRoleEnum.TESTER), null},*/
- {LifeCycleStatesEnum.CHECKOUT, LifeCycleStatesEnum.CERTIFY, COMPONENT_NOT_READY_FOR_CERTIFICATION, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT, "403", ActionStatus.COMPONENT_NOT_READY_FOR_CERTIFICATION, ElementFactory.getDefaultUser(UserRoleEnum.TESTER), null},
-
- /*{LifeCycleStatesEnum.CERTIFICATIONREQUEST, LifeCycleStatesEnum.CERTIFICATIONREQUEST, COMPONENT_SENT_FOR_CERTIFICATION, LifecycleStateEnum.READY_FOR_CERTIFICATION, LifecycleStateEnum.READY_FOR_CERTIFICATION, "403", ActionStatus.COMPONENT_SENT_FOR_CERTIFICATION, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), null},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, LifeCycleStatesEnum.CERTIFY, RESTRICTED_OPERATION, LifecycleStateEnum.READY_FOR_CERTIFICATION, LifecycleStateEnum.READY_FOR_CERTIFICATION, "409", ActionStatus.RESTRICTED_OPERATION, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), null},
-
- {LifeCycleStatesEnum.STARTCERTIFICATION, LifeCycleStatesEnum.CHECKIN, COMPONENT_IN_CERT_IN_PROGRESS_STATE, LifecycleStateEnum.CERTIFICATION_IN_PROGRESS, LifecycleStateEnum.CERTIFICATION_IN_PROGRESS, "403", ActionStatus.COMPONENT_IN_CERT_IN_PROGRESS_STATE, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), ElementFactory.getDefaultUser(UserRoleEnum.TESTER)},
- {LifeCycleStatesEnum.STARTCERTIFICATION, LifeCycleStatesEnum.CHECKOUT, COMPONENT_IN_CERT_IN_PROGRESS_STATE, LifecycleStateEnum.CERTIFICATION_IN_PROGRESS, LifecycleStateEnum.CERTIFICATION_IN_PROGRESS, "403", ActionStatus.COMPONENT_IN_CERT_IN_PROGRESS_STATE, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), ElementFactory.getDefaultUser(UserRoleEnum.TESTER)},
- {LifeCycleStatesEnum.STARTCERTIFICATION, LifeCycleStatesEnum.CERTIFICATIONREQUEST, COMPONENT_IN_CERT_IN_PROGRESS_STATE, LifecycleStateEnum.CERTIFICATION_IN_PROGRESS, LifecycleStateEnum.CERTIFICATION_IN_PROGRESS, "403", ActionStatus.COMPONENT_IN_CERT_IN_PROGRESS_STATE, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), ElementFactory.getDefaultUser(UserRoleEnum.TESTER)},
- {LifeCycleStatesEnum.STARTCERTIFICATION, LifeCycleStatesEnum.STARTCERTIFICATION, COMPONENT_IN_CERT_IN_PROGRESS_STATE, LifecycleStateEnum.CERTIFICATION_IN_PROGRESS, LifecycleStateEnum.CERTIFICATION_IN_PROGRESS, "403", ActionStatus.COMPONENT_IN_CERT_IN_PROGRESS_STATE, ElementFactory.getDefaultUser(UserRoleEnum.TESTER), null},*/
-
- {LifeCycleStatesEnum.CERTIFY, LifeCycleStatesEnum.CHECKIN, COMPONENT_ALREADY_CERTIFIED, LifecycleStateEnum.CERTIFIED, LifecycleStateEnum.CERTIFIED, "403", ActionStatus.COMPONENT_ALREADY_CERTIFIED, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), ElementFactory.getDefaultUser(UserRoleEnum.TESTER)},
- /*{LifeCycleStatesEnum.CERTIFY, LifeCycleStatesEnum.CERTIFICATIONREQUEST, COMPONENT_ALREADY_CERTIFIED, LifecycleStateEnum.CERTIFIED, LifecycleStateEnum.CERTIFIED, "403", ActionStatus.COMPONENT_ALREADY_CERTIFIED, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), ElementFactory.getDefaultUser(UserRoleEnum.TESTER)},
- {LifeCycleStatesEnum.CERTIFY, LifeCycleStatesEnum.STARTCERTIFICATION, COMPONENT_ALREADY_CERTIFIED, LifecycleStateEnum.CERTIFIED, LifecycleStateEnum.CERTIFIED, "403", ActionStatus.COMPONENT_ALREADY_CERTIFIED, ElementFactory.getDefaultUser(UserRoleEnum.TESTER), null},*/
- {LifeCycleStatesEnum.CERTIFY, LifeCycleStatesEnum.CERTIFY, COMPONENT_NOT_READY_FOR_CERTIFICATION, LifecycleStateEnum.CERTIFIED, LifecycleStateEnum.CERTIFIED, "403", ActionStatus.COMPONENT_NOT_READY_FOR_CERTIFICATION, ElementFactory.getDefaultUser(UserRoleEnum.TESTER), null},
- };
- }
-
- // US849997 - Story [BE]: External API for asset lifecycle - checkout
- @Test(dataProvider="invalidStatesForResource")
- public void invalidStatesForResource(LifeCycleStatesEnum initState, LifeCycleStatesEnum targetState, int errorCode,
- LifecycleStateEnum preState, LifecycleStateEnum currState, String status,
- ActionStatus actionStatus, User user, User operationUser) throws Exception {
-
- getExtendTest().log(Status.INFO, String.format("initState: %s, targetState: %s, errorCode: %s,"
- + " preState: %s, currState: %s, status: %s, actionStatus: %s, user: %s, operationUser: %s", initState, targetState, errorCode, preState,
- currState, status, actionStatus, user, operationUser));
-
- Either<Resource, RestResponse> createdComponent = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, UserRoleEnum.DESIGNER, true);
- Component resourceDetails = createdComponent.left().value();
-
- resourceDetails = AtomicOperationUtils.changeComponentState(resourceDetails, UserRoleEnum.DESIGNER, initState, true).getLeft();
-
- RestResponse restResponse = null;
-
- if(targetState.equals(LifeCycleStatesEnum.CHECKOUT)) {
- restResponse = LifecycleRestUtils.checkOutResource(resourceDetails.getUUID(), user);
- } else if(targetState.equals(LifeCycleStatesEnum.CHECKIN)) {
- restResponse = LifecycleRestUtils.checkInResource(resourceDetails.getUUID(), user);
- } else if(targetState.equals(LifeCycleStatesEnum.CERTIFY)) {
- restResponse = LifecycleRestUtils.certifyResource(resourceDetails.getUUID(), user);
- }
-
- Assert.assertEquals(restResponse.getErrorCode(), (Integer)errorCode, "Expected that response code will be equal.");
-
- }
-
-
-
-
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-/* // US824692 - Story [BE]: External API for asset lifecycle - submit for test / start testing
- @Test
- public void BasicFlowForResourceSubmitForTestingStartTesting() throws Exception {
- Either<Resource, RestResponse> createdComponent = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, UserRoleEnum.DESIGNER, true);
- Component resourceDetails = createdComponent.left().value();
- RestResponse restResponse = LifecycleRestUtils.checkInResource(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
-
- // Certification request
- restResponse = LifecycleRestUtils.certificationRequestResource(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- }*/
-
- // US824692 - Story [BE]: External API for asset lifecycle - submit for test / start testing
- @Test
- public void BasicFlowForServiceSubmitForTestingStartTesting() throws Exception {
- Either<Service, RestResponse> createdComponent = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true);
- Component resourceDetails = createdComponent.left().value();
- RestResponse restResponse = LifecycleRestUtils.checkInService(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
-
- // Certification request
- restResponse = LifecycleRestUtils.certificationRequestService(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
-
- // Start testing
- restResponse = LifecycleRestUtils.startTestingService(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.TESTER));
-
- }
-
- /*// US824692 - Story [BE]: External API for asset lifecycle - submit for test / start testing
- @Test
- public void specialCaseInvalidFlowForVfcmtSubmitForTesting() throws Exception {
- Either<Resource, RestResponse> createdComponent = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFCMT, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, UserRoleEnum.DESIGNER, true);
- Component resourceDetails = createdComponent.left().value();
- RestResponse restResponse = LifecycleRestUtils.checkInResource(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
-
- // Certification request
- restResponse = LifecycleRestUtils.certificationRequestResource(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- }*/
-
- // US824692 - Story [BE]: External API for asset lifecycle - submit for test / start testing
- @Test
- public void specialCaseInvalidFlowForVfcmtStartTesting() throws Exception {
- Either<Resource, RestResponse> createdComponent = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFCMT, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, UserRoleEnum.DESIGNER, true);
- Component resourceDetails = createdComponent.left().value();
- RestResponse restResponse = LifecycleRestUtils.checkInResource(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
-
- // Certification request
- restResponse = LifecycleRestUtils.startTestingResource(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.TESTER));
-
- }
-
-
-
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-
-
-
- // US824692 - Story [BE]: External API for asset lifecycle - submit for test / start testing
- @Test
- public void BasicFlowForResourceCertify() throws Exception {
- Either<Resource, RestResponse> createdComponent = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, UserRoleEnum.DESIGNER, true);
- Component resourceDetails = createdComponent.left().value();
- RestResponse restResponse = LifecycleRestUtils.checkInResource(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
-
- /*// Certification request
- restResponse = LifecycleRestUtils.certificationRequestResource(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
-
- // Start testing
- restResponse = LifecycleRestUtils.startTestingResource(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.TESTER));*/
-
- // Certify
- restResponse = LifecycleRestUtils.certifyResource(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- }
-
- // US824692 - Story [BE]: External API for asset lifecycle - submit for test / start testing
- @Test
- public void BasicFlowForServiceCertify() throws Exception {
- Either<Service, RestResponse> createdComponent = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true);
- Component resourceDetails = createdComponent.left().value();
- RestResponse restResponse = LifecycleRestUtils.checkInService(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
-
- // Certification request
- restResponse = LifecycleRestUtils.certificationRequestService(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
-
- // Start testing
- restResponse = LifecycleRestUtils.startTestingService(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.TESTER));
-
- // Certify
- restResponse = LifecycleRestUtils.certifyService(resourceDetails.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.TESTER));
-
- }
-
-
-
-
-
-
-
-
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
- @Test
- public void theFlow() throws Exception {
- User defaultUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- ResourceExternalReqDetails defaultResource = ElementFactory.getDefaultResourceByType("ci", ResourceCategoryEnum.TEMPLATE_MONITORING_TEMPLATE, defaultUser.getUserId(), ResourceTypeEnum.VFCMT.toString());
-
- // 1. Create VFCMT.
- RestResponse restResponse = ResourceRestUtilsExternalAPI.createResource(defaultResource, defaultUser);
- BaseRestUtils.checkCreateResponse(restResponse);
- ResourceAssetStructure parsedCreatedResponse = gson.fromJson(restResponse.getResponse(), ResourceAssetStructure.class);
-
- // 2. Using search external API with resourceType=VFCMT to retrieve VFCMT.
- restResponse = ResourceRestUtils.getResourceListFilterByCriteria(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), AssetTypeEnum.RESOURCES.getValue(), SearchCriteriaEnum.RESOURCE_TYPE.getValue(), ResourceTypeEnum.VFCMT.toString());
- BaseRestUtils.checkSuccess(restResponse);
- ResourceAssetStructure dataOutOfSearchResponseForResourceName = ResponseParser.getDataOutOfSearchExternalAPIResponseForResourceName(restResponse.getResponse(), parsedCreatedResponse.getName());
- Assert.assertEquals(parsedCreatedResponse.getUuid(), dataOutOfSearchResponseForResourceName.getUuid(), "Created resourceUUID not equal to search retrieve resourceUUID.");
-
- // 3. Use getSpecificMetadata external API to receive full information of the VFCMT.
- RestResponse assetResponse = AssetRestUtils.getAssetMetadataByAssetTypeAndUuid(true, AssetTypeEnum.RESOURCES, dataOutOfSearchResponseForResourceName.getUuid());
- BaseRestUtils.checkSuccess(assetResponse);
- ResourceDetailedAssetStructure resourceAssetMetadata = AssetRestUtils.getResourceAssetMetadata(assetResponse);
- Assert.assertEquals(resourceAssetMetadata.getUuid(), parsedCreatedResponse.getUuid(), "Created resourceUUID not equal to getSpecificMetadata resourceUUID.");
-
- // 4. Upload artifact via upload artifact external API.
- Component initComponentVersion = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, parsedCreatedResponse.getName(), parsedCreatedResponse.getVersion());
- ArtifactReqDetails artifactReqDetails = ElementFactory.getArtifactByType("ci", "OTHER", true, false);
- RestResponse uploadArtifactRestResponse = ArtifactRestUtils.externalAPIUploadArtifactOfTheAsset(initComponentVersion, defaultUser, artifactReqDetails);
- BaseRestUtils.checkSuccess(uploadArtifactRestResponse);
-
- ArtifactDefinition responseArtifact = ResponseParser.convertArtifactDefinitionResponseToJavaObject(uploadArtifactRestResponse.getResponse());
-// ArtifactDefinition responseArtifact = ArtifactRestUtils.getArtifactDataFromJson(uploadArtifactRestResponse.getResponse());
- initComponentVersion = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, parsedCreatedResponse.getName(), parsedCreatedResponse.getVersion());
-
- // 5. Update artifact via external API.
- CRUDExternalAPI crudExternalAPI = new CRUDExternalAPI();
- crudExternalAPI.updateArtifactOnAssetViaExternalAPI(initComponentVersion, ComponentTypeEnum.RESOURCE, LifeCycleStatesEnum.CHECKOUT, "OTHER");
-
-
- // 6. Use external API to checkin the VFCMT.
- RestResponse checkInRestResponse = LifecycleRestUtils.checkInResource(initComponentVersion.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- BaseRestUtils.checkCreateResponse(checkInRestResponse);
- parsedCreatedResponse = gson.fromJson(checkInRestResponse.getResponse(), ResourceAssetStructure.class);
- Assert.assertEquals(parsedCreatedResponse.getVersion(), "0.1", "Expect that version will not change.");
- Assert.assertEquals(parsedCreatedResponse.getUuid(), initComponentVersion.getUUID(), "Expect that UUID will not change.");
- Assert.assertEquals(parsedCreatedResponse.getInvariantUUID(), initComponentVersion.getInvariantUUID(), "Expected that invariantUUID will not change.");
-
- // 7. Then checkout the VFCMT via external API.
- RestResponse checkOutRestResponse = LifecycleRestUtils.checkOutResource(initComponentVersion.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- BaseRestUtils.checkCreateResponse(checkOutRestResponse);
- parsedCreatedResponse = gson.fromJson(checkOutRestResponse.getResponse(), ResourceAssetStructure.class);
- Assert.assertEquals(parsedCreatedResponse.getVersion(), "0.2", "Expect that version will change to 0.2.");
- Assert.assertEquals(parsedCreatedResponse.getUuid(), initComponentVersion.getUUID(), "Expect that UUID will not change.");
- Assert.assertEquals(parsedCreatedResponse.getInvariantUUID(), initComponentVersion.getInvariantUUID(), "Expected that invariantUUID will not change.");
-
- // 8. The minor version must be incremented, the invariantUUID, and UUID must stay the same, the uniqueId should be changed, the artifacts from first version exists on the new version.
- Component newComponentVersion = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, parsedCreatedResponse.getName(), String.format("%.1f", Double.parseDouble(parsedCreatedResponse.getVersion())));
- Assert.assertEquals(newComponentVersion.getInvariantUUID(), initComponentVersion.getInvariantUUID(), "Expected that invariantUUID will not change.");
- Assert.assertEquals(newComponentVersion.getUUID(), initComponentVersion.getUUID(), "Expected that UUID will not change.");
- Assert.assertNotEquals(newComponentVersion.getUniqueId(), initComponentVersion.getUniqueId(), "Expected that uniqueId will change.");
- Assert.assertTrue(newComponentVersion.getDeploymentArtifacts().keySet().contains(responseArtifact.getArtifactLabel()), "Expected that artifact from first version exists on the new version.");
-
- // 9. The previous version remains untouched, the highest version flag on the first version is false, all information (metadata / artifacts) are the same on the first version.
- initComponentVersion = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, parsedCreatedResponse.getName(), String.format("%.1f", Double.parseDouble("0.1")));
- Assert.assertEquals(initComponentVersion.isHighestVersion(), (Boolean)false, "Expected that highest version flag on first version is false.");
-
- // 10. Check in via external API.
- checkInRestResponse = LifecycleRestUtils.checkInResource(initComponentVersion.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- BaseRestUtils.checkCreateResponse(checkInRestResponse);
- parsedCreatedResponse = gson.fromJson(checkInRestResponse.getResponse(), ResourceAssetStructure.class);
- Assert.assertEquals(parsedCreatedResponse.getVersion(), "0.2", "Expect that version will not change.");
- Assert.assertEquals(parsedCreatedResponse.getUuid(), initComponentVersion.getUUID(), "Expect that UUID will not change.");
- Assert.assertEquals(parsedCreatedResponse.getInvariantUUID(), initComponentVersion.getInvariantUUID(), "Expected that invariantUUID will not change.");
-
- // 11. Certify via external API.
- RestResponse certifyRestResponse = LifecycleRestUtils.certifyResource(initComponentVersion.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- BaseRestUtils.checkCreateResponse(certifyRestResponse);
- parsedCreatedResponse = gson.fromJson(certifyRestResponse.getResponse(), ResourceAssetStructure.class);
- Assert.assertEquals(parsedCreatedResponse.getVersion(), "1.0", "Expect that version will change to 1.0");
- Assert.assertEquals(parsedCreatedResponse.getUuid(), initComponentVersion.getUUID(), "Expect that UUID will not change.");
- Assert.assertEquals(parsedCreatedResponse.getInvariantUUID(), initComponentVersion.getInvariantUUID(), "Expected that invariantUUID will not change.");
-
- // 12. Check out via external API.
- checkOutRestResponse = LifecycleRestUtils.checkOutResource(initComponentVersion.getUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
- BaseRestUtils.checkCreateResponse(checkOutRestResponse);
- parsedCreatedResponse = gson.fromJson(checkOutRestResponse.getResponse(), ResourceAssetStructure.class);
- Assert.assertEquals(parsedCreatedResponse.getVersion(), "1.1", "Expect that version will change to 1.1");
- Assert.assertNotEquals(parsedCreatedResponse.getUuid(), initComponentVersion.getUUID(), "Expect that UUID will change.");
- Assert.assertEquals(parsedCreatedResponse.getInvariantUUID(), initComponentVersion.getInvariantUUID(), "Expected that invariantUUID will not change.");
-
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/CRUDExternalAPI.java b/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/CRUDExternalAPI.java
deleted file mode 100644
index 3b7d2dbb8b..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/CRUDExternalAPI.java
+++ /dev/null
@@ -1,2442 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.externalApis;
-
-import com.aventstack.extentreports.Status;
-import fj.data.Either;
-import org.apache.commons.lang3.StringUtils;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.*;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-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.ArtifactRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
-import org.openecomp.sdc.common.util.ValidationUtils;
-import org.testng.Assert;
-import org.testng.annotations.DataProvider;
-import org.testng.annotations.Test;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-
-import static java.util.Arrays.asList;
-
-public class CRUDExternalAPI extends ComponentBaseTest {
-
- /*private static Logger log = LoggerFactory.getLogger(CRUDExternalAPI.class.getName());
- protected static final String UPLOAD_ARTIFACT_PAYLOAD = "UHVUVFktVXNlci1LZXktRmlsZS0yOiBzc2gtcnNhDQpFbmNyeXB0aW9uOiBhZXMyNTYtY2JjDQpDb21tZW5wOA0K";
- protected static final String UPLOAD_ARTIFACT_NAME = "TLV_prv.ppk";*/
-
- protected Config config = Config.instance();
-
- protected String serviceVersion;
- protected ResourceReqDetails resourceDetails;
- protected User sdncUserDetails;
- protected ServiceReqDetails serviceDetails;
-
- @Rule
- public static TestName name = new TestName();
-
- public CRUDExternalAPI() {
- super(name, CRUDExternalAPI.class.getName());
- }
-
- @DataProvider(name = "uploadArtifactOnVfcVlCpViaExternalAPI", parallel = true)
- public static Object[][] dataProviderUploadArtifactOnVfcVlCpViaExternalAPI() {
- return new Object[][]{
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VNF_CATALOG.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VF_LICENSE.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VENDOR_LICENSE.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.VFC},
-
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.YANG_XML.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VNF_CATALOG.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VF_LICENSE.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VENDOR_LICENSE.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.VL},
-
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.YANG_XML.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VNF_CATALOG.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VF_LICENSE.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VENDOR_LICENSE.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.CP},
-
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.YANG_XML.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VNF_CATALOG.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VF_LICENSE.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VENDOR_LICENSE.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.OTHER.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.VFC},
-
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.YANG_XML.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VNF_CATALOG.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VF_LICENSE.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VENDOR_LICENSE.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.OTHER.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.VL},
-
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.YANG_XML.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VNF_CATALOG.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VF_LICENSE.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VENDOR_LICENSE.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.OTHER.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.CP},
- };
- }
-
- // External API
- // Upload artifact on VFC, VL, CP via external API - happy flow
- @Test(dataProvider = "uploadArtifactOnVfcVlCpViaExternalAPI")
- public void uploadArtifactOnVfcVlCpViaExternalAPI(LifeCycleStatesEnum chosenLifeCycleState, String artifactType, ResourceTypeEnum resourceTypeEnum) throws Exception {
- getExtendTest().log(Status.INFO, String.format("chosenLifeCycleState: %s, artifactType: %s, resourceTypeEnum: %s", chosenLifeCycleState, artifactType, resourceTypeEnum));
- uploadArtifactOnAssetViaExternalAPI(ComponentTypeEnum.RESOURCE, chosenLifeCycleState, artifactType, resourceTypeEnum);
- }
-
- @DataProvider(name = "uploadArtifactOnVFViaExternalAPI", parallel = true)
- public static Object[][] dataProviderUploadArtifactOnVFViaExternalAPI() {
- return new Object[][]{
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_JSON.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_POLICY.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_EVENT.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.APPC_CONFIG.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_DOC.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_TOSCA.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.YANG_XML.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VNF_CATALOG.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VF_LICENSE.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VENDOR_LICENSE.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType()},
-
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_JSON.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_POLICY.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_EVENT.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.APPC_CONFIG.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_DOC.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_TOSCA.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.YANG_XML.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VNF_CATALOG.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VF_LICENSE.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VENDOR_LICENSE.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.OTHER.getType()},
- };
- }
-
- // External API
- // Upload artifact on VF via external API - happy flow
- @Test(dataProvider = "uploadArtifactOnVFViaExternalAPI")
- public void uploadArtifactOnVFViaExternalAPI(LifeCycleStatesEnum chosenLifeCycleState, String artifactType) throws Exception {
- getExtendTest().log(Status.INFO, String.format("chosenLifeCycleState: %s, artifactType: %s", chosenLifeCycleState, artifactType));
- uploadArtifactOnAssetViaExternalAPI(ComponentTypeEnum.RESOURCE, chosenLifeCycleState, artifactType, null);
- }
-
-
- @DataProvider(name = "uploadArtifactOnServiceViaExternalAPI", parallel = true)
- public static Object[][] dataProviderUploadArtifactOnServiceViaExternalAPI() {
- return new Object[][]{
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.YANG_XML.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VNF_CATALOG.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.YANG_XML.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VNF_CATALOG.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.OTHER.getType()},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ArtifactTypeEnum.YANG_XML.getType()},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ArtifactTypeEnum.VNF_CATALOG.getType()},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType()},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType()},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ArtifactTypeEnum.OTHER.getType()}
- };
- }
-
-
- @Test(dataProvider = "uploadArtifactOnServiceViaExternalAPI")
- public void uploadArtifactOnServiceViaExternalAPI(LifeCycleStatesEnum chosenLifeCycleState, String artifactType) throws Exception {
- getExtendTest().log(Status.INFO, String.format("chosenLifeCycleState: %s, artifactType: %s", chosenLifeCycleState, artifactType));
- uploadArtifactOnAssetViaExternalAPI(ComponentTypeEnum.SERVICE, chosenLifeCycleState, artifactType, null);
- }
-
- // Happy flow - get chosen life cycle state, artifact type and asset type
- // Create asset, upload artifact via external API + check audit & response code
- // Download artifact via external API + check audit & response code
- protected Component uploadArtifactOnAssetViaExternalAPI(ComponentTypeEnum componentTypeEnum, LifeCycleStatesEnum chosenLifeCycleState, String artifactType, ResourceTypeEnum resourceTypeEnum) throws Exception {
- Component component = null;
- RestResponse restResponse;
- int numberOfArtifact = 0;
-
- // get artifact data
- ArtifactReqDetails artifactReqDetails = ElementFactory.getArtifactByType("ci", artifactType, true, false);
-
- // create component/s & upload artifact via external api
- if (ComponentTypeEnum.RESOURCE_INSTANCE == componentTypeEnum) {
- component = getComponentWithResourceInstanceInTargetLifeCycleState(chosenLifeCycleState, resourceTypeEnum);
- restResponse = uploadArtifactOfRIIncludingValiditionOfAuditAndResponseCode(component, component.getComponentInstances().get(0), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, 200);
- component = getNewerVersionOfComponent(component, chosenLifeCycleState);
- numberOfArtifact = (component.getComponentInstances().get(0).getDeploymentArtifacts() == null ? 0 : component.getComponentInstances().get(0).getDeploymentArtifacts().size());
- } else {
- component = getComponentInTargetLifeCycleState(componentTypeEnum.toString(), UserRoleEnum.DESIGNER, chosenLifeCycleState, resourceTypeEnum);
- restResponse = uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, 200);
- component = updateComponentDetailsByLifeCycleState(chosenLifeCycleState, component);
- numberOfArtifact = component.getDeploymentArtifacts().size();
- }
-
- ArtifactDefinition responseArtifact = ResponseParser.convertArtifactDefinitionResponseToJavaObject(restResponse.getResponse());
- // Get list of deployment artifact + download them via external API
- Map<String, ArtifactDefinition> deploymentArtifacts = getDeploymentArtifactsOfAsset(component, componentTypeEnum);
- Assert.assertEquals(numberOfArtifact, deploymentArtifacts.keySet().size(), "Expected that number of deployment artifacts will be increase by one.");
-
- // Download the uploaded artifact via external API
- downloadResourceDeploymentArtifactExternalAPI(component, deploymentArtifacts.get(responseArtifact.getArtifactLabel()), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, componentTypeEnum);
- return component;
- }
-
- /**
- * according lifecycle state of component get updated component details
- *
- * @param chosenLifeCycleState
- * @param component
- * @return
- * @throws Exception
- */
- public Component updateComponentDetailsByLifeCycleState(LifeCycleStatesEnum chosenLifeCycleState, Component component) throws Exception {
- if (LifeCycleStatesEnum.CHECKOUT.equals(chosenLifeCycleState)) {
- component = AtomicOperationUtils.getComponentObject(component, UserRoleEnum.DESIGNER);
- } else {
- component = getNewerVersionOfComponent(component, chosenLifeCycleState);
- }
- return component;
- }
-
- // Upload artifact via external API + Check auditing for upload operation + Check response of external API
- public RestResponse uploadArtifactOfRIIncludingValiditionOfAuditAndResponseCode(Component component, ComponentInstance componentInstance, User sdncModifierDetails, ArtifactReqDetails artifactReqDetails, Integer expectedResponseCode) throws Exception {
- RestResponse restResponse = ArtifactRestUtils.externalAPIUploadArtifactOfComponentInstanceOnAsset(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, component.getComponentInstances().get(0));
-
- // Check response of external API
- Integer responseCode = restResponse.getErrorCode();
- Assert.assertEquals(responseCode, expectedResponseCode, "Response code is not correct.");
- return restResponse;
- }
-
-
- protected Component getComponentWithResourceInstanceInTargetLifeCycleState(LifeCycleStatesEnum lifeCycleStatesEnum, ResourceTypeEnum resourceTypeEnum) throws Exception {
- Component component;
- if (resourceTypeEnum == ResourceTypeEnum.VF) {
- component = getComponentInTargetLifeCycleState(ComponentTypeEnum.SERVICE.toString(), UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, null);
-
- Component resourceInstanceDetails = getComponentInTargetLifeCycleState(ComponentTypeEnum.RESOURCE.getValue(), UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, null);
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceInstanceDetails, component, UserRoleEnum.DESIGNER, true).left().value();
-
- // Add artifact to service if asked for certification request - must be at least one artifact for the flow
-// if((LifeCycleStatesEnum.CERTIFICATIONREQUEST == lifeCycleStatesEnum) || (LifeCycleStatesEnum.STARTCERTIFICATION == lifeCycleStatesEnum)) {
-// }
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.OTHER, component, UserRoleEnum.DESIGNER, true, true).left().value();
- component = AtomicOperationUtils.changeComponentState(component, UserRoleEnum.DESIGNER, lifeCycleStatesEnum, true).getLeft();
- } else {
- component = getComponentInTargetLifeCycleState(ComponentTypeEnum.RESOURCE.toString(), UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, null);
- Component resourceInstanceDetails = getComponentInTargetLifeCycleState(ComponentTypeEnum.RESOURCE.getValue(), UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, resourceTypeEnum);
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceInstanceDetails, component, UserRoleEnum.DESIGNER, true).left().value();
- component = AtomicOperationUtils.changeComponentState(component, UserRoleEnum.DESIGNER, lifeCycleStatesEnum, true).getLeft();
- }
- return component;
- }
-
- // Upload artifact via external API + Check auditing for upload operation + Check response of external API
- protected RestResponse uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(Component component, User sdncModifierDetails, ArtifactReqDetails artifactReqDetails, Integer expectedResponseCode) throws Exception {
- RestResponse restResponse = ArtifactRestUtils.externalAPIUploadArtifactOfTheAsset(component, sdncModifierDetails, artifactReqDetails);
-
- // Check response of external API
- Integer responseCode = restResponse.getErrorCode();
- Assert.assertEquals(responseCode, expectedResponseCode, "Response code is not correct.");
- return restResponse;
- }
-
- // Check Component version (increase by one if not in checkout)
- // Input: component, componentLifeCycleState
- // for any LifeCycleState != checkout
- // find component of version +0.1
- // check that this version different for input version
- // check that this component uniqueID different from input uniqueID
- // Return: that version
- protected synchronized Component getNewerVersionOfComponent(Component component, LifeCycleStatesEnum lifeCycleStatesEnum) throws Exception {
- Component resourceDetails = null;
-
- if ((!lifeCycleStatesEnum.equals(LifeCycleStatesEnum.CHECKOUT)) && (!lifeCycleStatesEnum.equals(LifeCycleStatesEnum.STARTCERTIFICATION))) {
-
-
- String resourceVersion = component.getVersion();
- String resourceUniqueID = component.getUniqueId();
-
- if (component.getComponentType().equals(ComponentTypeEnum.SERVICE)) {
- resourceDetails = AtomicOperationUtils.getServiceObjectByNameAndVersion(UserRoleEnum.DESIGNER, component.getName(), String.format("%.1f", Double.parseDouble(component.getVersion()) + 0.1));
- } else {
- resourceDetails = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, component.getName(), String.format("%.1f", Double.parseDouble(component.getVersion()) + 0.1));
- }
-
- String resourceNewVersion = resourceDetails.getVersion();
- String resourceNewUniqueID = resourceDetails.getUniqueId();
-
- System.out.println(resourceNewVersion);
- System.out.println("Service UUID: " + resourceDetails.getUUID());
- System.out.println("Service UniqueID: " + resourceDetails.getUniqueId());
-
- // Checking that new version exist + different from old one by unique id
- Assert.assertNotEquals(resourceVersion, resourceNewVersion, "Expected for different resource version.");
- Assert.assertNotEquals(resourceUniqueID, resourceNewUniqueID, "Expected that resource will have new unique ID.");
- } else {
- if (component.getComponentType().equals(ComponentTypeEnum.SERVICE)) {
- resourceDetails = AtomicOperationUtils.getServiceObjectByNameAndVersion(UserRoleEnum.DESIGNER, component.getName(), component.getVersion());
- } else {
- resourceDetails = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, component.getName(), component.getVersion());
- }
- }
- return resourceDetails;
- }
-
-
- // download deployment via external api + check response code for success (200) + get artifactReqDetails and verify payload + verify audit
- protected RestResponse downloadResourceDeploymentArtifactExternalAPI(Component component, ArtifactDefinition artifactDefinition, User sdncModifierDetails, ArtifactReqDetails artifactReqDetails, ComponentTypeEnum componentTypeEnum) throws Exception {
- RestResponse restResponse;
-
- if (componentTypeEnum == ComponentTypeEnum.RESOURCE_INSTANCE) {
- restResponse = ArtifactRestUtils.getComponentInstanceDeploymentArtifactExternalAPI(component.getUUID(), component.getComponentInstances().get(0).getNormalizedName(), artifactDefinition.getArtifactUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), component.getComponentType().toString());
- } else {
- restResponse = ArtifactRestUtils.getResourceDeploymentArtifactExternalAPI(component.getUUID(), artifactDefinition.getArtifactUUID(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), component.getComponentType().toString());
- }
-
- Integer responseCode = restResponse.getErrorCode();
- Integer expectedCode = 200;
- Assert.assertEquals(responseCode, expectedCode, "Response code is not correct.");
-
- // For known artifact/payload - verify payload of downloaded artifact
- if (artifactReqDetails != null) {
- String response = restResponse.getResponse();
- String payloadData = artifactReqDetails.getPayload();
- String decodedPaypload = org.openecomp.sdc.ci.tests.utils.Decoder.decode(payloadData);
- Assert.assertEquals(response, decodedPaypload, "Response artifact payload not correct.");
- }
- return restResponse;
- }
-
- // download deployment via external api + check response code for success (200) + verify audit
- protected void downloadResourceDeploymentArtifactExternalAPI(Component component, ArtifactDefinition artifactDefinition, User sdncModifierDetails) throws Exception {
- downloadResourceDeploymentArtifactExternalAPI(component, artifactDefinition, sdncModifierDetails, null, component.getComponentType());
- }
-
-
- @DataProvider(name = "uploadArtifactOnRIViaExternalAPI", parallel = true)
- public static Object[][] dataProviderUploadArtifactOnRIViaExternalAPI() {
- return new Object[][]{
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_JSON.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_POLICY.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_DOC.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_BLUEPRINT.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_EVENT.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_POLL.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_TRAP.getType()},
-
-
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_JSON.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_POLICY.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_DOC.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_BLUEPRINT.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_EVENT.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_POLL.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_TRAP.getType()},
- };
- }
-
-
- @Test(dataProvider = "uploadArtifactOnRIViaExternalAPI")
- public void uploadArtifactOnRIViaExternalAPI(LifeCycleStatesEnum chosenLifeCycleState, String artifactType) throws Exception {
- getExtendTest().log(Status.INFO, String.format("chosenLifeCycleState: %s, artifactType: %s", chosenLifeCycleState, artifactType));
- uploadArtifactOnAssetViaExternalAPI(ComponentTypeEnum.RESOURCE_INSTANCE, chosenLifeCycleState, artifactType, null);
- }
-
-
- @DataProvider(name = "uploadArtifactOnVfcVlCpRIViaExternalAPI", parallel = true)
- public static Object[][] dataProviderUploadArtifactOnVfcVlCpRIViaExternalAPI() {
- return new Object[][]{
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_JSON.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_POLICY.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_DOC.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_BLUEPRINT.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_EVENT.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.VFC},
-
-
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_JSON.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_POLICY.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_DOC.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_BLUEPRINT.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_EVENT.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.VL},
-
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_JSON.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_POLICY.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_DOC.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_BLUEPRINT.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_EVENT.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.CP},
-
-
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_JSON.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_POLICY.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_DOC.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_BLUEPRINT.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_EVENT.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.VFC},
-
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_JSON.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_POLICY.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_DOC.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_BLUEPRINT.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_EVENT.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.VL},
-
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_JSON.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_POLICY.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_DOC.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_BLUEPRINT.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_EVENT.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.CP},
- };
- }
-
-
- @Test(dataProvider = "uploadArtifactOnVfcVlCpRIViaExternalAPI")
- public void uploadArtifactOnVfcVlCpRIViaExternalAPI(LifeCycleStatesEnum chosenLifeCycleState, String artifactType, ResourceTypeEnum resourceTypeEnum) throws Exception {
- getExtendTest().log(Status.INFO, String.format("chosenLifeCycleState: %s, artifactType: %s", chosenLifeCycleState, artifactType));
- uploadArtifactOnAssetViaExternalAPI(ComponentTypeEnum.RESOURCE_INSTANCE, chosenLifeCycleState, artifactType, resourceTypeEnum);
- }
-
-
- @DataProvider(name = "uploadInvalidArtifactTypeExtensionLabelDescriptionCheckSumDuplicateLabelViaExternalAPI", parallel = false)
- public static Object[][] dataProviderUploadInvalidArtifactTypeExtensionLabelDescriptionCheckSumDuplicateLabelViaExternalAPI() {
- return new Object[][]{
-
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidTypeToLong"},
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidTypeToLong"},
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidTypeToLong"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidTypeToLong"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidTypeToLong"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidTypeToLong"},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidTypeToLong"},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidTypeToLong"},
-
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidTypeEmpty"},
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidTypeEmpty"},
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidTypeEmpty"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidTypeEmpty"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidTypeEmpty"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidTypeEmpty"},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidTypeEmpty"},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidTypeEmpty"},
-
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidNameToLong"},
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidNameToLong"},
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidNameToLong"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidNameToLong"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidNameToLong"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidNameToLong"},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidNameToLong"},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidNameToLong"},
-
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidNameEmpty"},
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidNameEmpty"},
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidNameEmpty"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidNameEmpty"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidNameEmpty"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidNameEmpty"},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidNameEmpty"},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidNameEmpty"},
-
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidLabelToLong"},
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidLabelToLong"},
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidLabelToLong"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidLabelToLong"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidLabelToLong"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidLabelToLong"},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidLabelToLong"},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidLabelToLong"},
-
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidLabelEmpty"},
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidLabelEmpty"},
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidLabelEmpty"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidLabelEmpty"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidLabelEmpty"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidLabelEmpty"},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidLabelEmpty"},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidLabelEmpty"},
-
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidDescriptionToLong"},
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidDescriptionToLong"},
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidDescriptionToLong"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidDescriptionToLong"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidDescriptionToLong"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidDescriptionToLong"},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidDescriptionToLong"},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidDescriptionToLong"},
-
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidDescriptionEmpty"},
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidDescriptionEmpty"},
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidDescriptionEmpty"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidDescriptionEmpty"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidDescriptionEmpty"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidDescriptionEmpty"},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidDescriptionEmpty"},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidDescriptionEmpty"},
-
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE, "uploadArtifactWithSameLabel"},
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.SERVICE, "uploadArtifactWithSameLabel"},
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithSameLabel"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE, "uploadArtifactWithSameLabel"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.SERVICE, "uploadArtifactWithSameLabel"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithSameLabel"},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.SERVICE, "uploadArtifactWithSameLabel"},
-
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidCheckSum"},
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidCheckSum"},
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidCheckSum"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE, "uploadArtifactWithInvalidCheckSum"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidCheckSum"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidCheckSum"},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.SERVICE, "uploadArtifactWithInvalidCheckSum"},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE_INSTANCE, "uploadArtifactWithInvalidCheckSum"},
- };
- }
-
-
- // InvalidArtifact + check audit & response code function
- @Test(dataProvider = "uploadInvalidArtifactTypeExtensionLabelDescriptionCheckSumDuplicateLabelViaExternalAPI")
- public void uploadInvalidArtifactTypeExtensionLabelDescriptionCheckSumDuplicateLabelViaExternalAPI(LifeCycleStatesEnum chosenLifeCycleState,
- ComponentTypeEnum componentTypeEnum, String uploadArtifactTestType) throws Exception {
- getExtendTest().log(Status.INFO, String.format("chosenLifeCycleState: %s, componentTypeEnum: %s, uploadArtifactTestType: %s", chosenLifeCycleState, componentTypeEnum, uploadArtifactTestType));
- Component resourceDetails;
- ComponentInstance componentResourceInstanceDetails = null;
- ArtifactReqDetails artifactReqDetails;
-
- if (ComponentTypeEnum.RESOURCE_INSTANCE == componentTypeEnum) {
- artifactReqDetails = ElementFactory.getArtifactByType("Abcd", ArtifactTypeEnum.DCAE_INVENTORY_DOC.toString(), true, false);
-
- resourceDetails = getComponentInTargetLifeCycleState(ComponentTypeEnum.SERVICE.toString(), UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, null);
- resourceDetails = getComponentWithResourceInstanceInTargetLifeCycleState(chosenLifeCycleState, null);
- componentResourceInstanceDetails = resourceDetails.getComponentInstances().get(0);
- } else {
- artifactReqDetails = ElementFactory.getArtifactByType("Abcd", ArtifactTypeEnum.OTHER.toString(), true, false);
- resourceDetails = getComponentInTargetLifeCycleState(componentTypeEnum.toString(), UserRoleEnum.DESIGNER, chosenLifeCycleState, null);
- }
-
-
- switch (uploadArtifactTestType) {
- case "uploadArtifactWithInvalidTypeToLong":
- uploadArtifactWithInvalidTypeToLong(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, componentResourceInstanceDetails);
- break;
- case "uploadArtifactWithInvalidTypeEmpty":
- uploadArtifactWithInvalidTypeEmpty(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, componentResourceInstanceDetails);
- break;
- case "uploadArtifactWithInvalidCheckSum":
- uploadArtifactWithInvalidCheckSum(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, componentResourceInstanceDetails);
- break;
- case "uploadArtifactWithInvalidNameToLong":
- uploadArtifactWithInvalidNameToLong(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, componentResourceInstanceDetails);
- break;
- case "uploadArtifactWithInvalidNameEmpty":
- uploadArtifactWithInvalidNameEmpty(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, componentResourceInstanceDetails);
- break;
- case "uploadArtifactWithInvalidLabelToLong":
- uploadArtifactWithInvalidLabelToLong(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, componentResourceInstanceDetails);
- break;
- case "uploadArtifactWithInvalidLabelEmpty":
- uploadArtifactWithInvalidLabelEmpty(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, componentResourceInstanceDetails);
- break;
- case "uploadArtifactWithInvalidDescriptionToLong":
- uploadArtifactWithInvalidDescriptionToLong(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, componentResourceInstanceDetails);
- break;
- case "uploadArtifactWithInvalidDescriptionEmpty":
- uploadArtifactWithInvalidDescriptionEmpty(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, componentResourceInstanceDetails);
- break;
- case "uploadArtifactWithSameLabel":
- default:
- uploadArtifactWithSameLabel(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, componentResourceInstanceDetails);
- break;
- }
- }
-
- // Upload artifact with invalid type via external API - to long type
- protected void uploadArtifactWithInvalidTypeToLong(Component component, User sdncModifierDetails, ArtifactReqDetails artifactReqDetails,
- ComponentInstance componentResourceInstanceDetails) throws Exception {
- artifactReqDetails.setArtifactType("dsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfdsdsfdsfds");
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.ARTIFACT_TYPE_NOT_SUPPORTED.name());
- List<String> variables = asList(artifactReqDetails.getArtifactType());
-
- uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- artifactReqDetails, componentResourceInstanceDetails, errorInfo, variables, null, false);
- }
-
- // Upload artifact with invalid type via external API - empty type
- protected void uploadArtifactWithInvalidTypeEmpty(Component component, User sdncModifierDetails, ArtifactReqDetails artifactReqDetails,
- ComponentInstance componentResourceInstanceDetails) throws Exception {
- artifactReqDetails.setArtifactType("");
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.ARTIFACT_TYPE_NOT_SUPPORTED.name());
- List<String> variables = asList(artifactReqDetails.getArtifactType());
-
- uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- artifactReqDetails, componentResourceInstanceDetails, errorInfo, variables, null, false);
- }
-
- // Upload artifact with invalid checksum via external API
- protected void uploadArtifactWithInvalidCheckSum(Component component, User sdncModifierDetails, ArtifactReqDetails artifactReqDetails,
- ComponentInstance componentResourceInstanceDetails) throws Exception {
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.ARTIFACT_INVALID_MD5.name());
- List<String> variables = asList();
- uploadArtifactWithInvalidCheckSumOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- artifactReqDetails, componentResourceInstanceDetails, errorInfo, variables);
- }
-
- // Upload artifact with valid type & invalid name via external API - name to long
- protected void uploadArtifactWithInvalidNameToLong(Component component, User sdncModifierDetails, ArtifactReqDetails artifactReqDetails,
- ComponentInstance componentResourceInstanceDetails) throws Exception {
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.EXCEEDS_LIMIT.name());
- List<String> variables = asList("artifact name", "255");
- artifactReqDetails.setArtifactName("invalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsinvalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidTypeinvalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidTypeghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidType");
- uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- artifactReqDetails, componentResourceInstanceDetails, errorInfo, variables, null, false);
- }
-
- // Upload artifact with valid type & invalid name via external API - name is empty
- protected void uploadArtifactWithInvalidNameEmpty(Component component, User sdncModifierDetails, ArtifactReqDetails artifactReqDetails,
- ComponentInstance componentResourceInstanceDetails) throws Exception {
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_ARTIFACT_NAME.name());
- List<String> variables = asList();
-
- artifactReqDetails.setArtifactName("");
- uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- artifactReqDetails, componentResourceInstanceDetails, errorInfo, variables, null, false);
- }
-
-
- // Upload artifact with valid type & invalid label via external API - label to long
- protected void uploadArtifactWithInvalidLabelToLong(Component component, User sdncModifierDetails, ArtifactReqDetails artifactReqDetails,
- ComponentInstance componentResourceInstanceDetails) throws Exception {
-
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.EXCEEDS_LIMIT.name());
- List<String> variables = asList("artifact label", "255");
- artifactReqDetails.setArtifactLabel("invalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidTypeinvalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidTypeinvalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidTypeinvalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidType");
- uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- artifactReqDetails, componentResourceInstanceDetails, errorInfo, variables, null, false);
- }
-
- // Upload artifact with valid type & invalid label via external API - label is empty
- protected void uploadArtifactWithInvalidLabelEmpty(Component component, User sdncModifierDetails, ArtifactReqDetails artifactReqDetails,
- ComponentInstance componentResourceInstanceDetails) throws Exception {
-
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_DATA.name());
- List<String> variables = asList("artifact label");
- artifactReqDetails.setArtifactLabel("");
- uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- artifactReqDetails, componentResourceInstanceDetails, errorInfo, variables, null, false);
- }
-
- // Upload artifact with invalid description via external API - to long description
- protected void uploadArtifactWithInvalidDescriptionToLong(Component component, User sdncModifierDetails, ArtifactReqDetails artifactReqDetails,
- ComponentInstance componentResourceInstanceDetails) throws Exception {
-
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.EXCEEDS_LIMIT.name());
- List<String> variables = asList("artifact description", "256");
- artifactReqDetails.setDescription("invalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsinvalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidTypeinvalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidTypeghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidType");
- uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- artifactReqDetails, componentResourceInstanceDetails, errorInfo, variables, null, false);
- }
-
-
- // Upload artifact with invalid description via external API - empty description
- protected void uploadArtifactWithInvalidDescriptionEmpty(Component component, User sdncModifierDetails, ArtifactReqDetails artifactReqDetails,
- ComponentInstance componentResourceInstanceDetails) throws Exception {
-
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_DATA.name());
- List<String> variables = asList("artifact description");
- artifactReqDetails.setDescription("");
- uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- artifactReqDetails, componentResourceInstanceDetails, errorInfo, variables, null, false);
- }
-
- // Upload artifact with same label via external API
- protected void uploadArtifactWithSameLabel(Component component, User sdncModifierDetails, ArtifactReqDetails artifactReqDetails,
- ComponentInstance componentResourceInstanceDetails) throws Exception {
-
- RestResponse restResponse = null;
- if (componentResourceInstanceDetails != null) {
- restResponse = ArtifactRestUtils.externalAPIUploadArtifactOfComponentInstanceOnAsset(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, componentResourceInstanceDetails);
- } else {
- restResponse = ArtifactRestUtils.externalAPIUploadArtifactOfTheAsset(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails);
-
- }
-
- ArtifactDefinition artifactDefinition = ResponseParser.convertArtifactDefinitionResponseToJavaObject(restResponse.getResponse());
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.ARTIFACT_EXIST.name());
-
- List<String> variables = asList(artifactDefinition.getArtifactDisplayName());
- ArtifactReqDetails artifactReqDetailsSameLabel = ElementFactory.getArtifactByType("Abcd", ArtifactTypeEnum.DCAE_INVENTORY_EVENT.toString(), true, false);
- artifactReqDetailsSameLabel.setArtifactLabel(artifactReqDetails.getArtifactLabel());
- uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- artifactReqDetailsSameLabel, componentResourceInstanceDetails, errorInfo, variables, null, false);
- }
-
- protected RestResponse uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(Component component, User sdncModifierDetails, ArtifactReqDetails artifactReqDetails,
- ComponentInstance componentResourceInstanceDetails, ErrorInfo errorInfo, List<String> variables, LifeCycleStatesEnum lifeCycleStatesEnum, Boolean includeResourceNameInAudit) throws Exception {
- RestResponse restResponse;
- if (componentResourceInstanceDetails != null) {
- restResponse = ArtifactRestUtils.externalAPIUploadArtifactOfComponentInstanceOnAsset(component, sdncModifierDetails, artifactReqDetails, componentResourceInstanceDetails);
- } else {
- restResponse = ArtifactRestUtils.externalAPIUploadArtifactOfTheAsset(component, sdncModifierDetails, artifactReqDetails);
-
- }
- // validate response code
- Integer responseCode = restResponse.getErrorCode();
- Assert.assertEquals(responseCode, errorInfo.getCode(), "Response code is not correct.");
- return restResponse;
- }
-
-
- protected RestResponse uploadArtifactWithInvalidCheckSumOfAssetIncludingValiditionOfAuditAndResponseCode(Component component, User sdncModifierDetails, ArtifactReqDetails artifactReqDetails,
- ComponentInstance componentResourceInstanceDetails, ErrorInfo errorInfo, List<String> variables) throws Exception {
- RestResponse restResponse;
- if (componentResourceInstanceDetails != null) {
- restResponse = ArtifactRestUtils.externalAPIUploadArtifactWithInvalidCheckSumOfComponentInstanceOnAsset(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, componentResourceInstanceDetails);
- } else {
- restResponse = ArtifactRestUtils.externalAPIUploadArtifactWithInvalidCheckSumOfTheAsset(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails);
-
- }
- // validate response code
- Integer responseCode = restResponse.getErrorCode();
- Assert.assertEquals(responseCode, errorInfo.getCode(), "Response code is not correct.");
- return restResponse;
-
- }
-
- @DataProvider(name = "uploadArtifactOnVFViaExternalAPIByDiffrentUserThenCreatorOfAsset", parallel = true)
- public static Object[][] dataProviderUploadArtifactOnVFViaExternalAPIByDiffrentUserThenCreatorOfAsset() {
- return new Object[][]{
- {ComponentTypeEnum.RESOURCE, UserRoleEnum.ADMIN, LifeCycleStatesEnum.CHECKOUT},
- {ComponentTypeEnum.SERVICE, UserRoleEnum.ADMIN, LifeCycleStatesEnum.CHECKOUT},
- {ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.ADMIN, LifeCycleStatesEnum.CHECKOUT},
- {ComponentTypeEnum.RESOURCE, UserRoleEnum.ADMIN, LifeCycleStatesEnum.CHECKOUT},
- {ComponentTypeEnum.SERVICE, UserRoleEnum.ADMIN, LifeCycleStatesEnum.CHECKOUT},
- {ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.ADMIN, LifeCycleStatesEnum.CHECKOUT},
-
- {ComponentTypeEnum.RESOURCE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKIN},
- {ComponentTypeEnum.SERVICE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKIN},
- {ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKIN},
- {ComponentTypeEnum.RESOURCE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKOUT},
- {ComponentTypeEnum.SERVICE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKOUT},
- {ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKOUT},
-
- {ComponentTypeEnum.RESOURCE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKIN},
- {ComponentTypeEnum.SERVICE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKIN},
- {ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKIN},
- {ComponentTypeEnum.RESOURCE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKOUT},
- {ComponentTypeEnum.SERVICE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKOUT},
- {ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKOUT},
-
- {ComponentTypeEnum.RESOURCE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKIN},
- {ComponentTypeEnum.SERVICE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKIN},
- {ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKIN},
- {ComponentTypeEnum.RESOURCE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKOUT},
- {ComponentTypeEnum.SERVICE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKOUT},
- {ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKOUT},
- };
- }
-
- // External API
- // Upload artifact by diffrent user then creator of asset - Fail
- @Test(dataProvider = "uploadArtifactOnVFViaExternalAPIByDiffrentUserThenCreatorOfAsset")
- public void uploadArtifactOnVFViaExternalAPIByDiffrentUserThenCreatorOfAsset(ComponentTypeEnum componentTypeEnum, UserRoleEnum userRoleEnum, LifeCycleStatesEnum lifeCycleStatesEnum) throws Exception {
- getExtendTest().log(Status.INFO, String.format("componentTypeEnum: %s, userRoleEnum: %s, lifeCycleStatesEnum: %s", componentTypeEnum, userRoleEnum, lifeCycleStatesEnum));
- Component resourceDetails;
- ComponentInstance componentResourceInstanceDetails = null;
- ArtifactReqDetails artifactReqDetails;
-
- if (ComponentTypeEnum.RESOURCE_INSTANCE == componentTypeEnum) {
- artifactReqDetails = ElementFactory.getArtifactByType("Abcd", ArtifactTypeEnum.DCAE_INVENTORY_DOC.toString(), true, false);
-
- resourceDetails = getComponentWithResourceInstanceInTargetLifeCycleState(lifeCycleStatesEnum, null);
- componentResourceInstanceDetails = resourceDetails.getComponentInstances().get(0);
- } else {
- artifactReqDetails = ElementFactory.getArtifactByType("Abcd", ArtifactTypeEnum.OTHER.toString(), true, false);
-
- resourceDetails = getComponentInTargetLifeCycleState(componentTypeEnum.toString(), UserRoleEnum.DESIGNER, lifeCycleStatesEnum, null);
- }
-
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESTRICTED_OPERATION.name());
- List<String> variables = asList();
-
- uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(resourceDetails, ElementFactory.getDefaultUser(userRoleEnum),
- artifactReqDetails, componentResourceInstanceDetails, errorInfo, variables, lifeCycleStatesEnum, true);
-
- }
-
- @DataProvider(name = "uploadArtifactOnAssetWhichNotExist", parallel = true)
- public static Object[][] dataProviderUploadArtifactOnAssetWhichNotExist() {
- return new Object[][]{
- {ComponentTypeEnum.SERVICE},
- {ComponentTypeEnum.RESOURCE},
- {ComponentTypeEnum.RESOURCE_INSTANCE},
- };
- }
-
- // External API
- // Upload artifact on VF via external API - happy flow
- @Test(dataProvider = "uploadArtifactOnAssetWhichNotExist")
- public void uploadArtifactOnAssetWhichNotExist(ComponentTypeEnum componentTypeEnum) throws Exception {
- getExtendTest().log(Status.INFO, String.format("componentTypeEnum: %s", componentTypeEnum));
- Component resourceDetails;
- ComponentInstance componentResourceInstanceDetails = null;
- ArtifactReqDetails artifactReqDetails;
-
- if (ComponentTypeEnum.RESOURCE_INSTANCE == componentTypeEnum) {
- artifactReqDetails = ElementFactory.getArtifactByType("Abcd", ArtifactTypeEnum.DCAE_INVENTORY_DOC.toString(), true, false);
-
- resourceDetails = getComponentWithResourceInstanceInTargetLifeCycleState(LifeCycleStatesEnum.CHECKIN, null);
- componentResourceInstanceDetails = resourceDetails.getComponentInstances().get(0);
-
- resourceDetails.setUUID("12345");
- componentResourceInstanceDetails.setNormalizedName("12345");
- } else {
- artifactReqDetails = ElementFactory.getArtifactByType("Abcd", ArtifactTypeEnum.OTHER.getType(), true, false);
-
- resourceDetails = getComponentInTargetLifeCycleState(componentTypeEnum.toString(), UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, null);
-
- resourceDetails.setUUID("12345");
- }
-
- String componentTypeError = ActionStatus.RESOURCE_NOT_FOUND.name();
- if (ComponentTypeEnum.SERVICE == componentTypeEnum) {
- componentTypeError = ActionStatus.SERVICE_NOT_FOUND.name();
- }
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(componentTypeError);
- List<String> variables = asList(resourceDetails.getUUID());
-
- uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- artifactReqDetails, componentResourceInstanceDetails, errorInfo, variables, LifeCycleStatesEnum.CHECKIN, false);
- }
-
- @DataProvider(name = "uploadArtifactOnAssetWhichInInvalidStateForUploading", parallel = true)
- public static Object[][] dataProviderUploadArtifactOnAssetWhichInInvalidStateForUploading() {
- return new Object[][]{
- {ComponentTypeEnum.SERVICE},
- };
- }
-
- @Test(dataProvider = "uploadArtifactOnAssetWhichInInvalidStateForUploading")
- public void uploadArtifactOnAssetWhichInInvalidStateForUploading(ComponentTypeEnum componentTypeEnum) throws Exception {
- getExtendTest().log(Status.INFO, String.format("componentTypeEnum: %s", componentTypeEnum));
- ComponentInstance componentResourceInstanceDetails = null;
-
- ArtifactReqDetails artifactReqDetails = ElementFactory.getArtifactByType("Abcd", ArtifactTypeEnum.OTHER.toString(), true, false);
- Component resourceDetails = getComponentInTargetLifeCycleState(componentTypeEnum.toString(), UserRoleEnum.DESIGNER, LifeCycleStatesEnum.STARTCERTIFICATION, null);
-
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_IN_CERT_IN_PROGRESS_STATE.name());
- List<String> variables = asList(resourceDetails.getName(), resourceDetails.getComponentType().toString().toLowerCase(), resourceDetails.getLastUpdaterFullName().split(" ")[0],
- resourceDetails.getLastUpdaterFullName().split(" ")[1], resourceDetails.getLastUpdaterUserId());
-
- uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- artifactReqDetails, componentResourceInstanceDetails, errorInfo, variables, LifeCycleStatesEnum.STARTCERTIFICATION, true);
- }
-
- ////////////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////////////
- // Update External API //
- ////////////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////////////
-
- @DataProvider(name = "updateArtifactForServiceViaExternalAPI", parallel = true)
- public static Object[][] dataProviderUpdateArtifactForServiceViaExternalAPI() {
- return new Object[][]{
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.YANG_XML.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VNF_CATALOG.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.YANG_XML.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VNF_CATALOG.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.OTHER.getType()},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ArtifactTypeEnum.YANG_XML.getType()},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ArtifactTypeEnum.VNF_CATALOG.getType()},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType()},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType()},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ArtifactTypeEnum.OTHER.getType()},
- {LifeCycleStatesEnum.CERTIFY, ArtifactTypeEnum.YANG_XML.getType()},
- {LifeCycleStatesEnum.CERTIFY, ArtifactTypeEnum.VNF_CATALOG.getType()},
- {LifeCycleStatesEnum.CERTIFY, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType()},
- {LifeCycleStatesEnum.CERTIFY, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType()},
- {LifeCycleStatesEnum.CERTIFY, ArtifactTypeEnum.OTHER.getType()}
- };
- }
-
- // Update artifact for Service - Success
- @Test(dataProvider = "updateArtifactForServiceViaExternalAPI")
- public void updateArtifactForServiceViaExternalAPI(LifeCycleStatesEnum lifeCycleStatesEnum, String artifactType) throws Exception {
- getExtendTest().log(Status.INFO, String.format("lifeCycleStatesEnum: %s, artifactType: %s", lifeCycleStatesEnum, artifactType));
- Component component = uploadArtifactOnAssetViaExternalAPI(ComponentTypeEnum.SERVICE, LifeCycleStatesEnum.CHECKOUT, artifactType, null);
- updateArtifactOnAssetViaExternalAPI(component, ComponentTypeEnum.SERVICE, lifeCycleStatesEnum, artifactType);
-
- // for certify version check that previous version exist, and that it artifact can be download + checksum
- if (lifeCycleStatesEnum.equals(LifeCycleStatesEnum.CERTIFY)) {
- // Download the uploaded artifact via external API
- downloadResourceDeploymentArtifactExternalAPIAndComparePayLoadOfArtifactType(component, artifactType, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), ComponentTypeEnum.SERVICE);
- }
- }
-
- @DataProvider(name = "updateArtifactForVFViaExternalAPI", parallel = true)
- public static Object[][] dataProviderUpdateArtifactForVFViaExternalAPI() {
- return new Object[][]{
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_JSON.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_POLICY.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_EVENT.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.APPC_CONFIG.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_DOC.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_TOSCA.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.YANG_XML.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VNF_CATALOG.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VF_LICENSE.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VENDOR_LICENSE.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType()},
-
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_JSON.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_POLICY.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_EVENT.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.APPC_CONFIG.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_DOC.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_TOSCA.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.YANG_XML.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VNF_CATALOG.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VF_LICENSE.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VENDOR_LICENSE.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.OTHER.getType()},
- };
- }
-
- // Update artifact for VF - Success
- @Test(dataProvider = "updateArtifactForVFViaExternalAPI")
- public void updateArtifactForVFViaExternalAPI(LifeCycleStatesEnum lifeCycleStatesEnum, String artifactType) throws Exception {
- getExtendTest().log(Status.INFO, String.format("lifeCycleStatesEnum: %s, artifactType: %s", lifeCycleStatesEnum, artifactType));
- Component component = uploadArtifactOnAssetViaExternalAPI(ComponentTypeEnum.RESOURCE, LifeCycleStatesEnum.CHECKOUT, artifactType, null);
- updateArtifactOnAssetViaExternalAPI(component, ComponentTypeEnum.RESOURCE, lifeCycleStatesEnum, artifactType);
-
- // for certify version check that previous version exist, and that it artifact can be download + checksum
- if (lifeCycleStatesEnum.equals(LifeCycleStatesEnum.CERTIFY)) {
- // Download the uploaded artifact via external API
- downloadResourceDeploymentArtifactExternalAPIAndComparePayLoadOfArtifactType(component, artifactType, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), ComponentTypeEnum.RESOURCE);
- }
- }
-
- @DataProvider(name = "updateArtifactForVfcVlCpViaExternalAPI", parallel = true)
- public static Object[][] dataProviderUpdateArtifactForVfcVlCpViaExternalAPI() {
- return new Object[][]{
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.YANG_XML.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VNF_CATALOG.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VF_LICENSE.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VENDOR_LICENSE.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.VFC},
-
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.YANG_XML.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VNF_CATALOG.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VF_LICENSE.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VENDOR_LICENSE.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.VL},
-
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.YANG_XML.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VNF_CATALOG.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VF_LICENSE.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VENDOR_LICENSE.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.CP},
-
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.YANG_XML.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VNF_CATALOG.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VF_LICENSE.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VENDOR_LICENSE.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.OTHER.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.VFC},
-
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.YANG_XML.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VNF_CATALOG.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VF_LICENSE.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VENDOR_LICENSE.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.OTHER.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.VL},
-
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.YANG_XML.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VNF_CATALOG.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VF_LICENSE.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VENDOR_LICENSE.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.OTHER.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.CP},
- };
- }
-
- // Update artifact for VFC/VL/CP - Success
- @Test(dataProvider = "updateArtifactForVfcVlCpViaExternalAPI")
- public void updateArtifactForVfcVlCpViaExternalAPI(LifeCycleStatesEnum lifeCycleStatesEnum, String artifactType, ResourceTypeEnum resourceTypeEnum) throws Exception {
- getExtendTest().log(Status.INFO, String.format("lifeCycleStatesEnum: %s, artifactType: %s, resourceTypeEnum: %s", lifeCycleStatesEnum, artifactType, resourceTypeEnum));
- Component component = uploadArtifactOnAssetViaExternalAPI(ComponentTypeEnum.RESOURCE, LifeCycleStatesEnum.CHECKOUT, artifactType, resourceTypeEnum);
- updateArtifactOnAssetViaExternalAPI(component, ComponentTypeEnum.RESOURCE, lifeCycleStatesEnum, artifactType);
-
- // for certify version check that previous version exist, and that it artifact can be download + checksum
- if (lifeCycleStatesEnum.equals(LifeCycleStatesEnum.CERTIFY)) {
- // Download the uploaded artifact via external API
- downloadResourceDeploymentArtifactExternalAPIAndComparePayLoadOfArtifactType(component, artifactType, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), ComponentTypeEnum.RESOURCE);
- }
- }
-
- @DataProvider(name = "updateArtifactOfVfcVlCpForVfciVliCpiViaExternalAPI", parallel = true)
- public static Object[][] dataProviderUpdateArtifactOfVfcVlCpForVfciVliCpiViaExternalAPI() {
- return new Object[][]{
- {ResourceTypeEnum.VFC},
- {ResourceTypeEnum.VL},
- {ResourceTypeEnum.CP}
- };
- }
-
- // Verify that it cannot update VFC/VL/CP artifact on VFCi/VLi/CPi - Failure flow
- @Test(dataProvider = "updateArtifactOfVfcVlCpForVfciVliCpiViaExternalAPI")
- public void updateArtifactOfVfcVlCpForVfciVliCpiViaExternalAPI(ResourceTypeEnum resourceTypeEnum) throws Exception {
- getExtendTest().log(Status.INFO, String.format("resourceTypeEnum: %s", resourceTypeEnum));
-
- Component resourceInstanceDetails = getComponentInTargetLifeCycleState(ComponentTypeEnum.RESOURCE.getValue(), UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, resourceTypeEnum);
- ArtifactReqDetails artifactReqDetails = ElementFactory.getArtifactByType("ci", ArtifactTypeEnum.SNMP_TRAP.getType(), true, false);
- uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(resourceInstanceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, 200);
- resourceInstanceDetails = AtomicOperationUtils.changeComponentState(resourceInstanceDetails, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- Component component = getComponentInTargetLifeCycleState(ComponentTypeEnum.RESOURCE.toString(), UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, null);
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceInstanceDetails, component, UserRoleEnum.DESIGNER, true).left().value();
- component = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, component.getName(), component.getVersion());
-
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.OK.name());
- Map<String, ArtifactDefinition> deploymentArtifacts;
- deploymentArtifacts = getDeploymentArtifactsOfAsset(component, ComponentTypeEnum.RESOURCE_INSTANCE);
- String artifactUUID = null;
- for (String key : deploymentArtifacts.keySet()) {
- if (key.startsWith("ci") && StringUtils.isNotEmpty(deploymentArtifacts.get(key).getArtifactUUID())) {
- artifactUUID = deploymentArtifacts.get(key).getArtifactUUID();
- break;
- }
- }
- List<String> variables = asList(artifactUUID);
- updateArtifactOnAssetViaExternalAPI(component, ComponentTypeEnum.RESOURCE_INSTANCE, LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_TRAP.getType(), errorInfo, variables, UserRoleEnum.DESIGNER);
-
- }
-
- @DataProvider(name = "updateArtifactOnRIViaExternalAPI", parallel = true)
- public static Object[][] dataProviderUpdateArtifactOnRIViaExternalAPI() {
- return new Object[][]{
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType(), null},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_JSON.getType(), null},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_POLICY.getType(), null},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_DOC.getType(), null},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_BLUEPRINT.getType(), null},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_EVENT.getType(), null},
-
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType(), null},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_JSON.getType(), null},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_POLICY.getType(), null},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_DOC.getType(), null},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_BLUEPRINT.getType(), null},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_EVENT.getType(), null},
-
- };
- }
-
- @Test(dataProvider = "updateArtifactOnRIViaExternalAPI")
- public void updateArtifactOnRIViaExternalAPI(LifeCycleStatesEnum chosenLifeCycleState, String artifactType, ResourceTypeEnum resourceTypeEnum) throws Exception {
- getExtendTest().log(Status.INFO, String.format("chosenLifeCycleState: %s, artifactType: %s", chosenLifeCycleState, artifactType));
- Component component = uploadArtifactOnAssetViaExternalAPI(ComponentTypeEnum.RESOURCE_INSTANCE, LifeCycleStatesEnum.CHECKOUT, artifactType, resourceTypeEnum);
- updateArtifactOnAssetViaExternalAPI(component, ComponentTypeEnum.RESOURCE_INSTANCE, chosenLifeCycleState, artifactType);
-
- // for certify version check that previous version exist, and that it artifact can be download + checksum
- if (chosenLifeCycleState.equals(LifeCycleStatesEnum.CERTIFY)) {
- // Download the uploaded artifact via external API
- downloadResourceDeploymentArtifactExternalAPIAndComparePayLoadOfArtifactType(component, artifactType, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), ComponentTypeEnum.RESOURCE_INSTANCE);
- }
- }
-
- @DataProvider(name = "updateArtifactOnVfcVlCpRIViaExternalAPI", parallel = true)
- public static Object[][] dataProviderUpdateArtifactOnVfcVlCpRIViaExternalAPI() {
- return new Object[][]{
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_JSON.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_POLICY.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_DOC.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_BLUEPRINT.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_EVENT.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.VFC},
-
-
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_JSON.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_POLICY.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_DOC.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_BLUEPRINT.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_EVENT.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.VL},
-
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_JSON.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_POLICY.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_DOC.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_BLUEPRINT.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_EVENT.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.CP},
-
-
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_JSON.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_POLICY.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_DOC.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_BLUEPRINT.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_EVENT.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.VFC},
-
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_JSON.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_POLICY.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_DOC.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_BLUEPRINT.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_EVENT.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.VL},
-
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_JSON.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_POLICY.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_DOC.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_BLUEPRINT.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_EVENT.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.CP},
- };
- }
-
- @Test(dataProvider = "updateArtifactOnVfcVlCpRIViaExternalAPI")
- public void updateArtifactOnVfcVlCpRIViaExternalAPI(LifeCycleStatesEnum chosenLifeCycleState, String artifactType, ResourceTypeEnum resourceTypeEnum) throws Exception {
- getExtendTest().log(Status.INFO, String.format("chosenLifeCycleState: %s, artifactType: %s", chosenLifeCycleState, artifactType));
- Component component = uploadArtifactOnAssetViaExternalAPI(ComponentTypeEnum.RESOURCE_INSTANCE, LifeCycleStatesEnum.CHECKOUT, artifactType, resourceTypeEnum);
- updateArtifactOnAssetViaExternalAPI(component, ComponentTypeEnum.RESOURCE_INSTANCE, chosenLifeCycleState, artifactType);
-
-
- // for certify version check that previous version exist, and that it artifact can be download + checksum
- if (chosenLifeCycleState.equals(LifeCycleStatesEnum.CERTIFY)) {
- // Download the uploaded artifact via external API
- downloadResourceDeploymentArtifactExternalAPIAndComparePayLoadOfArtifactType(component, artifactType, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), ComponentTypeEnum.RESOURCE_INSTANCE);
- }
- }
-
- @DataProvider(name = "updateArtifactOnVFViaExternalAPIByDifferentUserThenCreatorOfAsset", parallel = true)
- public static Object[][] dataProviderUpdateArtifactOnVFViaExternalAPIByDifferentUserThenCreatorOfAsset() {
- return new Object[][]{
- {ComponentTypeEnum.RESOURCE, UserRoleEnum.ADMIN, LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType()},
- {ComponentTypeEnum.SERVICE, UserRoleEnum.ADMIN, LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType()},
- {ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.ADMIN, LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType()},
-
- {ComponentTypeEnum.RESOURCE, UserRoleEnum.ADMIN, LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType()},
- {ComponentTypeEnum.SERVICE, UserRoleEnum.ADMIN, LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType()},
- {ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.ADMIN, LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType()},
-
- {ComponentTypeEnum.RESOURCE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.OTHER.getType()},
- {ComponentTypeEnum.SERVICE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.OTHER.getType()},
- {ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType()},
- {ComponentTypeEnum.RESOURCE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType()},
- {ComponentTypeEnum.SERVICE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType()},
- {ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType()},
-
- {ComponentTypeEnum.RESOURCE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.OTHER.getType()},
- {ComponentTypeEnum.SERVICE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.OTHER.getType()},
- {ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType()},
- {ComponentTypeEnum.RESOURCE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType()},
- {ComponentTypeEnum.SERVICE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType()},
- {ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType()},
-
- {ComponentTypeEnum.RESOURCE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.OTHER.getType()},
- {ComponentTypeEnum.SERVICE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.OTHER.getType()},
- {ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType()},
- {ComponentTypeEnum.RESOURCE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType()},
- {ComponentTypeEnum.SERVICE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType()},
- {ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType()},
- };
- }
-
- // External API
- // Update artifact by different user then creator of asset - Fail
- @Test(dataProvider = "updateArtifactOnVFViaExternalAPIByDifferentUserThenCreatorOfAsset")
- public void updateArtifactOnVFViaExternalAPIByDifferentUserThenCreatorOfAsset(ComponentTypeEnum componentTypeEnum, UserRoleEnum userRoleEnum, LifeCycleStatesEnum lifeCycleStatesEnum, String artifactType) throws Exception {
- getExtendTest().log(Status.INFO, String.format("componentTypeEnum: %s, userRoleEnum: %s, lifeCycleStatesEnum: %s, artifactType: %s", componentTypeEnum, userRoleEnum, lifeCycleStatesEnum, artifactType));
- Component component = uploadArtifactOnAssetViaExternalAPI(componentTypeEnum, LifeCycleStatesEnum.CHECKIN, artifactType, null);
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESTRICTED_OPERATION.name());
- List<String> variables = asList();
- updateArtifactOnAssetViaExternalAPI(component, componentTypeEnum, lifeCycleStatesEnum, artifactType, errorInfo, variables, userRoleEnum);
- }
-
- @DataProvider(name = "updateArtifactOnAssetWhichNotExist", parallel = true)
- public static Object[][] dataProviderUpdateArtifactOnAssetWhichNotExist() {
- return new Object[][]{
- {ComponentTypeEnum.SERVICE, ArtifactTypeEnum.OTHER.getType(), null},
- {ComponentTypeEnum.RESOURCE, ArtifactTypeEnum.OTHER.getType(), null},
- {ComponentTypeEnum.RESOURCE_INSTANCE, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType(), ResourceTypeEnum.VF},
- };
- }
-
- // External API
- // Upload artifact on VF via external API - happy flow
- @Test(dataProvider = "updateArtifactOnAssetWhichNotExist")
- public void updateArtifactOnAssetWhichNotExist(ComponentTypeEnum componentTypeEnum, String artifactType, ResourceTypeEnum resourceTypeEnum) throws Exception {
- getExtendTest().log(Status.INFO, String.format("componentTypeEnum: %s, artifactType: %s", componentTypeEnum, artifactType));
- Component component = uploadArtifactOnAssetViaExternalAPI(componentTypeEnum, LifeCycleStatesEnum.CHECKIN, artifactType, resourceTypeEnum);
-
- // get updated artifact data
- Map<String, ArtifactDefinition> deploymentArtifacts = getDeploymentArtifactsOfAsset(component, componentTypeEnum);
- ArtifactReqDetails artifactReqDetails = getUpdatedArtifact(deploymentArtifacts, artifactType);
- String artifactUUID = deploymentArtifacts.get(artifactReqDetails.getArtifactLabel()).getArtifactUUID();
-
- // Invalid artifactUUID
- String invalidArtifactUUID = "12341234-1234-1234-1234-123412341234";
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.ARTIFACT_NOT_FOUND.name());
- List<String> variables = asList(invalidArtifactUUID);
-
- if (componentTypeEnum.equals(ComponentTypeEnum.RESOURCE_INSTANCE)) {
- updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- component.getComponentInstances().get(0), artifactReqDetails, invalidArtifactUUID, errorInfo, variables, null, true);
- } else {
- updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- null, artifactReqDetails, invalidArtifactUUID, errorInfo, variables, null, true);
-
- }
-
- // Invalid componentUUID
-// errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESOURCE_NOT_FOUND.name());
-// variables = asList("null");
-
- if (componentTypeEnum.equals(ComponentTypeEnum.RESOURCE_INSTANCE)) {
- component.getComponentInstances().get(0).setNormalizedName("invalidNormalizedName");
-
- errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_INSTANCE_NOT_FOUND_ON_CONTAINER.name());
-
- variables = asList("invalidNormalizedName", ComponentTypeEnum.RESOURCE_INSTANCE.getValue().toLowerCase(), ComponentTypeEnum.SERVICE.getValue(), component.getName());
- updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- component.getComponentInstances().get(0), artifactReqDetails, artifactUUID, errorInfo, variables, LifeCycleStatesEnum.CHECKIN, true);
- } else {
- component.setUUID("invalidComponentUUID");
-
- errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESOURCE_NOT_FOUND.name());
- variables = asList("null");
-
- updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- null, artifactReqDetails, artifactUUID, errorInfo, variables, LifeCycleStatesEnum.CHECKIN, false);
- }
- performClean();
- }
-
- @DataProvider(name = "updateArtifactOnAssetWhichInInvalidStateForUploading", parallel = true)
- public static Object[][] dataProviderUpdateProviderDeleteArtifactOnAssetWhichInInvalidStateForUploading() {
- return new Object[][]{
- {ComponentTypeEnum.SERVICE, ArtifactTypeEnum.OTHER.getType()},
- };
- }
-
- @Test(dataProvider = "updateArtifactOnAssetWhichInInvalidStateForUploading")
- public void updateArtifactOnAssetWhichInInvalidStateForUploading(ComponentTypeEnum componentTypeEnum, String artifactType) throws Exception {
- getExtendTest().log(Status.INFO, String.format("componentTypeEnum: %s, artifactType: %s", componentTypeEnum, artifactType));
- Component component = uploadArtifactOnAssetViaExternalAPI(componentTypeEnum, LifeCycleStatesEnum.CHECKIN, artifactType, null);
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_IN_CERT_IN_PROGRESS_STATE.name());
- List<String> variables = asList(component.getName(), component.getComponentType().toString().toLowerCase(), ElementFactory.getDefaultUser(UserRoleEnum.TESTER).getFirstName(),
- ElementFactory.getDefaultUser(UserRoleEnum.TESTER).getLastName(), ElementFactory.getDefaultUser(UserRoleEnum.TESTER).getUserId());
- updateArtifactOnAssetViaExternalAPI(component, componentTypeEnum, LifeCycleStatesEnum.STARTCERTIFICATION, artifactType, errorInfo, variables, UserRoleEnum.DESIGNER);
-
- }
-
- @DataProvider(name = "updateInvalidArtifactTypeExtensionLabelDescriptionCheckSumDuplicateLabelViaExternalAPI", parallel = true)
- public static Object[][] dataProviderUpdateInvalidArtifactTypeExtensionLabelDescriptionCheckSumDuplicateLabelViaExternalAPI() {
- return new Object[][]{
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidCheckSum"},
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidCheckSum"},
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidCheckSum"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidCheckSum"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidCheckSum"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidCheckSum"},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidCheckSum"},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidCheckSum"},
-
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidNameToLong"},
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidNameToLong"},
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidNameToLong"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidNameToLong"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidNameToLong"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidNameToLong"},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidNameToLong"},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidNameToLong"},
-
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidNameEmpty"},
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidNameEmpty"},
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidNameEmpty"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidNameEmpty"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidNameEmpty"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidNameEmpty"},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidNameEmpty"},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidNameEmpty"},
-
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidLabelToLong"},
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidLabelToLong"},
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidLabelToLong"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidLabelToLong"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidLabelToLong"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidLabelToLong"},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidLabelToLong"},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidLabelToLong"},
-
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidLabelEmpty"},
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidLabelEmpty"},
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidLabelEmpty"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidLabelEmpty"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidLabelEmpty"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidLabelEmpty"},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidLabelEmpty"},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidLabelEmpty"},
-
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidDescriptionToLong"},
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidDescriptionToLong"},
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidDescriptionToLong"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidDescriptionToLong"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidDescriptionToLong"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidDescriptionToLong"},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidDescriptionToLong"},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidDescriptionToLong"},
-
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidDescriptionEmpty"},
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidDescriptionEmpty"},
- {LifeCycleStatesEnum.CHECKOUT, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidDescriptionEmpty"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE, "updateArtifactWithInvalidDescriptionEmpty"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidDescriptionEmpty"},
- {LifeCycleStatesEnum.CHECKIN, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidDescriptionEmpty"},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.SERVICE, "updateArtifactWithInvalidDescriptionEmpty"},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ComponentTypeEnum.RESOURCE_INSTANCE, "updateArtifactWithInvalidDescriptionEmpty"},
- };
- }
-
- // InvalidArtifact + check audit & response code function
- @Test(dataProvider = "updateInvalidArtifactTypeExtensionLabelDescriptionCheckSumDuplicateLabelViaExternalAPI")
- public void updateInvalidArtifactTypeExtensionLabelDescriptionCheckSumDuplicateLabelViaExternalAPI(LifeCycleStatesEnum chosenLifeCycleState,
- ComponentTypeEnum componentTypeEnum, String uploadArtifactTestType) throws Exception {
- getExtendTest().log(Status.INFO, String.format("chosenLifeCycleState: %s, componentTypeEnum: %s, uploadArtifactTestType: %s", chosenLifeCycleState, componentTypeEnum, uploadArtifactTestType));
- Component component;
- ComponentInstance componentInstance = null;
- String artifactType;
-
- if (ComponentTypeEnum.RESOURCE_INSTANCE == componentTypeEnum) {
- artifactType = ArtifactTypeEnum.DCAE_INVENTORY_DOC.toString();
- component = uploadArtifactOnAssetViaExternalAPI(componentTypeEnum, LifeCycleStatesEnum.CHECKIN, artifactType, null);
- componentInstance = component.getComponentInstances().get(0);
- } else {
- artifactType = ArtifactTypeEnum.OTHER.toString();
- component = uploadArtifactOnAssetViaExternalAPI(componentTypeEnum, LifeCycleStatesEnum.CHECKIN, artifactType, null);
- }
-
- component = AtomicOperationUtils.changeComponentState(component, UserRoleEnum.DESIGNER, chosenLifeCycleState, true).getLeft();
-
- switch (uploadArtifactTestType) {
- case "updateArtifactWithInvalidCheckSum":
- updateArtifactWithInvalidCheckSum(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactType, componentInstance);
- break;
- case "updateArtifactWithInvalidNameToLong":
- updateArtifactWithInvalidNameToLong(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactType, componentInstance);
- break;
- case "updateArtifactWithInvalidNameEmpty":
- updateArtifactWithInvalidNameEmpty(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactType, componentInstance);
- break;
- case "updateArtifactWithInvalidLabelToLong":
- updateArtifactWithInvalidLabelToLong(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactType, componentInstance);
- break;
- case "updateArtifactWithInvalidLabelEmpty":
- updateArtifactWithInvalidLabelEmpty(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactType, componentInstance);
- break;
- case "updateArtifactWithInvalidDescriptionToLong":
- updateArtifactWithInvalidDescriptionToLong(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactType, componentInstance);
- break;
- case "updateArtifactWithInvalidDescriptionEmpty":
- default:
- updateArtifactWithInvalidDescriptionEmpty(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactType, componentInstance);
- break;
- }
-
-///////////////////////////////////////////////////////////////////////////////
-// // TODO: there is defect when checking invalid type
-//// // Upload artifact with invalid type via external API
-//// // invalid type
-//// String artifactType = artifactReqDetails.getArtifactType();
-//// artifactReqDetails.setArtifactType("invalidType");
-//// restResponse = uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, componentResourceInstanceDetails);
-//// // empty type
-//// artifactReqDetails.setArtifactType("");
-//// restResponse = uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(resourceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, componentResourceInstanceDetails);
-//// artifactReqDetails.setArtifactType(artifactType);
-///////////////////////////////////////////////////////////////////////////////
- }
-
- // TODO
- // Update artifact with invalid checksum via external API
- protected void updateArtifactWithInvalidCheckSum(Component component, User sdncModifierDetails, String artifactType, ComponentInstance componentInstance) throws Exception {
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.ARTIFACT_INVALID_MD5.name());
- List<String> variables = asList();
- }
-
-
- // Update artifact with valid type & invalid name via external API - name to long
- protected void updateArtifactWithInvalidNameToLong(Component component, User sdncModifierDetails, String artifactType,
- ComponentInstance componentInstance) throws Exception {
-
- ArtifactReqDetails artifactReqDetails = ElementFactory.getArtifactByType("ci", artifactType, true, true);
- String artifactUUID = getFirstArtifactUuidFromComponent(component);
-
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.EXCEEDS_LIMIT.name());
- List<String> variables = asList("artifact name", "255");
- artifactReqDetails.setArtifactName("invalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsinvalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidTypeinvalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidTypeghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidType");
-
- if (componentInstance != null) {
- updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- component.getComponentInstances().get(0), artifactReqDetails, artifactUUID, errorInfo, variables, null, true);
- } else {
- updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- null, artifactReqDetails, artifactUUID, errorInfo, variables, null, true);
-
- }
- }
-
- // Update artifact with valid type & invalid name via external API - name is empty
- protected void updateArtifactWithInvalidNameEmpty(Component component, User sdncModifierDetails, String artifactType,
- ComponentInstance componentInstance) throws Exception {
-
- ArtifactReqDetails artifactReqDetails = ElementFactory.getArtifactByType("ci", artifactType, true, true);
- String artifactUUID = getFirstArtifactUuidFromComponent(component);
-
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_ARTIFACT_NAME.name());
- List<String> variables = asList();
- artifactReqDetails.setArtifactName("");
-
- if (componentInstance != null) {
- updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- component.getComponentInstances().get(0), artifactReqDetails, artifactUUID, errorInfo, variables, null, true);
- } else {
- updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- null, artifactReqDetails, artifactUUID, errorInfo, variables, null, true);
-
- }
- }
-
- // Update artifact with valid type & invalid label via external API - label to long -
-// according to the newest AID doc artifactLabel, artifactType, artifactGroupType parameters should be ignored
- protected void updateArtifactWithInvalidLabelToLong(Component component, User sdncModifierDetails, String artifactType,
- ComponentInstance componentInstance) throws Exception {
-
- ArtifactReqDetails artifactReqDetails = ElementFactory.getArtifactByType("ci", artifactType, true, true);
- String artifactUUID = getFirstArtifactUuidFromComponent(component);
-
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.OK.name());
- artifactReqDetails.setArtifactLabel("invalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidTypeinvalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidType");
-
- if (componentInstance != null) {
- updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- component.getComponentInstances().get(0), artifactReqDetails, artifactUUID, errorInfo, null, null, true);
- } else {
- updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- null, artifactReqDetails, artifactUUID, errorInfo, null, null, true);
-
- }
- }
-
- // Update artifact with valid type & invalid label via external API - label is empty
-// according to the newest AID doc artifactLabel, artifactType, artifactGroupType parameters should be ignored
- protected void updateArtifactWithInvalidLabelEmpty(Component component, User sdncModifierDetails, String artifactType,
- ComponentInstance componentInstance) throws Exception {
-
- ArtifactReqDetails artifactReqDetails = ElementFactory.getArtifactByType("ci", artifactType, true, true);
- String artifactUUID = getFirstArtifactUuidFromComponent(component);
-
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.OK.name());
- artifactReqDetails.setArtifactLabel("");
-
- if (componentInstance != null) {
- updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- component.getComponentInstances().get(0), artifactReqDetails, artifactUUID, errorInfo, null, null, true);
- } else {
- updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- null, artifactReqDetails, artifactUUID, errorInfo, null, null, true);
-
- }
- }
-
- // Update artifact with invalid description via external API - to long description
- protected void updateArtifactWithInvalidDescriptionToLong(Component component, User sdncModifierDetails, String artifactType,
- ComponentInstance componentInstance) throws Exception {
-
- ArtifactReqDetails artifactReqDetails = ElementFactory.getArtifactByType("ci", artifactType, true, true);
- String artifactUUID = getFirstArtifactUuidFromComponent(component);
-
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.EXCEEDS_LIMIT.name());
- List<String> variables = asList("artifact description", ValidationUtils.ARTIFACT_DESCRIPTION_MAX_LENGTH.toString());
- artifactReqDetails.setDescription("invalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsinvalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidTypeinvalGGfdsiofhdsouhfoidshfoidshoifhsdoifhdsouihfdsofhiufdsghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidTypeghiufghodhfioudsgafodsgaiofudsghifudsiugfhiufawsouipfhgawseiupfsadiughdfsoiuhgfaighfpasdghfdsaqgfdsgdfgidType");
-
- if (componentInstance != null) {
- updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- component.getComponentInstances().get(0), artifactReqDetails, artifactUUID, errorInfo, variables, null, true);
- } else {
- updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- null, artifactReqDetails, artifactUUID, errorInfo, variables, null, true);
-
- }
- }
-
- public String getFirstArtifactUuidFromComponent(Component component) {
- String artifactUUID = null;
- Map<String, ArtifactDefinition> deploymentArtifacts;
- if (component.getComponentInstances() != null) {
- deploymentArtifacts = component.getComponentInstances().get(0).getDeploymentArtifacts();
- } else {
- deploymentArtifacts = component.getDeploymentArtifacts();
- }
-
- for (String key : deploymentArtifacts.keySet()) {
- if (key.startsWith("ci")) {
- artifactUUID = deploymentArtifacts.get(key).getArtifactUUID();
- break;
- }
- }
- return artifactUUID;
- }
-
- // Update artifact with invalid description via external API - empty description
- protected void updateArtifactWithInvalidDescriptionEmpty(Component component, User sdncModifierDetails, String artifactType,
- ComponentInstance componentInstance) throws Exception {
-
- ArtifactReqDetails artifactReqDetails = ElementFactory.getArtifactByType("ci", artifactType, true, true);
- String artifactUUID = getFirstArtifactUuidFromComponent(component);
-
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_DATA.name());
- List<String> variables = asList("artifact description");
- artifactReqDetails.setDescription("");
-
- if (componentInstance != null) {
- updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- component.getComponentInstances().get(0), artifactReqDetails, artifactUUID, errorInfo, variables, null, true);
- } else {
- updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- null, artifactReqDetails, artifactUUID, errorInfo, variables, null, true);
- }
- }
-
- // Unhappy flow - get chosen life cycle state, artifact type and asset type
- // update artifact via external API + check audit & response code
- // Download artifact via external API + check audit & response code
- // Check artifact version, uuid & checksusm
- protected Component updateArtifactOnAssetViaExternalAPI(Component component, ComponentTypeEnum componentTypeEnum, LifeCycleStatesEnum chosenLifeCycleState, String artifactType, ErrorInfo errorInfo, List<String> variables, UserRoleEnum userRoleEnum) throws Exception {
- String componentVersionBeforeUpdate = null;
-
- // get updated artifact data
- component = AtomicOperationUtils.changeComponentState(component, UserRoleEnum.DESIGNER, chosenLifeCycleState, true).getLeft();
- componentVersionBeforeUpdate = component.getVersion();
-
- Map<String, ArtifactDefinition> deploymentArtifacts = getDeploymentArtifactsOfAsset(component, componentTypeEnum);
- ArtifactReqDetails artifactReqDetails = getUpdatedArtifact(deploymentArtifacts, artifactType);
-
- String artifactName = artifactReqDetails.getArtifactLabel();
- String artifactUUID = deploymentArtifacts.get(artifactName).getArtifactUUID();
- String artifactVersionBeforeUpdate = deploymentArtifacts.get(artifactName).getArtifactVersion();
- int numberOfArtifact = deploymentArtifacts.size();
-
- ArtifactReqDetails updateArtifactReqDetails = ElementFactory.getArtifactByType(ArtifactTypeEnum.SNMP_POLL.name(), ArtifactTypeEnum.SNMP_POLL.name(), true, true);
- updateArtifactReqDetails.setPayload("dGVzdA==");
-
- // create component/s & upload artifact via external api
- if (ComponentTypeEnum.RESOURCE_INSTANCE == componentTypeEnum) {
- updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(userRoleEnum),
- component.getComponentInstances().get(0), updateArtifactReqDetails, artifactUUID, errorInfo, variables, chosenLifeCycleState, true);
- } else {
- updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(userRoleEnum),
- null, updateArtifactReqDetails, artifactUUID, errorInfo, variables, chosenLifeCycleState, true);
- }
-
- if (component.getComponentType().equals(ComponentTypeEnum.SERVICE)) {
- component = AtomicOperationUtils.getServiceObjectByNameAndVersion(UserRoleEnum.DESIGNER, component.getName(), component.getVersion());
- } else {
- component = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, component.getName(), component.getVersion());
- }
-
- // Get list of deployment artifact + download them via external API
- if (ComponentTypeEnum.RESOURCE_INSTANCE == componentTypeEnum) {
- deploymentArtifacts = component.getComponentInstances().get(0).getDeploymentArtifacts();
- } else {
- deploymentArtifacts = component.getDeploymentArtifacts();
- }
- Assert.assertEquals(numberOfArtifact, deploymentArtifacts.keySet().size(), "Expected that number of deployment artifact will be same as before.");
- Assert.assertEquals(componentVersionBeforeUpdate, component.getVersion(), "Expected that check-out component will not change version number.");
- if (errorInfo.getCode().equals(200)) {
- Assert.assertNotEquals(String.valueOf((Integer.parseInt(artifactVersionBeforeUpdate))), deploymentArtifacts.get(artifactName).getArtifactVersion(), "Artifact version should be changed.");
- Assert.assertNotEquals(artifactUUID, deploymentArtifacts.get(artifactName).getArtifactUUID(), "Artifact UUID should be changed.");
- } else {
- Assert.assertEquals(String.valueOf((Integer.parseInt(artifactVersionBeforeUpdate))), deploymentArtifacts.get(artifactName).getArtifactVersion(), "Artifact version should not be changed.");
- Assert.assertEquals(artifactUUID, deploymentArtifacts.get(artifactName).getArtifactUUID(), "Artifact UUID should not be changed.");
- }
- return component;
- }
-
- protected RestResponse updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(Component component, User sdncModifierDetails,
- ComponentInstance componentInstance, ArtifactReqDetails artifactReqDetails, String artifactUUID, ErrorInfo errorInfo, List<String> variables, LifeCycleStatesEnum lifeCycleStatesEnum, Boolean resourceNameInAudit) throws Exception {
- RestResponse restResponse;
-
- if (componentInstance != null) {
- restResponse = ArtifactRestUtils.externalAPIUpdateArtifactOfComponentInstanceOnAsset(component, sdncModifierDetails, artifactReqDetails, componentInstance, artifactUUID);
- } else {
- restResponse = ArtifactRestUtils.externalAPIUpdateArtifactOfTheAsset(component, sdncModifierDetails, artifactReqDetails, artifactUUID);
-
- }
- // validate response code
- Integer responseCode = restResponse.getErrorCode();
- Assert.assertEquals(responseCode, errorInfo.getCode(), "Response code is not correct.");
- component = AtomicOperationUtils.getComponentObject(component, UserRoleEnum.DESIGNER);
- return restResponse;
- }
-
-
- // This function get component, user & if updatedPayload or not
- // It will create default payload / updated payload of artifact
- // And download artifact of component which starts with ci
- protected RestResponse downloadResourceDeploymentArtifactExternalAPIAndComparePayLoadOfArtifactType(Component component, String artifactType, User sdncModifierDetails, ComponentTypeEnum componentTypeEnum) throws IOException, Exception {
- // Download the uploaded artifact via external API
- ArtifactReqDetails artifactReqDetails = ElementFactory.getArtifactByType("abcd", artifactType, true, false);
- String artifactName = null;
- for (String key : component.getDeploymentArtifacts().keySet()) {
- if (key.startsWith("ci")) {
- artifactName = key;
- break;
- }
- }
- return downloadResourceDeploymentArtifactExternalAPI(component, component.getDeploymentArtifacts().get(artifactName), sdncModifierDetails, artifactReqDetails, componentTypeEnum);
- }
-
- // Get deployment artifact of RI
- protected Map<String, ArtifactDefinition> getDeploymentArtifactsOfAsset(Component component, ComponentTypeEnum componentTypeEnum) {
- Map<String, ArtifactDefinition> deploymentArtifacts = null;
- if (ComponentTypeEnum.RESOURCE_INSTANCE == componentTypeEnum) {
- for (ComponentInstance componentInstance : component.getComponentInstances()) {
- if (componentInstance.getNormalizedName().startsWith("ci")) {
- deploymentArtifacts = componentInstance.getDeploymentArtifacts();
- break;
- }
- }
- } else {
- deploymentArtifacts = component.getDeploymentArtifacts();
- }
- return deploymentArtifacts;
- }
-
- // get deploymentArtifact of asset and artifactType -> generate new artifact that can be updated on the asset
- protected ArtifactReqDetails getUpdatedArtifact(Map<String, ArtifactDefinition> deploymentArtifacts, String artifactType) throws IOException, Exception {
- ArtifactReqDetails artifactReqDetails = ElementFactory.getArtifactByType("ci", artifactType, true, true);
-
- for (String key : deploymentArtifacts.keySet()) {
- if (key.startsWith("ci")) {
- artifactReqDetails.setArtifactDisplayName(deploymentArtifacts.get(key).getArtifactDisplayName());
- artifactReqDetails.setArtifactName(deploymentArtifacts.get(key).getArtifactName());
- artifactReqDetails.setArtifactLabel(deploymentArtifacts.get(key).getArtifactLabel());
- break;
- }
- }
- return artifactReqDetails;
- }
-
- // Happy flow - get chosen life cycle state, artifact type and asset type
- // update artifact via external API + check audit & response code
- // Download artifact via external API + check audit & response code
- // Check artifact version, uuid & checksusm
- protected Component updateArtifactOnAssetViaExternalAPI(Component component, ComponentTypeEnum componentTypeEnum, LifeCycleStatesEnum chosenLifeCycleState, String artifactType) throws Exception {
- RestResponse restResponse = null;
- int numberOfArtifact = 0;
- String artifactVersionBeforeUpdate = null;
- String artifactName = null;
- String componentVersionBeforeUpdate = null;
-
- // get updated artifact data
- ArtifactReqDetails artifactReqDetails = ElementFactory.getArtifactByType("ci", artifactType, true, true);
- String artifactUUID = null;
- Map<String, ArtifactDefinition> deploymentArtifacts;
- deploymentArtifacts = getDeploymentArtifactsOfAsset(component, componentTypeEnum);
-
- for (String key : deploymentArtifacts.keySet()) {
- if (key.startsWith("ci")) {
- artifactName = key;
- artifactVersionBeforeUpdate = deploymentArtifacts.get(key).getArtifactVersion();
- artifactUUID = deploymentArtifacts.get(key).getArtifactUUID();
- artifactReqDetails.setArtifactDisplayName(deploymentArtifacts.get(key).getArtifactDisplayName());
- artifactReqDetails.setArtifactName(deploymentArtifacts.get(key).getArtifactName());
- artifactReqDetails.setArtifactLabel(deploymentArtifacts.get(key).getArtifactLabel());
- break;
- }
- }
-
- component = AtomicOperationUtils.changeComponentState(component, UserRoleEnum.DESIGNER, chosenLifeCycleState, true).getLeft();
- componentVersionBeforeUpdate = component.getVersion();
- deploymentArtifacts = getDeploymentArtifactsOfAsset(component, componentTypeEnum);
- numberOfArtifact = deploymentArtifacts.size();
-
- // create component/s & upload artifact via external api
- if (ComponentTypeEnum.RESOURCE_INSTANCE == componentTypeEnum) {
- restResponse = updateArtifactOfRIIncludingValiditionOfAuditAndResponseCode(component, component.getComponentInstances().get(0), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, artifactUUID, 200);
- } else {
- restResponse = updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, artifactUUID, 200);
- }
-
- ArtifactDefinition responseArtifact = ResponseParser.convertArtifactDefinitionResponseToJavaObject(restResponse.getResponse());
- component = getNewerVersionOfComponent(component, chosenLifeCycleState);
-
- // Get list of deployment artifact + download them via external API
- deploymentArtifacts = getDeploymentArtifactsOfAsset(component, componentTypeEnum);
- Assert.assertEquals(numberOfArtifact, deploymentArtifacts.keySet().size(), "Expected that number of deployment artifact will be same as before.");
- Assert.assertEquals(String.valueOf((Integer.parseInt(artifactVersionBeforeUpdate) + 1)), deploymentArtifacts.get(artifactName).getArtifactVersion(), "Expected that aftifact version will increase by one.");
-
- if (chosenLifeCycleState == LifeCycleStatesEnum.CHECKOUT) {
- Assert.assertEquals(componentVersionBeforeUpdate, component.getVersion(), "Expected that check-out component will not change version number.");
- } else {
- Assert.assertEquals(String.format("%.1f", (Double.parseDouble(componentVersionBeforeUpdate) + 0.1)), component.getVersion(), "Expected that non check-out component version will increase by 0.1.");
- }
-
- // Download the uploaded artifact via external API
- downloadResourceDeploymentArtifactExternalAPI(component, deploymentArtifacts.get(responseArtifact.getArtifactLabel()), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, componentTypeEnum);
-
- return component;
- }
-
-
- // Update artifact via external API + Check auditing for upload operation + Check response of external API
- protected RestResponse updateArtifactOfRIIncludingValiditionOfAuditAndResponseCode(Component component, ComponentInstance componentInstance, User sdncModifierDetails, ArtifactReqDetails artifactReqDetails, String artifactUUID, Integer expectedResponseCode) throws Exception {
- RestResponse restResponse = ArtifactRestUtils.externalAPIUpdateArtifactOfComponentInstanceOnAsset(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, component.getComponentInstances().get(0), artifactUUID);
-
- // Check response of external API
- Integer responseCode = restResponse.getErrorCode();
- Assert.assertEquals(responseCode, expectedResponseCode, "Response code is not correct.");
- return restResponse;
- }
-
-
- // Update artifact via external API + Check auditing for upload operation + Check response of external API
- protected RestResponse updateArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(Component component, User sdncModifierDetails, ArtifactReqDetails artifactReqDetails, String artifactUUID, Integer expectedResponseCode) throws Exception {
- RestResponse restResponse = ArtifactRestUtils.externalAPIUpdateArtifactOfTheAsset(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, artifactUUID);
-
- // Check response of external API
- Integer responseCode = restResponse.getErrorCode();
- Assert.assertEquals(responseCode, expectedResponseCode, "Response code is not correct.");
- return restResponse;
- }
-
-
- ////////////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////////////
- // Delete External API //
- ////////////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////////////
- @DataProvider(name = "deleteArtifactForServiceViaExternalAPI", parallel = true)
- public static Object[][] dataProviderDeleteArtifactForServiceViaExternalAPI() {
- return new Object[][]{
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.YANG_XML.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VNF_CATALOG.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.YANG_XML.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VNF_CATALOG.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.OTHER.getType()},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ArtifactTypeEnum.YANG_XML.getType()},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ArtifactTypeEnum.VNF_CATALOG.getType()},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType()},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType()},
- {LifeCycleStatesEnum.CERTIFICATIONREQUEST, ArtifactTypeEnum.OTHER.getType()},
- {LifeCycleStatesEnum.CERTIFY, ArtifactTypeEnum.YANG_XML.getType()},
- {LifeCycleStatesEnum.CERTIFY, ArtifactTypeEnum.VNF_CATALOG.getType()},
- {LifeCycleStatesEnum.CERTIFY, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType()},
- {LifeCycleStatesEnum.CERTIFY, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType()},
- {LifeCycleStatesEnum.CERTIFY, ArtifactTypeEnum.OTHER.getType()}
- };
- }
-
- // Delete artifact for Service - Success
- @Test(dataProvider = "deleteArtifactForServiceViaExternalAPI")
- public void deleteArtifactForServiceViaExternalAPI(LifeCycleStatesEnum lifeCycleStatesEnum, String artifactType) throws Exception {
- getExtendTest().log(Status.INFO, String.format("lifeCycleStatesEnum: %s, artifactType: %s", lifeCycleStatesEnum, artifactType));
- Component component = uploadArtifactOnAssetViaExternalAPI(ComponentTypeEnum.SERVICE, LifeCycleStatesEnum.CHECKOUT, artifactType, null);
- deleteArtifactOnAssetViaExternalAPI(component, ComponentTypeEnum.SERVICE, lifeCycleStatesEnum);
- }
-
- @DataProvider(name = "deleteArtifactForVFViaExternalAPI", parallel = true)
- public static Object[][] dataProviderDeleteArtifactForVFViaExternalAPI() {
- return new Object[][]{
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_JSON.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_POLICY.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_EVENT.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.APPC_CONFIG.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_DOC.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_TOSCA.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.YANG_XML.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VNF_CATALOG.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VF_LICENSE.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VENDOR_LICENSE.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType()},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType()},
-
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_JSON.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_POLICY.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_EVENT.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.APPC_CONFIG.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_DOC.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_TOSCA.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.YANG_XML.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VNF_CATALOG.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VF_LICENSE.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VENDOR_LICENSE.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType()},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.OTHER.getType()},
- };
- }
-
- // Delete artifact for VF - Success
- @Test(dataProvider = "deleteArtifactForVFViaExternalAPI")
- public void deleteArtifactForVFViaExternalAPI(LifeCycleStatesEnum lifeCycleStatesEnum, String artifactType) throws Exception {
- getExtendTest().log(Status.INFO, String.format("lifeCycleStatesEnum: %s, artifactType: %s", lifeCycleStatesEnum, artifactType));
- Component component = uploadArtifactOnAssetViaExternalAPI(ComponentTypeEnum.RESOURCE, LifeCycleStatesEnum.CHECKOUT, artifactType, null);
- deleteArtifactOnAssetViaExternalAPI(component, ComponentTypeEnum.RESOURCE, lifeCycleStatesEnum);
- }
-
- @DataProvider(name = "deleteArtifactForVfcVlCpViaExternalAPI", parallel = true)
- public static Object[][] dataProviderDeleteArtifactForVfcVlCpViaExternalAPI() {
- return new Object[][]{
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.YANG_XML.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VNF_CATALOG.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VF_LICENSE.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VENDOR_LICENSE.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.VFC},
-
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.YANG_XML.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VNF_CATALOG.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VF_LICENSE.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VENDOR_LICENSE.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.VL},
-
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.YANG_XML.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VNF_CATALOG.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VF_LICENSE.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.VENDOR_LICENSE.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.CP},
-
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.YANG_XML.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VNF_CATALOG.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VF_LICENSE.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VENDOR_LICENSE.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.OTHER.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.VFC},
-
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.YANG_XML.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VNF_CATALOG.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VF_LICENSE.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VENDOR_LICENSE.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.OTHER.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.VL},
-
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.YANG_XML.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VNF_CATALOG.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VF_LICENSE.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.VENDOR_LICENSE.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.MODEL_QUERY_SPEC.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.OTHER.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.CP},
- };
- }
-
- // Delete artifact for VFC, VL, CP - Success
- @Test(dataProvider = "deleteArtifactForVfcVlCpViaExternalAPI")
- public void deleteArtifactForVfcVlCpViaExternalAPI(LifeCycleStatesEnum lifeCycleStatesEnum, String artifactType, ResourceTypeEnum resourceTypeEnum) throws Exception {
- getExtendTest().log(Status.INFO, String.format("lifeCycleStatesEnum: %s, artifactType: %s, resourceTypeEnum: %s", lifeCycleStatesEnum, artifactType, resourceTypeEnum));
- Component component = uploadArtifactOnAssetViaExternalAPI(ComponentTypeEnum.RESOURCE, LifeCycleStatesEnum.CHECKOUT, artifactType, resourceTypeEnum);
- deleteArtifactOnAssetViaExternalAPI(component, ComponentTypeEnum.RESOURCE, lifeCycleStatesEnum);
- }
-
- @DataProvider(name = "deleteArtifactOnRIViaExternalAPI", parallel = true)
- public static Object[][] dataProviderDeleteArtifactOnRIViaExternalAPI() {
- return new Object[][]{
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType(), null},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_JSON.getType(), null},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_POLICY.getType(), null},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_DOC.getType(), null},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_BLUEPRINT.getType(), null},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_EVENT.getType(), null},
-
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType(), null},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_JSON.getType(), null},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_POLICY.getType(), null},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_DOC.getType(), null},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_BLUEPRINT.getType(), null},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_EVENT.getType(), null},
-
- };
- }
-
-
- @Test(dataProvider = "deleteArtifactOnRIViaExternalAPI")
- public void deleteArtifactOnRIViaExternalAPI(LifeCycleStatesEnum chosenLifeCycleState, String artifactType, ResourceTypeEnum resourceTypeEnum) throws Exception {
- getExtendTest().log(Status.INFO, String.format("chosenLifeCycleState: %s, artifactType: %s", chosenLifeCycleState, artifactType));
- Component component = uploadArtifactOnAssetViaExternalAPI(ComponentTypeEnum.RESOURCE_INSTANCE, LifeCycleStatesEnum.CHECKOUT, artifactType, resourceTypeEnum);
- deleteArtifactOnAssetViaExternalAPI(component, ComponentTypeEnum.RESOURCE_INSTANCE, chosenLifeCycleState);
- }
-
- @DataProvider(name = "deleteArtifactOnVfcVlCpRIViaExternalAPI", parallel = true)
- public static Object[][] dataProviderDeleteArtifactOnVfcVlCpRIViaExternalAPI() {
- return new Object[][]{
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_JSON.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_POLICY.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_DOC.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_BLUEPRINT.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_EVENT.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.VFC},
-
-
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_JSON.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_POLICY.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_DOC.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_BLUEPRINT.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_EVENT.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.VL},
-
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_JSON.getType(), ResourceTypeEnum.CP,},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_POLICY.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_DOC.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_BLUEPRINT.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_EVENT.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.CP},
-
-
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_JSON.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_POLICY.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_DOC.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_BLUEPRINT.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_EVENT.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.VFC},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.VFC},
-
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_JSON.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_POLICY.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_DOC.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_BLUEPRINT.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_EVENT.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.VL},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.VL},
-
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_JSON.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_POLICY.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_DOC.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_BLUEPRINT.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_EVENT.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_POLL.getType(), ResourceTypeEnum.CP},
- {LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.SNMP_TRAP.getType(), ResourceTypeEnum.CP},
- };
- }
-
- @Test(dataProvider = "deleteArtifactOnVfcVlCpRIViaExternalAPI")
- public void deleteArtifactOnVfcVlCpRIViaExternalAPI(LifeCycleStatesEnum chosenLifeCycleState, String artifactType, ResourceTypeEnum resourceTypeEnum) throws Exception {
- getExtendTest().log(Status.INFO, String.format("chosenLifeCycleState: %s, artifactType: %s", chosenLifeCycleState, artifactType));
- Component component = uploadArtifactOnAssetViaExternalAPI(ComponentTypeEnum.RESOURCE_INSTANCE, LifeCycleStatesEnum.CHECKOUT, artifactType, resourceTypeEnum);
- deleteArtifactOnAssetViaExternalAPI(component, ComponentTypeEnum.RESOURCE_INSTANCE, chosenLifeCycleState);
- }
-
- @DataProvider(name = "deleteArtifactOnVFViaExternalAPIByDiffrentUserThenCreatorOfAsset", parallel = true)
- public static Object[][] dataProviderDeleteArtifactOnVFViaExternalAPIByDiffrentUserThenCreatorOfAsset() {
- return new Object[][]{
- {ComponentTypeEnum.RESOURCE, UserRoleEnum.ADMIN, LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType()},
- {ComponentTypeEnum.SERVICE, UserRoleEnum.ADMIN, LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType()},
- {ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.ADMIN, LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType()},
-
- {ComponentTypeEnum.RESOURCE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.OTHER.getType()},
- {ComponentTypeEnum.SERVICE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.OTHER.getType()},
- {ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType()},
- {ComponentTypeEnum.RESOURCE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType()},
- {ComponentTypeEnum.SERVICE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType()},
- {ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.TESTER, LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType()},
-
- {ComponentTypeEnum.RESOURCE, UserRoleEnum.ADMIN, LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.OTHER.getType()},
- {ComponentTypeEnum.SERVICE, UserRoleEnum.ADMIN, LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.OTHER.getType()},
- {ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.ADMIN, LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType()},
- {ComponentTypeEnum.RESOURCE, UserRoleEnum.ADMIN, LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType()},
- {ComponentTypeEnum.SERVICE, UserRoleEnum.ADMIN, LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType()},
- {ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.ADMIN, LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType()},
-
- {ComponentTypeEnum.RESOURCE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.OTHER.getType()},
- {ComponentTypeEnum.SERVICE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.OTHER.getType()},
- {ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType()},
- {ComponentTypeEnum.RESOURCE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType()},
- {ComponentTypeEnum.SERVICE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType()},
- {ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.OPS, LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType()},
-
- {ComponentTypeEnum.RESOURCE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.OTHER.getType()},
- {ComponentTypeEnum.SERVICE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.OTHER.getType()},
- {ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKIN, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType()},
- {ComponentTypeEnum.RESOURCE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType()},
- {ComponentTypeEnum.SERVICE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.OTHER.getType()},
- {ComponentTypeEnum.RESOURCE_INSTANCE, UserRoleEnum.GOVERNOR, LifeCycleStatesEnum.CHECKOUT, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType()},
- };
- }
-
- // External API
- // Delete artifact by different user then creator of asset - Fail
- @Test(dataProvider = "deleteArtifactOnVFViaExternalAPIByDiffrentUserThenCreatorOfAsset")
- public void deleteArtifactOnVFViaExternalAPIByDiffrentUserThenCreatorOfAsset(ComponentTypeEnum componentTypeEnum, UserRoleEnum userRoleEnum, LifeCycleStatesEnum lifeCycleStatesEnum, String artifactType) throws Exception {
- getExtendTest().log(Status.INFO, String.format("componentTypeEnum: %s, userRoleEnum %s, lifeCycleStatesEnum %s, artifactType: %s", componentTypeEnum, userRoleEnum, lifeCycleStatesEnum, artifactType));
- Component component = uploadArtifactOnAssetViaExternalAPI(componentTypeEnum, lifeCycleStatesEnum, artifactType, null);
- Map<String, ArtifactDefinition> deploymentArtifacts = getDeploymentArtifactsOfAsset(component, componentTypeEnum);
-
- String artifactUUID = null;
- for (String key : deploymentArtifacts.keySet()) {
- if (key.startsWith("ci")) {
- artifactUUID = deploymentArtifacts.get(key).getArtifactUUID();
- break;
- }
- }
-
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESTRICTED_OPERATION.name());
- List<String> variables = asList();
-
- if (componentTypeEnum.equals(ComponentTypeEnum.RESOURCE_INSTANCE)) {
- deleteArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(userRoleEnum),
- component.getComponentInstances().get(0), artifactUUID, errorInfo, variables, lifeCycleStatesEnum, true);
- } else {
- deleteArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(userRoleEnum),
- null, artifactUUID, errorInfo, variables, lifeCycleStatesEnum, true);
- }
-
- //TODO
-// downloadResourceDeploymentArtifactExternalAPI(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactUUID, componentTypeEnum);
- }
-
-
- @DataProvider(name = "deleteArtifactOnAssetWhichNotExist", parallel = true)
- public static Object[][] dataProviderDeleteArtifactOnAssetWhichNotExist() {
- return new Object[][]{
- {ComponentTypeEnum.SERVICE, ArtifactTypeEnum.OTHER.getType(), null},
- {ComponentTypeEnum.RESOURCE, ArtifactTypeEnum.OTHER.getType(), null},
- {ComponentTypeEnum.RESOURCE_INSTANCE, ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType(), ResourceTypeEnum.VF},
- };
- }
-
- // External API
- // Upload artifact on VF via external API - happy flow
- @Test(dataProvider = "deleteArtifactOnAssetWhichNotExist")
- public void deleteArtifactOnAssetWhichNotExist(ComponentTypeEnum componentTypeEnum, String artifactType, ResourceTypeEnum resourceTypeEnum) throws Exception {
- getExtendTest().log(Status.INFO, String.format("componentTypeEnum: %s, artifactType: %s", componentTypeEnum, artifactType));
- Component component = uploadArtifactOnAssetViaExternalAPI(componentTypeEnum, LifeCycleStatesEnum.CHECKIN, artifactType, resourceTypeEnum);
-
- Map<String, ArtifactDefinition> deploymentArtifacts = getDeploymentArtifactsOfAsset(component, componentTypeEnum);
-
- String artifactUUID = null;
- for (String key : deploymentArtifacts.keySet()) {
- if (key.startsWith("ci")) {
- artifactUUID = deploymentArtifacts.get(key).getArtifactUUID();
- break;
- }
- }
-
- // Invalid artifactUUID
- String invalidArtifactUUID = "12341234-1234-1234-1234-123412341234";
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.ARTIFACT_NOT_FOUND.name());
- List<String> variables = asList(invalidArtifactUUID);
-
- if (componentTypeEnum.equals(ComponentTypeEnum.RESOURCE_INSTANCE)) {
- deleteArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- component.getComponentInstances().get(0), invalidArtifactUUID, errorInfo, variables, null, true);
- } else {
- deleteArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- null, invalidArtifactUUID, errorInfo, variables, null, true);
-
- }
- // Invalid componentUUID
- if (componentTypeEnum.equals(ComponentTypeEnum.RESOURCE_INSTANCE)) {
- component.getComponentInstances().get(0).setNormalizedName("invalidNormalizedName");
- errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_INSTANCE_NOT_FOUND_ON_CONTAINER.name());
- variables = asList("invalidNormalizedName", ComponentTypeEnum.RESOURCE_INSTANCE.getValue().toLowerCase(), ComponentTypeEnum.SERVICE.getValue(), component.getName());
- deleteArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- component.getComponentInstances().get(0), artifactUUID, errorInfo, variables, LifeCycleStatesEnum.CHECKIN, true);
- } else {
- component.setUUID("invalidComponentUUID");
- if (componentTypeEnum.equals(ComponentTypeEnum.RESOURCE)) {
- errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.RESOURCE_NOT_FOUND.name());
- } else {
- errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.SERVICE_NOT_FOUND.name());
- }
- variables = asList("invalidComponentUUID");
- deleteArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- null, artifactUUID, errorInfo, variables, LifeCycleStatesEnum.CHECKIN, false);
- }
-
- }
-
- @DataProvider(name = "deleteArtifactOnAssetWhichInInvalidStateForUploading", parallel = true)
- public static Object[][] dataProviderDeleteArtifactOnAssetWhichInInvalidStateForUploading() {
- return new Object[][]{
- {ComponentTypeEnum.SERVICE, ArtifactTypeEnum.OTHER.getType()},
- };
- }
-
-
- @Test(dataProvider = "deleteArtifactOnAssetWhichInInvalidStateForUploading")
- public void deleteArtifactOnAssetWhichInInvalidStateForUploading(ComponentTypeEnum componentTypeEnum, String artifactType) throws Exception {
- getExtendTest().log(Status.INFO, String.format("componentTypeEnum: %s, artifactType: %s", componentTypeEnum, artifactType));
- Component component = uploadArtifactOnAssetViaExternalAPI(componentTypeEnum, LifeCycleStatesEnum.CHECKOUT, artifactType, null);
- component = AtomicOperationUtils.changeComponentState(component, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.STARTCERTIFICATION, true).getLeft();
-
- Map<String, ArtifactDefinition> deploymentArtifacts = getDeploymentArtifactsOfAsset(component, componentTypeEnum);
- String artifactUUID = null;
- for (String key : deploymentArtifacts.keySet()) {
- if (key.startsWith("ci")) {
- artifactUUID = deploymentArtifacts.get(key).getArtifactUUID();
- break;
- }
- }
- // Invalid artifactUUID
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_IN_CERT_IN_PROGRESS_STATE.name());
- List<String> variables = asList(component.getName(), component.getComponentType().toString().toLowerCase(), ElementFactory.getDefaultUser(UserRoleEnum.TESTER).getFirstName(),
- ElementFactory.getDefaultUser(UserRoleEnum.TESTER).getLastName(), ElementFactory.getDefaultUser(UserRoleEnum.TESTER).getUserId());
-
- if (componentTypeEnum.equals(ComponentTypeEnum.RESOURCE_INSTANCE)) {
- deleteArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- component.getComponentInstances().get(0), artifactUUID, errorInfo, variables, null, true);
- } else {
- deleteArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- null, artifactUUID, errorInfo, variables, null, true);
-
- }
-
- }
-
- @DataProvider(name = "deleteArtifactOfVfcVlCpForVfciVliCpiViaExternalAPI", parallel = true)
- public static Object[][] dataProviderDeleteArtifactOfVfcVlCpForVfciVliCpiViaExternalAPI() {
- return new Object[][]{
- {ResourceTypeEnum.VFC},
- {ResourceTypeEnum.VL},
- {ResourceTypeEnum.CP}
- };
- }
-
- // Verify that it cannot delete VFC/VL/CP artifact on VFCi/VLi/CPi - Failure flow
- @Test(dataProvider = "deleteArtifactOfVfcVlCpForVfciVliCpiViaExternalAPI")
- public void deleteArtifactOfVfcVlCpForVfciVliCpiViaExternalAPI(ResourceTypeEnum resourceTypeEnum) throws Exception {
-
- getExtendTest().log(Status.INFO, String.format("resourceTypeEnum: %s", resourceTypeEnum));
-
- Component resourceInstanceDetails = getComponentInTargetLifeCycleState(ComponentTypeEnum.RESOURCE.getValue(), UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, resourceTypeEnum);
- ArtifactReqDetails artifactReqDetails = ElementFactory.getArtifactByType("ci", ArtifactTypeEnum.SNMP_TRAP.getType(), true, false);
- uploadArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(resourceInstanceDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactReqDetails, 200);
- resourceInstanceDetails = AtomicOperationUtils.changeComponentState(resourceInstanceDetails, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- Component component = getComponentInTargetLifeCycleState(ComponentTypeEnum.RESOURCE.toString(), UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, null);
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceInstanceDetails, component, UserRoleEnum.DESIGNER, true).left().value();
- component = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, component.getName(), component.getVersion());
-
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.OK.name());
- Map<String, ArtifactDefinition> deploymentArtifacts;
- deploymentArtifacts = getDeploymentArtifactsOfAsset(component, ComponentTypeEnum.RESOURCE_INSTANCE);
- String artifactUUID = null;
- for (String key : deploymentArtifacts.keySet()) {
- if (key.startsWith("ci")) {
- artifactUUID = deploymentArtifacts.get(key).getArtifactUUID();
- break;
- }
- }
- List<String> variables = asList(artifactUUID);
- deleteArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER),
- component.getComponentInstances().get(0), artifactUUID, errorInfo, variables, null, true);
- }
-
- protected RestResponse deleteArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(Component component, User sdncModifierDetails,
- ComponentInstance componentInstance, String artifactUUID, ErrorInfo errorInfo, List<String> variables, LifeCycleStatesEnum lifeCycleStatesEnum, Boolean resourceNameInAudit) throws Exception {
- RestResponse restResponse;
-
- if (componentInstance != null) {
- restResponse = ArtifactRestUtils.externalAPIDeleteArtifactOfComponentInstanceOnAsset(component, sdncModifierDetails, componentInstance, artifactUUID);
- } else {
- restResponse = ArtifactRestUtils.externalAPIDeleteArtifactOfTheAsset(component, sdncModifierDetails, artifactUUID);
-
- }
-
- // validate response code
- Integer responseCode = restResponse.getErrorCode();
- Assert.assertEquals(responseCode, errorInfo.getCode(), "Response code is not correct.");
- return restResponse;
-
- }
-
-
- // Happy flow - get chosen life cycle state, artifact type and asset type
- // delete artifact via external API + check audit & response code
- protected Component deleteArtifactOnAssetViaExternalAPI(Component component, ComponentTypeEnum componentTypeEnum, LifeCycleStatesEnum chosenLifeCycleState) throws Exception {
- String artifactName = null;
- component = AtomicOperationUtils.changeComponentState(component, UserRoleEnum.DESIGNER, chosenLifeCycleState, true).getLeft();
- if (!LifeCycleStatesEnum.CHECKOUT.equals(chosenLifeCycleState)) {
- component = AtomicOperationUtils.getComponentObject(component, UserRoleEnum.DESIGNER);
- } else {
- component = getNewerVersionOfComponent(component, chosenLifeCycleState);
- }
- // get updated artifact data
- String artifactUUID = null;
- int moduleTypeArtifact = 0;
- Map<String, ArtifactDefinition> deploymentArtifacts = getDeploymentArtifactsOfAsset(component, componentTypeEnum);
-
- for (String key : deploymentArtifacts.keySet()) {
- if (key.startsWith("ci") && StringUtils.isNotEmpty(deploymentArtifacts.get(key).getArtifactUUID())) {
- artifactName = key;
- artifactUUID = deploymentArtifacts.get(key).getArtifactUUID();
-
- if (deploymentArtifacts.get(key).getArtifactType().equals(ArtifactTypeEnum.VF_MODULES_METADATA)) {
- moduleTypeArtifact = 1;
- }
- break;
- }
- }
-
- String componentVersionBeforeDelete = component.getVersion();
- int numberOfArtifact = deploymentArtifacts.size();
-
- // create component/s & upload artifact via external api
- if (ComponentTypeEnum.RESOURCE_INSTANCE == componentTypeEnum) {
- deleteArtifactOfRIIncludingValiditionOfAuditAndResponseCode(component, component.getComponentInstances().get(0), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactUUID, 200);
- } else {
- deleteArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactUUID, 200);
- }
-
- component = updateComponentDetailsByLifeCycleState(chosenLifeCycleState, component);
-
- // Get list of deployment artifact + download them via external API
- deploymentArtifacts = getDeploymentArtifactsOfAsset(component, componentTypeEnum);
- if (deploymentArtifacts.get(artifactName) != null) {
- Assert.assertTrue(false, "Expected that deleted artifact will not appear in deployment artifact list.");
- }
- if ((LifeCycleStatesEnum.CERTIFICATIONREQUEST.equals(chosenLifeCycleState)) && (ComponentTypeEnum.RESOURCE_INSTANCE.equals(componentTypeEnum)) && (!component.getComponentType().toString().equals(ComponentTypeEnum.RESOURCE.toString()))) {
- Assert.assertEquals(numberOfArtifact - 1 - moduleTypeArtifact, deploymentArtifacts.keySet().size(), "Expected that number of deployment artifact (one deleted and one vfmodule) will decrease by two.");
- } else {
- Assert.assertEquals(numberOfArtifact - 1, deploymentArtifacts.keySet().size(), "Expected that number of deployment artifact will decrease by one.");
- }
-
- if (chosenLifeCycleState == LifeCycleStatesEnum.CHECKOUT) {
- Assert.assertEquals(componentVersionBeforeDelete, component.getVersion(), "Expected that check-out component will not change version number.");
- } else {
- Assert.assertEquals(String.format("%.1f", (Double.parseDouble(componentVersionBeforeDelete) + 0.1)), component.getVersion(), "Expected that non check-out component version will increase by 0.1.");
- }
-
- downloadResourceDeploymentArtifactExternalAPI(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactUUID, componentTypeEnum);
-
- return component;
- }
-
- // Delete artifact via external API + Check auditing for upload operation + Check response of external API
- protected RestResponse deleteArtifactOfRIIncludingValiditionOfAuditAndResponseCode(Component component, ComponentInstance componentInstance, User sdncModifierDetails, String artifactUUID, Integer expectedResponseCode) throws Exception {
- RestResponse restResponse = ArtifactRestUtils.externalAPIDeleteArtifactOfComponentInstanceOnAsset(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), component.getComponentInstances().get(0), artifactUUID);
-
- // Check response of external API
- Integer responseCode = restResponse.getErrorCode();
- Assert.assertEquals(responseCode, expectedResponseCode, "Response code is not correct.");
-// component = AtomicOperationUtils.getComponentObject(component, UserRoleEnum.DESIGNER);
- return restResponse;
- }
-
-
- // Delete artifact via external API + Check auditing for upload operation + Check response of external API
- protected RestResponse deleteArtifactOfAssetIncludingValiditionOfAuditAndResponseCode(Component component, User sdncModifierDetails, String artifactUUID, Integer expectedResponseCode) throws Exception {
- RestResponse restResponse = ArtifactRestUtils.externalAPIDeleteArtifactOfTheAsset(component, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), artifactUUID);
-
- // Check response of external API
- Integer responseCode = restResponse.getErrorCode();
- Assert.assertEquals(responseCode, expectedResponseCode, "Response code is not correct.");
-// component = AtomicOperationUtils.getComponentObject(component, UserRoleEnum.DESIGNER);
- return restResponse;
- }
-
-
- // download deployment via external api + check response code for success (200) + get artifactReqDetails and verify payload + verify audit
- protected RestResponse downloadResourceDeploymentArtifactExternalAPI(Component component, User sdncModifierDetails, String artifactUUID, ComponentTypeEnum componentTypeEnum) throws Exception {
- RestResponse restResponse;
-
- if (componentTypeEnum == ComponentTypeEnum.RESOURCE_INSTANCE) {
- restResponse = ArtifactRestUtils.getComponentInstanceDeploymentArtifactExternalAPI(component.getUUID(), component.getComponentInstances().get(0).getNormalizedName(), artifactUUID, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), component.getComponentType().toString());
- } else {
- restResponse = ArtifactRestUtils.getResourceDeploymentArtifactExternalAPI(component.getUUID(), artifactUUID, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), component.getComponentType().toString());
- }
-
- Integer responseCode = restResponse.getErrorCode();
- Integer expectedCode = 404;
- Assert.assertEquals(responseCode, expectedCode, "Response code is not correct.");
-
- return restResponse;
-
- }
-
-
- public Component getComponentInTargetLifeCycleState(String componentType, UserRoleEnum creatorUser, LifeCycleStatesEnum targetLifeCycleState, ResourceTypeEnum resourceTypeEnum) throws Exception {
- Component resourceDetails = null;
-
- if ((componentType.toLowerCase().equals("vf")) || (componentType.toLowerCase().equals("resource"))) {
- if (resourceTypeEnum == null) {
- resourceTypeEnum = ResourceTypeEnum.VF;
- }
- Either<Resource, RestResponse> createdResource = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(resourceTypeEnum, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, creatorUser, true);
- resourceDetails = createdResource.left().value();
- resourceDetails = AtomicOperationUtils.changeComponentState(resourceDetails, creatorUser, targetLifeCycleState, true).getLeft();
- } else {
- Either<Service, RestResponse> createdResource = AtomicOperationUtils.createDefaultService(creatorUser, true);
- resourceDetails = createdResource.left().value();
- // Add artifact to service if asked for certifcationrequest - must be at least one artifact for the flow
- if ((LifeCycleStatesEnum.CERTIFICATIONREQUEST == targetLifeCycleState) || (LifeCycleStatesEnum.STARTCERTIFICATION == targetLifeCycleState)) {
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.OTHER, resourceDetails, UserRoleEnum.DESIGNER, true, true).left().value();
- }
- resourceDetails = AtomicOperationUtils.changeComponentState(resourceDetails, creatorUser, targetLifeCycleState, true).getLeft();
- }
- return resourceDetails;
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/DeploymentValiditaion.java b/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/DeploymentValiditaion.java
deleted file mode 100644
index de2b40868d..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/DeploymentValiditaion.java
+++ /dev/null
@@ -1,322 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.externalApis;
-
-import com.aventstack.extentreports.Status;
-import org.apache.commons.io.FileUtils;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.be.model.category.CategoryDefinition;
-import org.openecomp.sdc.be.model.category.SubCategoryDefinition;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.datatypes.PropertyReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-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.CatalogRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.CategoryRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Test;
-import org.yaml.snakeyaml.Yaml;
-
-import java.io.File;
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.util.*;
-import java.util.stream.Collectors;
-
-import static org.testng.AssertJUnit.assertTrue;
-
-public class DeploymentValiditaion extends ComponentBaseTest{
-
- @Rule
- public static TestName name = new TestName();
-// These tests should run in executable jar only on deployed environment
- public DeploymentValiditaion() {
- super(name, DeploymentValiditaion.class.getName());
- }
-
- protected final static String categoryFilterKey = "category";
- protected final static String subCategoryFilterKey = "subCategory";
- protected String attVersionStr ;
- protected String pathPrefix;
-
-
- public static List<File> listf(String directoryName) {
- File directory = new File(directoryName);
-
- List<File> resultList = new ArrayList<>();
-
- // get all the files from a directory
- File[] fList = directory.listFiles();
- resultList.addAll(Arrays.asList(fList));
- for (File file : fList) {
- if (file.isFile()) {
- System.out.println(file.getAbsolutePath());
- } else if (file.isDirectory()) {
- resultList.addAll(listf(file.getAbsolutePath()));
- }
- }
- //System.out.println(fList);
- return resultList;
- }
- @BeforeTest
- public void beforeTest() throws Exception{
- RestResponse attVersion = CatalogRestUtils.getOsVersion();
- attVersionStr = ResponseParser.getVersionFromResponse(attVersion);
- pathPrefix = File.separator+"opt"+File.separator+"app"+File.separator+"asdc_kits"+File.separator+"catalog-be-"+attVersionStr+File.separator+"import"+File.separator+"tosca"+File.separator;
- }
-
- /*@Test
- public void pasrseNormativies() throws Exception{
-
-
- String path = pathPrefix+"normative-types";
- String path2 = pathPrefix+"heat-types";
-
- List<File> yamlList1 = getYamlFilesList(path);
- List<String> nodeNamesFromYamlList1 = getNodeNamesFromYamlList(yamlList1);
- List<File> yamlList2 = getYamlFilesList(path2);
- List<String> nodeNamesFromYamlList2 = getNodeNamesFromYamlList(yamlList2);
-
-
- List<String> expectedList = new ArrayList<>();
- expectedList.addAll(nodeNamesFromYamlList1);
- expectedList.addAll(nodeNamesFromYamlList2);
- System.out.println("list of normatives from files:::::::::::");
- expectedList.forEach(System.out::println);
- getExtendTest().log(Status.INFO, "list of normatives from files:");
- getExtendTest().log(Status.INFO,expectedList.toString());
-
- String[] filter = { categoryFilterKey + "=" + ResourceCategoryEnum.GENERIC_ABSTRACT.getCategory(), subCategoryFilterKey + "=" + ResourceCategoryEnum.GENERIC_ABSTRACT.getSubCategory() };
- RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.RESOURCES);
- Map<String, String> resourceAssetList = AssetRestUtils.getResourceAssetMap(assetResponse);
- Map<String, String> resourceListFiltteredByWholeVersion = AssetRestUtils.getResourceListFiltteredByWholeVersion(resourceAssetList);
- List<String> resourceToscaNamesList = AssetRestUtils.getResourceObjectByNameAndVersionToscaNamesList(resourceListFiltteredByWholeVersion);
- System.out.println("list of normatives from APIs:::::::::::");
- resourceToscaNamesList.forEach(System.out::println);
- getExtendTest().log(Status.INFO, "list of normatives from APIs:");
- getExtendTest().log(Status.INFO, resourceToscaNamesList.toString());
-
- boolean good = true;
- List<String> missingNormatives = new ArrayList<>();
-
- for (int i = 0; i < expectedList.size(); i ++) {
- if (!resourceToscaNamesList.contains(expectedList.get(i))) {
- good = false;
- missingNormatives.add(expectedList.get(i));
- }
- }
-
- System.out.println("<<<<<<<<<MISSING NORMATIVES>>>>>>");
- missingNormatives.forEach(System.out::println);
- getExtendTest().log(Status.INFO, "MISSING NORMATIVES:");
- getExtendTest().log(Status.INFO, missingNormatives.toString());
-
- assertTrue("missing normatives ", good);
-
- }*/
-
-
- public List<String> getNodeNamesFromYamlList(List<File> yamlList) throws IOException {
- List<String> nodeNameList = new ArrayList<>();
-
- for (File file : yamlList) {
- String content = new String(Files.readAllBytes(Paths.get(file.getPath())), StandardCharsets.UTF_8);
- Yaml yaml = new Yaml();
- Map<String, Object> load = (Map<String, Object>) yaml.load(content);
- Map<String, Object> topology_template = (Map<String, Object>) load.get("node_types");
-// String string = topology_template.keySet().toString().replaceAll("tosca.nodes.", "");
- String string = topology_template.keySet().iterator().next().toString();
- System.out.println(string +" -----> " +file.getPath());
- nodeNameList.add(string);
- }
- return nodeNameList;
- }
-
-
- public List<File> getYamlFilesList(String path) throws IOException {
- List<File> yamlList = new ArrayList<>();
- File dir = new File(path);
- String[] extensions = new String[] { "yml" };
- System.out.println("Getting all .yml files in " + dir.getCanonicalPath()
- + " including those in subdirectories");
- List<File> files = (List<File>) FileUtils.listFiles(dir, extensions, true);
- for (File file : files) {
- System.out.println("file: " + file.getCanonicalPath());
- yamlList.add(file);
- }
- return yamlList;
- }
-
- @Test
- public void pasrseDataTypes() throws Exception{
-
- String path = pathPrefix+"data-types"+File.separator+"dataTypes.yml";
- String content = new String(Files.readAllBytes(Paths.get(path)), StandardCharsets.UTF_8);
-
- Yaml yaml = new Yaml();
- Map<String, Object> load = (Map<String, Object>) yaml.load(content);
- List<String> listOfDataTypes = new ArrayList<>();
- listOfDataTypes.addAll(load.keySet());
- System.out.println("<<<<<<<< List of Data Types >>>>>>>>>");
- listOfDataTypes.forEach(System.out::println);
- getExtendTest().log(Status.INFO, "List of Data Types:");
- getExtendTest().log(Status.INFO, listOfDataTypes.toString());
-
- Resource resource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
- PropertyReqDetails defaultProperty = ElementFactory.getDefaultListProperty();
-
- defaultProperty.setPropertyDefaultValue(null);
- for (String dataType : listOfDataTypes) {
- defaultProperty.setPropertyType(dataType);
- defaultProperty.setName(dataType);
- System.out.println("Adding proporty with data type: ----> " + dataType);
- getExtendTest().log(Status.INFO, "Adding proporty with data type: ----> " + dataType);
- AtomicOperationUtils.addCustomPropertyToResource(defaultProperty, resource, UserRoleEnum.DESIGNER, true);
- }
-
- listOfDataTypes.forEach(System.out::println);
-
- }
-
- @Test
- public void pasrseCategories() throws Exception{
-
- String path = pathPrefix+"categories"+File.separator+"categoryTypes.yml";
- String content = new String(Files.readAllBytes(Paths.get(path)), StandardCharsets.UTF_8);
-
- List<String> serviceCategories = new ArrayList<>();
- List<String> resourceCategories = new ArrayList<>();
-
- Yaml yaml = new Yaml();
- Map<String, Object> load = (Map<String, Object>) yaml.load(content);
- Map<String, Map> services = (Map<String, Map>) load.get("services");
- Map<String, Map> resources = (Map<String, Map>) load.get("resources");
-
- Map<String, List<String>> resourcesListFromFile = new HashMap<>() ;
-
- //retrieve subcategories
- for ( String resourceCategoryName : resources.keySet()) {
- Map<String, Map> subcategory = (Map) resources.get(resourceCategoryName).get("subcategories");
-
- resourceCategories = new ArrayList<String>();
- for (String subcategoryName : subcategory.keySet()) {
- String name = (String) subcategory.get(subcategoryName).get("name");
- resourceCategories.add(name);
- }
- resourcesListFromFile.put(resources.get(resourceCategoryName).get("name").toString(), resourceCategories);
- }
-
- System.out.println(resourcesListFromFile.toString());
- getExtendTest().log(Status.INFO, "Expected categories:");
- getExtendTest().log(Status.INFO, resourcesListFromFile.toString());
-
- //retrieve service categories
-// for ( String serviceCategoryName : services.keySet()) {
-// String name = (String) services.get(serviceCategoryName).get("name");
-// serviceCategories.add(name);
-// }
-// serviceCategories.forEach(System.out::println);
-
- //retrieve resource list from URL
-
- Map<String, List<CategoryDefinition>> categoriesMap = getCategories();
- List<CategoryDefinition> resourceSubCategories = categoriesMap.get(ComponentTypeEnum.RESOURCE_PARAM_NAME);
- List<SubCategoryDefinition> subcategories;
- for (CategoryDefinition categoryDefinition : resourceSubCategories) {
- subcategories = categoryDefinition.getSubcategories();
- }
-// subcategories.stream().collect(toMap(i -> i, i -> items.get(i)));
-
-// resourceSubCategories.stream().collect(
-// Collectors.groupingBy(CategoryDefinition::getName, Collectors.groupingBy(SubCategoryDefinition::getName)));
-
-// resourceSubCategories.stream().filter(p->p.getSubcategories()).map(m->m.getName()).collect(Collectors.toList()).collect(Collectors.toMap(CategoryDefinition::getName,m));
-
-
- Map<String, List<String>> resourceMapFromUrl = resourceSubCategories.stream().collect(Collectors.toMap( e -> e.getName() , e -> e.getSubcategories().stream().map(e1 -> e1.getName()).collect(Collectors.toList())));
-
- getExtendTest().log(Status.INFO, "Actual categories:");
- getExtendTest().log(Status.INFO, resourceMapFromUrl.toString());
-
-
- assertTrue("missing categories ", resourceMapFromUrl.keySet().containsAll(resourcesListFromFile.keySet()));
-
- }
-
-
- public Map<String, List<CategoryDefinition>> getCategories() throws Exception {
-
- User defaultAdminUser = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-
- Map<String,List<CategoryDefinition>> map = new HashMap<String,List<CategoryDefinition>>();
-
-
- RestResponse allResourceCategories = CategoryRestUtils.getAllCategories(defaultAdminUser, ComponentTypeEnum.RESOURCE_PARAM_NAME);
- RestResponse allServiceCategories = CategoryRestUtils.getAllCategories(defaultAdminUser, ComponentTypeEnum.SERVICE_PARAM_NAME);
-
- List<CategoryDefinition> parsedResourceCategories = ResponseParser.parseCategories(allResourceCategories);
- List<CategoryDefinition> parsedServiceCategories = ResponseParser.parseCategories(allServiceCategories);
-
- map.put(ComponentTypeEnum.RESOURCE_PARAM_NAME, parsedResourceCategories);
- map.put(ComponentTypeEnum.SERVICE_PARAM_NAME, parsedServiceCategories);
-
- return map;
- }
-
-
-
-/* @Test (enabled=false)
- public void pasrseCategoriesClass2() throws IOException{
-
- String path = "C:\\Git_work\\Git_UGN\\d2-sdnc\\catalog-be\\src\\main\\resources\\import\\tosca\\categories\\categoryTypes.yml";
-
- FileReader reader = new FileReader(path);
- Yaml yaml=new Yaml();
-
-
- Map<?, ?> map = (Map<?, ?>) yaml.load(reader);
-
- Collection<Map> values = (Collection<Map>) map.values();
- for (Map map2 : values) {
- Collection values2 = map2.values();
- for (Object object : values2) {
-
-
- }
- }
-
- List<Object> collect = values.stream().map(e -> e.get("name")).collect(Collectors.toList());
-
-// resourcesArrayList.stream().filter(s -> s.getName().toLowerCase().startsWith("ci") && !s.getName().toLowerCase().equals("cindervolume")).map(e -> e.getUniqueId()).collect(Collectors.toList()).forEach((i)
-
- }*/
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/GetAssetServlet.java b/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/GetAssetServlet.java
deleted file mode 100644
index bddc06169a..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/GetAssetServlet.java
+++ /dev/null
@@ -1,290 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.externalApis;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.gson.Gson;
-import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.io.IOUtils;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClients;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.datatypes.elements.ConsumerDataDefinition;
-import org.openecomp.sdc.be.datatypes.enums.AssetTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.ArtifactUiDownloadData;
-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.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.api.Urls;
-import org.openecomp.sdc.ci.tests.datatypes.*;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-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.ArtifactRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.AssetRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
-import org.openecomp.sdc.common.api.Constants;
-import org.testng.annotations.Test;
-
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import static org.testng.AssertJUnit.assertEquals;
-
-public class GetAssetServlet extends ComponentBaseTest {
-
- protected User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- protected User sdncAdminUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- protected ConsumerDataDefinition consumerDataDefinition;
-
- @Rule
- public static TestName name = new TestName();
-
- public GetAssetServlet() {
- super(name, GetAssetServlet.class.getName());
- }
-
- Gson gson = new Gson();
-
-// @BeforeMethod
-// public void setup() throws Exception {
-//
-// AtomicOperationUtils.createDefaultConsumer(true);
-//
-// }
-
- @Test // (enabled = false)
- public void getResourceAssetSuccess() throws Exception {
-
-// CassandraUtils.truncateAllKeyspaces();
- List<String> expectedAssetNamesList = new ArrayList<>();
- ResourceReqDetails resourceDetails = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, sdncUserDetails);
- Resource resource = AtomicOperationUtils.createResourceByResourceDetails(resourceDetails, UserRoleEnum.DESIGNER, true).left().value();
- expectedAssetNamesList.add(resourceDetails.getName());
-
- resourceDetails = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, sdncUserDetails);
- resource = AtomicOperationUtils.createResourceByResourceDetails(resourceDetails, UserRoleEnum.DESIGNER, true).left().value();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- expectedAssetNamesList.add(resourceDetails.getName());
-
- resourceDetails = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, sdncUserDetails);
- resource = AtomicOperationUtils.createResourceByResourceDetails(resourceDetails, UserRoleEnum.DESIGNER, true).left().value();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- expectedAssetNamesList.add(resourceDetails.getName());
-
- resourceDetails = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, sdncUserDetails);
- resource = AtomicOperationUtils.createResourceByResourceDetails(resourceDetails, UserRoleEnum.DESIGNER, true).left().value();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- expectedAssetNamesList.add(resourceDetails.getName());
-
- resourceDetails = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, sdncUserDetails);
- resource = AtomicOperationUtils.createResourceByResourceDetails(resourceDetails, UserRoleEnum.DESIGNER, true).left().value();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- expectedAssetNamesList.add(resourceDetails.getName());
-
- resourceDetails = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, sdncUserDetails);
- resource = AtomicOperationUtils.createResourceByResourceDetails(resourceDetails, UserRoleEnum.DESIGNER, true).left().value();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.STARTCERTIFICATION, true).getLeft();
- expectedAssetNamesList.add(resourceDetails.getName());
-
-/* resourceDetails = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, sdncUserDetails);
- resource = AtomicOperationUtils.createResourceByResourceDetails(resourceDetails, UserRoleEnum.DESIGNER, true).left().value();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFICATIONREQUEST, true).getLeft();
- expectedAssetNamesList.add(resourceDetails.getName());*/
-
- System.out.println("6 VF resources were created");
-
- RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.RESOURCES);
- BaseRestUtils.checkSuccess(assetResponse);
-
- List<ResourceAssetStructure> resourceAssetList = AssetRestUtils.getResourceAssetList(assetResponse);
- List<String> getActualAssetNamesList = AssetRestUtils.getResourceNamesList(resourceAssetList);
- Utils.compareArrayLists(getActualAssetNamesList, expectedAssetNamesList, "Element");
-
- AssetRestUtils.checkComponentTypeInObjectList(resourceAssetList, ComponentTypeEnum.RESOURCE);
-
- /* // Validate audit message
- ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultAssetListAudit(AssetTypeEnum.RESOURCES, AuditingActionEnum.GET_ASSET_LIST);
- Map <AuditingFieldsKey, String> body = new HashMap<>();
- body.put(AuditingFieldsKey.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
- AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_ASSET_LIST.getName(), body);*/
-
- }
-
- @Test // (enabled = false)
- public void getServiceAssetSuccess() throws Exception {
-
-// CassandraUtils.truncateAllKeyspaces();
- List<String> expectedAssetNamesList = new ArrayList<>();
- ArtifactReqDetails artifactDetails = ElementFactory.getArtifactByType(ArtifactTypeEnum.OTHER, ArtifactTypeEnum.OTHER, true);
-
- ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
- Service service = AtomicOperationUtils.createCustomService(serviceDetails, UserRoleEnum.DESIGNER, true).left().value();
- expectedAssetNamesList.add(serviceDetails.getName());
-
- serviceDetails = ElementFactory.getDefaultService();
- service = AtomicOperationUtils.createCustomService(serviceDetails, UserRoleEnum.DESIGNER, true).left().value();
- RestResponse addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(artifactDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), service.getUniqueId());
- BaseRestUtils.checkSuccess(addInformationalArtifactToService);
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- expectedAssetNamesList.add(serviceDetails.getName());
-
- serviceDetails = ElementFactory.getDefaultService();
- service = AtomicOperationUtils.createCustomService(serviceDetails, UserRoleEnum.DESIGNER, true).left().value();
- addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(artifactDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), service.getUniqueId());
- BaseRestUtils.checkSuccess(addInformationalArtifactToService);
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- expectedAssetNamesList.add(serviceDetails.getName());
-
- serviceDetails = ElementFactory.getDefaultService();
- service = AtomicOperationUtils.createCustomService(serviceDetails, UserRoleEnum.DESIGNER, true).left().value();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- expectedAssetNamesList.add(serviceDetails.getName());
-
- serviceDetails = ElementFactory.getDefaultService();
- service = AtomicOperationUtils.createCustomService(serviceDetails, UserRoleEnum.DESIGNER, true).left().value();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- expectedAssetNamesList.add(serviceDetails.getName());
-
- serviceDetails = ElementFactory.getDefaultService();
- service = AtomicOperationUtils.createCustomService(serviceDetails, UserRoleEnum.DESIGNER, true).left().value();
- addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(artifactDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), service.getUniqueId());
- BaseRestUtils.checkSuccess(addInformationalArtifactToService);
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.STARTCERTIFICATION, true).getLeft();
- expectedAssetNamesList.add(serviceDetails.getName());
-
- serviceDetails = ElementFactory.getDefaultService();
- service = AtomicOperationUtils.createCustomService(serviceDetails, UserRoleEnum.DESIGNER, true).left().value();
- addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(artifactDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), service.getUniqueId());
- BaseRestUtils.checkSuccess(addInformationalArtifactToService);
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFICATIONREQUEST, true).getLeft();
- expectedAssetNamesList.add(serviceDetails.getName());
-
- System.out.println("7 Services were created");
-
- RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.SERVICES);
- BaseRestUtils.checkSuccess(assetResponse);
-
- List<ServiceAssetStructure> serviceAssetList = AssetRestUtils.getServiceAssetList(assetResponse);
- List<String> getActualAssetNamesList = AssetRestUtils.getServiceNamesList(serviceAssetList);
- Utils.compareArrayLists(getActualAssetNamesList, expectedAssetNamesList, "Element");
-
- /*// Validate audit message
- ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultAssetListAudit(AssetTypeEnum.SERVICES, AuditingActionEnum.GET_ASSET_LIST);
- Map <AuditingFieldsKey, String> body = new HashMap<>();
- body.put(AuditingFieldsKey.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
- AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_ASSET_LIST.getName(), body);*/
-
- }
-
- @Test(enabled = true)
- public void getToscaModelSuccess() throws Exception {
-
- Resource resource;
- HttpResponse assetResponse;
- HttpResponse response;
- InputStream inputStream;
- ArtifactUiDownloadData artifactUiDownloadData;
- int len;
- byte[] res;
- byte[] fromUiDownload;
- String fileName;
- try (CloseableHttpClient httpclient = HttpClients.createDefault()) {
- ResourceReqDetails resourceDetails = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, sdncUserDetails);
- resource = AtomicOperationUtils.createResourceByResourceDetails(resourceDetails, UserRoleEnum.DESIGNER, true).left().value();
- assetResponse = AssetRestUtils.getComponentToscaModel(AssetTypeEnum.RESOURCES, resource.getUUID());
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- String artId = resource.getToscaArtifacts().get("assettoscacsar").getEsId();
- String url = String.format(Urls.UI_DOWNLOAD_RESOURCE_ARTIFACT, config.getCatalogBeHost(), config.getCatalogBePort(), resource.getUniqueId(), artId);
- HttpGet httpGet = createGetRequest(url);
- response = httpclient.execute(httpGet);
- }
- inputStream = response.getEntity().getContent();
- artifactUiDownloadData = getArtifactUiDownloadData(IOUtils.toString(inputStream));
- assetResponse = AssetRestUtils.getComponentToscaModel(AssetTypeEnum.RESOURCES, resource.getUUID());
- inputStream = assetResponse.getEntity().getContent();
- len = (int) assetResponse.getEntity().getContentLength();
- res = new byte[len];
- inputStream.read(res, 0, len);
- fromUiDownload = artifactUiDownloadData.getBase64Contents().getBytes();
- assertEquals(Base64.encodeBase64(res), fromUiDownload);
- fileName = assetResponse.getFirstHeader(Constants.CONTENT_DISPOSITION_HEADER).getValue();
- assertEquals(fileName, new StringBuilder().append("attachment; filename=\"")
- .append(artifactUiDownloadData.getArtifactName()).append("\"").toString());
- }
-
-
- private HttpGet createGetRequest(String url) {
- HttpGet httpGet = new HttpGet(url);
- httpGet.addHeader(HttpHeaderEnum.USER_ID.getValue(), sdncUserDetails.getUserId());
- return httpGet;
- }
-
- private ArtifactUiDownloadData getArtifactUiDownloadData(String artifactUiDownloadDataStr) throws Exception {
-
- ObjectMapper mapper = new ObjectMapper();
- try {
- ArtifactUiDownloadData artifactUiDownloadData = mapper.readValue(artifactUiDownloadDataStr, ArtifactUiDownloadData.class);
- return artifactUiDownloadData;
- } catch (Exception e) {
- e.printStackTrace();
- }
- return null;
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/GetCSARofVF.java b/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/GetCSARofVF.java
deleted file mode 100644
index 57c678efc7..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/GetCSARofVF.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.externalApis;
-
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.datatypes.enums.AssetTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.Component;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.model.Service;
-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.LifeCycleStatesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.AssetRestUtils;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipException;
-import java.util.zip.ZipFile;
-
-import static org.testng.AssertJUnit.assertTrue;
-
-public class GetCSARofVF extends ComponentBaseTest {
-
-// protected User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
-// protected User sdncAdminUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-// protected ConsumerDataDefinition consumerDataDefinition;
-
- @Rule
- public static TestName name = new TestName();
-
- public GetCSARofVF() {
- super(name, GetCSARofVF.class.getName());
- }
-
-// Gson gson = new Gson();
-
- @BeforeMethod
- public void setup() throws Exception {
-
-// AtomicOperationUtils.createDefaultConsumer(true);
-// CassandraUtils.truncateAllKeyspaces();
-
-
- }
-
- @Test
- public void getResourceToscaModelCheckOutState() throws Exception {
-
-
- Resource resource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
-
-// HttpResponse componentToscaModel = AssetRestUtils.getComponentToscaModel(AssetTypeEnum.RESOURCES, resource.getUUID());
- File toscaModelCsarFile = AssetRestUtils.getToscaModelCsarFile(AssetTypeEnum.RESOURCES, resource.getUUID());
-
- // validate tosca structure
- validateCsarContent(resource, toscaModelCsarFile);
-
- /* // Validate audit message
- validateAudit(resource);*/
-
- }
-
-
-
- @Test
- public void getResourceToscaModelCheckInState() throws Exception {
-
- Resource resource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
-
- AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
-
-// HttpResponse componentToscaModel = AssetRestUtils.getComponentToscaModel(AssetTypeEnum.RESOURCES, resource.getUUID());
- File toscaModelCsarFile = AssetRestUtils.getToscaModelCsarFile(AssetTypeEnum.RESOURCES, resource.getUUID());
-
- // validate tosca structure
- validateCsarContent(resource, toscaModelCsarFile);
-
- /*// Validate audit message
- validateAudit(resource);*/
-
- }
-
- @Test
- public void getRsourceToscaModelCertifyState() throws Exception {
-
- Resource resource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
-
- AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
-
-// HttpResponse componentToscaModel = AssetRestUtils.getComponentToscaModel(AssetTypeEnum.RESOURCES, resource.getUUID());
- File toscaModelCsarFile = AssetRestUtils.getToscaModelCsarFile(AssetTypeEnum.RESOURCES, resource.getUUID());
-
- // validate tosca structure
- validateCsarContent(resource, toscaModelCsarFile);
-
- /*// Validate audit message
- validateAudit(resource);*/
-
- }
-
-
- @Test
- public void getServiceToscaModelCheckOutState() throws Exception {
-
- Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
-
-// HttpResponse componentToscaModel = AssetRestUtils.getComponentToscaModel(AssetTypeEnum.RESOURCES, resource.getUUID());
- File toscaModelCsarFile = AssetRestUtils.getToscaModelCsarFile(AssetTypeEnum.SERVICES, service.getUUID());
-
- // validate tosca structure
- validateCsarContent(service, toscaModelCsarFile);
-
- /*validateAudit(service);*/
-
- }
-
- @Test
- public void getServiceToscaModelCheckInState() throws Exception {
-
- Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
-
- AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
-
-// HttpResponse componentToscaModel = AssetRestUtils.getComponentToscaModel(AssetTypeEnum.RESOURCES, resource.getUUID());
- File toscaModelCsarFile = AssetRestUtils.getToscaModelCsarFile(AssetTypeEnum.SERVICES, service.getUUID());
-
- // validate tosca structure
- validateCsarContent(service, toscaModelCsarFile);
-
- /*validateAudit(service);*/
-
- }
-
- @Test
- public void getServiceToscaModelCertifyState() throws Exception {
-
- Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.OTHER, service, UserRoleEnum.DESIGNER, true, true);
- AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true);
-
-// HttpResponse componentToscaModel = AssetRestUtils.getComponentToscaModel(AssetTypeEnum.RESOURCES, resource.getUUID());
- File toscaModelCsarFile = AssetRestUtils.getToscaModelCsarFile(AssetTypeEnum.SERVICES, service.getUUID());
-
- // validate tosca structure
- validateCsarContent(service, toscaModelCsarFile);
-
- /*validateAudit(service);*/
-
- }
-
-
- /**
- * all files in list(expectedDefinitionFolderFileList) must be found in csar file
- * @param resource
- * @param toscaModelCsarFile
- * @throws ZipException
- * @throws IOException
- */
- public void validateCsarContent(Component resource, File toscaModelCsarFile) throws ZipException, IOException {
- ZipFile zipFile = new ZipFile(toscaModelCsarFile);
- List<String> expectedDefinitionFolderFileList = new ArrayList<String>();
- expectedDefinitionFolderFileList.add("Definitions/"+ resource.getComponentType().getValue().toLowerCase()+"-"+ resource.getSystemName()+"-template.yml");
- expectedDefinitionFolderFileList.add("Definitions/"+ resource.getComponentType().getValue().toLowerCase()+"-"+ resource.getSystemName()+"-template-interface.yml");
- expectedDefinitionFolderFileList.add("Definitions/relationships.yml");
- expectedDefinitionFolderFileList.add("Definitions/policies.yml");
- expectedDefinitionFolderFileList.add("Definitions/nodes.yml");
- expectedDefinitionFolderFileList.add("Definitions/interfaces.yml");
- expectedDefinitionFolderFileList.add("Definitions/groups.yml");
- expectedDefinitionFolderFileList.add("Definitions/data.yml");
- expectedDefinitionFolderFileList.add("Definitions/capabilities.yml");
- expectedDefinitionFolderFileList.add("Definitions/artifacts.yml");
- expectedDefinitionFolderFileList.add("Definitions/annotations.yml");
-
- Enumeration<? extends ZipEntry> entries = zipFile.entries();
- while(entries.hasMoreElements()){
- ZipEntry nextElement = entries.nextElement();
- if (!(nextElement.getName().contains("Artifacts")||nextElement.getName().contains("csar.meta"))){
-// assertTrue("missing file in csar template", (nextElement.getName().equals("TOSCA-Metadata/TOSCA.meta") ||
-// nextElement.getName().equals("Definitions/"+ resource.getComponentType().getValue().toLowerCase()+"-"+ resource.getSystemName()+"-template.yml")) ||
-// nextElement.getName().equals("Definitions/"+ resource.getComponentType().getValue().toLowerCase()+"-"+ resource.getSystemName()+"-template-interface.yml"));
- if(expectedDefinitionFolderFileList.contains(nextElement.getName())){
- expectedDefinitionFolderFileList.remove(nextElement.getName());
- }
- }
- }
- zipFile.close();
- assertTrue("missing files in csar template definitions folder", expectedDefinitionFolderFileList.size() == 0);
- }
-
- /*public void validateAudit(Component resource) throws Exception {
- ExpectedExternalAudit expectedAudit = null;
- if (resource.getComponentType().equals(ComponentTypeEnum.RESOURCE)){
- expectedAudit = ElementFactory.getDefaultExternalAuditObject(AssetTypeEnum.RESOURCES, AuditingActionEnum.GET_TOSCA_MODEL, ("/" + resource.getUUID() + "/toscaModel"));
- }
- else expectedAudit = ElementFactory.getDefaultExternalAuditObject(AssetTypeEnum.SERVICES, AuditingActionEnum.GET_TOSCA_MODEL, ("/" + resource.getUUID() + "/toscaModel"));
- expectedAudit.setRESOURCE_NAME(resource.getName());
- expectedAudit.setSERVICE_INSTANCE_ID(resource.getUUID());
- expectedAudit.setRESOURCE_TYPE(resource.getComponentType().getValue());
-// AuditValidationUtils.validateExternalAudit(expectedAudit, AuditingActionEnum.GET_TOSCA_MODEL.getName(), null);
-
- Map <AuditingFieldsKey, String> body = new HashMap<>();
- body.put(AuditingFieldsKey.AUDIT_RESOURCE_NAME, expectedAudit.getRESOURCE_NAME());
- AuditValidationUtils.validateExternalAudit(expectedAudit, AuditingActionEnum.GET_TOSCA_MODEL.getName(), body);
-
- }*/
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/GetFilteredAssetServlet.java b/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/GetFilteredAssetServlet.java
deleted file mode 100644
index 94d1047ddb..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/GetFilteredAssetServlet.java
+++ /dev/null
@@ -1,587 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.externalApis;
-
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.datatypes.enums.AssetTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.DistributionStatusEnum;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.model.Service;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.datatypes.*;
-import org.openecomp.sdc.ci.tests.datatypes.enums.*;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-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.*;
-import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.annotations.Test;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertNotNull;
-
-public class GetFilteredAssetServlet extends ComponentBaseTest {
-
- private static Logger log = LoggerFactory.getLogger(GetAssetServlet.class.getName());
- protected final static String categoryFilterKey = "category";
- protected final static String subCategoryFilterKey = "subCategory";
- protected final static String distributionStatusFilterKey = "distributionStatus";
- protected final static String serviceKey = "service";
- protected final static String resourceKey = "resource";
- protected final static String resourceType = "resourceType";
- protected final static String validFilterParameters = "[" + resourceType + ", "+ subCategoryFilterKey + ", " + categoryFilterKey + "]";
-
- @Rule
- public static TestName name = new TestName();
-
- public GetFilteredAssetServlet() {
- super(name, GetFilteredAssetServlet.class.getName());
- }
-
-// @BeforeMethod
-// public void setup() throws Exception {
-// AtomicOperationUtils.createDefaultConsumer(true);
-// }
-
- // RESOURCE
- // Success
-
- @Test // (enabled = false)
- public void getResourceAssetBySpecifiedCategory() throws Exception {
- String[] filter = { categoryFilterKey + "=" + ResourceCategoryEnum.GENERIC_ABSTRACT.getCategory() };
- List<String> expectedAssetNamesList = new ArrayList<>();
-
- Resource resource1 = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.COMPUTE, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left().value();
- expectedAssetNamesList.add(resource1.getName());
- Resource resource2 = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.DATABASE, ResourceCategoryEnum.GENERIC_NETWORK_ELEMENTS, UserRoleEnum.DESIGNER, true).left().value();
- expectedAssetNamesList.add(resource2.getName());
- Resource resource3 = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.COMPUTE, ResourceCategoryEnum.NETWORK_CONNECTIVITY_CON_POINT, UserRoleEnum.DESIGNER, true).left().value();
-
- RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.RESOURCES, filter);
- BaseRestUtils.checkSuccess(assetResponse);
-
- List<ResourceAssetStructure> resourceAssetList = AssetRestUtils.getResourceAssetList(assetResponse);
- List<String> getActualAssetNamesList = AssetRestUtils.getResourceNamesList(resourceAssetList);
- Utils.compareArrayLists(getActualAssetNamesList, expectedAssetNamesList, "Element");
-
- /*// Validate audit message
- validateSuccessAudit(filter, AssetTypeEnum.RESOURCES);*/
-
- }
-
- // 2 resources has the same category and different subcategory
- @Test // (enabled = false)
- public void getResourceAssetBySpecifiedCategoryAndSubCategory() throws Exception {
- String[] filter = { categoryFilterKey + "=" + ResourceCategoryEnum.GENERIC_ABSTRACT.getCategory(), subCategoryFilterKey + "=" + ResourceCategoryEnum.GENERIC_ABSTRACT.getSubCategory() };
- // String[] filter2 = {categoryFilterKey + "=" +
- // ResourceCategoryEnum.GENERIC_NETWORK_ELEMENTS.getCategory(),
- // subCategoryFilterKey + "=" +
- // ResourceCategoryEnum.GENERIC_NETWORK_ELEMENTS.getSubCategory()};
- List<String> expectedAssetNamesList = new ArrayList<>();
-
- Resource resource1 = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.COMPUTE, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left().value();
- expectedAssetNamesList.add(resource1.getName());
- Resource resource2 = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.DATABASE, ResourceCategoryEnum.GENERIC_NETWORK_ELEMENTS, UserRoleEnum.DESIGNER, true).left().value();
-
- RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.RESOURCES, filter);
- BaseRestUtils.checkSuccess(assetResponse);
-
- List<ServiceAssetStructure> resourceAssetList = AssetRestUtils.getServiceAssetList(assetResponse);
- List<String> getActualAssetNamesList = AssetRestUtils.getServiceNamesList(resourceAssetList);
- Utils.compareArrayLists(getActualAssetNamesList, expectedAssetNamesList, "Element");
-
- /*// Validate audit message
- validateSuccessAudit(filter, AssetTypeEnum.RESOURCES);*/
- }
-
- @Test // (enabled = false)
- public void getResourceAssetBySpecifiedSubCategoryAndCategory() throws Exception {
- String[] filter = { subCategoryFilterKey + "=" + ResourceCategoryEnum.GENERIC_DATABASE.getSubCategory(), categoryFilterKey + "=" + ResourceCategoryEnum.GENERIC_DATABASE.getCategory(), };
- List<String> expectedAssetNamesList = new ArrayList<>();
-
- Resource resource1 = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.COMPUTE, ResourceCategoryEnum.GENERIC_ABSTRACT, UserRoleEnum.DESIGNER, true).left().value();
- Resource resource2 = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.DATABASE, ResourceCategoryEnum.GENERIC_DATABASE, UserRoleEnum.DESIGNER, true).left().value();
- expectedAssetNamesList.add(resource2.getName());
-
- RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.RESOURCES, filter);
- BaseRestUtils.checkSuccess(assetResponse);
-
- List<ServiceAssetStructure> resourceAssetList = AssetRestUtils.getServiceAssetList(assetResponse);
- List<String> getActualAssetNamesList = AssetRestUtils.getServiceNamesList(resourceAssetList);
- Utils.compareArrayLists(getActualAssetNamesList, expectedAssetNamesList, "Element");
-
- /*// Validate audit message
- validateSuccessAudit(filter, AssetTypeEnum.RESOURCES);*/
- }
-
- // Failure
- @Test // (enabled = false)
- public void getResourceAssetCategoryNotExists() throws Exception {
- String[] filter = { categoryFilterKey + "=" + "NotExistingCategory" };
-
- RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.RESOURCES, filter);
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_CATEGORY_NOT_FOUND.name());
-
- assertNotNull("check response object is not null after create resouce", assetResponse);
- assertNotNull("check error code exists in response after create resource", assetResponse.getErrorCode());
- assertEquals("Check response code after create resource", errorInfo.getCode(), assetResponse.getErrorCode());
-
- List<String> variables = Arrays.asList(resourceKey, categoryFilterKey, "NotExistingCategory");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_CATEGORY_NOT_FOUND.name(), variables, assetResponse.getResponse());
-
- /*// Validate audit message
- validateFailureAudit(filter, errorInfo, variables, AssetTypeEnum.RESOURCES)*/;
- }
-
- @Test // (enabled = false)
- public void getResourceAssetSubCategoryNotExists() throws Exception {
- String[] filter = { categoryFilterKey + "=" + ResourceCategoryEnum.GENERIC_ABSTRACT.getCategory(), subCategoryFilterKey + "=" + "NotExistingSubCategory" };
-
- RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.RESOURCES, filter);
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_SUB_CATEGORY_NOT_FOUND_FOR_CATEGORY.name());
-
- assertNotNull("check response object is not null after create resouce", assetResponse);
- assertNotNull("check error code exists in response after create resource", assetResponse.getErrorCode());
- assertEquals("Check response code after create resource", errorInfo.getCode(), assetResponse.getErrorCode());
-
- List<String> variables = Arrays.asList("Resource", "NotExistingSubCategory", ResourceCategoryEnum.GENERIC_ABSTRACT.getCategory());
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_SUB_CATEGORY_NOT_FOUND_FOR_CATEGORY.name(), variables, assetResponse.getResponse());
-
- /*// Validate audit message
- validateFailureAudit(filter, errorInfo, variables, AssetTypeEnum.RESOURCES);*/
- }
-
- @Test // (enabled = false)
- public void getResourceAssetCategoryNotExistsSubCategoryExists() throws Exception {
- String[] filter = { subCategoryFilterKey + "=" + ResourceCategoryEnum.NETWORK_L2_3_GETEWAY.getSubCategory(), categoryFilterKey + "=" + "NotExistingCategory" };
-
- RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.RESOURCES, filter);
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_CATEGORY_NOT_FOUND.name());
-
- assertNotNull("check response object is not null after create resouce", assetResponse);
- assertNotNull("check error code exists in response after create resource", assetResponse.getErrorCode());
- assertEquals("Check response code after create resource", errorInfo.getCode(), assetResponse.getErrorCode());
-
- List<String> variables = Arrays.asList(resourceKey, categoryFilterKey, "NotExistingCategory");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_CATEGORY_NOT_FOUND.name(), variables, assetResponse.getResponse());
-
- /*// Validate audit message
- validateFailureAudit(filter, errorInfo, variables, AssetTypeEnum.RESOURCES);*/
- }
-
- @Test // (enabled = false)
- public void getResourceAssetInvalidFilterKey() throws Exception {
- String[] filter = { subCategoryFilterKey + "1=" + ResourceCategoryEnum.NETWORK_L2_3_GETEWAY.getSubCategory(), categoryFilterKey + "=" + "NotExistingCategory" };
-
- RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.RESOURCES, filter);
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_FILTER_KEY.name());
-
- assertNotNull("check response object is not null after create resouce", assetResponse);
- assertNotNull("check error code exists in response after create resource", assetResponse.getErrorCode());
- assertEquals("Check response code after create resource", errorInfo.getCode(), assetResponse.getErrorCode());
-
- List<String> variables = Arrays.asList(subCategoryFilterKey + "1", validFilterParameters);
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_FILTER_KEY.name(), variables, assetResponse.getResponse());
-
- /*// Validate audit message
- validateFailureAudit(filter, errorInfo, variables, AssetTypeEnum.RESOURCES);*/
- }
-
- // ---------------------------------------------------------------------------------------------------------
- // SERVICE
- // Success
- @Test // (enabled = false)
- public void getServiceAssetBySpecifiedCategory() throws Exception {
- String[] filter = { categoryFilterKey + "=" + ServiceCategoriesEnum.MOBILITY.getValue() };
- List<String> expectedAssetNamesList = new ArrayList<>();
-
- Service service1 = AtomicOperationUtils.createServiceByCategory(ServiceCategoriesEnum.MOBILITY, UserRoleEnum.DESIGNER, true).left().value();
- expectedAssetNamesList.add(service1.getName());
-
- RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.SERVICES, filter);
- BaseRestUtils.checkSuccess(assetResponse);
-
- List<ServiceAssetStructure> serviceAssetList = AssetRestUtils.getServiceAssetList(assetResponse);
- List<String> getActualAssetNamesList = AssetRestUtils.getServiceNamesList(serviceAssetList);
- Utils.compareArrayLists(getActualAssetNamesList, expectedAssetNamesList, "Element");
-
- /*// Validate audit message
- validateSuccessAudit(filter, AssetTypeEnum.SERVICES);*/
- }
-
- @Test // (enabled = false)
- public void getServiceAssetBySpecifiedCategoryAndDistributionStatus() throws Exception {
- String[] filter = { categoryFilterKey + "=" + ServiceCategoriesEnum.MOBILITY.getValue(), distributionStatusFilterKey + "=" + DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED };
- List<String> expectedAssetNamesList = new ArrayList<>();
- ArtifactReqDetails artifactDetails = ElementFactory.getArtifactByType(ArtifactTypeEnum.OTHER, ArtifactTypeEnum.OTHER, true);
-
- Service service1 = AtomicOperationUtils.createServiceByCategory(ServiceCategoriesEnum.MOBILITY, UserRoleEnum.DESIGNER, true).left().value();
- expectedAssetNamesList.add(service1.getName());
- Service service2 = AtomicOperationUtils.createServiceByCategory(ServiceCategoriesEnum.MOBILITY, UserRoleEnum.DESIGNER, true).left().value();
- RestResponse addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(artifactDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), service2.getUniqueId());
- BaseRestUtils.checkSuccess(addInformationalArtifactToService);
- service2 = (Service) AtomicOperationUtils.changeComponentState(service2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- expectedAssetNamesList.add(service2.getName());
-
- RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.SERVICES, filter);
- BaseRestUtils.checkSuccess(assetResponse);
-
- List<ServiceAssetStructure> serviceAssetList = AssetRestUtils.getServiceAssetList(assetResponse);
- List<String> getActualAssetNamesList = AssetRestUtils.getServiceNamesList(serviceAssetList);
- Utils.compareArrayLists(getActualAssetNamesList, expectedAssetNamesList, "Element");
-
- /*// Validate audit message
- validateSuccessAudit(filter, AssetTypeEnum.SERVICES);*/
- }
-
- @Test // (enabled = false)
- public void getServiceAssetByDistributionStatus() throws Exception {
- String[] filter = { distributionStatusFilterKey + "=" + DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED };
- List<String> expectedAssetNamesList = new ArrayList<>();
- ArtifactReqDetails artifactDetails = ElementFactory.getArtifactByType(ArtifactTypeEnum.OTHER, ArtifactTypeEnum.OTHER, true);
-
- Service service1 = AtomicOperationUtils.createServiceByCategory(ServiceCategoriesEnum.MOBILITY, UserRoleEnum.DESIGNER, true).left().value();
- expectedAssetNamesList.add(service1.getName());
- Service service2 = AtomicOperationUtils.createServiceByCategory(ServiceCategoriesEnum.MOBILITY, UserRoleEnum.DESIGNER, true).left().value();
- RestResponse addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(artifactDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), service2.getUniqueId());
- BaseRestUtils.checkSuccess(addInformationalArtifactToService);
- service2 = (Service) AtomicOperationUtils.changeComponentState(service2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- ServiceRestUtils.approveServiceDistribution(service2.getUniqueId(), UserRoleEnum.GOVERNOR.getUserId());
-
- RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.SERVICES, filter);
- BaseRestUtils.checkSuccess(assetResponse);
-
- List<ServiceAssetStructure> serviceAssetList = AssetRestUtils.getServiceAssetList(assetResponse);
- List<String> getActualAssetNamesList = AssetRestUtils.getServiceNamesList(serviceAssetList);
- Utils.compareArrayLists(getActualAssetNamesList, expectedAssetNamesList, "Element");
-
- /*// Validate audit message
- validateSuccessAudit(filter, AssetTypeEnum.SERVICES);*/
- }
-
- // Failure
- @Test // (enabled = false)
- public void getServiceAssetCategoryNotExists() throws Exception {
- String[] filter = { categoryFilterKey + "=" + "NotExistingCategory" };
-
- RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.SERVICES, filter);
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_CATEGORY_NOT_FOUND.name());
-
- assertNotNull("check response object is not null after create resouce", assetResponse);
- assertNotNull("check error code exists in response after create resource", assetResponse.getErrorCode());
- assertEquals("Check response code after create resource", errorInfo.getCode(), assetResponse.getErrorCode());
-
- List<String> variables = Arrays.asList(serviceKey, categoryFilterKey, "NotExistingCategory");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_CATEGORY_NOT_FOUND.name(), variables, assetResponse.getResponse());
-
- /*// Validate audit message
- validateFailureAudit(filter, errorInfo, variables, AssetTypeEnum.SERVICES);*/
- }
-
- @Test // (enabled = false)
- public void getServiceAssetInvalidDistributionStatus() throws Exception {
- String[] filter = { distributionStatusFilterKey + "=" + "NotExistingDistributionStatus" };
- RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.SERVICES, filter);
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_CATEGORY_NOT_FOUND.name());
-
- assertNotNull("check response object is not null after create resouce", assetResponse);
- assertNotNull("check error code exists in response after create resource", assetResponse.getErrorCode());
- assertEquals("Check response code after create resource", errorInfo.getCode(), assetResponse.getErrorCode());
-
- List<String> variables = Arrays.asList(serviceKey, distributionStatusFilterKey, "NotExistingDistributionStatus");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_CATEGORY_NOT_FOUND.name(), variables, assetResponse.getResponse());
-
- /*// Validate audit message
- validateFailureAudit(filter, errorInfo, variables, AssetTypeEnum.SERVICES);*/
- }
-
- @Test // (enabled = false)
- public void getServiceAssetCategoryExitsDistributionStatusInvalid() throws Exception {
- String[] filter = { categoryFilterKey + "=" + ServiceCategoriesEnum.MOBILITY.getValue(), distributionStatusFilterKey + "=" + "NotExistingDistributionStatus" };
-
- RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.SERVICES, filter);
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_CATEGORY_NOT_FOUND.name());
-
- assertNotNull("check response object is not null after create resouce", assetResponse);
- assertNotNull("check error code exists in response after create resource", assetResponse.getErrorCode());
- assertEquals("Check response code after create resource", errorInfo.getCode(), assetResponse.getErrorCode());
-
- List<String> variables = Arrays.asList(serviceKey, distributionStatusFilterKey, "NotExistingDistributionStatus");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_CATEGORY_NOT_FOUND.name(), variables, assetResponse.getResponse());
-
- /*// Validate audit message
- validateFailureAudit(filter, errorInfo, variables, AssetTypeEnum.SERVICES);*/
- }
-
- @Test // (enabled = false)
- public void getServiceAssetCategoryNotExistsDistributionStatus() throws Exception {
- String[] filter = { distributionStatusFilterKey + "=" + DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED, categoryFilterKey + "=" + "NotExistingCategory" };
-
- RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.SERVICES, filter);
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_CATEGORY_NOT_FOUND.name());
-
- assertNotNull("check response object is not null after create resouce", assetResponse);
- assertNotNull("check error code exists in response after create resource", assetResponse.getErrorCode());
- assertEquals("Check response code after create resource", errorInfo.getCode(), assetResponse.getErrorCode());
-
- List<String> variables = Arrays.asList(serviceKey, categoryFilterKey, "NotExistingCategory");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.COMPONENT_CATEGORY_NOT_FOUND.name(), variables, assetResponse.getResponse());
-
- /*// Validate audit message
- validateFailureAudit(filter, errorInfo, variables, AssetTypeEnum.SERVICES);*/
- }
-
- @Test // (enabled = false)
- public void getServiceAssetInvalidFilterKey() throws Exception {
- String[] filter = { distributionStatusFilterKey + "1=" + DistributionStatusEnum.DISTRIBUTION_NOT_APPROVED, categoryFilterKey + "=" + ServiceCategoriesEnum.MOBILITY.getValue() };
-
- RestResponse assetResponse = AssetRestUtils.getComponentListByAssetType(true, AssetTypeEnum.SERVICES, filter);
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_FILTER_KEY.name());
-
- assertNotNull("check response object is not null after create resouce", assetResponse);
- assertNotNull("check error code exists in response after create resource", assetResponse.getErrorCode());
- assertEquals("Check response code after create resource", errorInfo.getCode(), assetResponse.getErrorCode());
-
- List<String> variables = Arrays.asList(distributionStatusFilterKey + "1", "[" + categoryFilterKey + ", " + distributionStatusFilterKey + "]");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_FILTER_KEY.name(), variables, assetResponse.getResponse());
-
- /*// Validate audit message
- validateFailureAudit(filter, errorInfo, variables, AssetTypeEnum.SERVICES);*/
-
- }
-
- @Test
- public void getFilteredResourceAssetCategoryNotFound() throws Exception {
-
- String query = "category=Application%20L3%2B";
- RestResponse assetResponse = AssetRestUtils.getFilteredComponentList(AssetTypeEnum.RESOURCES, query);
- BaseRestUtils.checkErrorResponse(assetResponse, ActionStatus.COMPONENT_CATEGORY_NOT_FOUND, "resource", "category", "Application L3+");
-
- /*// Validate audit message
- ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getFilteredAssetListAuditCategoryNotFound(AssetTypeEnum.RESOURCES, "?" + query, "Application L3+");
- Map <AuditingFieldsKey, String> body = new HashMap<>();
- body.put(AuditingFieldsKey.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
- AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_FILTERED_ASSET_LIST.getName(), body);*/
-
- }
-
- @Test
- public void getFilteredResourceAssetSuccess() throws Exception {
-
- List<String> expectedAssetNamesList = new ArrayList<>();
-
- ResourceReqDetails resourceDetails = ElementFactory.getDefaultResource(ResourceCategoryEnum.APPLICATION_L4_APP_SERVER);
- resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
- Resource resource = AtomicOperationUtils.createResourceByResourceDetails(resourceDetails, UserRoleEnum.DESIGNER, true).left().value();
- expectedAssetNamesList.add(resource.getName());
-
- resourceDetails = ElementFactory.getDefaultResource(ResourceCategoryEnum.APPLICATION_L4_BORDER);
- resourceDetails.setResourceType(ResourceTypeEnum.VFC.name());
- resource = AtomicOperationUtils.createResourceByResourceDetails(resourceDetails, UserRoleEnum.DESIGNER, true).left().value();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
-
- resourceDetails = ElementFactory.getDefaultResource(ResourceCategoryEnum.GENERIC_INFRASTRUCTURE);
- resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
- resource = AtomicOperationUtils.createResourceByResourceDetails(resourceDetails, UserRoleEnum.DESIGNER, true).left().value();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- resourceDetails = ElementFactory.getDefaultResource(ResourceCategoryEnum.APPLICATION_L4_FIREWALL);
- resourceDetails.setResourceType(ResourceTypeEnum.VF.name());
- resource = AtomicOperationUtils.createResourceByResourceDetails(resourceDetails, UserRoleEnum.DESIGNER, true).left().value();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- expectedAssetNamesList.add(resource.getName());
-
- log.debug("4 resources created");
- String query = "category=Application%20L4%2B";
- RestResponse assetResponse = AssetRestUtils.getFilteredComponentList(AssetTypeEnum.RESOURCES, query);
- BaseRestUtils.checkSuccess(assetResponse);
-
- List<ResourceAssetStructure> resourceAssetList = AssetRestUtils.getResourceAssetList(assetResponse);
- List<String> getActualAssetNamesList = AssetRestUtils.getResourceNamesList(resourceAssetList);
- Utils.compareArrayLists(getActualAssetNamesList, expectedAssetNamesList, "Element");
-
-// Andrey L. This condition can not be checked in case resources list has two or ore different resource types
-// AssetRestUtils.checkResourceTypeInObjectList(resourceAssetList, ResourceTypeEnum.VF);
-
- /*// Validate audit message
- validateFilteredAudit(query, AssetTypeEnum.RESOURCES);*/
-
- }
-
- /*@Test
- public void getFilteredServiceAssetInformationalSuccess() throws Exception {
-
- List<String> expectedAssetNamesList = new ArrayList<>();
- ArtifactReqDetails artifactDetails = ElementFactory.getArtifactByType(ArtifactTypeEnum.OTHER, ArtifactTypeEnum.OTHER, true);
- artifactDetails.setArtifactGroupType(ArtifactGroupTypeEnum.INFORMATIONAL.getType());
-
- ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
- Service service = AtomicOperationUtils.createCustomService(serviceDetails, UserRoleEnum.DESIGNER, true).left().value();
-
- serviceDetails = ElementFactory.getDefaultService();
- service = AtomicOperationUtils.createCustomService(serviceDetails, UserRoleEnum.DESIGNER, true).left().value();
- RestResponse addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(artifactDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), service.getUniqueId());
- BaseRestUtils.checkSuccess(addInformationalArtifactToService);
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- ServiceReqDetails certifyService = new ServiceReqDetails(service);
- LifecycleRestUtils.changeDistributionStatus(certifyService, certifyService.getVersion(), ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR), null, DistributionStatusEnum.DISTRIBUTION_APPROVED);
- AtomicOperationUtils.distributeService(service, false);
- expectedAssetNamesList.add(service.getName());
-
- serviceDetails = ElementFactory.getDefaultService();
- service = AtomicOperationUtils.createCustomService(serviceDetails, UserRoleEnum.DESIGNER, true).left().value();
- addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(artifactDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), service.getUniqueId());
- BaseRestUtils.checkSuccess(addInformationalArtifactToService);
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- certifyService = new ServiceReqDetails(service);
- LifecycleRestUtils.changeDistributionStatus(certifyService, certifyService.getVersion(), ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR), null, DistributionStatusEnum.DISTRIBUTION_APPROVED);
- AtomicOperationUtils.distributeService(service, false);
- expectedAssetNamesList.add(service.getName());
-
- serviceDetails = ElementFactory.getDefaultService();
- service = AtomicOperationUtils.createCustomService(serviceDetails, UserRoleEnum.DESIGNER, true).left().value();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
-
- serviceDetails = ElementFactory.getDefaultService();
- service = AtomicOperationUtils.createCustomService(serviceDetails, UserRoleEnum.DESIGNER, true).left().value();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
-
- String query = "distributionStatus=Distributed";
- RestResponse assetResponse = AssetRestUtils.getFilteredComponentList(AssetTypeEnum.SERVICES, query);
- BaseRestUtils.checkSuccess(assetResponse);
-
- List<ServiceAssetStructure> resourceAssetList = AssetRestUtils.getServiceAssetList(assetResponse);
- List<String> getActualAssetNamesList = AssetRestUtils.getServiceNamesList(resourceAssetList);
- Utils.compareArrayLists(getActualAssetNamesList, expectedAssetNamesList, "Element");
-
- }*/
-
- @Test
- public void getFilteredServiceAssetDeploymentSuccess() throws Exception {
-
- List<String> expectedAssetNamesList = new ArrayList<>();
- ArtifactReqDetails artifactDetails = ElementFactory.getArtifactByType(ArtifactTypeEnum.OTHER, ArtifactTypeEnum.OTHER, true);
-
- ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
- Service service = AtomicOperationUtils.createCustomService(serviceDetails, UserRoleEnum.DESIGNER, true).left().value();
-
- serviceDetails = ElementFactory.getDefaultService();
- service = AtomicOperationUtils.createCustomService(serviceDetails, UserRoleEnum.DESIGNER, true).left().value();
- RestResponse addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(artifactDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), service.getUniqueId());
- BaseRestUtils.checkSuccess(addInformationalArtifactToService);
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- ServiceReqDetails certifyService = new ServiceReqDetails(service);
- LifecycleRestUtils.changeDistributionStatus(certifyService, certifyService.getVersion(), ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR), null, DistributionStatusEnum.DISTRIBUTED);
- AtomicOperationUtils.distributeService(service, false);
- expectedAssetNamesList.add(service.getName());
-
- serviceDetails = ElementFactory.getDefaultService();
- service = AtomicOperationUtils.createCustomService(serviceDetails, UserRoleEnum.DESIGNER, true).left().value();
- addInformationalArtifactToService = ArtifactRestUtils.addInformationalArtifactToService(artifactDetails, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), service.getUniqueId());
- BaseRestUtils.checkSuccess(addInformationalArtifactToService);
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- certifyService = new ServiceReqDetails(service);
- LifecycleRestUtils.changeDistributionStatus(certifyService, certifyService.getVersion(), ElementFactory.getDefaultUser(UserRoleEnum.GOVERNOR), null, DistributionStatusEnum.DISTRIBUTED);
- AtomicOperationUtils.distributeService(service, false);
- expectedAssetNamesList.add(service.getName());
-
- serviceDetails = ElementFactory.getDefaultService();
- service = AtomicOperationUtils.createCustomService(serviceDetails, UserRoleEnum.DESIGNER, true).left().value();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
-
- serviceDetails = ElementFactory.getDefaultService();
- service = AtomicOperationUtils.createCustomService(serviceDetails, UserRoleEnum.DESIGNER, true).left().value();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
-
- String query = "distributionStatus=Distributed";
- RestResponse assetResponse = AssetRestUtils.getFilteredComponentList(AssetTypeEnum.SERVICES, query);
- BaseRestUtils.checkSuccess(assetResponse);
-
- List<ServiceAssetStructure> resourceAssetList = AssetRestUtils.getServiceAssetList(assetResponse);
- List<String> getActualAssetNamesList = AssetRestUtils.getServiceNamesList(resourceAssetList);
- Utils.compareArrayLists(getActualAssetNamesList, expectedAssetNamesList, "Element");
-
- /*// Validate audit message
- validateFilteredAudit(query, AssetTypeEnum.SERVICES);*/
- }
-
- /*private void validateSuccessAudit(String[] filter, AssetTypeEnum assetType) throws Exception {
- ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultAssetListAudit(assetType, AuditingActionEnum.GET_FILTERED_ASSET_LIST);
- expectedAssetListAudit.setRESOURCE_URL(AssetRestUtils.buildUrlWithFilter(expectedAssetListAudit.getRESOURCE_URL(), filter));
- Map<AuditingFieldsKey, String> body = new HashMap<>();
- body.put(AuditingFieldsKey.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
- AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_FILTERED_ASSET_LIST.getName(), body);
- }
-
- private void validateFilteredAudit(String query, AssetTypeEnum assetType) throws Exception {
- ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultFilteredAssetListAudit(assetType, "?" + query);
- Map<AuditingFieldsKey, String> body = new HashMap<>();
- body.put(AuditingFieldsKey.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
- AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_FILTERED_ASSET_LIST.getName(), body);
- }
-
- private void validateFailureAudit(String[] filter, ErrorInfo errorInfo, List<String> variables, AssetTypeEnum assetType) throws Exception {
- ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultAssetListAudit(assetType, AuditingActionEnum.GET_FILTERED_ASSET_LIST);
- expectedAssetListAudit.setRESOURCE_URL(AssetRestUtils.buildUrlWithFilter(expectedAssetListAudit.getRESOURCE_URL(), filter));
- expectedAssetListAudit.setSTATUS(errorInfo.getCode().toString());
- expectedAssetListAudit.setDESC(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
- Map<AuditingFieldsKey, String> body = new HashMap<>();
- body.put(AuditingFieldsKey.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
- AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_FILTERED_ASSET_LIST.getName(), body);
- }*/
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/GetSpecificAssetMetadataServlet.java b/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/GetSpecificAssetMetadataServlet.java
deleted file mode 100644
index 6bd47e972f..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/GetSpecificAssetMetadataServlet.java
+++ /dev/null
@@ -1,405 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.externalApis;
-
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.datatypes.enums.AssetTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.model.Service;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceDetailedAssetStructure;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceDetailedAssetStructure;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-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.*;
-import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
-import org.testng.annotations.Test;
-
-import java.util.ArrayList;
-
-public class GetSpecificAssetMetadataServlet extends ComponentBaseTest {
-
- @Rule
- public static TestName name = new TestName();
-
- public GetSpecificAssetMetadataServlet() {
- super(name, GetSpecificAssetMetadataServlet.class.getName());
- }
-
-// @BeforeMethod
-// public void setup() throws Exception {
-// AtomicOperationUtils.createDefaultConsumer(true);
-// }
-
- // get specific asset metadata
-
- // Resource
- @Test // (enabled = false)
- public void getResourceAssetMetadataSuccess() throws Exception {
-
- Resource resourceVF = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
-
- RestResponse assetResponse = AssetRestUtils.getAssetMetadataByAssetTypeAndUuid(true, AssetTypeEnum.RESOURCES, resourceVF.getUUID());
- BaseRestUtils.checkSuccess(assetResponse);
-
- ResourceDetailedAssetStructure resourceAssetMetadata = AssetRestUtils.getResourceAssetMetadata(assetResponse);
- AssetRestUtils.resourceMetadataValidatior(resourceAssetMetadata, resourceVF, AssetTypeEnum.RESOURCES);
-
- /* // Validate audit message
- validateAudit(resourceVF, AssetTypeEnum.RESOURCES);*/
- }
-
- @Test // (enabled = false)
- public void getResourceAssetMetadataWithResourceInstancesSuccess() throws Exception {
-
- Resource resourceVF = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
- Resource resource2 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
- resource2 = (Resource) AtomicOperationUtils.changeComponentState(resource2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
-
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resource2, resourceVF, UserRoleEnum.DESIGNER, true);
- resourceVF = ResponseParser.parseToObjectUsingMapper(ResourceRestUtils.getResource(resourceVF.getUniqueId()).getResponse(), Resource.class);
-
- RestResponse assetResponse = AssetRestUtils.getAssetMetadataByAssetTypeAndUuid(true, AssetTypeEnum.RESOURCES, resourceVF.getUUID());
- BaseRestUtils.checkSuccess(assetResponse);
-
- ResourceDetailedAssetStructure resourceAssetMetadata = AssetRestUtils.getResourceAssetMetadata(assetResponse);
- AssetRestUtils.resourceMetadataValidatior(resourceAssetMetadata, resourceVF, AssetTypeEnum.RESOURCES);
-
- /*// Validate audit message
- validateAudit(resourceVF, AssetTypeEnum.RESOURCES);*/
- }
-
- @Test // (enabled = false)
- public void getResourceAssetMetadataWithNonCertifiedResourceInstancesSuccess() throws Exception {
-
- Resource resourceVF = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
- Resource resource2 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
- resource2 = (Resource) AtomicOperationUtils.changeComponentState(resource2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- Resource resource3 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
- resource3 = (Resource) AtomicOperationUtils.changeComponentState(resource3, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
-
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resource2, resourceVF, UserRoleEnum.DESIGNER, true);
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resource3, resourceVF, UserRoleEnum.DESIGNER, true);
-
- // certify resource2 and add to VF(VF with resource2 0.1, 1.0 and 1.1
- // versions)
- resource2 = (Resource) AtomicOperationUtils.changeComponentState(resource2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resource2, resourceVF, UserRoleEnum.DESIGNER, true);
- resource2 = (Resource) AtomicOperationUtils.changeComponentState(resource2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resource2, resourceVF, UserRoleEnum.DESIGNER, true);
- resourceVF = ResponseParser.parseToObjectUsingMapper(ResourceRestUtils.getResource(resourceVF.getUniqueId()).getResponse(), Resource.class);
-
- RestResponse assetResponse = AssetRestUtils.getAssetMetadataByAssetTypeAndUuid(true, AssetTypeEnum.RESOURCES, resourceVF.getUUID());
- BaseRestUtils.checkSuccess(assetResponse);
-
- ResourceDetailedAssetStructure resourceAssetMetadata = AssetRestUtils.getResourceAssetMetadata(assetResponse);
- AssetRestUtils.resourceMetadataValidatior(resourceAssetMetadata, resourceVF, AssetTypeEnum.RESOURCES);
-
- /* // Validate audit message
- validateAudit(resourceVF, AssetTypeEnum.RESOURCES);*/
- }
-
- /*@Test // (enabled = false)
- public void getResourceAssetMetadataWithResourceInstancesVfInSubmitForTestingSuccess() throws Exception {
-
- Resource resourceVF = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
- Resource resource2 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
- resource2 = (Resource) AtomicOperationUtils.changeComponentState(resource2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- Resource resource3 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
- resource3 = (Resource) AtomicOperationUtils.changeComponentState(resource3, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resource2, resourceVF, UserRoleEnum.DESIGNER, true);
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resource3, resourceVF, UserRoleEnum.DESIGNER, true);
-
- // certify resource2 and add to VF(VF with resource2 1.0, 2.0 and 3.0
- // versions)
- resource2 = (Resource) AtomicOperationUtils.changeComponentState(resource2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resource2, resourceVF, UserRoleEnum.DESIGNER, true);
- resource2 = (Resource) AtomicOperationUtils.changeComponentState(resource2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resource2, resourceVF, UserRoleEnum.DESIGNER, true);
- resourceVF = (Resource) AtomicOperationUtils.changeComponentState(resourceVF, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFICATIONREQUEST, true).getLeft();
-
- RestResponse assetResponse = AssetRestUtils.getAssetMetadataByAssetTypeAndUuid(true, AssetTypeEnum.RESOURCES, resourceVF.getUUID());
- BaseRestUtils.checkSuccess(assetResponse);
-
- ResourceDetailedAssetStructure resourceAssetMetadata = AssetRestUtils.getResourceAssetMetadata(assetResponse);
- AssetRestUtils.resourceMetadataValidatior(resourceAssetMetadata, resourceVF, AssetTypeEnum.RESOURCES);
-
- *//* // Validate audit message
- validateAudit(resourceVF, AssetTypeEnum.RESOURCES);*//*
- }*/
-
- @Test // (enabled = false)
- public void getResourceAssetMetadataWithResourceInstancesVfInStartCertificationSuccess() throws Exception {
-
- Resource resourceVF = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
- Resource resource2 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
- resource2 = (Resource) AtomicOperationUtils.changeComponentState(resource2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- Resource resource3 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
- resource3 = (Resource) AtomicOperationUtils.changeComponentState(resource3, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resource2, resourceVF, UserRoleEnum.DESIGNER, true);
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resource3, resourceVF, UserRoleEnum.DESIGNER, true);
-
- // certify resource2 and add to VF(VF with resource2 1.0, 2.0 and 3.0
- // versions)
- resource2 = (Resource) AtomicOperationUtils.changeComponentState(resource2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resource2, resourceVF, UserRoleEnum.DESIGNER, true);
- resource2 = (Resource) AtomicOperationUtils.changeComponentState(resource2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resource2, resourceVF, UserRoleEnum.DESIGNER, true);
- resourceVF = (Resource) AtomicOperationUtils.changeComponentState(resourceVF, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.STARTCERTIFICATION, true).getLeft();
-
- RestResponse assetResponse = AssetRestUtils.getAssetMetadataByAssetTypeAndUuid(true, AssetTypeEnum.RESOURCES, resourceVF.getUUID());
- BaseRestUtils.checkSuccess(assetResponse);
-
- ResourceDetailedAssetStructure resourceAssetMetadata = AssetRestUtils.getResourceAssetMetadata(assetResponse);
- AssetRestUtils.resourceMetadataValidatior(resourceAssetMetadata, resourceVF, AssetTypeEnum.RESOURCES);
-
- /*// Validate audit message
- validateAudit(resourceVF, AssetTypeEnum.RESOURCES);*/
- }
-
- @Test // (enabled = false)
- public void getResourceAssetMetadataWithResourceInstancesCertifiedVFSuccess() throws Exception {
-
- Resource resourceVF = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
- Resource resource2 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
- resource2 = (Resource) AtomicOperationUtils.changeComponentState(resource2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- Resource resource3 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
- resource3 = (Resource) AtomicOperationUtils.changeComponentState(resource3, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resource2, resourceVF, UserRoleEnum.DESIGNER, true);
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resource3, resourceVF, UserRoleEnum.DESIGNER, true);
-
- // certify resource2 and add to VF(VF with resource2 1.0, 2.0 and 3.0
- // versions)
- resource2 = (Resource) AtomicOperationUtils.changeComponentState(resource2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resource2, resourceVF, UserRoleEnum.DESIGNER, true);
- resource2 = (Resource) AtomicOperationUtils.changeComponentState(resource2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resource2, resourceVF, UserRoleEnum.DESIGNER, true);
- resourceVF = (Resource) AtomicOperationUtils.changeComponentState(resourceVF, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- RestResponse assetResponse = AssetRestUtils.getAssetMetadataByAssetTypeAndUuid(true, AssetTypeEnum.RESOURCES, resourceVF.getUUID());
- BaseRestUtils.checkSuccess(assetResponse);
-
- ResourceDetailedAssetStructure resourceAssetMetadata = AssetRestUtils.getResourceAssetMetadata(assetResponse);
- AssetRestUtils.resourceMetadataValidatior(resourceAssetMetadata, resourceVF, AssetTypeEnum.RESOURCES);
-
- /* // Validate audit message
- validateAudit(resourceVF, AssetTypeEnum.RESOURCES);*/
- }
-
- /*@Test // (enabled = false)
- public void getResourceAssetMetadataWithNonCertifiedResourceInstancesAndArtifactsSuccess() throws Exception {
-
- Resource resourceVF = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
- Resource resource2 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
- resource2 = (Resource) AtomicOperationUtils.changeComponentState(resource2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- Resource resource3 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
- resource3 = (Resource) AtomicOperationUtils.changeComponentState(resource3, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFICATIONREQUEST, true).getLeft();
-
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resource2, resourceVF, UserRoleEnum.DESIGNER, true);
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resource3, resourceVF, UserRoleEnum.DESIGNER, true);
-
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.VENDOR_LICENSE, resourceVF, UserRoleEnum.DESIGNER, true, true);
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.APPC_CONFIG, resourceVF, UserRoleEnum.DESIGNER, true, true);
- resourceVF = ResponseParser.parseToObjectUsingMapper(ResourceRestUtils.getResource(resourceVF.getUniqueId()).getResponse(), Resource.class);
-
- RestResponse assetResponse = AssetRestUtils.getAssetMetadataByAssetTypeAndUuid(true, AssetTypeEnum.RESOURCES, resourceVF.getUUID());
- BaseRestUtils.checkSuccess(assetResponse);
-
- ResourceDetailedAssetStructure resourceAssetMetadata = AssetRestUtils.getResourceAssetMetadata(assetResponse);
- AssetRestUtils.resourceMetadataValidatior(resourceAssetMetadata, resourceVF, AssetTypeEnum.RESOURCES);
-
- }*/
-
-
- // Import CSAR
-
- // Service
- @Test // (enabled = false)
- public void getServiceAssetMetadataSuccess() throws Exception {
-
- Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
-
- RestResponse assetResponse = AssetRestUtils.getAssetMetadataByAssetTypeAndUuid(true, AssetTypeEnum.SERVICES, service.getUUID());
- BaseRestUtils.checkSuccess(assetResponse);
-
- ServiceDetailedAssetStructure serviceAssetMetadata = AssetRestUtils.getServiceAssetMetadata(assetResponse);
- AssetRestUtils.serviceMetadataValidatior(serviceAssetMetadata, service, AssetTypeEnum.SERVICES);
-
- /*// Validate audit message
- validateAudit(service, AssetTypeEnum.SERVICES);*/
- }
-
- @Test // (enabled = false)
- public void getServiceAssetMetadataWithResourceInstancesSuccess() throws Exception {
-
- Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
- Resource resourceVF = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
- resourceVF = (Resource) AtomicOperationUtils.changeComponentState(resourceVF, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
-
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceVF, service, UserRoleEnum.DESIGNER, true);
- service = ResponseParser.parseToObjectUsingMapper(ServiceRestUtils.getService(service.getUniqueId(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER)).getResponse(),Service.class);
-
- RestResponse assetResponse = AssetRestUtils.getAssetMetadataByAssetTypeAndUuid(true, AssetTypeEnum.SERVICES, service.getUUID());
- BaseRestUtils.checkSuccess(assetResponse);
-
- ServiceDetailedAssetStructure serviceAssetMetadata = AssetRestUtils.getServiceAssetMetadata(assetResponse);
- AssetRestUtils.serviceMetadataValidatior(serviceAssetMetadata, service, AssetTypeEnum.SERVICES);
-
- /*// Validate audit message
- validateAudit(service, AssetTypeEnum.SERVICES);*/
-
- }
-
- @Test // (enabled = false)
- public void getServiceAssetMetadataWithNonCertifiedResourceInstancesWithArtifactsSuccess() throws Exception {
-
- Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
-
- Resource resourceVF = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.VENDOR_LICENSE, resourceVF, UserRoleEnum.DESIGNER, true, true);
- resourceVF = (Resource) AtomicOperationUtils.changeComponentState(resourceVF, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
-
- Resource resourceVF2 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.APPC_CONFIG, resourceVF2, UserRoleEnum.DESIGNER, true, true);
- resourceVF2 = (Resource) AtomicOperationUtils.changeComponentState(resourceVF2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
-
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceVF, service, UserRoleEnum.DESIGNER, true);
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceVF2, service, UserRoleEnum.DESIGNER, true);
- resourceVF = (Resource) AtomicOperationUtils
- .changeComponentState(resourceVF, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceVF, service, UserRoleEnum.DESIGNER, true);
-
- // service with 0.1, 0.1 and 1.0 RIs versions
- service = ResponseParser.parseToObjectUsingMapper(ServiceRestUtils.getService(service.getUniqueId(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER)).getResponse(), Service.class);
-
- RestResponse assetResponse = AssetRestUtils.getAssetMetadataByAssetTypeAndUuid(true, AssetTypeEnum.SERVICES, service.getUUID());
- BaseRestUtils.checkSuccess(assetResponse);
-
- ServiceDetailedAssetStructure serviceAssetMetadata = AssetRestUtils.getServiceAssetMetadata(assetResponse);
- AssetRestUtils.serviceMetadataValidatior(serviceAssetMetadata, service, AssetTypeEnum.SERVICES);
-
- /*// Validate audit message
- validateAudit(service, AssetTypeEnum.SERVICES);*/
-
- }
-
- @Test // (enabled = false)
- public void getServiceAssetMetadataWithCertifiedResourceInstancesAndArtifactsOnRIsAndServiceSuccess()
- throws Exception {
-
- Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
-
- Resource resourceVF = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.VENDOR_LICENSE, resourceVF, UserRoleEnum.DESIGNER, true, true);
- resourceVF = (Resource) AtomicOperationUtils.changeComponentState(resourceVF, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- Resource resourceVF2 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.APPC_CONFIG, resourceVF2, UserRoleEnum.DESIGNER, true, true);
- resourceVF2 = (Resource) AtomicOperationUtils.changeComponentState(resourceVF2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceVF, service, UserRoleEnum.DESIGNER, true);
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceVF2, service, UserRoleEnum.DESIGNER, true);
- resourceVF = (Resource) AtomicOperationUtils.changeComponentState(resourceVF, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.MODEL_INVENTORY_PROFILE, resourceVF, UserRoleEnum.DESIGNER, true, true);
- resourceVF = (Resource) AtomicOperationUtils.changeComponentState(resourceVF, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceVF, service, UserRoleEnum.DESIGNER, true);
-
- // service with resourceVF 1.0(1 art), 2.0(2 art) versions and
- // resourceVF2 1.0(1 art), service 1 artifact version
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.MODEL_INVENTORY_PROFILE, service, UserRoleEnum.DESIGNER, true, true);
- service = ResponseParser.parseToObjectUsingMapper(ServiceRestUtils.getService(service.getUniqueId(), ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER)).getResponse(), Service.class);
-
- RestResponse assetResponse = AssetRestUtils.getAssetMetadataByAssetTypeAndUuid(true, AssetTypeEnum.SERVICES, service.getUUID());
- BaseRestUtils.checkSuccess(assetResponse);
-
- ServiceDetailedAssetStructure serviceAssetMetadata = AssetRestUtils.getServiceAssetMetadata(assetResponse);
- AssetRestUtils.serviceMetadataValidatior(serviceAssetMetadata, service, AssetTypeEnum.SERVICES);
-
- /*// Validate audit message
- validateAudit(service, AssetTypeEnum.SERVICES);*/
-
- }
-
- @Test // (enabled = false)
- public void getServiceAssetMetadataWithResourceInstancesServiceInSubmitForTestingSuccess() throws Exception {
-
- Service service = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
-
- Resource resourceVF = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.VENDOR_LICENSE, resourceVF, UserRoleEnum.DESIGNER, true, true);
- resourceVF = (Resource) AtomicOperationUtils.changeComponentState(resourceVF, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- Resource resourceVF2 = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.APPC_CONFIG, resourceVF2, UserRoleEnum.DESIGNER, true, true);
- resourceVF = (Resource) AtomicOperationUtils.changeComponentState(resourceVF2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceVF, service, UserRoleEnum.DESIGNER, true);
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceVF2, service, UserRoleEnum.DESIGNER, true);
- resourceVF = (Resource) AtomicOperationUtils.changeComponentState(resourceVF, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.MODEL_INVENTORY_PROFILE, resourceVF, UserRoleEnum.DESIGNER, true, true);
- resourceVF = (Resource) AtomicOperationUtils.changeComponentState(resourceVF, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceVF, service, UserRoleEnum.DESIGNER, true);
-
- // service with resourceVF 1.0(1 art), 2.0(2 art) versions and
- // resourceVF2 1.0(1 art), service 1 artifact version
- AtomicOperationUtils.uploadArtifactByType(ArtifactTypeEnum.MODEL_INVENTORY_PROFILE, service, UserRoleEnum.DESIGNER, true, true);
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- RestResponse assetResponse = AssetRestUtils.getAssetMetadataByAssetTypeAndUuid(true, AssetTypeEnum.SERVICES, service.getUUID());
- BaseRestUtils.checkSuccess(assetResponse);
-
- ServiceDetailedAssetStructure serviceAssetMetadata = AssetRestUtils.getServiceAssetMetadata(assetResponse);
- AssetRestUtils.serviceMetadataValidatior(serviceAssetMetadata, service, AssetTypeEnum.SERVICES);
-
- /*// Validate audit message
- validateAudit(service, AssetTypeEnum.SERVICES);*/
- }
-
- @Test // (enabled = false)
- public void getServiceAssetMetadataServiceNotFound() throws Exception {
-
- String serviceUuid = "notExistingServiceUuid";
- RestResponse assetResponse = AssetRestUtils.getAssetMetadataByAssetTypeAndUuid(true, AssetTypeEnum.SERVICES, serviceUuid);
-
- // Validate audit message
- ArrayList<String> variables = new ArrayList<>();
- variables.add(serviceUuid);
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.SERVICE_NOT_FOUND.name(), variables, assetResponse.getResponse());
- }
-
- /*private void validateAudit(Component component, AssetTypeEnum assetType) throws Exception {
- ExpectedExternalAudit expectedAssetListAudit = ElementFactory.getDefaultAssetMetadataAudit(assetType, component);
- Map<AuditingFieldsKey, String> body = new HashMap<>();
- body.put(AuditingFieldsKey.AUDIT_RESOURCE_URL, expectedAssetListAudit.getRESOURCE_URL());
- AuditValidationUtils.validateExternalAudit(expectedAssetListAudit, AuditingActionEnum.GET_ASSET_METADATA.getName(), body);
- }*/
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/SearchFilterCategoryExternalAPI.java b/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/SearchFilterCategoryExternalAPI.java
deleted file mode 100644
index e446dc356e..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/SearchFilterCategoryExternalAPI.java
+++ /dev/null
@@ -1,325 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.externalApis;
-
-import com.google.gson.Gson;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonParser;
-import org.json.simple.parser.JSONParser;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.datatypes.enums.AssetTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.model.category.CategoryDefinition;
-import org.openecomp.sdc.be.model.category.SubCategoryDefinition;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-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.SearchCriteriaEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-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.CategoryRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
-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.DataProvider;
-import org.testng.annotations.Test;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Random;
-
-public class SearchFilterCategoryExternalAPI extends ComponentBaseTest {
-
- private static Logger log = LoggerFactory.getLogger(CRUDExternalAPI.class.getName());
-
- protected Config config = Config.instance();
- protected String contentTypeHeaderData = "application/json";
- protected String acceptHeaderDate = "application/json";
-
- protected Gson gson = new Gson();
- protected JSONParser jsonParser = new JSONParser();
-
-// @BeforeMethod
-// public void init() throws Exception{
-// AtomicOperationUtils.createDefaultConsumer(true);
-// }
-
- ;
- @Rule
- public static TestName name = new TestName();
-
- public SearchFilterCategoryExternalAPI() {
- super(name, SearchFilterCategoryExternalAPI.class.getName());
-
- }
-
- // Search for invalid resourceType
- @Test
- public void searchWithInvalidFilter() throws Exception {
- RestResponse restResponse = ResourceRestUtils.getResourceListFilterByCriteria(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), AssetTypeEnum.RESOURCES.getValue(), SearchCriteriaEnum.RESOURCE_TYPE.getValue() + "invalid", ResourceTypeEnum.VFC.toString());
-
- Integer expectedResponseCode = 400;
- Assert.assertEquals(restResponse.getErrorCode(), expectedResponseCode);
-
- List<String> variables = Arrays.asList("resourceTypeinvalid", "[resourceType, subCategory, category]");
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_FILTER_KEY.name(), variables, restResponse.getResponse());
-
- /*validateFailureAudit(variables);*/
- }
-
- /*private void validateFailureAudit(List<String> variables) throws Exception {
- ExpectedExternalAudit expectedExternalAudit = ElementFactory.getDefaultExternalAuditObject(AssetTypeEnum.RESOURCES, AuditingActionEnum.GET_FILTERED_ASSET_LIST, "?" + SearchCriteriaEnum.RESOURCE_TYPE.getValue() + "invalid=" + ResourceTypeEnum.VFC.toString());
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_FILTER_KEY.name());
- expectedExternalAudit.setDESC(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
- expectedExternalAudit.setSTATUS("400");
- Map<AuditingFieldsKey, String> body = new HashMap<>();
- body.put(AuditingFieldsKey.AUDIT_RESOURCE_URL, expectedExternalAudit.getRESOURCE_URL());
- AuditValidationUtils.validateAuditExternalSearchAPI(expectedExternalAudit, AuditingActionEnum.GET_FILTERED_ASSET_LIST.getName(), body);
- }*/
-
- @DataProvider(name="searchForResourceTypeNegativeTest", parallel=true)
- public static Object[][] dataProviderSearchForResourceTypeNegativeTest() {
- return new Object[][] {
- {"invalidResourceType"},
- {""}
- };
- }
-
- // Search for invalid resourceType
- @Test(dataProvider="searchForResourceTypeNegativeTest")
- public void searchForResourceTypeNegativeTest(String resourceType) throws Exception {
- RestResponse restResponse = ResourceRestUtils.getResourceListFilterByCriteria(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), AssetTypeEnum.RESOURCES.getValue(), SearchCriteriaEnum.RESOURCE_TYPE.getValue(), resourceType);
-
- Integer expectedResponseCode = 400;
- Assert.assertEquals(restResponse.getErrorCode(), expectedResponseCode);
-
- List<String> variables = Arrays.asList();
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.INVALID_CONTENT.name(), variables, restResponse.getResponse());
-
- /*ExpectedExternalAudit expectedExternalAudit = ElementFactory.getDefaultExternalAuditObject(AssetTypeEnum.RESOURCES, AuditingActionEnum.GET_FILTERED_ASSET_LIST, "?" + SearchCriteriaEnum.RESOURCE_TYPE.getValue() + "=" + resourceType);
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_CONTENT.name());
- expectedExternalAudit.setDESC(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
- expectedExternalAudit.setSTATUS("400");
- Map <AuditingFieldsKey, String> body = new HashMap<>();
- body.put(AuditingFieldsKey.AUDIT_RESOURCE_URL, expectedExternalAudit.getRESOURCE_URL());
- AuditValidationUtils.validateAuditExternalSearchAPI(expectedExternalAudit, AuditingActionEnum.GET_FILTERED_ASSET_LIST.getName(), body);*/
- }
-
- // Searching for resource filter incorrect resource type using external API
- @Test
- public void searchingForResouceFilterIncorrectResouceTypeUsingExternalAPI() throws Exception {
- Resource resource = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_DATABASE, UserRoleEnum.DESIGNER, true).left().value();
- List<String> createdResoucesName = new ArrayList<String>();
- createdResoucesName.add(resource.getName());
-
- for(ResourceTypeEnum resourceTypeEnum: ResourceTypeEnum.values()) {
- // Create resource for each type so it will not return 404
- AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(resourceTypeEnum, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_DATABASE, UserRoleEnum.DESIGNER, true).left().value();
-
- RestResponse restResponse = ResourceRestUtils.getResourceListFilterByCriteria(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), AssetTypeEnum.RESOURCES.getValue(), SearchCriteriaEnum.RESOURCE_TYPE.getValue(), resourceTypeEnum.toString());
-
- Integer expectedResponseCode = 200;
- Assert.assertEquals(restResponse.getErrorCode(), expectedResponseCode);
- if(resourceTypeEnum == ResourceTypeEnum.VF) {
- validateJsonContainResource(restResponse.getResponse(), createdResoucesName, true);
- } else {
- validateJsonContainResource(restResponse.getResponse(), createdResoucesName, false);
- }
-
-
- /*ExpectedExternalAudit expectedExternalAudit = ElementFactory.getDefaultExternalAuditObject(AssetTypeEnum.RESOURCES, AuditingActionEnum.GET_FILTERED_ASSET_LIST, "?" + SearchCriteriaEnum.RESOURCE_TYPE.getValue() + "=" + resourceTypeEnum.toString());
- Map <AuditingFieldsKey, String> body = new HashMap<>();
- body.put(AuditingFieldsKey.AUDIT_RESOURCE_URL, expectedExternalAudit.getRESOURCE_URL());
- AuditValidationUtils.validateAuditExternalSearchAPI(expectedExternalAudit, AuditingActionEnum.GET_FILTERED_ASSET_LIST.getName(), body);*/
- }
- }
-
- // Searching for several resource types using external API
- @Test
- public void searchingForSeveralResouceTypesUsingExternalAPI() throws Exception {
- performClean();
- for(ResourceTypeEnum resourceTypeEnum: ResourceTypeEnum.values()) {
- List<String> createdResoucesName = new ArrayList<String>();
- Resource resource = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(resourceTypeEnum, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_DATABASE, UserRoleEnum.DESIGNER, true).left().value();
- createdResoucesName.add(resource.getName());
-
- RestResponse restResponse = ResourceRestUtils.getResourceListFilterByCriteria(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), AssetTypeEnum.RESOURCES.getValue(), SearchCriteriaEnum.RESOURCE_TYPE.getValue(), resourceTypeEnum.toString());
-
- Integer expectedResponseCode = 200;
- Assert.assertEquals(restResponse.getErrorCode(), expectedResponseCode);
- validateJsonContainResource(restResponse.getResponse(), createdResoucesName, true);
-
- /*ExpectedExternalAudit expectedExternalAudit = ElementFactory.getDefaultExternalAuditObject(AssetTypeEnum.RESOURCES, AuditingActionEnum.GET_FILTERED_ASSET_LIST, "?" + SearchCriteriaEnum.RESOURCE_TYPE.getValue() + "=" + resourceTypeEnum.toString());
- Map <AuditingFieldsKey, String> body = new HashMap<>();
- body.put(AuditingFieldsKey.AUDIT_RESOURCE_URL, expectedExternalAudit.getRESOURCE_URL());
- AuditValidationUtils.validateAuditExternalSearchAPI(expectedExternalAudit, AuditingActionEnum.GET_FILTERED_ASSET_LIST.getName(), body);*/
- }
- }
-
- // Searching for several resources of type VFCMT using external API
- @Test
- public void searchingForSeveralResourcesOfTypeVFCMTUsingExternalAPI() throws Exception {
- performClean();
- Random random = new Random();
- int numberOfResouceToCreate = random.nextInt(5) + 1;
- List<String> createdResoucesName = new ArrayList<String>();
-
- for(int i=0; i<numberOfResouceToCreate; i++) {
-
- Resource resource = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VFCMT, NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_DATABASE, UserRoleEnum.DESIGNER, true).left().value();
- createdResoucesName.add(resource.getName());
- }
-
- RestResponse restResponse = ResourceRestUtils.getResourceListFilterByCriteria(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), AssetTypeEnum.RESOURCES.getValue(), SearchCriteriaEnum.RESOURCE_TYPE.getValue(), ResourceTypeEnum.VFCMT.toString());
-
- Integer expectedResponseCode = 200;
- Assert.assertEquals(restResponse.getErrorCode(), expectedResponseCode);
- validateJsonContainResource(restResponse.getResponse(), createdResoucesName, true);
-
- /*ExpectedExternalAudit expectedExternalAudit = ElementFactory.getDefaultExternalAuditObject(AssetTypeEnum.RESOURCES, AuditingActionEnum.GET_FILTERED_ASSET_LIST, "?" + SearchCriteriaEnum.RESOURCE_TYPE.getValue() + "=" + ResourceTypeEnum.VFCMT.toString());
- AuditValidationUtils.validateAuditExternalSearchAPI(expectedExternalAudit, AuditingActionEnum.GET_FILTERED_ASSET_LIST.getName(), null);*/
- }
-
-
-
- @DataProvider(name="normativeResourceCategory", parallel=true)
- public static Object[][] dataProviderNormativeResourceCategory() {
- return new Object[][] {
- {ResourceCategoryEnum.ALLOTTED_RESOURCE},
- {ResourceCategoryEnum.TEMPLATE_MONITORING_TEMPLATE},
- };
- }
-
- // Verify exist of normative resource category from data provider
- @Test(dataProvider="normativeResourceCategory")
- public void normativeResourceCategory(ResourceCategoryEnum resourceCategoryEnum) throws Exception {
- RestResponse restResponse = CategoryRestUtils.getAllCategories(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), "resources");
- validateJsonContainResourceCategory(restResponse.getResponse(), resourceCategoryEnum);
-
- Resource resource = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, resourceCategoryEnum, UserRoleEnum.DESIGNER, true).left().value();
- List<String> createdResoucesName = new ArrayList<String>();
- createdResoucesName.add(resource.getName());
-
- restResponse = ResourceRestUtils.getResourceListFilterByCategory(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), AssetTypeEnum.RESOURCES.getValue(), resourceCategoryEnum.getCategory());
-
- Integer expectedResponseCode = 200;
- Assert.assertEquals(restResponse.getErrorCode(), expectedResponseCode);
- validateJsonContainResource(restResponse.getResponse(), createdResoucesName, true);
- }
-
- // Verify search filter by sub-category
- @Test
- public void validateFilterBySubcategory() throws Exception {
- ResourceCategoryEnum resourceCategoryEnum = getRandomCategoryFromResourceCategoryEnum();
-
- Resource resource = AtomicOperationUtils.createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, resourceCategoryEnum, UserRoleEnum.DESIGNER, true).left().value();
- List<String> createdResoucesName = new ArrayList<String>();
- createdResoucesName.add(resource.getName());
-
- RestResponse restResponse = ResourceRestUtils.getResourceListFilterBySubCategory(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), AssetTypeEnum.RESOURCES.getValue(), resourceCategoryEnum.getSubCategory());
-
- Integer expectedResponseCode = 200;
- Assert.assertEquals(restResponse.getErrorCode(), expectedResponseCode);
- validateJsonContainResource(restResponse.getResponse(), createdResoucesName, true);
- }
-
-
- protected ResourceCategoryEnum getRandomCategoryFromResourceCategoryEnum() throws Exception {
- Random random = new Random();
- int randint = random.nextInt(ResourceCategoryEnum.values().length);
- int i = 0;
- for(ResourceCategoryEnum resourceTypeEnum: ResourceCategoryEnum.values()) {
- if(randint == i) {
- return resourceTypeEnum;
- }
- i++;
- }
- return null;
- }
-
- protected CategoryDefinition getRandomCategory() throws Exception {
- Random random = new Random();
-
- RestResponse restResponse = CategoryRestUtils.getAllCategories(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), "resources");
- Gson gson = new Gson();
- JsonElement jelement = new JsonParser().parse(restResponse.getResponse());
- JsonArray jsonArray = jelement.getAsJsonArray();
-
- CategoryDefinition categoryDefinition = gson.fromJson(jsonArray.get(random.nextInt(jsonArray.size())), CategoryDefinition.class);
-
- return categoryDefinition;
- }
-
- protected void validateJsonContainResource(String json, List<String> resourceNameList, Boolean willBeFound) {
- int lenResourceNameList = resourceNameList.size();
- Gson gson = new Gson();
- JsonElement jsonElement = new JsonParser().parse(json);
- JsonArray jsonArray = jsonElement.getAsJsonArray();
- for(JsonElement jElement: jsonArray) {
- ResourceReqDetails jResource = gson.fromJson(jElement, ResourceReqDetails.class);
-
- if(resourceNameList.contains(jResource.getName())) {
- resourceNameList.remove(jResource.getName());
- }
- }
-
- if(resourceNameList.size() != 0 && willBeFound) {
- Assert.assertTrue(false, "Created resource not found on search filtered by category.");
- } else if (lenResourceNameList != resourceNameList.size() & !willBeFound) {
- Assert.assertTrue(false, "Some of the resources found when expect that no resource will be found.");
- }
- }
-
-
-
- protected void validateJsonContainResourceCategory(String json, ResourceCategoryEnum resourceCategoryEnum) {
- Gson gson = new Gson();
- JsonElement jelement = new JsonParser().parse(json);
- JsonArray jsonArray = jelement.getAsJsonArray();
- for(JsonElement jsonElement : jsonArray){
- CategoryDefinition categoryDefinition = gson.fromJson(jsonElement, CategoryDefinition.class);
-
- if(categoryDefinition.getName().equals(resourceCategoryEnum.getCategory())) {
- for(SubCategoryDefinition subcategory: categoryDefinition.getSubcategories()) {
- if(subcategory.getName().equals(resourceCategoryEnum.getSubCategory())) {
- return;
- }
- }
- }
-
- }
-
- Assert.assertTrue(false, "Category and subcategory not found in categories list.");
- }
-
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/UserAPIs.java b/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/UserAPIs.java
deleted file mode 100644
index 149593de60..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/UserAPIs.java
+++ /dev/null
@@ -1,551 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.externalApis;
-
-import com.google.gson.Gson;
-import com.google.gson.reflect.TypeToken;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.onap.portalsdk.core.restful.domain.EcompRole;
-import org.onap.portalsdk.core.restful.domain.EcompUser;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-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.BaseRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.EcompUserRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.UserRestUtils;
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-import java.io.IOException;
-import java.lang.reflect.Type;
-import java.util.*;
-
-import static org.testng.AssertJUnit.assertFalse;
-import static org.testng.AssertJUnit.assertTrue;
-
-public class UserAPIs extends ComponentBaseTest {
-
- @Rule
- public static TestName name = new TestName();
-
- public UserAPIs() {
- super(name, UserAPIs.class.getName());
- }
-
- public User adminUser = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-
-
- @Test
- public void createUserAllPosibleRolesThenDeactivate() throws Exception {
-
- EcompUser ecompUser = new EcompUser();
- EcompRole ecompRole = new EcompRole();
-
- List<EcompRole> allRoles = getAllRoles();
-
- for (EcompRole ecompRole2 : allRoles) {
- try {
-
- ///get list of users
- List<EcompUser> allusersList = getAllusersList();
- int sizeBeforeChange = allusersList.size();
-
- //create user
- ecompUser.setLoginId(getUser());
- ecompRole.setId((long) ecompRole2.getId());
- ecompRole.setName(ecompRole2.getName());
- System.out.println(ecompRole2.getName());
- Set<EcompRole> setRoles = new HashSet<EcompRole>();
- setRoles.add(ecompRole);
- ecompUser.setRoles(setRoles);
- RestResponse pushUser = EcompUserRestUtils.pushUser(ecompUser);
- BaseRestUtils.checkSuccess(pushUser);
-
- ///get list of users verify list size changed
- allusersList = getAllusersList();
- int sizeAfterChange = allusersList.size();
-
- Assert.assertEquals(sizeBeforeChange + 1, sizeAfterChange, "Expected that list will change.");
- sizeBeforeChange = sizeAfterChange;
- pushUser = EcompUserRestUtils.pushUser(ecompUser);
-
- //deactivate user
- ecompRole = new EcompRole();;
- List<EcompRole> list= new ArrayList<EcompRole>();
- list.add(ecompRole);
-
- RestResponse deactivateUserResponse = EcompUserRestUtils.pushUserRoles(ecompUser.getLoginId(), list);
- BaseRestUtils.checkSuccess(deactivateUserResponse);
-
- ///get list of users verify list size changed
- allusersList = getAllusersList();
- sizeAfterChange = allusersList.size();
- Assert.assertEquals(sizeBeforeChange, sizeAfterChange + 1, "Expected that list will change.");
-
- } finally {
- deleteUser(ecompUser.getLoginId());
- }
-
- }
-
- }
-
- @Test
- public void createSameUserTwiceTest() throws Exception {
-
- EcompUser ecompUser = new EcompUser();
- EcompRole ecompRole = new EcompRole();
- try {
-
- ///get list of users
- List<EcompUser> allusersList = getAllusersList();
- int sizeBeforeChange = allusersList.size();
-
- //create user
- ecompUser.setLoginId(getUser());
- ecompRole.setId((long) 1);
- ecompRole.setName("TESTER");
- Set<EcompRole> setRoles = new HashSet<EcompRole>();
- setRoles.add(ecompRole);
- ecompUser.setRoles(setRoles);
- RestResponse pushUser = EcompUserRestUtils.pushUser(ecompUser);
- BaseRestUtils.checkSuccess(pushUser);
-
- ///get list of users verify list size changed
- allusersList = getAllusersList();
- int sizeAfterChange = allusersList.size();
-
- assertTrue("List is Equel" , sizeBeforeChange != sizeAfterChange );
- pushUser = EcompUserRestUtils.pushUser(ecompUser);
-
- } finally {
- deleteUser(ecompUser.getLoginId());
- }
-
- }
-
- @Test
- public void createSameUserTwiceDiffrentDataTest() throws Exception {
-
- EcompUser ecompUser = new EcompUser();
- EcompRole ecompRole = new EcompRole();
- try {
- ///get list of users
- List<EcompUser> allusersList = getAllusersList();
- int sizeBeforeChange = allusersList.size();
-
- //create user
- ecompUser.setLoginId(getUser());
- ecompRole.setId((long) 1);
- ecompRole.setName("TESTER");
- Set<EcompRole> setRoles = new HashSet<EcompRole>();
- setRoles.add(ecompRole);
- ecompUser.setRoles(setRoles);
- RestResponse pushUser = EcompUserRestUtils.pushUser(ecompUser);
- BaseRestUtils.checkSuccess(pushUser);
-
- ///get list of users verify list size changed
- allusersList = getAllusersList();
- int sizeAfterChange = allusersList.size();
-
- assertTrue("Lists are Equal" , sizeBeforeChange != sizeAfterChange );
-
- //update role
- ecompRole.setId((long) 2);
- ecompRole.setName("DESIGNER");
- setRoles = new HashSet<EcompRole>();
- setRoles.add(ecompRole);
- ecompUser.setRoles(setRoles);
-
- pushUser = EcompUserRestUtils.pushUser(ecompUser);
-
- } finally {
- deleteUser(ecompUser.getLoginId());
- }
-
- }
-
- @Test
- public void updateUserRoleTest() throws Exception {
-
- EcompUser ecompUser = new EcompUser();
- EcompRole ecompRole = new EcompRole();
- try {
- //create user
- ecompUser.setLoginId(getUser());
- ecompRole.setId((long) 1);
- ecompRole.setName("TESTER");
- Set<EcompRole> setRoles = new HashSet<EcompRole>();
- setRoles.add(ecompRole);
- ecompUser.setRoles(setRoles);
- RestResponse pushUser = EcompUserRestUtils.pushUser(ecompUser);
- BaseRestUtils.checkSuccess(pushUser);
-
- List<EcompRole> userRolesBefore = getUserRoles(ecompUser);
-
- //update role
- ecompRole = new EcompRole();
- ecompRole.setId((long) 2);
- ecompRole.setName("DESIGNER");
- List<EcompRole> list= new ArrayList<EcompRole>();
- list.add(ecompRole);
-
- EcompUserRestUtils.pushUserRoles(ecompUser.getLoginId(), list);
-
- List<EcompRole> userRolesAfter = getUserRoles(ecompUser);
-
- assertFalse("role wasn't changed", userRolesBefore.equals(userRolesAfter));
- } finally {
- deleteUser(ecompUser.getLoginId());
- }
-
- }
-
- @Test
- public void addUserCreateResource() throws Exception {
-
- EcompUser ecompUser = new EcompUser();
- EcompRole ecompRole = new EcompRole();
- Resource resource = new Resource();
-
- try {
- //create user
- ecompUser.setLoginId(getUser());
- ecompRole.setId((long) 2);
- ecompRole.setName("DESIGNER");
- Set<EcompRole> setRoles = new HashSet<EcompRole>();
- setRoles.add(ecompRole);
- ecompUser.setRoles(setRoles);
- RestResponse pushUser = EcompUserRestUtils.pushUser(ecompUser);
- BaseRestUtils.checkSuccess(pushUser);
-
- UserRoleEnum.DESIGNER.setUserId(ecompUser.getLoginId());
- resource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
-
- } finally {
- ResourceRestUtils.deleteResource(resource.getUniqueId(), adminUser.getUserId());
- deleteUser(ecompUser.getLoginId());
- }
-
- }
-
- // First try update to Tester and verify it not success
- // Then try to deactivate and verify it not success
- @Test
- public void changeUserRoleWithCheckOutResourceThenDeactivate() throws Exception {
- EcompUser ecompUser = new EcompUser();
- EcompRole ecompRole = new EcompRole();
- Resource resource = new Resource();
- try {
- //create user
- ecompUser.setLoginId(getUser());
- ecompRole.setId((long) 2);
- ecompRole.setName("DESIGNER");
- Set<EcompRole> setRoles = new HashSet<EcompRole>();
- setRoles.add(ecompRole);
- ecompUser.setRoles(setRoles);
- RestResponse pushUser = EcompUserRestUtils.pushUser(ecompUser);
- BaseRestUtils.checkSuccess(pushUser);
-
- UserRoleEnum.DESIGNER.setUserId(ecompUser.getLoginId());
- resource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
-
- int sizeBeforeChange = getAllusersList().size();
-
- //update role
- ecompRole = new EcompRole();
- ecompRole.setId((long) 1);
- ecompRole.setName("TESTER");
- List<EcompRole> list= new ArrayList<EcompRole>();
- list.add(ecompRole);
-
- RestResponse pushUserRoles = EcompUserRestUtils.pushUserRoles(ecompUser.getLoginId(), list);
- Assert.assertEquals(pushUserRoles.getErrorCode(), (Integer)BaseRestUtils.STATUS_CODE_UNSUPPORTED_ERROR, "Not correct response code");
-
- //deactivate user
- ecompRole = new EcompRole();;
- list= new ArrayList<EcompRole>();
- list.add(ecompRole);
-
- RestResponse deactivateUserResponse = EcompUserRestUtils.pushUserRoles(ecompUser.getLoginId(), list);
- Assert.assertEquals(deactivateUserResponse.getErrorCode(), (Integer)BaseRestUtils.STATUS_CODE_UNSUPPORTED_ERROR, "Not correct response code");
-
- ///get list of users verify list size changed
- int sizeAfterChange = getAllusersList().size();
- Assert.assertEquals(sizeBeforeChange, sizeAfterChange, "Expected that list will not change.");
-
- } finally {
- ResourceRestUtils.deleteResource(resource.getUniqueId(), adminUser.getUserId());
- deleteUser(ecompUser.getLoginId());
- }
- }
-
- /*@Test
- public void deactivateUserRoleWithStartTestingResource() throws Exception {
-
- EcompUser ecompUser = new EcompUser();
- EcompRole ecompRole = new EcompRole();
- Resource resource= new Resource();
-
- try {
- //create user
- ecompUser.setLoginId(getUser());
- ecompRole.setId((long) 2);
- ecompRole.setName("DESIGNER");
- Set<EcompRole> setRoles = new HashSet<EcompRole>();
- setRoles.add(ecompRole);
- ecompUser.setRoles(setRoles);
- RestResponse pushUser = EcompUserRestUtils.pushUser(ecompUser);
- BaseRestUtils.checkSuccess(pushUser);
- int sizeBeforeChange = getAllusersList().size();
- UserRoleEnum.DESIGNER.setUserId(ecompUser.getLoginId());
-
- resource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
- AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFICATIONREQUEST, true);
-
-
- //update role
- ecompRole = new EcompRole();
- ecompRole.setId((long) 1);
- ecompRole.setName("TESTER");
- List<EcompRole> list= new ArrayList<EcompRole>();
- list.add(ecompRole);
-
- RestResponse pushUserRoles = EcompUserRestUtils.pushUserRoles(ecompUser.getLoginId(), list);
- BaseRestUtils.checkSuccess(pushUserRoles);
-
- UserRoleEnum.TESTER.setUserId(ecompUser.getLoginId());
- AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.TESTER, LifeCycleStatesEnum.STARTCERTIFICATION, true);
-
- //deactivate user
- ecompRole = new EcompRole();;
- list= new ArrayList<EcompRole>();
- list.add(ecompRole);
-
- RestResponse deactivateUserResponse = EcompUserRestUtils.pushUserRoles(ecompUser.getLoginId(), list);
- Assert.assertEquals(deactivateUserResponse.getErrorCode(), (Integer)BaseRestUtils.STATUS_CODE_UNSUPPORTED_ERROR, "Not correct response code");
-
- ///get list of users verify list size changed
- int sizeAfterChange = getAllusersList().size();
- Assert.assertEquals(sizeBeforeChange, sizeAfterChange, "Expected that list will not change.");
-
- } finally {
- ResourceRestUtils.deleteResource(resource.getUniqueId(), adminUser.getUserId());
- deleteUser(ecompUser.getLoginId());
- }
- }*/
-
- @Test
- public void changeUserRoleWithStartTestingResource() throws Exception {
-
- EcompUser ecompUser = new EcompUser();
- EcompRole ecompRole = new EcompRole();
- Resource resource= new Resource();
-
- try {
- //create user
- ecompUser.setLoginId(getUser());
- ecompRole.setId((long) 2);
- ecompRole.setName("DESIGNER");
- Set<EcompRole> setRoles = new HashSet<EcompRole>();
- setRoles.add(ecompRole);
- ecompUser.setRoles(setRoles);
- RestResponse pushUser = EcompUserRestUtils.pushUser(ecompUser);
- BaseRestUtils.checkSuccess(pushUser);
-
- UserRoleEnum.DESIGNER.setUserId(ecompUser.getLoginId());
-
- resource = AtomicOperationUtils.createResourceByType(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, true).left().value();
- AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.STARTCERTIFICATION, true);
-
-
- //update role
- ecompRole = new EcompRole();
- ecompRole.setId((long) 1);
- ecompRole.setName("TESTER");
- List<EcompRole> list= new ArrayList<EcompRole>();
- list.add(ecompRole);
-
- RestResponse pushUserRoles = EcompUserRestUtils.pushUserRoles(ecompUser.getLoginId(), list);
- BaseRestUtils.checkSuccess(pushUserRoles);
-
- } finally {
- ResourceRestUtils.deleteResource(resource.getUniqueId(), adminUser.getUserId());
- deleteUser(ecompUser.getLoginId());
- }
- }
-
- @Test
- public void fillAllEcompFields() throws Exception {
- EcompUser ecompUser = new EcompUser();
- EcompRole ecompRole = new EcompRole();
- try {
-
- ///get list of users
- List<EcompUser> allusersList = getAllusersList();
- int sizeBeforeChange = allusersList.size();
-
- //create user
- ecompUser.setLoginId(getUser());
- ecompUser.setOrgId((long) 123);
- ecompUser.setManagerId("ci4321");
- ecompUser.setFirstName("firstName");
- ecompUser.setMiddleInitial("middleInitial");
- ecompUser.setLastName("lastName");
- ecompUser.setPhone("phone");
- ecompUser.setEmail("email@email.com");
- ecompUser.setHrid("hrid");
- ecompUser.setOrgUserId("orgUserId");
- ecompUser.setOrgCode("orgCode");
- ecompUser.setOrgManagerUserId("ci1234");
- ecompUser.setJobTitle("jobTitle");
- ecompUser.setActive(true);
-
-
- ecompRole.setId((long) 1);
- ecompRole.setName("TESTER");
- Set<EcompRole> setRoles = new HashSet<EcompRole>();
- setRoles.add(ecompRole);
- ecompUser.setRoles(setRoles);
- RestResponse pushUser = EcompUserRestUtils.pushUser(ecompUser);
- BaseRestUtils.checkSuccess(pushUser);
-
- ///get list of users verify list size changed
- allusersList = getAllusersList();
- int sizeAfterChange = allusersList.size();
-
- assertTrue("List is Equel" , sizeBeforeChange != sizeAfterChange );
-
- } finally {
-
- deleteUser(ecompUser.getLoginId());
- }
- }
-
- @Test
- public void missingMandatoryFieldRole() throws Exception {
-
- EcompUser ecompUser = new EcompUser();
- try {
- ///get list of users
- List<EcompUser> allusersList = getAllusersList();
- int sizeBeforeChange = allusersList.size();
-
- //create user
- ecompUser.setLoginId(getUser());
- RestResponse pushUser = EcompUserRestUtils.pushUser(ecompUser);
- BaseRestUtils.checkSuccess(pushUser);
-
- ///get list of users verify list size changed
- allusersList = getAllusersList();
- int sizeAfterChange = allusersList.size();
-
- assertTrue("List is Equel" , sizeBeforeChange != sizeAfterChange );
-
- } finally {
- deleteUser(ecompUser.getLoginId());
- }
- }
-
- @Test
- public void missingMandatoryFieldATTid() throws Exception {
-
- EcompUser ecompUser = new EcompUser();
- EcompRole ecompRole = new EcompRole();
- try {
-
- //create user
- ecompUser.setLoginId("");
- ecompRole.setId((long) 1);
- ecompRole.setName("TESTER");
- Set<EcompRole> setRoles = new HashSet<EcompRole>();
- setRoles.add(ecompRole);
- ecompUser.setRoles(setRoles);
- RestResponse pushUser = EcompUserRestUtils.pushUser(ecompUser);
- assertTrue("wrong response code :" , pushUser.getErrorCode() == BaseRestUtils.STATUS_CODE_INVALID_CONTENT);
-
- } finally {
- deleteUser(ecompUser.getLoginId());
- }
-
-
- }
-
- private List<EcompRole> getUserRoles(EcompUser ecompUser) throws IOException {
- RestResponse userRoles = EcompUserRestUtils.getUserRoles(ecompUser.getLoginId());
- Type listType = new TypeToken<List<EcompRole>>() {}.getType();
- List<EcompRole> roleList = new Gson().fromJson(userRoles.getResponse(), listType);
- return roleList;
- }
-
- private void deleteUser(String userId) throws IOException {
- User defaultUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- defaultUser.setUserId(userId);
-
- UserRestUtils.deleteUser(defaultUser, adminUser, true);
- }
-
- private List<EcompUser> getAllusersList() throws IOException {
- RestResponse allUsers = EcompUserRestUtils.getAllUsers();
-
- Type listType = new TypeToken<List<EcompUser>>() {}.getType();
- List<EcompUser> usersList = new Gson().fromJson(allUsers.getResponse(), listType);
-
- return usersList;
- }
-
- private List<EcompRole> getAllRoles() throws IOException {
- RestResponse allRoles = EcompUserRestUtils.getAllAvailableRoles();
-
- Type listType = new TypeToken<List<EcompRole>>() {}.getType();
- List<EcompRole> availableRoles = new Gson().fromJson(allRoles.getResponse(), listType);
-
- return availableRoles;
- }
-
- private String getUser() {
- int nextInt = rnd.nextInt(8999) + 1000;
-// String returnMe = "ci"+ new BigInteger(getRandomNumber(4));
- String returnMe = "ci"+ nextInt;
- System.out.println(returnMe);
-
-
- return returnMe;
- }
-
- private static Random rnd = new Random();
-
- public static String getRandomNumber(int digCount) {
- StringBuilder sb = new StringBuilder(digCount);
- for(int i=1; i <= digCount; i++){
- sb.append((char)('0' + rnd.nextInt(10)));
- }
- return sb.toString();
- }
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/VFCMTExternalAPI.java b/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/VFCMTExternalAPI.java
deleted file mode 100644
index 8c3404ec67..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/VFCMTExternalAPI.java
+++ /dev/null
@@ -1,380 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.externalApis;
-
-import com.google.gson.Gson;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import org.json.simple.parser.JSONParser;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.datatypes.enums.AssetTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceAssetStructure;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceExternalReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.SearchCriteriaEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.AssetRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtilsExternalAPI;
-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.DataProvider;
-import org.testng.annotations.Test;
-
-import java.util.List;
-
-import static java.util.Arrays.asList;
-import static org.testng.Assert.assertTrue;
-
-public class VFCMTExternalAPI extends ComponentBaseTest {
-
- private static Logger log = LoggerFactory.getLogger(CRUDExternalAPI.class.getName());
- protected static final String UPLOAD_ARTIFACT_PAYLOAD = "UHVUVFktVXNlci1LZXktRmlsZS0yOiBzc2gtcnNhDQpFbmNyeXB0aW9uOiBhZXMyNTYtY2JjDQpDb21tZW5wOA0K";
- protected static final String UPLOAD_ARTIFACT_NAME = "TLV_prv.ppk";
-
- protected Config config = Config.instance();
- protected String contentTypeHeaderData = "application/json";
- protected String acceptHeaderDate = "application/json";
-
-
-
- protected Gson gson = new Gson();
- protected JSONParser jsonParser = new JSONParser();
-
-
- protected String serviceVersion;
- protected ResourceReqDetails resourceDetails;
- protected User sdncUserDetails;
- protected ServiceReqDetails serviceDetails;
-
-
-// @BeforeMethod
-// public synchronized void init() throws Exception{
-// AtomicOperationUtils.createDefaultConsumer(true);
-// }
-
-
- @Rule
- public static TestName name = new TestName();
-
- public VFCMTExternalAPI() {
- super(name, VFCMTExternalAPI.class.getName());
-
- }
-
- // Create VFCMT - validate response + search external api + retrieve metadata via external api - success flow
- @Test
- public void createVfcmt() throws Exception {
- User defaultUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- ResourceExternalReqDetails defaultResource = ElementFactory.getDefaultResourceByType("ci", ResourceCategoryEnum.TEMPLATE_MONITORING_TEMPLATE, defaultUser.getUserId(), ResourceTypeEnum.VFCMT.toString());
-
- RestResponse restResponse = ResourceRestUtilsExternalAPI.createResource(defaultResource, defaultUser);
- ResourceAssetStructure parsedCreatedResponse = gson.fromJson(restResponse.getResponse(), ResourceAssetStructure.class);
-
- /* // auditing verification
- AuditingActionEnum action = AuditingActionEnum.CREATE_RESOURCE_BY_API;
- Map <AuditingFieldsKey, String> body = new HashMap<>();
- body.put(AuditingFieldsKey.AUDIT_RESOURCE_NAME, parsedCreatedResponse.getName());
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory.getDefaultCreateResourceExternalAPI(parsedCreatedResponse.getName());
- AuditValidationUtils.validateAuditExternalCreateResource(expectedResourceAuditJavaObject, action.getName(), body);*/
-
- // search for vfcmt via external api - validate created resource exist
- RestResponse searchResult = ResourceRestUtils.getResourceListFilterByCriteria(ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), AssetTypeEnum.RESOURCES.getValue(), SearchCriteriaEnum.RESOURCE_TYPE.getValue(), ResourceTypeEnum.VFCMT.toString());
- JsonArray listSearchResult = gson.fromJson(searchResult.getResponse(), JsonArray.class);
- boolean found = false;
- for(JsonElement result: listSearchResult) {
- ResourceAssetStructure parsedResult = gson.fromJson(result, ResourceAssetStructure.class);
- if(parsedResult.getName().equals(defaultResource.getName())) {
- found = true;
- }
- }
- Assert.assertEquals(found, true);
-
- // get created vfcmt metadata via external api - validate data
- RestResponse resourceMetadata = AssetRestUtils.getAssetMetadataByAssetTypeAndUuid(true, AssetTypeEnum.RESOURCES, parsedCreatedResponse.getUuid());
- ResourceAssetStructure parsedMetadata = gson.fromJson(resourceMetadata.getResponse(), ResourceAssetStructure.class);
-
- Assert.assertEquals(parsedCreatedResponse.getUuid(), parsedMetadata.getUuid());
- Assert.assertEquals(parsedCreatedResponse.getInvariantUUID(), parsedMetadata.getInvariantUUID());
- Assert.assertEquals(parsedCreatedResponse.getName(), parsedMetadata.getName());
- Assert.assertEquals(parsedCreatedResponse.getVersion(), parsedMetadata.getVersion());
- Assert.assertEquals(parsedCreatedResponse.getCategory(), parsedMetadata.getCategory());
- Assert.assertEquals(parsedCreatedResponse.getSubCategory(), parsedMetadata.getSubCategory());
- Assert.assertEquals(parsedCreatedResponse.getResourceType(), parsedMetadata.getResourceType());
- Assert.assertEquals(parsedCreatedResponse.getLifecycleState(), parsedMetadata.getLifecycleState());
- Assert.assertEquals(parsedCreatedResponse.getLastUpdaterUserId(), parsedMetadata.getLastUpdaterUserId());
- Assert.assertEquals(parsedCreatedResponse.getLastUpdaterFullName(), parsedMetadata.getLastUpdaterFullName());
- Assert.assertEquals(parsedCreatedResponse.getToscaResourceName(), parsedMetadata.getToscaResourceName());
- }
-
-
-
- // Create two VFCMT with same name - validate error + audit - failure flow
- @Test
- public void createTwoVfcmtWithSameName() throws Exception {
- User defaultUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- ResourceExternalReqDetails defaultResource = ElementFactory.getDefaultResourceByType("ci", ResourceCategoryEnum.TEMPLATE_MONITORING_TEMPLATE, defaultUser.getUserId(), ResourceTypeEnum.VFCMT.toString());
-
- // create vfcmt
- RestResponse firstTryToCreate = ResourceRestUtilsExternalAPI.createResource(defaultResource, defaultUser);
- ResourceAssetStructure parsedCreatedResponse = gson.fromJson(firstTryToCreate.getResponse(), ResourceAssetStructure.class);
-
- /*// auditing verification
- AuditingActionEnum action = AuditingActionEnum.CREATE_RESOURCE_BY_API;
- Map <AuditingFieldsKey, String> body = new HashMap<>();
- body.put(AuditingFieldsKey.AUDIT_RESOURCE_NAME, parsedCreatedResponse.getName());
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory.getDefaultCreateResourceExternalAPI(parsedCreatedResponse.getName());
- AuditValidationUtils.validateAuditExternalCreateResource(expectedResourceAuditJavaObject, action.getName(), body);*/
-
- // try to create another vfcmt wit same name
- RestResponse secondTryToCreate = ResourceRestUtilsExternalAPI.createResource(defaultResource, defaultUser);
- Assert.assertEquals((int)secondTryToCreate.getErrorCode(), 409);
-
- /*body.put(AuditingFieldsKey.AUDIT_STATUS, "409");
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_NAME_ALREADY_EXIST.name());
- List<String> variables = asList(ComponentTypeEnum.RESOURCE.getValue(), defaultResource.getName());
- expectedResourceAuditJavaObject.setDesc(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
- expectedResourceAuditJavaObject.setStatus("409");
- AuditValidationUtils.validateAuditExternalCreateResource(expectedResourceAuditJavaObject, action.getName(), body);*/
- }
-
-
-
- @DataProvider(name="createVfcmtVariousFailureFlows", parallel=true)
- public static Object[][] dataProviderCreateVfcmtVariousFailureFlows() {
- return new Object[][] {
- {"name_missing"},
- {"name_to_long"},
- {"name_with_invalid_char"},
- {"description_missing"},
- {"description_to_long"},
- {"description_with_invalid_char"},
- {"resource_type_missing"},
- {"resource_type_invalid"},
- {"category_type_missing"},
- {"category_type_invalid"},
- {"subcategory_type_missing"},
- {"subcategory_type_invalid"},
- {"vendor_name_missing"},
- {"vendor_name_to_long"},
- {"vendor_name_with_invalid_char"},
- {"vendor_release_missing"},
- {"vendor_release_to_long"},
- {"vendor_release_with_invalid_char"},
- {"tags_missing"},
- {"tags_to_long"},
- {"tags_invalid"},
- {"icon_missing"},
- {"user_contact_missing"},
- {"user_contact_invalid"},
- };
- }
-
- // Various failure flows
- @Test(dataProvider="createVfcmtVariousFailureFlows")
- public void createVfcmtVariousFailureFlows(String flow) throws Exception {
-
- User defaultUser = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- ResourceExternalReqDetails defaultResource = ElementFactory.getDefaultResourceByType("ci", ResourceCategoryEnum.TEMPLATE_MONITORING_TEMPLATE, defaultUser.getUserId(), ResourceTypeEnum.VFCMT.toString());
-
- ErrorInfo errorInfo = null;
- /*List<String> variables = null;
- AuditingActionEnum action = AuditingActionEnum.CREATE_RESOURCE_BY_API;
- ExpectedResourceAuditJavaObject expectedResourceAuditJavaObject = ElementFactory.getDefaultCreateResourceExternalAPI(defaultResource.getName());
- Map <AuditingFieldsKey, String> body = new HashMap<>();
- body.put(AuditingFieldsKey.AUDIT_RESOURCE_NAME, defaultResource.getName());*/
-
- switch (flow) {
- case "name_missing":
- defaultResource.setName("");
- List<String> resourceTags = defaultResource.getTags();
- resourceTags.add("");
- defaultResource.setTags(resourceTags);
- errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_COMPONENT_NAME.name());
- /*expectedResourceAuditJavaObject.setResourceName("");
- variables = asList(ComponentTypeEnum.RESOURCE.getValue());
- body.put(AuditingFieldsKey.AUDIT_RESOURCE_NAME, "");*/
- break;
- case "name_to_long":
- defaultResource.setName("asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1");
- errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_NAME_EXCEEDS_LIMIT.name());
- /*expectedResourceAuditJavaObject.setResourceName("asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1");
- variables = asList(ComponentTypeEnum.RESOURCE.getValue(), "1024");
- body.put(AuditingFieldsKey.AUDIT_RESOURCE_NAME, "asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1");*/
- break;
- case "name_with_invalid_char":
- defaultResource.setName("!@#$%^&*(");
- errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_COMPONENT_NAME.name());
- /*expectedResourceAuditJavaObject.setResourceName("!@#$%^&*(");
- variables = asList(ComponentTypeEnum.RESOURCE.getValue());
- body.put(AuditingFieldsKey.AUDIT_RESOURCE_NAME, "!@#$%^&*(");*/
- break;
- case "description_missing":
- defaultResource.setDescription("");
- errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_MISSING_DESCRIPTION.name());
- /*expectedResourceAuditJavaObject.setDesc("");
- variables = asList(ComponentTypeEnum.RESOURCE.getValue());*/
- break;
- case "description_to_long":
- defaultResource.setDescription("asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1");
- errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_DESCRIPTION_EXCEEDS_LIMIT.name());
- /*expectedResourceAuditJavaObject.setDesc("asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjk1");
- variables = asList(ComponentTypeEnum.RESOURCE.getValue(), "1024");*/
- break;
- case "description_with_invalid_char":
- defaultResource.setDescription("\uC2B5");
- errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_INVALID_DESCRIPTION.name());
- /*expectedResourceAuditJavaObject.setDesc("t");
- variables = asList(ComponentTypeEnum.RESOURCE.getValue());*/
- break;
- // TODO: defect on the flow - need to get error instead create VFC
- case "resource_type_missing":
- defaultResource.setResourceType("");
- errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_CONTENT.name());
- /*expectedResourceAuditJavaObject.setResourceType("");
- variables = asList(ComponentTypeEnum.RESOURCE.getValue());*/
- break;
- // TODO: in audit RESOURCE_NAME is empty
- case "resource_type_invalid":
- defaultResource.setResourceType("invalid");
- errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_RESOURCE_TYPE.name());
- /*expectedResourceAuditJavaObject.setResourceType(ComponentTypeEnum.RESOURCE.getValue());
- variables = asList(ComponentTypeEnum.RESOURCE.getValue());*/
- break;
- case "category_type_missing":
- defaultResource.setCategory("");
- errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_MISSING_CATEGORY.name());
- /*variables = asList(ComponentTypeEnum.RESOURCE.getValue());*/
- break;
- // TODO: not correct response code in this flow - 500 instead 400
- case "category_type_invalid":
- defaultResource.setCategory("invalid");
- errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_INVALID_CATEGORY.name());
- /*variables = asList(ComponentTypeEnum.RESOURCE.getValue());*/
- break;
- case "subcategory_type_missing":
- defaultResource.setSubcategory("");
- errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_MISSING_SUBCATEGORY.name());
- /*variables = asList(ComponentTypeEnum.RESOURCE.getValue());*/
- break;
- // TODO: not correct error - it not missing it not correct
- case "subcategory_type_invalid":
- defaultResource.setSubcategory("invalid");
- errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_INVALID_SUBCATEGORY.name());
- /*variables = asList(ComponentTypeEnum.RESOURCE.getValue());*/
- break;
- case "vendor_name_missing":
- defaultResource.setVendorName("");
- errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_VENDOR_NAME.name());
- /*variables = asList(ComponentTypeEnum.RESOURCE.getValue());*/
- break;
- case "vendor_name_to_long":
- defaultResource.setVendorName("asdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdff");
- errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.VENDOR_NAME_EXCEEDS_LIMIT.name());
- /*variables = asList(ValidationUtils.VENDOR_NAME_MAX_LENGTH.toString());*/
- break;
- case "vendor_name_with_invalid_char":
- defaultResource.setVendorName("!@#$*()&*^%$#@");
- errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_VENDOR_NAME.name());
- /*variables = asList(ComponentTypeEnum.RESOURCE.getValue());*/
- break;
- case "vendor_release_missing":
- defaultResource.setVendorRelease("");
- errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.MISSING_VENDOR_RELEASE.name());
- /*variables = asList(ComponentTypeEnum.RESOURCE.getValue());*/
- break;
- case "vendor_release_to_long":
- defaultResource.setVendorRelease("asdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdff");
- errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.VENDOR_RELEASE_EXCEEDS_LIMIT.name());
- /*variables = asList("25");*/
- break;
- case "vendor_release_with_invalid_char":
- defaultResource.setVendorRelease("!@#$*()&*^%$#@");
- errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_VENDOR_RELEASE.name());
- /*variables = asList(ComponentTypeEnum.RESOURCE.getValue());*/
- break;
- case "tags_missing":
- defaultResource.setTags(asList(""));
- errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.INVALID_FIELD_FORMAT.name());
- /*variables = asList(ComponentTypeEnum.RESOURCE.getValue(), "tag");*/
- break;
- case "tags_to_long":
- defaultResource.setTags(asList("asdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdffasdff"));
- errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_SINGLE_TAG_EXCEED_LIMIT.name());
- /*variables = asList("1024");*/
- break;
- case "tags_invalid":
- defaultResource.setTags(asList("asfdg"));
- errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_INVALID_TAGS_NO_COMP_NAME.name());
- /*variables = asList(ComponentTypeEnum.RESOURCE.getValue());*/
- break;
- case "icon_missing":
- defaultResource.setIcon("");
- errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_MISSING_ICON.name());
- /*variables = asList(ComponentTypeEnum.RESOURCE.getValue());*/
- break;
- case "user_contact_missing":
- defaultResource.setContactId("");
- errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_MISSING_CONTACT.name());
- /*variables = asList(ComponentTypeEnum.RESOURCE.getValue());*/
- break;
- case "user_contact_invalid":
- default:
- defaultResource.setContactId("abcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfdabcderfffdfdfd");
- errorInfo = ErrorValidationUtils.parseErrorConfigYaml(ActionStatus.COMPONENT_INVALID_CONTACT.name());
- /*variables = asList(ComponentTypeEnum.RESOURCE.getValue());*/
- break;
- }
-
- // create vfcmt
- RestResponse restResponse = ResourceRestUtilsExternalAPI.createResource(defaultResource, defaultUser);
- assertTrue(errorInfo.getCode().equals(restResponse.getErrorCode()), "Expected response code on [" + flow + "] is: " + errorInfo.getCode() + ", actual is: " + restResponse.getErrorCode());
-
- /*expectedResourceAuditJavaObject.setStatus(errorInfo.getCode().toString());
- expectedResourceAuditJavaObject.setDesc(AuditValidationUtils.buildAuditDescription(errorInfo, variables));
- AuditValidationUtils.validateAuditExternalCreateResource(expectedResourceAuditJavaObject, action.getName(), body);*/
-
- }
-
-
-
-
-
-
-
-
-
-
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/internalApis/annotations/AnnotationsTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/internalApis/annotations/AnnotationsTest.java
deleted file mode 100644
index fdb0e8750b..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/internalApis/annotations/AnnotationsTest.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.internalApis.annotations;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Maps;
-import org.apache.commons.lang3.tuple.Pair;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.openecomp.sdc.be.dao.utils.MapUtil;
-import org.openecomp.sdc.be.datatypes.elements.Annotation;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.*;
-import org.openecomp.sdc.be.model.utils.ComponentUtilities;
-import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-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.http.RestResponse;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaAnnotationsTypesDefinition;
-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.FileHandling;
-import org.openecomp.sdc.ci.tests.utils.rest.PropertyRestUtils;
-import org.testng.annotations.Test;
-
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-import static java.util.stream.Collectors.groupingBy;
-import static java.util.stream.Collectors.toMap;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertTrue;
-import static org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaAnnotationsTypesDefinition.SOURCE_ANNOTATION;
-import static org.openecomp.sdc.ci.tests.utils.ToscaTypesDefinitionUtils.getToscaAnnotationsFromCsar;
-import static org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils.*;
-import static org.openecomp.sdc.ci.tests.utils.general.ElementFactory.getDefaultUser;
-import static org.openecomp.sdc.ci.tests.utils.rest.InputsRestUtils.deleteInputFromComponent;
-import static org.openecomp.sdc.ci.tests.utils.validation.BaseValidationUtils.checkSuccess;
-import static org.springframework.util.CollectionUtils.isEmpty;
-
-public class AnnotationsTest extends ComponentBaseTest{
-
- private static final String PCM_FLAVOR_NAME = "pcm_flavor_name";
- private static final String AVAILABILITY_ZONE = "availabilityzone_name";
- private static final String NET_NAME = "net_name";
- private static final String NF_NAMING_CODE = "nf_naming_code";
- private static final String [] PROPS_TO_DECLARE = new String [] {PCM_FLAVOR_NAME, AVAILABILITY_ZONE, NET_NAME, NF_NAMING_CODE};
- private static final String CSAR_WITH_ANNOTATIONS_V1 = "SIROV_annotations_VSP.csar";
- private static final String CSAR_WITH_ANNOTATIONS_V2 = "SIROV_annotations_VSP_V2.csar";
- private static final String SRIOV_PATH = FileHandling.getFilePath("SRIOV");
-
- @Rule
- public static TestName name = new TestName();
-
- public AnnotationsTest() {
- super(name, AnnotationsTest.class.getName());
- }
-
- @Test
- public void whenExportingToscaOfTopologyTemplate_annotationTypeYamlExist_sourceAnnotationExist() throws Exception {
- User sdncModifierDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- ResourceReqDetails resourceDetails = ElementFactory.getDefaultResourceByType("exportToscaAnnotationsYml", NormativeTypesEnum.ROOT, ResourceCategoryEnum.GENERIC_INFRASTRUCTURE, sdncModifierDetails.getUserId(), ResourceTypeEnum.VF.toString());
- Resource createdVF = AtomicOperationUtils.createResourceByResourceDetails(resourceDetails, UserRoleEnum.DESIGNER, true).left().value();
- ToscaAnnotationsTypesDefinition toscaAnnotations = getToscaAnnotationsFromCsar(createdVF, sdncModifierDetails);
- assertTrue(toscaAnnotations.getAnnotation_types().containsKey(SOURCE_ANNOTATION));
- }
-
- @Test
- public void whenDeclaringAnInputFromPropertyWhichOriginatedFromInputWithAnnotation_copyAnnotationsToNewInput() throws Exception {
- Resource vfWithAnnotationsV1 = importAnnotationsCsarAndCheckIn();
- Service service = createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
- ComponentInstance createdCmptInstance = addComponentInstanceToComponentContainer(vfWithAnnotationsV1, service).left().value();
- Service fetchedService = getServiceObject(service.getUniqueId());
- List<ComponentInstanceInput> declaredProps = declareProperties(fetchedService, createdCmptInstance, PROPS_TO_DECLARE);
- verifyAnnotationsOnDeclaredInputs(vfWithAnnotationsV1, fetchedService, declaredProps);
- Service serviceAfterPropertyDeclaration = getServiceObject(service.getUniqueId());
- deleteDeclaredInputsAndVerifySuccess(serviceAfterPropertyDeclaration);
- }
-
- @Test
- public void onChangeVersion_copyAnnotationsFromNewVspToServiceInputs() throws Exception {
- Resource vfWithAnnotationsV1 = importAnnotationsCsarAndCheckIn();
- Service service = createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
- ComponentInstance createdCmptInstance = addComponentInstanceToComponentContainer(vfWithAnnotationsV1, service).left().value();
- Service fetchedService = getServiceObject(service.getUniqueId());
- declareProperties(fetchedService, createdCmptInstance, PROPS_TO_DECLARE);
-
- Resource vfWithAnnotationsV2 = updateAnnotationsCsarAndCheckIn(vfWithAnnotationsV1);
- Pair<Component, ComponentInstance> changeVersionRes = changeComponentInstanceVersion(service, createdCmptInstance, vfWithAnnotationsV2, UserRoleEnum.DESIGNER, true).left().value();
- Component serviceAfterChangeVersion = changeVersionRes.getKey();
- ComponentInstance newInstance = changeVersionRes.getRight();
- List<ComponentInstanceInput> declaredProps = getInstanceProperties(serviceAfterChangeVersion, newInstance.getUniqueId(), PROPS_TO_DECLARE);
- verifyAnnotationsOnDeclaredInputs(vfWithAnnotationsV2, serviceAfterChangeVersion, declaredProps);
-
- }
-
- private void verifyAnnotationsOnDeclaredInputs(Resource vfWithAnnotations, Component fetchedService, List<ComponentInstanceInput> declaredProps) throws Exception {
- Map<String, InputDefinition> serviceLevelInputsByProperty = getCreatedInputsByProperty(fetchedService, declaredProps);
- Map<String, List<Annotation>> annotationsFromVfLevelInputs = getAnnotationsByInputName(vfWithAnnotations);
- verifyInputsAnnotation(serviceLevelInputsByProperty, declaredProps, annotationsFromVfLevelInputs);
- }
-
- private Map<String, List<Annotation>> getAnnotationsByInputName(Resource resource) {
- return resource.getInputs()
- .stream()
- .collect(toMap(InputDefinition::getName, input -> ComponentUtilities.getInputAnnotations(resource, input.getName())));
- }
-
- private void deleteDeclaredInputsAndVerifySuccess(Component service) throws Exception {
- for (InputDefinition declaredInput : service.getInputs()) {
- RestResponse deleteInputResponse = deleteInputFromComponent(service, declaredInput.getUniqueId());
- checkSuccess(deleteInputResponse);
- }
- Service fetchedService = getServiceObject(service.getUniqueId());
- assertThat(fetchedService.getInputs()).isNullOrEmpty();
- }
-
- private void verifyInputsAnnotation(Map<String, InputDefinition> inputsByProperty, List<ComponentInstanceInput> declaredProps, Map<String, List<Annotation>> expectedAnnotationsByInput) {
- Map<String, ComponentInstanceInput> propsByName = MapUtil.toMap(declaredProps, ComponentInstanceInput::getName);
-
- InputDefinition declaredFromPcmFlavourName = findInputDeclaredFromProperty(PCM_FLAVOR_NAME, inputsByProperty, propsByName);
- verifyInputAnnotations(declaredFromPcmFlavourName, expectedAnnotationsByInput.get(PCM_FLAVOR_NAME));
-
- InputDefinition declaredFromAvailabilityZone = findInputDeclaredFromProperty(AVAILABILITY_ZONE, inputsByProperty, propsByName);
- verifyInputAnnotations(declaredFromAvailabilityZone, expectedAnnotationsByInput.get(AVAILABILITY_ZONE));
-
- InputDefinition declaredFromNetName = findInputDeclaredFromProperty(NET_NAME, inputsByProperty, propsByName);
- verifyInputAnnotations(declaredFromNetName, expectedAnnotationsByInput.get(NET_NAME));
-
- InputDefinition declaredFromNFNamingCode = findInputDeclaredFromProperty(NF_NAMING_CODE, inputsByProperty, propsByName);
- verifyInputHasNoAnnotations(declaredFromNFNamingCode);
- }
-
- private void verifyInputHasNoAnnotations(InputDefinition inputWithoutAnnotation) {
- assertThat(inputWithoutAnnotation.getAnnotations()).isNullOrEmpty();
- }
-
- private InputDefinition findInputDeclaredFromProperty(String propName, Map<String, InputDefinition> inputsByProperty, Map<String, ComponentInstanceInput> propsByName) {
- String propId = propsByName.get(propName).getUniqueId();
- return inputsByProperty.get(propId);
- }
-
- private Map<String, InputDefinition> getCreatedInputsByProperty(Component service, List<ComponentInstanceInput> declaredProps) throws Exception {
- Service fetchedService = getServiceObject(service.getUniqueId());
- List<InputDefinition> inputs = fetchedService.getInputs();
- return filterInputsCreatedByDeclaringFromProperties(declaredProps, inputs);
- }
-
- private Map<String, InputDefinition> filterInputsCreatedByDeclaringFromProperties(List<ComponentInstanceInput> declaredProps, List<InputDefinition> inputs) {
- List<String> declaredPropsIds = declaredProps.stream().map(ComponentInstanceInput::getUniqueId).collect(Collectors.toList());
- Map<String, InputDefinition> inputsByPropertyId = MapUtil.toMap(inputs, InputDefinition::getPropertyId);
- return Maps.filterKeys(inputsByPropertyId, declaredPropsIds::contains);
- }
-
- private Resource importAnnotationsCsarAndCheckIn() throws Exception {
- Resource annotationsVF = importResourceFromCsar(ResourceTypeEnum.VF, UserRoleEnum.DESIGNER, CSAR_WITH_ANNOTATIONS_V1, SRIOV_PATH);
- changeComponentState(annotationsVF, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
- return annotationsVF;
- }
-
- private Resource updateAnnotationsCsarAndCheckIn(Resource vfToUpdate) throws Exception {
- changeComponentState(vfToUpdate, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true);
- Resource annotationsVfV2 = updateResourceFromCsar(vfToUpdate, UserRoleEnum.DESIGNER, CSAR_WITH_ANNOTATIONS_V2, SRIOV_PATH);
- changeComponentState(annotationsVfV2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true);
- return annotationsVfV2;
- }
-
- private List<ComponentInstanceInput> declareProperties(Service service, ComponentInstance instance, String ... propertiesToDeclareNames) throws Exception {
- Map<String, List<ComponentInstanceInput>> propertiesToDeclare = getServiceInstancesProps(service, instance.getUniqueId(), propertiesToDeclareNames);
- RestResponse restResponse = PropertyRestUtils.declareProporties(service, propertiesToDeclare, getDefaultUser(UserRoleEnum.DESIGNER));
- checkSuccess(restResponse);
- return propertiesToDeclare.get(instance.getUniqueId());
- }
-
- private List<ComponentInstanceInput> getInstanceProperties(Component service, String ofInstance, String ... propsNames) {
- return getServiceInstancesProps(service, ofInstance, propsNames).get(ofInstance);
- }
-
- private void verifyInputAnnotations(InputDefinition input, List<Annotation> expectedAnnotations) {
- if (isEmpty(expectedAnnotations)) {
- assertThat(input.getAnnotations()).isNullOrEmpty();
- return;
- }
- assertThat(input.getAnnotations())
- .usingElementComparatorOnFields("type", "name", "properties")
- .isNotEmpty()
- .containsExactlyElementsOf(expectedAnnotations);
- }
-
- private Map<String, List<ComponentInstanceInput>> getServiceInstancesProps(Component fromService, String ofInstance, String ... propsToDeclareNames) {
- Set<String> propsToDeclare = ImmutableSet.<String>builder().add(propsToDeclareNames).build();
- List<ComponentInstanceInput> componentInstancesInputs = fromService.getComponentInstancesInputs().get(ofInstance);
- return componentInstancesInputs.stream()
- .filter(insInput -> propsToDeclare.contains(insInput.getName()))
- .collect(groupingBy((i) -> ofInstance));
- }
-
-}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/post/Install.java b/test-apis-ci/src/main/java/org/openecomp/sdc/post/Install.java
deleted file mode 100644
index 322a3171ad..0000000000
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/post/Install.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.post;
-
-import org.openecomp.sdc.be.dao.DAOJanusGraphStrategy;
-import org.openecomp.sdc.be.dao.janusgraph.JanusGraphClient;
-import org.openecomp.sdc.be.dao.janusgraph.JanusGraphOperationStatus;
-
-import java.io.File;
-
-public class Install {
- public static void main(String[] args) {
-
- if (args == null || args.length == 0) {
- System.out.println("Usage: org.openecomp.sdc.post.Install path_to_janusgraph.properties");
- System.exit(1);
- }
- String janusGraphPropsFile = args[0];
-
- if (!isFileExists(janusGraphPropsFile)) {
- System.exit(2);
- }
-
- if (!createJanusGraphSchema(janusGraphPropsFile)) {
- System.exit(3);
- }
-
- System.exit(0);
- }
-
- private static boolean createJanusGraphSchema(String janusGraphPropsFile) {
- JanusGraphClient janusGraphClient = new JanusGraphClient(new DAOJanusGraphStrategy());
- JanusGraphOperationStatus status = janusGraphClient.createGraph(janusGraphPropsFile);
- if (JanusGraphOperationStatus.OK == status) {
- System.out.println("JanusGraph schema ,indexes and default values created successfully.");
- return true;
- } else {
- System.out.println(
- "Problem while creating janusgraph schema ,indexes and default values. (" + status.name() + ")");
- return false;
- }
- }
-
- private static boolean isFileExists(String janusGraphPropsFile) {
- File f = new File(janusGraphPropsFile);
- if (!f.exists()) {
- System.out.println(janusGraphPropsFile + " not found");
- return false;
- }
- return true;
- }
-}
diff --git a/test-apis-ci/src/main/resources/ci/conf/attsdc-packages.yaml b/test-apis-ci/src/main/resources/ci/conf/attsdc-packages.yaml
deleted file mode 100644
index 5d1a3e1537..0000000000
--- a/test-apis-ci/src/main/resources/ci/conf/attsdc-packages.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-packages:
- - org.openecomp.sdc.ci.tests.execute.general
- - org.openecomp.sdc.ci.tests.execute.user
- - org.openecomp.sdc.ci.tests.execute.property
- - org.openecomp.sdc.ci.tests.execute.lifecycle
- - org.openecomp.sdc.ci.tests.execute.resource
- - org.openecomp.sdc.ci.tests.execute.service
- - org.openecomp.sdc.ci.tests.execute.artifacts
- - org.openecomp.sdc.ci.tests.execute.imports
- - org.openecomp.sdc.ci.tests.execute.category
- - org.openecomp.sdc.ci.tests.execute.distribution
- - org.openecomp.sdc.ci.tests.execute.product \ No newline at end of file
diff --git a/test-apis-ci/src/main/resources/ci/conf/attsdc.yaml b/test-apis-ci/src/main/resources/ci/conf/attsdc.yaml
deleted file mode 100644
index 4ef9ce4ccd..0000000000
--- a/test-apis-ci/src/main/resources/ci/conf/attsdc.yaml
+++ /dev/null
@@ -1,101 +0,0 @@
-outputFolder: target
-reportName: index.html
-catalogBeHost: 192.168.33.10
-catalogFeHost: fehost
-#QA-SCRUM1
-#catalogBeHost: 135.21.125.97
-#catalogFeHost: 135.21.125.89
-#Automate
-#catalogBeHost: 135.63.125.67
-#catalogFeHost: 135.63.125.63
-esHost: eshost
-disributionClientHost: disClient
-catalogFePort: 8181
-catalogBePort: 8080
-disributionClientPort: 8181
-isDistributionClientRunning: true
-esPort: 9200
-neoHost: neoHost
-neoPort: 7474
-neoDBusername: neo4j
-neoDBpassword: 123456
-windowsDownloadDirectory: "c:\\apache-ftpserver-1.1.0\\res\\home"
-systemUnderDebug: false
-resourceConfigDir: src/test/resources/CI/tests
-componentsConfigDir: src/test/resources/CI/components
-importResourceConfigDir: ../catalog-be/src/main/resources/import/tosca/capability-types
-importResourceTestsConfigDir: src/test/resources/CI/importResourceTests
-errorConfigurationFile: ../catalog-be/src/main/resources/config/error-configuration.yaml
-configurationFile: ../catalog-be/src/main/resources/config/configuration.yaml
-importTypesConfigDir: src/test/resources/CI/importTypesTest
-
-
-janusGraphPropertiesFile: src/main/resources/ci/conf/janusgraph.properties
-cassandraHost: 127.0.0.1
-cassandraAuthenticate: false
-cassandraUsername: koko
-cassandraPassword: bobo
-cassandraSsl: false
-cassandraTruststorePath : /path/path
-cassandraTruststorePassword : 123123
-cassandraAuditKeySpace: sdcaudit
-cassandraArtifactKeySpace: sdcartifact
-url: http://localhost:8285/sdc1
-
-sdcHttpMethod: http
-localDataCenter: DC-Automate01
-
-stopOnClassFailure: false
-
-#List of non-abstract resources to keep during janus graph cleanup between tests
-#Only 1.0 version will be kept
-resourcesNotToDelete:
- - Compute
- - Database
- - ObjectStorage
- - BlockStorage
- - LoadBalancer
- - Port
- - Network
- - Root
- - ContainerApplication
- - ContainerRuntime
- - DBMS
- - SoftwareComponent
- - WebApplication
- - WebServer
- - CinderVolume
- - ContrailVirtualNetwork
- - NeutronNet
- - NeutronPort
- - NovaServer
- - AbstractSubstitute
- - ContrailAbstractSubstitute
- - ContrailCompute
- - ContrailNetworkRules
- - ContrailPort
- - ContrailV2NetworkRules
- - ContrailV2VirtualMachineInterface
- - ContrailV2VirtualNetwork
- - ContrailVirtualNetwork
- - VL ELINE
- - SecurityRules
- - VL
-
-#Resource categories to keep (including all their subcategories)
-resourceCategoriesNotToDelete:
- - Generic
- - Network L2-3
- - Network L4+
- - Application L4+
- - Network Connectivity
- - DCAE Component
- - Template
- - Allotted Resource
-
-#Service categories to keep
-serviceCategoriesNotToDelete:
- - Mobility
- - Network L1-3
- - Network L4+
- - VoIP Call Control \ No newline at end of file
diff --git a/test-apis-ci/src/main/resources/ci/conf/credentials.yaml b/test-apis-ci/src/main/resources/ci/conf/credentials.yaml
deleted file mode 100644
index 19dc605a1f..0000000000
--- a/test-apis-ci/src/main/resources/ci/conf/credentials.yaml
+++ /dev/null
@@ -1,48 +0,0 @@
- designer: {
- username: cs0008,
- password: 123123a,
- firstname: SDC,
- lastname: SDC2
- }
- admin: {
- username: jh0003,
- password: 123123a,
- firstname: SDC,
- lastname: SDC2
- }
- ops: {
- username: af0006,
- password: 123123a,
- firstname: SDC,
- lastname: SDC2
- }
- tester: {
- username: kb0004,
- password: 123123a,
- firstname: SDC,
- lastname: SDC2
- }
- governor: {
- username: ah0002,
- password: 123123a,
- firstname: SDC,
- lastname: SDC2
- }
- product_strategist: {
- username: m99126,
- password: 1910-FruitGum,
- firstname: SDC,
- lastname: SDC2
- }
- product_manager: {
- username: m99127,
- password: 747-Airplane,
- firstname: SDC,
- lastname: SDC2
- }
- product_local: {
- username: pm0001,
- password: 123123a,
- firstname: SDC,
- lastname: SDC2
- } \ No newline at end of file
diff --git a/test-apis-ci/src/main/resources/ci/conf/extent-config.xml b/test-apis-ci/src/main/resources/ci/conf/extent-config.xml
deleted file mode 100644
index 4eb7f681aa..0000000000
--- a/test-apis-ci/src/main/resources/ci/conf/extent-config.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<extentreports>
- <configuration>
- <!-- report theme -->
- <!-- standard, dark -->
- <theme>standard</theme>
-
- <!-- document encoding -->
- <!-- defaults to UTF-8 -->
- <encoding>UTF-8</encoding>
-
- <!-- protocol for script and stylesheets -->
- <!-- defaults to https -->
- <protocol>https</protocol>
-
- <!-- title of the document -->
- <documentTitle>ASDC Automation Report</documentTitle>
-
- <!-- report name - displayed at top-nav -->
- <reportName> ASDC Automation Report </reportName>
-
- <!-- report headline - displayed at top-nav, after reportHeadline -->
- <reportHeadline></reportHeadline>
-
- <!-- global date format override -->
- <!-- defaults to yyyy-MM-dd -->
- <dateFormat>yyyy-MM-dd</dateFormat>
-
- <!-- global time format override -->
- <!-- defaults to HH:mm:ss -->
- <timeFormat>HH:mm:ss</timeFormat>
-
- <!-- custom javascript -->
- <scripts>
- <![CDATA[
- $(document).ready(function() {
- $('.logo-content' ).remove();
- $('.charts div:nth-child(2)').remove();
- });
- ]]>
- </scripts>
-
- <!-- custom styles -->
- <styles>
- <![CDATA[
- .report-name {padding-top: 1px; font-size: 15px; font-weight: bold;}
- ]]>
- </styles>
- </configuration>
-</extentreports> \ No newline at end of file
diff --git a/test-apis-ci/src/main/resources/ci/conf/janusgraph.properties b/test-apis-ci/src/main/resources/ci/conf/janusgraph.properties
deleted file mode 100644
index ea498bb7da..0000000000
--- a/test-apis-ci/src/main/resources/ci/conf/janusgraph.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-storage.backend=cql
-storage.hostname=localhost
-storage.port=9042
-
-cache.db-cache = false
-cache.db-cache-clean-wait = 20
-cache.db-cache-time = 180000
-cache.db-cache-size = 0.5
-
-cache.tx-cache-size = 500000
-storage.cql.keyspace=sdctitan
diff --git a/test-apis-ci/src/main/resources/ci/conf/log4j2.properties b/test-apis-ci/src/main/resources/ci/conf/log4j2.properties
deleted file mode 100644
index a8944dba13..0000000000
--- a/test-apis-ci/src/main/resources/ci/conf/log4j2.properties
+++ /dev/null
@@ -1,46 +0,0 @@
-status = error
-dest = err
-name = PropertiesConfig
-
-property.filename = ${targetlog}logs/ci-log.out
-
-#filter.threshold.type = ThresholdFilter
-#filter.threshold.level = debug
-
-appender.rolling.type = RollingFile
-appender.rolling.name = RollingFile
-appender.rolling.fileName = ${filename}
-appender.rolling.filePattern = ${targetlog}logs/ci-%d{MM-dd-yy-HH-mm-ss}-%i.log.gz
-appender.rolling.layout.type = PatternLayout
-appender.rolling.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %5p [%10c] : %m%n
-appender.rolling.policies.type = Policies
-appender.rolling.policies.size.type = SizeBasedTriggeringPolicy
-appender.rolling.policies.size.size=5MB
-appender.rolling.strategy.type = DefaultRolloverStrategy
-appender.rolling.strategy.max = 10
-
-appender.console.type = Console
-appender.console.name = STDOUT
-appender.console.layout.type = PatternLayout
-appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %5p %10c:%L - %m%n
-appender.console.filter.threshold.type = ThresholdFilter
-appender.console.filter.threshold.level = info
-
-logger.rolling.name = RollingAppender
-logger.rolling.level = info
-logger.rolling.additivity = false
-logger.rolling.appenderRef.rolling.ref = RollingFile
-
-logger.org.apache.cassandra.service.StorageProxy.level=info
-logger.org.janusgraph.diskstorage.cassandra.CassandraTransaction.level =info
-logger.org.janusgraph.diskstorage.cassandra.CassandraTransaction.appendRef.rolling.ref = RollingFile
-logger.org.janusgraph.diskstorage.cassandra.CassandraTransaction.appendRef.stdout.ref = STDOUT
-
-logger.org.openecomp.sdc.ci.tests.utils.level = info
-logger.org.openecomp.sdc.ci.tests.utils.appendRef.rolling.ref = RollingFile
-logger.org.openecomp.sdc.ci.tests.utils.appendRef.stdout.ref = STDOUT
-logger.org.openecomp.sdc.ci.tests.utils.additivity = false
-
-rootLogger.level = info
-rootLogger.appenderRef.stdout.ref = STDOUT
-rootLogger.appenderRef.rolling.ref = RollingFile
diff --git a/test-apis-ci/src/main/resources/ci/conf/log4j2.xml b/test-apis-ci/src/main/resources/ci/conf/log4j2.xml
deleted file mode 100644
index 5295d45a47..0000000000
--- a/test-apis-ci/src/main/resources/ci/conf/log4j2.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="ERROR">
- <Appenders>
- <File name="fileAppender" fileName="logfile.log" append="false">
- <PatternLayout pattern="%d %-5p [%c{1}] %m %n"/>
- </File>
- </Appenders>
- <Loggers>
- <Root level="info">
- <AppenderRef ref="fileAppender"/>
- </Root>
- </Loggers>
-</Configuration> \ No newline at end of file
diff --git a/test-apis-ci/src/main/resources/ci/conf/testngLifeCycle.xml b/test-apis-ci/src/main/resources/ci/conf/testngLifeCycle.xml
deleted file mode 100644
index 6188116210..0000000000
--- a/test-apis-ci/src/main/resources/ci/conf/testngLifeCycle.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="lifeCycle" parallel="none">
- <test name="Test">
- <classes>
- <class name="LCSbaseTest"/>
- </classes>
- </test> <!-- Test -->
-</suite> <!-- lifeCycle -->
diff --git a/test-apis-ci/src/main/resources/ci/conf/truststore b/test-apis-ci/src/main/resources/ci/conf/truststore
deleted file mode 100644
index bdec93d862..0000000000
--- a/test-apis-ci/src/main/resources/ci/conf/truststore
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/src/main/resources/ci/scripts/addUsersFromList_new.sh b/test-apis-ci/src/main/resources/ci/scripts/addUsersFromList_new.sh
deleted file mode 100644
index e695db26b2..0000000000
--- a/test-apis-ci/src/main/resources/ci/scripts/addUsersFromList_new.sh
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/bin/bash
-
-function help_usage ()
-{
- echo "$0 -ip <ip> -f <userToAdd_file>"
- echo "for example: -ip 127.0.0.1 -f /var/tmp/userToAdd.txt"
- exit
-}
-
-function check_file_existance ()
-{
-echo "check_file_existance $1"
-if [ $1 == "" ]; then
- echo "Please provide full path to user file"
- exit;
-elif [ -f $1 ]; then
- source $1
- USERS=("${USER_LIST[@]}")
- echo "file exist" $1
-else
- echo "Provided user file does not exist"
- exit
-fi
-}
-
-function check_ip_existance ()
-{
-if [ $1 == "" ]; then
- echo "Please provide ip address"
- exit;
-fi
-}
-
-function addUser ()
-{
- #for user in "${USER_LIST[@]}"; do
- for user in "${USERS[@]}"; do
- PING=`ping -c 1 $IP > /var/tmp/ping.log`
- pattern1='100% packet loss'
- pattern2='Host Unreachable'
- COUNT=`egrep -c "$pattern1|$pattern2" /var/tmp/ping.log`
- if [ $COUNT -eq 0 ]; then
- # curl -i -X post -d '{ "userId" : "kk1123", "role" : "ADMIN" }' -H "Content-Type: application/json" -H "USER_ID: jh0003" http://192.168.111.9:8080/sdc2/rest/v1/user
- userId=`echo $user|awk '{print $1}'`
- role=`echo $user|awk '{print $2}'`
- firstName=`echo $user|awk '{print $3}'`
- lastName=`echo $user|awk '{print $4}'`
- email=`echo $user|awk '{print $5}'`
- curl --noproxy '*' -i -X post -d '{ "userId" : "'${userId}'", "role" : "'${role}'", "firstName" : "'${firstName}'", "lastName" : "'${lastName}'", "email" : "'${email}'" }' -H "Content-Type: application/json" -H "USER_ID: jh0003" https://${IP}:8443/sdc2/rest/v1/user
- else
- echo "Host" $IP "Is Unreachable"
- fi
- done
-curl --noproxy '*' -i -X post -d '{"consumerName": "ci","consumerSalt": "2a1f887d607d4515d4066fe0f5452a50","consumerPassword": "0a0dc557c3bf594b1a48030e3e99227580168b21f44e285c69740b8d5b13e33b"}' -H "Content-Type: application/json" -H "USER_ID: jh0003" -H "Authorization:Basic Y2k6MTIzNDU2" https://${IP}:8443/sdc2/rest/v1/consumers
-
-}
-
-#main
-[ $# -eq 0 ] && help_usage
-while [ $# -ne 0 ]; do
- case $1 in
- "-f")
- USER_FILE=$2
- shift 1
- shift 1
- ;;
- -ip)
- IP=$2
- shift 1
- shift 1
- ;;
- *)
-# help_usage
- ;;
- esac
-done
-
-check_file_existance $USER_FILE
-check_ip_existance $IP
-addUser
diff --git a/test-apis-ci/src/main/resources/ci/scripts/copyToStorage.sh b/test-apis-ci/src/main/resources/ci/scripts/copyToStorage.sh
deleted file mode 100644
index b7b8c09715..0000000000
--- a/test-apis-ci/src/main/resources/ci/scripts/copyToStorage.sh
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/bin/bash
-
-REPORT_NAME=$1
-VERSION=$2
-ENV=$3
-
-if [ -z "$REPORT_NAME" ]
- then
- source ExtentReport/versions.info
- now=$(date -d '+7 hour' "+%Y-%m-%d_%H_%M")
- REPORT_NAME="${now}"
- VERSION="${osVersion}"
- if [[ $env == *"DEV20"* ]]
- then
- ENV="Nightly"
- else
- ENV=""
- fi
-
- fi
-
-source conf/attInternal.info
-IP=$automationResutlsRepo
-PASS=$automationResutlsRepoPass
-
-echo ${IP}
-
-/usr/bin/expect << EOF
-spawn ssh admin@${IP} mkdir -p -m 775 /home/admin/reports/${ENV}/${VERSION}/APIs/
-
-expect {
- -re ".*es.*o.*" {
- exp_send "yes\r"
- exp_continue
- }
- -re ".*sword.*" {
- exp_send ${PASS}\r
- }
-}
-
-expect eof
-
-spawn scp -r ExtentReport admin@${IP}:/home/admin/reports/${ENV}/${VERSION}/APIs/${REPORT_NAME}/
-
-expect {
- -re ".*es.*o.*" {
- exp_send "yes\r"
- exp_continue
- }
- -re ".*sword.*" {
- exp_send ${PASS}\r
- }
-}
-
-expect eof
-
-spawn ssh admin@${IP} chmod -R 775 /home/admin/reports/${ENV}/${VERSION}/APIs/${REPORT_NAME}/
-
-expect {
- -re ".*es.*o.*" {
- exp_send "yes\r"
- exp_continue
- }
- -re ".*sword.*" {
- exp_send ${PASS}\r
- }
-}
-
-expect eof
-
-EOF
diff --git a/test-apis-ci/src/main/resources/ci/scripts/sendMail.sh b/test-apis-ci/src/main/resources/ci/scripts/sendMail.sh
deleted file mode 100644
index 979d091d00..0000000000
--- a/test-apis-ci/src/main/resources/ci/scripts/sendMail.sh
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/bash
-
-now=$(date +'%Y%-m%d%H%M')
-
-REPORT_NAME=$1
-VERSION=$2
-ENV=$3
-
-RECIPIENTS1="md9897@att.com,NETCOM_ASDC_DEV@att.com,IL-D2-QA-Alex@att.com,bs5719@att.com,yg356h@att.com,yr9970@att.com,sl615n@att.com,yn813h@att.com,as221v@att.com,ms172g@att.com,ma2244@att.com,el489u@att.com,gg980r@att.com,ak991p@att.com,bv095y@att.com,ms656r@att.com,df502y@att.com,bt750h@att.com,ln699k@att.com,hm104p@att.com"
-#RECIPIENTS2="dl-asdcqa@intl.att.com"
-RECIPIENTS2="md9897@att.com,NETCOM_ASDC_DEV@att.com,IL-D2-QA-Alex@att.com,bs5719@att.com,yg356h@att.com,yr9970@att.com,sl615n@att.com,yn813h@att.com,as221v@att.com,ms172g@att.com,ma2244@att.com,el489u@att.com,gg980r@att.com,ak991p@att.com,bv095y@att.com,ms656r@att.com,df502y@att.com,bt750h@att.com,ln699k@att.com,hm104p@att.com"
-source ExtentReport/versions.info
-if [ -z "$REPORT_NAME" ]
- then
- now=$(date -d '+7 hour' "+%Y-%m-%d_%H_%M")
- REPORT_NAME="${now}"
- VERSION="${osVersion}"
-fi
-
-if [[ $env == *"DEV20"* ]]
- then
- ENV="Nightly"
- RECIPIENTS=$RECIPIENTS1
- else
- ENV=""
- RECIPIENTS=$RECIPIENTS2
-fi
-
-
-#REPORT_ZIP_FILE=ExtentReport_${now}.zip
-REPORT_FOLDER='ExtentReport'
-REPORT_HTML_FILE=${REPORT_FOLDER}/*Report.html
-BODY_MESSAGE='Hello, \n\n Please find automation results on following link: \n\n http://asdc-srv-210-45.tlv.intl.att.com/'${ENV}'/'${VERSION}'/APIs/'${REPORT_NAME}'/SDC_CI_Extent_Report.html \n\nThanks, \nSDC QA Team\n\n '
-
-#OLD_FILE=$(find ./ -type f -name ${REPORT_ZIP_FILE} -print)
-#if [ ! -z ${OLD_FILE} ]
-#then
-# rm -f ${REPORT_ZIP_FILE}
-# echo "Removing old zip file............"
-#fi
-
-#echo "Creating new zip file"
-#zip -r ${REPORT_ZIP_FILE} ./${REPORT_FOLDER}
-
-
-echo -e ${BODY_MESSAGE} | mail -s 'External APIs Automation '$ENV' results - ASDC '$VERSION -r 'ASDC@Automation.team' $RECIPIENTS
diff --git a/test-apis-ci/src/main/resources/ci/scripts/startTest.sh b/test-apis-ci/src/main/resources/ci/scripts/startTest.sh
deleted file mode 100644
index f8285ef506..0000000000
--- a/test-apis-ci/src/main/resources/ci/scripts/startTest.sh
+++ /dev/null
@@ -1,153 +0,0 @@
-#!/bin/bash
-REMOTE_DEBUG=false
-RERUN=false
-JAVA_OPTION=""
-debug_port=8000
-TEST_SUITES=testSuites
-fileName=testng-failed.xml
-
-function help_usage ()
-{
- echo
- echo "$0 (<jar_file_name> <suite file name>) [-r/rerun <true/false> -d/debug <true/false>]"
- echo "nohup ./startTest.sh ui-ci-1707.0.5-SNAPSHOT-jar-with-dependencies.jar extendedSanity.xml -r false -d true &"
- echo "by default rerun is true and remote debug is false."
- echo
- exit 2
-}
-
-function isBoolean ()
-{
- PARAM_NAME=$1
- VALUE=$2
- if [[ ${VALUE} != "true" ]] && [[ ${VALUE} != "false" ]]; then
- echo "Valid parameter" ${PARAM_NAME} "values are: true/false"
- help_usage
- fi
-}
-
-function prepareFailedXmlFile ()
-{
- echo "1="$1 "2="$2 "fileName="${fileName}
- PATTERN=`grep -w "test name=" ${FULL_PATH}/${TEST_SUITES}/$2 | awk -F'"' '{print $2}'`
- sed '/<test name="'${PATTERN}'"/,/<!-- '${PATTERN}' --/d' $1 > ${FULL_PATH}/${TEST_SUITES}/${fileName}
- sed -i 's/thread-count="[0-9]\+"/thread-count="1"/g' ${FULL_PATH}/${TEST_SUITES}/${fileName}
-}
-
-#main
-[ $# -lt 2 ] && help_usage
-
-JAR_FILE=$1
-SUITE_FILE=$2
-
-while [ $# -ne 0 ]; do
- case $1 in
- -r|rerun)
- RERUN=$2
- isBoolean $1 ${RERUN}
- shift 1
- shift 1
- ;;
- -d|debug)
- REMOTE_DEBUG=$2
- isBoolean $1 ${REMOTE_DEBUG}
- shift 1
- shift 1
- ;;
- *)
- shift 1
- ;;
- esac
-done
-
-CURRENT_DIR=`pwd`
-BASEDIR=$(dirname $0)
-
-if [ ${BASEDIR:0:1} = "/" ]
-then
- FULL_PATH=$BASEDIR
-else
- FULL_PATH=$CURRENT_DIR/$BASEDIR
-fi
-LOGS_PROP_FILE=file:${FULL_PATH}/conf/log4j2.properties
-#############################################
-TARGET_DIR=${FULL_PATH}/target
-CONF_FILE=${FULL_PATH}/conf/attsdc.yaml
-
-DEBUG=true
-MainClass=org.openecomp.sdc.ci.tests.run.StartTest
-
-TESTS_DIR=/opt/app/sdc/ci/resources/tests
-COMPONENTS_DIR=/opt/app/sdc/ci/resources/components
-
-
-TARGET_LOG_DIR="${TARGET_DIR}/"
-
-######ADD USERS################
-
-BE_IP=`cat conf/attsdc.yaml | grep catalogBeHost| awk '{print $2}'`
-
-ADD_USERS_SCRIPT="addUsersFromList_new.sh"
-USER_LIST="conf/userList.txt"
-chmod +x ${ADD_USERS_SCRIPT}
-echo "add users..."
-./${ADD_USERS_SCRIPT} -ip ${BE_IP} -f ${USER_LIST}
-
-
-
-if [ ${REMOTE_DEBUG} == "true" ]; then
- echo "Debug mode, Listen on port $debug_port";
- JAVA_OPTION="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=${debug_port}" ;
-fi
-
-cmd="java -Xmx2048m -Xms1024m $JAVA_OPTION -DdisplayException=true -Dtargetlog=${TARGET_LOG_DIR} -Dfilepath=${FILES_TEST} -Dconfig.resource=${CONF_FILE} -Ddebug=${DEBUG} -Dlog4j.configuration=${LOGS_PROP_FILE} -Dorg.freemarker.loggerLibrary=none -cp $JAR_FILE ${MainClass} $SUITE_FILE &"
-
-
-if [ $DEBUG == "true" ]
-then
- $cmd
-else
- $cmd >> /dev/null
-fi
-
-if [ ${RERUN} == "true" ]; then
- if [ -f ${TARGET_DIR}/${fileName} ]; then
- echo "Prepare" ${TARGET_DIR}/${fileName} "file to rerun all failed tests ...";
- prepareFailedXmlFile ${TARGET_DIR}/${fileName} $SUITE_FILE;
- SUITE_FILE=${fileName};
- cmd="java -Xmx2048m -Xms1024m $JAVA_OPTION -DdisplayException=true -Dtargetlog=${TARGET_LOG_DIR} -Dfilepath=${FILES_TEST} -Dconfig.resource=${CONF_FILE} -Ddebug=${DEBUG} -Dlog4j.configuration=${LOGS_PROP_FILE} -Dorg.freemarker.loggerLibrary=none -cp $JAR_FILE ${MainClass} $SUITE_FILE &"
- $cmd;
- fi
-fi
-
-status=`echo $?`
-
-source ExtentReport/versions.info
-now=$(date +'%Y-%m-%d_%H_%M')
-REPORT_NAME=${now}
-VERSION=${osVersion}
-
-if [[ $env == *"DEV20"* ]]
-then
- MYENV="Nightly"
-else
- MYENV=""
-fi
-
-COPY_REPORT_SCRIPT="copyToStorage.sh"
-chmod +x ${COPY_REPORT_SCRIPT}
-echo "copy report to storage..."
-( ./${COPY_REPORT_SCRIPT} ${REPORT_NAME} ${VERSION} ${MYENV} )
-
-
-MAILING_SCRIPT_NAME="sendMail.sh"
-chmod +x ${MAILING_SCRIPT_NAME}
-echo "Sending report via mail..."
-`./${MAILING_SCRIPT_NAME} ${REPORT_NAME} ${VERSION} ${MYENV}`
-
-
-echo "##################################################"
-echo "################# status is ${status} #################"
-echo "##################################################"
-
-exit $status
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/CRUDArtifacts.xml b/test-apis-ci/src/main/resources/ci/testSuites/CRUDArtifacts.xml
deleted file mode 100644
index 78c93723fa..0000000000
--- a/test-apis-ci/src/main/resources/ci/testSuites/CRUDArtifacts.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="CRUDArtifacts" configfailurepolicy="continue" verbose="2" parallel="tests" thread-count="10">
-
- <test name="Test">
- <classes>
- <class
- name="CRUDExternalAPI">
- <methods>
- <!-- <include name="uploadArtifactOnVFViaExternalAPI" />
- <include name="uploadArtifactOnServiceViaExternalAPI" />
- <include name="uploadArtifactOnRIViaExternalAPI" />
- <include name="uploadInvalidArtifactTypeExtensionLabelDescriptionCheckSumDuplicateLabelViaExternalAPI" />
- <include name="uploadArtifactOnVFViaExternalAPIByDiffrentUserThenCreatorOfAsset" />
- <include name="uploadArtifactOnAssetWhichNotExist" />
- <include name="uploadArtifactOnAssetWhichInInvalidStateForUploading" />
-
-
- <include name="updateArtifactForServiceViaExternalAPI" />
- <include name="updateArtifactForVFViaExternalAPI" />
- <include name="updateArtifactOnRIViaExternalAPI" />
- <include name="updateArtifactOnVFViaExternalAPIByDiffrentUserThenCreatorOfAsset" />
- <include name="updateArtifactOnAssetWhichNotExist" />
- <include name="updateArtifactOnAssetWhichInInvalidStateForUploading" />
- <include name="updateInvalidArtifactTypeExtensionLabelDescriptionCheckSumDuplicateLabelViaExternalAPI" />
-
-
- <include name="deleteArtifactForServiceViaExternalAPI" />
- <include name="deleteArtifactForVFViaExternalAPI" />
- <include name="deleteArtifactOnRIViaExternalAPI" />
- <include name="deleteArtifactOnVFViaExternalAPIByDiffrentUserThenCreatorOfAsset" />
- <include name="deleteArtifactOnAssetWhichNotExist" />
- <include name="deleteArtifactOnAssetWhichInInvalidStateForUploading" /> -->
-
- <include name="deleteArtifactForServiceViaExternalAPI" />
- </methods>
-
- </class>
-
- </classes>
- </test> <!-- Test -->
-</suite> <!-- Suite --> \ No newline at end of file
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/ExternalApiSanity.xml b/test-apis-ci/src/main/resources/ci/testSuites/ExternalApiSanity.xml
deleted file mode 100644
index 633054fb13..0000000000
--- a/test-apis-ci/src/main/resources/ci/testSuites/ExternalApiSanity.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="CRUDArtifacts" configfailurepolicy="continue" verbose="2" parallel="methods" thread-count="2" data-provider-thread-count="2">
-
- <test name="Test">
- <classes>
- <class name="CRUDExternalAPI">
- <methods>
- <include name="uploadArtifactOnVfcVlCpViaExternalAPI" invocation-numbers="0" />
- <include name="uploadArtifactOnVFViaExternalAPI" invocation-numbers="0" />
- <include name="uploadArtifactOnServiceViaExternalAPI" invocation-numbers="0" />
- <include name="uploadArtifactOnRIViaExternalAPI" invocation-numbers="0" />
- <include name="uploadArtifactOnVfcVlCpRIViaExternalAPI" invocation-numbers="0" />
- <include name="updateArtifactForServiceViaExternalAPI" invocation-numbers="0" />
- <include name="updateArtifactForVFViaExternalAPI" invocation-numbers="0" />
- <include name="updateArtifactForVfcVlCpViaExternalAPI" invocation-numbers="0" />
- <include name="updateArtifactOfVfcVlCpForVfciVliCpiViaExternalAPI" invocation-numbers="0" />
- <include name="updateArtifactOnRIViaExternalAPI" invocation-numbers="0" />
- <include name="updateArtifactOnVfcVlCpRIViaExternalAPI" invocation-numbers="0" />
- <include name="deleteArtifactForServiceViaExternalAPI" invocation-numbers="0" />
- <include name="deleteArtifactForVFViaExternalAPI" invocation-numbers="0" />
- <include name="deleteArtifactOnRIViaExternalAPI" invocation-numbers="0" />
- <include name="deleteArtifactOnVfcVlCpRIViaExternalAPI" invocation-numbers="0" />
- <include name="deleteArtifactOnAssetWhichNotExist" />
- </methods>
- </class>
- <class name="DownloadComponentArt">
- <methods>
- <include name="downloadArtifactOfComponentInstanceFromServiceViaExternalAPI"/>
- </methods>
- </class>
- <class name="GetFilteredAssetServlet">
- <methods>
- <include name="getResourceAssetBySpecifiedCategory"/>
- <include name="getServiceAssetBySpecifiedCategory"/>
- </methods>
- </class>
- <class name="SearchFilterCategoryExternalAPI">
- <methods>
- <include name="normativeResourceCategory" invocation-numbers="0"/>
- </methods>
- </class>
- <class name="GetCSARofVF">
- <methods>
- <include name="getServiceToscaModelCheckInState"/>
- <include name="getRsourceToscaModelCertifyState"/>
- </methods>
- </class>
- <class name="GetFilteredAssetServlet">
- <methods>
- <include name="getResourceAssetBySpecifiedCategory"/>
- <include name="getServiceAssetBySpecifiedCategory"/>
- </methods>
- </class>
- <class name="GetSpecificAssetMetadataServlet">
- <methods>
- <include name="getResourceAssetMetadataSuccess"/>
- <include name="getServiceAssetMetadataWithResourceInstancesSuccess"/>
- </methods>
- </class>
- <class name="AssetLifeCycle">
- <methods>
- <include name="theFlow"/>
- </methods>
- </class>
- </classes>
- </test> <!-- Test -->
-</suite> <!-- Suite --> \ No newline at end of file
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/SearchExternalAPI.xml b/test-apis-ci/src/main/resources/ci/testSuites/SearchExternalAPI.xml
deleted file mode 100644
index 40c462a4cb..0000000000
--- a/test-apis-ci/src/main/resources/ci/testSuites/SearchExternalAPI.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="CRUDArtifacts" configfailurepolicy="continue" verbose="2" parallel="tests" thread-count="10">
-
- <test name="Test">
- <classes>
- <class
- name="org.openecomp.sdc.ci.tests.execute.devCI.SearchFilterCategoryExternalAPI">
- <methods>
-
- <include name="searchWithInvalidFilter" />
- <include name="searchForResourceTypeNegativeTest" />
- <include name="searchingForResouceFilterIncorrectResouceTypeUsingExternalAPI" />
- <include name="searchingForSeveralResouceTypesUsingExternalAPI" />
- <include name="searchingForSeveralResourcesOfTypeVFCMTUsingExternalAPI" />
- <include name="normativeResourceCategory" />
- </methods>
-
- </class>
-
- </classes>
- </test> <!-- Test -->
-</suite> <!-- Suite --> \ No newline at end of file
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/artifacts.xml b/test-apis-ci/src/main/resources/ci/testSuites/artifacts.xml
deleted file mode 100644
index 6a018ab0f0..0000000000
--- a/test-apis-ci/src/main/resources/ci/testSuites/artifacts.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="Artifacts">
- <test name="Artifacts">
- <classes>
- <class name="DownloadComponentArt"/>
- <class name="ValidateHeatArtFieldsTypes"/>
- <class name="PlaceHolderValidations"/>
- </classes>
- </test>
-</suite> <!-- Artifacts -->
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/cap_req.xml b/test-apis-ci/src/main/resources/ci/testSuites/cap_req.xml
deleted file mode 100644
index 4fefeaf679..0000000000
--- a/test-apis-ci/src/main/resources/ci/testSuites/cap_req.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="Cap_Req" >
- <test name="Cap_Req">
- <classes>
- <class name="RequirementsTest"/>
- <class name="CapabilitiesTest"/>
- </classes>
- </test>
-</suite> <!-- Artifacts -->
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/category.xml b/test-apis-ci/src/main/resources/ci/testSuites/category.xml
deleted file mode 100644
index b6f64fc9e8..0000000000
--- a/test-apis-ci/src/main/resources/ci/testSuites/category.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="category">
- <test name="Test">
- <classes>
- <class name="GroupingTest"/>
- <class name="SubCategoriesTest"/>
- </classes>
- </test> <!-- Test -->
-</suite> <!-- category -->
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/ciFull.xml b/test-apis-ci/src/main/resources/ci/testSuites/ciFull.xml
deleted file mode 100644
index 35239c7ce1..0000000000
--- a/test-apis-ci/src/main/resources/ci/testSuites/ciFull.xml
+++ /dev/null
@@ -1,117 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="ciFull" configfailurepolicy="continue" verbose="2">
- <test name="Category">
- <classes>
- <class name="CatalogDataApiTest"/>
- <class name="GroupingTest">
- <methods>
- <exclude name="createProductGroupForNonExistingCategory"/>
- <exclude name="createProductGroupForNonExistingSunCategory"/>
- <exclude name="getProductCategoryHierarchySuccessFlow"/>
- </methods>
- </class>
-
- <class name="SubCategoriesTest">
- <methods>
- <exclude name="createProductSubCategoryForNonExistingCategory"/>
- <exclude name="createResourceSubCategoryForNonExistingCategory"/>
- <exclude name="getResourceCategoryHierarchySuccessFlow"/>
- </methods>
- </class>
- </classes>
- </test> <!-- Test -->
- <test name="Distribution">
- <classes>
- <class
- name="AuthanticationTests"/>
- <class
- name="DistributionDownloadArtifactTest">
- <methods>
- <exclude name="downloadServiceArtifact_ServiceVersionNotFound"/>
- </methods>
- </class>
- </classes>
- </test> <!-- Test -->
- <test name="General">
- <classes>
- <class name="FeProxyTest"/>
- <class name="UuidTest"/>
- </classes>
- </test>
- <test name="Resource">
- <classes>
- <class name="SimultaneousApiTest"/>
- <class name="UpdateResourceMetadataTest">
- <methods>
- <exclude name="UpdateResourceCategory_negativeFlow"/>
- </methods>
- </class>
- <class name="VFResourceInstanceNameCRUD"/>
- <class name="ResourceApiTest"/>
- <class
- name="ValidateExtendedVfData"/>
- </classes>
- </test>
- <test name="Product">
- <classes>
- <class
- name="ProductUndoCheckoutTest">
- <methods>
- <exclude name="undoCheckOutNotExist"/>
- </methods>
- </class>
- <class
- name="ProductGetFollowedTest"/>
- <class
- name="ProductToscaYamlGenerationTest"/>
- <class name="ProductCheckinTest">
- <methods>
- <exclude name="checkInProductNotExist"/>
- </methods>
- </class>
- <class name="ProductCheckoutTest"/>
- <class
- name="ProductCreateWithValidationsTest">
- <methods>
- <exclude name="createProductDescriptionRemoveSpacesFromBeginning"/>
- <exclude name="createProductDescriptionRemoveSpacesFromTheEnd"/>
- <exclude name="createProductDescriptionValidCharacters01"/>
- <exclude name="createProductDescriptionValidCharacters02"/>
- </methods>
- </class>
- </classes>
- </test>
- <test name="Service">
- <classes>
- <class
- name="org.openecomp.sdc.ci.tests.execute.service.ChangeServiceDistributionStatusApiTest">
- <methods>
- <exclude name="approveCertifiedService_byDesigner"/>
- <exclude name="approveCertifiedService_byOps"/>
- <exclude name="approveCertifiedService_byTester"/>
- <exclude
- name="distributionStatusChange_approve_Reject_AprroveBysdncAdminDetails"/>
- <exclude name="rejectCertifiedService_byDesigner"/>
- <exclude name="rejectCertifiedService_byOps"/>
- <exclude name="rejectCertifiedService_byTester"/>
- <exclude name="rejectCertifiedService_bysdncAdminDetails"/>
- <exclude name="rejectCertifiedService_bysdncGovernorDeatails"/>
- <exclude name="rejectNotCertifiedService_checkedin"/>
- <exclude name="rejectNotCertifiedService_checkeout"/>
- <exclude name="rejectNotCertifiedService_inProgress"/>
- <exclude name="rejectNotCertifiedService_readyForCer"/>
- <exclude name="rejectServiceNotFound"/>
- </methods>
- </class>
- <class name="GetAllServiceVersions"/>
- </classes>
- </test>
- <test name="Artifacts">
- <classes>
- <class name="DownloadComponentArt"/>
- <class name="ValidateHeatArtFieldsTypes"/>
- <class name="PlaceHolderValidations"/>
- </classes>
- </test>
-</suite> \ No newline at end of file
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/externalAPIs.xml b/test-apis-ci/src/main/resources/ci/testSuites/externalAPIs.xml
deleted file mode 100644
index b83761833e..0000000000
--- a/test-apis-ci/src/main/resources/ci/testSuites/externalAPIs.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="externalApis" configfailurepolicy="continue" verbose="2" parallel="methods" thread-count="1" data-provider-thread-count="8">
- <test name="ExternalApis">
- <classes>
-
- <class name="VFCMTExternalAPI"/>
- <class name="CRUDExternalAPI"/>
- <class name="DeploymentValiditaion"/>
- <class name="GetAssetServlet"/>
- <class name="GetCSARofVF"/>
- <class name="GetFilteredAssetServlet"/>
- <class name="GetSpecificAssetMetadataServlet"/>
- <class name="SearchFilterCategoryExternalAPI"/>
- <class name="AssetLifeCycle"/>
- <class name="UserAPIs"/>
-
- <class name="AnnotationsTest"/>
-
-
-<!-- <class name="org.openecomp.sdc.ci.tests.execute.product.ChangeServiceInstanceVersionTest"/>
- <class name="ProductCheckinTest"/>
- <class name="ProductCheckoutTest"/>
- <class name="org.openecomp.sdc.ci.tests.execute.product.ProductComponentInstanceCRUDTest"/>
- <class name="ProductCreateWithValidationsTest"/>
- <class name="org.openecomp.sdc.ci.tests.execute.product.ProductCrudTest"/>
- <class name="ProductGetFollowedTest"/>
- <class name="ProductUndoCheckoutTest"/> -->
-
-
- </classes>
- </test>
-</suite> \ No newline at end of file
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/general.xml b/test-apis-ci/src/main/resources/ci/testSuites/general.xml
deleted file mode 100644
index 9b988d8b12..0000000000
--- a/test-apis-ci/src/main/resources/ci/testSuites/general.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="General">
- <test name="Test">
- <classes>
- <class name="UuidTest"/>
- </classes>
- </test> <!-- Test -->
-</suite> <!-- General -->
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/imports.xml b/test-apis-ci/src/main/resources/ci/testSuites/imports.xml
deleted file mode 100644
index 3cf3b9833b..0000000000
--- a/test-apis-ci/src/main/resources/ci/testSuites/imports.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="Imports">
- <test name="Imports">
- <classes>
- <class name="ImportGenericResourceCITest"/>
- </classes>
- </test> <!-- Test -->
-</suite> <!-- Imports -->
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/normatives.xml b/test-apis-ci/src/main/resources/ci/testSuites/normatives.xml
deleted file mode 100644
index 9676e8f398..0000000000
--- a/test-apis-ci/src/main/resources/ci/testSuites/normatives.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Copyright © 2018 European Support Limited
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="normatives" >
- <test name="InterfaceLifecycleTypes">
- <classes>
- <class name="InterfaceLifecycleTypesTest"/>
- </classes>
- </test>
-</suite> \ No newline at end of file
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/onapApiSanity.xml b/test-apis-ci/src/main/resources/ci/testSuites/onapApiSanity.xml
deleted file mode 100644
index 00f60cb68e..0000000000
--- a/test-apis-ci/src/main/resources/ci/testSuites/onapApiSanity.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="externalApis" configfailurepolicy="continue" verbose="2" parallel="methods" thread-count="1" data-provider-thread-count="1">
- <parameter name="makeDistribution" value="false"/>
- <parameter name="makeToscaValidation" value="true"/>
- <test name="ExternalApis">
- <classes>
- <class name="Onboard"/>
- </classes>
- </test>
-</suite> \ No newline at end of file
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/pass.xml b/test-apis-ci/src/main/resources/ci/testSuites/pass.xml
deleted file mode 100644
index 02a314f8e9..0000000000
--- a/test-apis-ci/src/main/resources/ci/testSuites/pass.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="externalApis" configfailurepolicy="continue" verbose="2" parallel="methods" thread-count="1" data-provider-thread-count="1">
- <parameter name="makeDistribution" value="false"/>
- <parameter name="makeToscaValidation" value="true"/>
- <test name="passTest">
-
- <classes>
- <class
- name="Onboard">
- <methods>
- <include name="passTest" />
- </methods>
- </class>
-
- </classes>
- </test>
-</suite> \ No newline at end of file
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/product.xml b/test-apis-ci/src/main/resources/ci/testSuites/product.xml
deleted file mode 100644
index 72fb68b197..0000000000
--- a/test-apis-ci/src/main/resources/ci/testSuites/product.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="Product">
- <test name="Test">
- <classes>
- <class name="ProductLifecycleTest"/>
- <class name="ProductUndoCheckoutTest"/>
- <class name="ProductCheckinTest"/>
- <class name="ProductCheckoutTest"/>
- </classes>
- </test> <!-- Test -->
-</suite> <!-- Product -->
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/productAPIs.xml b/test-apis-ci/src/main/resources/ci/testSuites/productAPIs.xml
deleted file mode 100644
index f3f7f912a1..0000000000
--- a/test-apis-ci/src/main/resources/ci/testSuites/productAPIs.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="productAPIs" configfailurepolicy="continue" verbose="2" parallel="tests"
- thread-count="6">
-
- <test name="Test">
- <classes>
- <class name="ProductCheckinTest"/>
- <class name="ProductCheckoutTest"/>
- <class name="ProductCreateWithValidationsTest"/>
- <class name="ProductGetFollowedTest"/>
- <class name="ProductUndoCheckoutTest"/>
- </classes>
- </test> <!-- Test -->
-</suite> <!-- Suite --> \ No newline at end of file
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/property.xml b/test-apis-ci/src/main/resources/ci/testSuites/property.xml
deleted file mode 100644
index 2b90f9b2f6..0000000000
--- a/test-apis-ci/src/main/resources/ci/testSuites/property.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="Property" >
- <test name="Test">
- <classes>
- <class name="PropertyApisTest"/>
- <class name="org.openecomp.sdc.ci.tests.execute.property.PropertyServletTest"/>
- <class name="AdditionalInformationServletTest"/>
- </classes>
- </test> <!-- Test -->
-</suite> <!-- Property -->
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/resource.xml b/test-apis-ci/src/main/resources/ci/testSuites/resource.xml
deleted file mode 100644
index c9f5558449..0000000000
--- a/test-apis-ci/src/main/resources/ci/testSuites/resource.xml
+++ /dev/null
@@ -1,123 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="Sanity" configfailurepolicy="continue">
-
- <test verbose="2" name="Sanity">
- <classes>
-
- <class name="CatalogDataApiTest"/>
-
- <class name="AuthanticationTests">
- <methods>
- <include name="downloadServiceArtifactSuccessWithAutantication"/>
- </methods>
- </class>
-
- <class
- name="DistributionDownloadArtifactTest">
- <methods>
- <include name="downloadResourceArtifactSuccess"/>
- </methods>
- </class>
-
- <class name="FeProxyTest"/>
-
- <class name="UuidTest">
- <methods>
- <include name="testE2EUuidHeaderReturnedAndPreserved"/>
- </methods>
- </class>
-
- <class name="ImportGenericResourceCITest">
- <methods>
- <include name="importAllTestResources"/>
- <include name="testImportCheckoutAndUpdateUserResource"/>
- <include name="testImportWithUpdateNormativeType"/>
- </methods>
- </class>
-
- <class name="AdditionalInformationServletTest">
- <methods>
- <include name="createResourceAdditionalInformationTestDuringLifecycle"/>
- <include name="updateResourceAdditionalInformationTest"/>
- <include name="deleteResourceAdditionalInformationTest"/>
- </methods>
- </class>
-
- <class name="PropertyApisTest">
- <methods>
- <include name="testPropertyApis"/>
- </methods>
- </class>
-
- <class name="GetAllResourceVersions">
- <methods>
- <include name="getResourceAllVersions_version15"/>
- </methods>
- </class>
-
- <class name="ResourceApiTest">
- <methods>
- <include name="updateResourceMetadataSuccess"/>
- </methods>
- </class>
-
- <class name="UpdateResourceMetadataTest">
- <methods>
- <include name="UpdateDerivedFromSuccess"/>
- </methods>
- </class>
-
- <class name="GetComponentAuditApiTest">
- <methods>
- <include name="testServiceAuditCertifiedVersion"/>
- </methods>
- </class>
-
- <class name="ActivateDeActivateDeleteUser">
- <methods>
- <include name="authorizeDeActivatedUser"/>
- </methods>
- </class>
-
- <!-- Product tests start-->
- <class name="ProductCheckinTest">
- <methods>
- <include name="checkInProductByCreator"/>
- </methods>
- </class>
-
- <class name="ProductCheckoutTest">
- <methods>
- <include name="checkOutProductByPmNotInContacts"/>
- </methods>
- </class>
-
- <class name="ProductGetFollowedTest">
- <methods>
- <include name="followedPageTest"/>
- </methods>
- </class>
- <class name="ProductUndoCheckoutTest">
- <methods>
- <include name="undoCheckOutProductByPm"/>
- </methods>
- </class>
- <class name="InterfaceOperationsTest">
- <methods>
- <include name="addInterfaceOperationsOfGlobalTypeOnResource"/>
- <include name="addInterfaceOperationsOnResource"/>
- <include name="getInterfaceOperationsFromResource"/>
- <include name="updateInterfaceOperationsOnResource"/>
- <include name="deleteInterfaceOperationsFromResource"/>
- <include name="addInterfaceOperationsOfGlobalTypeOnPNFResource"/>
- <include name="addInterfaceOperationsOnPNFResource"/>
- <include name="getInterfaceOperationsFromPNFResource"/>
- <include name="updateInterfaceOperationsOnPNFResource"/>
- <include name="deleteInterfaceOperationsFromPNFResource"/>
- </methods>
- </class>
- <!-- Product tests end-->
- </classes>
- </test> <!-- Test -->
-</suite> <!-- Sanity -->
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/sanity.xml b/test-apis-ci/src/main/resources/ci/testSuites/sanity.xml
deleted file mode 100644
index 5d21455530..0000000000
--- a/test-apis-ci/src/main/resources/ci/testSuites/sanity.xml
+++ /dev/null
@@ -1,228 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="Sanity" configfailurepolicy="continue" verbose="2">
-
- <test name="sanityE2Eflows">
- <classes>
- <class name="CrudE2E"/>
- </classes>
- </test>
-
- <test name="General">
- <classes>
- <class name="FeProxyTest"/>
- <class name="UuidTest">
- <methods>
- <include name="testE2EUuidHeaderReturnedAndPreserved"/>
- </methods>
- </class>
- </classes>
- </test>
-
- <test name="ArtifactOnInstance">
- <classes>
- </classes>
- </test>
-
- <test name="Artifact">
- <classes>
- <class
- name="DownloadComponentArt">
- <methods>
- <include name="downloadArtifactFromResourceTest"/>
- <include name="downloadArtifactFromServiceTest"/>
- </methods>
- </class>
- </classes>
- </test>
-
- <test name="Service">
- <classes>
- <class
- name="GetComponentAuditApiTest">
- <methods>
- <include name="testServiceAuditCertifiedVersion"/>
- </methods>
- </class>
-
- </classes>
- </test>
-
- <test name="Resource">
- <classes>
- <class
- name="GetAllResourceVersions">
- <methods>
- <include name="getResourceAllVersions_version15"/>
- </methods>
- </class>
-
- <class name="ResourceApiTest">
- <methods>
- <include name="updateResourceMetadataSuccess"/>
- </methods>
- </class>
-
- <class
- name="UpdateResourceMetadataTest">
- <methods>
- <include name="UpdateDerivedFromSuccess"/>
- </methods>
- </class>
- </classes>
- </test>
- <test name="Product">
- <classes>
- <class name="ProductCheckinTest">
- <methods>
- <include name="checkInProductByCreator"/>
- </methods>
- </class>
- <class name="ProductCheckoutTest">
- <methods>
- <include name="checkOutProductByPmNotInContacts"/>
- </methods>
- </class>
- <class
- name="ProductGetFollowedTest">
- <methods>
- <include name="followedPageTest"/>
- </methods>
- </class>
- <class
- name="ProductUndoCheckoutTest">
- <methods>
- <include name="undoCheckOutProductByPm"/>
- </methods>
- </class>
- <!-- Product tests end -->
- </classes>
- </test>
- <test name="Catalog">
- <classes>
- <class name="CatalogDataApiTest"/>
- </classes>
- </test>
-
- <test name="distribution">
- <classes>
- <class
- name="AuthanticationTests">
- <methods>
- <include name="downloadServiceArtifactSuccessWithAutantication"/>
- </methods>
- </class>
-
- <class
- name="DistributionDownloadArtifactTest">
- <methods>
- <include name="downloadResourceArtifactSuccess"/>
- </methods>
- </class>
- </classes>
- </test>
-
- <test name="Category">
- <classes>
- </classes>
- </test>
-
- <test name="Imports">
- <classes>
- <class
- name="ImportGenericResourceCITest">
- <methods>
- <include name="importAllTestResources"/>
- <include name="testImportCheckoutAndUpdateUserResource"/>
- <include name="testImportWithUpdateNormativeType"/>
- </methods>
- </class>
- <class
- name="ImportToscaCapabilitiesWithProperties">
- <methods>
- <include name="importNodeTypeWithCapabilityWithPropertiesFromYmlSucceed"/>
- <include
- name="importResourceWithCapabilityWithPropertiesOverridingCapTypePropertiesSucceed"/>
- </methods>
- </class>
- </classes>
- </test> <!-- Test -->
-
- <test name="attribute">
- <classes>
- <class
- name="ComponentInstanceAttributeTest">
- <methods>
- <include name="testUpdateAttributeOnResourceInstance"/>
- </methods>
- </class>
- </classes>
- </test>
-
- <test name="inputs">
- <classes>
- <class
- name="InputsApiTests">
- <methods>
- <include name="testInputsMainFunctionality"/>
- </methods>
- </class>
- </classes>
- </test>
-
- <test name="property">
- <classes>
- <class
- name="AdditionalInformationServletTest">
- <methods>
- <include name="createResourceAdditionalInformationTestDuringLifecycle"/>
- <include name="updateResourceAdditionalInformationTest"/>
- <include name="deleteResourceAdditionalInformationTest"/>
- </methods>
- </class>
-
- <class name="PropertyApisTest">
- <methods>
- <include name="testPropertyApis"/>
- </methods>
- </class>
- <class name="ComponentInstancePropertyTest">
- <methods>
- <include name="nestedVfResourceProperty3Levels"/>
- </methods>
- </class>
-
- </classes>
- </test>
-
- <test name="User">
- <classes>
-
- </classes>
- </test>
-
- <test name="ExternalApis">
- <classes>
- <class name="GetAssetServlet">
- <methods>
- <include name="getResourceAssetSuccess"/>
- </methods>
- </class>
- <class name="GetFilteredAssetServlet">
- <methods>
- <include name="getResourceAssetBySpecifiedCategoryAndSubCategory"/>
- <include name="getServiceAssetBySpecifiedCategoryAndDistributionStatus"/>
- </methods>
- </class>
- <class name="GetSpecificAssetMetadataServlet">
- <methods>
- <include name="getResourceAssetMetadataWithResourceInstancesSuccess"/>
- <include
- name="getServiceAssetMetadataWithCertifiedResourceInstancesAndArtifactsOnRIsAndServiceSuccess"/>
- </methods>
- </class>
- </classes>
- </test>
-
-
-</suite> \ No newline at end of file
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/service.xml b/test-apis-ci/src/main/resources/ci/testSuites/service.xml
deleted file mode 100644
index 89f4819cc1..0000000000
--- a/test-apis-ci/src/main/resources/ci/testSuites/service.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="Service">
- <test name="Service">
- <classes>
- <class name="org.openecomp.sdc.ci.tests.execute.service.ChangeServiceDistributionStatusApiTest"/>
- <class name="GetAllServiceVersions"/>
- <class name="InterfaceOperationsTest">
- <methods>
- <include name="addInterfaceOperationsOnService"/>
- <include name="getInterfaceOperationsFromService"/>
- <include name="updateInterfaceOperationsOnService"/>
- <include name="deleteInterfaceOperationsFromService"/>
- <include name="testCreateOperationWithLocalInterfaceAndDownloadArtifact"/>
- </methods>
- </class>
- </classes>
- </test>
-</suite> <!-- Service -->
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/testngLifeCycle.xml b/test-apis-ci/src/main/resources/ci/testSuites/testngLifeCycle.xml
deleted file mode 100644
index f65ef786e2..0000000000
--- a/test-apis-ci/src/main/resources/ci/testSuites/testngLifeCycle.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="lifeCycle">
- <test name="Test">
- <classes>
- <class name="LCSbaseTest"/>
- </classes>
- </test> <!-- Test -->
-</suite> <!-- lifeCycle -->
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/user.xml b/test-apis-ci/src/main/resources/ci/testSuites/user.xml
deleted file mode 100644
index b4a5b932fd..0000000000
--- a/test-apis-ci/src/main/resources/ci/testSuites/user.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="User">
- <test name="Test">
- <classes>
- <class name="ActivateDeActivateDeleteUser"/>
- </classes>
- </test> <!-- Test -->
-</suite> <!-- User -->
diff --git a/test-apis-ci/src/main/resources/log4j2.properties b/test-apis-ci/src/main/resources/log4j2.properties
deleted file mode 100644
index 77acad8915..0000000000
--- a/test-apis-ci/src/main/resources/log4j2.properties
+++ /dev/null
@@ -1,36 +0,0 @@
-status = error
-dest = err
-name = PropertiesConfig
-
-property.filename = logs/ws-log.out
-
-#filter.threshold.type = ThresholdFilter
-#filter.threshold.level = debug
-
-appender.rolling.type = RollingFile
-appender.rolling.name = RollingFile
-appender.rolling.fileName = ${filename}
-appender.rolling.filePattern = logs/ws-%d{MM-dd-yy-HH-mm-ss}-%i.log.gz
-appender.rolling.layout.type = PatternLayout
-appender.rolling.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %5p [%10c] : %m%n
-appender.rolling.policies.type = Policies
-appender.rolling.policies.size.type = SizeBasedTriggeringPolicy
-appender.rolling.policies.size.size=5MB
-appender.rolling.strategy.type = DefaultRolloverStrategy
-appender.rolling.strategy.max = 10
-
-appender.console.type = Console
-appender.console.name = STDOUT
-appender.console.layout.type = PatternLayout
-appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %5p %10c:%L - %m%n
-appender.console.filter.threshold.type = ThresholdFilter
-appender.console.filter.threshold.level = info
-
-logger.rolling.name = RollingAppender
-logger.rolling.level = info
-logger.rolling.additivity = false
-logger.rolling.appenderRef.rolling.ref = RollingFile
-
-rootLogger.level = info
-rootLogger.appenderRef.stdout.ref = STDOUT
-rootLogger.appenderRef.rolling.ref = RollingFile \ No newline at end of file
diff --git a/test-apis-ci/src/main/resources/log4j2.xml b/test-apis-ci/src/main/resources/log4j2.xml
deleted file mode 100644
index 97a07f95e0..0000000000
--- a/test-apis-ci/src/main/resources/log4j2.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="ERROR">
-<Appenders>
- <File name="fileAppender" fileName="logfile.log" append="false">
- <PatternLayout pattern="%d %-5p [%c{1}] %m %n"/>
- </File>
-</Appenders>
-<Loggers>
- <Root level="info">
- <AppenderRef ref="fileAppender"/>
- </Root>
-</Loggers>
-</Configuration> \ No newline at end of file
diff --git a/test-apis-ci/src/main/resources/logback.xml b/test-apis-ci/src/main/resources/logback.xml
deleted file mode 100644
index 4b5e23c776..0000000000
--- a/test-apis-ci/src/main/resources/logback.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<configuration>
-
- <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
- <encoder>
- <pattern>%d{yyyy-MM-dd HH:mm:ss} | %-5p | [%thread] %logger{5}:%L - %msg%n</pattern>
- </encoder>
- </appender>
-
- <appender name="FILE" class="ch.qos.logback.core.FileAppender">
- <file>logFile.log</file>
- <append>true</append>
- <encoder>
- <pattern>%d{yyyy-MM-dd HH:mm:ss} | %-5p | [%thread] %logger{5}:%L - %msg%n</pattern>
- </encoder>
- </appender>
-
- <logger name="com.memorynotfound" level="INFO"/>
-
- <root level="INFO">
- <appender-ref ref="STDOUT" />
- <appender-ref ref="FILE" />
- </root>
-
-</configuration> \ No newline at end of file
diff --git a/test-apis-ci/src/test/java/org/openecomp/sdc/conf/TestAPIConfDependentTest.java b/test-apis-ci/src/test/java/org/openecomp/sdc/conf/TestAPIConfDependentTest.java
deleted file mode 100644
index 9e664030af..0000000000
--- a/test-apis-ci/src/test/java/org/openecomp/sdc/conf/TestAPIConfDependentTest.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.conf;
-
-import org.junit.BeforeClass;
-import org.openecomp.sdc.common.test.BaseConfDependent;
-
-public class TestAPIConfDependentTest extends BaseConfDependent{
- @BeforeClass
- public static void setupBeforeClass() {
- componentName = "test-apis-ci";
- confPath = "src/test/resources/config";
- setUp();
- }
-}
diff --git a/test-apis-ci/src/test/java/org/openecomp/sdc/cucumber/runners/RunTenantIsolationCucumberCI.java b/test-apis-ci/src/test/java/org/openecomp/sdc/cucumber/runners/RunTenantIsolationCucumberCI.java
deleted file mode 100644
index 2c9fca2186..0000000000
--- a/test-apis-ci/src/test/java/org/openecomp/sdc/cucumber/runners/RunTenantIsolationCucumberCI.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.cucumber.runners;
-
-import io.cucumber.junit.Cucumber;
-import io.cucumber.junit.CucumberOptions;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.runner.RunWith;
-import org.openecomp.sdc.conf.TestAPIConfDependentTest;
-
-@RunWith(Cucumber.class)
-@CucumberOptions(features = "classpath:cucumber/tenantIsolation.feature", glue = "org.openecomp.sdc.cucumber.steps")
-
-public class RunTenantIsolationCucumberCI extends TestAPIConfDependentTest {
-
- @BeforeClass
- public static void beforeClass() {
- }
-
- @AfterClass
- public static void afterClassJUnit() {
- }
-
- @org.testng.annotations.BeforeClass
- public static void beforeClassTestNg() {
- }
-
- @org.testng.annotations.AfterClass
- public static void afterClassTestNG() {
- }
-}
diff --git a/test-apis-ci/src/test/java/org/openecomp/sdc/cucumber/spring/ImportTableConfig.java b/test-apis-ci/src/test/java/org/openecomp/sdc/cucumber/spring/ImportTableConfig.java
deleted file mode 100644
index 275f1032b4..0000000000
--- a/test-apis-ci/src/test/java/org/openecomp/sdc/cucumber/spring/ImportTableConfig.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.cucumber.spring;
-
-import org.openecomp.sdc.be.dao.cassandra.CassandraClient;
-import org.openecomp.sdc.be.dao.cassandra.OperationalEnvironmentDao;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-@Configuration
-public class ImportTableConfig {
- @Bean(name = "cassandra-client")
- public CassandraClient cassandraClient() {
- return new CassandraClient();
- }
-
- @Bean(name = "operational-environment-dao")
- public OperationalEnvironmentDao operationalEnvironmentDao(CassandraClient cassandraClient) {
- return new OperationalEnvironmentDao(cassandraClient);
- }
-}
diff --git a/test-apis-ci/src/test/java/org/openecomp/sdc/cucumber/steps/PrecannedTestExpectationCallback.java b/test-apis-ci/src/test/java/org/openecomp/sdc/cucumber/steps/PrecannedTestExpectationCallback.java
deleted file mode 100644
index 7bd002efda..0000000000
--- a/test-apis-ci/src/test/java/org/openecomp/sdc/cucumber/steps/PrecannedTestExpectationCallback.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.cucumber.steps;
-
-import com.google.common.net.HttpHeaders;
-import org.apache.http.entity.ContentType;
-import org.mockserver.mock.action.ExpectationCallback;
-import org.mockserver.model.Header;
-import org.mockserver.model.HttpRequest;
-import org.mockserver.model.HttpResponse;
-
-import static org.mockserver.model.HttpResponse.response;
-
-public class PrecannedTestExpectationCallback implements ExpectationCallback {
- private static volatile int countRequests;
-
- static HttpResponse httpResponse = response()
- .withStatusCode(200)
- .withHeaders(new Header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON.getMimeType()));
-
- @Override
- public HttpResponse handle(HttpRequest httpRequest) {
- countRequests++;
-
- System.out.println(
- String.format("MSO Server Simulator Recieved %s Final Distribution Complete Rest Reports From ASDC",
- countRequests));
-
- return httpResponse;
- }
-
-}
diff --git a/test-apis-ci/src/test/java/org/openecomp/sdc/cucumber/steps/StepsTenantIsolationCI.java b/test-apis-ci/src/test/java/org/openecomp/sdc/cucumber/steps/StepsTenantIsolationCI.java
deleted file mode 100644
index e19280aa46..0000000000
--- a/test-apis-ci/src/test/java/org/openecomp/sdc/cucumber/steps/StepsTenantIsolationCI.java
+++ /dev/null
@@ -1,606 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.cucumber.steps;
-
-import com.google.common.base.Strings;
-import com.google.common.net.HttpHeaders;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonParser;
-import io.cucumber.java.After;
-import io.cucumber.java.Before;
-import io.cucumber.java.en.Given;
-import io.cucumber.java.en.Then;
-import io.cucumber.java.en.When;
-import fj.data.Either;
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.http.HttpStatus;
-import org.apache.http.entity.ContentType;
-import org.apache.http.entity.StringEntity;
-import org.mockserver.integration.ClientAndServer;
-import org.mockserver.model.Header;
-import org.mockserver.model.HttpRequest;
-import org.openecomp.sdc.api.IDistributionClient;
-import org.openecomp.sdc.api.consumer.IConfiguration;
-import org.openecomp.sdc.api.consumer.IFinalDistrStatusMessage;
-import org.openecomp.sdc.api.consumer.INotificationCallback;
-import org.openecomp.sdc.api.notification.IArtifactInfo;
-import org.openecomp.sdc.api.notification.INotificationData;
-import org.openecomp.sdc.api.results.IDistributionClientDownloadResult;
-import org.openecomp.sdc.api.results.IDistributionClientResult;
-import org.openecomp.sdc.be.dao.cassandra.CassandraOperationStatus;
-import org.openecomp.sdc.be.dao.cassandra.OperationalEnvironmentDao;
-import org.openecomp.sdc.be.datatypes.enums.EnvironmentStatusEnum;
-import org.openecomp.sdc.be.resources.data.OperationalEnvironmentEntry;
-import org.openecomp.sdc.common.datastructure.FunctionalInterfaces;
-import org.openecomp.sdc.common.datastructure.Wrapper;
-import org.openecomp.sdc.cucumber.spring.ImportTableConfig;
-import org.openecomp.sdc.http.HttpAsdcClient;
-import org.openecomp.sdc.http.HttpAsdcResponse;
-import org.openecomp.sdc.http.IHttpAsdcClient;
-import org.openecomp.sdc.impl.DistributionClientFactory;
-import org.openecomp.sdc.utils.ArtifactTypeEnum;
-import org.openecomp.sdc.utils.DistributionActionResultEnum;
-import org.openecomp.sdc.utils.DistributionStatusEnum;
-import org.springframework.context.annotation.AnnotationConfigApplicationContext;
-
-import java.util.*;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.is;
-import static org.mockserver.model.HttpClassCallback.callback;
-import static org.mockserver.model.HttpRequest.request;
-import static org.mockserver.model.HttpResponse.response;
-import static org.openecomp.sdc.common.datastructure.FunctionalInterfaces.retryMethodOnResult;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-
-//import org.openecomp.sdc.dmaap.DmaapPublisher;
-
-public class StepsTenantIsolationCI {
-
- private Map<String, OperationalEnvironmentEntry> recordMap = new HashMap<>();
- private OperationalEnvironmentDao operationalEnvironmentDao;
- private ClientAndServer aaiMockServer;
- private ClientAndServer msoMockServer;
- private List<IDistributionClient> distributionClients = new ArrayList<>();
-
- private List<String> wdFinalStatusSent = new ArrayList<>();
-
- private HttpRequest msoHttpRequest;
- private List<String> uuidServicesList;
- private boolean cleanFlag = true;
- private int maxStepWaitTimeMs;
-
- private List<String> envIds = new ArrayList<>();
- private List<OperationalEnvironmentEntry> envList = new ArrayList<>();
- private String asdcAddress;
- private volatile int numberOfFinalDistributionsSentByASDC;
- private int numOfArtifactsToDownload;
- private volatile int totalNumOfArtifactsToDownload;
- private List<String> envNames = new ArrayList<>(Arrays.asList("Apple", "Orange", "Grape", "Pear", "Watermelon", "Bannana", "Cherry", "Coconut", "Fig", "Mango", "Peach", "Pineapple", "Plum", "Strawberries", "Apricot"));
-
- private static final String AAI_RESPONSE_BODY_FMT = "{\"operational-environment-id\":\"UUID of Operational Environment\","
- + "\"operational-environment-name\":\"Op Env Name\"," + "\"operational-environment-type\":\"ECOMP\","
- + "\"operational-environment-status\":\"Activate\"," + "\"tenant-context\":\"%s\","
- + "\"workload-context\":\"%s\"," + "\"resource-version\":\"1505228226913\"," + "\"relationship-list\":{}}";
-
- private static final String AAI_PATH_REGEX = "/aai/v12/cloud-infrastructure/operational-environments/.*";
-
- private static final String MSO_PATH_REGEX = "/onap/mso/infra/modelDistributions/v1/distributions/.*";
-
- @Before
- public void beforeScenario() {
- Collections.shuffle(envNames);
- aaiMockServer = ClientAndServer.startClientAndServer(1111);
- msoMockServer = ClientAndServer.startClientAndServer(1112);
-
- this.operationalEnvironmentDao = createDaoObj();
- }
-
- @After
- public void afterScenario() {
- System.out.println("Cleaning Up After Scenario...");
- aaiMockServer.stop();
- msoMockServer.stop();
- if (cleanFlag) {
- envIds.stream().forEach(operationalEnvironmentDao::delete);
- }
- distributionClients.stream().forEach(IDistributionClient::stop);
- System.out.println("Cleaning Up After Scenario Done");
- }
-
- // ############################# Given - Start #############################
-
- @Given("^clean db after test is (.*)$")
- public void clean_db_after_test_is(boolean cleanFlag) {
- this.cleanFlag = cleanFlag;
- }
-
- @Given("^AAI returns (.*) and aai_body contains (.*) and (.*)$")
- public void aai_returns(int retCode, String tenant, String workload) throws Throwable {
- String aaiResponseBody = String.format(AAI_RESPONSE_BODY_FMT, tenant, workload);
-
- setAaiMockServer(aaiResponseBody);
-
- System.out.println(aaiMockServer.getClass());
- }
-
- @Given("^MSO-WD Simulators Started with topic name (.*)$")
- public void notification_listner_simulators_started(String topicName) throws Throwable {
- envList.forEach(env -> {
- final IDistributionClient distClientSim = simulateDistributionClientWD(topicName, env);
- distributionClients.add(distClientSim);
- });
-
- }
-
- @Given("^MSO Final Distribution Simulator is UP$")
- public void mso_Final_Distribution_Simulator_is_UP() throws Throwable {
- msoHttpRequest = request().withPath(MSO_PATH_REGEX);
- msoMockServer.when(msoHttpRequest).forward(
- callback().withCallbackClass("org.openecomp.sdc.cucumber.steps.PrecannedTestExpectationCallback"));
- }
-
- @Given("^ASDC Address is (.*)$")
- public void asdc_Address_is(String asdcAddress) throws Throwable {
- this.asdcAddress = asdcAddress;
-
- }
-
- @Given("^ASDC Contains the following services (.*)$")
- public void asdc_Contains_the_following_services(String listOfServicesUUID) throws Throwable {
- uuidServicesList = Arrays.asList(listOfServicesUUID.split(",")).stream().map(String::trim)
- .collect(Collectors.toList());
-
- int maxMinWait = uuidServicesList.size() * envIds.size();
- this.maxStepWaitTimeMs = 60000 * maxMinWait;
- System.out.println(String.format("Set Max Step Wait Time To: %s Minutes", maxMinWait));
- }
-
- @Given("^The number of complete environments is (.*)$")
- public void the_number_of_complete_environments_is(int envNum) throws Throwable {
-
- int counter = 1;
- while( envNum > envNames.size()){
- envNames.add(String.valueOf(counter));
- counter++;
- }
-
-
- for (int i = 0; i < envNum; i++) {
- OperationalEnvironmentEntry preSaveEntry = new OperationalEnvironmentEntry();
-
- preSaveEntry.setStatus(EnvironmentStatusEnum.COMPLETED);
- preSaveEntry.setLastModified(new Date(System.currentTimeMillis()));
-
- Set<String> uebAdresses = new HashSet<>();
- uebAdresses.add("uebsb92sfdc.it.att.com");
- preSaveEntry.setDmaapUebAddress(uebAdresses);
- preSaveEntry.setIsProduction(false);
- preSaveEntry.setUebApikey("sSJc5qiBnKy2qrlc");
- preSaveEntry.setUebSecretKey("4ZRPzNJfEUK0sSNBvccd2m7X");
- preSaveEntry.setTenant("TEST");
- preSaveEntry.setEcompWorkloadContext("ECOMP_E2E-IST");
-
- // String envId = UUID.randomUUID().toString();
- String envId = envNames.get(i);
- preSaveEntry.setEnvironmentId(envId);
- envIds.add(envId);
- envList.add(preSaveEntry);
- operationalEnvironmentDao.save(preSaveEntry);
- }
- }
-
- @Given("^The number of artifacts each Simulator downloads from a service is (.*)$")
- public void number_of_artifacts_each_simulator_downloads(int numOfArtifactsToDownload) throws Throwable {
- this.numOfArtifactsToDownload = numOfArtifactsToDownload;
- }
-
- // ############################# Given - End #############################
-
- // ############################# When - Start #############################
- @When("^Distribution Requests are Sent By MSO$")
- public void distribution_Requests_are_Sent_By_MSO() throws Throwable {
- envList.stream().forEach(this::distributeServiceInEnv);
-
- }
-
- @When("^The Number Of Operational Envrinoments that created is (.*) and Records are added with data (.*)$")
- public void operational_envrinoments_records_are_added_with_data(int numOfRecords, String recordData)
- throws Throwable {
- for (int i = 0; i < numOfRecords; i++) {
- OperationalEnvironmentEntry preSaveEntry = new OperationalEnvironmentEntry();
- JsonElement root = new JsonParser().parse(recordData);
-
- String originalStatus = root.getAsJsonObject().get("status").getAsString();
- int delta = root.getAsJsonObject().get("last_modified_delta").getAsInt();
- preSaveEntry.setStatus(EnvironmentStatusEnum.getByName(originalStatus));
- long last_modified = System.currentTimeMillis() + delta * 1000;
- preSaveEntry.setLastModified(new Date(last_modified));
- String envId = UUID.randomUUID().toString();
- preSaveEntry.setEnvironmentId(envId);
- envIds.add(envId);
- // envrionmentIds.add(envId);
- operationalEnvironmentDao.save(preSaveEntry);
-
- }
-
- }
-
- // ############################# When - End #############################
-
- // ############################# Then - Start #############################
- @Then("^Operational Environment record contains tenant field (.*$)")
- public void operational_environment_record_contains_tenant(boolean tenantExist) throws Throwable {
- envIds.forEach(envId -> {
- validateStringFieldPresent(tenantExist, OperationalEnvironmentEntry::getTenant, envId,
- "Tenant is not as expected");
- });
- }
-
- @Then("^Operational Environment record contains workload field (.*$)")
- public void operational_environment_record_contains_workload(boolean workloadExist) throws Throwable {
- envIds.forEach(envId -> {
- validateStringFieldPresent(workloadExist, OperationalEnvironmentEntry::getEcompWorkloadContext, envId,
- "Workload is not as expected");
- });
- }
-
- @Then("^Operational Environment record contains UEB Address field (.*$)")
- public void operational_environment_record_contains_ueb_address(boolean uebAddresExist) throws Throwable {
- envIds.forEach(envId -> {
- validateStringFieldPresent(uebAddresExist, this::convertUebAddressToList, envId,
- "UEB Address is not as expected");
- });
- }
-
- @Then("^The Number Of Environment is (.*) with status (.*)$")
- public void the_Number_Of_Environment_Created_is(int numberOfEnvsCreated, String status) throws Throwable {
- // Write code here that turns the phrase above into concrete actions
-
- retryMethodOnResult(() -> getCurrentEnvironmets(status), envList -> envList.size() == numberOfEnvsCreated,
- 40000, 500);
-
- List<OperationalEnvironmentEntry> environmentsFound = getCurrentEnvironmets(status);
-
- assertThat(environmentsFound.size(), is(numberOfEnvsCreated));
-
- environmentsFound.forEach(env -> recordMap.put(env.getEnvironmentId(), env));
- envList.addAll(environmentsFound);
- }
-
- @Then("^MSO Final Distribution Recieved Correct Number Of Request$")
- public void mso_final_distribution_recieved_request() throws Throwable {
- int expectedNumberOfRequestsSentByASDC = calculateExcpectedNumberOfDistributionRequets();
- Function<Integer, Boolean> resultVerifier = actualStatusList -> actualStatusList >= expectedNumberOfRequestsSentByASDC;
- retryMethodOnResult(() -> numberOfFinalDistributionsSentByASDC(expectedNumberOfRequestsSentByASDC),
- resultVerifier, maxStepWaitTimeMs, 500);
- int actualNumberOfRequestsSentByASDC = numberOfFinalDistributionsSentByASDC(expectedNumberOfRequestsSentByASDC);
- assertThat(actualNumberOfRequestsSentByASDC, is(expectedNumberOfRequestsSentByASDC));
- }
-
- @Then("^All MSO-WD Simulators Sent The Distribution Complete Notifications$")
- public void all_mso_wd_simulators_sent_the_distribution_complete_notifications() {
- // Wait Watch Dogs To Send Final Distribution
- int excpectedNumberOfDistributionCompleteNotifications = calculateExcpectedNumberOfDistributionRequets();
- final Function<List<String>, Boolean> resultVerifier = actualStatusList -> actualStatusList
- .size() == excpectedNumberOfDistributionCompleteNotifications;
- retryMethodOnResult(() -> wdFinalStatusSent, resultVerifier, maxStepWaitTimeMs, 500);
- assertThat(wdFinalStatusSent.size(), is(excpectedNumberOfDistributionCompleteNotifications));
- }
- @Then("^All Artifacts were downloaded by Simulators$")
- public void all_artifacts_downloaded() {
- // Wait Watch Dogs To Send Final Distribution
- int excpectedNumberOfArtifactsToDownload = numOfArtifactsToDownload * envIds.size() * uuidServicesList.size();
- assertThat(totalNumOfArtifactsToDownload, is(excpectedNumberOfArtifactsToDownload));
- }
- // ############################# Then - End #############################
-
- private List<OperationalEnvironmentEntry> getCurrentEnvironmets(String status) {
- Either<List<OperationalEnvironmentEntry>, CassandraOperationStatus> eitherStatus = operationalEnvironmentDao
- .getByEnvironmentsStatus(EnvironmentStatusEnum.getByName(status));
- assertThat(eitherStatus.isLeft(), is(true));
-
- List<OperationalEnvironmentEntry> environmentsRetrieved = eitherStatus.left().value();
-
- List<OperationalEnvironmentEntry> environmentsFound = environmentsRetrieved.stream()
- .filter(env -> envIds.contains(env.getEnvironmentId())).collect(Collectors.toList());
- return environmentsFound;
- }
-
- private int numberOfFinalDistributionsSentByASDC(int expectedNumberOfRequestsSentByASDC) {
- final int newVal = msoMockServer.retrieveRecordedRequests(msoHttpRequest).length;
- if (newVal != numberOfFinalDistributionsSentByASDC) {
- System.out.println(String.format(
- "MSO Server Simulator Recieved %s/%s Final Distribution Complete Rest Reports From ASDC", newVal,
- expectedNumberOfRequestsSentByASDC));
- numberOfFinalDistributionsSentByASDC = newVal;
- }
-
- return newVal;
- }
-
- private int calculateExcpectedNumberOfDistributionRequets() {
- int numberOfDistributionRequests = envList.size() * uuidServicesList.size();
- return numberOfDistributionRequests;
- }
-
- private static OperationalEnvironmentDao createDaoObj() {
- AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ImportTableConfig.class);
- final OperationalEnvironmentDao openvDao = (OperationalEnvironmentDao) context
- .getBean("operational-environment-dao");
- return openvDao;
- }
-
- private OperationalEnvironmentEntry getRecord(String environmentId) {
- Either<OperationalEnvironmentEntry, CassandraOperationStatus> result = operationalEnvironmentDao
- .get(environmentId);
- return result.isLeft() ? result.left().value() : null;
- }
-
- private void validateStringFieldPresent(boolean fieldExist,
- Function<OperationalEnvironmentEntry, String> getFieldFunc, String envId, String msg) {
- OperationalEnvironmentEntry record = recordMap.computeIfAbsent(envId, this::getRecord);
-
- assertNotNull(record, "Expected DB record was not found");
-
- String actualValue = getFieldFunc.apply(record);
-
- assertEquals(fieldExist, !Strings.isNullOrEmpty(actualValue), msg);
- }
-
- private void setAaiMockServer(String aaiResponseBody) {
- HttpRequest httpRequest = request().withMethod("GET").withPath(AAI_PATH_REGEX)
- .withHeaders(new Header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON.getMimeType()));
-
- aaiMockServer.when(httpRequest)
- .respond(response()
- .withHeaders(new Header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON.getMimeType()))
- .withBody(aaiResponseBody));
- }
-
- private IDistributionClient simulateDistributionClientWD(String topicName, OperationalEnvironmentEntry opEnv) {
-
- IDistributionClient client = DistributionClientFactory.createDistributionClient();
- final IConfiguration buildDistributionClientConfiguration = buildDistributionClientConfiguration(topicName,
- opEnv);
- IDistributionClientResult initResult = client.init(buildDistributionClientConfiguration,
- new INotificationCallback() {
-
- @Override
- public void activateCallback(INotificationData data) {
- buildWdSimulatorCallback(opEnv, client, buildDistributionClientConfiguration, data);
-
- }
-
- });
- assertThat(initResult.getDistributionActionResult(), is(DistributionActionResultEnum.SUCCESS));
- IDistributionClientResult startResult = client.start();
- assertThat(startResult.getDistributionActionResult(), is(DistributionActionResultEnum.SUCCESS));
- System.out.println(String.format("WD Simulator On Environment:\"%s\" Started Successfully",
- buildDistributionClientConfiguration.getConsumerID()));
- return client;
- }
-
- private IFinalDistrStatusMessage buildFinalDistribution() {
- return new IFinalDistrStatusMessage() {
-
- @Override
- public long getTimestamp() {
- return System.currentTimeMillis();
- }
-
- @Override
- public DistributionStatusEnum getStatus() {
- return DistributionStatusEnum.DISTRIBUTION_COMPLETE_OK;
- }
-
- @Override
- public String getDistributionID() {
- return "FakeDistributionId";
- }
- };
- }
-
- private IConfiguration buildDistributionClientConfiguration(String topicName, OperationalEnvironmentEntry opEnv) {
- return new IConfiguration() {
-
- public String getUser() {
- return "ci";
- }
-
- public int getPollingTimeout() {
- return 20;
- }
-
- public int getPollingInterval() {
- return 20;
- }
-
- public String getPassword() {
- return "123456";
- }
-
- public String getEnvironmentName() {
- return topicName;
- }
-
- public String getConsumerID() {
- return opEnv.getEnvironmentId();
- }
-
- public String getConsumerGroup() {
- return String.format("BenchMarkDistributionClientConsumerGroup%s", opEnv.getEnvironmentId());
- }
-
- public String getAsdcAddress() {
- return String.format("%s:8443", asdcAddress);
- }
-
- @Override
- public String getKeyStorePath() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public String getKeyStorePassword() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public boolean activateServerTLSAuth() {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public List<String> getRelevantArtifactTypes() {
- return Arrays.asList(ArtifactTypeEnum.values()).stream()
- .map(artifactTypeEnum -> artifactTypeEnum.name()).collect(Collectors.toList());
- }
-
- @Override
- public boolean isFilterInEmptyResources() {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public Boolean isUseHttpsWithDmaap() {
- return null;
- }
-
- @Override
- public List<String> getMsgBusAddress() {
- return opEnv.getDmaapUebAddress().stream().map(this::extractHost).collect(Collectors.toList());
- }
-
- private String extractHost(String url) {
- return url.split(":")[0];
- }
- };
- }
-
- private void distributeServiceInEnv(OperationalEnvironmentEntry env) {
- uuidServicesList.stream().forEach(serviceUUID -> distributeSingleService(env, serviceUUID));
- }
-
- private void distributeSingleService(OperationalEnvironmentEntry env, String serviceUUID) {
- IHttpAsdcClient client = new HttpAsdcClient(buildDistributionClientConfiguration(StringUtils.EMPTY, env));
- String pattern = "/sdc/v1/catalog/services/%s/distribution/%s/activate";
- String requestUrl = String.format(pattern, serviceUUID, env.getEnvironmentId());
- String requestBody = String.format("{\"workloadContext\":\"%s\"}", env.getEnvironmentId());
- StringEntity body = new StringEntity(requestBody, ContentType.APPLICATION_JSON);
- Map<String, String> headersMap = new HashMap<>();
- headersMap.put("USER_ID", "cs0008");
- headersMap.put("X-ECOMP-InstanceID", "test");
- headersMap.put("Content-Type", "application/json");
-
- HttpAsdcResponse postRequest = FunctionalInterfaces.retryMethodOnResult(
- () -> distributeMethod(client, requestUrl, serviceUUID, body, headersMap, env.getEnvironmentId()),
- resp -> resp.getStatus() == HttpStatus.SC_ACCEPTED);
- assertThat(postRequest.getStatus(), is(HttpStatus.SC_ACCEPTED));
-
- }
-
- private HttpAsdcResponse distributeMethod(IHttpAsdcClient client, String requestUrl, String serviceUUID,
- StringEntity body, Map<String, String> headersMap, String envId) {
-
- final HttpAsdcResponse postRequest = client.postRequest(requestUrl, body, headersMap);
- final String message = String.format(
- "MSO Client Simulator Distributes Service:%s On Environment:\"%s\" - Recieved Response: %s", serviceUUID, envId,
- postRequest.getStatus());
- if (postRequest.getStatus() != HttpStatus.SC_ACCEPTED) {
- System.err.println(message);
- } else {
- System.out.println(message);
- }
-
- return postRequest;
- }
-
- private String convertUebAddressToList(OperationalEnvironmentEntry op) {
- Set<String> dmaapUebAddress = op.getDmaapUebAddress();
- Wrapper<String> resultWrapper = new Wrapper<>(StringUtils.EMPTY);
- if (!CollectionUtils.isEmpty(dmaapUebAddress)) {
- dmaapUebAddress.stream()
- .forEach(uebAddress -> resultWrapper.setInnerElement(resultWrapper.getInnerElement() + uebAddress));
- }
-
- return resultWrapper.getInnerElement();
- }
-
- private void buildWdSimulatorCallback(OperationalEnvironmentEntry opEnv, IDistributionClient client,
- final IConfiguration buildDistributionClientConfiguration, INotificationData data) {
- if (StringUtils.equals(data.getWorkloadContext(), opEnv.getEnvironmentId())) {
-
- final String expectedArtifactType = org.openecomp.sdc.common.api.ArtifactTypeEnum.MODEL_INVENTORY_PROFILE.name();
- Optional<IArtifactInfo> optional = data.getServiceArtifacts().stream().filter( artifact -> {
- return StringUtils.equals(artifact.getArtifactType(), expectedArtifactType);
- }).findAny();
-
- for (int i = 0; i < numOfArtifactsToDownload; i++) {
- optional.ifPresent( artifactInfo -> simulateDownload(client , artifactInfo, data) );
- optional.orElseThrow( () -> handleArtifactNotFound(expectedArtifactType, data));
-
- }
- if( numOfArtifactsToDownload > 0 ){
- System.out.println(String.format(
- "ASDC Consumer Simulator On Environment:\"%s\" Downloaded %s Artifacts From ASDC Service with UUID:%s Total Artifacts Downloaded from ASDC is: %s",
- data.getWorkloadContext(), numOfArtifactsToDownload,
- data.getServiceUUID(), totalNumOfArtifactsToDownload));
- }
-
- IDistributionClientResult finalDistrStatus = client.sendFinalDistrStatus(buildFinalDistribution());
- assertThat(finalDistrStatus.getDistributionActionResult(), is(DistributionActionResultEnum.SUCCESS));
- wdFinalStatusSent.add(data.getWorkloadContext());
-
- System.out.println(String.format(
- "WD Simulator On Environment:\"%s\" Recieved Notification From ASDC On WorkLoad: %s And Service UUID:%s And Sends Distribution Complete Notification",
- buildDistributionClientConfiguration.getConsumerID(), data.getWorkloadContext(),
- data.getServiceUUID()));
- }
- }
-
- private IllegalStateException handleArtifactNotFound(String expectedArtifactType, INotificationData data ){
- final String stringMessage = String.format("Did Not Find Artifact of type: %s to download from service with UUID:%s", expectedArtifactType, data.getServiceUUID());
- System.err.println(stringMessage);
- return new IllegalStateException(stringMessage);
-
- }
-
- private void simulateDownload(IDistributionClient client, IArtifactInfo info, INotificationData data){
- IDistributionClientDownloadResult downloadResult = client.download(info);
- if( downloadResult.getDistributionActionResult() != DistributionActionResultEnum.SUCCESS ){
- System.err.println(String.format("Client Simulator %s Failed to download artifact from service : %s", client.getConfiguration().getConsumerID(), data.getServiceUUID()));
- assertThat(downloadResult.getDistributionActionResult(), is(DistributionActionResultEnum.SUCCESS));
- }
- else{
- totalNumOfArtifactsToDownload++;
-
- }
- }
-}
diff --git a/test-apis-ci/src/test/java/org/openecomp/sdc/cucumber/utils/RunnerSession.java b/test-apis-ci/src/test/java/org/openecomp/sdc/cucumber/utils/RunnerSession.java
deleted file mode 100644
index 9c0bdf79a5..0000000000
--- a/test-apis-ci/src/test/java/org/openecomp/sdc/cucumber/utils/RunnerSession.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.cucumber.utils;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Store Data here that is relevant for the whole runner and not just a single scenario.
- * @author ms172g
- *
- */
-public class RunnerSession {
- private static final RunnerSession instance = new RunnerSession();
- private Map<String, String> stringElements;
- private Map<String, Integer> intElements;
- private Map<String, Object> elements;
- private RunnerSession(){
- stringElements = new HashMap<>();
- intElements = new HashMap<>();
- elements = new HashMap<>();
- }
- public static RunnerSession getSession(){
- return instance;
- }
-
- public void putInSession(String key, String value){
- stringElements.put(key, value);
- }
-
- public String getString(String key){
- return stringElements.get(key);
-
- }
-
- public void putInSession(String key, Integer value){
- intElements.put(key, value);
- }
-
-
- public Integer getInt(String key){
- return intElements.get(key);
- }
-
- public void putInSession(String key, Object value) {
- elements.put(key, value);
-
- }
-
- public Object get(String key){
- return elements.get(key);
- }
-
- public void clean(){
- intElements.clear();
- stringElements.clear();
- }
-
-
-
-
-
-}
diff --git a/test-apis-ci/src/test/resources/CI/csars/VLANTaggingFromAmdox1303_2018.csar b/test-apis-ci/src/test/resources/CI/csars/VLANTaggingFromAmdox1303_2018.csar
deleted file mode 100644
index 6c14b1fcd5..0000000000
--- a/test-apis-ci/src/test/resources/CI/csars/VLANTaggingFromAmdox1303_2018.csar
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/src/test/resources/CI/csars/incorrect_cap.csar b/test-apis-ci/src/test/resources/CI/csars/incorrect_cap.csar
deleted file mode 100644
index 506eb851bf..0000000000
--- a/test-apis-ci/src/test/resources/CI/csars/incorrect_cap.csar
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/src/test/resources/CI/csars/with_groups.csar b/test-apis-ci/src/test/resources/CI/csars/with_groups.csar
deleted file mode 100644
index d344ed2d55..0000000000
--- a/test-apis-ci/src/test/resources/CI/csars/with_groups.csar
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/src/test/resources/CI/csars/with_groups_update.csar b/test-apis-ci/src/test/resources/CI/csars/with_groups_update.csar
deleted file mode 100644
index c813d814b6..0000000000
--- a/test-apis-ci/src/test/resources/CI/csars/with_groups_update.csar
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/src/test/resources/CI/csars/without_caps.csar b/test-apis-ci/src/test/resources/CI/csars/without_caps.csar
deleted file mode 100644
index 3ffb8643e1..0000000000
--- a/test-apis-ci/src/test/resources/CI/csars/without_caps.csar
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/src/test/resources/CI/ecomp-error-configuration.yaml b/test-apis-ci/src/test/resources/CI/ecomp-error-configuration.yaml
deleted file mode 100644
index 9d7cd74a2b..0000000000
--- a/test-apis-ci/src/test/resources/CI/ecomp-error-configuration.yaml
+++ /dev/null
@@ -1,383 +0,0 @@
-###########################################
-# Note the conventions of the field values:
-# type can be one of: CONFIG_ERROR, SYSTEM_ERROR, DATA_ERROR, CONNECTION_PROBLEM, AUTHENTICATION_PROBLEM
-# severity can be one of: WARN, ERROR, FATAL
-# alarmSeverity can be one of: CRITICAL,MAJOR,MINOR,INFORMATIONAL,NONE
-# code is a unique integer in range of 3003-9999 (3000-3002 are occupied for internal usage)
-# The above enumeration values are out-of-the-box and can be changed in code.
-# In case of config and code mismatch, the appropriate error will be printed to log
-#
-## Range of BE codes - 3010-7999
-
-errors:
-
- BeRestApiGeneralError: {
- type: SYSTEM_ERROR,
- code: ASDC_4000,
- severity: ERROR,
- description: "Unexpected error during BE REST API execution",
- alarmSeverity: CRITICAL
- }
-
- BeHealthCheckError: {
- type: SYSTEM_ERROR,
- code: ASDC_3010,
- severity: ERROR,
- description: "Error during BE Health Check",
- alarmSeverity: CRITICAL
- }
-
- BeInitializationError: {
- type: SYSTEM_ERROR,
- code: ASDC_4019,
- severity: ERROR,
- description: "Catalog-BE was not initialized properly",
- alarmSeverity: CRITICAL
- }
-
- BeResourceMissingError: {
- type: SYSTEM_ERROR,
- code: ASDC_3011,
- severity: ERROR,
- description: "Mandatory resource %s cannot be found in repository",
- alarmSeverity: MAJOR
- }
-
- BeServiceMissingError: {
- type: SYSTEM_ERROR,
- code: ASDC_3012,
- severity: ERROR,
- description: "Mandatory service %s cannot be found in repository",
- alarmSeverity: MAJOR
- }
-
- BeFailedAddingResourceInstanceError: {
- type: SYSTEM_ERROR,
- code: ASDC_3013,
- severity: ERROR,
- description: "Failed to add resource instance of resource %s to service %s",
- alarmSeverity: MAJOR
- }
-
- BeIncorrectServiceError: {
- type: SYSTEM_ERROR,
- code: ASDC_3014,
- severity: ERROR,
- description: "Service %s is not valid",
- alarmSeverity: MAJOR
- }
-
- BeRepositoryDeleteError: {
- type: SYSTEM_ERROR,
- code: ASDC_3015,
- severity: ERROR,
- description: "Failed to delete object %s from repository",
- alarmSeverity: CRITICAL
- }
-
- BeRepositoryQueryError: {
- type: SYSTEM_ERROR,
- code: ASDC_3016,
- severity: ERROR,
- description: "Failed to fetch from repository %s",
- alarmSeverity: MAJOR
- }
-
- BeInvalidConfigurationError: {
- type: CONFIG_ERROR,
- code: ASDC_3017,
- severity: FATAL,
- description: "Configuration parameter %s is invalid. Value configured is %s",
- alarmSeverity: MAJOR
- }
-
- BeUebConnectionError: {
- type: CONNECTION_PROBLEM,
- code: ASDC_4001,
- severity: ERROR,
- description: "Connection problem towards U-EB server. Reason: %s",
- alarmSeverity: MAJOR
- }
-
- BeUebSystemError: {
- type: SYSTEM_ERROR,
- code: ASDC_3019,
- severity: ERROR,
- description: "Error occured during access to U-EB Server. Operation: %s",
- alarmSeverity: MAJOR
- }
-
- BeUebObjectNotFoundError: {
- type: DATA_ERROR,
- code: ASDC_4005,
- severity: ERROR,
- description: "Error occured during access to U-EB Server. Data not found: %s",
- alarmSeverity: MAJOR
- }
-
- BeDistributionEngineSystemError: {
- type: SYSTEM_ERROR,
- code: ASDC_3021,
- severity: ERROR,
- description: "Error occured in Distribution Engine. Failed operation: %s",
- alarmSeverity: MAJOR
- }
-
- BeUebAuthenticationError: {
- type: AUTHENTICATION_PROBLEM,
- code: ASDC_4003,
- severity: ERROR,
- description: "Authentication problem towards U-EB server. Reason: %s",
- alarmSeverity: MAJOR
- }
-
- BeUebUnkownHostError: {
- type: CONNECTION_PROBLEM,
- code: ASDC_4002,
- severity: ERROR,
- description: "Connection problem towards U-EB server. Cannot reach host %s",
- alarmSeverity: MAJOR
- }
-
- BeDistributionEngineInvalidArtifactType: {
- type: DATA_ERROR,
- code: ASDC_4006,
- severity: WARN,
- description: "The artifact type %s does not appear in the list of valid artifacts %s",
- alarmSeverity: MAJOR
- }
- BeInvalidTypeError: {
- type: DATA_ERROR,
- code: ASDC_4008,
- severity: WARN,
- description: "The type %s of %s is invalid",
- alarmSeverity: MAJOR
- }
- BeInvalidValueError: {
- type: DATA_ERROR,
- code: ASDC_3028,
- severity: WARN,
- description: "The value %s of %s from type %s is invalid",
- alarmSeverity: MAJOR
- }
-
- BeFailedDeletingResourceInstanceError: {
- type: SYSTEM_ERROR,
- code: ASDC_3029,
- severity: ERROR,
- description: "Failed to delete resource instance %s from service %s",
- alarmSeverity: MAJOR
- }
-
- BeMissingConfigurationError: {
- type: CONFIG_ERROR,
- code: ASDC_3030,
- severity: FATAL,
- description: "Configuration parameter %s is missing",
- alarmSeverity: MAJOR
- }
-
- BeConfigurationInvalidListSizeError: {
- type: CONFIG_ERROR,
- code: ASDC_3031,
- severity: FATAL,
- description: "Configuration parameter %s is invalid. At least %s values shall be configured",
- alarmSeverity: MAJOR
- }
-
- ErrorConfigFileFormat: {
- type: CONFIG_ERROR,
- code: ASDC_3032,
- severity: ERROR,
- description: "Error element not found in YAML name: %s",
- alarmSeverity: MAJOR
- }
-
- BeMissingArtifactInformationError: {
- type: DATA_ERROR,
- code: ASDC_4010,
- severity: ERROR,
- description: "Artifact uploaded has missing information. Missing %s",
- alarmSeverity: MAJOR
- }
-
- BeArtifactMissingError: {
- type: DATA_ERROR,
- code: ASDC_4011,
- severity: ERROR,
- description: "Artifact %s requested is not found",
- alarmSeverity: MAJOR
- }
-
- BeArtifactPayloadInvalid: {
- type: DATA_ERROR,
- code: ASDC_4012,
- severity: ERROR,
- description: "Payload of artifact uploaded is invalid (invalid MD5 or encryption)",
- alarmSeverity: MAJOR
- }
-
- BeUserMissingError: {
- type: DATA_ERROR,
- code: ASDC_4009,
- severity: ERROR,
- description: "User %s requested is not found",
- alarmSeverity: MAJOR
- }
-
- BeArtifactInformationInvalidError: {
- type: DATA_ERROR,
- code: ASDC_4013,
- severity: ERROR,
- description: "Input for artifact metadata is invalid",
- alarmSeverity: MAJOR
- }
- BeFailedAddingCapabilityTypeError: {
- type: DATA_ERROR,
- code: ASDC_4015,
- severity: ERROR,
- description: "Failed adding capability type",
- alarmSeverity: CRITICAL
- }
-
- BeCapabilityTypeMissingError: {
- type: DATA_ERROR,
- code: ASDC_4016,
- severity: ERROR,
- description: "Capability Type %s not found",
- alarmSeverity: CRITICAL
- }
-
- BeInterfaceMissingError: {
- type: DATA_ERROR,
- code: ASDC_4020,
- severity: ERROR,
- description: "Interface %s required is missing",
- alarmSeverity: MAJOR
- }
-
- BeDaoSystemError: {
- type: SYSTEM_ERROR,
- code: ASDC_4014,
- severity: ERROR,
- description: "Operation towards database failed",
- alarmSeverity: CRITICAL
- }
-
- BeSystemError: {
- type: SYSTEM_ERROR,
- code: ASDC_4017,
- severity: ERROR,
- description: "Unexpected error during operation",
- alarmSeverity: CRITICAL
- }
-
- BeFailedLockObjectError: {
- type: SYSTEM_ERROR,
- code: ASDC_4007,
- severity: WARN,
- description: "Failed to lock object for update",
- alarmSeverity: CRITICAL
- }
-
- BeInvalidJsonInput: {
- type: SYSTEM_ERROR,
- code: ASDC_4018,
- severity: ERROR,
- description: "Failed to convert json input to object",
- alarmSeverity: MAJOR
- }
-
- BeDistributionMissingError: {
- type: DATA_ERROR,
- code: ASDC_4021,
- severity: ERROR,
- description: "Distribution %s required is missing",
- alarmSeverity: MAJOR
- }
-
- BeHealthCheckRecovery: {
- type: RECOVERY,
- code: ASDC_4022,
- severity: INFO,
- description: "BE Health Check Recovery",
- alarmSeverity: INFORMATIONAL
- }
- BeFailedCreateNodeError: {
- type: DATA_ERROR,
- code: ASDC_6000,
- severity: ERROR,
- description: "Failed to create node %s on graph. status is %s",
- alarmSeverity: MAJOR
- }
- BeFailedUpdateNodeError: {
- type: DATA_ERROR,
- code: ASDC_6001,
- severity: ERROR,
- description: "Failed to update node %s on graph. Status is %s",
- alarmSeverity: MAJOR
- }
-
- BeFailedDeleteNodeError: {
- type: DATA_ERROR,
- code: ASDC_6002,
- severity: ERROR,
- description: "Failed to delete node %s on graph. Status is %s",
- alarmSeverity: MAJOR
- }
-
- BeFailedRetrieveNodeError: {
- type: DATA_ERROR,
- code: ASDC_6003,
- severity: ERROR,
- description: "Failed to retrieve node %s from graph. Status is %s",
- alarmSeverity: MAJOR
- }
-
- BeExecuteRollbackError: {
- type: DATA_ERROR,
- code: ASDC_6004,
- severity: ERROR,
- description: "Going to execute rollback on graph.",
- alarmSeverity: MAJOR
- }
-
- BeFailedFindParentError: {
- type: DATA_ERROR,
- code: ASDC_6005,
- severity: ERROR,
- description: "Failed to find parent node %s on graph. Status is %s",
- alarmSeverity: MAJOR
- }
-
- BeFailedFindAllNodesError: {
- type: DATA_ERROR,
- code: ASDC_6006,
- severity: ERROR,
- description: "Failed to fetch all nodes with type %s of parent node %s . Status is %s",
- alarmSeverity: MAJOR
- }
-
- BeFailedFindAssociationError: {
- type: DATA_ERROR,
- code: ASDC_6007,
- severity: ERROR,
- description: "Cannot find node with type %s associated with node %s . Status is %s",
- alarmSeverity: MAJOR
- }
-
- BeFailedFindAssociationError: {
- type: DATA_ERROR,
- code: ASDC_6008,
- severity: ERROR,
- description: "Cannot find node with type %s associated with node %s . Status is %s",
- alarmSeverity: MAJOR
- }
- BeComponentCleanerSystemError: {
- type: SYSTEM_ERROR,
- code: ASDC_6009,
- severity: ERROR,
- description: "Error occured in Component Cleaner Task. Failed operation: %s",
- alarmSeverity: MAJOR
- }
- \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/error-configuration.yaml b/test-apis-ci/src/test/resources/CI/error-configuration.yaml
deleted file mode 100644
index 7fc65221aa..0000000000
--- a/test-apis-ci/src/test/resources/CI/error-configuration.yaml
+++ /dev/null
@@ -1,1784 +0,0 @@
-# Errors
-errors:
- OK: {
- code: 200,
- message: "OK"
- }
- CREATED: {
- code: 201,
- message: "OK"
- }
- NO_CONTENT: {
- code: 204,
- message: "No Content"
- }
-#--------POL4050-----------------------------
- NOT_ALLOWED: {
- code: 405,
- message: "Error: Method not allowed.",
- messageId: "POL4050"
- }
-#--------POL5000-----------------------------
- GENERAL_ERROR: {
- code: 500,
- message: "Error: Internal Server Error. Please try again later.",
- messageId: "POL5000"
- }
-#---------POL5001------------------------------
- MISSING_X_ECOMP_INSTANCE_ID: {
- code: 400 ,
- message: "Error: Missing 'X-ECOMP-InstanceID' HTTP header.",
- messageId: "POL5001"
- }
-#---------POL5002------------------------------
- AUTH_REQUIRED: {
- code: 401 ,
- message: "Error: Authentication is required to use the API.",
- messageId: "POL5002"
- }
-#---------POL5003------------------------------
- AUTH_FAILED: {
- code: 403 ,
- message: "Error: Not authorized to use the API.",
- messageId: "POL5003"
- }
-#---------POL5004------------------------------
- MISSING_USER_ID: {
- code: 400 ,
- message: "Error: Missing 'USER_ID' HTTP header.",
- messageId: "POL5004"
- }
-#---------SVC4000-----------------------------
- INVALID_CONTENT: {
- code: 400,
- message: "Error: Invalid content.",
- messageId: "SVC4000"
- }
-#---------SVC4002-----------------------------
- MISSING_INFORMATION: {
- code: 403,
- message: "Error: Missing information.",
- messageId: "SVC4002"
- }
-#---------SVC4003------------------------------
-# %1 - Users's ID
- USER_NOT_FOUND: {
- code: 404,
- message: "Error: User '%1' was not found.",
- messageId: "SVC4003"
- }
-#---------SVC4004-----------------------------
-# %1 - Users's email address
- INVALID_EMAIL_ADDRESS: {
- code: 400,
- message: "Error: Invalid email address '%1'.",
- messageId: "SVC4004"
- }
-#---------SVC4005------------------------------
-# %1 - role
- INVALID_ROLE: {
- code: 400,
- message: "Error: Invalid role '%1'.",
- messageId: "SVC4005"
- }
-#---------SVC4006------------------------------
-# %1 - Users's USER_ID
- USER_ALREADY_EXIST: {
- code: 409,
- message: "Error: User with '%1' ID already exists.",
- messageId: "SVC4006"
- }
-#---------SVC4007------------------------------
- DELETE_USER_ADMIN_CONFLICT: {
- code: 409,
- message: "Error: An administrator can only be deleted by another administrator.",
- messageId: "SVC4007"
- }
-#---------SVC4008-----------------------------
-# %1 - Users's userId
- INVALID_USER_ID: {
- code: 400,
- message: "Error: Invalid userId '%1'.",
- messageId: "SVC4008"
- }
-#---------SVC4049------------------------------
-# %1 - service/resource
- COMPONENT_MISSING_CONTACT: {
- code: 400,
- message: "Error: Invalid Content. Missing %1 contact.",
- messageId: "SVC4049"
- }
-#---------SVC4050-----------------------------
-# %1 - Service/Resource/Additional parameter
-# %2 - service/resource/label name
- COMPONENT_NAME_ALREADY_EXIST: {
- code: 409,
- message: "Error: %1 with name '%2' already exists.",
- messageId: "SVC4050"
- }
-#---------SVC4051------------------------------
-# %1 - resource/service
- COMPONENT_MISSING_CATEGORY: {
- code: 400,
- message: "Error: Invalid Content. Missing %1 category.",
- messageId: "SVC4051"
- }
-
-#---------SVC4052------------------------------
- COMPONENT_MISSING_TAGS: {
- code: 400,
- message: "Error: Invalid Content. At least one tag has to be specified.",
- messageId: "SVC4052"
- }
-
-#---------SVC4053------------------------------
-# %1 - service/resource
- COMPONENT_MISSING_DESCRIPTION: {
- code: 400,
- message: "Error: Invalid Content. Missing %1 description.",
- messageId: "SVC4053"
- }
-#---------SVC4054------------------------------
-# %1 - resource/service
- COMPONENT_INVALID_CATEGORY: {
- code: 400,
- message: "Error: Invalid Content. Value %1 for the field Category is invalid.",
- messageId: "SVC4054"
- }
-#---------SVC4055------------------------------
- MISSING_VENDOR_NAME: {
- code: 400,
- message: "Error: Invalid Content. Missing vendor name.",
- messageId: "SVC4055"
- }
-#---------SVC4056------------------------------
- MISSING_VENDOR_RELEASE: {
- code: 400,
- message: "Error: Invalid Content. Missing vendor release.",
- messageId: "SVC4056"
- }
-
-#---------SVC4057------------------------------
- MISSING_DERIVED_FROM_TEMPLATE: {
- code: 400,
- message: "Error: Invalid Content. Missing derived from template specification.",
- messageId: "SVC4057"
- }
-
-#---------SVC4058------------------------------
-# %1 - service/resource
- COMPONENT_MISSING_ICON: {
- code: 400,
- message: "Error: Invalid Content. Missing %1 icon.",
- messageId: "SVC4058"
- }
-#---------SVC4059------------------------------
-# %1 - service/resource
- COMPONENT_INVALID_ICON: {
- code: 400,
- message: "Error: Invalid Content. Invalid %1 icon.",
- messageId: "SVC4059"
- }
-#---------SVC4060------------------------------
- PARENT_RESOURCE_NOT_FOUND: {
- code: 400,
- message: "Error: Invalid Content. Derived from resource template was not found.",
- messageId: "SVC4060"
- }
-#---------SVC4061------------------------------
- MULTIPLE_PARENT_RESOURCE_FOUND: {
- code: 400,
- message: "Error: Invalid Content. Multiple derived from resource template is not allowed.",
- messageId: "SVC4061"
- }
-
-#---------SVC4062------------------------------
-# %1 - service/resource
- MISSING_COMPONENT_NAME: {
- code: 400,
- message: "Error: Invalid Content. Missing %1 name.",
- messageId: "SVC4062"
- }
-#---------SVC4063------------------------------
- #%1  -  resource/service name
- RESOURCE_NOT_FOUND: {
- code: 404,
- message: "Error: Requested '%1' resource was not found.",
- messageId: "SVC4063"
- }
-
-#---------SVC4064------------------------------
-# %1 - Service/Resource/Property
- COMPONENT_INVALID_DESCRIPTION: {
- code: 400,
- message: "Error: Invalid Content. %1 description contains non-english characters.",
- messageId: "SVC4064"
- }
-#---------SVC4065------------------------------
-# %1 - Service/Resource/Property
-# %2 - max resource/service name length
- COMPONENT_DESCRIPTION_EXCEEDS_LIMIT: {
- code: 400,
- message: "Error: Invalid Content. %1 description exceeds limit of %2 characters.",
- messageId: "SVC4065"
- }
-#---------SVC4066------------------------------
-# %1 - max length
- COMPONENT_TAGS_EXCEED_LIMIT: {
- code: 400,
- message: "Error: Invalid Content. Tags overall length exceeds limit of %1 characters.",
- messageId: "SVC4066"
- }
-#---------SVC4067------------------------------
-# %1 - max length
- VENDOR_NAME_EXCEEDS_LIMIT: {
- code: 400,
- message: "Error: Invalid Content. Vendor name exceeds limit of %1 characters.",
- messageId: "SVC4067"
- }
-#---------SVC4068------------------------------
-# %1 - max length
- VENDOR_RELEASE_EXCEEDS_LIMIT: {
- code: 400,
- message: "Error: Invalid Content. Vendor release exceeds limit of %1 characters.",
- messageId: "SVC4068"
- }
-
-#---------SVC4069------------------------------
-# %1 - Service/Resource/Product
- COMPONENT_INVALID_CONTACT: {
- code: 400,
- message: "Error: Invalid Content. %1 Contact Id should be in format 'mnnnnnn' or 'aannna' or 'aannnn', where m=m ,a=a-zA-Z and n=0-9",
- messageId: "SVC4069"
- }
-#---------SVC4070------------------------------
-# %1 - Service/Resource
- INVALID_COMPONENT_NAME: {
- code: 400,
- message: 'Error: Invalid Content. Value %1 for Component name is invalid. Only alphanumeric characters and regular spaces are allowed.',
- messageId: "SVC4070"
- }
-
-#---------SVC4071------------------------------
- INVALID_VENDOR_NAME: {
- code: 400,
- message: 'Error: Invalid Content. Value %1 for the field Vendor name is invalid. Only alphanumeric characters and regular spaces are allowed.',
- messageId: "SVC4071"
- }
-#---------SVC4072------------------------------
- INVALID_VENDOR_RELEASE: {
- code: 400,
- message: 'Error: Invalid Content. Value %1 for the field Vendor release is invalid. Only alphanumeric characters and regular spaces are allowed.',
- messageId: "SVC4072"
- }
-#---------SVC4073------------------------------
-# %1 - Service/Resource
-# %2 - max resource/service name
- COMPONENT_NAME_EXCEEDS_LIMIT: {
- code: 400,
- message: "Error: Invalid Content. %1 name exceeds limit of %2 characters.",
- messageId: "SVC4073"
- }
-#---------SVC4080------------------------------
-# %1 - resource/service name
-# %2 - resource/service
-# %3 - First name of last modifier
-# %4 - Last name of last modifier
-# %5 - USER_ID of last modifier
- COMPONENT_IN_CHECKOUT_STATE: {
- code: 403,
- message: "Error: Requested '%1' %2 is locked for modification by %3 %4(%5).",
- messageId: "SVC4080"
- }
-#---------SVC4081-----------------------------
-# %1 - resource/service name
-# %2 - resource/service
-# %3 - First name of last modifier
-# %4 - Last name of last modifier
-# %5 - USER_ID of last modifier
- COMPONENT_IN_CERT_IN_PROGRESS_STATE: {
- code: 403,
- message: "Error: Requested '%1' %2 is locked for certification by %3 %4(%5).",
- messageId: "SVC4081"
- }
-
-#-----------SVC4082---------------------------
-# %1 - resource/service name
-# %2 - resource/service
-# %3 - First name of last modifier
-# %4 - Last name of last modifier
-# %5 - USER_ID of last modifier
- COMPONENT_SENT_FOR_CERTIFICATION: {
- code: 403,
- message: "Error: Requested '%1' %2 is sent for certification by %3 %4(%5).",
- messageId: "SVC4082"
- }
-#-----------SVC4083---------------------------
- COMPONENT_VERSION_ALREADY_EXIST: {
- code: 409,
- message: "Error: Version of this %1 was already promoted.",
- messageId: "SVC4083"
- }
-#-----------SVC4084---------------------------
-# %1 - resource/service/product name
-# %2 - resource/service/product
-# %3 - First name of last modifier
-# %4 - Last name of last modifier
-# %5 - USER_ID of last modifier
- COMPONENT_ALREADY_CHECKED_IN: {
- code: 409,
- message: "Error: The current version of '%1' %2 was already checked-in by %3 %4(%5).",
- messageId: "SVC4084"
- }
-#-----------SVC4085---------------------------
-# %1 - resource/service/product name
-# %2 - resource/service/product
-# %3 - First name of last modifier
-# %4 - Last name of last modifier
-# %5 - USER_ID of last modifier
- COMPONENT_CHECKOUT_BY_ANOTHER_USER: {
- code: 403,
- message: "Error: %1 %2 has already been checked out by %3 %4(%5).",
- messageId: "SVC4085"
- }
-#-----------SVC4086---------------------------
-# %1  - resource/service name
-# %2  - resource/service
- COMPONENT_IN_USE: {
- code: 403,
- message: "Error: Requested '%1' %2 is in use by another user.",
- messageId: "SVC4086"
- }
-#-----------SVC4087---------------------------
-# %1 - component name
-# %2 - resource/service/product
- COMPONENT_HAS_NEWER_VERSION: {
- code: 409,
- message: "Error: Checking out of the requested version of the '%1' %2 is not allowed as a newer version exists.",
- messageId: "SVC4087"
- }
-#-----------SVC4088---------------------------
-# %1 - resource/service name
-# %2 - resource/service
-# %3 - First name of last modifier
-# %4 - Last name of last modifier
-# %5 - USER_ID of last modifier
- COMPONENT_ALREADY_CERTIFIED: {
- code: 403,
- message: "Error: Requested %1 %2 has already been certified by %3 %4(%5).",
- messageId: "SVC4088"
- }
-#-----------SVC4089---------------------------
-# %1 - resource/service name
-# %2 - resource/service
- COMPONENT_NOT_READY_FOR_CERTIFICATION: {
- code: 403,
- message: "Error: Requested '%1' %2 is not ready for certification.",
- messageId: "SVC4089"
- }
-#-----------SVC4100---------------------------
-#%1 - property name
- PROPERTY_NOT_FOUND: {
- code: 404,
- message: "Error: Requested '%1' property was not found.",
- messageId: "SVC4100"
- }
-#-----------SVC4101---------------------------
-#%1 - property name
- PROPERTY_ALREADY_EXIST: {
- code: 409,
- message: "Error: Property with '%1' name already exists.",
- messageId: "SVC4101"
- }
-
-#-----------SVC4102---------------------------
-# %1 - capability type name
- CAPABILITY_TYPE_ALREADY_EXIST: {
- code: 409,
- message: "Error: Capability Type with name '%1' already exists.",
- messageId: "SVC4102"
- }
-#-----------SVC4114---------------------------
- AUTH_FAILED_INVALIDE_HEADER: {
- code: 400,
- message: "Error: Invalid Authorization header.",
- messageId: "SVC4114"
- }
-#-----------SVC4115---------------------------
-# %1 - capability type name
- MISSING_CAPABILITY_TYPE: {
- code: 400,
- message: "Error: Invalid Content. Missing Capability Type '%1'.",
- messageId: "SVC4115"
- }
- RESOURCE_INSTANCE_BAD_REQUEST: {
- code: 400,
- message: "Error: Invalid Content.",
- messageId: "SVC4116"
- }
-#-----------SVC4117---------------------------
-# %1 - resource instance name
-# %2 - resource instance name
-# %3 - requirement name
- RESOURCE_INSTANCE_MATCH_NOT_FOUND: {
- code: 404,
- message: "Error: Match not found between resource instance '%1' and resource instance '%2' for requirement '%3'.",
- messageId: "SVC4117"
- }
-#-----------SVC4118---------------------------
-# %1 - resource instance name
-# %2 - resource instance name
-# %3 - requirement name
- RESOURCE_INSTANCE_ALREADY_EXIST: {
- code: 409,
- message: "Error: Resource instances '%1' and '%2' are already associated with requirement '%3'.",
- messageId: "SVC4118"
- }
-#-----------SVC4119---------------------------
-# %1 - resource instance name
-# %2 - resource instance name
-# %3 - requirement name
- RESOURCE_INSTANCE_RELATION_NOT_FOUND: {
- code: 404,
- message: "Error: No relation found between resource instances '%1' and '%2' for requirement '%3'.",
- messageId: "SVC4119"
- }
-#-----------SVC4120---------------------------
-# %1 - User's USER_ID
- USER_INACTIVE: {
- code: 404,
- message: "Error: User %1 was not found.",
- messageId: "SVC4120"
- }
-#-----------SVC4121---------------------------
-# %1 - User's USER_ID
- USER_HAS_ACTIVE_ELEMENTS: {
- code: 403,
- message: "Error: User with %1 ID can not be deleted since it has active elements(resources/services/artifacts).",
- messageId: "SVC4121"
- }
-#-----------SVC4122---------------------------
-# %1 - artifact type
- ARTIFACT_TYPE_NOT_SUPPORTED: {
- code: 400,
- message: "Error: Invalid artifact type '%1'.",
- messageId: "SVC4122"
- }
-#-----------SVC4123---------------------------
- ARTIFACT_LOGICAL_NAME_CANNOT_BE_CHANGED: {
- code: 400,
- message: "Error: Artifact logical name cannot be changed.",
- messageId: "SVC4123"
- }
-#-----------SVC4124---------------------------
- MISSING_ARTIFACT_TYPE: {
- code: 400,
- message: "Error: Missing artifact type.",
- messageId: "SVC4124"
- }
-#-----------SVC4125---------------------------
-# %1-artifact name
- ARTIFACT_EXIST: {
- code: 400,
- message: "Error: Artifact '%1' already exists.",
- messageId: "SVC4125"
- }
-#---------SVC4126------------------------------
-# %1 - resource/service/product/...
-# %2 - field (tag, vendor name...)
- INVALID_FIELD_FORMAT: {
- code: 400,
- message: "Error: Invalid %1 %2 format.",
- messageId: "SVC4126"
- }
-#-----------SVC4127---------------------------
- ARTIFACT_INVALID_MD5: {
- code: 400,
- message: "Error: Invalid artifact checksum.",
- messageId: "SVC4127"
- }
-#-----------SVC4128---------------------------
- MISSING_ARTIFACT_NAME: {
- code: 400,
- message: "Error: Invalid content. Missing artifact name.",
- messageId: "SVC4128"
- }
-#-----------SVC4129---------------------------
- MISSING_PROJECT_CODE: {
- code: 400,
- message: "Error: Invalid Content. Missing PROJECT_CODE number.",
- messageId: "SVC4129"
- }
-#-----------SVC4130---------------------------
- INVALID_PROJECT_CODE: {
- code: 400,
- message: "Error: Invalid Content. PROJECT_CODE must be from 3 up to 50 characters.",
- messageId: "SVC4130"
- }
-#-----------SVC4131---------------------------
-# %1-resource/service
-# %2-srtifact/artifacts
-# %3-semicolomn separated list of artifact
- COMPONENT_MISSING_MANDATORY_ARTIFACTS: {
- code: 403,
- message: "Error: Missing mandatory informational %1 %2: [%3].",
- messageId: "SVC4131"
- }
-#-----------SVC4132---------------------------
-# %1 - lifecycle type name
- LIFECYCLE_TYPE_ALREADY_EXIST: {
- code: 409,
- message: "Error: Lifecycle Type with name '%1' already exists.",
- messageId: "SVC4132"
- }
-#-----------SVC4133---------------------------
-# %1 - service version
-# %2 - service name
- SERVICE_NOT_AVAILABLE_FOR_DISTRIBUTION: {
- code: 403,
- message: "Error: Version %1 of '%2' service is not available for distribution.",
- messageId: "SVC4133"
- }
-#-----------SVC4134---------------------------
- MISSING_LIFECYCLE_TYPE: {
- code: 400,
- message: "Error: Invalid Content. Missing interface life-cycle type.",
- messageId: "SVC4134"
- }
-#---------SVC4135------------------------------
- SERVICE_CATEGORY_CANNOT_BE_CHANGED: {
- code: 400,
- message: "Error: Service category cannot be changed once the service is certified.",
- messageId: "SVC4135"
- }
-#---------SVC4136------------------------------
-# %1 - distribution environment name
- DISTRIBUTION_ENVIRONMENT_NOT_AVAILABLE: {
- code: 500,
- message: "Error: Requested distribution environment '%1' is not available.",
- messageId: "SVC4136"
- }
-#---------SVC4137------------------------------
-# %1 - distribution environment name
- DISTRIBUTION_ENVIRONMENT_NOT_FOUND: {
- code: 400,
- message: "Error: Requested distribution environment '%1' was not found.",
- messageId: "SVC4137"
- }
-#---------SVC4138------------------------------
- DISTRIBUTION_ENVIRONMENT_INVALID: {
- code: 400,
- message: "Error: Invalid distribution environment.",
- messageId: "SVC4138"
- }
-#---------SVC4139------------------------------
-# %1 - service name
- DISTRIBUTION_ARTIFACT_NOT_FOUND: {
- code: 409,
- message: "Error: Service '%1' cannot be distributed due to missing deployment artifacts.",
- messageId: "SVC4139"
- }
-#---------SVC4200------------------------------
-# %1 - Service/Resource
-# %2 - max icon name length
- COMPONENT_ICON_EXCEEDS_LIMIT: {
- code: 400,
- message: "Error: Invalid Content. %1 icon name exceeds limit of %2 characters.",
- messageId: "SVC4200"
- }
-#---------SVC4300------------------------------
- RESTRICTED_ACCESS: {
- code: 403,
- message: "Error: Restricted access.",
- messageId: "SVC4300"
- }
-#---------SVC4301------------------------------
- RESTRICTED_OPERATION: {
- code: 409,
- message: "Error: Restricted operation.",
- messageId: "SVC4301"
- }
-#---------SVC4500------------------------------
- MISSING_BODY: {
- code: 400 ,
- message: "Error: Missing request body.",
- messageId: "SVC4500"
- }
-#---------SVC4501------------------------------
- MISSING_PUBLIC_KEY: {
- code: 400 ,
- message: "Error: Invalid Content. Missing mandatory parameter 'apiPublicKey'." ,
- messageId: "SVC4501"
- }
-#---------SVC4502------------------------------
- DISTRIBUTION_ENV_DOES_NOT_EXIST: {
- code: 400 ,
- message: "Error: Invalid Body : Missing mandatory parameter 'distrEnvName'." ,
- messageId: "SVC4502"
- }
-#-----------SVC4503---------------------------
-# %1 - service name
- SERVICE_NOT_FOUND: {
- code: 404,
- message: "Error: Requested '%1' service was not found.",
- messageId: "SVC4503"
- }
-
-#---------SVC4504------------------------------
-# %1 - Service/Resource
-# %2 - service/resource version
- COMPONENT_VERSION_NOT_FOUND: {
- code: 404,
- message: "Error: %1 version %2 was not found.",
- messageId: "SVC4504"
- }
-#-----------SVC4505---------------------------
- #%1-artifact name
-
- ARTIFACT_NOT_FOUND: {
- code: 404,
- message: "Error: Artifact '%1' was not found.",
- messageId: "SVC4505"
- }
-#---------SVC4506------------------------------
- MISSING_ENV_NAME: {
- code: 400 ,
- message: "Error: Invalid Content. Missing mandatory parameter 'distrEnvName'.",
- messageId: "SVC4506"
- }
-#---------SVC4507------------------------------
- COMPONENT_INVALID_TAGS_NO_COMP_NAME: {
- code: 400,
- message: "Error: Invalid Content. One of the tags should be the component name.",
- messageId: "SVC4507"
- }
-
-#---------SVC4508------------------------------
- SERVICE_NAME_CANNOT_BE_CHANGED: {
- code: 400,
- message: "Error: Service name cannot be changed once the service is certified.",
- messageId: "SVC4508"
- }
-
-#---------SVC4509------------------------------
- SERVICE_ICON_CANNOT_BE_CHANGED: {
- code: 400,
- message: "Error: Icon cannot be changed once the service is certified.",
- messageId: "SVC4509"
- }
-#---------SVC4510------------------------------
-# %1 - icon name max length
- SERVICE_ICON_EXCEEDS_LIMIT: {
- code: 400,
- message: "Error: Invalid Content. Icon name exceeds limit of %1 characters.",
- messageId: "SVC4510"
- }
-#---------SVC4511------------------------------
- DISTRIBUTION_REQUESTED_NOT_FOUND: {
- code: 404,
- message: "Error: Requested distribution was not found.",
- messageId: "SVC4511"
- }
-#---------SVC4512------------------------------
-# %1 - Distribution ID
- DISTRIBUTION_REQUESTED_FAILED: {
- code: 403,
- message: "Error: Requested distribution '%1' failed.",
- messageId: "SVC4512"
- }
-#---------SVC4513------------------------------
- RESOURCE_CATEGORY_CANNOT_BE_CHANGED: {
- code: 400,
- message: "Error: Resource category cannot be changed once the resource is certified.",
- messageId: "SVC4513"
- }
-#---------SVC4514------------------------------
- RESOURCE_NAME_CANNOT_BE_CHANGED: {
- code: 400,
- message: "Error: Resource name cannot be changed once the resource is certified.",
- messageId: "SVC4514"
- }
-#---------SVC4515------------------------------
- RESOURCE_ICON_CANNOT_BE_CHANGED: {
- code: 400,
- message: "Error: Icon cannot be changed once the resource is certified.",
- messageId: "SVC4515"
- }
-#---------SVC4516------------------------------
- RESOURCE_VENDOR_NAME_CANNOT_BE_CHANGED: {
- code: 400,
- message: "Error: Vendor name cannot be changed once the resource is certified.",
- messageId: "SVC4516"
- }
-#---------SVC4517------------------------------
- RESOURCE_DERIVED_FROM_CANNOT_BE_CHANGED: {
- code: 400,
- message: "Error: Derived from resource template cannot be changed once the resource is certified.",
- messageId: "SVC4517"
- }
-#---------SVC4518------------------------------
-# %1 - max length
- COMPONENT_SINGLE_TAG_EXCEED_LIMIT: {
- code: 400,
- message: "Error: Invalid Content. Single tag exceeds limit of %1 characters.",
- messageId: "SVC4518"
- }
-#---------SVC4519------------------------------
- INVALID_DEFAULT_VALUE: {
- code: 400,
- message: "Error: mismatch in data-type occurred for property %1. data type is %2 and default value found is %3.",
- messageId: "SVC4519"
- }
-#---------SVC4520------------------------------
-# %1 - service or resource
- ADDITIONAL_INFORMATION_MAX_NUMBER_REACHED: {
- code: 409,
- message: "Error: Maximal number of additional %1 parameters was reached.",
- messageId: "SVC4520"
- }
-#---------SVC4521------------------------------
- ADDITIONAL_INFORMATION_EMPTY_STRING_NOT_ALLOWED: {
- code: 400,
- message: "Error: Invalid Content. The Additional information label and value cannot be empty.",
- messageId: "SVC4521"
- }
-#---------SVC4522------------------------------
-# %1 - label/value
-# %2 - Maximal length of %1
- ADDITIONAL_INFORMATION_EXCEEDS_LIMIT: {
- code: 400,
- message: "Error: Invalid Content. Additional information %1 exceeds limit of %2 characters.",
- messageId: "SVC4522"
- }
-#---------SVC4523------------------------------
- ADDITIONAL_INFORMATION_KEY_NOT_ALLOWED_CHARACTERS: {
- code: 400,
- message: 'Error: Invalid Content. Additional information label is not allowed to contain characters like <>:"\/|?* and space characters other than regular space.',
- messageId: "SVC4523"
- }
-#---------SVC4524------------------------------
- ADDITIONAL_INFORMATION_NOT_FOUND: {
- code: 409,
- message: "Error: Requested additional information was not found.",
- messageId: "SVC4524"
- }
-#---------SVC4525------------------------------
- ADDITIONAL_INFORMATION_VALUE_NOT_ALLOWED_CHARACTERS: {
- code: 400,
- message: 'Error: Invalid Content. Additional information contains non-english characters.',
- messageId: "SVC4525"
- }
-#---------SVC4526------------------------------
- RESOURCE_INSTANCE_NOT_FOUND: {
- code: 404,
- message: "Error: Requested '%1' resource instance was not found.",
- messageId: "SVC4526"
- }
-#---------SVC4527------------------------------
- ASDC_VERSION_NOT_FOUND: {
- code: 500,
- message: 'Error: ASDC version cannot be displayed.',
- messageId: "SVC4527"
- }
-#---------SVC4528------------------------------
-# %1-artifact url/artifact label/artifact description/VNF Service Indicator
- MISSING_DATA: {
- code: 400,
- message: "Error: Invalid content. Missing %1.",
- messageId: "SVC4528"
- }
-#---------SVC4529------------------------------
-# %1-artifact url/artifact label/artifact description/artifact name
-# %2 - Maximal length of %1
- EXCEEDS_LIMIT: {
- code: 400,
- message: "Error: Invalid Content. %1 exceeds limit of %2 characters.",
- messageId: "SVC4529"
- }
-#---------SVC4530------------------------------
- ARTIFACT_INVALID_TIMEOUT: {
- code: 400,
- message: "Error: Invalid Content. Artifact Timeout should be set to valid positive non-zero number of minutes.",
- messageId: "SVC4530"
- }
-#---------SVC4531------------------------------
- SERVICE_IS_VNF_CANNOT_BE_CHANGED: {
- code: 400,
- message: "Error: VNF Indicator cannot be updated for certified service.",
- messageId: "SVC4531"
- }
- #---------SVC4532------------------------------
- RESOURCE_INSTANCE_NOT_FOUND_ON_SERVICE: {
- code: 404,
- message: "Error: Requested '%1' resource instance was not found on the service '%2.",
- messageId: "SVC4532"
- }
- #---------SVC4533------------------------------
- # %1 - "HEAT"/"HEAT_ENV"/"MURANO_PKG"/"YANG_XML"
- WRONG_ARTIFACT_FILE_EXTENSION: {
- code: 400,
- message: "Error: Invalid file extension for %1 artifact type.",
- messageId: "SVC4533"
- }
-
-#---------SVC4534------------------------------
-# %1 - "HEAT"/"HEAT_ENV"
- INVALID_YAML: {
- code: 400,
- message: "Error: Uploaded YAML file for %1 artifact is invalid.",
- messageId: "SVC4534"
- }
-
-#---------SVC4535------------------------------
-# %1 - "HEAT"
- INVALID_DEPLOYMENT_ARTIFACT_HEAT: {
- code: 400,
- message: "Error: Invalid %1 artifact.",
- messageId: "SVC4535"
- }
-#---------SVC4536------------------------------
-# %1 - "Resource"/"Service"
-# %2 - resource/service name
-# %3 - "HEAT"/"HEAT_ENV"/"MURANO_PKG"
-# %4 - "HEAT"/"HEAT_ENV"/"MURANO_PKG
- DEPLOYMENT_ARTIFACT_OF_TYPE_ALREADY_EXISTS: {
- code: 400,
- message: "Error: %1 '%2' already has a deployment artifact of %3 type .Please delete or update an existing %4 artifact.",
- messageId: "SVC4536"
- }
-
-#---------SVC4537------------------------------
- MISSING_HEAT: {
- code: 400,
- message: "Error: Missing HEAT artifact. HEAT_ENV artifact cannot be uploaded without corresponding HEAT template.",
- messageId: "SVC4537"
- }
-#---------SVC4538------------------------------
- MISMATCH_HEAT_VS_HEAT_ENV: {
- code: 400,
- message: "Error: Invalid artifact content. Parameter's set in HEAT_ENV '%1' artifact doesn't match the parameters in HEAT '%2' artifact.",
- messageId: "SVC4538"
- }
-#---------SVC4539------------------------------
- INVALID_RESOURCE_PAYLOAD: {
- code: 400,
- message: "Error: Invalid resource payload.",
- messageId: "SVC4539"
- }
-#---------SVC4540------------------------------
- INVALID_TOSCA_FILE_EXTENSION: {
- code: 400,
- message: "Error: Invalid file extension for TOSCA template.",
- messageId: "SVC4540"
- }
-#---------SVC4541------------------------------
- INVALID_YAML_FILE: {
- code: 400,
- message: "Error: Invalid YAML file.",
- messageId: "SVC4541"
- }
-#---------SVC4542------------------------------
- INVALID_TOSCA_TEMPLATE: {
- code: 400,
- message: "Error: Invalid TOSCA template.",
- messageId: "SVC4542"
- }
-#---------SVC4543------------------------------
- NOT_RESOURCE_TOSCA_TEMPLATE: {
- code: 400,
- message: "Error: Imported Service TOSCA template.",
- messageId: "SVC4543"
- }
-#---------SVC4544------------------------------
- NOT_SINGLE_RESOURCE: {
- code: 400,
- message: "Error: Imported TOSCA template should contain one resource definition.",
- messageId: "SVC4544"
- }
-#---------SVC4545------------------------------
- INVALID_RESOURCE_NAMESPACE: {
- code: 400,
- message: "Error: Invalid resource namespace.",
- messageId: "SVC4545"
- }
-#---------SVC4546------------------------------
- RESOURCE_ALREADY_EXISTS: {
- code: 400,
- message: "Error: Imported resource already exists in ASDC Catalog.",
- messageId: "SVC4546"
- }
-#---------SVC4549------------------------------
- INVALID_RESOURCE_CHECKSUM: {
- code: 400,
- message: "Error: Invalid resource checksum.",
- messageId: "SVC4549"
- }
-#---------SVC4550------------------------------
- #%1  -  Consumer salt
- INVALID_LENGTH: {
- code: 400,
- message: "Error: Invalid %1 length.",
- messageId: "SVC4550"
- }
- #---------SVC4551------------------------------
- #%1  -  ECOMP User name
- ECOMP_USER_NOT_FOUND: {
- code: 404,
- message: "Error: ECOMP User '%1' was not found.",
- messageId: "SVC4551"
- }
-#---------SVC4552------------------------------
- CONSUMER_ALREADY_EXISTS: {
- code: 409,
- message: "Error: ECOMP User already exists.",
- messageId: "SVC4552"
- }
-#---------SVC4553-----------------------------
- #%1  -  Consumer name / Consumer password/ Consumer salt
- INVALID_CONTENT_PARAM: {
- code: 400,
- message: "Error: %1 is invalid.",
- messageId: "SVC4553"
- }
- #---------SVC4554------------------------------
-# %1 - "Resource"/"Service"
- COMPONENT_ARTIFACT_NOT_FOUND: {
- code: 404,
- message: "Error: Requested artifact doesn't belong to specified %1.",
- messageId: "SVC4554"
- }
-#---------SVC4554------------------------------
-# %1 - "Service name"
- SERVICE_DEPLOYMENT_ARTIFACT_NOT_FOUND: {
- code: 403,
- message: "Error: Requested '%1' service is not ready for certification. Service has to have at least one deployment artifact.",
- messageId: "SVC4554"
- }
-#---------SVC4555------------------------------
-#%1 - "Resource"/"Service"/"Product"
-#%2 - "category"
- COMPONENT_ELEMENT_INVALID_NAME_LENGTH: {
- code: 400,
- message: "Error: Invalid %1 %2 name length.",
- messageId: "SVC4555"
- }
-#---------SVC4556------------------------------
-#%1 - "Resource"/"Service"/"Product"
-#%2 - "category"
- COMPONENT_ELEMENT_INVALID_NAME_FORMAT: {
- code: 400,
- message: "Error: Invalid %1 %2 name format.",
- messageId: "SVC4556"
- }
-#---------SVC4557------------------------------
-#%1 - "Resource"/"Service"/"Product"
-#%2 - "category name"
- COMPONENT_CATEGORY_ALREADY_EXISTS: {
- code: 409,
- message: "Error: %1 category name '%2' already exists.",
- messageId: "SVC4557"
- }
-#---------SVC4558------------------------------
-# %1 - "service"/"VF"
-# %2 - "Resource name"
- VALIDATED_RESOURCE_NOT_FOUND: {
- code: 403,
- message: "Error: Submit for Testing is not permitted as your '%1' includes non-validated '%2' resource.",
- messageId: "SVC4558"
- }
-#---------SVC4559------------------------------
-# %1 - "service"/"VF"
-# %2 - "Resource name"
- FOUND_ALREADY_VALIDATED_RESOURCE: {
- code: 403,
- message: "Error: Submit for Testing is not permitted as your '%1' includes non-validated '%2' resource. Please use already available validated resource version.",
- messageId: "SVC4559"
- }
-#---------SVC4560------------------------------
-# %1 - "service"/"VF"
-# %2 - "Resource name"
- FOUND_LIST_VALIDATED_RESOURCES: {
- code: 403,
- message: "Error: Submit for Testing is not permitted as your '%1' includes non-validated '%2' resource. Please use one of available validated resource versions.",
- messageId: "SVC4560"
- }
-#---------SVC4561------------------------------
-# %1 - "resource"/"product"
-# %2 - "category"
-# %3 - "category name"
- COMPONENT_CATEGORY_NOT_FOUND: {
- code: 404,
- message: "Error: Requested %1 %2 '%3' was not found.",
- messageId: "SVC4561"
- }
-#---------SVC4562------------------------------
-# %1 - "Resource"/"Product"
-# %2 - "sub-category name"
-# %3 - "category name"
- COMPONENT_SUB_CATEGORY_EXISTS_FOR_CATEGORY: {
- code: 409,
- message: "Error: %1 sub-category '%2' already exists under '%3' category.",
- messageId: "SVC4562"
- }
-#---------SVC4563------------------------------
-# %1 - "Product"
-# %2 - "grouping name"
-# %3 - "sub-category name"
- COMPONENT_GROUPING_EXISTS_FOR_SUB_CATEGORY: {
- code: 409,
- message: "Error: %1 grouping '%2' already exists under '%3' sub-category.",
- messageId: "SVC4563"
- }
-#---------SVC4564------------------------------
-# %1 - product name
- PRODUCT_NOT_FOUND: {
- code: 404,
- message: "Error: Requested '%1' product was not found.",
- messageId: "SVC4564"
- }
-#---------SVC4565------------------------------
-# %1 - "HEAT"
-# %2 - parameter type ("string" , "boolean" , "number")
-# %3 - parameter name
- INVALID_HEAT_PARAMETER_VALUE: {
- code: 400,
- message: "Error: Invalid %1 artifact. Invalid %2 value set for '%3' parameter.",
- messageId: "SVC4565"
- }
-#---------SVC4566------------------------------
-# %1 - "HEAT"
-# %2 - parameter type ("string" , "boolean" , "number")
- INVALID_HEAT_PARAMETER_TYPE: {
- code: 400,
- message: "Error: Invalid %1 artifact. Unsupported '%2' parameter type.",
- messageId: "SVC4566"
- }
-#---------SVC4567------------------------------
-# %1 - "YANG_XML"
- INVALID_XML: {
- code: 400,
- message: "Error: Uploaded XML file for %1 artifact is invalid.",
- messageId: "SVC4567"
- }
-#---------SVC4567------------------------------
-# %1 - "User Name and UserId"
-# %2 -"checked-out"/"in-certification"
- CANNOT_DELETE_USER_WITH_ACTIVE_ELEMENTS: {
- code: 409,
- message: "Error: User cannot be deleted. User '%1' has %2 projects.",
- messageId: "SVC4567"
- }
-#---------SVC4568------------------------------
-# %1 - "User Name and UserId"
-# %2 -"checked-out"/"in-certification"
- CANNOT_UPDATE_USER_WITH_ACTIVE_ELEMENTS: {
- code: 409,
- message: "Error: Role cannot be changed. User '%1' has %2 projects.",
- messageId: "SVC4568"
- }
-#---------SVC4570------------------------------
- UPDATE_USER_ADMIN_CONFLICT: {
- code: 409,
- message: "Error: An administrator is not allowed to change his/her role.",
- messageId: "SVC4570"
- }
-#---------SVC4571------------------------------
- SERVICE_CANNOT_CONTAIN_SUBCATEGORY: {
- code: 400,
- message: "Error: Sub category cannot be defined for service",
- messageId: "SVC4571"
- }
-#---------SVC4572------------------------------
-# %1 - "Resource"/"Service"
- COMPONENT_TOO_MUCH_CATEGORIES: {
- code: 400,
- message: "Error: %1 must have only 1 category",
- messageId: "SVC4572"
- }
-#---------SVC4574------------------------------
- RESOURCE_TOO_MUCH_SUBCATEGORIES: {
- code: 400,
- message: "Error: Resource must have only 1 sub category",
- messageId: "SVC4574"
- }
-#---------SVC4575------------------------------
- COMPONENT_MISSING_SUBCATEGORY: {
- code: 400,
- message: "Error: Missing sub category",
- messageId: "SVC4575"
- }
- #---------SVC4576------------------------------
-# %1 - "component type"
- UNSUPPORTED_ERROR: {
- code: 400,
- message: "Error : Requested component type %1 is unsupported.",
- messageId: "SVC4576"
- }
- #---------SVC4577------------------------------
-# %1 - "resource type"
- RESOURCE_CANNOT_CONTAIN_RESOURCE_INSTANCES: {
- code: 409,
- message: "Error : Resource of type %1 cannot contain resource instances.",
- messageId: "SVC4577"
- }
-#---------SVC4578------------------------------
-# %1 - "Resource"/"Service"
-# %2 - resource/service name
-# %3 - "artifact name"
- DEPLOYMENT_ARTIFACT_NAME_ALREADY_EXISTS: {
- code: 400,
- message: "Error: %1 '%2' already has a deployment artifact named '%3'.",
- messageId: "SVC4578"
- }
-#---------SVC4579------------------------------
-# %1 - "Category"/"Sub-Category"/"Group"
-# %2 - category/sub-category/grouping name.
- INVALID_GROUP_ASSOCIATION: {
- code: 400,
- message: "Error: Invalid group association. %1 '%2' was not found.",
- messageId: "SVC4579"
- }
-#---------SVC4580------------------------------
- EMPTY_PRODUCT_CONTACTS_LIST: {
- code: 400,
- message: "Error: Invalid content. At least one Product Contact has to be specified.",
- messageId: "SVC4580"
- }
-#---------SVC4581------------------------------
-# %1 - UserId
- INVALID_PRODUCT_CONTACT: {
- code: 400,
- message: "Error: Invalid content. User '%1' cannot be set as Product Contact.",
- messageId: "SVC4581"
- }
-#---------SVC4582------------------------------
-# %1 - Product
-# %2 - "abbreviated"/"full"
- MISSING_ONE_OF_COMPONENT_NAMES: {
- code: 400,
- message: "Error: Invalid content. Missing %1 %2 name.",
- messageId: "SVC4582"
- }
-#---------SVC4583------------------------------
-# %1 - "Icon"
-# %2 - "resource"/"service"/"product"
- COMPONENT_PARAMETER_CANNOT_BE_CHANGED: {
- code: 400,
- message: "Error: %1 cannot be changed once the %2 is certified.",
- messageId: "SVC4583"
- }
-#---------SVC4584------------------------------
-# %1 - service/VF name
-# %2 - "service" /"VF"
-# %3 - resource instance origin type
-# %4 - resource instance name
-# %5 - requirement/capability
-# %6 - requirement/capability name
-# %7 - "fulfilled" (for req)/"consumed (for cap)"
- REQ_CAP_NOT_SATISFIED_BEFORE_CERTIFICATION: {
- code: 403,
- message: "Error: Requested '%1' %2 is not ready for certification. %3 '%4' has to have %5 '%6' %7.",
- messageId: "SVC4584"
- }
-#---------SVC4585------------------------------
- INVALID_OCCURRENCES: {
- code: 400,
- message: "Error: Invalid occurrences format.",
- messageId: "SVC4585"
- }
-#---------SVC4586------------------------------
-#---------SVC4586------------------------------
- INVALID_SERVICE_API_URL: {
- code: 400,
- message: 'Error: Invalid Service API URL. Please check whether your URL has a valid domain extension and does not contain the following characters - #?&@%+;,=$<>~^`\[]{}|"*!',
- messageId: "SVC4586"
- }
-#---------SVC4587------------------------------
-# %1 - Data type name
- DATA_TYPE_ALREADY_EXIST: {
- code: 409,
- message: 'Error: Data type %1 already exists.',
- messageId: "SVC4587"
- }
-#---------SVC4588------------------------------
-# %1 - Data type name
- DATA_TYPE_NOR_PROPERTIES_NEITHER_DERIVED_FROM: {
- code: 400,
- message: 'Error: Invalid Data type %1. Data type must have either a valid derived from declaration or at least one valid property',
- messageId: "SVC4588"
- }
-#---------SVC4589------------------------------
-# %1 - Data type name
- DATA_TYPE_PROPERTIES_CANNOT_BE_EMPTY: {
- code: 400,
- message: "Error: Invalid Data type %1. 'properties' parameter cannot be empty if provided.",
- messageId: "SVC4589"
- }
-#---------SVC4590------------------------------
-# %1 - Property type name
-# %2 - Property name
- INVALID_PROPERTY_TYPE: {
- code: 400,
- message: "Error: Invalid Property type %1 in property %2.",
- messageId: "SVC4590"
- }
-#---------SVC4591------------------------------
-# %1 - Property inner type
-# %2 - Property name
- INVALID_PROPERTY_INNER_TYPE: {
- code: 400,
- message: "Error: Invalid property inner type %1, in property %2",
- messageId: "SVC4591"
- }
-#---------SVC4592------------------------------
-# %1 - component instance name
-# %2 - "resource instance"/"service instance"
- COMPONENT_INSTANCE_NOT_FOUND: {
- code: 404,
- message: "Error: Requested '%1' %2 was not found.",
- messageId: "SVC4592"
- }
-#---------SVC4593------------------------------
-# %1 - component instance name
-# %2 - "resource instance"/"service instance"
-# %3 - "resource/"service"/"product"
-# %4 - container name
- COMPONENT_INSTANCE_NOT_FOUND_ON_CONTAINER: {
- code: 404,
- message: "Error: Requested '%1' %2 was not found on the %3 '%4'.",
- messageId: "SVC4593"
- }
-#---------SVC4594------------------------------
-#%1 - requirement / capability
-#%2 - requirement name
- IMPORT_DUPLICATE_REQ_CAP_NAME: {
- code: 400,
- message: "Error: Imported TOSCA template contains more than one %1 named '%2'.",
- messageId: "SVC4594"
- }
-#---------SVC4595------------------------------
-#%1 - requirement / capability
-#%2 - requirement name
-#%3 - parent containing the requirement
- IMPORT_REQ_CAP_NAME_EXISTS_IN_DERIVED: {
- code: 400,
- message: "Error: Imported TOSCA template contains %1 '%2' that is already defined by derived template %3.",
- messageId: "SVC4595"
- }
-#---------SVC4596------------------------------
-# %1 - Data type name
- DATA_TYPE_DERIVED_IS_MISSING: {
- code: 400,
- message: "Error: Invalid Content. The ancestor data type %1 cannot be found in the system.",
- messageId: "SVC4596"
- }
-#---------SVC4597------------------------------
-# %1 - Data type name
-# %2 - Property names
- DATA_TYPE_PROPERTY_ALREADY_DEFINED_IN_ANCESTOR: {
- code: 400,
- message: "Error: Invalid Content. The data type %1 contains properties named %2 which are already defined in one of its ancestors.",
- messageId: "SVC4597"
- }
-#---------SVC4598------------------------------
-# %1 - Data type name
- DATA_TYPE_DUPLICATE_PROPERTY: {
- code: 400,
- message: "Error: Invalid Content. The data type %1 contains duplicate property.",
- messageId: "SVC4598"
- }
-#---------SVC4599------------------------------
-# %1 - Data type name
-# %2 - Property names
- DATA_TYPE_PROEPRTY_CANNOT_HAVE_SAME_TYPE_OF_DATA_TYPE: {
- code: 400,
- message: "Error: Invalid Content. The data type %1 contains properties %2 which their type is this data type.",
- messageId: "SVC4599"
- }
-#---------SVC4600------------------------------
-# %1 - Data type name
- DATA_TYPE_CANNOT_HAVE_PROPERTIES: {
- code: 400,
- message: "Error: Invalid Content. The data type %1 cannot have properties since it is of type scalar",
- messageId: "SVC4600"
- }
-#---------SVC4601------------------------------
- NOT_TOPOLOGY_TOSCA_TEMPLATE: {
- code: 400,
- message: "Error: TOSCA yaml file %1 cannot be modeled to VF as it does not contain 'topology_template.",
- messageId: "SVC4601"
- }
-#---------SVC4602--------------------------------
-# %1 - yaml file name
-# %2 - node_template label
-# %3 - node_template type
- INVALID_NODE_TEMPLATE: {
- code: 400,
- message: "Error: TOSCA yaml file '%1' contains node_template '%2' of type '%3' that does not represent existing VFC/CP/VL",
- messageId: "SVC4602"
- }
-#---------SVC4603------------------------------
-# %1 - component type
-# %2 - component name
-# %3 - state
- ILLEGAL_COMPONENT_STATE: {
- code: 403,
- message: "Error: Component instance of %1 can not be created because the component '%2' is in an illegal state %3.",
- messageId: "SVC4603"
- }
-#---------SVC4604------------------------------
-# %1 - csar file name
- CSAR_INVALID: {
- code: 400,
- message: "Error: TOSCA CSAR '%1' is invalid. 'TOSCA-Metadata/Tosca.meta' file must be provided.",
- messageId: "SVC4604"
- }
-#---------SVC4605------------------------------
-# %1 - csar file name
- CSAR_INVALID_FORMAT: {
- code: 400,
- message: "Error: TOSCA CSAR '%1' is invalid. Invalid 'TOSCA-Metadata/Tosca.meta' file format.",
- messageId: "SVC4605"
- }
-#---------SVC4606------------------------------
-# %1 - property name
-# %2 - property type
-# %3 - property innerType
-# %4 - default value is
- INVALID_COMPLEX_DEFAULT_VALUE: {
- code: 400,
- message: "Error: Invalid default value of property %1. Data type is %2 with inner type %3 and default value found is %4.",
- messageId: "SVC4606"
- }
-#---------SVC4607------------------------------
-# %1 - csar file name
- CSAR_NOT_FOUND: {
- code: 400,
- message: "Error: TOSCA CSAR '%1' is not found.",
- messageId: "SVC4607"
- }
-#---------SVC4608------------------------------
-# %1 - artifact name
-# %2 - component type
-# %3 - actual component type
- MISMATCH_BETWEEN_ARTIFACT_TYPE_AND_COMPONENT_TYPE: {
- code: 400,
- message: "Error: Artifact %1 is only compatible with component of type %2, but component type is %3.",
- messageId: "SVC4608"
- }
-
-#---------SVC4609------------------------------
-# %1 - "INVALID_JSON"
- INVALID_JSON: {
- code: 400,
- message: "Error: Uploaded JSON file for %1 artifact is invalid.",
- messageId: "SVC4609"
- }
-#---------SVC4610------------------------------
-# %1 - csar file name
-# %2 - missing file name
- YAML_NOT_FOUND_IN_CSAR: {
- code: 400,
- message: "Error - TOSCA CSAR %1 is invalid. TOSCA-Metadata/Tosca.meta refers to file %2 that is not provided.",
- messageId: "SVC4610"
- }
-#---------SVC4611------------------------------
-# %1 - group name
- GROUP_MEMBER_EMPTY: {
- code: 400,
- message: "Error: Invalid Content. Group %1 member list was provided but does not have values",
- messageId: "SVC4611"
- }
-#---------SVC4612------------------------------
-# %1 - group name
- GROUP_TYPE_ALREADY_EXIST: {
- code: 409,
- message: 'Error: Group type %1 already exists.',
- messageId: "SVC4612"
- }
-#---------SVC4613------------------------------
-# %1 - group name
-# %2 - VF name(component name)
-# %3 - actual component type [VF]
- GROUP_ALREADY_EXIST: {
- code: 409,
- message: "Error: Group with name '%1' already exists in %2 %3.",
- messageId: "SVC4613"
- }
-#---------SVC4614------------------------------
-# %1 - group type
- GROUP_TYPE_IS_INVALID: {
- code: 400,
- message: "Error: Invalid content. Group type %1 does not exist",
- messageId: "SVC4614"
- }
-#---------SVC4615------------------------------
-# %1 - group name
- GROUP_MISSING_GROUP_TYPE: {
- code: 400,
- message: "Error: Invalid Content. Missing Group Type for group '%1'",
- messageId: "SVC4615"
- }
-#---------SVC4616------------------------------
-# %1 - member name
-# %2 - group name
-# %3 - VF name
-# %4 - component type [VF ]
- GROUP_INVALID_COMPONENT_INSTANCE: {
- code: 400,
- message: "Error: Member '%1' listed in group '%2' is not part of '%3' %4.",
- messageId: "SVC4616"
- }
-#---------SVC4617------------------------------
-# %1 - member name
-# %2 - group name
-# %3 - group type
- GROUP_INVALID_TOSCA_NAME_OF_COMPONENT_INSTANCE: {
- code: 400,
- message: "Error: member %1 listed in group %2 is not part of allowed members of group type %3.",
- messageId: "SVC4617"
- }
-#---------SVC4618------------------------------
-# %1 - missing file name
-# %2 - csar file name
- ARTIFACT_NOT_FOUND_IN_CSAR: {
- code: 400,
- message: "Error: artifact %1 is defined in CSAR %2 manifest but is not provided",
- messageId: "SVC4618"
- }
-#---------SVC4619------------------------------
-# %1 - artifact name
-# %2 - artifact type
-# %3 - existing artifact type
- ARTIFACT_ALREADY_EXIST_IN_DIFFERENT_TYPE_IN_CSAR: {
- code: 400,
- message: "Error: artifact %1 in type %2 already exists in type %3.",
- messageId: "SVC4619"
- }
-#---------SVC4620------------------------------
- FAILED_RETRIVE_ARTIFACTS_TYPES: {
- code: 400,
- message: "Error: Failed to retrieve list of suported artifact types.",
- messageId: "SVC4620"
- }
-#---------SVC4621------------------------------
-# %1 - artifact name
-# %2 - master
- ARTIFACT_ALRADY_EXIST_IN_MASTER_IN_CSAR: {
- code: 400,
- message: "Error: artifact %1 already exists in master %2 .",
- messageId: "SVC4621"
- }
-#---------SVC4622------------------------------
-# %1 - artifact name
-# %2 - artifact type
-# %3 - master name
-# %4 - master type
- ARTIFACT_NOT_VALID_IN_MASTER: {
- code: 400,
- message: "Error: artifact %1 in type %2 can not be exists under master %3 in type %4.",
- messageId: "SVC4622"
- }
-#---------SVC4623------------------------------
-# %1 - artifact name
-# %2 - artifact type
-# %3 - env name
-# %4 - existing env
- ARTIFACT_NOT_VALID_ENV: {
- code: 400,
- message: "Error: Artifact %1 in type %2 with env %3 already exists with another env %4",
- messageId: "SVC4623"
- }
-#---------SVC4624------------------------------
-# %1 - groups names
-# %2 - VF name
-# %3 - component type [VF ]
- GROUP_IS_MISSING: {
- code: 404,
- message: "Error: Invalid Content. The groups '%1' cannot be found under %2 %3.",
- messageId: "SVC4624"
- }
-#---------SVC4625------------------------------
-# %1 - groups name
- GROUP_ARTIFACT_ALREADY_ASSOCIATED: {
- code: 400,
- message: "Error: Invalid Content. Artifact already associated to group '%1'.",
- messageId: "SVC4625"
- }
-#---------SVC4626------------------------------
-# %1 - groups name
- GROUP_ARTIFACT_ALREADY_DISSOCIATED: {
- code: 400,
- message: "Error: Invalid Content. Artifact already dissociated from group '%1'.",
- messageId: "SVC4626"
- }
-#---------SVC4627------------------------------
-# %1 - property name
-# %2 - group name
-# %3 - group type name
- GROUP_PROPERTY_NOT_FOUND: {
- code: 400,
- message: "Error: property %1 listed in group %2 is not exist in group type %3.",
- messageId: "SVC4627"
- }
-#---------SVC4628------------------------------
-# %1 - csarUUID
-# %2 - VF name
- VSP_ALREADY_EXISTS: {
- code: 400,
- message: "Error: The VSP with UUID %1 was already imported for VF %2. Please select another or update the existing VF.",
- messageId: "SVC4628"
- }
-#---------SVC4629------------------------------
-# %1 - VF name
- MISSING_CSAR_UUID: {
- code: 400,
- message: "Error: The Csar UUID or payload name is missing for VF %1.",
- messageId: "SVC4629"
- }
-#---------SVC4630------------------------------
-# %1 - VF name
-# %2 - new csarUUID
-# %3 - old csarUUID
- RESOURCE_LINKED_TO_DIFFERENT_VSP: {
- code: 400,
- message: "Error: Resource %1 cannot be updated using CsarUUID %2 since the resource is linked to a different VSP with csarUUID %3.",
- messageId: "SVC4630"
- }
-#---------SVC4631------------------------------
-# %1 - policy name
- POLICY_TYPE_ALREADY_EXIST: {
- code: 409,
- message: "Error: Policy type %1 already exists.",
- messageId: "SVC4631"
- }
-#---------SVC4632------------------------------
-# %1 - target name
-# %2 - policy type name
- TARGETS_NON_VALID: {
- code: 400,
- message: "Error: target %1 listed in policy type %2 is not a group or resource.",
- messageId: "SVC4632"
- }
-#---------SVC4633------------------------------
-# %1 - policy name
- TARGETS_EMPTY: {
- code: 400,
- message: "Error: Invalid Content. Policy %1 target list was provided but does not have values",
- messageId: "SVC4633"
- }
-#---------SVC4634------------------------------
- DATA_TYPE_CANNOT_BE_EMPTY: {
- code: 500,
- message: "Error: Data types are empty. Please import the data types.",
- messageId: "SVC4634"
- }
-#---------SVC4635------------------------------
-# %1 - csar uuid
- RESOURCE_FROM_CSAR_NOT_FOUND: {
- code: 400,
- message: "Error: resource from csar uuid %1 not found",
- messageId: "SVC4635"
- }
-#---------SVC4636------------------------------
-# %1 - Data type name
- DATA_TYPE_CANNOT_BE_UPDATED_BAD_REQUEST: {
- code: 400,
- message: 'Error: Data type %1 cannot be upgraded. The new data type does not contain old properties or the type of one of the properties has been changed.',
- messageId: "SVC4636"
- }
-#-----------SVC4637---------------------------
-#%1 - attribute name
- ATTRIBUTE_NOT_FOUND: {
- code: 404,
- message: "Error: Requested '%1' attribute was not found.",
- messageId: "SVC4637"
- }
-#-----------SVC4638---------------------------
-#%1 - attribute name
- ATTRIBUTE_ALREADY_EXIST: {
- code: 409,
- message: "Error: Attribute with '%1' name already exists.",
- messageId: "SVC4638"
- }
-#-----------SVC4639---------------------------
-#%1 - property name
- PROPERTY_NAME_ALREADY_EXISTS: {
- code: 409,
- message: "Error: Property with '%1' name and different type already exists.",
- messageId: "SVC4639"
- }
-#-----------SVC4640---------------------------
-#%1 - property name
- INVALID_PROPERTY: {
- code: 409,
- message: "Error: Invalid property received.",
- messageId: "SVC4640"
- }
-#---------SVC4641-----------------------------
-#%1 - invalid filter
-#%2 - valid filters
- INVALID_FILTER_KEY: {
- code: 400,
- message: "Error: The filter %1 is not applicable. Please use one of the following filters: %2",
- messageId: "SVC4641"
- }
-#---------SVC4642-----------------------------
-#%1 - asset type
-#%2 - filter
- NO_ASSETS_FOUND: {
- code: 404,
- message: "No %1 were found to match criteria %2",
- messageId: "SVC4642"
- }
-#---------SVC4643------------------------------
-# %1 - "Resource"/"Product"
-# %2 - "sub-category name"
-# %3 - "category name"
- COMPONENT_SUB_CATEGORY_NOT_FOUND_FOR_CATEGORY: {
- code: 404,
- message: "Error: %1 sub-category '%2' not found under category '%3'.",
- messageId: "SVC4643"
- }
-#---------SVC4644------------------------------
-# %1 - Format
- CORRUPTED_FORMAT: {
- code: 400,
- message: "Error: %1 format is corrupted.",
- messageId: "SVC4644"
- }
-#---------SVC4645------------------------------
-# %1 - "groupType"
- INVALID_VF_MODULE_TYPE: {
- code: 400,
- message: "Error: Invalid group type '%1' (should be VfModule).",
- messageId: "SVC4645"
- }
-#---------SVC4646------------------------------
-# %1 - "groupName"
- INVALID_VF_MODULE_NAME: {
- code: 400,
- message: "Error: Invalid Content. VF Module name '%1' contains invalid characters",
- messageId: "SVC4646"
- }
-
-#---------SVC4647------------------------------
-# %1 - "modifiedName"
- INVALID_VF_MODULE_NAME_MODIFICATION: {
- code: 400,
- message: "Error: Invalid VF Module name modification, can not modify '%1'",
- messageId: "SVC4647"
- }
-#---------SVC4648------------------------------
-# %1 - "inputId"
-# %2 - "componentId"
- INPUT_IS_NOT_CHILD_OF_COMPONENT: {
- code: 400,
- message: "Error: Input id: '%1' is not child of component id: '%2'",
- messageId: "SVC4648"
- }
-#---------SVC4649------------------------------
-# %1 - "groupName"
- GROUP_HAS_CYCLIC_DEPENDENCY: {
- code: 400,
- message: "Error: The group '%1' has cyclic dependency",
- messageId: "SVC4649"
- }
-#---------SVC4650------------------------------
-# %1 - "Component Type"
-# %2 - <ServiceName>
-# %3 - error description
- AAI_ARTIFACT_GENERATION_FAILED: {
- code: 500,
- message: "Error: %1 %2 automatic generation of artifacts failed. Description: %3",
- messageId: "SVC4650"
- }
-#---------SVC4651------------------------------
- PARENT_RESOURCE_DOES_NOT_EXTEND: {
- code: 400,
- message: "Error: Once resource is certified, derived_from can be changed only to a sibling",
- messageId: "SVC4651"
- }
-#---------SVC4652------------------------------
-# %1 - resource/service
- COMPONENT_INVALID_SUBCATEGORY: {
- code: 400,
- message: "Error: Invalid Content. Invalid %1 sub category.",
- messageId: "SVC4652"
- }
-#---------SVC4653------------------------------
-# %1 - group instance uniqueId
-# %2 - service uniqueId
- GROUP_INSTANCE_NOT_FOUND_ON_COMPONENT_INSTANCE: {
- code: 404,
- message: "Error: Requested group instance %1 was not found on component %2.",
- messageId: "SVC4653"
- }
-#---------SVC4654------------------------------
-# %1 - group property name
-# %2 - valid min limit value
-# %3 - valid max limit value
- INVALID_GROUP_MIN_MAX_INSTANCES_PROPERTY_VALUE: {
- code: 400,
- message: "Error: Value of %1 must be not higher than %2, and not lower than %3.",
- messageId: "SVC4654"
- }
-#---------SVC4655------------------------------
-# %1 - group property name
-# %2 - valid min limit value
-# %3 - valid max limit value
- INVALID_GROUP_INITIAL_COUNT_PROPERTY_VALUE: {
- code: 400,
- message: "Error: Value of %1 must be between %2 and %3.",
- messageId: "SVC4655"
- }
-#---------SVC4656------------------------------
-# %1 - group property name
-# %2 - lower/higher
-# %3 - valid max/min value
- INVALID_GROUP_PROPERTY_VALUE_LOWER_HIGHER: {
- code: 400,
- message: "Error: Value of %1 must be %2 or equals to %3.",
- messageId: "SVC4656"
- }
-#---------SVC4657------------------------------
-# %1 - certificationRequest / startTesting
- RESOURCE_VFCMT_LIFECYCLE_STATE_NOT_VALID: {
- code: 400,
- message: "Error - Lifecycle state %1 is not valid for resource of type VFCMT",
- messageId: "SVC4657"
- }
-#---------SVC4658------------------------------
-# %1 – asset type [service / resource ]
-# %2 – main asset uuid
-# %3 – not found asset type [service / resource]
-# %4 – not found asset name
- ASSET_NOT_FOUND_DURING_CSAR_CREATION: {
- code: 400,
- message: "Error: CSAR packaging failed for %1 %2. %3 %4 was not found",
- messageId: "SVC4658"
- }
-#---------SVC4659------------------------------
-# %1 – asset type [service / resource ]
-# %2 – main asset uuid
-# %3 – Artifact name
-# %4 – Artifact uuid
- ARTIFACT_PAYLOAD_NOT_FOUND_DURING_CSAR_CREATION: {
- code: 400,
- message: " Error: CSAR packaging failed for %1 %2. Artifact %3 [%4] was not found",
- messageId: "SVC4659"
- }
-#---------SVC4660------------------------------
-# %1 - assetType
-# %2 - matching generic node type name
- GENERIC_TYPE_NOT_FOUND: {
- code: 404,
- message: "Creation of %1 failed. Generic type %2 was not found",
- messageId: "SVC4660"
- }
- #---------SVC4669-----------------------------
- INVALID_RESOURCE_TYPE: {
- code: 400,
- message: "Error: Invalid resource type.",
- messageId: "SVC4669"
- } \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/importTypesTest/categoryTypesTest.yml b/test-apis-ci/src/test/resources/CI/importTypesTest/categoryTypesTest.yml
deleted file mode 100644
index 120f33d5f1..0000000000
--- a/test-apis-ci/src/test/resources/CI/importTypesTest/categoryTypesTest.yml
+++ /dev/null
@@ -1,23 +0,0 @@
-services:
- Mobility:
- name: "Mobility1"
- icons: ['mobility']
- Network_L1_3:
- name: "Network L1-31"
- icons: ['network_l_1-3']
-resources:
- NetworkLayer23:
- name: "Network Layer 2-31"
- subcategories:
- Router:
- name: "Router"
- icons: ['router']
- Gateway:
- name: "Gateway"
- icons: ['gateway']
- WAN_Connectors:
- name: "WAN Connectors"
- icons: ['connector']
- LAN_Connectors:
- name: "LAN Connectors"
- icons: ['connector']
diff --git a/test-apis-ci/src/test/resources/CI/importTypesTest/categoryTypesTest.zip b/test-apis-ci/src/test/resources/CI/importTypesTest/categoryTypesTest.zip
deleted file mode 100644
index 68b7aa9114..0000000000
--- a/test-apis-ci/src/test/resources/CI/importTypesTest/categoryTypesTest.zip
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/src/test/resources/CI/importTypesTest/myHeatStack1/myHeatStack1.yml b/test-apis-ci/src/test/resources/CI/importTypesTest/myHeatStack1/myHeatStack1.yml
deleted file mode 100644
index db40c2e5dd..0000000000
--- a/test-apis-ci/src/test/resources/CI/importTypesTest/myHeatStack1/myHeatStack1.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-org.openecomp.groups.MyHeatStack1:
- derived_from: tosca.groups.Root
- description: Grouped all heat resources which are in the same heat stack
- properties:
- heat_files:
- type: list
- description: Heat files which associate to this group/heat stack
- required: true
- status: supported
- entry_schema:
- type: string
- url_credential:
- type: tosca.datatypes.Credential \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/importTypesTest/myHeatStack1/myHeatStack1.zip b/test-apis-ci/src/test/resources/CI/importTypesTest/myHeatStack1/myHeatStack1.zip
deleted file mode 100644
index 2619853f4b..0000000000
--- a/test-apis-ci/src/test/resources/CI/importTypesTest/myHeatStack1/myHeatStack1.zip
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/src/test/resources/CI/importTypesTest/myHeatStack2/myHeatStack2.yml b/test-apis-ci/src/test/resources/CI/importTypesTest/myHeatStack2/myHeatStack2.yml
deleted file mode 100644
index 017aac2f57..0000000000
--- a/test-apis-ci/src/test/resources/CI/importTypesTest/myHeatStack2/myHeatStack2.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-org.openecomp.groups.MyHeatStack2:
- derived_from: tosca.groups.Root
- description: Grouped all heat resources which are in the same heat stack
- members: [ tosca.nodes.Compute ]
- properties:
- heat_files:
- type: list
- description: Heat files which associate to this group/heat stack
- required: true
- status: supported
- entry_schema:
- type: string
- url_credential:
- type: tosca.datatypes.Credential \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/importTypesTest/myHeatStack2/myHeatStack2.zip b/test-apis-ci/src/test/resources/CI/importTypesTest/myHeatStack2/myHeatStack2.zip
deleted file mode 100644
index 7f43af70eb..0000000000
--- a/test-apis-ci/src/test/resources/CI/importTypesTest/myHeatStack2/myHeatStack2.zip
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/src/test/resources/CI/other/mapping.json b/test-apis-ci/src/test/resources/CI/other/mapping.json
deleted file mode 100644
index 3310d776b9..0000000000
--- a/test-apis-ci/src/test/resources/CI/other/mapping.json
+++ /dev/null
@@ -1,182 +0,0 @@
-{ "order": 1, "template": "auditingevents-*", "settings": {}, "mappings":
-{
-"distributiondownloadevent":
- { "properties": {
- "TIMESTAMP": { "include_in_all": true, "ignore_malformed": false, "format": "yyyy-MM-dd HH:mm:ss.SSS z", "precision_step": 4, "type": "date" },
- "REQUEST_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "SERVICE_INSTANCE_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "ACTION": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "DESC": { "include_in_all": true, "type": "string" },
- "STATUS": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "RESOURCE_URL": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "CONSUMER_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" }},
- "_all": { "enabled": true } },
- "auditinggetuebclusterevent":
- { "properties": {
- "TIMESTAMP": { "include_in_all": true, "ignore_malformed": false, "format": "yyyy-MM-dd HH:mm:ss.SSS z", "precision_step": 4, "type": "date" },
- "REQUEST_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "SERVICE_INSTANCE_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "ACTION": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "DESC": { "include_in_all": true, "type": "string" },
- "STATUS": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "CONSUMER_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" }},
- "_all": { "enabled": true } },
- "distributionstatusevent":
- { "properties": {
- "TIMESTAMP": { "include_in_all": true, "ignore_malformed": false, "format": "yyyy-MM-dd HH:mm:ss.SSS z", "precision_step": 4, "type": "date" },
- "REQUEST_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "SERVICE_INSTANCE_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "ACTION": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "DESC": { "include_in_all": true, "type": "string" },
- "STATUS": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "RESOURCE_URL": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "DID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "TOPIC_NAME":{ "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "CONSUMER_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" }},
- "_all": { "enabled": true } },
-"distributionengineevent":
- { "properties": {
- "TIMESTAMP": { "include_in_all": true, "ignore_malformed": false, "format": "yyyy-MM-dd HH:mm:ss.SSS z", "precision_step": 4, "type": "date" },
- "REQUEST_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "SERVICE_INSTANCE_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "ACTION": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "DESC": { "include_in_all": true, "type": "string" },
- "STATUS": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "TOPIC_NAME":{ "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "ROLE": { "include_in_all": true, "type": "string" },
- "API_KEY": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "D_ENV": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "CONSUMER_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" }},
- "_all": { "enabled": true } },
- "useraccessevent": {
- "properties": {
- "TIMESTAMP": { "include_in_all": true, "ignore_malformed": false, "format": "yyyy-MM-dd HH:mm:ss.SSS z", "precision_step": 4, "type": "date" },
- "REQUEST_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "SERVICE_INSTANCE_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "ACTION": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "DESC": { "include_in_all": true, "type": "string" },
- "STATUS": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "USER": { "include_in_all": true, "type": "string" }},
- "_all": { "enabled": true }},
-"resourceadminevent":
- { "properties": {
- "TIMESTAMP": { "include_in_all": true, "ignore_malformed": false, "format": "yyyy-MM-dd HH:mm:ss.SSS z", "precision_step": 4, "type": "date" },
- "REQUEST_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "SERVICE_INSTANCE_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "ACTION": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "DESC": { "include_in_all": true, "type": "string" },
- "STATUS": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "CURR_VERSION": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "CURR_STATE": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "DID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "MODIFIER": { "include_in_all": true, "type": "string" },
- "PREV_VERSION": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "PREV_STATE": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "RESOURCE_NAME": { "include_in_all": true, "type": "string" },
- "RESOURCE_TYPE": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "DPREV_STATUS": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "DCURR_STATUS": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "TOSCA_NODE_TYPE": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "COMMENT": { "include_in_all": true, "type": "string" },
- "ARTIFACT_DATA": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "PREV_ARTIFACT_UUID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "CURR_ARTIFACT_UUID": { "include_in_all": true, "index": "not_analyzed", "type": "string" } },
- "_all": { "enabled": true }} ,
-"useradminevent":
- { "properties": {
- "TIMESTAMP": { "include_in_all": true, "ignore_malformed": false, "format": "yyyy-MM-dd HH:mm:ss.SSS z", "precision_step": 4, "type": "date" },
- "REQUEST_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "SERVICE_INSTANCE_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "ACTION": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "DESC": { "include_in_all": true, "type": "string" },
- "STATUS": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "USER_AFTER": { "include_in_all": true, "type": "string" },
- "USER_BEFORE": { "include_in_all": true, "type": "string" },
- "MODIFIER": { "include_in_all": true, "type": "string" }},
- "_all": { "enabled": true } },
-"distributionnotificationevent":
- {"properties":{
- "TIMESTAMP": { "include_in_all": true, "ignore_malformed": false, "format": "yyyy-MM-dd HH:mm:ss.SSS z", "precision_step": 4, "type": "date" },
- "REQUEST_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "SERVICE_INSTANCE_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "ACTION": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "DESC": { "include_in_all": true, "type": "string" },
- "STATUS": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "CURR_STATE": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "CURR_VERSION": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "DID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "MODIFIER": { "include_in_all": true, "type": "string" },
- "RESOURCE_NAME": { "include_in_all": true, "type": "string" },
- "RESOURCE_TYPE": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "TOPIC_NAME":{ "include_in_all": true, "index": "not_analyzed", "type": "string" }},
- "_all": { "enabled": true } },
- "categoryevent":
- { "properties":{
- "ACTION": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "DESC": { "include_in_all": true, "type": "string" },
- "MODIFIER": { "include_in_all": true, "type": "string" },
- "REQUEST_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "CATEGORY_NAME": { "include_in_all": true, "type": "string" },
- "SUB_CATEGORY_NAME": { "include_in_all": true, "type": "string" },
- "GROUPING_NAME": { "include_in_all": true, "type": "string" },
- "RESOURCE_TYPE": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "SERVICE_INSTANCE_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "STATUS": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "TIMESTAMP": { "include_in_all": true, "ignore_malformed": false, "format": "yyyy-MM-dd HH:mm:ss.SSS z", "precision_step": 4, "type": "date" }},
- "_all": { "enabled": true } },
- "authevent": {
- "properties": {
- "TIMESTAMP": { "include_in_all": true, "ignore_malformed": false, "format": "yyyy-MM-dd HH:mm:ss.SSS z", "precision_step": 4, "type": "date" },
- "DESC": { "include_in_all": true, "type": "string" },
- "STATUS": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "URL": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "ACTION": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "USER": { "include_in_all": true, "type": "string" },
- "AUTH_STATUS": { "include_in_all": true, "index": "not_analyzed","type": "string" } ,
- "REALM": { "include_in_all": true, "index": "not_analyzed","type": "string" }} ,
- "_all": { "enabled": true }},
- "consumerevent":
- { "properties":{
- "ACTION": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "MODIFIER": { "include_in_all": true, "type": "string" },
- "STATUS": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "DESC": { "include_in_all": true, "type": "string" },
- "REQUEST_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "ECOMP_USER": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "TIMESTAMP": { "include_in_all": true, "ignore_malformed": false, "format": "yyyy-MM-dd HH:mm:ss.SSS z", "precision_step": 4, "type": "date" }},
- "_all": { "enabled": true } },
- "getuserslistevent":
- { "properties":{
- "ACTION": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "MODIFIER": { "include_in_all": true, "type": "string" },
- "STATUS": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "DESC": { "include_in_all": true, "type": "string" },
- "REQUEST_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "DETAILS": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "TIMESTAMP": { "include_in_all": true, "ignore_malformed": false, "format": "yyyy-MM-dd HH:mm:ss.SSS z", "precision_step": 4, "type": "date" }},
- "_all": { "enabled": true } },
- "getcategoryhierarchyevent":
- { "properties":{
- "ACTION": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "MODIFIER": { "include_in_all": true, "type": "string" },
- "STATUS": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "DESC": { "include_in_all": true, "type": "string" },
- "REQUEST_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "DETAILS": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "TIMESTAMP": { "include_in_all": true, "ignore_malformed": false, "format": "yyyy-MM-dd HH:mm:ss.SSS z", "precision_step": 4, "type": "date" }},
- "_all": { "enabled": true } },
- "distributiondeployevent":
- { "properties": {
- "ACTION": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "CURR_VERSION": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "DESC": { "include_in_all": true, "type": "string" },
- "DID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "MODIFIER": { "include_in_all": true, "type": "string" },
- "REQUEST_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "RESOURCE_NAME": { "include_in_all": true, "type": "string" },
- "RESOURCE_TYPE": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "SERVICE_INSTANCE_ID": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "STATUS": { "include_in_all": true, "index": "not_analyzed", "type": "string" },
- "TIMESTAMP": { "include_in_all": true, "ignore_malformed": false, "format": "yyyy-MM-dd HH:mm:ss.SSS z", "precision_step": 4, "type": "date" }},
- "_all": { "enabled": true } }},
- "aliases": { "last_3_months": {}}} \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/addYangXmlArtifactToResource.xml b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/addYangXmlArtifactToResource.xml
deleted file mode 100644
index 0415385bd0..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/addYangXmlArtifactToResource.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<data>
- <sports>
- <person>
- <name>Lionel Andres Messi</name>
- <birthday>1987-06-24T00:00:00-00:00</birthday>
- </person>
- <person>
- <name>Cristiano Ronaldo</name>
- <birthday>1985-02-05T00:00:00-00:00</birthday>
- </person>
- <team>
- <name>FC Barcelona</name>
- <player>
- <name>Lionel Andres Messi</name>
- <season>Champions League 2014-2015</season>
- <number>10</number>
- <scores>43</scores>
- </player>
- </team>
- <team>
- <name>Real Madrid</name>
- <player>
- <name>Cristiano Ronaldo</name>
- <season>Champions League 2014-2015</season>
- <number>7</number>
- <scores>48</scores>
- </player>
- </team>
- </sports>
-
-</data> \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/asc_heat 0 2.yaml b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/asc_heat 0 2.yaml
deleted file mode 100644
index 6835485ca1..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/asc_heat 0 2.yaml
+++ /dev/null
@@ -1,787 +0,0 @@
-heat_template_version: 2013-05-23
-#################################
-#
-# Changes in v0.2:
-# - Unique availability zone for each VM
-# - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
-# - 2 DB VMs added
-# - Images corrected
-# - VM start-up order: SMP->DB->BE->FE (no error handling yet)
-# - Provisioning scripts placeholders
-#
-#################################
-
-description: ASC Template
-
-parameters:
-# availability_zone_smp0:
-# type: string
-# default: nova
-# availability_zone_smp1:
-# type: string
-# default: nova
-# availability_zone_fe0:
-# type: string
-# default: nova
-# availability_zone_fe1:
-# type: string
-# default: nova
-# availability_zone_db0:
-# type: string
-# default: nova
-# availability_zone_db1:
-# type: string
-# default: nova
-# availability_zone_be0:
-# type: string
-# default: nova
-# availability_zone_be1:
-# type: string
-# default: nova
-# availability_zone_be2:
-# type: string
-# default: nova
-# availability_zone_be3:
-# type: string
-# default: nova
-# availability_zone_be4:
-# type: string
-# default: nova
-
- vnf_name:
- type: string
- description: Unique name for this VNF instance
- default: This_is_the_SCP_name
- vnf_id:
- type: string
- description: Unique ID for this VNF instance
- default: This_is_ths_SCP_id
-
- flavor_scp_be_id:
- type: string
- description: flavor type
- default: a1.Small
- flavor_scp_fe_id:
- type: string
- description: flavor type
- default: a1.Small
- flavor_smp_id:
- type: string
- description: flavor type
- default: a1.Small
- flavor_db_id:
- type: string
- description: flavor type
- default: a1.Small
- image_scp_be_id:
- type: string
- description: Image use to boot a server
- default: asc_base_image_be
- image_scp_fe_id:
- type: string
- description: Image use to boot a server
- default: asc_base_image_fe
- image_smp_id:
- type: string
- description: Image use to boot a server
- default: asc_base_image_smp
- image_db_id:
- type: string
- description: Image use to boot a server
- default: asc_base_image_db
-
- int_vscp_fe_cluster_net_id:
- type: string
- description: LAN2 FE Cluster/KA
- int_vscp_fe_cluster_cidr:
- type: string
- description: Private Network2 Address (CIDR notation)
- int_vscp_cluster_net_id:
- type: string
- description: LAN3 Cluster
- int_vscp_cluster_cidr:
- type: string
- description: Private Network3 Address (CIDR notation)
- int_vscp_db_network_net_id:
- type: string
- description: LAN4 DB
- int_vscp_db_network_cidr:
- type: string
- description: Private Network4 Address (CIDR notation)
- SIGNET_vrf_A1_direct_net_id:
- type: string
- description: Network name for SIGTRAN_A
- SIGNET_vrf_B1_direct_net_id:
- type: string
- description: Network name for SIGTRAN_B
- Cricket_OCS_protected_net_id:
- type: string
- description: Network name for CRICKET_OCS
- OAM_direct_net_id:
- type: string
- description: Network name for OAM
- be0_Cricket_OCS_protected_ips:
- type: string
- label: be0 port 5 OAM ip address
- description: be0 port 5 OAM ip address
- be1_Cricket_OCS_protected_ips:
- type: string
- label: be1 port 5 OAM ip address
- description: be1 port 5 OAM ip address
- be2_Cricket_OCS_protected_ips:
- type: string
- label: be2 port 5 OAM ip address
- description: be2 port 5 OAM ip address
- be3_Cricket_OCS_protected_ips:
- type: string
- label: be3 port 5 OAM ip address
- description: be3 port 5 OAM ip address
- be4_Cricket_OCS_protected_ips:
- type: string
- label: be4 port 5 OAM ip address
- description: be4 port 5 OAM ip address
- be0_OAM_direct_ips:
- type: string
- label: be0 port 7 OAM ip address
- description: be0 port 7 OAM ip address
- be1_OAM_direct_ips:
- type: string
- label: be1 port 7 OAM ip address
- description: be1 port 7 OAM ip address
- be2_OAM_direct_ips:
- type: string
- label: be2 port 7 OAM ip address
- description: be2 port 7 OAM ip address
- be3_OAM_direct_ips:
- type: string
- label: be3 port 7 OAM ip address
- description: be3 port 7 OAM ip address
- be4_OAM_direct_ips:
- type: string
- label: be4 port 7 OAM ip address
- description: be4 port 7 OAM ip address
- fe0_SIGNET_vrf_A1_direct_ips:
- type: string
- label: fe0 port 0 SIGTRAN ip address
- description: fe0 port 0 SIGTRAN ip address
- fe0_OAM_direct_ips:
- type: string
- label: fe0 port 7 OAM ip address
- description: fe0 port 7 OAM ip address
- fe1_SIGNET_vrf_B1_direct_ips:
- type: string
- label: fe1 port 1 SIGTRAN ip address
- description: fe1 port 1 SIGTRAN ip address
- fe1_OAM_direct_ips:
- type: string
- label: fe1 port 7 OAM ip address
- description: fe1 port 7 OAM ip address
- smp0_OAM_direct_ips:
- type: string
- label: smp0 port 7 OAM ip address
- description: smp0 port 7 OAM ip address
- smp1_OAM_direct_ips:
- type: string
- label: smp1 port 7 OAM ip address
- description: smp1 port 7 OAM ip address
- db0_OAM_direct_ips:
- type: string
- label: db0 port 7 OAM ip address
- description: smp0 port 7 OAM ip address
- db1_OAM_direct_ips:
- type: string
- label: smp1 port 7 OAM ip address
- description: db1 port 7 OAM ip address
- vm_scp_be0_name:
- type: string
- default: vSCP_BE0
- description: name of VM
- vm_scp_be1_name:
- type: string
- default: vSCP_BE1
- description: name of VM
- vm_scp_be2_name:
- type: string
- default: vSCP_BE2
- description: name of VM
- vm_scp_be3_name:
- type: string
- default: vSCP_BE3
- description: name of VM
- vm_scp_be4_name:
- type: string
- default: vSCP_BE4
- description: name of VM
- vm_scp_fe0_name:
- type: string
- default: vSCP_FE0
- description: name of VM
- vm_scp_fe1_name:
- type: string
- default: vSCP_FE1
- description: name of VM
- vm_smp0_name:
- type: string
- default: vSMP0
- description: name of VM
- vm_smp1_name:
- type: string
- default: vSMP1
- description: name of VM
- vm_db0_name:
- type: string
- default: vDB0
- description: name of VM
- vm_db1_name:
- type: string
- default: vDB1
- description: name of VM
-
-resources:
-# scp_be_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_be_wait_handle }
-# count: 5
-# timeout: 300
-# scp_be_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# scp_fe_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_fe_wait_handle }
-# count: 2
-# timeout: 300
-# scp_fe_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# smp_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: smp_wait_handle }
-# count: 2
-# timeout: 300
-# smp_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# db_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: db_wait_handle }
-# count: 2
-# timeout: 300
-# db_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-
- FE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- BE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- SMP_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- DB_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
-
- FE_Clustering_KA:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_fe_cluster_net_id }
-
- FE_Clustering_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: FE_Clustering_KA }
- cidr: { get_param: int_vscp_fe_cluster_cidr }
-
- Clustering_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_cluster_net_id }
-
- Clustering_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: Clustering_Network }
- cidr: { get_param: int_vscp_cluster_cidr }
-
- DB_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_db_network_net_id }
-
- DB_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: DB_Network }
- cidr: { get_param: int_vscp_db_network_cidr }
-
- server_scp_be0:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be0_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be0 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be0_port_3 }
- - port: { get_resource: be0_port_4 }
- - port: { get_resource: be0_port_5 }
- - port: { get_resource: be0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be0_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be0_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be0_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be0_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be0_Cricket_OCS_protected_ips}}]
-
- be0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be0_OAM_direct_ips}}]
-
- server_scp_be1:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be1_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be1 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be1_port_3 }
- - port: { get_resource: be1_port_4 }
- - port: { get_resource: be1_port_5 }
- - port: { get_resource: be1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be1_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be1_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be1_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be1_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be1_Cricket_OCS_protected_ips}}]
-
- be1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be1_OAM_direct_ips}}]
-
- server_scp_be2:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be2_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be2 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be2_port_3 }
- - port: { get_resource: be2_port_4 }
- - port: { get_resource: be2_port_5 }
- - port: { get_resource: be2_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be2_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be2_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be2_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be2_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be2_Cricket_OCS_protected_ips}}]
-
- be2_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be2_OAM_direct_ips}}]
-
- server_scp_be3:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be3_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be3 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be3_port_3 }
- - port: { get_resource: be3_port_4 }
- - port: { get_resource: be3_port_5 }
- - port: { get_resource: be3_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be3_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be3_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be3_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be3_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be3_Cricket_OCS_protected_ips}}]
-
- be3_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be3_OAM_direct_ips}}]
-
- server_scp_be4:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be4_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be4 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be4_port_3 }
- - port: { get_resource: be4_port_4 }
- - port: { get_resource: be4_port_5 }
- - port: { get_resource: be4_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be4_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be4_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be4_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be4_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be4_Cricket_OCS_protected_ips}}]
-
- be4_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be4_OAM_direct_ips}}]
-
- server_scp_fe0:
- type: OS::Nova::Server
-# depends on: scp_be_wait_condition
- properties:
- name: { get_param: vm_scp_fe0_name }
- image: { get_param: image_scp_fe_id }
-# availability_zone: { get_param: availability_zone_fe0 }
- flavor: { get_param: flavor_scp_fe_id }
- scheduler_hints: { group: { get_resource: FE_Affinity } }
- networks:
- - port: { get_resource: fe0_port_0 }
- - port: { get_resource: fe0_port_2 }
- - port: { get_resource: fe0_port_3 }
- - port: { get_resource: fe0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_fe0_name}
-# wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
-
- fe0_port_0:
- type: OS::Neutron::Port
- properties:
- network: { get_param: SIGNET_vrf_A1_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe0_SIGNET_vrf_A1_direct_ips}}]
-
- fe0_port_2:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: FE_Clustering_KA }
-
- fe0_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- fe0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe0_OAM_direct_ips}}]
-
- server_scp_fe1:
- type: OS::Nova::Server
-# depends on: scp_be_wait_condition
- properties:
- name: { get_param: vm_scp_fe1_name }
- image: { get_param: image_scp_fe_id }
-# availability_zone: { get_param: availability_zone_fe1 }
- flavor: { get_param: flavor_scp_fe_id }
- scheduler_hints: { group: { get_resource: FE_Affinity } }
- networks:
- - port: { get_resource: fe1_port_1 }
- - port: { get_resource: fe1_port_2 }
- - port: { get_resource: fe1_port_3 }
- - port: { get_resource: fe1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_fe1_name}
-# wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
-
- fe1_port_1:
- type: OS::Neutron::Port
- properties:
- network: { get_param: SIGNET_vrf_B1_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe1_SIGNET_vrf_B1_direct_ips}}]
-
- fe1_port_2:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: FE_Clustering_KA }
-
- fe1_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- fe1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe1_OAM_direct_ips}}]
-
- server_smp0:
- type: OS::Nova::Server
- properties:
- name: { get_param: vm_smp0_name }
- image: { get_param: image_smp_id }
-# availability_zone: { get_param: availability_zone_smp0 }
- flavor: { get_param: flavor_smp_id }
- scheduler_hints: { group: { get_resource: SMP_Affinity } }
- networks:
- - port: { get_resource: smp0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_smp0_name}
-# wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
-
- smp0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: smp0_OAM_direct_ips}}]
-
- server_smp1:
- type: OS::Nova::Server
- properties:
- name: { get_param: vm_smp1_name }
- image: { get_param: image_smp_id }
-# availability_zone: { get_param: availability_zone_smp1 }
- flavor: { get_param: flavor_smp_id }
- scheduler_hints: { group: { get_resource: SMP_Affinity } }
- networks:
- - port: { get_resource: smp1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_smp1_name}
-# wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
-
- smp1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: smp1_OAM_direct_ips}}]
-
- server_db0:
- type: OS::Nova::Server
-# depends_on: smp_wait_condition
- properties:
- name: { get_param: vm_db0_name }
- image: { get_param: image_db_id }
-# availability_zone: { get_param: availability_zone_db0 }
- flavor: { get_param: flavor_db_id }
- scheduler_hints: { group: { get_resource: DB_Affinity } }
- networks:
- - port: { get_resource: db0_port_4 }
- - port: { get_resource: db0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_db0_name}
-# wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
-
- db0_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- db0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: db0_OAM_direct_ips}}]
-
- server_db1:
- type: OS::Nova::Server
-# depends_on: smp_wait_condition
- properties:
- name: { get_param: vm_db1_name }
- image: { get_param: image_db_id }
-# availability_zone: { get_param: availability_zone_db1 }
- flavor: { get_param: flavor_db_id }
- scheduler_hints: { group: { get_resource: DB_Affinity } }
- networks:
- - port: { get_resource: db1_port_4 }
- - port: { get_resource: db1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_db1_name}
-# wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
-
- db1_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- db1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: db1_OAM_direct_ips}}] \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/asc_heat 0 2.zip b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/asc_heat 0 2.zip
deleted file mode 100644
index c8a2726421..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/asc_heat 0 2.zip
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/asc_heat_net 0 2.yaml b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/asc_heat_net 0 2.yaml
deleted file mode 100644
index 6835485ca1..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/asc_heat_net 0 2.yaml
+++ /dev/null
@@ -1,787 +0,0 @@
-heat_template_version: 2013-05-23
-#################################
-#
-# Changes in v0.2:
-# - Unique availability zone for each VM
-# - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
-# - 2 DB VMs added
-# - Images corrected
-# - VM start-up order: SMP->DB->BE->FE (no error handling yet)
-# - Provisioning scripts placeholders
-#
-#################################
-
-description: ASC Template
-
-parameters:
-# availability_zone_smp0:
-# type: string
-# default: nova
-# availability_zone_smp1:
-# type: string
-# default: nova
-# availability_zone_fe0:
-# type: string
-# default: nova
-# availability_zone_fe1:
-# type: string
-# default: nova
-# availability_zone_db0:
-# type: string
-# default: nova
-# availability_zone_db1:
-# type: string
-# default: nova
-# availability_zone_be0:
-# type: string
-# default: nova
-# availability_zone_be1:
-# type: string
-# default: nova
-# availability_zone_be2:
-# type: string
-# default: nova
-# availability_zone_be3:
-# type: string
-# default: nova
-# availability_zone_be4:
-# type: string
-# default: nova
-
- vnf_name:
- type: string
- description: Unique name for this VNF instance
- default: This_is_the_SCP_name
- vnf_id:
- type: string
- description: Unique ID for this VNF instance
- default: This_is_ths_SCP_id
-
- flavor_scp_be_id:
- type: string
- description: flavor type
- default: a1.Small
- flavor_scp_fe_id:
- type: string
- description: flavor type
- default: a1.Small
- flavor_smp_id:
- type: string
- description: flavor type
- default: a1.Small
- flavor_db_id:
- type: string
- description: flavor type
- default: a1.Small
- image_scp_be_id:
- type: string
- description: Image use to boot a server
- default: asc_base_image_be
- image_scp_fe_id:
- type: string
- description: Image use to boot a server
- default: asc_base_image_fe
- image_smp_id:
- type: string
- description: Image use to boot a server
- default: asc_base_image_smp
- image_db_id:
- type: string
- description: Image use to boot a server
- default: asc_base_image_db
-
- int_vscp_fe_cluster_net_id:
- type: string
- description: LAN2 FE Cluster/KA
- int_vscp_fe_cluster_cidr:
- type: string
- description: Private Network2 Address (CIDR notation)
- int_vscp_cluster_net_id:
- type: string
- description: LAN3 Cluster
- int_vscp_cluster_cidr:
- type: string
- description: Private Network3 Address (CIDR notation)
- int_vscp_db_network_net_id:
- type: string
- description: LAN4 DB
- int_vscp_db_network_cidr:
- type: string
- description: Private Network4 Address (CIDR notation)
- SIGNET_vrf_A1_direct_net_id:
- type: string
- description: Network name for SIGTRAN_A
- SIGNET_vrf_B1_direct_net_id:
- type: string
- description: Network name for SIGTRAN_B
- Cricket_OCS_protected_net_id:
- type: string
- description: Network name for CRICKET_OCS
- OAM_direct_net_id:
- type: string
- description: Network name for OAM
- be0_Cricket_OCS_protected_ips:
- type: string
- label: be0 port 5 OAM ip address
- description: be0 port 5 OAM ip address
- be1_Cricket_OCS_protected_ips:
- type: string
- label: be1 port 5 OAM ip address
- description: be1 port 5 OAM ip address
- be2_Cricket_OCS_protected_ips:
- type: string
- label: be2 port 5 OAM ip address
- description: be2 port 5 OAM ip address
- be3_Cricket_OCS_protected_ips:
- type: string
- label: be3 port 5 OAM ip address
- description: be3 port 5 OAM ip address
- be4_Cricket_OCS_protected_ips:
- type: string
- label: be4 port 5 OAM ip address
- description: be4 port 5 OAM ip address
- be0_OAM_direct_ips:
- type: string
- label: be0 port 7 OAM ip address
- description: be0 port 7 OAM ip address
- be1_OAM_direct_ips:
- type: string
- label: be1 port 7 OAM ip address
- description: be1 port 7 OAM ip address
- be2_OAM_direct_ips:
- type: string
- label: be2 port 7 OAM ip address
- description: be2 port 7 OAM ip address
- be3_OAM_direct_ips:
- type: string
- label: be3 port 7 OAM ip address
- description: be3 port 7 OAM ip address
- be4_OAM_direct_ips:
- type: string
- label: be4 port 7 OAM ip address
- description: be4 port 7 OAM ip address
- fe0_SIGNET_vrf_A1_direct_ips:
- type: string
- label: fe0 port 0 SIGTRAN ip address
- description: fe0 port 0 SIGTRAN ip address
- fe0_OAM_direct_ips:
- type: string
- label: fe0 port 7 OAM ip address
- description: fe0 port 7 OAM ip address
- fe1_SIGNET_vrf_B1_direct_ips:
- type: string
- label: fe1 port 1 SIGTRAN ip address
- description: fe1 port 1 SIGTRAN ip address
- fe1_OAM_direct_ips:
- type: string
- label: fe1 port 7 OAM ip address
- description: fe1 port 7 OAM ip address
- smp0_OAM_direct_ips:
- type: string
- label: smp0 port 7 OAM ip address
- description: smp0 port 7 OAM ip address
- smp1_OAM_direct_ips:
- type: string
- label: smp1 port 7 OAM ip address
- description: smp1 port 7 OAM ip address
- db0_OAM_direct_ips:
- type: string
- label: db0 port 7 OAM ip address
- description: smp0 port 7 OAM ip address
- db1_OAM_direct_ips:
- type: string
- label: smp1 port 7 OAM ip address
- description: db1 port 7 OAM ip address
- vm_scp_be0_name:
- type: string
- default: vSCP_BE0
- description: name of VM
- vm_scp_be1_name:
- type: string
- default: vSCP_BE1
- description: name of VM
- vm_scp_be2_name:
- type: string
- default: vSCP_BE2
- description: name of VM
- vm_scp_be3_name:
- type: string
- default: vSCP_BE3
- description: name of VM
- vm_scp_be4_name:
- type: string
- default: vSCP_BE4
- description: name of VM
- vm_scp_fe0_name:
- type: string
- default: vSCP_FE0
- description: name of VM
- vm_scp_fe1_name:
- type: string
- default: vSCP_FE1
- description: name of VM
- vm_smp0_name:
- type: string
- default: vSMP0
- description: name of VM
- vm_smp1_name:
- type: string
- default: vSMP1
- description: name of VM
- vm_db0_name:
- type: string
- default: vDB0
- description: name of VM
- vm_db1_name:
- type: string
- default: vDB1
- description: name of VM
-
-resources:
-# scp_be_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_be_wait_handle }
-# count: 5
-# timeout: 300
-# scp_be_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# scp_fe_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_fe_wait_handle }
-# count: 2
-# timeout: 300
-# scp_fe_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# smp_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: smp_wait_handle }
-# count: 2
-# timeout: 300
-# smp_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# db_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: db_wait_handle }
-# count: 2
-# timeout: 300
-# db_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-
- FE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- BE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- SMP_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- DB_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
-
- FE_Clustering_KA:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_fe_cluster_net_id }
-
- FE_Clustering_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: FE_Clustering_KA }
- cidr: { get_param: int_vscp_fe_cluster_cidr }
-
- Clustering_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_cluster_net_id }
-
- Clustering_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: Clustering_Network }
- cidr: { get_param: int_vscp_cluster_cidr }
-
- DB_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_db_network_net_id }
-
- DB_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: DB_Network }
- cidr: { get_param: int_vscp_db_network_cidr }
-
- server_scp_be0:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be0_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be0 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be0_port_3 }
- - port: { get_resource: be0_port_4 }
- - port: { get_resource: be0_port_5 }
- - port: { get_resource: be0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be0_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be0_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be0_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be0_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be0_Cricket_OCS_protected_ips}}]
-
- be0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be0_OAM_direct_ips}}]
-
- server_scp_be1:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be1_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be1 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be1_port_3 }
- - port: { get_resource: be1_port_4 }
- - port: { get_resource: be1_port_5 }
- - port: { get_resource: be1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be1_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be1_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be1_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be1_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be1_Cricket_OCS_protected_ips}}]
-
- be1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be1_OAM_direct_ips}}]
-
- server_scp_be2:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be2_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be2 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be2_port_3 }
- - port: { get_resource: be2_port_4 }
- - port: { get_resource: be2_port_5 }
- - port: { get_resource: be2_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be2_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be2_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be2_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be2_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be2_Cricket_OCS_protected_ips}}]
-
- be2_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be2_OAM_direct_ips}}]
-
- server_scp_be3:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be3_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be3 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be3_port_3 }
- - port: { get_resource: be3_port_4 }
- - port: { get_resource: be3_port_5 }
- - port: { get_resource: be3_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be3_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be3_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be3_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be3_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be3_Cricket_OCS_protected_ips}}]
-
- be3_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be3_OAM_direct_ips}}]
-
- server_scp_be4:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be4_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be4 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be4_port_3 }
- - port: { get_resource: be4_port_4 }
- - port: { get_resource: be4_port_5 }
- - port: { get_resource: be4_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be4_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be4_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be4_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be4_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be4_Cricket_OCS_protected_ips}}]
-
- be4_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be4_OAM_direct_ips}}]
-
- server_scp_fe0:
- type: OS::Nova::Server
-# depends on: scp_be_wait_condition
- properties:
- name: { get_param: vm_scp_fe0_name }
- image: { get_param: image_scp_fe_id }
-# availability_zone: { get_param: availability_zone_fe0 }
- flavor: { get_param: flavor_scp_fe_id }
- scheduler_hints: { group: { get_resource: FE_Affinity } }
- networks:
- - port: { get_resource: fe0_port_0 }
- - port: { get_resource: fe0_port_2 }
- - port: { get_resource: fe0_port_3 }
- - port: { get_resource: fe0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_fe0_name}
-# wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
-
- fe0_port_0:
- type: OS::Neutron::Port
- properties:
- network: { get_param: SIGNET_vrf_A1_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe0_SIGNET_vrf_A1_direct_ips}}]
-
- fe0_port_2:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: FE_Clustering_KA }
-
- fe0_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- fe0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe0_OAM_direct_ips}}]
-
- server_scp_fe1:
- type: OS::Nova::Server
-# depends on: scp_be_wait_condition
- properties:
- name: { get_param: vm_scp_fe1_name }
- image: { get_param: image_scp_fe_id }
-# availability_zone: { get_param: availability_zone_fe1 }
- flavor: { get_param: flavor_scp_fe_id }
- scheduler_hints: { group: { get_resource: FE_Affinity } }
- networks:
- - port: { get_resource: fe1_port_1 }
- - port: { get_resource: fe1_port_2 }
- - port: { get_resource: fe1_port_3 }
- - port: { get_resource: fe1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_fe1_name}
-# wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
-
- fe1_port_1:
- type: OS::Neutron::Port
- properties:
- network: { get_param: SIGNET_vrf_B1_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe1_SIGNET_vrf_B1_direct_ips}}]
-
- fe1_port_2:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: FE_Clustering_KA }
-
- fe1_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- fe1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe1_OAM_direct_ips}}]
-
- server_smp0:
- type: OS::Nova::Server
- properties:
- name: { get_param: vm_smp0_name }
- image: { get_param: image_smp_id }
-# availability_zone: { get_param: availability_zone_smp0 }
- flavor: { get_param: flavor_smp_id }
- scheduler_hints: { group: { get_resource: SMP_Affinity } }
- networks:
- - port: { get_resource: smp0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_smp0_name}
-# wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
-
- smp0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: smp0_OAM_direct_ips}}]
-
- server_smp1:
- type: OS::Nova::Server
- properties:
- name: { get_param: vm_smp1_name }
- image: { get_param: image_smp_id }
-# availability_zone: { get_param: availability_zone_smp1 }
- flavor: { get_param: flavor_smp_id }
- scheduler_hints: { group: { get_resource: SMP_Affinity } }
- networks:
- - port: { get_resource: smp1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_smp1_name}
-# wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
-
- smp1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: smp1_OAM_direct_ips}}]
-
- server_db0:
- type: OS::Nova::Server
-# depends_on: smp_wait_condition
- properties:
- name: { get_param: vm_db0_name }
- image: { get_param: image_db_id }
-# availability_zone: { get_param: availability_zone_db0 }
- flavor: { get_param: flavor_db_id }
- scheduler_hints: { group: { get_resource: DB_Affinity } }
- networks:
- - port: { get_resource: db0_port_4 }
- - port: { get_resource: db0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_db0_name}
-# wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
-
- db0_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- db0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: db0_OAM_direct_ips}}]
-
- server_db1:
- type: OS::Nova::Server
-# depends_on: smp_wait_condition
- properties:
- name: { get_param: vm_db1_name }
- image: { get_param: image_db_id }
-# availability_zone: { get_param: availability_zone_db1 }
- flavor: { get_param: flavor_db_id }
- scheduler_hints: { group: { get_resource: DB_Affinity } }
- networks:
- - port: { get_resource: db1_port_4 }
- - port: { get_resource: db1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_db1_name}
-# wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
-
- db1_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- db1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: db1_OAM_direct_ips}}] \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/heatEnvfile.env b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/heatEnvfile.env
deleted file mode 100644
index 6835485ca1..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/heatEnvfile.env
+++ /dev/null
@@ -1,787 +0,0 @@
-heat_template_version: 2013-05-23
-#################################
-#
-# Changes in v0.2:
-# - Unique availability zone for each VM
-# - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
-# - 2 DB VMs added
-# - Images corrected
-# - VM start-up order: SMP->DB->BE->FE (no error handling yet)
-# - Provisioning scripts placeholders
-#
-#################################
-
-description: ASC Template
-
-parameters:
-# availability_zone_smp0:
-# type: string
-# default: nova
-# availability_zone_smp1:
-# type: string
-# default: nova
-# availability_zone_fe0:
-# type: string
-# default: nova
-# availability_zone_fe1:
-# type: string
-# default: nova
-# availability_zone_db0:
-# type: string
-# default: nova
-# availability_zone_db1:
-# type: string
-# default: nova
-# availability_zone_be0:
-# type: string
-# default: nova
-# availability_zone_be1:
-# type: string
-# default: nova
-# availability_zone_be2:
-# type: string
-# default: nova
-# availability_zone_be3:
-# type: string
-# default: nova
-# availability_zone_be4:
-# type: string
-# default: nova
-
- vnf_name:
- type: string
- description: Unique name for this VNF instance
- default: This_is_the_SCP_name
- vnf_id:
- type: string
- description: Unique ID for this VNF instance
- default: This_is_ths_SCP_id
-
- flavor_scp_be_id:
- type: string
- description: flavor type
- default: a1.Small
- flavor_scp_fe_id:
- type: string
- description: flavor type
- default: a1.Small
- flavor_smp_id:
- type: string
- description: flavor type
- default: a1.Small
- flavor_db_id:
- type: string
- description: flavor type
- default: a1.Small
- image_scp_be_id:
- type: string
- description: Image use to boot a server
- default: asc_base_image_be
- image_scp_fe_id:
- type: string
- description: Image use to boot a server
- default: asc_base_image_fe
- image_smp_id:
- type: string
- description: Image use to boot a server
- default: asc_base_image_smp
- image_db_id:
- type: string
- description: Image use to boot a server
- default: asc_base_image_db
-
- int_vscp_fe_cluster_net_id:
- type: string
- description: LAN2 FE Cluster/KA
- int_vscp_fe_cluster_cidr:
- type: string
- description: Private Network2 Address (CIDR notation)
- int_vscp_cluster_net_id:
- type: string
- description: LAN3 Cluster
- int_vscp_cluster_cidr:
- type: string
- description: Private Network3 Address (CIDR notation)
- int_vscp_db_network_net_id:
- type: string
- description: LAN4 DB
- int_vscp_db_network_cidr:
- type: string
- description: Private Network4 Address (CIDR notation)
- SIGNET_vrf_A1_direct_net_id:
- type: string
- description: Network name for SIGTRAN_A
- SIGNET_vrf_B1_direct_net_id:
- type: string
- description: Network name for SIGTRAN_B
- Cricket_OCS_protected_net_id:
- type: string
- description: Network name for CRICKET_OCS
- OAM_direct_net_id:
- type: string
- description: Network name for OAM
- be0_Cricket_OCS_protected_ips:
- type: string
- label: be0 port 5 OAM ip address
- description: be0 port 5 OAM ip address
- be1_Cricket_OCS_protected_ips:
- type: string
- label: be1 port 5 OAM ip address
- description: be1 port 5 OAM ip address
- be2_Cricket_OCS_protected_ips:
- type: string
- label: be2 port 5 OAM ip address
- description: be2 port 5 OAM ip address
- be3_Cricket_OCS_protected_ips:
- type: string
- label: be3 port 5 OAM ip address
- description: be3 port 5 OAM ip address
- be4_Cricket_OCS_protected_ips:
- type: string
- label: be4 port 5 OAM ip address
- description: be4 port 5 OAM ip address
- be0_OAM_direct_ips:
- type: string
- label: be0 port 7 OAM ip address
- description: be0 port 7 OAM ip address
- be1_OAM_direct_ips:
- type: string
- label: be1 port 7 OAM ip address
- description: be1 port 7 OAM ip address
- be2_OAM_direct_ips:
- type: string
- label: be2 port 7 OAM ip address
- description: be2 port 7 OAM ip address
- be3_OAM_direct_ips:
- type: string
- label: be3 port 7 OAM ip address
- description: be3 port 7 OAM ip address
- be4_OAM_direct_ips:
- type: string
- label: be4 port 7 OAM ip address
- description: be4 port 7 OAM ip address
- fe0_SIGNET_vrf_A1_direct_ips:
- type: string
- label: fe0 port 0 SIGTRAN ip address
- description: fe0 port 0 SIGTRAN ip address
- fe0_OAM_direct_ips:
- type: string
- label: fe0 port 7 OAM ip address
- description: fe0 port 7 OAM ip address
- fe1_SIGNET_vrf_B1_direct_ips:
- type: string
- label: fe1 port 1 SIGTRAN ip address
- description: fe1 port 1 SIGTRAN ip address
- fe1_OAM_direct_ips:
- type: string
- label: fe1 port 7 OAM ip address
- description: fe1 port 7 OAM ip address
- smp0_OAM_direct_ips:
- type: string
- label: smp0 port 7 OAM ip address
- description: smp0 port 7 OAM ip address
- smp1_OAM_direct_ips:
- type: string
- label: smp1 port 7 OAM ip address
- description: smp1 port 7 OAM ip address
- db0_OAM_direct_ips:
- type: string
- label: db0 port 7 OAM ip address
- description: smp0 port 7 OAM ip address
- db1_OAM_direct_ips:
- type: string
- label: smp1 port 7 OAM ip address
- description: db1 port 7 OAM ip address
- vm_scp_be0_name:
- type: string
- default: vSCP_BE0
- description: name of VM
- vm_scp_be1_name:
- type: string
- default: vSCP_BE1
- description: name of VM
- vm_scp_be2_name:
- type: string
- default: vSCP_BE2
- description: name of VM
- vm_scp_be3_name:
- type: string
- default: vSCP_BE3
- description: name of VM
- vm_scp_be4_name:
- type: string
- default: vSCP_BE4
- description: name of VM
- vm_scp_fe0_name:
- type: string
- default: vSCP_FE0
- description: name of VM
- vm_scp_fe1_name:
- type: string
- default: vSCP_FE1
- description: name of VM
- vm_smp0_name:
- type: string
- default: vSMP0
- description: name of VM
- vm_smp1_name:
- type: string
- default: vSMP1
- description: name of VM
- vm_db0_name:
- type: string
- default: vDB0
- description: name of VM
- vm_db1_name:
- type: string
- default: vDB1
- description: name of VM
-
-resources:
-# scp_be_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_be_wait_handle }
-# count: 5
-# timeout: 300
-# scp_be_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# scp_fe_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_fe_wait_handle }
-# count: 2
-# timeout: 300
-# scp_fe_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# smp_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: smp_wait_handle }
-# count: 2
-# timeout: 300
-# smp_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# db_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: db_wait_handle }
-# count: 2
-# timeout: 300
-# db_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-
- FE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- BE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- SMP_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- DB_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
-
- FE_Clustering_KA:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_fe_cluster_net_id }
-
- FE_Clustering_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: FE_Clustering_KA }
- cidr: { get_param: int_vscp_fe_cluster_cidr }
-
- Clustering_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_cluster_net_id }
-
- Clustering_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: Clustering_Network }
- cidr: { get_param: int_vscp_cluster_cidr }
-
- DB_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_db_network_net_id }
-
- DB_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: DB_Network }
- cidr: { get_param: int_vscp_db_network_cidr }
-
- server_scp_be0:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be0_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be0 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be0_port_3 }
- - port: { get_resource: be0_port_4 }
- - port: { get_resource: be0_port_5 }
- - port: { get_resource: be0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be0_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be0_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be0_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be0_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be0_Cricket_OCS_protected_ips}}]
-
- be0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be0_OAM_direct_ips}}]
-
- server_scp_be1:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be1_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be1 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be1_port_3 }
- - port: { get_resource: be1_port_4 }
- - port: { get_resource: be1_port_5 }
- - port: { get_resource: be1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be1_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be1_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be1_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be1_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be1_Cricket_OCS_protected_ips}}]
-
- be1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be1_OAM_direct_ips}}]
-
- server_scp_be2:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be2_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be2 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be2_port_3 }
- - port: { get_resource: be2_port_4 }
- - port: { get_resource: be2_port_5 }
- - port: { get_resource: be2_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be2_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be2_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be2_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be2_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be2_Cricket_OCS_protected_ips}}]
-
- be2_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be2_OAM_direct_ips}}]
-
- server_scp_be3:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be3_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be3 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be3_port_3 }
- - port: { get_resource: be3_port_4 }
- - port: { get_resource: be3_port_5 }
- - port: { get_resource: be3_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be3_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be3_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be3_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be3_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be3_Cricket_OCS_protected_ips}}]
-
- be3_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be3_OAM_direct_ips}}]
-
- server_scp_be4:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be4_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be4 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be4_port_3 }
- - port: { get_resource: be4_port_4 }
- - port: { get_resource: be4_port_5 }
- - port: { get_resource: be4_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be4_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be4_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be4_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be4_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be4_Cricket_OCS_protected_ips}}]
-
- be4_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be4_OAM_direct_ips}}]
-
- server_scp_fe0:
- type: OS::Nova::Server
-# depends on: scp_be_wait_condition
- properties:
- name: { get_param: vm_scp_fe0_name }
- image: { get_param: image_scp_fe_id }
-# availability_zone: { get_param: availability_zone_fe0 }
- flavor: { get_param: flavor_scp_fe_id }
- scheduler_hints: { group: { get_resource: FE_Affinity } }
- networks:
- - port: { get_resource: fe0_port_0 }
- - port: { get_resource: fe0_port_2 }
- - port: { get_resource: fe0_port_3 }
- - port: { get_resource: fe0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_fe0_name}
-# wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
-
- fe0_port_0:
- type: OS::Neutron::Port
- properties:
- network: { get_param: SIGNET_vrf_A1_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe0_SIGNET_vrf_A1_direct_ips}}]
-
- fe0_port_2:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: FE_Clustering_KA }
-
- fe0_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- fe0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe0_OAM_direct_ips}}]
-
- server_scp_fe1:
- type: OS::Nova::Server
-# depends on: scp_be_wait_condition
- properties:
- name: { get_param: vm_scp_fe1_name }
- image: { get_param: image_scp_fe_id }
-# availability_zone: { get_param: availability_zone_fe1 }
- flavor: { get_param: flavor_scp_fe_id }
- scheduler_hints: { group: { get_resource: FE_Affinity } }
- networks:
- - port: { get_resource: fe1_port_1 }
- - port: { get_resource: fe1_port_2 }
- - port: { get_resource: fe1_port_3 }
- - port: { get_resource: fe1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_fe1_name}
-# wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
-
- fe1_port_1:
- type: OS::Neutron::Port
- properties:
- network: { get_param: SIGNET_vrf_B1_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe1_SIGNET_vrf_B1_direct_ips}}]
-
- fe1_port_2:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: FE_Clustering_KA }
-
- fe1_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- fe1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe1_OAM_direct_ips}}]
-
- server_smp0:
- type: OS::Nova::Server
- properties:
- name: { get_param: vm_smp0_name }
- image: { get_param: image_smp_id }
-# availability_zone: { get_param: availability_zone_smp0 }
- flavor: { get_param: flavor_smp_id }
- scheduler_hints: { group: { get_resource: SMP_Affinity } }
- networks:
- - port: { get_resource: smp0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_smp0_name}
-# wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
-
- smp0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: smp0_OAM_direct_ips}}]
-
- server_smp1:
- type: OS::Nova::Server
- properties:
- name: { get_param: vm_smp1_name }
- image: { get_param: image_smp_id }
-# availability_zone: { get_param: availability_zone_smp1 }
- flavor: { get_param: flavor_smp_id }
- scheduler_hints: { group: { get_resource: SMP_Affinity } }
- networks:
- - port: { get_resource: smp1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_smp1_name}
-# wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
-
- smp1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: smp1_OAM_direct_ips}}]
-
- server_db0:
- type: OS::Nova::Server
-# depends_on: smp_wait_condition
- properties:
- name: { get_param: vm_db0_name }
- image: { get_param: image_db_id }
-# availability_zone: { get_param: availability_zone_db0 }
- flavor: { get_param: flavor_db_id }
- scheduler_hints: { group: { get_resource: DB_Affinity } }
- networks:
- - port: { get_resource: db0_port_4 }
- - port: { get_resource: db0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_db0_name}
-# wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
-
- db0_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- db0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: db0_OAM_direct_ips}}]
-
- server_db1:
- type: OS::Nova::Server
-# depends_on: smp_wait_condition
- properties:
- name: { get_param: vm_db1_name }
- image: { get_param: image_db_id }
-# availability_zone: { get_param: availability_zone_db1 }
- flavor: { get_param: flavor_db_id }
- scheduler_hints: { group: { get_resource: DB_Affinity } }
- networks:
- - port: { get_resource: db1_port_4 }
- - port: { get_resource: db1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_db1_name}
-# wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
-
- db1_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- db1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: db1_OAM_direct_ips}}] \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/heatInvalidFormat.yaml b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/heatInvalidFormat.yaml
deleted file mode 100644
index b70d5a4b0a..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/heatInvalidFormat.yaml
+++ /dev/null
@@ -1,9 +0,0 @@
-heat_template_version: 2013-05-23
-
-parameters:
-
- FE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/heat_mini.yaml b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/heat_mini.yaml
deleted file mode 100644
index a545569129..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/heat_mini.yaml
+++ /dev/null
@@ -1,13 +0,0 @@
-heat_template_version: 2013-05-23
-
-parameters:
- vnf_name:
- type: string
- description: Unique name for this VNF instance
- default: This_is_the_SCP_name
-
-resources:
- FE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"] \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/invalidJson.json b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/invalidJson.json
deleted file mode 100644
index 48a3e89deb..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/invalidJson.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "glossary": {
- "title": "example glossary",
- "GlossDiv": {
- "title": "S",
- "GlossList": {
- "GlossEntry": {
- "ID": "SGML",
- "SortAs": "SGML",
- "GlossTerm": "Standard Generalized Markup Language",
- "Acronym": "SGML",
diff --git a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/invalidYamlFormat.yaml b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/invalidYamlFormat.yaml
deleted file mode 100644
index 5c51039931..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/invalidYamlFormat.yaml
+++ /dev/null
@@ -1,787 +0,0 @@
- heat_template_version: 2013-05-23
-#################################
-#
-# Changes in v0.2:
-# - Unique availability zone for each VM
-# - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
-# - 2 DB VMs added
-# - Images corrected
-# - VM start-up order: SMP->DB->BE->FE (no error handling yet)
-# - Provisioning scripts placeholders
-#
-#################################
-
-description: ASC Template
-
-parameters:
-# availability_zone_smp0:
-# type: string
-# default: nova
-# availability_zone_smp1:
-# type: string
-# default: nova
-# availability_zone_fe0:
-# type: string
-# default: nova
-# availability_zone_fe1:
-# type: string
-# default: nova
-# availability_zone_db0:
-# type: string
-# default: nova
-# availability_zone_db1:
-# type: string
-# default: nova
-# availability_zone_be0:
-# type: string
-# default: nova
-# availability_zone_be1:
-# type: string
-# default: nova
-# availability_zone_be2:
-# type: string
-# default: nova
-# availability_zone_be3:
-# type: string
-# default: nova
-# availability_zone_be4:
-# type: string
-# default: nova
-
- vnf_name:
- type: string
- description: Unique name for this VNF instance
- default: This_is_the_SCP_name
- vnf_id:
- type: string
- description: Unique ID for this VNF instance
- default: This_is_ths_SCP_id
-
- flavor_scp_be_id:
- type: string
- description: flavor type
- default: a1.Small
- flavor_scp_fe_id:
- type: string
- description: flavor type
- default: a1.Small
- flavor_smp_id:
- type: string
- description: flavor type
- default: a1.Small
- flavor_db_id:
- type: string
- description: flavor type
- default: a1.Small
- image_scp_be_id:
- type: string
- description: Image use to boot a server
- default: asc_base_image_be
- image_scp_fe_id:
- type: string
- description: Image use to boot a server
- default: asc_base_image_fe
- image_smp_id:
- type: string
- description: Image use to boot a server
- default: asc_base_image_smp
- image_db_id:
- type: string
- description: Image use to boot a server
- default: asc_base_image_db
-
- int_vscp_fe_cluster_net_id:
- type: string
- description: LAN2 FE Cluster/KA
- int_vscp_fe_cluster_cidr:
- type: string
- description: Private Network2 Address (CIDR notation)
- int_vscp_cluster_net_id:
- type: string
- description: LAN3 Cluster
- int_vscp_cluster_cidr:
- type: string
- description: Private Network3 Address (CIDR notation)
- int_vscp_db_network_net_id:
- type: string
- description: LAN4 DB
- int_vscp_db_network_cidr:
- type: string
- description: Private Network4 Address (CIDR notation)
- SIGNET_vrf_A1_direct_net_id:
- type: string
- description: Network name for SIGTRAN_A
- SIGNET_vrf_B1_direct_net_id:
- type: string
- description: Network name for SIGTRAN_B
- Cricket_OCS_protected_net_id:
- type: string
- description: Network name for CRICKET_OCS
- OAM_direct_net_id:
- type: string
- description: Network name for OAM
- be0_Cricket_OCS_protected_ips:
- type: string
- label: be0 port 5 OAM ip address
- description: be0 port 5 OAM ip address
- be1_Cricket_OCS_protected_ips:
- type: string
- label: be1 port 5 OAM ip address
- description: be1 port 5 OAM ip address
- be2_Cricket_OCS_protected_ips:
- type: string
- label: be2 port 5 OAM ip address
- description: be2 port 5 OAM ip address
- be3_Cricket_OCS_protected_ips:
- type: string
- label: be3 port 5 OAM ip address
- description: be3 port 5 OAM ip address
- be4_Cricket_OCS_protected_ips:
- type: string
- label: be4 port 5 OAM ip address
- description: be4 port 5 OAM ip address
- be0_OAM_direct_ips:
- type: string
- label: be0 port 7 OAM ip address
- description: be0 port 7 OAM ip address
- be1_OAM_direct_ips:
- type: string
- label: be1 port 7 OAM ip address
- description: be1 port 7 OAM ip address
- be2_OAM_direct_ips:
- type: string
- label: be2 port 7 OAM ip address
- description: be2 port 7 OAM ip address
- be3_OAM_direct_ips:
- type: string
- label: be3 port 7 OAM ip address
- description: be3 port 7 OAM ip address
- be4_OAM_direct_ips:
- type: string
- label: be4 port 7 OAM ip address
- description: be4 port 7 OAM ip address
- fe0_SIGNET_vrf_A1_direct_ips:
- type: string
- label: fe0 port 0 SIGTRAN ip address
- description: fe0 port 0 SIGTRAN ip address
- fe0_OAM_direct_ips:
- type: string
- label: fe0 port 7 OAM ip address
- description: fe0 port 7 OAM ip address
- fe1_SIGNET_vrf_B1_direct_ips:
- type: string
- label: fe1 port 1 SIGTRAN ip address
- description: fe1 port 1 SIGTRAN ip address
- fe1_OAM_direct_ips:
- type: string
- label: fe1 port 7 OAM ip address
- description: fe1 port 7 OAM ip address
- smp0_OAM_direct_ips:
- type: string
- label: smp0 port 7 OAM ip address
- description: smp0 port 7 OAM ip address
- smp1_OAM_direct_ips:
- type: string
- label: smp1 port 7 OAM ip address
- description: smp1 port 7 OAM ip address
- db0_OAM_direct_ips:
- type: string
- label: db0 port 7 OAM ip address
- description: smp0 port 7 OAM ip address
- db1_OAM_direct_ips:
- type: string
- label: smp1 port 7 OAM ip address
- description: db1 port 7 OAM ip address
- vm_scp_be0_name:
- type: string
- default: vSCP_BE0
- description: name of VM
- vm_scp_be1_name:
- type: string
- default: vSCP_BE1
- description: name of VM
- vm_scp_be2_name:
- type: string
- default: vSCP_BE2
- description: name of VM
- vm_scp_be3_name:
- type: string
- default: vSCP_BE3
- description: name of VM
- vm_scp_be4_name:
- type: string
- default: vSCP_BE4
- description: name of VM
- vm_scp_fe0_name:
- type: string
- default: vSCP_FE0
- description: name of VM
- vm_scp_fe1_name:
- type: string
- default: vSCP_FE1
- description: name of VM
- vm_smp0_name:
- type: string
- default: vSMP0
- description: name of VM
- vm_smp1_name:
- type: string
- default: vSMP1
- description: name of VM
- vm_db0_name:
- type: string
- default: vDB0
- description: name of VM
- vm_db1_name:
- type: string
- default: vDB1
- description: name of VM
-
-resources:
-# scp_be_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_be_wait_handle }
-# count: 5
-# timeout: 300
-# scp_be_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# scp_fe_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_fe_wait_handle }
-# count: 2
-# timeout: 300
-# scp_fe_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# smp_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: smp_wait_handle }
-# count: 2
-# timeout: 300
-# smp_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# db_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: db_wait_handle }
-# count: 2
-# timeout: 300
-# db_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-
- FE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- BE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- SMP_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- DB_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
-
- FE_Clustering_KA:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_fe_cluster_net_id }
-
- FE_Clustering_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: FE_Clustering_KA }
- cidr: { get_param: int_vscp_fe_cluster_cidr }
-
- Clustering_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_cluster_net_id }
-
- Clustering_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: Clustering_Network }
- cidr: { get_param: int_vscp_cluster_cidr }
-
- DB_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_db_network_net_id }
-
- DB_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: DB_Network }
- cidr: { get_param: int_vscp_db_network_cidr }
-
- server_scp_be0:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be0_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be0 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be0_port_3 }
- - port: { get_resource: be0_port_4 }
- - port: { get_resource: be0_port_5 }
- - port: { get_resource: be0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be0_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be0_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be0_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be0_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be0_Cricket_OCS_protected_ips}}]
-
- be0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be0_OAM_direct_ips}}]
-
- server_scp_be1:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be1_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be1 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be1_port_3 }
- - port: { get_resource: be1_port_4 }
- - port: { get_resource: be1_port_5 }
- - port: { get_resource: be1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be1_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be1_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be1_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be1_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be1_Cricket_OCS_protected_ips}}]
-
- be1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be1_OAM_direct_ips}}]
-
- server_scp_be2:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be2_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be2 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be2_port_3 }
- - port: { get_resource: be2_port_4 }
- - port: { get_resource: be2_port_5 }
- - port: { get_resource: be2_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be2_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be2_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be2_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be2_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be2_Cricket_OCS_protected_ips}}]
-
- be2_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be2_OAM_direct_ips}}]
-
- server_scp_be3:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be3_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be3 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be3_port_3 }
- - port: { get_resource: be3_port_4 }
- - port: { get_resource: be3_port_5 }
- - port: { get_resource: be3_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be3_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be3_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be3_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be3_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be3_Cricket_OCS_protected_ips}}]
-
- be3_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be3_OAM_direct_ips}}]
-
- server_scp_be4:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be4_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be4 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be4_port_3 }
- - port: { get_resource: be4_port_4 }
- - port: { get_resource: be4_port_5 }
- - port: { get_resource: be4_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be4_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be4_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be4_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be4_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be4_Cricket_OCS_protected_ips}}]
-
- be4_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be4_OAM_direct_ips}}]
-
- server_scp_fe0:
- type: OS::Nova::Server
-# depends on: scp_be_wait_condition
- properties:
- name: { get_param: vm_scp_fe0_name }
- image: { get_param: image_scp_fe_id }
-# availability_zone: { get_param: availability_zone_fe0 }
- flavor: { get_param: flavor_scp_fe_id }
- scheduler_hints: { group: { get_resource: FE_Affinity } }
- networks:
- - port: { get_resource: fe0_port_0 }
- - port: { get_resource: fe0_port_2 }
- - port: { get_resource: fe0_port_3 }
- - port: { get_resource: fe0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_fe0_name}
-# wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
-
- fe0_port_0:
- type: OS::Neutron::Port
- properties:
- network: { get_param: SIGNET_vrf_A1_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe0_SIGNET_vrf_A1_direct_ips}}]
-
- fe0_port_2:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: FE_Clustering_KA }
-
- fe0_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- fe0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe0_OAM_direct_ips}}]
-
- server_scp_fe1:
- type: OS::Nova::Server
-# depends on: scp_be_wait_condition
- properties:
- name: { get_param: vm_scp_fe1_name }
- image: { get_param: image_scp_fe_id }
-# availability_zone: { get_param: availability_zone_fe1 }
- flavor: { get_param: flavor_scp_fe_id }
- scheduler_hints: { group: { get_resource: FE_Affinity } }
- networks:
- - port: { get_resource: fe1_port_1 }
- - port: { get_resource: fe1_port_2 }
- - port: { get_resource: fe1_port_3 }
- - port: { get_resource: fe1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_fe1_name}
-# wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
-
- fe1_port_1:
- type: OS::Neutron::Port
- properties:
- network: { get_param: SIGNET_vrf_B1_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe1_SIGNET_vrf_B1_direct_ips}}]
-
- fe1_port_2:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: FE_Clustering_KA }
-
- fe1_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- fe1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe1_OAM_direct_ips}}]
-
- server_smp0:
- type: OS::Nova::Server
- properties:
- name: { get_param: vm_smp0_name }
- image: { get_param: image_smp_id }
-# availability_zone: { get_param: availability_zone_smp0 }
- flavor: { get_param: flavor_smp_id }
- scheduler_hints: { group: { get_resource: SMP_Affinity } }
- networks:
- - port: { get_resource: smp0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_smp0_name}
-# wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
-
- smp0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: smp0_OAM_direct_ips}}]
-
- server_smp1:
- type: OS::Nova::Server
- properties:
- name: { get_param: vm_smp1_name }
- image: { get_param: image_smp_id }
-# availability_zone: { get_param: availability_zone_smp1 }
- flavor: { get_param: flavor_smp_id }
- scheduler_hints: { group: { get_resource: SMP_Affinity } }
- networks:
- - port: { get_resource: smp1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_smp1_name}
-# wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
-
- smp1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: smp1_OAM_direct_ips}}]
-
- server_db0:
- type: OS::Nova::Server
-# depends_on: smp_wait_condition
- properties:
- name: { get_param: vm_db0_name }
- image: { get_param: image_db_id }
-# availability_zone: { get_param: availability_zone_db0 }
- flavor: { get_param: flavor_db_id }
- scheduler_hints: { group: { get_resource: DB_Affinity } }
- networks:
- - port: { get_resource: db0_port_4 }
- - port: { get_resource: db0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_db0_name}
-# wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
-
- db0_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- db0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: db0_OAM_direct_ips}}]
-
- server_db1:
- type: OS::Nova::Server
-# depends_on: smp_wait_condition
- properties:
- name: { get_param: vm_db1_name }
- image: { get_param: image_db_id }
-# availability_zone: { get_param: availability_zone_db1 }
- flavor: { get_param: flavor_db_id }
- scheduler_hints: { group: { get_resource: DB_Affinity } }
- networks:
- - port: { get_resource: db1_port_4 }
- - port: { get_resource: db1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_db1_name}
-# wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
-
- db1_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- db1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: db1_OAM_direct_ips}}] \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/invalidYangXml.xml b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/invalidYangXml.xml
deleted file mode 100644
index 8978e0d5ed..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/invalidYangXml.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
-
- <sports xmlns="http://example.com/example-sports">
- <person>
- <name>Lionel Andr�s Messi</name>
- <birthday>1987-06-24T00:00:00-00:00</birthday>
- </person>
- <person>
- <name>Cristiano Ronaldo</name>
- <birthday>1985-02-05T00:00:00-00:00</birthday>
- </person>
- <team>
- <name>FC Barcelona</name>
- <player>
- <name>Lionel Andr�s Messi</name>
- <season>Champions League 2014/2015</season>
- <number>10</number>
- <scores>43</scores>
- </player>
- </team>
- <team>
- <name>Real Madrid</name>
- <player>
- <name>Cristiano Ronaldo</name>
- <season>Champions League 2014/2015</season>
- <number>7</number>
- <scores>48</scores>
- </player>
- </team>
- </sports>
-
-
-
-</data>
-</data> \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/jsonArtifact.json b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/jsonArtifact.json
deleted file mode 100644
index d5ca56d195..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/jsonArtifact.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "glossary": {
- "title": "example glossary",
- "GlossDiv": {
- "title": "S",
- "GlossList": {
- "GlossEntry": {
- "ID": "SGML",
- "SortAs": "SGML",
- "GlossTerm": "Standard Generalized Markup Language",
- "Acronym": "SGML",
- "Abbrev": "ISO 8879:1986",
- "GlossDef": {
- "para": "A meta-markup language, used to create markup languages such as DocBook.",
- "GlossSeeAlso": ["GML", "XML"]
- },
- "GlossSee": "markup"
- }
- }
- }
- }
-} \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/other.txt b/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/other.txt
deleted file mode 100644
index 5f8f77ca2c..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/HeatDeploymentArtifacts/other.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-cmd1
-cmd2
-cmd3 \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/bluePrintSampleArtifact.xml b/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/bluePrintSampleArtifact.xml
deleted file mode 100644
index 10c46b7269..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/bluePrintSampleArtifact.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<test>
- dfsfsdfsdf
-</test> \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/docSampleArtifact.docx b/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/docSampleArtifact.docx
deleted file mode 100644
index c281f532f8..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/docSampleArtifact.docx
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/emfSampleArtifact.emf b/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/emfSampleArtifact.emf
deleted file mode 100644
index 9c478f6ce1..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/emfSampleArtifact.emf
+++ /dev/null
@@ -1,2 +0,0 @@
-This is sample EMF file
-We currently not checking the file content. \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/emfSampleArtifact.xml b/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/emfSampleArtifact.xml
deleted file mode 100644
index 10c46b7269..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/emfSampleArtifact.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<test>
- dfsfsdfsdf
-</test> \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/eventSampleArtifact.xml b/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/eventSampleArtifact.xml
deleted file mode 100644
index 10c46b7269..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/eventSampleArtifact.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<test>
- dfsfsdfsdf
-</test> \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/jsonSampleArtifact.json b/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/jsonSampleArtifact.json
deleted file mode 100644
index b749a9e89c..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/jsonSampleArtifact.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "test": "This is test"
-}
diff --git a/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/toscaSampleArtifact.yml b/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/toscaSampleArtifact.yml
deleted file mode 100644
index 10ccf71d51..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/ResourceInstanceArtifacts/toscaSampleArtifact.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-
-node_types:
- org.openecomp.resource.cp.CP:
- derived_from: org.openecomp.resource.cp.root \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/addHeatArtifactToServiceAndSertify/asc_heat 0 2.yaml b/test-apis-ci/src/test/resources/CI/tests/addHeatArtifactToServiceAndSertify/asc_heat 0 2.yaml
deleted file mode 100644
index 6835485ca1..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/addHeatArtifactToServiceAndSertify/asc_heat 0 2.yaml
+++ /dev/null
@@ -1,787 +0,0 @@
-heat_template_version: 2013-05-23
-#################################
-#
-# Changes in v0.2:
-# - Unique availability zone for each VM
-# - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
-# - 2 DB VMs added
-# - Images corrected
-# - VM start-up order: SMP->DB->BE->FE (no error handling yet)
-# - Provisioning scripts placeholders
-#
-#################################
-
-description: ASC Template
-
-parameters:
-# availability_zone_smp0:
-# type: string
-# default: nova
-# availability_zone_smp1:
-# type: string
-# default: nova
-# availability_zone_fe0:
-# type: string
-# default: nova
-# availability_zone_fe1:
-# type: string
-# default: nova
-# availability_zone_db0:
-# type: string
-# default: nova
-# availability_zone_db1:
-# type: string
-# default: nova
-# availability_zone_be0:
-# type: string
-# default: nova
-# availability_zone_be1:
-# type: string
-# default: nova
-# availability_zone_be2:
-# type: string
-# default: nova
-# availability_zone_be3:
-# type: string
-# default: nova
-# availability_zone_be4:
-# type: string
-# default: nova
-
- vnf_name:
- type: string
- description: Unique name for this VNF instance
- default: This_is_the_SCP_name
- vnf_id:
- type: string
- description: Unique ID for this VNF instance
- default: This_is_ths_SCP_id
-
- flavor_scp_be_id:
- type: string
- description: flavor type
- default: a1.Small
- flavor_scp_fe_id:
- type: string
- description: flavor type
- default: a1.Small
- flavor_smp_id:
- type: string
- description: flavor type
- default: a1.Small
- flavor_db_id:
- type: string
- description: flavor type
- default: a1.Small
- image_scp_be_id:
- type: string
- description: Image use to boot a server
- default: asc_base_image_be
- image_scp_fe_id:
- type: string
- description: Image use to boot a server
- default: asc_base_image_fe
- image_smp_id:
- type: string
- description: Image use to boot a server
- default: asc_base_image_smp
- image_db_id:
- type: string
- description: Image use to boot a server
- default: asc_base_image_db
-
- int_vscp_fe_cluster_net_id:
- type: string
- description: LAN2 FE Cluster/KA
- int_vscp_fe_cluster_cidr:
- type: string
- description: Private Network2 Address (CIDR notation)
- int_vscp_cluster_net_id:
- type: string
- description: LAN3 Cluster
- int_vscp_cluster_cidr:
- type: string
- description: Private Network3 Address (CIDR notation)
- int_vscp_db_network_net_id:
- type: string
- description: LAN4 DB
- int_vscp_db_network_cidr:
- type: string
- description: Private Network4 Address (CIDR notation)
- SIGNET_vrf_A1_direct_net_id:
- type: string
- description: Network name for SIGTRAN_A
- SIGNET_vrf_B1_direct_net_id:
- type: string
- description: Network name for SIGTRAN_B
- Cricket_OCS_protected_net_id:
- type: string
- description: Network name for CRICKET_OCS
- OAM_direct_net_id:
- type: string
- description: Network name for OAM
- be0_Cricket_OCS_protected_ips:
- type: string
- label: be0 port 5 OAM ip address
- description: be0 port 5 OAM ip address
- be1_Cricket_OCS_protected_ips:
- type: string
- label: be1 port 5 OAM ip address
- description: be1 port 5 OAM ip address
- be2_Cricket_OCS_protected_ips:
- type: string
- label: be2 port 5 OAM ip address
- description: be2 port 5 OAM ip address
- be3_Cricket_OCS_protected_ips:
- type: string
- label: be3 port 5 OAM ip address
- description: be3 port 5 OAM ip address
- be4_Cricket_OCS_protected_ips:
- type: string
- label: be4 port 5 OAM ip address
- description: be4 port 5 OAM ip address
- be0_OAM_direct_ips:
- type: string
- label: be0 port 7 OAM ip address
- description: be0 port 7 OAM ip address
- be1_OAM_direct_ips:
- type: string
- label: be1 port 7 OAM ip address
- description: be1 port 7 OAM ip address
- be2_OAM_direct_ips:
- type: string
- label: be2 port 7 OAM ip address
- description: be2 port 7 OAM ip address
- be3_OAM_direct_ips:
- type: string
- label: be3 port 7 OAM ip address
- description: be3 port 7 OAM ip address
- be4_OAM_direct_ips:
- type: string
- label: be4 port 7 OAM ip address
- description: be4 port 7 OAM ip address
- fe0_SIGNET_vrf_A1_direct_ips:
- type: string
- label: fe0 port 0 SIGTRAN ip address
- description: fe0 port 0 SIGTRAN ip address
- fe0_OAM_direct_ips:
- type: string
- label: fe0 port 7 OAM ip address
- description: fe0 port 7 OAM ip address
- fe1_SIGNET_vrf_B1_direct_ips:
- type: string
- label: fe1 port 1 SIGTRAN ip address
- description: fe1 port 1 SIGTRAN ip address
- fe1_OAM_direct_ips:
- type: string
- label: fe1 port 7 OAM ip address
- description: fe1 port 7 OAM ip address
- smp0_OAM_direct_ips:
- type: string
- label: smp0 port 7 OAM ip address
- description: smp0 port 7 OAM ip address
- smp1_OAM_direct_ips:
- type: string
- label: smp1 port 7 OAM ip address
- description: smp1 port 7 OAM ip address
- db0_OAM_direct_ips:
- type: string
- label: db0 port 7 OAM ip address
- description: smp0 port 7 OAM ip address
- db1_OAM_direct_ips:
- type: string
- label: smp1 port 7 OAM ip address
- description: db1 port 7 OAM ip address
- vm_scp_be0_name:
- type: string
- default: vSCP_BE0
- description: name of VM
- vm_scp_be1_name:
- type: string
- default: vSCP_BE1
- description: name of VM
- vm_scp_be2_name:
- type: string
- default: vSCP_BE2
- description: name of VM
- vm_scp_be3_name:
- type: string
- default: vSCP_BE3
- description: name of VM
- vm_scp_be4_name:
- type: string
- default: vSCP_BE4
- description: name of VM
- vm_scp_fe0_name:
- type: string
- default: vSCP_FE0
- description: name of VM
- vm_scp_fe1_name:
- type: string
- default: vSCP_FE1
- description: name of VM
- vm_smp0_name:
- type: string
- default: vSMP0
- description: name of VM
- vm_smp1_name:
- type: string
- default: vSMP1
- description: name of VM
- vm_db0_name:
- type: string
- default: vDB0
- description: name of VM
- vm_db1_name:
- type: string
- default: vDB1
- description: name of VM
-
-resources:
-# scp_be_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_be_wait_handle }
-# count: 5
-# timeout: 300
-# scp_be_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# scp_fe_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_fe_wait_handle }
-# count: 2
-# timeout: 300
-# scp_fe_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# smp_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: smp_wait_handle }
-# count: 2
-# timeout: 300
-# smp_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# db_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: db_wait_handle }
-# count: 2
-# timeout: 300
-# db_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-
- FE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- BE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- SMP_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- DB_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
-
- FE_Clustering_KA:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_fe_cluster_net_id }
-
- FE_Clustering_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: FE_Clustering_KA }
- cidr: { get_param: int_vscp_fe_cluster_cidr }
-
- Clustering_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_cluster_net_id }
-
- Clustering_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: Clustering_Network }
- cidr: { get_param: int_vscp_cluster_cidr }
-
- DB_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_db_network_net_id }
-
- DB_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: DB_Network }
- cidr: { get_param: int_vscp_db_network_cidr }
-
- server_scp_be0:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be0_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be0 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be0_port_3 }
- - port: { get_resource: be0_port_4 }
- - port: { get_resource: be0_port_5 }
- - port: { get_resource: be0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be0_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be0_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be0_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be0_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be0_Cricket_OCS_protected_ips}}]
-
- be0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be0_OAM_direct_ips}}]
-
- server_scp_be1:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be1_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be1 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be1_port_3 }
- - port: { get_resource: be1_port_4 }
- - port: { get_resource: be1_port_5 }
- - port: { get_resource: be1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be1_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be1_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be1_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be1_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be1_Cricket_OCS_protected_ips}}]
-
- be1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be1_OAM_direct_ips}}]
-
- server_scp_be2:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be2_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be2 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be2_port_3 }
- - port: { get_resource: be2_port_4 }
- - port: { get_resource: be2_port_5 }
- - port: { get_resource: be2_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be2_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be2_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be2_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be2_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be2_Cricket_OCS_protected_ips}}]
-
- be2_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be2_OAM_direct_ips}}]
-
- server_scp_be3:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be3_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be3 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be3_port_3 }
- - port: { get_resource: be3_port_4 }
- - port: { get_resource: be3_port_5 }
- - port: { get_resource: be3_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be3_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be3_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be3_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be3_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be3_Cricket_OCS_protected_ips}}]
-
- be3_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be3_OAM_direct_ips}}]
-
- server_scp_be4:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be4_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be4 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be4_port_3 }
- - port: { get_resource: be4_port_4 }
- - port: { get_resource: be4_port_5 }
- - port: { get_resource: be4_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be4_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be4_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be4_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be4_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be4_Cricket_OCS_protected_ips}}]
-
- be4_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be4_OAM_direct_ips}}]
-
- server_scp_fe0:
- type: OS::Nova::Server
-# depends on: scp_be_wait_condition
- properties:
- name: { get_param: vm_scp_fe0_name }
- image: { get_param: image_scp_fe_id }
-# availability_zone: { get_param: availability_zone_fe0 }
- flavor: { get_param: flavor_scp_fe_id }
- scheduler_hints: { group: { get_resource: FE_Affinity } }
- networks:
- - port: { get_resource: fe0_port_0 }
- - port: { get_resource: fe0_port_2 }
- - port: { get_resource: fe0_port_3 }
- - port: { get_resource: fe0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_fe0_name}
-# wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
-
- fe0_port_0:
- type: OS::Neutron::Port
- properties:
- network: { get_param: SIGNET_vrf_A1_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe0_SIGNET_vrf_A1_direct_ips}}]
-
- fe0_port_2:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: FE_Clustering_KA }
-
- fe0_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- fe0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe0_OAM_direct_ips}}]
-
- server_scp_fe1:
- type: OS::Nova::Server
-# depends on: scp_be_wait_condition
- properties:
- name: { get_param: vm_scp_fe1_name }
- image: { get_param: image_scp_fe_id }
-# availability_zone: { get_param: availability_zone_fe1 }
- flavor: { get_param: flavor_scp_fe_id }
- scheduler_hints: { group: { get_resource: FE_Affinity } }
- networks:
- - port: { get_resource: fe1_port_1 }
- - port: { get_resource: fe1_port_2 }
- - port: { get_resource: fe1_port_3 }
- - port: { get_resource: fe1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_fe1_name}
-# wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
-
- fe1_port_1:
- type: OS::Neutron::Port
- properties:
- network: { get_param: SIGNET_vrf_B1_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe1_SIGNET_vrf_B1_direct_ips}}]
-
- fe1_port_2:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: FE_Clustering_KA }
-
- fe1_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- fe1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe1_OAM_direct_ips}}]
-
- server_smp0:
- type: OS::Nova::Server
- properties:
- name: { get_param: vm_smp0_name }
- image: { get_param: image_smp_id }
-# availability_zone: { get_param: availability_zone_smp0 }
- flavor: { get_param: flavor_smp_id }
- scheduler_hints: { group: { get_resource: SMP_Affinity } }
- networks:
- - port: { get_resource: smp0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_smp0_name}
-# wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
-
- smp0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: smp0_OAM_direct_ips}}]
-
- server_smp1:
- type: OS::Nova::Server
- properties:
- name: { get_param: vm_smp1_name }
- image: { get_param: image_smp_id }
-# availability_zone: { get_param: availability_zone_smp1 }
- flavor: { get_param: flavor_smp_id }
- scheduler_hints: { group: { get_resource: SMP_Affinity } }
- networks:
- - port: { get_resource: smp1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_smp1_name}
-# wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
-
- smp1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: smp1_OAM_direct_ips}}]
-
- server_db0:
- type: OS::Nova::Server
-# depends_on: smp_wait_condition
- properties:
- name: { get_param: vm_db0_name }
- image: { get_param: image_db_id }
-# availability_zone: { get_param: availability_zone_db0 }
- flavor: { get_param: flavor_db_id }
- scheduler_hints: { group: { get_resource: DB_Affinity } }
- networks:
- - port: { get_resource: db0_port_4 }
- - port: { get_resource: db0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_db0_name}
-# wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
-
- db0_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- db0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: db0_OAM_direct_ips}}]
-
- server_db1:
- type: OS::Nova::Server
-# depends_on: smp_wait_condition
- properties:
- name: { get_param: vm_db1_name }
- image: { get_param: image_db_id }
-# availability_zone: { get_param: availability_zone_db1 }
- flavor: { get_param: flavor_db_id }
- scheduler_hints: { group: { get_resource: DB_Affinity } }
- networks:
- - port: { get_resource: db1_port_4 }
- - port: { get_resource: db1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_db1_name}
-# wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
-
- db1_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- db1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: db1_OAM_direct_ips}}] \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/downloadResourceArtifactSuccess/org.openstack.Rally.zip b/test-apis-ci/src/test/resources/CI/tests/downloadResourceArtifactSuccess/org.openstack.Rally.zip
deleted file mode 100644
index 0951d5cef8..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/downloadResourceArtifactSuccess/org.openstack.Rally.zip
+++ /dev/null
Binary files differ
diff --git a/test-apis-ci/src/test/resources/CI/tests/heatArtifactParameters/heatWithParamsMissingDefault.yaml b/test-apis-ci/src/test/resources/CI/tests/heatArtifactParameters/heatWithParamsMissingDefault.yaml
deleted file mode 100644
index 6aad589bdb..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/heatArtifactParameters/heatWithParamsMissingDefault.yaml
+++ /dev/null
@@ -1,603 +0,0 @@
-heat_template_version: 2013-05-23
-#################################
-#
-# Changes in v0.2:
-# - Unique availability zone for each VM
-# - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
-# - 2 DB VMs added
-# - Images corrected
-# - VM start-up order: SMP->DB->BE->FE (no error handling yet)
-# - Provisioning scripts placeholders
-#
-#################################
-
-description: ASC Template
-
-parameters:
-# availability_zone_smp0:
-# type: string
-# default: nova
-# availability_zone_smp1:
-# type: string
-# default: nova
-# availability_zone_fe0:
-# type: string
-# default: nova
-# availability_zone_fe1:
-# type: string
-# default: nova
-# availability_zone_db0:
-# type: string
-# default: nova
-# availability_zone_db1:
-# type: string
-# default: nova
-# availability_zone_be0:
-# type: string
-# default: nova
-# availability_zone_be1:
-# type: string
-# default: nova
-# availability_zone_be2:
-# type: string
-# default: nova
-# availability_zone_be3:
-# type: string
-# default: nova
-# availability_zone_be4:
-# type: string
-# default: nova
-
- vnf_missing_default:
- type: string
- description: Unique name for this VNF instance
- label: be4 port 5 OAM ip address
-
-resources:
-# scp_be_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_be_wait_handle }
-# count: 5
-# timeout: 300
-# scp_be_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# scp_fe_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_fe_wait_handle }
-# count: 2
-# timeout: 300
-# scp_fe_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# smp_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: smp_wait_handle }
-# count: 2
-# timeout: 300
-# smp_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# db_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: db_wait_handle }
-# count: 2
-# timeout: 300
-# db_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-
- FE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- BE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- SMP_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- DB_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
-
- FE_Clustering_KA:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_fe_cluster_net_id }
-
- FE_Clustering_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: FE_Clustering_KA }
- cidr: { get_param: int_vscp_fe_cluster_cidr }
-
- Clustering_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_cluster_net_id }
-
- Clustering_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: Clustering_Network }
- cidr: { get_param: int_vscp_cluster_cidr }
-
- DB_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_db_network_net_id }
-
- DB_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: DB_Network }
- cidr: { get_param: int_vscp_db_network_cidr }
-
- server_scp_be0:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be0_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be0 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be0_port_3 }
- - port: { get_resource: be0_port_4 }
- - port: { get_resource: be0_port_5 }
- - port: { get_resource: be0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be0_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be0_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be0_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be0_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be0_Cricket_OCS_protected_ips}}]
-
- be0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be0_OAM_direct_ips}}]
-
- server_scp_be1:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be1_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be1 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be1_port_3 }
- - port: { get_resource: be1_port_4 }
- - port: { get_resource: be1_port_5 }
- - port: { get_resource: be1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be1_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be1_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be1_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be1_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be1_Cricket_OCS_protected_ips}}]
-
- be1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be1_OAM_direct_ips}}]
-
- server_scp_be2:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be2_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be2 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be2_port_3 }
- - port: { get_resource: be2_port_4 }
- - port: { get_resource: be2_port_5 }
- - port: { get_resource: be2_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be2_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be2_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be2_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be2_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be2_Cricket_OCS_protected_ips}}]
-
- be2_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be2_OAM_direct_ips}}]
-
- server_scp_be3:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be3_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be3 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be3_port_3 }
- - port: { get_resource: be3_port_4 }
- - port: { get_resource: be3_port_5 }
- - port: { get_resource: be3_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be3_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be3_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be3_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be3_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be3_Cricket_OCS_protected_ips}}]
-
- be3_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be3_OAM_direct_ips}}]
-
- server_scp_be4:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be4_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be4 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be4_port_3 }
- - port: { get_resource: be4_port_4 }
- - port: { get_resource: be4_port_5 }
- - port: { get_resource: be4_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be4_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be4_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be4_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be4_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be4_Cricket_OCS_protected_ips}}]
-
- be4_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be4_OAM_direct_ips}}]
-
- server_scp_fe0:
- type: OS::Nova::Server
-# depends on: scp_be_wait_condition
- properties:
- name: { get_param: vm_scp_fe0_name }
- image: { get_param: image_scp_fe_id }
-# availability_zone: { get_param: availability_zone_fe0 }
- flavor: { get_param: flavor_scp_fe_id }
- scheduler_hints: { group: { get_resource: FE_Affinity } }
- networks:
- - port: { get_resource: fe0_port_0 }
- - port: { get_resource: fe0_port_2 }
- - port: { get_resource: fe0_port_3 }
- - port: { get_resource: fe0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_fe0_name}
-# wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
-
- fe0_port_0:
- type: OS::Neutron::Port
- properties:
- network: { get_param: SIGNET_vrf_A1_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe0_SIGNET_vrf_A1_direct_ips}}]
-
- fe0_port_2:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: FE_Clustering_KA }
-
- fe0_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- fe0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe0_OAM_direct_ips}}]
-
- server_scp_fe1:
- type: OS::Nova::Server
-# depends on: scp_be_wait_condition
- properties:
- name: { get_param: vm_scp_fe1_name }
- image: { get_param: image_scp_fe_id }
-# availability_zone: { get_param: availability_zone_fe1 }
- flavor: { get_param: flavor_scp_fe_id }
- scheduler_hints: { group: { get_resource: FE_Affinity } }
- networks:
- - port: { get_resource: fe1_port_1 }
- - port: { get_resource: fe1_port_2 }
- - port: { get_resource: fe1_port_3 }
- - port: { get_resource: fe1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_fe1_name}
-# wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
-
- fe1_port_1:
- type: OS::Neutron::Port
- properties:
- network: { get_param: SIGNET_vrf_B1_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe1_SIGNET_vrf_B1_direct_ips}}]
-
- fe1_port_2:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: FE_Clustering_KA }
-
- fe1_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- fe1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe1_OAM_direct_ips}}]
-
- server_smp0:
- type: OS::Nova::Server
- properties:
- name: { get_param: vm_smp0_name }
- image: { get_param: image_smp_id }
-# availability_zone: { get_param: availability_zone_smp0 }
- flavor: { get_param: flavor_smp_id }
- scheduler_hints: { group: { get_resource: SMP_Affinity } }
- networks:
- - port: { get_resource: smp0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_smp0_name}
-# wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
-
- smp0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: smp0_OAM_direct_ips}}]
-
- server_smp1:
- type: OS::Nova::Server
- properties:
- name: { get_param: vm_smp1_name }
- image: { get_param: image_smp_id }
-# availability_zone: { get_param: availability_zone_smp1 }
- flavor: { get_param: flavor_smp_id }
- scheduler_hints: { group: { get_resource: SMP_Affinity } }
- networks:
- - port: { get_resource: smp1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_smp1_name}
-# wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
-
- smp1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: smp1_OAM_direct_ips}}]
-
- server_db0:
- type: OS::Nova::Server
-# depends_on: smp_wait_condition
- properties:
- name: { get_param: vm_db0_name }
- image: { get_param: image_db_id }
-# availability_zone: { get_param: availability_zone_db0 }
- flavor: { get_param: flavor_db_id }
- scheduler_hints: { group: { get_resource: DB_Affinity } }
- networks:
- - port: { get_resource: db0_port_4 }
- - port: { get_resource: db0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_db0_name}
-# wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
-
- db0_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- db0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: db0_OAM_direct_ips}}]
-
- server_db1:
- type: OS::Nova::Server
-# depends_on: smp_wait_condition
- properties:
- name: { get_param: vm_db1_name }
- image: { get_param: image_db_id }
-# availability_zone: { get_param: availability_zone_db1 }
- flavor: { get_param: flavor_db_id }
- scheduler_hints: { group: { get_resource: DB_Affinity } }
- networks:
- - port: { get_resource: db1_port_4 }
- - port: { get_resource: db1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_db1_name}
-# wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
-
- db1_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- db1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: db1_OAM_direct_ips}}] \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/heatArtifactParameters/heatWithParamsMissingDesc.yaml b/test-apis-ci/src/test/resources/CI/tests/heatArtifactParameters/heatWithParamsMissingDesc.yaml
deleted file mode 100644
index d51a20d77f..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/heatArtifactParameters/heatWithParamsMissingDesc.yaml
+++ /dev/null
@@ -1,603 +0,0 @@
-heat_template_version: 2013-05-23
-#################################
-#
-# Changes in v0.2:
-# - Unique availability zone for each VM
-# - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
-# - 2 DB VMs added
-# - Images corrected
-# - VM start-up order: SMP->DB->BE->FE (no error handling yet)
-# - Provisioning scripts placeholders
-#
-#################################
-
-description: ASC Template
-
-parameters:
-# availability_zone_smp0:
-# type: string
-# default: nova
-# availability_zone_smp1:
-# type: string
-# default: nova
-# availability_zone_fe0:
-# type: string
-# default: nova
-# availability_zone_fe1:
-# type: string
-# default: nova
-# availability_zone_db0:
-# type: string
-# default: nova
-# availability_zone_db1:
-# type: string
-# default: nova
-# availability_zone_be0:
-# type: string
-# default: nova
-# availability_zone_be1:
-# type: string
-# default: nova
-# availability_zone_be2:
-# type: string
-# default: nova
-# availability_zone_be3:
-# type: string
-# default: nova
-# availability_zone_be4:
-# type: string
-# default: nova
-
- vnf_missing_desc:
- type: string
- default: This_is_the_SCP_name
- label: be4 port 5 OAM ip address
-
-resources:
-# scp_be_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_be_wait_handle }
-# count: 5
-# timeout: 300
-# scp_be_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# scp_fe_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_fe_wait_handle }
-# count: 2
-# timeout: 300
-# scp_fe_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# smp_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: smp_wait_handle }
-# count: 2
-# timeout: 300
-# smp_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# db_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: db_wait_handle }
-# count: 2
-# timeout: 300
-# db_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-
- FE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- BE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- SMP_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- DB_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
-
- FE_Clustering_KA:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_fe_cluster_net_id }
-
- FE_Clustering_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: FE_Clustering_KA }
- cidr: { get_param: int_vscp_fe_cluster_cidr }
-
- Clustering_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_cluster_net_id }
-
- Clustering_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: Clustering_Network }
- cidr: { get_param: int_vscp_cluster_cidr }
-
- DB_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_db_network_net_id }
-
- DB_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: DB_Network }
- cidr: { get_param: int_vscp_db_network_cidr }
-
- server_scp_be0:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be0_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be0 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be0_port_3 }
- - port: { get_resource: be0_port_4 }
- - port: { get_resource: be0_port_5 }
- - port: { get_resource: be0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be0_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be0_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be0_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be0_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be0_Cricket_OCS_protected_ips}}]
-
- be0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be0_OAM_direct_ips}}]
-
- server_scp_be1:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be1_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be1 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be1_port_3 }
- - port: { get_resource: be1_port_4 }
- - port: { get_resource: be1_port_5 }
- - port: { get_resource: be1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be1_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be1_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be1_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be1_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be1_Cricket_OCS_protected_ips}}]
-
- be1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be1_OAM_direct_ips}}]
-
- server_scp_be2:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be2_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be2 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be2_port_3 }
- - port: { get_resource: be2_port_4 }
- - port: { get_resource: be2_port_5 }
- - port: { get_resource: be2_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be2_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be2_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be2_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be2_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be2_Cricket_OCS_protected_ips}}]
-
- be2_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be2_OAM_direct_ips}}]
-
- server_scp_be3:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be3_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be3 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be3_port_3 }
- - port: { get_resource: be3_port_4 }
- - port: { get_resource: be3_port_5 }
- - port: { get_resource: be3_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be3_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be3_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be3_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be3_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be3_Cricket_OCS_protected_ips}}]
-
- be3_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be3_OAM_direct_ips}}]
-
- server_scp_be4:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be4_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be4 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be4_port_3 }
- - port: { get_resource: be4_port_4 }
- - port: { get_resource: be4_port_5 }
- - port: { get_resource: be4_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be4_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be4_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be4_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be4_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be4_Cricket_OCS_protected_ips}}]
-
- be4_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be4_OAM_direct_ips}}]
-
- server_scp_fe0:
- type: OS::Nova::Server
-# depends on: scp_be_wait_condition
- properties:
- name: { get_param: vm_scp_fe0_name }
- image: { get_param: image_scp_fe_id }
-# availability_zone: { get_param: availability_zone_fe0 }
- flavor: { get_param: flavor_scp_fe_id }
- scheduler_hints: { group: { get_resource: FE_Affinity } }
- networks:
- - port: { get_resource: fe0_port_0 }
- - port: { get_resource: fe0_port_2 }
- - port: { get_resource: fe0_port_3 }
- - port: { get_resource: fe0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_fe0_name}
-# wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
-
- fe0_port_0:
- type: OS::Neutron::Port
- properties:
- network: { get_param: SIGNET_vrf_A1_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe0_SIGNET_vrf_A1_direct_ips}}]
-
- fe0_port_2:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: FE_Clustering_KA }
-
- fe0_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- fe0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe0_OAM_direct_ips}}]
-
- server_scp_fe1:
- type: OS::Nova::Server
-# depends on: scp_be_wait_condition
- properties:
- name: { get_param: vm_scp_fe1_name }
- image: { get_param: image_scp_fe_id }
-# availability_zone: { get_param: availability_zone_fe1 }
- flavor: { get_param: flavor_scp_fe_id }
- scheduler_hints: { group: { get_resource: FE_Affinity } }
- networks:
- - port: { get_resource: fe1_port_1 }
- - port: { get_resource: fe1_port_2 }
- - port: { get_resource: fe1_port_3 }
- - port: { get_resource: fe1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_fe1_name}
-# wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
-
- fe1_port_1:
- type: OS::Neutron::Port
- properties:
- network: { get_param: SIGNET_vrf_B1_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe1_SIGNET_vrf_B1_direct_ips}}]
-
- fe1_port_2:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: FE_Clustering_KA }
-
- fe1_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- fe1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe1_OAM_direct_ips}}]
-
- server_smp0:
- type: OS::Nova::Server
- properties:
- name: { get_param: vm_smp0_name }
- image: { get_param: image_smp_id }
-# availability_zone: { get_param: availability_zone_smp0 }
- flavor: { get_param: flavor_smp_id }
- scheduler_hints: { group: { get_resource: SMP_Affinity } }
- networks:
- - port: { get_resource: smp0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_smp0_name}
-# wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
-
- smp0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: smp0_OAM_direct_ips}}]
-
- server_smp1:
- type: OS::Nova::Server
- properties:
- name: { get_param: vm_smp1_name }
- image: { get_param: image_smp_id }
-# availability_zone: { get_param: availability_zone_smp1 }
- flavor: { get_param: flavor_smp_id }
- scheduler_hints: { group: { get_resource: SMP_Affinity } }
- networks:
- - port: { get_resource: smp1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_smp1_name}
-# wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
-
- smp1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: smp1_OAM_direct_ips}}]
-
- server_db0:
- type: OS::Nova::Server
-# depends_on: smp_wait_condition
- properties:
- name: { get_param: vm_db0_name }
- image: { get_param: image_db_id }
-# availability_zone: { get_param: availability_zone_db0 }
- flavor: { get_param: flavor_db_id }
- scheduler_hints: { group: { get_resource: DB_Affinity } }
- networks:
- - port: { get_resource: db0_port_4 }
- - port: { get_resource: db0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_db0_name}
-# wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
-
- db0_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- db0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: db0_OAM_direct_ips}}]
-
- server_db1:
- type: OS::Nova::Server
-# depends_on: smp_wait_condition
- properties:
- name: { get_param: vm_db1_name }
- image: { get_param: image_db_id }
-# availability_zone: { get_param: availability_zone_db1 }
- flavor: { get_param: flavor_db_id }
- scheduler_hints: { group: { get_resource: DB_Affinity } }
- networks:
- - port: { get_resource: db1_port_4 }
- - port: { get_resource: db1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_db1_name}
-# wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
-
- db1_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- db1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: db1_OAM_direct_ips}}] \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/heatArtifactParameters/heatWithParamsMissingType.yaml b/test-apis-ci/src/test/resources/CI/tests/heatArtifactParameters/heatWithParamsMissingType.yaml
deleted file mode 100644
index 29527495f7..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/heatArtifactParameters/heatWithParamsMissingType.yaml
+++ /dev/null
@@ -1,603 +0,0 @@
-heat_template_version: 2013-05-23
-#################################
-#
-# Changes in v0.2:
-# - Unique availability zone for each VM
-# - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
-# - 2 DB VMs added
-# - Images corrected
-# - VM start-up order: SMP->DB->BE->FE (no error handling yet)
-# - Provisioning scripts placeholders
-#
-#################################
-
-description: ASC Template
-
-parameters:
-# availability_zone_smp0:
-# type: string
-# default: nova
-# availability_zone_smp1:
-# type: string
-# default: nova
-# availability_zone_fe0:
-# type: string
-# default: nova
-# availability_zone_fe1:
-# type: string
-# default: nova
-# availability_zone_db0:
-# type: string
-# default: nova
-# availability_zone_db1:
-# type: string
-# default: nova
-# availability_zone_be0:
-# type: string
-# default: nova
-# availability_zone_be1:
-# type: string
-# default: nova
-# availability_zone_be2:
-# type: string
-# default: nova
-# availability_zone_be3:
-# type: string
-# default: nova
-# availability_zone_be4:
-# type: string
-# default: nova
-
- vnf_missing_desc:
- description: Unique name for this VNF instance
- default: This_is_the_SCP_name
- label: be4 port 5 OAM ip address
-
-resources:
-# scp_be_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_be_wait_handle }
-# count: 5
-# timeout: 300
-# scp_be_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# scp_fe_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_fe_wait_handle }
-# count: 2
-# timeout: 300
-# scp_fe_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# smp_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: smp_wait_handle }
-# count: 2
-# timeout: 300
-# smp_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# db_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: db_wait_handle }
-# count: 2
-# timeout: 300
-# db_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-
- FE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- BE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- SMP_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- DB_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
-
- FE_Clustering_KA:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_fe_cluster_net_id }
-
- FE_Clustering_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: FE_Clustering_KA }
- cidr: { get_param: int_vscp_fe_cluster_cidr }
-
- Clustering_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_cluster_net_id }
-
- Clustering_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: Clustering_Network }
- cidr: { get_param: int_vscp_cluster_cidr }
-
- DB_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_db_network_net_id }
-
- DB_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: DB_Network }
- cidr: { get_param: int_vscp_db_network_cidr }
-
- server_scp_be0:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be0_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be0 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be0_port_3 }
- - port: { get_resource: be0_port_4 }
- - port: { get_resource: be0_port_5 }
- - port: { get_resource: be0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be0_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be0_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be0_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be0_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be0_Cricket_OCS_protected_ips}}]
-
- be0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be0_OAM_direct_ips}}]
-
- server_scp_be1:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be1_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be1 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be1_port_3 }
- - port: { get_resource: be1_port_4 }
- - port: { get_resource: be1_port_5 }
- - port: { get_resource: be1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be1_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be1_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be1_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be1_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be1_Cricket_OCS_protected_ips}}]
-
- be1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be1_OAM_direct_ips}}]
-
- server_scp_be2:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be2_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be2 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be2_port_3 }
- - port: { get_resource: be2_port_4 }
- - port: { get_resource: be2_port_5 }
- - port: { get_resource: be2_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be2_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be2_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be2_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be2_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be2_Cricket_OCS_protected_ips}}]
-
- be2_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be2_OAM_direct_ips}}]
-
- server_scp_be3:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be3_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be3 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be3_port_3 }
- - port: { get_resource: be3_port_4 }
- - port: { get_resource: be3_port_5 }
- - port: { get_resource: be3_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be3_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be3_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be3_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be3_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be3_Cricket_OCS_protected_ips}}]
-
- be3_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be3_OAM_direct_ips}}]
-
- server_scp_be4:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be4_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be4 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be4_port_3 }
- - port: { get_resource: be4_port_4 }
- - port: { get_resource: be4_port_5 }
- - port: { get_resource: be4_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be4_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be4_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be4_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be4_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be4_Cricket_OCS_protected_ips}}]
-
- be4_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be4_OAM_direct_ips}}]
-
- server_scp_fe0:
- type: OS::Nova::Server
-# depends on: scp_be_wait_condition
- properties:
- name: { get_param: vm_scp_fe0_name }
- image: { get_param: image_scp_fe_id }
-# availability_zone: { get_param: availability_zone_fe0 }
- flavor: { get_param: flavor_scp_fe_id }
- scheduler_hints: { group: { get_resource: FE_Affinity } }
- networks:
- - port: { get_resource: fe0_port_0 }
- - port: { get_resource: fe0_port_2 }
- - port: { get_resource: fe0_port_3 }
- - port: { get_resource: fe0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_fe0_name}
-# wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
-
- fe0_port_0:
- type: OS::Neutron::Port
- properties:
- network: { get_param: SIGNET_vrf_A1_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe0_SIGNET_vrf_A1_direct_ips}}]
-
- fe0_port_2:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: FE_Clustering_KA }
-
- fe0_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- fe0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe0_OAM_direct_ips}}]
-
- server_scp_fe1:
- type: OS::Nova::Server
-# depends on: scp_be_wait_condition
- properties:
- name: { get_param: vm_scp_fe1_name }
- image: { get_param: image_scp_fe_id }
-# availability_zone: { get_param: availability_zone_fe1 }
- flavor: { get_param: flavor_scp_fe_id }
- scheduler_hints: { group: { get_resource: FE_Affinity } }
- networks:
- - port: { get_resource: fe1_port_1 }
- - port: { get_resource: fe1_port_2 }
- - port: { get_resource: fe1_port_3 }
- - port: { get_resource: fe1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_fe1_name}
-# wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
-
- fe1_port_1:
- type: OS::Neutron::Port
- properties:
- network: { get_param: SIGNET_vrf_B1_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe1_SIGNET_vrf_B1_direct_ips}}]
-
- fe1_port_2:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: FE_Clustering_KA }
-
- fe1_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- fe1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe1_OAM_direct_ips}}]
-
- server_smp0:
- type: OS::Nova::Server
- properties:
- name: { get_param: vm_smp0_name }
- image: { get_param: image_smp_id }
-# availability_zone: { get_param: availability_zone_smp0 }
- flavor: { get_param: flavor_smp_id }
- scheduler_hints: { group: { get_resource: SMP_Affinity } }
- networks:
- - port: { get_resource: smp0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_smp0_name}
-# wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
-
- smp0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: smp0_OAM_direct_ips}}]
-
- server_smp1:
- type: OS::Nova::Server
- properties:
- name: { get_param: vm_smp1_name }
- image: { get_param: image_smp_id }
-# availability_zone: { get_param: availability_zone_smp1 }
- flavor: { get_param: flavor_smp_id }
- scheduler_hints: { group: { get_resource: SMP_Affinity } }
- networks:
- - port: { get_resource: smp1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_smp1_name}
-# wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
-
- smp1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: smp1_OAM_direct_ips}}]
-
- server_db0:
- type: OS::Nova::Server
-# depends_on: smp_wait_condition
- properties:
- name: { get_param: vm_db0_name }
- image: { get_param: image_db_id }
-# availability_zone: { get_param: availability_zone_db0 }
- flavor: { get_param: flavor_db_id }
- scheduler_hints: { group: { get_resource: DB_Affinity } }
- networks:
- - port: { get_resource: db0_port_4 }
- - port: { get_resource: db0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_db0_name}
-# wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
-
- db0_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- db0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: db0_OAM_direct_ips}}]
-
- server_db1:
- type: OS::Nova::Server
-# depends_on: smp_wait_condition
- properties:
- name: { get_param: vm_db1_name }
- image: { get_param: image_db_id }
-# availability_zone: { get_param: availability_zone_db1 }
- flavor: { get_param: flavor_db_id }
- scheduler_hints: { group: { get_resource: DB_Affinity } }
- networks:
- - port: { get_resource: db1_port_4 }
- - port: { get_resource: db1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_db1_name}
-# wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
-
- db1_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- db1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: db1_OAM_direct_ips}}] \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/heatArtifactParameters/heatWithValidParams.yaml b/test-apis-ci/src/test/resources/CI/tests/heatArtifactParameters/heatWithValidParams.yaml
deleted file mode 100644
index 6835485ca1..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/heatArtifactParameters/heatWithValidParams.yaml
+++ /dev/null
@@ -1,787 +0,0 @@
-heat_template_version: 2013-05-23
-#################################
-#
-# Changes in v0.2:
-# - Unique availability zone for each VM
-# - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
-# - 2 DB VMs added
-# - Images corrected
-# - VM start-up order: SMP->DB->BE->FE (no error handling yet)
-# - Provisioning scripts placeholders
-#
-#################################
-
-description: ASC Template
-
-parameters:
-# availability_zone_smp0:
-# type: string
-# default: nova
-# availability_zone_smp1:
-# type: string
-# default: nova
-# availability_zone_fe0:
-# type: string
-# default: nova
-# availability_zone_fe1:
-# type: string
-# default: nova
-# availability_zone_db0:
-# type: string
-# default: nova
-# availability_zone_db1:
-# type: string
-# default: nova
-# availability_zone_be0:
-# type: string
-# default: nova
-# availability_zone_be1:
-# type: string
-# default: nova
-# availability_zone_be2:
-# type: string
-# default: nova
-# availability_zone_be3:
-# type: string
-# default: nova
-# availability_zone_be4:
-# type: string
-# default: nova
-
- vnf_name:
- type: string
- description: Unique name for this VNF instance
- default: This_is_the_SCP_name
- vnf_id:
- type: string
- description: Unique ID for this VNF instance
- default: This_is_ths_SCP_id
-
- flavor_scp_be_id:
- type: string
- description: flavor type
- default: a1.Small
- flavor_scp_fe_id:
- type: string
- description: flavor type
- default: a1.Small
- flavor_smp_id:
- type: string
- description: flavor type
- default: a1.Small
- flavor_db_id:
- type: string
- description: flavor type
- default: a1.Small
- image_scp_be_id:
- type: string
- description: Image use to boot a server
- default: asc_base_image_be
- image_scp_fe_id:
- type: string
- description: Image use to boot a server
- default: asc_base_image_fe
- image_smp_id:
- type: string
- description: Image use to boot a server
- default: asc_base_image_smp
- image_db_id:
- type: string
- description: Image use to boot a server
- default: asc_base_image_db
-
- int_vscp_fe_cluster_net_id:
- type: string
- description: LAN2 FE Cluster/KA
- int_vscp_fe_cluster_cidr:
- type: string
- description: Private Network2 Address (CIDR notation)
- int_vscp_cluster_net_id:
- type: string
- description: LAN3 Cluster
- int_vscp_cluster_cidr:
- type: string
- description: Private Network3 Address (CIDR notation)
- int_vscp_db_network_net_id:
- type: string
- description: LAN4 DB
- int_vscp_db_network_cidr:
- type: string
- description: Private Network4 Address (CIDR notation)
- SIGNET_vrf_A1_direct_net_id:
- type: string
- description: Network name for SIGTRAN_A
- SIGNET_vrf_B1_direct_net_id:
- type: string
- description: Network name for SIGTRAN_B
- Cricket_OCS_protected_net_id:
- type: string
- description: Network name for CRICKET_OCS
- OAM_direct_net_id:
- type: string
- description: Network name for OAM
- be0_Cricket_OCS_protected_ips:
- type: string
- label: be0 port 5 OAM ip address
- description: be0 port 5 OAM ip address
- be1_Cricket_OCS_protected_ips:
- type: string
- label: be1 port 5 OAM ip address
- description: be1 port 5 OAM ip address
- be2_Cricket_OCS_protected_ips:
- type: string
- label: be2 port 5 OAM ip address
- description: be2 port 5 OAM ip address
- be3_Cricket_OCS_protected_ips:
- type: string
- label: be3 port 5 OAM ip address
- description: be3 port 5 OAM ip address
- be4_Cricket_OCS_protected_ips:
- type: string
- label: be4 port 5 OAM ip address
- description: be4 port 5 OAM ip address
- be0_OAM_direct_ips:
- type: string
- label: be0 port 7 OAM ip address
- description: be0 port 7 OAM ip address
- be1_OAM_direct_ips:
- type: string
- label: be1 port 7 OAM ip address
- description: be1 port 7 OAM ip address
- be2_OAM_direct_ips:
- type: string
- label: be2 port 7 OAM ip address
- description: be2 port 7 OAM ip address
- be3_OAM_direct_ips:
- type: string
- label: be3 port 7 OAM ip address
- description: be3 port 7 OAM ip address
- be4_OAM_direct_ips:
- type: string
- label: be4 port 7 OAM ip address
- description: be4 port 7 OAM ip address
- fe0_SIGNET_vrf_A1_direct_ips:
- type: string
- label: fe0 port 0 SIGTRAN ip address
- description: fe0 port 0 SIGTRAN ip address
- fe0_OAM_direct_ips:
- type: string
- label: fe0 port 7 OAM ip address
- description: fe0 port 7 OAM ip address
- fe1_SIGNET_vrf_B1_direct_ips:
- type: string
- label: fe1 port 1 SIGTRAN ip address
- description: fe1 port 1 SIGTRAN ip address
- fe1_OAM_direct_ips:
- type: string
- label: fe1 port 7 OAM ip address
- description: fe1 port 7 OAM ip address
- smp0_OAM_direct_ips:
- type: string
- label: smp0 port 7 OAM ip address
- description: smp0 port 7 OAM ip address
- smp1_OAM_direct_ips:
- type: string
- label: smp1 port 7 OAM ip address
- description: smp1 port 7 OAM ip address
- db0_OAM_direct_ips:
- type: string
- label: db0 port 7 OAM ip address
- description: smp0 port 7 OAM ip address
- db1_OAM_direct_ips:
- type: string
- label: smp1 port 7 OAM ip address
- description: db1 port 7 OAM ip address
- vm_scp_be0_name:
- type: string
- default: vSCP_BE0
- description: name of VM
- vm_scp_be1_name:
- type: string
- default: vSCP_BE1
- description: name of VM
- vm_scp_be2_name:
- type: string
- default: vSCP_BE2
- description: name of VM
- vm_scp_be3_name:
- type: string
- default: vSCP_BE3
- description: name of VM
- vm_scp_be4_name:
- type: string
- default: vSCP_BE4
- description: name of VM
- vm_scp_fe0_name:
- type: string
- default: vSCP_FE0
- description: name of VM
- vm_scp_fe1_name:
- type: string
- default: vSCP_FE1
- description: name of VM
- vm_smp0_name:
- type: string
- default: vSMP0
- description: name of VM
- vm_smp1_name:
- type: string
- default: vSMP1
- description: name of VM
- vm_db0_name:
- type: string
- default: vDB0
- description: name of VM
- vm_db1_name:
- type: string
- default: vDB1
- description: name of VM
-
-resources:
-# scp_be_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_be_wait_handle }
-# count: 5
-# timeout: 300
-# scp_be_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# scp_fe_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_fe_wait_handle }
-# count: 2
-# timeout: 300
-# scp_fe_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# smp_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: smp_wait_handle }
-# count: 2
-# timeout: 300
-# smp_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# db_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: db_wait_handle }
-# count: 2
-# timeout: 300
-# db_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-
- FE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- BE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- SMP_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- DB_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
-
- FE_Clustering_KA:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_fe_cluster_net_id }
-
- FE_Clustering_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: FE_Clustering_KA }
- cidr: { get_param: int_vscp_fe_cluster_cidr }
-
- Clustering_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_cluster_net_id }
-
- Clustering_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: Clustering_Network }
- cidr: { get_param: int_vscp_cluster_cidr }
-
- DB_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_db_network_net_id }
-
- DB_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: DB_Network }
- cidr: { get_param: int_vscp_db_network_cidr }
-
- server_scp_be0:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be0_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be0 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be0_port_3 }
- - port: { get_resource: be0_port_4 }
- - port: { get_resource: be0_port_5 }
- - port: { get_resource: be0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be0_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be0_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be0_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be0_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be0_Cricket_OCS_protected_ips}}]
-
- be0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be0_OAM_direct_ips}}]
-
- server_scp_be1:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be1_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be1 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be1_port_3 }
- - port: { get_resource: be1_port_4 }
- - port: { get_resource: be1_port_5 }
- - port: { get_resource: be1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be1_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be1_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be1_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be1_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be1_Cricket_OCS_protected_ips}}]
-
- be1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be1_OAM_direct_ips}}]
-
- server_scp_be2:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be2_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be2 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be2_port_3 }
- - port: { get_resource: be2_port_4 }
- - port: { get_resource: be2_port_5 }
- - port: { get_resource: be2_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be2_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be2_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be2_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be2_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be2_Cricket_OCS_protected_ips}}]
-
- be2_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be2_OAM_direct_ips}}]
-
- server_scp_be3:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be3_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be3 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be3_port_3 }
- - port: { get_resource: be3_port_4 }
- - port: { get_resource: be3_port_5 }
- - port: { get_resource: be3_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be3_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be3_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be3_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be3_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be3_Cricket_OCS_protected_ips}}]
-
- be3_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be3_OAM_direct_ips}}]
-
- server_scp_be4:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be4_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be4 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be4_port_3 }
- - port: { get_resource: be4_port_4 }
- - port: { get_resource: be4_port_5 }
- - port: { get_resource: be4_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be4_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be4_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be4_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be4_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be4_Cricket_OCS_protected_ips}}]
-
- be4_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be4_OAM_direct_ips}}]
-
- server_scp_fe0:
- type: OS::Nova::Server
-# depends on: scp_be_wait_condition
- properties:
- name: { get_param: vm_scp_fe0_name }
- image: { get_param: image_scp_fe_id }
-# availability_zone: { get_param: availability_zone_fe0 }
- flavor: { get_param: flavor_scp_fe_id }
- scheduler_hints: { group: { get_resource: FE_Affinity } }
- networks:
- - port: { get_resource: fe0_port_0 }
- - port: { get_resource: fe0_port_2 }
- - port: { get_resource: fe0_port_3 }
- - port: { get_resource: fe0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_fe0_name}
-# wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
-
- fe0_port_0:
- type: OS::Neutron::Port
- properties:
- network: { get_param: SIGNET_vrf_A1_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe0_SIGNET_vrf_A1_direct_ips}}]
-
- fe0_port_2:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: FE_Clustering_KA }
-
- fe0_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- fe0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe0_OAM_direct_ips}}]
-
- server_scp_fe1:
- type: OS::Nova::Server
-# depends on: scp_be_wait_condition
- properties:
- name: { get_param: vm_scp_fe1_name }
- image: { get_param: image_scp_fe_id }
-# availability_zone: { get_param: availability_zone_fe1 }
- flavor: { get_param: flavor_scp_fe_id }
- scheduler_hints: { group: { get_resource: FE_Affinity } }
- networks:
- - port: { get_resource: fe1_port_1 }
- - port: { get_resource: fe1_port_2 }
- - port: { get_resource: fe1_port_3 }
- - port: { get_resource: fe1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_fe1_name}
-# wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
-
- fe1_port_1:
- type: OS::Neutron::Port
- properties:
- network: { get_param: SIGNET_vrf_B1_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe1_SIGNET_vrf_B1_direct_ips}}]
-
- fe1_port_2:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: FE_Clustering_KA }
-
- fe1_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- fe1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe1_OAM_direct_ips}}]
-
- server_smp0:
- type: OS::Nova::Server
- properties:
- name: { get_param: vm_smp0_name }
- image: { get_param: image_smp_id }
-# availability_zone: { get_param: availability_zone_smp0 }
- flavor: { get_param: flavor_smp_id }
- scheduler_hints: { group: { get_resource: SMP_Affinity } }
- networks:
- - port: { get_resource: smp0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_smp0_name}
-# wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
-
- smp0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: smp0_OAM_direct_ips}}]
-
- server_smp1:
- type: OS::Nova::Server
- properties:
- name: { get_param: vm_smp1_name }
- image: { get_param: image_smp_id }
-# availability_zone: { get_param: availability_zone_smp1 }
- flavor: { get_param: flavor_smp_id }
- scheduler_hints: { group: { get_resource: SMP_Affinity } }
- networks:
- - port: { get_resource: smp1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_smp1_name}
-# wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
-
- smp1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: smp1_OAM_direct_ips}}]
-
- server_db0:
- type: OS::Nova::Server
-# depends_on: smp_wait_condition
- properties:
- name: { get_param: vm_db0_name }
- image: { get_param: image_db_id }
-# availability_zone: { get_param: availability_zone_db0 }
- flavor: { get_param: flavor_db_id }
- scheduler_hints: { group: { get_resource: DB_Affinity } }
- networks:
- - port: { get_resource: db0_port_4 }
- - port: { get_resource: db0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_db0_name}
-# wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
-
- db0_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- db0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: db0_OAM_direct_ips}}]
-
- server_db1:
- type: OS::Nova::Server
-# depends_on: smp_wait_condition
- properties:
- name: { get_param: vm_db1_name }
- image: { get_param: image_db_id }
-# availability_zone: { get_param: availability_zone_db1 }
- flavor: { get_param: flavor_db_id }
- scheduler_hints: { group: { get_resource: DB_Affinity } }
- networks:
- - port: { get_resource: db1_port_4 }
- - port: { get_resource: db1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_db1_name}
-# wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
-
- db1_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- db1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: db1_OAM_direct_ips}}] \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/heatEnv/artifact_1.yaml b/test-apis-ci/src/test/resources/CI/tests/heatEnv/artifact_1.yaml
deleted file mode 100644
index 7d4a85c2b6..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/heatEnv/artifact_1.yaml
+++ /dev/null
@@ -1,144 +0,0 @@
-heat_template_version: 2013-05-23
-#################################
-#
-# Changes in v0.2:
-# - Unique availability zone for each VM
-# - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
-# - 2 DB VMs added
-# - Images corrected
-# - VM start-up order: SMP->DB->BE->FE (no error handling yet)
-# - Provisioning scripts placeholders
-#
-#################################
-
-description: ASC Template
-
-parameters:
- city_name:
- type: string
- description: city name
- default: Hulon
- address:
- type: string
- description: address
- default: Alonim
- home_number:
- type: number
- description: home_number
- default: 8
- private_building:
- type: boolean
- description: home_number
- default: true
-resources:
-# scp_be_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_be_wait_handle }
-# count: 5
-# timeout: 300
-# scp_be_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# scp_fe_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_fe_wait_handle }
-# count: 2
-# timeout: 300
-# scp_fe_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# smp_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: smp_wait_handle }
-# count: 2
-# timeout: 300
-# smp_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# db_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: db_wait_handle }
-# count: 2
-# timeout: 300
-# db_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-
- FE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- BE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- SMP_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- DB_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
-
- FE_Clustering_KA:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_fe_cluster_net_id }
-
- FE_Clustering_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: FE_Clustering_KA }
- cidr: { get_param: int_vscp_fe_cluster_cidr }
-
- Clustering_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_cluster_net_id }
-
- Clustering_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: Clustering_Network }
- cidr: { get_param: int_vscp_cluster_cidr }
-
- DB_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_db_network_net_id }
-
- DB_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: DB_Network }
- cidr: { get_param: int_vscp_db_network_cidr }
-
- server_scp_be0:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be0_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be0 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be0_port_3 }
- - port: { get_resource: be0_port_4 }
- - port: { get_resource: be0_port_5 }
- - port: { get_resource: be0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be0_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/heatEnv/artifact_2.yaml b/test-apis-ci/src/test/resources/CI/tests/heatEnv/artifact_2.yaml
deleted file mode 100644
index 2c404f0721..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/heatEnv/artifact_2.yaml
+++ /dev/null
@@ -1,469 +0,0 @@
-heat_template_version: 2013-05-23
-#################################
-#
-# Changes in v0.2:
-# - Unique availability zone for each VM
-# - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
-# - 2 DB VMs added
-# - Images corrected
-# - VM start-up order: SMP->DB->BE->FE (no error handling yet)
-# - Provisioning scripts placeholders
-#
-#################################
-
-description: ASC Template
-
-parameters:
-parameters:
- city_name:
- type: string
- description: city name
- default: Hulon
- address:
- type: string
- description: address
- default: Narkis
- home_number:
- type: number
- description: home_number
- default: 14
- private_building:
- type: boolean
- description: home_number
- default: true
-resources:
- be0_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be0_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be0_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be0_Cricket_OCS_protected_ips}}]
-
- be0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be0_OAM_direct_ips}}]
-
- server_scp_be1:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be1_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be1 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be1_port_3 }
- - port: { get_resource: be1_port_4 }
- - port: { get_resource: be1_port_5 }
- - port: { get_resource: be1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be1_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be1_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be1_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be1_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be1_Cricket_OCS_protected_ips}}]
-
- be1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be1_OAM_direct_ips}}]
-
- server_scp_be2:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be2_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be2 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be2_port_3 }
- - port: { get_resource: be2_port_4 }
- - port: { get_resource: be2_port_5 }
- - port: { get_resource: be2_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be2_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be2_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be2_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be2_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be2_Cricket_OCS_protected_ips}}]
-
- be2_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be2_OAM_direct_ips}}]
-
- server_scp_be3:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be3_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be3 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be3_port_3 }
- - port: { get_resource: be3_port_4 }
- - port: { get_resource: be3_port_5 }
- - port: { get_resource: be3_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be3_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be3_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be3_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be3_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be3_Cricket_OCS_protected_ips}}]
-
- be3_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be3_OAM_direct_ips}}]
-
- server_scp_be4:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be4_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be4 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be4_port_3 }
- - port: { get_resource: be4_port_4 }
- - port: { get_resource: be4_port_5 }
- - port: { get_resource: be4_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be4_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
-
- be4_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- be4_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- be4_port_5:
- type: OS::Neutron::Port
- properties:
- network: { get_param: Cricket_OCS_protected_net_id }
- fixed_ips: [{"ip_address": {get_param: be4_Cricket_OCS_protected_ips}}]
-
- be4_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: be4_OAM_direct_ips}}]
-
- server_scp_fe0:
- type: OS::Nova::Server
-# depends on: scp_be_wait_condition
- properties:
- name: { get_param: vm_scp_fe0_name }
- image: { get_param: image_scp_fe_id }
-# availability_zone: { get_param: availability_zone_fe0 }
- flavor: { get_param: flavor_scp_fe_id }
- scheduler_hints: { group: { get_resource: FE_Affinity } }
- networks:
- - port: { get_resource: fe0_port_0 }
- - port: { get_resource: fe0_port_2 }
- - port: { get_resource: fe0_port_3 }
- - port: { get_resource: fe0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_fe0_name}
-# wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
-
- fe0_port_0:
- type: OS::Neutron::Port
- properties:
- network: { get_param: SIGNET_vrf_A1_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe0_SIGNET_vrf_A1_direct_ips}}]
-
- fe0_port_2:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: FE_Clustering_KA }
-
- fe0_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- fe0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe0_OAM_direct_ips}}]
-
- server_scp_fe1:
- type: OS::Nova::Server
-# depends on: scp_be_wait_condition
- properties:
- name: { get_param: vm_scp_fe1_name }
- image: { get_param: image_scp_fe_id }
-# availability_zone: { get_param: availability_zone_fe1 }
- flavor: { get_param: flavor_scp_fe_id }
- scheduler_hints: { group: { get_resource: FE_Affinity } }
- networks:
- - port: { get_resource: fe1_port_1 }
- - port: { get_resource: fe1_port_2 }
- - port: { get_resource: fe1_port_3 }
- - port: { get_resource: fe1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_fe1_name}
-# wc_notify: { get_attr: ['scp_fe_wait_handle', 'curl_cli'] }
-
- fe1_port_1:
- type: OS::Neutron::Port
- properties:
- network: { get_param: SIGNET_vrf_B1_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe1_SIGNET_vrf_B1_direct_ips}}]
-
- fe1_port_2:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: FE_Clustering_KA }
-
- fe1_port_3:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: Clustering_Network }
-
- fe1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: fe1_OAM_direct_ips}}]
-
- server_smp0:
- type: OS::Nova::Server
- properties:
- name: { get_param: vm_smp0_name }
- image: { get_param: image_smp_id }
-# availability_zone: { get_param: availability_zone_smp0 }
- flavor: { get_param: flavor_smp_id }
- scheduler_hints: { group: { get_resource: SMP_Affinity } }
- networks:
- - port: { get_resource: smp0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_smp0_name}
-# wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
-
- smp0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: smp0_OAM_direct_ips}}]
-
- server_smp1:
- type: OS::Nova::Server
- properties:
- name: { get_param: vm_smp1_name }
- image: { get_param: image_smp_id }
-# availability_zone: { get_param: availability_zone_smp1 }
- flavor: { get_param: flavor_smp_id }
- scheduler_hints: { group: { get_resource: SMP_Affinity } }
- networks:
- - port: { get_resource: smp1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_smp1_name}
-# wc_notify: { get_attr: ['smp_wait_handle', 'curl_cli'] }
-
- smp1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: smp1_OAM_direct_ips}}]
-
- server_db0:
- type: OS::Nova::Server
-# depends_on: smp_wait_condition
- properties:
- name: { get_param: vm_db0_name }
- image: { get_param: image_db_id }
-# availability_zone: { get_param: availability_zone_db0 }
- flavor: { get_param: flavor_db_id }
- scheduler_hints: { group: { get_resource: DB_Affinity } }
- networks:
- - port: { get_resource: db0_port_4 }
- - port: { get_resource: db0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_db0_name}
-# wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
-
- db0_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- db0_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: db0_OAM_direct_ips}}]
-
- server_db1:
- type: OS::Nova::Server
-# depends_on: smp_wait_condition
- properties:
- name: { get_param: vm_db1_name }
- image: { get_param: image_db_id }
-# availability_zone: { get_param: availability_zone_db1 }
- flavor: { get_param: flavor_db_id }
- scheduler_hints: { group: { get_resource: DB_Affinity } }
- networks:
- - port: { get_resource: db1_port_4 }
- - port: { get_resource: db1_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_db1_name}
-# wc_notify: { get_attr: ['db_wait_handle', 'curl_cli'] }
-
- db1_port_4:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: DB_Network }
-
- db1_port_7:
- type: OS::Neutron::Port
- properties:
- network: { get_param: OAM_direct_net_id }
- fixed_ips: [{"ip_address": {get_param: db1_OAM_direct_ips}}] \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/heatEnv/yuli.yaml b/test-apis-ci/src/test/resources/CI/tests/heatEnv/yuli.yaml
deleted file mode 100644
index 7d4a85c2b6..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/heatEnv/yuli.yaml
+++ /dev/null
@@ -1,144 +0,0 @@
-heat_template_version: 2013-05-23
-#################################
-#
-# Changes in v0.2:
-# - Unique availability zone for each VM
-# - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
-# - 2 DB VMs added
-# - Images corrected
-# - VM start-up order: SMP->DB->BE->FE (no error handling yet)
-# - Provisioning scripts placeholders
-#
-#################################
-
-description: ASC Template
-
-parameters:
- city_name:
- type: string
- description: city name
- default: Hulon
- address:
- type: string
- description: address
- default: Alonim
- home_number:
- type: number
- description: home_number
- default: 8
- private_building:
- type: boolean
- description: home_number
- default: true
-resources:
-# scp_be_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_be_wait_handle }
-# count: 5
-# timeout: 300
-# scp_be_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# scp_fe_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_fe_wait_handle }
-# count: 2
-# timeout: 300
-# scp_fe_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# smp_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: smp_wait_handle }
-# count: 2
-# timeout: 300
-# smp_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# db_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: db_wait_handle }
-# count: 2
-# timeout: 300
-# db_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-
- FE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- BE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- SMP_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- DB_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
-
- FE_Clustering_KA:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_fe_cluster_net_id }
-
- FE_Clustering_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: FE_Clustering_KA }
- cidr: { get_param: int_vscp_fe_cluster_cidr }
-
- Clustering_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_cluster_net_id }
-
- Clustering_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: Clustering_Network }
- cidr: { get_param: int_vscp_cluster_cidr }
-
- DB_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_db_network_net_id }
-
- DB_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: DB_Network }
- cidr: { get_param: int_vscp_db_network_cidr }
-
- server_scp_be0:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be0_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be0 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be0_port_3 }
- - port: { get_resource: be0_port_4 }
- - port: { get_resource: be0_port_5 }
- - port: { get_resource: be0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be0_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/BindingAsset.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/BindingAsset.yml
deleted file mode 100644
index 5117247373..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/BindingAsset.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-
-node_types:
- org.openecomp.resource.cp:
- derived_from: tosca.nodes.Root
- properties:
- type:
- type: string
- required: false
- requirements:
- - VirtualBinding:
- capability: tosca.capabilities.network.Bindable
- relationship: tosca.relationships.network.BindsTo
- occurrences: [0, UNBOUNDED] \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CPHasNoReqCap.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CPHasNoReqCap.yml
deleted file mode 100644
index 8309df24b5..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CPHasNoReqCap.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-
-node_types:
- org.openecomp.resource.cp.CP:
- derived_from: tosca.nodes.Compute
- properties:
- type:
- type: string
- required: false \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CPHasNoReqCap_DerivedFromMyCompute1.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CPHasNoReqCap_DerivedFromMyCompute1.yml
deleted file mode 100644
index 478e742bc5..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CPHasNoReqCap_DerivedFromMyCompute1.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-
-node_types:
- org.openecomp.resource.cp.CP:
- derived_from: org.openecomp.resource.MyCompute1
- properties:
- type:
- type: string
- required: false \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CPWithAttributes.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CPWithAttributes.yml
deleted file mode 100644
index 807f7fe630..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CPWithAttributes.yml
+++ /dev/null
@@ -1,56 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-
-node_types:
- org.openecomp.resource.cp.CP: derived_from: tosca.nodes.Root
- properties:
- type:
- type: string
- required: false
- ip_address:
- type: string
- required: false
- description: Allow the user to set a static IP.
- order:
- type: integer
- required: false
- default: 0
- description: The order of the NIC on the compute instance (e.g. eth2).
- is_default:
- type: boolean
- required: false
- default: false
- description: “If is_default=true this port will be used for the default gateway route. Only one port that is associated to single compute node can set as is_default=true.”
- ip_range_start:
- type: string
- required: false
- description: “Defines the starting IP of a range to be allocated for the VFC instances that are associated with this Port.”
- ip_range_end:
- type: string
- required: false
- description: “Defines the ending IP of a range to be allocated for the compute instances that are associated with this Port.”
- is_tagged:
- type: boolean
- required: false
- default: false
- description:
- attributes:
- private_address:
- type: string
- default: "Hello"
- value: "HelloWord"
- public_address:
- default: "DefaultValuePublicAddress"
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - virtualLink:
- capability: tosca.capabilities.network.Linkable relationship: tosca.relationships.network.LinksTo
- - virtualbinding:
- capability: tosca.capabilities.network.Bindable relationship: tosca.relationships.network.BindsTo \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CaseInsensitiveCapTest_1.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CaseInsensitiveCapTest_1.yml
deleted file mode 100644
index b9e6c4f9b5..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CaseInsensitiveCapTest_1.yml
+++ /dev/null
@@ -1,34 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute1:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [0, UNBOUNDED]
- capabilities:
- host:
- type: tosca.capabilities.Container
- endpoint :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- capaBility:
- type: tosca.capabilities.OperatingSystem
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CaseInsensitiveCapTest_2.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CaseInsensitiveCapTest_2.yml
deleted file mode 100644
index 230e4fa924..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CaseInsensitiveCapTest_2.yml
+++ /dev/null
@@ -1,34 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute2:
- derived_from: org.openecomp.resource.MyCompute1
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [0, UNBOUNDED]
- capabilities:
- host:
- type: tosca.capabilities.Container
- endpoint :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- Capability:
- type: tosca.capabilities.OperatingSystem
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CaseInsensitiveReqTest_1.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CaseInsensitiveReqTest_1.yml
deleted file mode 100644
index 0d097a8f20..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CaseInsensitiveReqTest_1.yml
+++ /dev/null
@@ -1,34 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute1:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - requirEment:
- capability: tosca.capabilities.Endpoint
- relationship: tosca.relationships.AttachesTo
- occurrences: [0, UNBOUNDED]
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CaseInsensitiveReqTest_2.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CaseInsensitiveReqTest_2.yml
deleted file mode 100644
index 9cc1f2737b..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/CaseInsensitiveReqTest_2.yml
+++ /dev/null
@@ -1,34 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute2:
- derived_from: org.openecomp.resource.MyCompute1
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - Requirement:
- capability: tosca.capabilities.Endpoint
- relationship: tosca.relationships.AttachesTo
- occurrences: [0, UNBOUNDED]
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DerivedFromCPWithOwnReq.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DerivedFromCPWithOwnReq.yml
deleted file mode 100644
index 3514acfe9f..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DerivedFromCPWithOwnReq.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-
-node_types:
- org.openecomp.resource.cp.LAN:
- derived_from: org.openecomp.resource.cp.CP
- properties:
- type:
- type: string
- required: false
- requirements:
- - virtualLink:
- capability: tosca.capabilities.network.Linkable
- relationship: tosca.relationships.network.LinksTo
- occurrences: [0, UNBOUNDED] \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DerivedFromWebApplication_HasNoReqType.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DerivedFromWebApplication_HasNoReqType.yml
deleted file mode 100644
index 7fbf4ec132..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DerivedFromWebApplication_HasNoReqType.yml
+++ /dev/null
@@ -1,27 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyChildWebApplication:
- derived_from: tosca.nodes.WebApplication
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - diff:
- capability:
- relationship: tosca.relationships.AttachesTo
- occurrences: [0, UNBOUNDED]
- capabilities:
- deff:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
-
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentCapFromRoot.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentCapFromRoot.yml
deleted file mode 100644
index fe79bb3af9..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentCapFromRoot.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyAsset:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - test:
- capability: tosca.capabilities.Scalable
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [0, UNBOUNDED]
- capabilities:
- host:
- type: tosca.capabilities.Container \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentReqAndCap.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentReqAndCap.yml
deleted file mode 100644
index 798cd5b9cd..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentReqAndCap.yml
+++ /dev/null
@@ -1,34 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute1:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - DependencY:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [0, UNBOUNDED]
- capabilities:
- host:
- type: tosca.capabilities.Container
- endpoint :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- FeaTurE:
- type: tosca.capabilities.OperatingSystem \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentReqCapFromCompute1.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentReqCapFromCompute1.yml
deleted file mode 100644
index c72d0ee62a..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentReqCapFromCompute1.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute2:
- derived_from: org.openecomp.resource.MyCompute1
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - diff:
- capability: tosca.capabilities.Container
- relationship: tosca.relationships.AttachesTo
- occurrences: [0, UNBOUNDED]
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentReqCapFromCompute2.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentReqCapFromCompute2.yml
deleted file mode 100644
index 7132ca493a..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentReqCapFromCompute2.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute3:
- derived_from: org.openecomp.resource.MyCompute1
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - diff:
- capability: tosca.capabilities.Container
- relationship: tosca.relationships.AttachesTo
- occurrences: [0, UNBOUNDED]
- capabilities:
- deff:
- type: tosca.capabilities.Container
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentReqFromCompute.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentReqFromCompute.yml
deleted file mode 100644
index e9438bae3c..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/DifferentReqFromCompute.yml
+++ /dev/null
@@ -1,32 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute1:
- derived_from: tosca.nodes.Compute
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - test:
- capability: tosca.capabilities.Scalable
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [0, UNBOUNDED]
- capabilities:
- host:
- type: tosca.capabilities.Container
- endpoint :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/FatherHasNoReqCap.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/FatherHasNoReqCap.yml
deleted file mode 100644
index 039ab61939..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/FatherHasNoReqCap.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-
-node_types:
- org.openecomp.resource.cp.CP:
- derived_from: tosca.nodes.Root
- properties:
- type:
- type: string
- required: false \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure01.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure01.yml
deleted file mode 100644
index f20a9eb48f..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure01.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- my_boolean:
- type: list
- description : another description
- default:
- - false
- - true
- entry_schema:
- description: This is my property
- type: booolean
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure02.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure02.yml
deleted file mode 100644
index f1af89ca6a..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure02.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- my_property:
- type: list
- description : another description
- default:
- - false
- - truee
- entry_schema:
- description: This is my property
- type: boolean
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure03.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure03.yml
deleted file mode 100644
index 974d96ba5b..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure03.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- my_property:
- type: list
- description : another description
- default:
- - false
- - 3
- entry_schema:
- description: This is my property
- type: boolean
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure04.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure04.yml
deleted file mode 100644
index 52377e4b02..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure04.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- my_property:
- type: list
- description : another description
- default:
- - false
- - 3.56
- entry_schema:
- description: This is my property
- type: boolean
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure05.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure05.yml
deleted file mode 100644
index c66b4347f6..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure05.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- my_property:
- type: list
- description : another description
- default:
- - 10000
- - 3.56
- entry_schema:
- description: This is my property
- type: integer
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure06.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure06.yml
deleted file mode 100644
index 79b3c03cdf..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure06.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- my_property:
- type: list
- description : another description
- default:
- - 10000
- - aaaa
- entry_schema:
- description: This is my property
- type: integer
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure07.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure07.yml
deleted file mode 100644
index 5556e9ddfb..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure07.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- my_property:
- type: list
- description : another description
- default:
- - 10000
- - true
- entry_schema:
- description: This is my property
- type: integer
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure08.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure08.yml
deleted file mode 100644
index a3b21a64a3..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure08.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- my_property:
- type: list
- description : another description
- default:
- - 10.50
- - true
- entry_schema:
- description: This is my property
- type: float
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure09.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure09.yml
deleted file mode 100644
index dc28591499..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure09.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- my_property:
- type: list
- description : another description
- default:
- - 10.50
- - asdc
- entry_schema:
- description: This is my property
- type: float
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure10.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure10.yml
deleted file mode 100644
index e465448064..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure10.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- my_property:
- type: list
- description : another description
- default:
- - 10.50
- - 500
- entry_schema:
- description: This is my property
- type: float
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure11.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure11.yml
deleted file mode 100644
index a428b51974..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure11.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- my_property:
- type: list
- description : another description
- default:
- - 10.50
- - 500.0@
- entry_schema:
- description: This is my property
- type: float
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure12.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure12.yml
deleted file mode 100644
index d840253120..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure12.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- my_property:
- type: list
- description : another description
- default:
- - 10000
- - 3#
- entry_schema:
- description: This is my property
- type: integer
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure13.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure13.yml
deleted file mode 100644
index 4eb59886e4..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure13.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- my_property:
- type: list
- description : another description
- default:
- - false
- - true%
- entry_schema:
- description: This is my property
- type: boolean
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure14.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure14.yml
deleted file mode 100644
index ad263f3d00..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure14.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- my_property:
- type: list
- description : another description
- default:
- - false
- - falsee
- - true
- entry_schema:
- description: This is my property
- type: boolean
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure15.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure15.yml
deleted file mode 100644
index 93e8caa0a3..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure15.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- my_property:
- type: list
- description : another description
- default:
- - 10.5
- - 10.6x
- - 20.5
- - 30.5
- entry_schema:
- description: This is my property
- type: float
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure16.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure16.yml
deleted file mode 100644
index ed8ea4d70c..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/ListPropertyFalure16.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- my_boolean:
- type: koko
- description : another description
- default:
- - false
- - true
- entry_schema:
- description: This is my property
- type: boolean
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure01.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure01.yml
deleted file mode 100644
index c7ff0743f2..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure01.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- my_boolean:
- type: map
- description : another description
- default:
- - false
- - true
- entry_schema:
- description: This is my property
- type: booolean
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure02.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure02.yml
deleted file mode 100644
index d9abb87db8..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure02.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- my_property:
- type: map
- description : another description
- default:
- - false
- - truee
- entry_schema:
- description: This is my property
- type: boolean
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure03.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure03.yml
deleted file mode 100644
index e8f9b6eaa9..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure03.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- my_property:
- type: map
- description : another description
- default:
- - false
- - 3
- entry_schema:
- description: This is my property
- type: boolean
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure04.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure04.yml
deleted file mode 100644
index d9dc4f955b..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure04.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- my_property:
- type: map
- description : another description
- default:
- - false
- - 3.56
- entry_schema:
- description: This is my property
- type: boolean
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure05.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure05.yml
deleted file mode 100644
index aba6ff1992..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure05.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- my_property:
- type: map
- description : another description
- default:
- - 10000
- - 3.56
- entry_schema:
- description: This is my property
- type: integer
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure06.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure06.yml
deleted file mode 100644
index f27904d6e6..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure06.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- my_property:
- type: map
- description : another description
- default:
- - 10000
- - aaaa
- entry_schema:
- description: This is my property
- type: integer
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure07.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure07.yml
deleted file mode 100644
index ea123f3b1b..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure07.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- my_property:
- type: map
- description : another description
- default:
- - 10000
- - true
- entry_schema:
- description: This is my property
- type: integer
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure08.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure08.yml
deleted file mode 100644
index 87b51fb2de..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure08.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- my_property:
- type: map
- description : another description
- default:
- - 10.50
- - true
- entry_schema:
- description: This is my property
- type: float
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure09.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure09.yml
deleted file mode 100644
index 2fc8ded544..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure09.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- my_property:
- type: map
- description : another description
- default:
- - 10.50
- - asdc
- entry_schema:
- description: This is my property
- type: float
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure10.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure10.yml
deleted file mode 100644
index 3ab449d72e..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure10.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- my_property:
- type: map
- description : another description
- default:
- - 10.50
- - 500
- entry_schema:
- description: This is my property
- type: float
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure11.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure11.yml
deleted file mode 100644
index e437de822e..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure11.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- my_property:
- type: map
- description : another description
- default:
- - 10.50
- - 500.0@
- entry_schema:
- description: This is my property
- type: float
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure12.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure12.yml
deleted file mode 100644
index f2fbc7c435..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure12.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- my_property:
- type: map
- description : another description
- default:
- - 10000
- - 3#
- entry_schema:
- description: This is my property
- type: integer
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure13.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure13.yml
deleted file mode 100644
index e375aae197..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure13.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- my_property:
- type: map
- description : another description
- default:
- - false
- - true%
- entry_schema:
- description: This is my property
- type: boolean
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure14.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure14.yml
deleted file mode 100644
index e087212f1b..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure14.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- my_property:
- type: map
- description : another description
- default:
- - false
- - falsee
- - true
- entry_schema:
- description: This is my property
- type: boolean
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure15.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure15.yml
deleted file mode 100644
index 3923ee18d7..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure15.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- my_property:
- type: map
- description : another description
- default:
- - 10.5
- - 10.6x
- - 20.5
- - 30.5
- entry_schema:
- description: This is my property
- type: float
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure16.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure16.yml
deleted file mode 100644
index ed8ea4d70c..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MapPropertyFalure16.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- my_boolean:
- type: koko
- description : another description
- default:
- - false
- - true
- entry_schema:
- description: This is my property
- type: boolean
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MyFatherCompute_NoReqCap.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MyFatherCompute_NoReqCap.yml
deleted file mode 100644
index dfc564b458..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/MyFatherCompute_NoReqCap.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyFatherCompute:
- derived_from: tosca.nodes.Compute
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/SameCapAsCompute.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/SameCapAsCompute.yml
deleted file mode 100644
index 533333ee09..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/SameCapAsCompute.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute1:
- derived_from: tosca.nodes.Compute
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- capabilities:
- host:
- type: tosca.capabilities.Container
- endpoint :
- type: tosca.capabilities.Endpoint.Admin
- OS:
- type: tosca.capabilities.OperatingSystem
- BINDING:
- type: tosca.capabilities.network.Bindable \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/SameReqAsCompute.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/SameReqAsCompute.yml
deleted file mode 100644
index 9d8b2d8375..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/SameReqAsCompute.yml
+++ /dev/null
@@ -1,23 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute1:
- derived_from: tosca.nodes.Compute
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - LOCAL_STORAGE:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [0, 1] \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/SameReqAsCompute_DerivedFromMyCompute1.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/SameReqAsCompute_DerivedFromMyCompute1.yml
deleted file mode 100644
index a5413e516f..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/SameReqAsCompute_DerivedFromMyCompute1.yml
+++ /dev/null
@@ -1,23 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute2:
- derived_from: org.openecomp.resource.MyCompute1
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - LOCAL_STORAGE:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [0, 2] \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/computeCap11.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/computeCap11.yml
deleted file mode 100644
index 9cea0b9dc8..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/computeCap11.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vfc.vfc3:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [1, UNBOUNDED]
- capabilities:
- host:
- type: tosca.capabilities.Container
- occurrences: [1, 1]
- endpoint :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/computeCap1UNBOUNDED.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/computeCap1UNBOUNDED.yml
deleted file mode 100644
index 24efc27711..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/computeCap1UNBOUNDED.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vfc.vfc2:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [1, 1]
- capabilities:
- host:
- type: tosca.capabilities.Container
- occurrences: [1, UNBOUNDED]
- endpoint :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/derivedFromMyCompute.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/derivedFromMyCompute.yml
deleted file mode 100644
index 237bec1f0c..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/derivedFromMyCompute.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.DerivedFromMyCompute:
- derived_from: org.openecomp.resource.MyCompute
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [0, UNBOUNDED]
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/derivedFromWebAppDerivedReqCap.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/derivedFromWebAppDerivedReqCap.yml
deleted file mode 100644
index 0679bff4b1..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/derivedFromWebAppDerivedReqCap.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyWebApp:
- derived_from: tosca.nodes.WebApplication
- properties:
- context_root:
- type: string
- capabilities:
- app_endpoint:
- type: tosca.capabilities.Endpoint.Admin #derived from WebApplication's tosca.capabilities.Endpoint "app_endpoint"
- requirements:
- - host:
- capability: tosca.capabilities.Container.Docker #derived from WebApplication's tosca.capabilities.Container "host"
- node: tosca.nodes.WebServer
- relationship: tosca.relationships.HostedOn
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importAttributeSuccessFlow.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importAttributeSuccessFlow.yml
deleted file mode 100644
index 0fa9a302f2..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importAttributeSuccessFlow.yml
+++ /dev/null
@@ -1,53 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyComputeTest:
- derived_from: tosca.nodes.Root
- properties:
- myProp:
- type: tosca.datatypes.Credential
- descritpion: hey Desc
- default:
- "protocol" : hey1
- "token_type" : hey2
- "token" : hey3
- "keys" : {"keyA" : "val1" , keyB : val2}
- "user" : hey4
- attributes:
- private_address:
- type: string
- status: supported
- default: myDefault
- public_address:
- type: string
- networks:
- type: map
- default: {keyA : val1 , keyB : val2}
- entry_schema:
- type: string
- ports:
- type: tosca.datatypes.Credential
- description: this is my description
- default:
- "protocol" : hey1
- "token_type" : hey2
- "token" : hey3
- "keys" : {"keyA" : "val1" , keyB : val2}
- "user" : hey4
- requirements:
- - local_storage:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [0, UNBOUNDED]
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importCapabilityNameExistsOnParent.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importCapabilityNameExistsOnParent.yml
deleted file mode 100644
index 4d6db6c8c0..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importCapabilityNameExistsOnParent.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute1:
- derived_from: tosca.nodes.Compute
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [0, UNBOUNDED]
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- Binding: #"binding" exists on parent
- type: tosca.capabilities.OperatingSystem
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importDuplicateCapability.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importDuplicateCapability.yml
deleted file mode 100644
index fcc3952f94..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importDuplicateCapability.yml
+++ /dev/null
@@ -1,42 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [0, UNBOUNDED]
- - LOCAL_Storage:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [0, UNBOUNDED]
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- Scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importDuplicateRequirements.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importDuplicateRequirements.yml
deleted file mode 100644
index 7cab3ac590..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importDuplicateRequirements.yml
+++ /dev/null
@@ -1,40 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [0, UNBOUNDED]
- - LOCAL_Storage:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [0, UNBOUNDED]
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importListPropertyBadDefault.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importListPropertyBadDefault.yml
deleted file mode 100644
index a3ff088a35..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importListPropertyBadDefault.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.TestResource:
- derived_from: tosca.nodes.Root
- properties:
- my_prop:
- type: list
- description : another description
- default:
- - 12
- - true
- entry_schema:
- description: This is my property
- type: boolean
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importListPropertyGoodDefault.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importListPropertyGoodDefault.yml
deleted file mode 100644
index 2f864a727e..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importListPropertyGoodDefault.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- my_prop:
- type: list
- description : another description
- default:
- - false
- - true
- entry_schema:
- description: This is my property
- type: string
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importListPropertySuccessFlow.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importListPropertySuccessFlow.yml
deleted file mode 100644
index fd52df5f9b..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importListPropertySuccessFlow.yml
+++ /dev/null
@@ -1,198 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- my_boolean:
- type: list
- description : another description
- default:
- - false
- - true
- entry_schema:
- description: This is my property
- type: boolean
- my_boolean_array:
- type: list
- description : another description
- default: [ true , false ]
- entry_schema:
- description: This is my property
- type: boolean
- duplicate_boolean_values:
- type: list
- description : another description
- default: [ true , false , true ]
- entry_schema:
- description: This is my property
- type: boolean
- boolean_null_value:
- type: list
- description : another description
- default:
- - true
- -
- - false
- entry_schema:
- description: This is my property
- type: boolean
- my_integers:
- type: list
- description : another description
- default:
- - 0
- - 1000
- - -1000
- - 50
- entry_schema:
- description: This is my property
- type: integer
- my_integers_array:
- type: list
- description : another description
- default: [ 10 , -1000, 0 ]
- entry_schema:
- description: This is my property
- type: integer
- duplicate_integers_values:
- type: list
- description : another description
- default: [ 10 , 10, -1000, 0 ]
- entry_schema:
- description: This is my property
- type: integer
- integer_null_value:
- type: list
- description : another description
- default:
- - 1000
- -
- - 2000
- entry_schema:
- description: This is my property
- type: integer
- my_string:
- type: list
- description : another description
- default:
- - <b>asdc<b>
- - $?^@ecomp$!#%()_-~@+*^...;;/w#
- - uc
- entry_schema:
- description: This is my property
- type: string
- my_string_array:
- type: list
- description : another description
- default: [ <b>AAA</b>, ~$~#bbb%^*_-, qwe , 1.3 , <b>500</b> , true ]
- entry_schema:
- description: This is my property
- type: string
- string_null_value:
- type: list
- description : another description
- default:
- - <b>asdc<b>
- -
- - uc
- entry_schema:
- description: This is my property
- type: string
- string_space_value:
- type: list
- description : another description
- default:
- - <b> asdc<b>
- -
- - uc
- entry_schema:
- description: This is my property
- type: string
- duplicate_string_values:
- type: list
- description : another description
- default:
- - asdc
- - asdc
- - uc
- entry_schema:
- description: This is my property
- type: string
- my_float:
- type: list
- description : another description
- default:
- - 6
- - 1000.000001
- - -3.0f
- entry_schema:
- description: This is my property
- type: float
- my_float_array:
- type: list
- description : another description
- default: [ 0.01 , -5.0 , 2.1f ]
- entry_schema:
- description: This is my property
- type: float
- duplicate_float_values:
- type: list
- description : another description
- default:
- - 0.0
- - 0.0
- - 4.555555
- entry_schema:
- description: This is my property
- type: float
- float_no_default_values:
- type: list
- description : another description
- default:
- entry_schema:
- description: This is my property
- type: float
- float_null_value:
- type: list
- description : another description
- default:
- - 6
- -
- - -3.0f
- entry_schema:
- description: This is my property
- type: float
- float_space_value:
- type: list
- description : another description
- default:
- - 6
- -
- - -3.0f
- entry_schema:
- description: This is my property
- type: float
- integer_no_default_values:
- type: list
- description : another description
- default:
- entry_schema:
- description: This is my property
- type: integer
- string_no_default_values:
- type: list
- description : another description
- default:
- entry_schema:
- description: This is my property
- type: string
- boolean_no_default_values:
- type: list
- description : another description
- default:
- entry_schema:
- description: This is my property
- type: boolean
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importMapPropertySuccessFlow.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importMapPropertySuccessFlow.yml
deleted file mode 100644
index f856603397..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importMapPropertySuccessFlow.yml
+++ /dev/null
@@ -1,452 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.LinkTest:
- derived_from: tosca.nodes.Root
- properties:
- string_prop01:
- type: map
- description : another description
- default: {keyA : val1 , keyB : val2}
- entry_schema:
- description: This is my property
- type: string
- string_prop02:
- type: map
- description : another description
- default: {keyA : "val1" , keyB : "val2"}
- entry_schema:
- description: This is my property
- type: string
- string_prop03:
- type: map
- description : another description
- default: {"keyA" : "val1" , keyB : val2}
- entry_schema:
- description: This is my property
- type: string
- string_prop04:
- type: map
- description : another description
- default: {"keyA" : 10 , keyB : <b>true</b> }
- entry_schema:
- description: This is my property
- type: string
- string_prop05:
- type: map
- description : another description
- default: {"keyA" : , keyB : "Big" }
- entry_schema:
- description: This is my property
- type: string
- string_prop06:
- type: map
- description : another description
- default: {"keyA" : aaaA , keyB : null }
- entry_schema:
- description: This is my property
- type: string
- string_prop07:
- type: map
- description : another description
- default: {"keyA" : NULL , keyB : Null }
- entry_schema:
- description: This is my property
- type: string
- string_prop08:
- type: map
- description : another description
- default: {"keyA" : "" , keyB : "abcd" }
- entry_schema:
- description: This is my property
- type: string
- string_prop09:
- type: map
- description : another description
- default: {"keyA" : " " , keyB : "abcd" }
- entry_schema:
- description: This is my property
- type: string
- string_prop10:
- type: map
- description : another description
- default: {"keyA" : " aaaa" , keyB : " bbbb" }
- entry_schema:
- description: This is my property
- type: string
- string_prop11:
- type: map
- description : another description
- default: {"keyA" : "aaaa " , keyB : "bbbb " }
- entry_schema:
- description: This is my property
- type: string
- string_prop12:
- type: map
- description : another description
- default: {"keyA" : " aaaa " , keyB : " bbbb ccccc " }
- entry_schema:
- description: This is my property
- type: string
- string_prop13:
- type: map
- description : another description
- default:
- keyA : "aaaa"
- entry_schema:
- description: This is my property
- type: string
- string_prop14:
- type: map
- description : another description
- default:
- keyA : " aaaa "
- entry_schema:
- description: This is my property
- type: string
- string_prop15:
- type: map
- description : another description
- default:
- keyA : AbcD
- entry_schema:
- description: This is my property
- type: string
- string_prop16:
- type: map
- description : another description
- default:
- keyA : AbcD
- entry_schema:
- description: This is my property
- type: string
- string_prop17:
- type: map
- description : another description
- default:
- keyA : AbcD
- entry_schema:
- description: This is my property
- type: string
- string_prop18:
- type: map
- description : another description
- default:
- keyA : <b>AbcD</b>
- entry_schema:
- description: This is my property
- type: string
- string_prop19:
- type: map
- description : another description
- default:
- keyA : <b>AbcD
- entry_schema:
- description: This is my property
- type: string
- string_prop20:
- type: map
- description : another description
- default:
- keyA : aaaa
- keya : aaaa
- Keya : Aaaa
- KEYA : nnnn
- entry_schema:
- description: This is my property
- type: string
- string_prop21:
- type: map
- description : another description
- default:
- keyA : NULL
- keyB : null
- keyC : Null
- entry_schema:
- description: This is my property
- type: string
- string_prop22:
- type: map
- description : another description
- default:
- entry_schema:
- description: This is my property
- type: string
- integer_prop01:
- type: map
- description : another description
- default: {keyA : 1 , keyB : 1000}
- entry_schema:
- description: This is my property
- type: integer
- integer_prop02:
- type: map
- description : another description
- default: {keyA : Null , keyB : NULL ,keyC : null }
- entry_schema:
- description: This is my property
- type: integer
- integer_prop03:
- type: map
- description : another description
- default: {keyA : , keyB : -600}
- entry_schema:
- description: This is my property
- type: integer
- integer_prop03:
- type: map
- description : another description
- default: {keyA : 800 , keyB : -600}
- entry_schema:
- description: This is my property
- type: integer
- integer_prop04:
- type: map
- description : another description
- default: {keyA : , keyB : -600}
- entry_schema:
- description: This is my property
- type: integer
- integer_prop05:
- type: map
- description : another description
- default: {keyA : 100 , keyB : 0 }
- entry_schema:
- description: This is my property
- type: integer
- integer_prop06:
- type: map
- description : another description
- default: {keyA : 100 , keyB : 00}
- entry_schema:
- description: This is my property
- type: integer
- integer_prop07:
- type: map
- description : another description
- default: {keyA : 100 , keyB : 100 }
- entry_schema:
- description: This is my property
- type: integer
- integer_prop08:
- type: map
- description : another description
- default:
- keyA : 100
- keyB : 200
- entry_schema:
- description: This is my property
- type: integer
- integer_prop09:
- type: map
- description : another description
- default:
- keyA : 100
- keyB : 200
- entry_schema:
- description: This is my property
- type: integer
- integer_prop10:
- type: map
- description : another description
- default:
- keyA : null
- keyA : Null
- keyB : 1111
- keyB : 2222
- entry_schema:
- description: This is my property
- type: integer
- integer_prop11:
- type: map
- description : another description
- default:
- keyA : null
- keyB : Null
- keyC : NULL
- keyD :
- entry_schema:
- description: This is my property
- type: integer
- integer_prop12:
- type: map
- description : another description
- default:
- entry_schema:
- description: This is my property
- type: integer
- integer_prop13:
- type: map
- description : another description
- default: {keyA : 100 , keyA : 200}
- entry_schema:
- description: This is my property
- type: integer
- boolean_prop01:
- type: map
- description : another description
- default: {keyA : true , keyB : false , keyC : false }
- entry_schema:
- description: This is my property
- type: boolean
- boolean_prop02:
- type: map
- description : another description
- default: {keyA : TRUE , keyB : FALSE , keyC : False }
- entry_schema:
- description: This is my property
- type: boolean
- boolean_prop03:
- type: map
- description : another description
- default:
- keyA : null
- keyB : Null
- keyC : NULL
- keyD :
- entry_schema:
- description: This is my property
- type: boolean
- boolean_prop04:
- type: map
- description : another description
- default: {keyA : Null , keyB : NULL ,keyC : null ,keyD : }
- entry_schema:
- description: This is my property
- type: boolean
- boolean_prop05:
- type: map
- description : another description
- default: {keyA : true , keyB : false , keyC : false }
- entry_schema:
- description: This is my property
- type: boolean
- boolean_prop06:
- type: map
- description : another description
- default:
- keyA : true
- keyB : true
- keyC : false
- entry_schema:
- description: This is my property
- type: boolean
- boolean_prop07:
- type: map
- description : another description
- default:
- entry_schema:
- description: This is my property
- type: boolean
- boolean_prop08:
- type: map
- description : another description
- default:
- keyA : false
- keyA : true
- keyB : true
- keyB : false
- entry_schema:
- description: This is my property
- type: boolean
- boolean_prop09:
- type: map
- description : another description
- default: {keyA : true,keyA : false,keyB : false,keyB : true}
- entry_schema:
- description: This is my property
- type: boolean
- float_prop01:
- type: map
- description : another description
- default: {keyA : 1.20 , keyB : 3.56f , keyC : 33}
- entry_schema:
- description: This is my property
- type: float
- float_prop02:
- type: map
- description : another description
- default: {keyA : 0.00, keyB : 0.0 , keyC : 0 }
- entry_schema:
- description: This is my property
- type: float
- float_prop03:
- type: map
- description : another description
- default: {keyA : null, keyB : Null , keyC : NULL , keyD : }
- entry_schema:
- description: This is my property
- type: float
- float_prop04:
- type: map
- description : another description
- default: {keyA : 1.20 , keyB : 3.56f , keyC : 33 }
- entry_schema:
- description: This is my property
- type: float
- float_prop05:
- type: map
- description : another description
- default:
- keyA : 33
- keyB : 1.2000
- keyC : 3.607f
- keyD : 0
- entry_schema:
- description: This is my property
- type: float
- float_prop06:
- type: map
- description : another description
- default:
- keyA : 33
- keyB : 1.2000
- keyC : 3.607f
- entry_schema:
- description: This is my property
- type: float
- float_prop07:
- type: map
- description : another description
- default:
- keyA : null
- keyB : Null
- keyC : NULL
- keyD :
- entry_schema:
- description: This is my property
- type: float
- float_prop08:
- type: map
- description : another description
- default:
- entry_schema:
- description: This is my property
- type: float
- float_prop09:
- type: map
- description : another description
- default:
- keyA : 3.5
- keyA : 0.01
- keyB : 3.6
- keyB :
- entry_schema:
- description: This is my property
- type: float
- float_prop10:
- type: map
- description : another description
- default: {keyA : 0.0002}
- entry_schema:
- description: This is my property
- type: float
- float_prop11:
- type: map
- description : another description
- default: {keyA : 0.000 , keyA : 003.56f, keyB : 33}
- entry_schema:
- description: This is my property
- type: float
- capabilities:
- link:
- type: tosca.capabilities.network.Linkable \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importRequirementNameExistsOnParent.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importRequirementNameExistsOnParent.yml
deleted file mode 100644
index e4d626fca6..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importRequirementNameExistsOnParent.yml
+++ /dev/null
@@ -1,34 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute1:
- derived_from: tosca.nodes.Compute
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - Local_Storage:
- capability: tosca.capabilities.Endpoint
- relationship: tosca.relationships.AttachesTo
- occurrences: [0, UNBOUNDED]
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importRequirementNameExistsOnParent_DerivedFromMyCompute1.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importRequirementNameExistsOnParent_DerivedFromMyCompute1.yml
deleted file mode 100644
index 7ae9552d6a..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/importRequirementNameExistsOnParent_DerivedFromMyCompute1.yml
+++ /dev/null
@@ -1,34 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute2:
- derived_from: org.openecomp.resource.MyCompute1
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - Local_Storage:
- capability: tosca.capabilities.Endpoint
- relationship: tosca.relationships.AttachesTo
- occurrences: [0, UNBOUNDED]
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/missingCapInCapDefinition.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/missingCapInCapDefinition.yml
deleted file mode 100644
index 301116c985..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/missingCapInCapDefinition.yml
+++ /dev/null
@@ -1,37 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-description: Template for vSCP -- connectable to OCS-FW -- temporary model for 1602 demo
-
-############################
-# The model capture four sub-components (VDUs) and their connectivity to six
-# networks.
-############################
-
-node_types:
-
-#The node type for vSCP
-#used for substitution mapping, or to describe vSCP resource in ASDC studio
- org.openecomp.resource.vSCP-03-16:
- derived_from: tosca.nodes.Root
- requirements:
- - sigtran_connection1:
- capability: tosca.capabilities.Node
- - sigtran_connection2:
- capability: tosca.capabilities.Node
- - ocs_connection:
- capability: tosca.capabilities.Node
- - oam_connection:
- capability: tosca.capabilities.Node
- - firewall:
- capability: tosca.capabilities.Node
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: org.openecomp.capabilities.networkInterfaceNotFound \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/missingCapInReqDefinition.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/missingCapInReqDefinition.yml
deleted file mode 100644
index d100dafdf9..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/missingCapInReqDefinition.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-description: Template for vSCP -- connectable to OCS-FW -- temporary model for 1602 demo
-
-############################
-# The model capture four sub-components (VDUs) and their connectivity to six
-# networks.
-############################
-
-node_types:
-
-#The node type for vSCP
-#used for substitution mapping, or to describe vSCP resource in ASDC studio
- org.openecomp.resource.vSCP-03-16:
- derived_from: tosca.nodes.Root
- requirements:
- - sigtran_connection1:
- capability: org.openecomp.capabilities.networkInterfaceNotFound
- - sigtran_connection2:
- capability: tosca.capabilities.Node
- - ocs_connection:
- capability: tosca.capabilities.Node
- - oam_connection:
- capability: tosca.capabilities.Node
- - firewall:
- capability: tosca.capabilities.Node \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myChildCompute_NoReqCap.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myChildCompute_NoReqCap.yml
deleted file mode 100644
index cc5b202bc7..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myChildCompute_NoReqCap.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyChildCompute:
- derived_from: org.openecomp.resource.MyFatherCompute
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myChildWebApp_DerivedFromContainer.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myChildWebApp_DerivedFromContainer.yml
deleted file mode 100644
index b7859d4c14..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myChildWebApp_DerivedFromContainer.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyChildWebApp:
- derived_from: org.openecomp.resource.MyWebApp
- properties:
- context_root:
- type: string
- capabilities:
- app_endpoint:
- type: tosca.capabilities.Endpoint
- requirements:
- - host:
- capability: tosca.capabilities.Container
- node: tosca.nodes.WebServer
- relationship: tosca.relationships.HostedOn \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myCompute.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myCompute.yml
deleted file mode 100644
index 98bf9b7902..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myCompute.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [0, UNBOUNDED]
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeDerivedFromNotExists.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeDerivedFromNotExists.yml
deleted file mode 100644
index 2b2807395a..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeDerivedFromNotExists.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute:
- derived_from: tosca.nodes.RootNotExists
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [0, UNBOUNDED]
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeIncorrectDefenitionVersionValue.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeIncorrectDefenitionVersionValue.yml
deleted file mode 100644
index 2fa3ad0c08..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeIncorrectDefenitionVersionValue.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-tosca_definitions_version: toscaSimpleYaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [0, UNBOUNDED]
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeIncorrectNameSpaceFormat.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeIncorrectNameSpaceFormat.yml
deleted file mode 100644
index d1a613fff2..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeIncorrectNameSpaceFormat.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource2.MyCompute:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [0, UNBOUNDED]
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeNoDefenitionVersion.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeNoDefenitionVersion.yml
deleted file mode 100644
index 8084d049db..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeNoDefenitionVersion.yml
+++ /dev/null
@@ -1,34 +0,0 @@
-node_types:
- org.openecomp.resource.MyCompute:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [0, UNBOUNDED]
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeOccurencySuccess.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeOccurencySuccess.yml
deleted file mode 100644
index 40ae610c06..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeOccurencySuccess.yml
+++ /dev/null
@@ -1,77 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage100:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [1, UNBOUNDED]
- - local_storage200:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [1, 1]
- - local_storage300:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [1, 10]
- - local_storage400:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [1, 10000000]
- - local_storage500:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [2, 3]
- - local_storageNoOccurrences600:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpointNoOccurrence :
- type: tosca.capabilities.Endpoint.Admin
- endpoint200 :
- type: tosca.capabilities.Endpoint.Admin
- occurrences: [1, 2]
- endpoint300 :
- type: tosca.capabilities.Endpoint.Admin
- occurrences: [1, 1]
- endpoint400 :
- type: tosca.capabilities.Endpoint.Admin
- occurrences: [1, 10]
- endpoint500 :
- type: tosca.capabilities.Endpoint.Admin
- occurrences: [1, 10000000]
- endpoint600 :
- type: tosca.capabilities.Endpoint.Admin
- occurrences: [1, UNBOUNDED ]
- endpoint700 :
- type: tosca.capabilities.Endpoint.Admin
- occurrences: [2, 4 ]
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeParssingFalure.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeParssingFalure.yml
deleted file mode 100644
index b243add14a..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeParssingFalure.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requiremens:
- - local_storage:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [0, UNBOUNDED]
- capabilitis:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeReqNameExistsOnDerived.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeReqNameExistsOnDerived.yml
deleted file mode 100644
index 43d92d1681..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeReqNameExistsOnDerived.yml
+++ /dev/null
@@ -1,34 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute1:
- derived_from: tosca.nodes.Compute
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - Local_Storage: #"local_storage" exists on parent
- capability: tosca.capabilities.Endpoint
- relationship: tosca.relationships.AttachesTo
- occurrences: [0, UNBOUNDED]
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeVF.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeVF.yml
deleted file mode 100644
index 90e771dab1..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeVF.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.VF.MyCompute:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [0, UNBOUNDED]
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeWithNodeTypesTwice.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeWithNodeTypesTwice.yml
deleted file mode 100644
index 73b201eab4..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeWithNodeTypesTwice.yml
+++ /dev/null
@@ -1,42 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [0, UNBOUNDED]
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable
-
- org.openecomp.resource.example.TransactionSubsystem:
- derived_from: tosca.nodes.Root
- capabilities:
- message_receiver: tosca.capabilities.Endpoint
- requirements:
- - database_endpoint: tosca.capabilities.Endpoint.Database \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeWithTopologyTemplate.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeWithTopologyTemplate.yml
deleted file mode 100644
index c451eb2514..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myComputeWithTopologyTemplate.yml
+++ /dev/null
@@ -1,44 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-topology_template:
- description: Template of an application connecting to a database.
-
- node_templates:
- web_app:
- type: tosca.nodes.WebApplication.MyWebApp
- requirements:
- - host: web_server
- - database_endpoint: db
-node_types:
- org.openecomp.resource.MyCompute:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [0, UNBOUNDED]
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myFatherWebApp_derviedFromDocker.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myFatherWebApp_derviedFromDocker.yml
deleted file mode 100644
index 43a9a174f8..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myFatherWebApp_derviedFromDocker.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyWebApp:
- derived_from: tosca.nodes.WebApplication
- properties:
- context_root:
- type: string
- capabilities:
- app_endpoint:
- type: tosca.capabilities.Endpoint
- requirements:
- - HOSt:
- capability: tosca.capabilities.Container.Docker
- node: tosca.nodes.WebServer
- relationship: tosca.relationships.HostedOn
- occurrences: [ 1, 2 ]
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myLinkVL.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myLinkVL.yml
deleted file mode 100644
index 7c796d2801..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myLinkVL.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vl.MyLink:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [0, UNBOUNDED]
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myPortCP.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myPortCP.yml
deleted file mode 100644
index ff255f2394..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/myPortCP.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.cp.MyPort:
- derived_from: org.openecomp.resource.cp.Port
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage:
- capability: tosca.capabilities.network.Bindable
- node: org.openecomp.resource.vl.MyLink
- relationship: tosca.relationships.BindTo
- occurrences: [0, UNBOUNDED]
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/noContent.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/noContent.yml
deleted file mode 100644
index e69de29bb2..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/noContent.yml
+++ /dev/null
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure01.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure01.yml
deleted file mode 100644
index f007a0fed2..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure01.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage100:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [2, 0]
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint100 :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure02.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure02.yml
deleted file mode 100644
index 0487b63cb3..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure02.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage100:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [-1, 2]
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint100 :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure03.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure03.yml
deleted file mode 100644
index 7afdffa59d..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure03.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage100:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [1, -2]
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint100 :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure04.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure04.yml
deleted file mode 100644
index f8a582f401..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure04.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage100:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [ , 2]
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint100 :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure05.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure05.yml
deleted file mode 100644
index f1c6a93e1f..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure05.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage100:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [ 1, ]
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint100 :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure06.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure06.yml
deleted file mode 100644
index b0ef54b0eb..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure06.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage100:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [ 0 , 0 ]
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint100 :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure07.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure07.yml
deleted file mode 100644
index afd999f575..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure07.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage100:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [ @ , 1 ]
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint100 :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure08.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure08.yml
deleted file mode 100644
index 60efc99273..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure08.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage100:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [ 1.0 , 2.0 ]
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint100 :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure09.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure09.yml
deleted file mode 100644
index d6ec7eabe6..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure09.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage100:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [ "1" , "2" ]
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint100 :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure10.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure10.yml
deleted file mode 100644
index 27de429186..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure10.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage100:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [ ]
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint100 :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure11.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure11.yml
deleted file mode 100644
index 5bdae3a5f5..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure11.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage100:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- occurrences: [ UNBOUNDED , UNBOUNDED ]
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint100 :
- type: tosca.capabilities.Endpoint.Admin
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure31.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure31.yml
deleted file mode 100644
index 8c3034afce..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure31.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage100:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint100 :
- type: tosca.capabilities.Endpoint.Admin
- occurrences: [ 2, 1]
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure32.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure32.yml
deleted file mode 100644
index 4b5eba9110..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure32.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage100:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint100 :
- type: tosca.capabilities.Endpoint.Admin
- occurrences: [ -1, 2]
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure33.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure33.yml
deleted file mode 100644
index 9c42e22aa1..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure33.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage100:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint100 :
- type: tosca.capabilities.Endpoint.Admin
- occurrences: [ 1, -2]
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure34.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure34.yml
deleted file mode 100644
index 49953b5834..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure34.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage100:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint100 :
- type: tosca.capabilities.Endpoint.Admin
- occurrences: [ , 2]
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure35.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure35.yml
deleted file mode 100644
index 8d8985d7f7..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure35.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage100:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint100 :
- type: tosca.capabilities.Endpoint.Admin
- occurrences: [ 1 , ]
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure36.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure36.yml
deleted file mode 100644
index 12944507f6..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure36.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage100:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint100 :
- type: tosca.capabilities.Endpoint.Admin
- occurrences: [ 0 , 0 ]
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure37.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure37.yml
deleted file mode 100644
index 618c980e16..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure37.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage100:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint100 :
- type: tosca.capabilities.Endpoint.Admin
- occurrences: [ 0 , # ]
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure38.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure38.yml
deleted file mode 100644
index d0c4575c83..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure38.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage100:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint100 :
- type: tosca.capabilities.Endpoint.Admin
- occurrences: [ 1.0 , 2.0 ]
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure39.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure39.yml
deleted file mode 100644
index 024338d380..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure39.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage100:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint100 :
- type: tosca.capabilities.Endpoint.Admin
- occurrences: [ "1" , "2" ]
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure40.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure40.yml
deleted file mode 100644
index a4a32ba772..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure40.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage100:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint100 :
- type: tosca.capabilities.Endpoint.Admin
- occurrences: [ ]
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure41.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure41.yml
deleted file mode 100644
index c3024a3ee4..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/occurencyFalure41.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.MyCompute:
- derived_from: tosca.nodes.Root
- attributes:
- private_address:
- type: string
- public_address:
- type: string
- networks:
- type: map
- entry_schema:
- type: tosca.datatypes.network.NetworkInfo
- ports:
- type: map
- entry_schema:
- type: tosca.datatypes.network.PortInfo
- requirements:
- - local_storage100:
- capability: tosca.capabilities.Attachment
- node: tosca.nodes.BlockStorage
- relationship: tosca.relationships.AttachesTo
- capabilities:
- host:
- type: tosca.capabilities.Container
- valid_source_types: [tosca.nodes.SoftwareComponent]
- endpoint100 :
- type: tosca.capabilities.Endpoint.Admin
- occurrences: [ UNBOUNDED, UNBOUNDED ]
- os:
- type: tosca.capabilities.OperatingSystem
- scalable:
- type: tosca.capabilities.Scalable
- binding:
- type: tosca.capabilities.network.Bindable \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/softwareComponentReq11.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/softwareComponentReq11.yml
deleted file mode 100644
index b9bda183e6..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/softwareComponentReq11.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vfc.vfc4:
- derived_from: tosca.nodes.Root
- properties:
- # domain-specific software component version
- component_version:
- type: version
- required: false
- admin_credential:
- type: tosca.datatypes.Credential
- required: false
- requirements:
- - host:
- capability: tosca.capabilities.Container
- relationship: tosca.relationships.HostedOn
- occurrences: [1, 1]
diff --git a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/softwareComponentReq12.yml b/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/softwareComponentReq12.yml
deleted file mode 100644
index 9676bcdb6c..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/importToscaResourceByCreateUrl/softwareComponentReq12.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-node_types:
- org.openecomp.resource.vfc.vfc1:
- derived_from: tosca.nodes.Root
- properties:
- # domain-specific software component version
- component_version:
- type: version
- required: false
- admin_credential:
- type: tosca.datatypes.Credential
- required: false
- requirements:
- - host:
- capability: tosca.capabilities.Container
- relationship: tosca.relationships.HostedOn
- occurrences: [1, 2]
diff --git a/test-apis-ci/src/test/resources/CI/tests/tenantIsolationCI/aai_error.properties b/test-apis-ci/src/test/resources/CI/tests/tenantIsolationCI/aai_error.properties
deleted file mode 100644
index b4ae9e332b..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/tenantIsolationCI/aai_error.properties
+++ /dev/null
@@ -1,10 +0,0 @@
-400=Bad Request
-401=Unauthorized
-403=Forbidden
-404=Not Found
-405=Method Not Allowed
-409=The request could not be completed due to a conflict with the current state of the target resource
-410=You are using a version of the API that has been retired
-412=Precondition failed
-415=Unsupported Media Type
-500=Internal Server Error \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/testCsarAPI/topology.txt b/test-apis-ci/src/test/resources/CI/tests/testCsarAPI/topology.txt
deleted file mode 100644
index f46af26605..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/testCsarAPI/topology.txt
+++ /dev/null
@@ -1 +0,0 @@
-{"id":"c25811fc-e03f-401d-93ca-45d9bd312703","delegateId":"17710a88-f3d8-483d-aded-afee2906a8c1","delegateType":"topologytemplate","dependencies":[{"name":"tosca-normative-types-softwareComponent","version":"1.0.0.wd03-SNAPSHOT"},{"name":"tosca-normative-types-webServer","version":"1.0.0.wd03-SNAPSHOT"},{"name":"apache-type","version":"2.0.0-SNAPSHOT"},{"name":"tosca-normative-types-compute","version":"1.0.0.wd03-SNAPSHOT"},{"name":"tosca-normative-types-root","version":"1.0.0.wd03-SNAPSHOT"}],"nodeTemplates":[{"key":"Compute_2","value":{"type":"tosca.nodes.Compute","name":null,"properties":{"disk_size":null,"num_cpus":null,"os_distribution":null,"os_arch":null,"mem_size":null,"os_type":null,"os_version":null},"attributes":{"ip_address":null,"tosca_id":null,"tosca_name":null},"relationships":null,"requirements":{"dependency":{"type":"tosca.capabilities.Root","properties":null},"network":{"type":"tosca.capabilities.Connectivity","properties":null}},"capabilities":{"host":{"type":"tosca.capabilities.Container","properties":{"valid_node_types":null}},"root":{"type":"tosca.capabilities.Root","properties":null},"attach":{"type":"tosca.capabilities.Attachment","properties":null},"scalable":{"type":"tosca.capabilities.Scalable","properties":{"max_intances":{"value":"1","definition":false},"default_instances":{"value":"1","definition":false},"min_intances":{"value":"1","definition":false}}}},"artifacts":null}},{"key":"Apache","value":{"type":"alien.nodes.Apache","name":null,"properties":{"port":"80","document_root":"/var/www","version":"2.4"},"attributes":{"tosca_id":null,"tosca_name":null},"relationships":{"attachToCompute_2":{"type":"tosca.relationships.AttachTo","target":"Compute_2","requirementName":"dependency","requirementType":"tosca.capabilities.Root","targetedCapabilityName":"attach"}},"requirements":{"dependency":{"type":"tosca.capabilities.Root","properties":null},"host":{"type":"tosca.nodes.Compute","properties":null}},"capabilities":{"secure_endpoint":{"type":"tosca.capabilities.Endpoint","properties":{"port":null,"protocol":{"value":"tcp","definition":false},"url_path":null,"secure":{"value":"false","definition":false}}},"app_endpoint":{"type":"tosca.capabilities.Endpoint","properties":{"port":null,"protocol":{"value":"tcp","definition":false},"url_path":null,"secure":{"value":"false","definition":false}}},"host":{"type":"alien.capabilities.ApacheContainer","properties":{"valid_node_types":null}},"root":{"type":"tosca.capabilities.Root","properties":null}},"artifacts":null}},{"key":"Compute","value":{"type":"tosca.nodes.Compute","name":null,"properties":{"disk_size":null,"num_cpus":null,"os_distribution":null,"os_arch":null,"mem_size":null,"os_type":null,"os_version":null},"attributes":{"ip_address":null,"tosca_id":null,"tosca_name":null},"relationships":null,"requirements":{"dependency":{"type":"tosca.capabilities.Root","properties":null},"network":{"type":"tosca.capabilities.Connectivity","properties":null}},"capabilities":{"host":{"type":"tosca.capabilities.Container","properties":{"valid_node_types":null}},"root":{"type":"tosca.capabilities.Root","properties":null},"attach":{"type":"tosca.capabilities.Attachment","properties":null},"scalable":{"type":"tosca.capabilities.Scalable","properties":{"max_intances":{"value":"1","definition":false},"default_instances":{"value":"1","definition":false},"min_intances":{"value":"1","definition":false}}}},"artifacts":null}}]} \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/testCsarAPI/topologyTemplate.txt b/test-apis-ci/src/test/resources/CI/tests/testCsarAPI/topologyTemplate.txt
deleted file mode 100644
index f3fdf0297b..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/testCsarAPI/topologyTemplate.txt
+++ /dev/null
@@ -1 +0,0 @@
-{"id":"17710a88-f3d8-483d-aded-afee2906a8c1","name":"MichaelTest2","description":null,"topologyId":"c25811fc-e03f-401d-93ca-45d9bd312703"} \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool10_false.yaml b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool10_false.yaml
deleted file mode 100644
index b6faadd4f9..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool10_false.yaml
+++ /dev/null
@@ -1,140 +0,0 @@
-heat_template_version: 2013-05-23
-#################################
-#
-# Changes in v0.2:
-# - Unique availability zone for each VM
-# - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
-# - 2 DB VMs added
-# - Images corrected
-# - VM start-up order: SMP->DB->BE->FE (no error handling yet)
-# - Provisioning scripts placeholders
-#
-#################################
-
-description: ASC Template
-
-parameters:
- city_name:
- type: boolean
- description: city name
- default: NO
- address:
- type: string
- description: address
- default: Alonim
- home_number:
- type: number
- description: home_number
- default: 8
-resources:
-# scp_be_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_be_wait_handle }
-# count: 5
-# timeout: 300
-# scp_be_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# scp_fe_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_fe_wait_handle }
-# count: 2
-# timeout: 300
-# scp_fe_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# smp_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: smp_wait_handle }
-# count: 2
-# timeout: 300
-# smp_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# db_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: db_wait_handle }
-# count: 2
-# timeout: 300
-# db_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-
- FE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- BE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- SMP_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- DB_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
-
- FE_Clustering_KA:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_fe_cluster_net_id }
-
- FE_Clustering_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: FE_Clustering_KA }
- cidr: { get_param: int_vscp_fe_cluster_cidr }
-
- Clustering_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_cluster_net_id }
-
- Clustering_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: Clustering_Network }
- cidr: { get_param: int_vscp_cluster_cidr }
-
- DB_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_db_network_net_id }
-
- DB_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: DB_Network }
- cidr: { get_param: int_vscp_db_network_cidr }
-
- server_scp_be0:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be0_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be0 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be0_port_3 }
- - port: { get_resource: be0_port_4 }
- - port: { get_resource: be0_port_5 }
- - port: { get_resource: be0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be0_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool11_false.yaml b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool11_false.yaml
deleted file mode 100644
index 7fb2923b04..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool11_false.yaml
+++ /dev/null
@@ -1,140 +0,0 @@
-heat_template_version: 2013-05-23
-#################################
-#
-# Changes in v0.2:
-# - Unique availability zone for each VM
-# - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
-# - 2 DB VMs added
-# - Images corrected
-# - VM start-up order: SMP->DB->BE->FE (no error handling yet)
-# - Provisioning scripts placeholders
-#
-#################################
-
-description: ASC Template
-
-parameters:
- city_name:
- type: boolean
- description: city name
- default: 0
- address:
- type: string
- description: address
- default: Alonim
- home_number:
- type: number
- description: home_number
- default: 8
-resources:
-# scp_be_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_be_wait_handle }
-# count: 5
-# timeout: 300
-# scp_be_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# scp_fe_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_fe_wait_handle }
-# count: 2
-# timeout: 300
-# scp_fe_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# smp_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: smp_wait_handle }
-# count: 2
-# timeout: 300
-# smp_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# db_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: db_wait_handle }
-# count: 2
-# timeout: 300
-# db_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-
- FE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- BE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- SMP_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- DB_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
-
- FE_Clustering_KA:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_fe_cluster_net_id }
-
- FE_Clustering_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: FE_Clustering_KA }
- cidr: { get_param: int_vscp_fe_cluster_cidr }
-
- Clustering_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_cluster_net_id }
-
- Clustering_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: Clustering_Network }
- cidr: { get_param: int_vscp_cluster_cidr }
-
- DB_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_db_network_net_id }
-
- DB_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: DB_Network }
- cidr: { get_param: int_vscp_db_network_cidr }
-
- server_scp_be0:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be0_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be0 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be0_port_3 }
- - port: { get_resource: be0_port_4 }
- - port: { get_resource: be0_port_5 }
- - port: { get_resource: be0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be0_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool12_false.yaml b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool12_false.yaml
deleted file mode 100644
index fd451aa3af..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool12_false.yaml
+++ /dev/null
@@ -1,140 +0,0 @@
-heat_template_version: 2013-05-23
-#################################
-#
-# Changes in v0.2:
-# - Unique availability zone for each VM
-# - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
-# - 2 DB VMs added
-# - Images corrected
-# - VM start-up order: SMP->DB->BE->FE (no error handling yet)
-# - Provisioning scripts placeholders
-#
-#################################
-
-description: ASC Template
-
-parameters:
- city_name:
- type: boolean
- description: city name
- default: OFF
- address:
- type: string
- description: address
- default: Alonim
- home_number:
- type: number
- description: home_number
- default: 8
-resources:
-# scp_be_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_be_wait_handle }
-# count: 5
-# timeout: 300
-# scp_be_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# scp_fe_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_fe_wait_handle }
-# count: 2
-# timeout: 300
-# scp_fe_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# smp_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: smp_wait_handle }
-# count: 2
-# timeout: 300
-# smp_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# db_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: db_wait_handle }
-# count: 2
-# timeout: 300
-# db_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-
- FE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- BE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- SMP_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- DB_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
-
- FE_Clustering_KA:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_fe_cluster_net_id }
-
- FE_Clustering_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: FE_Clustering_KA }
- cidr: { get_param: int_vscp_fe_cluster_cidr }
-
- Clustering_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_cluster_net_id }
-
- Clustering_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: Clustering_Network }
- cidr: { get_param: int_vscp_cluster_cidr }
-
- DB_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_db_network_net_id }
-
- DB_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: DB_Network }
- cidr: { get_param: int_vscp_db_network_cidr }
-
- server_scp_be0:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be0_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be0 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be0_port_3 }
- - port: { get_resource: be0_port_4 }
- - port: { get_resource: be0_port_5 }
- - port: { get_resource: be0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be0_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool1_true.yaml b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool1_true.yaml
deleted file mode 100644
index a253e4c8d7..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool1_true.yaml
+++ /dev/null
@@ -1,140 +0,0 @@
-heat_template_version: 2013-05-23
-#################################
-#
-# Changes in v0.2:
-# - Unique availability zone for each VM
-# - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
-# - 2 DB VMs added
-# - Images corrected
-# - VM start-up order: SMP->DB->BE->FE (no error handling yet)
-# - Provisioning scripts placeholders
-#
-#################################
-
-description: ASC Template
-
-parameters:
- city_name:
- type: boolean
- description: city name
- default: t
- address:
- type: string
- description: address
- default: Alonim
- home_number:
- type: number
- description: home_number
- default: 8
-resources:
-# scp_be_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_be_wait_handle }
-# count: 5
-# timeout: 300
-# scp_be_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# scp_fe_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_fe_wait_handle }
-# count: 2
-# timeout: 300
-# scp_fe_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# smp_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: smp_wait_handle }
-# count: 2
-# timeout: 300
-# smp_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# db_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: db_wait_handle }
-# count: 2
-# timeout: 300
-# db_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-
- FE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- BE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- SMP_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- DB_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
-
- FE_Clustering_KA:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_fe_cluster_net_id }
-
- FE_Clustering_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: FE_Clustering_KA }
- cidr: { get_param: int_vscp_fe_cluster_cidr }
-
- Clustering_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_cluster_net_id }
-
- Clustering_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: Clustering_Network }
- cidr: { get_param: int_vscp_cluster_cidr }
-
- DB_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_db_network_net_id }
-
- DB_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: DB_Network }
- cidr: { get_param: int_vscp_db_network_cidr }
-
- server_scp_be0:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be0_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be0 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be0_port_3 }
- - port: { get_resource: be0_port_4 }
- - port: { get_resource: be0_port_5 }
- - port: { get_resource: be0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be0_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool2_true.yaml b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool2_true.yaml
deleted file mode 100644
index ce273b3522..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool2_true.yaml
+++ /dev/null
@@ -1,140 +0,0 @@
-heat_template_version: 2013-05-23
-#################################
-#
-# Changes in v0.2:
-# - Unique availability zone for each VM
-# - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
-# - 2 DB VMs added
-# - Images corrected
-# - VM start-up order: SMP->DB->BE->FE (no error handling yet)
-# - Provisioning scripts placeholders
-#
-#################################
-
-description: ASC Template
-
-parameters:
- city_name:
- type: boolean
- description: city name
- default: true
- address:
- type: string
- description: address
- default: Alonim
- home_number:
- type: number
- description: home_number
- default: 8
-resources:
-# scp_be_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_be_wait_handle }
-# count: 5
-# timeout: 300
-# scp_be_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# scp_fe_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_fe_wait_handle }
-# count: 2
-# timeout: 300
-# scp_fe_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# smp_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: smp_wait_handle }
-# count: 2
-# timeout: 300
-# smp_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# db_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: db_wait_handle }
-# count: 2
-# timeout: 300
-# db_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-
- FE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- BE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- SMP_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- DB_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
-
- FE_Clustering_KA:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_fe_cluster_net_id }
-
- FE_Clustering_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: FE_Clustering_KA }
- cidr: { get_param: int_vscp_fe_cluster_cidr }
-
- Clustering_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_cluster_net_id }
-
- Clustering_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: Clustering_Network }
- cidr: { get_param: int_vscp_cluster_cidr }
-
- DB_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_db_network_net_id }
-
- DB_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: DB_Network }
- cidr: { get_param: int_vscp_db_network_cidr }
-
- server_scp_be0:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be0_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be0 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be0_port_3 }
- - port: { get_resource: be0_port_4 }
- - port: { get_resource: be0_port_5 }
- - port: { get_resource: be0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be0_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool3_true.yaml b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool3_true.yaml
deleted file mode 100644
index 4680eb6996..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool3_true.yaml
+++ /dev/null
@@ -1,140 +0,0 @@
-heat_template_version: 2013-05-23
-#################################
-#
-# Changes in v0.2:
-# - Unique availability zone for each VM
-# - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
-# - 2 DB VMs added
-# - Images corrected
-# - VM start-up order: SMP->DB->BE->FE (no error handling yet)
-# - Provisioning scripts placeholders
-#
-#################################
-
-description: ASC Template
-
-parameters:
- city_name:
- type: boolean
- description: city name
- default: on
- address:
- type: string
- description: address
- default: Alonim
- home_number:
- type: number
- description: home_number
- default: 8
-resources:
-# scp_be_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_be_wait_handle }
-# count: 5
-# timeout: 300
-# scp_be_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# scp_fe_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_fe_wait_handle }
-# count: 2
-# timeout: 300
-# scp_fe_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# smp_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: smp_wait_handle }
-# count: 2
-# timeout: 300
-# smp_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# db_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: db_wait_handle }
-# count: 2
-# timeout: 300
-# db_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-
- FE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- BE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- SMP_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- DB_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
-
- FE_Clustering_KA:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_fe_cluster_net_id }
-
- FE_Clustering_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: FE_Clustering_KA }
- cidr: { get_param: int_vscp_fe_cluster_cidr }
-
- Clustering_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_cluster_net_id }
-
- Clustering_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: Clustering_Network }
- cidr: { get_param: int_vscp_cluster_cidr }
-
- DB_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_db_network_net_id }
-
- DB_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: DB_Network }
- cidr: { get_param: int_vscp_db_network_cidr }
-
- server_scp_be0:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be0_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be0 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be0_port_3 }
- - port: { get_resource: be0_port_4 }
- - port: { get_resource: be0_port_5 }
- - port: { get_resource: be0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be0_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool4_true.yaml b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool4_true.yaml
deleted file mode 100644
index 1ed7781831..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool4_true.yaml
+++ /dev/null
@@ -1,140 +0,0 @@
-heat_template_version: 2013-05-23
-#################################
-#
-# Changes in v0.2:
-# - Unique availability zone for each VM
-# - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
-# - 2 DB VMs added
-# - Images corrected
-# - VM start-up order: SMP->DB->BE->FE (no error handling yet)
-# - Provisioning scripts placeholders
-#
-#################################
-
-description: ASC Template
-
-parameters:
- city_name:
- type: boolean
- description: city name
- default: y
- address:
- type: string
- description: address
- default: Alonim
- home_number:
- type: number
- description: home_number
- default: 8
-resources:
-# scp_be_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_be_wait_handle }
-# count: 5
-# timeout: 300
-# scp_be_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# scp_fe_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_fe_wait_handle }
-# count: 2
-# timeout: 300
-# scp_fe_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# smp_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: smp_wait_handle }
-# count: 2
-# timeout: 300
-# smp_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# db_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: db_wait_handle }
-# count: 2
-# timeout: 300
-# db_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-
- FE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- BE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- SMP_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- DB_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
-
- FE_Clustering_KA:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_fe_cluster_net_id }
-
- FE_Clustering_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: FE_Clustering_KA }
- cidr: { get_param: int_vscp_fe_cluster_cidr }
-
- Clustering_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_cluster_net_id }
-
- Clustering_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: Clustering_Network }
- cidr: { get_param: int_vscp_cluster_cidr }
-
- DB_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_db_network_net_id }
-
- DB_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: DB_Network }
- cidr: { get_param: int_vscp_db_network_cidr }
-
- server_scp_be0:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be0_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be0 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be0_port_3 }
- - port: { get_resource: be0_port_4 }
- - port: { get_resource: be0_port_5 }
- - port: { get_resource: be0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be0_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool5_true.yaml b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool5_true.yaml
deleted file mode 100644
index c0b42e6288..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool5_true.yaml
+++ /dev/null
@@ -1,140 +0,0 @@
-heat_template_version: 2013-05-23
-#################################
-#
-# Changes in v0.2:
-# - Unique availability zone for each VM
-# - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
-# - 2 DB VMs added
-# - Images corrected
-# - VM start-up order: SMP->DB->BE->FE (no error handling yet)
-# - Provisioning scripts placeholders
-#
-#################################
-
-description: ASC Template
-
-parameters:
- city_name:
- type: boolean
- description: city name
- default: yes
- address:
- type: string
- description: address
- default: Alonim
- home_number:
- type: number
- description: home_number
- default: 8
-resources:
-# scp_be_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_be_wait_handle }
-# count: 5
-# timeout: 300
-# scp_be_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# scp_fe_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_fe_wait_handle }
-# count: 2
-# timeout: 300
-# scp_fe_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# smp_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: smp_wait_handle }
-# count: 2
-# timeout: 300
-# smp_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# db_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: db_wait_handle }
-# count: 2
-# timeout: 300
-# db_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-
- FE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- BE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- SMP_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- DB_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
-
- FE_Clustering_KA:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_fe_cluster_net_id }
-
- FE_Clustering_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: FE_Clustering_KA }
- cidr: { get_param: int_vscp_fe_cluster_cidr }
-
- Clustering_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_cluster_net_id }
-
- Clustering_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: Clustering_Network }
- cidr: { get_param: int_vscp_cluster_cidr }
-
- DB_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_db_network_net_id }
-
- DB_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: DB_Network }
- cidr: { get_param: int_vscp_db_network_cidr }
-
- server_scp_be0:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be0_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be0 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be0_port_3 }
- - port: { get_resource: be0_port_4 }
- - port: { get_resource: be0_port_5 }
- - port: { get_resource: be0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be0_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool6_true.yaml b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool6_true.yaml
deleted file mode 100644
index 24b862b751..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool6_true.yaml
+++ /dev/null
@@ -1,140 +0,0 @@
-heat_template_version: 2013-05-23
-#################################
-#
-# Changes in v0.2:
-# - Unique availability zone for each VM
-# - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
-# - 2 DB VMs added
-# - Images corrected
-# - VM start-up order: SMP->DB->BE->FE (no error handling yet)
-# - Provisioning scripts placeholders
-#
-#################################
-
-description: ASC Template
-
-parameters:
- city_name:
- type: boolean
- description: city name
- default: 1
- address:
- type: string
- description: address
- default: Alonim
- home_number:
- type: number
- description: home_number
- default: 8
-resources:
-# scp_be_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_be_wait_handle }
-# count: 5
-# timeout: 300
-# scp_be_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# scp_fe_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_fe_wait_handle }
-# count: 2
-# timeout: 300
-# scp_fe_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# smp_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: smp_wait_handle }
-# count: 2
-# timeout: 300
-# smp_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# db_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: db_wait_handle }
-# count: 2
-# timeout: 300
-# db_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-
- FE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- BE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- SMP_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- DB_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
-
- FE_Clustering_KA:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_fe_cluster_net_id }
-
- FE_Clustering_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: FE_Clustering_KA }
- cidr: { get_param: int_vscp_fe_cluster_cidr }
-
- Clustering_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_cluster_net_id }
-
- Clustering_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: Clustering_Network }
- cidr: { get_param: int_vscp_cluster_cidr }
-
- DB_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_db_network_net_id }
-
- DB_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: DB_Network }
- cidr: { get_param: int_vscp_db_network_cidr }
-
- server_scp_be0:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be0_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be0 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be0_port_3 }
- - port: { get_resource: be0_port_4 }
- - port: { get_resource: be0_port_5 }
- - port: { get_resource: be0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be0_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool7_false.yaml b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool7_false.yaml
deleted file mode 100644
index 7bad8efd6f..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool7_false.yaml
+++ /dev/null
@@ -1,140 +0,0 @@
-heat_template_version: 2013-05-23
-#################################
-#
-# Changes in v0.2:
-# - Unique availability zone for each VM
-# - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
-# - 2 DB VMs added
-# - Images corrected
-# - VM start-up order: SMP->DB->BE->FE (no error handling yet)
-# - Provisioning scripts placeholders
-#
-#################################
-
-description: ASC Template
-
-parameters:
- city_name:
- type: boolean
- description: city name
- default: F
- address:
- type: string
- description: address
- default: Alonim
- home_number:
- type: number
- description: home_number
- default: 8
-resources:
-# scp_be_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_be_wait_handle }
-# count: 5
-# timeout: 300
-# scp_be_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# scp_fe_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_fe_wait_handle }
-# count: 2
-# timeout: 300
-# scp_fe_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# smp_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: smp_wait_handle }
-# count: 2
-# timeout: 300
-# smp_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# db_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: db_wait_handle }
-# count: 2
-# timeout: 300
-# db_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-
- FE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- BE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- SMP_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- DB_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
-
- FE_Clustering_KA:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_fe_cluster_net_id }
-
- FE_Clustering_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: FE_Clustering_KA }
- cidr: { get_param: int_vscp_fe_cluster_cidr }
-
- Clustering_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_cluster_net_id }
-
- Clustering_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: Clustering_Network }
- cidr: { get_param: int_vscp_cluster_cidr }
-
- DB_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_db_network_net_id }
-
- DB_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: DB_Network }
- cidr: { get_param: int_vscp_db_network_cidr }
-
- server_scp_be0:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be0_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be0 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be0_port_3 }
- - port: { get_resource: be0_port_4 }
- - port: { get_resource: be0_port_5 }
- - port: { get_resource: be0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be0_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool8_false.yaml b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool8_false.yaml
deleted file mode 100644
index 8b35e2adf7..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool8_false.yaml
+++ /dev/null
@@ -1,140 +0,0 @@
-heat_template_version: 2013-05-23
-#################################
-#
-# Changes in v0.2:
-# - Unique availability zone for each VM
-# - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
-# - 2 DB VMs added
-# - Images corrected
-# - VM start-up order: SMP->DB->BE->FE (no error handling yet)
-# - Provisioning scripts placeholders
-#
-#################################
-
-description: ASC Template
-
-parameters:
- city_name:
- type: boolean
- description: city name
- default: FALSE
- address:
- type: string
- description: address
- default: Alonim
- home_number:
- type: number
- description: home_number
- default: 8
-resources:
-# scp_be_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_be_wait_handle }
-# count: 5
-# timeout: 300
-# scp_be_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# scp_fe_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_fe_wait_handle }
-# count: 2
-# timeout: 300
-# scp_fe_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# smp_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: smp_wait_handle }
-# count: 2
-# timeout: 300
-# smp_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# db_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: db_wait_handle }
-# count: 2
-# timeout: 300
-# db_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-
- FE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- BE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- SMP_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- DB_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
-
- FE_Clustering_KA:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_fe_cluster_net_id }
-
- FE_Clustering_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: FE_Clustering_KA }
- cidr: { get_param: int_vscp_fe_cluster_cidr }
-
- Clustering_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_cluster_net_id }
-
- Clustering_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: Clustering_Network }
- cidr: { get_param: int_vscp_cluster_cidr }
-
- DB_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_db_network_net_id }
-
- DB_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: DB_Network }
- cidr: { get_param: int_vscp_db_network_cidr }
-
- server_scp_be0:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be0_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be0 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be0_port_3 }
- - port: { get_resource: be0_port_4 }
- - port: { get_resource: be0_port_5 }
- - port: { get_resource: be0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be0_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool9_false.yaml b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool9_false.yaml
deleted file mode 100644
index 2768e0d480..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_bool9_false.yaml
+++ /dev/null
@@ -1,140 +0,0 @@
-heat_template_version: 2013-05-23
-#################################
-#
-# Changes in v0.2:
-# - Unique availability zone for each VM
-# - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
-# - 2 DB VMs added
-# - Images corrected
-# - VM start-up order: SMP->DB->BE->FE (no error handling yet)
-# - Provisioning scripts placeholders
-#
-#################################
-
-description: ASC Template
-
-parameters:
- city_name:
- type: boolean
- description: city name
- default: N
- address:
- type: string
- description: address
- default: Alonim
- home_number:
- type: number
- description: home_number
- default: 8
-resources:
-# scp_be_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_be_wait_handle }
-# count: 5
-# timeout: 300
-# scp_be_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# scp_fe_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_fe_wait_handle }
-# count: 2
-# timeout: 300
-# scp_fe_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# smp_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: smp_wait_handle }
-# count: 2
-# timeout: 300
-# smp_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# db_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: db_wait_handle }
-# count: 2
-# timeout: 300
-# db_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-
- FE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- BE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- SMP_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- DB_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
-
- FE_Clustering_KA:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_fe_cluster_net_id }
-
- FE_Clustering_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: FE_Clustering_KA }
- cidr: { get_param: int_vscp_fe_cluster_cidr }
-
- Clustering_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_cluster_net_id }
-
- Clustering_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: Clustering_Network }
- cidr: { get_param: int_vscp_cluster_cidr }
-
- DB_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_db_network_net_id }
-
- DB_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: DB_Network }
- cidr: { get_param: int_vscp_db_network_cidr }
-
- server_scp_be0:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be0_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be0 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be0_port_3 }
- - port: { get_resource: be0_port_4 }
- - port: { get_resource: be0_port_5 }
- - port: { get_resource: be0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be0_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_number1.yaml b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_number1.yaml
deleted file mode 100644
index fc7f84ca81..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_number1.yaml
+++ /dev/null
@@ -1,140 +0,0 @@
-heat_template_version: 2013-05-23
-#################################
-#
-# Changes in v0.2:
-# - Unique availability zone for each VM
-# - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
-# - 2 DB VMs added
-# - Images corrected
-# - VM start-up order: SMP->DB->BE->FE (no error handling yet)
-# - Provisioning scripts placeholders
-#
-#################################
-
-description: ASC Template
-
-parameters:
- city_name:
- type: number
- description: city name
- default: 12
- address:
- type: string
- description: address
- default: Alonim
- home_number:
- type: number
- description: home_number
- default: 8
-resources:
-# scp_be_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_be_wait_handle }
-# count: 5
-# timeout: 300
-# scp_be_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# scp_fe_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_fe_wait_handle }
-# count: 2
-# timeout: 300
-# scp_fe_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# smp_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: smp_wait_handle }
-# count: 2
-# timeout: 300
-# smp_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# db_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: db_wait_handle }
-# count: 2
-# timeout: 300
-# db_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-
- FE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- BE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- SMP_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- DB_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
-
- FE_Clustering_KA:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_fe_cluster_net_id }
-
- FE_Clustering_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: FE_Clustering_KA }
- cidr: { get_param: int_vscp_fe_cluster_cidr }
-
- Clustering_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_cluster_net_id }
-
- Clustering_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: Clustering_Network }
- cidr: { get_param: int_vscp_cluster_cidr }
-
- DB_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_db_network_net_id }
-
- DB_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: DB_Network }
- cidr: { get_param: int_vscp_db_network_cidr }
-
- server_scp_be0:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be0_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be0 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be0_port_3 }
- - port: { get_resource: be0_port_4 }
- - port: { get_resource: be0_port_5 }
- - port: { get_resource: be0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be0_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_number2.yaml b/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_number2.yaml
deleted file mode 100644
index 28ec3358be..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/tmp/positive_artifact_number2.yaml
+++ /dev/null
@@ -1,140 +0,0 @@
-heat_template_version: 2013-05-23
-#################################
-#
-# Changes in v0.2:
-# - Unique availability zone for each VM
-# - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
-# - 2 DB VMs added
-# - Images corrected
-# - VM start-up order: SMP->DB->BE->FE (no error handling yet)
-# - Provisioning scripts placeholders
-#
-#################################
-
-description: ASC Template
-
-parameters:
- city_name:
- type: number
- description: city name
- default: 12.12
- address:
- type: string
- description: address
- default: Alonim
- home_number:
- type: number
- description: home_number
- default: 8
-resources:
-# scp_be_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_be_wait_handle }
-# count: 5
-# timeout: 300
-# scp_be_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# scp_fe_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_fe_wait_handle }
-# count: 2
-# timeout: 300
-# scp_fe_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# smp_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: smp_wait_handle }
-# count: 2
-# timeout: 300
-# smp_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# db_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: db_wait_handle }
-# count: 2
-# timeout: 300
-# db_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-
- FE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- BE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- SMP_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- DB_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
-
- FE_Clustering_KA:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_fe_cluster_net_id }
-
- FE_Clustering_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: FE_Clustering_KA }
- cidr: { get_param: int_vscp_fe_cluster_cidr }
-
- Clustering_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_cluster_net_id }
-
- Clustering_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: Clustering_Network }
- cidr: { get_param: int_vscp_cluster_cidr }
-
- DB_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_db_network_net_id }
-
- DB_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: DB_Network }
- cidr: { get_param: int_vscp_db_network_cidr }
-
- server_scp_be0:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be0_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be0 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be0_port_3 }
- - port: { get_resource: be0_port_4 }
- - port: { get_resource: be0_port_5 }
- - port: { get_resource: be0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be0_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/artifact_unsupported.yaml b/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/artifact_unsupported.yaml
deleted file mode 100644
index 764b8d4c58..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/artifact_unsupported.yaml
+++ /dev/null
@@ -1,140 +0,0 @@
-heat_template_version: 2013-05-23
-#################################
-#
-# Changes in v0.2:
-# - Unique availability zone for each VM
-# - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
-# - 2 DB VMs added
-# - Images corrected
-# - VM start-up order: SMP->DB->BE->FE (no error handling yet)
-# - Provisioning scripts placeholders
-#
-#################################
-
-description: ASC Template
-
-parameters:
- city_name:
- type: number123
- description: city name
- default: 12.12
- address:
- type: string
- description: address
- default: Alonim
- home_number:
- type: number
- description: home_number
- default: 8
-resources:
-# scp_be_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_be_wait_handle }
-# count: 5
-# timeout: 300
-# scp_be_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# scp_fe_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_fe_wait_handle }
-# count: 2
-# timeout: 300
-# scp_fe_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# smp_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: smp_wait_handle }
-# count: 2
-# timeout: 300
-# smp_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# db_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: db_wait_handle }
-# count: 2
-# timeout: 300
-# db_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-
- FE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- BE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- SMP_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- DB_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
-
- FE_Clustering_KA:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_fe_cluster_net_id }
-
- FE_Clustering_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: FE_Clustering_KA }
- cidr: { get_param: int_vscp_fe_cluster_cidr }
-
- Clustering_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_cluster_net_id }
-
- Clustering_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: Clustering_Network }
- cidr: { get_param: int_vscp_cluster_cidr }
-
- DB_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_db_network_net_id }
-
- DB_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: DB_Network }
- cidr: { get_param: int_vscp_db_network_cidr }
-
- server_scp_be0:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be0_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be0 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be0_port_3 }
- - port: { get_resource: be0_port_4 }
- - port: { get_resource: be0_port_5 }
- - port: { get_resource: be0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be0_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_bool1.yaml b/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_bool1.yaml
deleted file mode 100644
index 19119f3d9a..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_bool1.yaml
+++ /dev/null
@@ -1,140 +0,0 @@
-heat_template_version: 2013-05-23
-#################################
-#
-# Changes in v0.2:
-# - Unique availability zone for each VM
-# - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
-# - 2 DB VMs added
-# - Images corrected
-# - VM start-up order: SMP->DB->BE->FE (no error handling yet)
-# - Provisioning scripts placeholders
-#
-#################################
-
-description: ASC Template
-
-parameters:
- city_name:
- type: boolean
- description: city name
- default: K
- address:
- type: string
- description: address
- default: Alonim
- home_number:
- type: number
- description: home_number
- default: 8
-resources:
-# scp_be_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_be_wait_handle }
-# count: 5
-# timeout: 300
-# scp_be_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# scp_fe_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_fe_wait_handle }
-# count: 2
-# timeout: 300
-# scp_fe_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# smp_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: smp_wait_handle }
-# count: 2
-# timeout: 300
-# smp_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# db_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: db_wait_handle }
-# count: 2
-# timeout: 300
-# db_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-
- FE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- BE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- SMP_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- DB_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
-
- FE_Clustering_KA:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_fe_cluster_net_id }
-
- FE_Clustering_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: FE_Clustering_KA }
- cidr: { get_param: int_vscp_fe_cluster_cidr }
-
- Clustering_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_cluster_net_id }
-
- Clustering_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: Clustering_Network }
- cidr: { get_param: int_vscp_cluster_cidr }
-
- DB_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_db_network_net_id }
-
- DB_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: DB_Network }
- cidr: { get_param: int_vscp_db_network_cidr }
-
- server_scp_be0:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be0_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be0 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be0_port_3 }
- - port: { get_resource: be0_port_4 }
- - port: { get_resource: be0_port_5 }
- - port: { get_resource: be0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be0_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_bool2.yaml b/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_bool2.yaml
deleted file mode 100644
index f9c09a4fed..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_bool2.yaml
+++ /dev/null
@@ -1,140 +0,0 @@
-heat_template_version: 2013-05-23
-#################################
-#
-# Changes in v0.2:
-# - Unique availability zone for each VM
-# - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
-# - 2 DB VMs added
-# - Images corrected
-# - VM start-up order: SMP->DB->BE->FE (no error handling yet)
-# - Provisioning scripts placeholders
-#
-#################################
-
-description: ASC Template
-
-parameters:
- city_name:
- type: boolean
- description: city name
- default: 11
- address:
- type: string
- description: address
- default: Alonim
- home_number:
- type: number
- description: home_number
- default: 8
-resources:
-# scp_be_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_be_wait_handle }
-# count: 5
-# timeout: 300
-# scp_be_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# scp_fe_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_fe_wait_handle }
-# count: 2
-# timeout: 300
-# scp_fe_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# smp_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: smp_wait_handle }
-# count: 2
-# timeout: 300
-# smp_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# db_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: db_wait_handle }
-# count: 2
-# timeout: 300
-# db_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-
- FE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- BE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- SMP_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- DB_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
-
- FE_Clustering_KA:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_fe_cluster_net_id }
-
- FE_Clustering_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: FE_Clustering_KA }
- cidr: { get_param: int_vscp_fe_cluster_cidr }
-
- Clustering_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_cluster_net_id }
-
- Clustering_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: Clustering_Network }
- cidr: { get_param: int_vscp_cluster_cidr }
-
- DB_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_db_network_net_id }
-
- DB_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: DB_Network }
- cidr: { get_param: int_vscp_db_network_cidr }
-
- server_scp_be0:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be0_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be0 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be0_port_3 }
- - port: { get_resource: be0_port_4 }
- - port: { get_resource: be0_port_5 }
- - port: { get_resource: be0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be0_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_number1.yaml b/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_number1.yaml
deleted file mode 100644
index 9a489879cc..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_number1.yaml
+++ /dev/null
@@ -1,140 +0,0 @@
-heat_template_version: 2013-05-23
-#################################
-#
-# Changes in v0.2:
-# - Unique availability zone for each VM
-# - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
-# - 2 DB VMs added
-# - Images corrected
-# - VM start-up order: SMP->DB->BE->FE (no error handling yet)
-# - Provisioning scripts placeholders
-#
-#################################
-
-description: ASC Template
-
-parameters:
- city_name:
- type: number
- description: city name
- default: 1.2Noo
- address:
- type: string
- description: address
- default: Alonim
- home_number:
- type: number
- description: home_number
- default: 8
-resources:
-# scp_be_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_be_wait_handle }
-# count: 5
-# timeout: 300
-# scp_be_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# scp_fe_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_fe_wait_handle }
-# count: 2
-# timeout: 300
-# scp_fe_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# smp_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: smp_wait_handle }
-# count: 2
-# timeout: 300
-# smp_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# db_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: db_wait_handle }
-# count: 2
-# timeout: 300
-# db_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-
- FE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- BE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- SMP_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- DB_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
-
- FE_Clustering_KA:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_fe_cluster_net_id }
-
- FE_Clustering_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: FE_Clustering_KA }
- cidr: { get_param: int_vscp_fe_cluster_cidr }
-
- Clustering_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_cluster_net_id }
-
- Clustering_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: Clustering_Network }
- cidr: { get_param: int_vscp_cluster_cidr }
-
- DB_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_db_network_net_id }
-
- DB_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: DB_Network }
- cidr: { get_param: int_vscp_db_network_cidr }
-
- server_scp_be0:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be0_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be0 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be0_port_3 }
- - port: { get_resource: be0_port_4 }
- - port: { get_resource: be0_port_5 }
- - port: { get_resource: be0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be0_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_number2.yaml b/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_number2.yaml
deleted file mode 100644
index 4c0e07affc..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_number2.yaml
+++ /dev/null
@@ -1,140 +0,0 @@
-heat_template_version: 2013-05-23
-#################################
-#
-# Changes in v0.2:
-# - Unique availability zone for each VM
-# - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
-# - 2 DB VMs added
-# - Images corrected
-# - VM start-up order: SMP->DB->BE->FE (no error handling yet)
-# - Provisioning scripts placeholders
-#
-#################################
-
-description: ASC Template
-
-parameters:
- city_name:
- type: number
- description: city name
- default: 1 2 3
- address:
- type: string
- description: address
- default: Alonim
- home_number:
- type: number
- description: home_number
- default: 8
-resources:
-# scp_be_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_be_wait_handle }
-# count: 5
-# timeout: 300
-# scp_be_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# scp_fe_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_fe_wait_handle }
-# count: 2
-# timeout: 300
-# scp_fe_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# smp_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: smp_wait_handle }
-# count: 2
-# timeout: 300
-# smp_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# db_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: db_wait_handle }
-# count: 2
-# timeout: 300
-# db_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-
- FE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- BE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- SMP_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- DB_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
-
- FE_Clustering_KA:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_fe_cluster_net_id }
-
- FE_Clustering_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: FE_Clustering_KA }
- cidr: { get_param: int_vscp_fe_cluster_cidr }
-
- Clustering_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_cluster_net_id }
-
- Clustering_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: Clustering_Network }
- cidr: { get_param: int_vscp_cluster_cidr }
-
- DB_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_db_network_net_id }
-
- DB_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: DB_Network }
- cidr: { get_param: int_vscp_db_network_cidr }
-
- server_scp_be0:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be0_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be0 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be0_port_3 }
- - port: { get_resource: be0_port_4 }
- - port: { get_resource: be0_port_5 }
- - port: { get_resource: be0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be0_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_string1.yaml b/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_string1.yaml
deleted file mode 100644
index f52ef04712..0000000000
--- a/test-apis-ci/src/test/resources/CI/tests/yamlFieldsValidation/negative_artifact_string1.yaml
+++ /dev/null
@@ -1,140 +0,0 @@
-heat_template_version: 2013-05-23
-#################################
-#
-# Changes in v0.2:
-# - Unique availability zone for each VM
-# - LAN8 and SLAN networks removed according to latest Prod/Type I diagram
-# - 2 DB VMs added
-# - Images corrected
-# - VM start-up order: SMP->DB->BE->FE (no error handling yet)
-# - Provisioning scripts placeholders
-#
-#################################
-
-description: ASC Template
-
-parameters:
- city_name:
- type: string
- description: city name
- default: שלום
- address:
- type: string
- description: address
- default: Alonim
- home_number:
- type: number
- description: home_number
- default: 8
-resources:
-# scp_be_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_be_wait_handle }
-# count: 5
-# timeout: 300
-# scp_be_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# scp_fe_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: scp_fe_wait_handle }
-# count: 2
-# timeout: 300
-# scp_fe_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# smp_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: smp_wait_handle }
-# count: 2
-# timeout: 300
-# smp_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-#
-# db_wait_condition:
-# type: OS::Heat::WaitCondition
-# properties:
-# handle: { get_resource: db_wait_handle }
-# count: 2
-# timeout: 300
-# db_wait_handle:
-# type: OS::Heat::WaitConditionHandle
-
- FE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- BE_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- SMP_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
- DB_Affinity:
- type: OS::Nova::ServerGroup
- properties:
- policies: ["anti-affinity"]
-
- FE_Clustering_KA:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_fe_cluster_net_id }
-
- FE_Clustering_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: FE_Clustering_KA }
- cidr: { get_param: int_vscp_fe_cluster_cidr }
-
- Clustering_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_cluster_net_id }
-
- Clustering_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: Clustering_Network }
- cidr: { get_param: int_vscp_cluster_cidr }
-
- DB_Network:
- type: OS::Contrail::VirtualNetwork
- properties:
- name: { get_param: int_vscp_db_network_net_id }
-
- DB_Network_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: DB_Network }
- cidr: { get_param: int_vscp_db_network_cidr }
-
- server_scp_be0:
- type: OS::Nova::Server
-# depends on: db_wait_condition
- properties:
- name: { get_param: vm_scp_be0_name }
- image: { get_param: image_scp_be_id }
-# availability_zone: { get_param: availability_zone_be0 }
- flavor: { get_param: flavor_scp_be_id }
- scheduler_hints: { group: { get_resource: BE_Affinity } }
- networks:
- - port: { get_resource: be0_port_3 }
- - port: { get_resource: be0_port_4 }
- - port: { get_resource: be0_port_5 }
- - port: { get_resource: be0_port_7 }
- metadata:
- vnf_id: { get_param: vnf_id }
- user_data:
- str_replace:
- template: |
- #!/bin/bash
- #todo: provision $vm_name
- wc_notify --data-binary '{"status": "SUCCESS"}'
- params:
- $vm_name: {get_param: vm_scp_be0_name}
-# wc_notify: { get_attr: ['scp_be_wait_handle', 'curl_cli'] }
diff --git a/test-apis-ci/src/test/resources/catalogMgmtTest.properties b/test-apis-ci/src/test/resources/catalogMgmtTest.properties
deleted file mode 100644
index c65c6244f2..0000000000
--- a/test-apis-ci/src/test/resources/catalogMgmtTest.properties
+++ /dev/null
@@ -1,34 +0,0 @@
-TransportType=DME2
-Latitude =32.109333
-Longitude =34.855499
-Version =1.0
-ServiceName =dmaap-v1.onap.org/events
-Environment =TEST
-Partner=BOT_R
-routeOffer=MR1
-SubContextPath =/
-Protocol =http
-MethodType =POST
-username =onapdemo
-password =Aa123456
-contenttype = application/json
-Authorization = Basic b25hcGRlbW86QWExMjM0NTY=
-authKey=
-authDate=
-#Dmaap Server Url port 3904-HTTP 3905-https
-host=demo.onap.org:3904
-###topic=com.att.ccd.CCD-CatalogManagement-go539p or com.att.sdc.SDCforTestDev | com.att.sdc.23911-SDCforTestDev-v001
-topic=com.att.sdc.23911-SDCforTestDev-v001
-partition=1
-maxBatchSize=100
-maxAgeMs=250
-AFT_DME2_EXCHANGE_REQUEST_HANDLERS=com.att.nsa.test.PreferredRouteRequestHandler
-AFT_DME2_EXCHANGE_REPLY_HANDLERS=com.att.nsa.test.PreferredRouteReplyHandler
-AFT_DME2_REQ_TRACE_ON=true
-AFT_ENVIRONMENT=AFTUAT
-AFT_DME2_EP_CONN_TIMEOUT=15000
-AFT_DME2_ROUNDTRIP_TIMEOUT_MS=240000
-AFT_DME2_EP_READ_TIMEOUT_MS=50000
-sessionstickinessrequired=NO
-DME2preferredRouterFilePath=src/test/resources/preferredRouter.txt
-MessageSentThreadOccurance=50 \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/catalogMgmtTest.yaml b/test-apis-ci/src/test/resources/catalogMgmtTest.yaml
deleted file mode 100644
index ee419f4f50..0000000000
--- a/test-apis-ci/src/test/resources/catalogMgmtTest.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-publisherPropertiesFilePath: "catalogMgmtTest.properties"
-topicMessages:
- - "{\"transactionId\": \"221e8cbe-493d-4848-b46c-a552b8928075\",\"notificationReason\":[\"product\"],\"republish\":\"No\",\"Authorization\": \"Basic bTEzMzMxQGNjZC5hdHQuY29tOkFhMTIzNDU2\"}"
- #- "{\"transactionId\": \"221e8cbe-493d-4848-b46c-a552b8928075\",\"notificationReason\":[\"logo\"],\"republish\":\"No\"}"
- #- "{\"transactionId\": \"221e8cbe-493d-4848-b46c-a552b8928075\",\"notificationReason\":[\"availabilitymatrix\"],\"republish\":\"No\"}"
- #- "{\"transactionId\": \"221e8cbe-493d-4848-b46c-a552b8928075\",\"notificationReason\":[\"product\",\"availabilitymatrix\"],\"republish\":\"No\"}" \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/config.json b/test-apis-ci/src/test/resources/config.json
deleted file mode 100644
index 86905518b6..0000000000
--- a/test-apis-ci/src/test/resources/config.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
-
-"catalogBeHost": "behost",
-"catalogFeHost": "fehost",
-"esHost": "eshost",
-"catalogFePort": 8080,
-"catalogBePort": 8080,
-"esPort": 9200,
-"resourceConfigDir": "src/test/resources/CI/tests",
-"componentsConfigDir": "src/test/resources/CI/components"
-
-} \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/config/configuration1.yaml b/test-apis-ci/src/test/resources/config/configuration1.yaml
deleted file mode 100644
index 12ab2c777f..0000000000
--- a/test-apis-ci/src/test/resources/config/configuration1.yaml
+++ /dev/null
@@ -1,17 +0,0 @@
-version: 1.0
-released: 2012-11-30
-
-# Connection parameters
-connection:
- url: jdbc:mysql://localhost:3306/db
- poolSize: 5
-
-# Protocols
-protocols:
- - http
- - https
-
-# Users
-users:
- tom: passwd
- bob: passwd \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/config/elasticsearch.yml b/test-apis-ci/src/test/resources/config/elasticsearch.yml
deleted file mode 100644
index a6a2c1b950..0000000000
--- a/test-apis-ci/src/test/resources/config/elasticsearch.yml
+++ /dev/null
@@ -1,387 +0,0 @@
-
-cluster.name: elasticsearch_1_5_2
-
-discovery.zen.ping.multicast.enabled: false
-discovery.zen.ping.unicast.enabled: true
-discovery.zen.ping.unicast.hosts: elasticsearch_host
-
-
-
-##################### Elasticsearch Configuration Example #####################
-
-# This file contains an overview of various configuration settings,
-# targeted at operations staff. Application developers should
-# consult the guide at <http://elasticsearch.org/guide>.
-#
-# The installation procedure is covered at
-# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/setup.html>.
-#
-# Elasticsearch comes with reasonable defaults for most settings,
-# so you can try it out without bothering with configuration.
-#
-# Most of the time, these defaults are just fine for running a production
-# cluster. If you're fine-tuning your cluster, or wondering about the
-# effect of certain configuration option, please _do ask_ on the
-# mailing list or IRC channel [http://elasticsearch.org/community].
-
-# Any element in the configuration can be replaced with environment variables
-# by placing them in ${...} notation. For example:
-#
-# node.rack: ${RACK_ENV_VAR}
-
-# For information on supported formats and syntax for the config file, see
-# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/setup-configuration.html>
-
-
-################################### Cluster ###################################
-
-# Cluster name identifies your cluster for auto-discovery. If you're running
-# multiple clusters on the same network, make sure you're using unique names.
-#
-# cluster.name: elasticsearch
-
-
-#################################### Node #####################################
-
-# Node names are generated dynamically on startup, so you're relieved
-# from configuring them manually. You can tie this node to a specific name:
-#
-# node.name: "Franz Kafka"
-
-# Every node can be configured to allow or deny being eligible as the master,
-# and to allow or deny to store the data.
-#
-# Allow this node to be eligible as a master node (enabled by default):
-#
-# node.master: true
-#
-# Allow this node to store data (enabled by default):
-#
-# node.data: true
-
-# You can exploit these settings to design advanced cluster topologies.
-#
-# 1. You want this node to never become a master node, only to hold data.
-# This will be the "workhorse" of your cluster.
-#
-# node.master: false
-# node.data: true
-#
-# 2. You want this node to only serve as a master: to not store any data and
-# to have free resources. This will be the "coordinator" of your cluster.
-#
-# node.master: true
-# node.data: false
-#
-# 3. You want this node to be neither master nor data node, but
-# to act as a "search load balancer" (fetching data from nodes,
-# aggregating results, etc.)
-#
-# node.master: false
-# node.data: false
-
-# Use the Cluster Health API [http://localhost:9200/_cluster/health], the
-# Node Info API [http://localhost:9200/_nodes] or GUI tools
-# such as <http://www.elasticsearch.org/overview/marvel/>,
-# <http://github.com/karmi/elasticsearch-paramedic>,
-# <http://github.com/lukas-vlcek/bigdesk> and
-# <http://mobz.github.com/elasticsearch-head> to inspect the cluster state.
-
-# A node can have generic attributes associated with it, which can later be used
-# for customized shard allocation filtering, or allocation awareness. An attribute
-# is a simple key value pair, similar to node.key: value, here is an example:
-#
-# node.rack: rack314
-
-# By default, multiple nodes are allowed to start from the same installation location
-# to disable it, set the following:
-# node.max_local_storage_nodes: 1
-
-
-#################################### Index ####################################
-
-# You can set a number of options (such as shard/replica options, mapping
-# or analyzer definitions, translog settings, ...) for indices globally,
-# in this file.
-#
-# Note, that it makes more sense to configure index settings specifically for
-# a certain index, either when creating it or by using the index templates API.
-#
-# See <http://elasticsearch.org/guide/en/elasticsearch/reference/current/index-modules.html> and
-# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/indices-create-index.html>
-# for more information.
-
-# Set the number of shards (splits) of an index (5 by default):
-#
-# index.number_of_shards: 5
-
-# Set the number of replicas (additional copies) of an index (1 by default):
-#
-# index.number_of_replicas: 1
-
-# Note, that for development on a local machine, with small indices, it usually
-# makes sense to "disable" the distributed features:
-#
-index.number_of_shards: 1
-index.number_of_replicas: 0
-
-# These settings directly affect the performance of index and search operations
-# in your cluster. Assuming you have enough machines to hold shards and
-# replicas, the rule of thumb is:
-#
-# 1. Having more *shards* enhances the _indexing_ performance and allows to
-# _distribute_ a big index across machines.
-# 2. Having more *replicas* enhances the _search_ performance and improves the
-# cluster _availability_.
-#
-# The "number_of_shards" is a one-time setting for an index.
-#
-# The "number_of_replicas" can be increased or decreased anytime,
-# by using the Index Update Settings API.
-#
-# Elasticsearch takes care about load balancing, relocating, gathering the
-# results from nodes, etc. Experiment with different settings to fine-tune
-# your setup.
-
-# Use the Index Status API (<http://localhost:9200/A/_status>) to inspect
-# the index status.
-
-
-#################################### Paths ####################################
-
-# Path to directory containing configuration (this file and logging.yml):
-#
-path.conf: /src/test/resources
-
-# Path to directory where to store index data allocated for this node.
-#
-path.data: target/esdata
-#
-# Can optionally include more than one location, causing data to be striped across
-# the locations (a la RAID 0) on a file level, favouring locations with most free
-# space on creation. For example:
-#
-# path.data: /path/to/data1,/path/to/data2
-
-# Path to temporary files:
-#
-path.work: /target/eswork
-
-# Path to log files:
-#
-path.logs: /target/eslogs
-
-# Path to where plugins are installed:
-#
-# path.plugins: /path/to/plugins
-
-
-#################################### Plugin ###################################
-
-# If a plugin listed here is not installed for current node, the node will not start.
-#
-# plugin.mandatory: mapper-attachments,lang-groovy
-
-
-################################### Memory ####################################
-
-# Elasticsearch performs poorly when JVM starts swapping: you should ensure that
-# it _never_ swaps.
-#
-# Set this property to true to lock the memory:
-#
-# bootstrap.mlockall: true
-
-# Make sure that the ES_MIN_MEM and ES_MAX_MEM environment variables are set
-# to the same value, and that the machine has enough memory to allocate
-# for Elasticsearch, leaving enough memory for the operating system itself.
-#
-# You should also make sure that the Elasticsearch process is allowed to lock
-# the memory, eg. by using `ulimit -l unlimited`.
-
-
-############################## Network And HTTP ###############################
-
-# Elasticsearch, by default, binds itself to the 0.0.0.0 address, and listens
-# on port [9200-9300] for HTTP traffic and on port [9300-9400] for node-to-node
-# communication. (the range means that if the port is busy, it will automatically
-# try the next port).
-
-# Set the bind address specifically (IPv4 or IPv6):
-#
-# network.bind_host: 192.168.0.1
-
-# Set the address other nodes will use to communicate with this node. If not
-# set, it is automatically derived. It must point to an actual IP address.
-#
-# network.publish_host: 192.168.0.1
-
-# Set both 'bind_host' and 'publish_host':
-#
-# network.host: 192.168.0.1
-
-# Set a custom port for the node to node communication (9300 by default):
-#
-# transport.tcp.port: 9300
-
-# Enable compression for all communication between nodes (disabled by default):
-#
-# transport.tcp.compress: true
-
-# Set a custom port to listen for HTTP traffic:
-#
-# http.port: 9200
-
-# Set a custom allowed content length:
-#
-# http.max_content_length: 100mb
-
-# Disable HTTP completely:
-#
-# http.enabled: false
-
-
-################################### Gateway ###################################
-
-# The gateway allows for persisting the cluster state between full cluster
-# restarts. Every change to the state (such as adding an index) will be stored
-# in the gateway, and when the cluster starts up for the first time,
-# it will read its state from the gateway.
-
-# There are several types of gateway implementations. For more information, see
-# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/modules-gateway.html>.
-
-# The default gateway type is the "local" gateway (recommended):
-#
-# gateway.type: local
-
-# Settings below control how and when to start the initial recovery process on
-# a full cluster restart (to reuse as much local data as possible when using shared
-# gateway).
-
-# Allow recovery process after N nodes in a cluster are up:
-#
-gateway.recover_after_nodes: 1
-
-# Set the timeout to initiate the recovery process, once the N nodes
-# from previous setting are up (accepts time value):
-#
-# gateway.recover_after_time: 5m
-
-# Set how many nodes are expected in this cluster. Once these N nodes
-# are up (and recover_after_nodes is met), begin recovery process immediately
-# (without waiting for recover_after_time to expire):
-#
-gateway.expected_nodes: 1
-
-
-############################# Recovery Throttling #############################
-
-# These settings allow to control the process of shards allocation between
-# nodes during initial recovery, replica allocation, rebalancing,
-# or when adding and removing nodes.
-
-# Set the number of concurrent recoveries happening on a node:
-#
-# 1. During the initial recovery
-#
-# cluster.routing.allocation.node_initial_primaries_recoveries: 4
-#
-# 2. During adding/removing nodes, rebalancing, etc
-#
-# cluster.routing.allocation.node_concurrent_recoveries: 2
-
-# Set to throttle throughput when recovering (eg. 100mb, by default 20mb):
-#
-# indices.recovery.max_bytes_per_sec: 20mb
-
-# Set to limit the number of open concurrent streams when
-# recovering a shard from a peer:
-#
-# indices.recovery.concurrent_streams: 5
-
-
-################################## Discovery ##################################
-
-# Discovery infrastructure ensures nodes can be found within a cluster
-# and master node is elected. Multicast discovery is the default.
-
-# Set to ensure a node sees N other master eligible nodes to be considered
-# operational within the cluster. Its recommended to set it to a higher value
-# than 1 when running more than 2 nodes in the cluster.
-#
-# discovery.zen.minimum_master_nodes: 1
-
-# Set the time to wait for ping responses from other nodes when discovering.
-# Set this option to a higher value on a slow or congested network
-# to minimize discovery failures:
-#
-# discovery.zen.ping.timeout: 3s
-
-# For more information, see
-# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/modules-discovery-zen.html>
-
-# Unicast discovery allows to explicitly control which nodes will be used
-# to discover the cluster. It can be used when multicast is not present,
-# or to restrict the cluster communication-wise.
-#
-# 1. Disable multicast discovery (enabled by default):
-#
-# discovery.zen.ping.multicast.enabled: false
-#
-# 2. Configure an initial list of master nodes in the cluster
-# to perform discovery when new nodes (master or data) are started:
-#
-# discovery.zen.ping.unicast.hosts: ["host1", "host2:port"]
-
-# EC2 discovery allows to use AWS EC2 API in order to perform discovery.
-#
-# You have to install the cloud-aws plugin for enabling the EC2 discovery.
-#
-# For more information, see
-# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/modules-discovery-ec2.html>
-#
-# See <http://elasticsearch.org/tutorials/elasticsearch-on-ec2/>
-# for a step-by-step tutorial.
-
-# GCE discovery allows to use Google Compute Engine API in order to perform discovery.
-#
-# You have to install the cloud-gce plugin for enabling the GCE discovery.
-#
-# For more information, see <https://github.com/elasticsearch/elasticsearch-cloud-gce>.
-
-# Azure discovery allows to use Azure API in order to perform discovery.
-#
-# You have to install the cloud-azure plugin for enabling the Azure discovery.
-#
-# For more information, see <https://github.com/elasticsearch/elasticsearch-cloud-azure>.
-
-################################## Slow Log ##################################
-
-# Shard level query and fetch threshold logging.
-
-#index.search.slowlog.threshold.query.warn: 10s
-#index.search.slowlog.threshold.query.info: 5s
-#index.search.slowlog.threshold.query.debug: 2s
-#index.search.slowlog.threshold.query.trace: 500ms
-
-#index.search.slowlog.threshold.fetch.warn: 1s
-#index.search.slowlog.threshold.fetch.info: 800ms
-#index.search.slowlog.threshold.fetch.debug: 500ms
-#index.search.slowlog.threshold.fetch.trace: 200ms
-
-#index.indexing.slowlog.threshold.index.warn: 10s
-#index.indexing.slowlog.threshold.index.info: 5s
-#index.indexing.slowlog.threshold.index.debug: 2s
-#index.indexing.slowlog.threshold.index.trace: 500ms
-
-################################## GC Logging ################################
-
-#monitor.jvm.gc.young.warn: 1000ms
-#monitor.jvm.gc.young.info: 700ms
-#monitor.jvm.gc.young.debug: 400ms
-
-#monitor.jvm.gc.old.warn: 10s
-#monitor.jvm.gc.old.info: 5s
-#monitor.jvm.gc.old.debug: 2s
-
diff --git a/test-apis-ci/src/test/resources/config/test-apis-ci/DME2preferredRouter.txt b/test-apis-ci/src/test/resources/config/test-apis-ci/DME2preferredRouter.txt
deleted file mode 100644
index e69de29bb2..0000000000
--- a/test-apis-ci/src/test/resources/config/test-apis-ci/DME2preferredRouter.txt
+++ /dev/null
diff --git a/test-apis-ci/src/test/resources/config/test-apis-ci/configuration.yaml b/test-apis-ci/src/test/resources/config/test-apis-ci/configuration.yaml
deleted file mode 100644
index 6943e9b024..0000000000
--- a/test-apis-ci/src/test/resources/config/test-apis-ci/configuration.yaml
+++ /dev/null
@@ -1,415 +0,0 @@
-identificationHeaderFields:
- - HTTP_IV_USER
- - HTTP_CSP_FIRSTNAME
- - HTTP_CSP_LASTNAME
- - HTTP_IV_REMOTE_ADDRESS
- - HTTP_CSP_WSTYPE
-
-# catalog backend hostname
-beFqdn: localhost
-# sdccatalog.att.com
-
-# catalog backend http port
-beHttpPort: 8080
-
-# catalog backend http context
-beContext: /sdc/rest/config/get
-
-# catalog backend protocol
-beProtocol: http
-
-# catalog backend ssl port
-beSslPort: 8443
-
-version: 1.1.0
-released: 2012-11-30
-toscaConformanceLevel: 8.0
-minToscaConformanceLevel: 3.0
-
-janusGraphCfgFile: /home/vagrant/catalog-be/config/catalog-be/janusgraph.properties
-janusGraphInMemoryGraph: false
-janusGraphLockTimeout: 1800
-
-# The interval to try and reconnect to janusGraph DB when it is down during ASDC startup:
-janusGraphReconnectIntervalInSeconds: 3
-
-# The read timeout towards JanusGraph DB when health check is invoked:
-janusGraphHealthCheckReadTimeout: 1
-
-# The interval to try and reconnect to Elasticsearch when it is down during ASDC startup:
-esReconnectIntervalInSeconds: 3
-uebHealthCheckReconnectIntervalInSeconds: 15
-uebHealthCheckReadTimeout: 4
-
-# Protocols
-protocols:
- - http
- - https
-
-# Default imports
-defaultImports:
- - nodes:
- file: nodes.yml
- - datatypes:
- file: data.yml
- - capabilities:
- file: capabilities.yml
- - relationships:
- file: relationships.yml
- - groups:
- file: groups.yml
- - policies:
- file: policies.yml
-
-# Users
-users:
- tom: passwd
- bob: passwd
-
-neo4j:
- host: neo4jhost
- port: 7474
- user: neo4j
- password: "Pass"
-
-cassandraConfig:
- cassandraHosts: ['localhost']
- localDataCenter: datacenter1
- reconnectTimeout : 30000
- authenticate: false
- username: koko
- password: "Pass"
- ssl: false
- truststorePath : /path/path
- truststorePassword : "Pass"
- keySpaces:
- - { name: sdcaudit, replicationStrategy: SimpleStrategy, replicationInfo: ['1']}
- - { name: sdcartifact, replicationStrategy: SimpleStrategy, replicationInfo: ['1']}
- - { name: sdccomponent, replicationStrategy: SimpleStrategy, replicationInfo: ['1']}
- - { name: sdcrepository, replicationStrategy: SimpleStrategy, replicationInfo: ['1']}
-
-#Application-specific settings of ES
-elasticSearch:
- # Mapping of index prefix to time-based frame. For example, if below is configured:
- #
- # - indexPrefix: auditingevents
- # creationPeriod: minute
- #
- # then ES object of type which is mapped to "auditingevents-*" template, and created on 2015-12-23 13:24:54, will enter "auditingevents-2015-12-23-13-24" index.
- # Another object created on 2015-12-23 13:25:54, will enter "auditingevents-2015-12-23-13-25" index.
- # If creationPeriod: month, both of the above will enter "auditingevents-2015-12" index.
- #
- # PLEASE NOTE: the timestamps are created in UTC/GMT timezone! This is needed so that timestamps will be correctly presented in Kibana.
- #
- # Legal values for creationPeriod - year, month, day, hour, minute, none (meaning no time-based behaviour).
- #
- # If no creationPeriod is configured for indexPrefix, default behavour is creationPeriod: month.
-
- indicesTimeFrequency:
- - indexPrefix: auditingevents
- creationPeriod: month
- - indexPrefix: monitoring_events
- creationPeriod: month
-
-licenseTypes:
- - User
- - Installation
- - CPU
-
-#Deployment artifacts placeHolder
-resourceTypes: &allResourceTypes
- - VFC
- - CP
- - VL
- - VF
- - VFCMT
- - Abstract
- - CVFC
-
-# validForResourceTypes usage
-# validForResourceTypes:
-# - VF
-# - VL
-deploymentResourceArtifacts:
-# heat:
-# displayName: "Base HEAT Template"
-# type: HEAT
-# validForResourceTypes: *allResourceTypes
-# heatVol:
-# displayName: "Volume HEAT Template"
-# type: HEAT_VOL
-# validForResourceTypes: *allResourceTypes
-# heatNet:
-# displayName: "Network HEAT Template"
-# type: HEAT_NET
-# validForResourceTypes: *allResourceTypes
-
-deploymentResourceInstanceArtifacts:
- heatEnv:
- displayName: "HEAT ENV"
- type: HEAT_ENV
- description: "Auto-generated HEAT Environment deployment artifact"
- fileExtension: "env"
- VfHeatEnv:
- displayName: "VF HEAT ENV"
- type: HEAT_ENV
- description: "VF Auto-generated HEAT Environment deployment artifact"
- fileExtension: "env"
-
-#tosca artifacts placeholders
-toscaArtifacts:
- assetToscaTemplate:
- artifactName: -template.yml
- displayName: Tosca Template
- type: TOSCA_TEMPLATE
- description: TOSCA representation of the asset
- assetToscaCsar:
- artifactName: -csar.csar
- displayName: Tosca Model
- type: TOSCA_CSAR
- description: TOSCA definition package of the asset
-
-
-#Informational artifacts placeHolder
-excludeResourceCategory:
- - Generic
-excludeResourceType:
- - PNF
-informationalResourceArtifacts:
- features:
- displayName: Features
- type: OTHER
- capacity:
- displayName: Capacity
- type: OTHER
- vendorTestResult:
- displayName: Vendor Test Result
- type: OTHER
- testScripts:
- displayName: Test Scripts
- type: OTHER
- CloudQuestionnaire:
- displayName: Cloud Questionnaire (completed)
- type: OTHER
- HEATTemplateFromVendor:
- displayName: HEAT Template from Vendor
- type: HEAT
- resourceSecurityTemplate:
- displayName: Resource Security Template
- type: OTHER
-
-excludeServiceCategory:
-
-informationalServiceArtifacts:
- serviceArtifactPlan:
- displayName: Service Artifact Plan
- type: OTHER
- summaryOfImpactsToECOMPElements:
- displayName: Summary of impacts to ECOMP elements,OSSs, BSSs
- type: OTHER
- controlLoopFunctions:
- displayName: Control Loop Functions
- type: OTHER
- dimensioningInfo:
- displayName: Dimensioning Info
- type: OTHER
- affinityRules:
- displayName: Affinity Rules
- type: OTHER
- operationalPolicies:
- displayName: Operational Policies
- type: OTHER
- serviceSpecificPolicies:
- displayName: Service-specific Policies
- type: OTHER
- engineeringRules:
- displayName: Engineering Rules (ERD)
- type: OTHER
- distributionInstructions:
- displayName: Distribution Instructions
- type: OTHER
- certificationTestResults:
- displayName: TD Certification Test Results
- type: OTHER
- deploymentVotingRecord:
- displayName: Deployment Voting Record
- type: OTHER
- serviceQuestionnaire:
- displayName: Service Questionnaire
- type: OTHER
- serviceSecurityTemplate:
- displayName: Service Security Template
- type: OTHER
-
-serviceApiArtifacts:
- configuration:
- displayName: Configuration
- type: OTHER
- instantiation:
- displayName: Instantiation
- type: OTHER
- monitoring:
- displayName: Monitoring
- type: OTHER
- reporting:
- displayName: Reporting
- type: OTHER
- logging:
- displayName: Logging
- type: OTHER
- testing:
- displayName: Testing
- type: OTHER
-
-additionalInformationMaxNumberOfKeys: 50
-
-systemMonitoring:
- enabled: false
- isProxy: false
- probeIntervalInSeconds: 15
-
-defaultHeatArtifactTimeoutMinutes: 60
-
-requirementsToFulfillBeforeCert:
-
-capabilitiesToConsumeBeforeCert:
-
-unLoggedUrls:
- - /sdc2/rest/healthCheck
-
-cleanComponentsConfiguration:
- cleanIntervalInMinutes: 1440
- componentsToClean:
- - Resource
- - Service
-
-artifactsIndex: resources
-
-heatEnvArtifactHeader: ""
-heatEnvArtifactFooter: ""
-
-onboarding:
- protocol: http
- host: localhost
- port: 8080
- downloadCsarUri: "/onboarding-api/v1.0/vendor-software-products/packages"
- healthCheckUri: "/onboarding-api/v1.0/healthcheck"
-
-dcae:
- protocol: http
- host: 127.0.0.1
- port: 8080
- healthCheckUri: "/dcae/healthCheck"
-
-switchoverDetector:
- gBeFqdn: Onap
- gFeFqdn: Onap
- beVip: 0.0.0.0
- feVip: 0.0.0.0
- beResolveAttempts: 3
- feResolveAttempts: 3
- enabled: false
- interval: 60
- changePriorityUser: Onap.Sdc
- changePriorityPassword: "Pass"
- publishNetworkUrl: "http://xxx.com/crt/CipDomain.ECOMP-ASDC-DEVST/config/update_network?user=root"
- publishNetworkBody: '{"note":"publish network"}'
- groups:
- beSet: { changePriorityUrl: "http://xxx.com/crt/CipDomain.ECOMP-ASDC-DEVST/config/sites/AIO-BE.ecomp.idns.com?user=root",
- changePriorityBody: '{"name":"AIO-BE.ecomp.idns.com","uri":"/crt/CipDomain.ECOMP-ASDC-DEVST/config/sites/AIO-BE.ecomp.idns.com","no_ad_redirection":false,"v4groups":{"failover_groups":["/crt/CipDomain.ECOMP-ASDC-DEVST/config/groups/group_mg_be","/crt/CipDomain.ECOMP-ASDC-DEVST/config/groups/group_bs_be"],"failover_policy":["FAILALL"]},"comment":"AIO BE G-fqdn","intended_app_proto":"DNS"}'}
- feSet: { changePriorityUrl: "http://xxx.com/crt/CipDomain.ECOMP-ASDC-DEVST/config/sites/AIO-FE.ecomp.idns.com?user=root",
- changePriorityBody: '{"comment":"AIO G-fqdn","name":"AIO-FE.ecomp.idns.com","v4groups":{"failover_groups":["/crt/CipDomain.ECOMP-ASDC-DEVST/config/groups/group_mg_fe","/crt/CipDomain.ECOMP-ASDC-DEVST/config/groups/group_bs_fe"],"failover_policy":["FAILALL"]},"no_ad_redirection":false,"intended_app_proto":"DNS","uri":"/crt/CipDomain.ECOMP-ASDC-DEVST/config/sites/AIO-FE.ecomp.idns.com"}'}
-
-applicationL1Cache:
- datatypes:
- enabled: true
- firstRunDelay: 10
- pollIntervalInSec: 60
-
-applicationL2Cache:
- enabled: true
- catalogL1Cache:
- enabled: true
- resourcesSizeInCache: 300
- servicesSizeInCache: 200
- productsSizeInCache: 100
- queue:
- syncIntervalInSecondes: 43200
- waitOnShutDownInMinutes: 10
- numberOfCacheWorkers: 4
-
-toscaValidators:
- stringMaxLength: 2500
-
-disableAudit: false
-
-vfModuleProperties:
- min_vf_module_instances:
- forBaseModule: 1
- forNonBaseModule: 0
- max_vf_module_instances:
- forBaseModule: 1
- forNonBaseModule:
- initial_count:
- forBaseModule: 1
- forNonBaseModule: 0
- vf_module_type:
- forBaseModule: Base
- forNonBaseModule: Expansion
-
-genericAssetNodeTypes:
- VFC: org.openecomp.resource.abstract.nodes.VFC
- CVFC: org.openecomp.resource.abstract.nodes.VFC
- VF : org.openecomp.resource.abstract.nodes.VF
- PNF: org.openecomp.resource.abstract.nodes.PNF
- Service: org.openecomp.resource.abstract.nodes.service
-
-workloadContext: Production
-environmentContext:
- defaultValue: General_Revenue-Bearing
- validValues:
- - Critical_Revenue-Bearing
- - Vital_Revenue-Bearing
- - Essential_Revenue-Bearing
- - Important_Revenue-Bearing
- - Needed_Revenue-Bearing
- - Useful_Revenue-Bearing
- - General_Revenue-Bearing
- - Critical_Non-Revenue
- - Vital_Non-Revenue
- - Essential_Non-Revenue
- - Important_Non-Revenue
- - Needed_Non-Revenue
- - Useful_Non-Revenue
- - General_Non-Revenue
-
-dmaapConsumerConfiguration:
- hosts: Demo.onap.org
- consumerGroup: asdc
- consumerId: mama
- timeoutMs: 15000
- limit: 1
- pollingInterval: 2
- topic: com.att.sdc.23911-SDCforTestDev-v001
- latitude: 32.109333
- longitude: 34.855499
- version: 1.0
- serviceName: dmaap.onap.org/events
- environment: TEST
- partner: BOT_R
- routeOffer: MR1
- protocol: https
- contenttype: application/json
- dme2TraceOn: true
- aftEnvironment: AFTUAT
- aftDme2ConnectionTimeoutMs: 15000
- aftDme2RoundtripTimeoutMs: 240000
- aftDme2ReadTimeoutMs: 50000
- dme2preferredRouterFilePath: DME2preferredRouter.txt
- timeLimitForNotificationHandleMs: 0
- credential:
- username: Onap_demo
- password: Pass
-
-dmeConfiguration:
- lookupUriFormat: "http://DME2RESOLVE/service=%s/version=1.0.0/envContext=%s/routeOffer=DEFAULT"
diff --git a/test-apis-ci/src/test/resources/config/test-apis-ci/distribution-engine-configuration.yaml b/test-apis-ci/src/test/resources/config/test-apis-ci/distribution-engine-configuration.yaml
deleted file mode 100644
index 00ae8f59c0..0000000000
--- a/test-apis-ci/src/test/resources/config/test-apis-ci/distribution-engine-configuration.yaml
+++ /dev/null
@@ -1,77 +0,0 @@
-uebServers:
- - uebsb91kcdc.it.att.com
- - uebsb92kcdc.it.att.com
-# - uebsb93kcdc.it.att.com
-
-uebPublicKey: 8F3MDAtMSBwwpSMy
-
-uebSecretKey: gzFmsTxSCtO5RQfAccM6PqqX
-
-distributionNotifTopicName: ASDC-DISTR-NOTIF-TOPIC
-distributionStatusTopicName: ASDC-DISTR-STATUS-TOPIC
-
-initRetryIntervalSec: 5
-initMaxIntervalSec: 60
-
-distribNotifServiceArtifactTypes:
- info:
- - MURANO-PKG
-
-distribNotifResourceArtifactTypes:
- lifecycle:
- - HEAT
- - DG-XML
-
-environments:
- - PROD
-
-distributionStatusTopic:
- pollingIntervalSec: 60
- fetchTimeSec: 15
- consumerGroup: asdc
- consumerId: asdc-id
-
-distributionNotificationTopic:
- minThreadPoolSize: 0
- maxThreadPoolSize: 10
- maxWaitingAfterSendingSeconds: 5
-
-createTopic:
- partitionCount: 1
- replicationCount: 1
-
-startDistributionEngine: true
-
-
-aaiConfig:
- serverRootUrl: https://127.0.0.1/aai/v1
- resourceNamespaces:
- operationalEnvironments: /aai/cloud-infrastructure/operational-environments
-
- httpRequestConfig:
- readTimeoutMs: 5000
- connectTimeoutMs: 1000
- maxReadConnectionRetry: 3
- userName: abcd
- password: hmXYcznAljMSisdy8zgcag==
- clientSslAuthentication: false
- keyStore: opt/app/catalog-be/cert/.keystore
- keyStorePassword: hmXYcznAljMSisdy8zgcag==
-
- httpRequestHeaders:
- XFromAppId: asdc
-
-opEnvRecoveryIntervalSec: 180
-allowedTimeBeforeStaleSec: 300
-
-msoConfig:
- serverRootUrl: https://127.0.0.1/onap/so/infra/modelDistributions/v1
- resourceNamespaces:
- distributions: /distributions
-
- httpClientConfig:
- readTimeout: 2000
- connectTimeout: 500
- numOfRetries: 3
- userName: asdc
- password: OTLEp5lfVhYdyw5EAtTUBQ== \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/config/test-apis-ci/ecomp-error-configuration.yaml b/test-apis-ci/src/test/resources/config/test-apis-ci/ecomp-error-configuration.yaml
deleted file mode 100644
index 9d7cd74a2b..0000000000
--- a/test-apis-ci/src/test/resources/config/test-apis-ci/ecomp-error-configuration.yaml
+++ /dev/null
@@ -1,383 +0,0 @@
-###########################################
-# Note the conventions of the field values:
-# type can be one of: CONFIG_ERROR, SYSTEM_ERROR, DATA_ERROR, CONNECTION_PROBLEM, AUTHENTICATION_PROBLEM
-# severity can be one of: WARN, ERROR, FATAL
-# alarmSeverity can be one of: CRITICAL,MAJOR,MINOR,INFORMATIONAL,NONE
-# code is a unique integer in range of 3003-9999 (3000-3002 are occupied for internal usage)
-# The above enumeration values are out-of-the-box and can be changed in code.
-# In case of config and code mismatch, the appropriate error will be printed to log
-#
-## Range of BE codes - 3010-7999
-
-errors:
-
- BeRestApiGeneralError: {
- type: SYSTEM_ERROR,
- code: ASDC_4000,
- severity: ERROR,
- description: "Unexpected error during BE REST API execution",
- alarmSeverity: CRITICAL
- }
-
- BeHealthCheckError: {
- type: SYSTEM_ERROR,
- code: ASDC_3010,
- severity: ERROR,
- description: "Error during BE Health Check",
- alarmSeverity: CRITICAL
- }
-
- BeInitializationError: {
- type: SYSTEM_ERROR,
- code: ASDC_4019,
- severity: ERROR,
- description: "Catalog-BE was not initialized properly",
- alarmSeverity: CRITICAL
- }
-
- BeResourceMissingError: {
- type: SYSTEM_ERROR,
- code: ASDC_3011,
- severity: ERROR,
- description: "Mandatory resource %s cannot be found in repository",
- alarmSeverity: MAJOR
- }
-
- BeServiceMissingError: {
- type: SYSTEM_ERROR,
- code: ASDC_3012,
- severity: ERROR,
- description: "Mandatory service %s cannot be found in repository",
- alarmSeverity: MAJOR
- }
-
- BeFailedAddingResourceInstanceError: {
- type: SYSTEM_ERROR,
- code: ASDC_3013,
- severity: ERROR,
- description: "Failed to add resource instance of resource %s to service %s",
- alarmSeverity: MAJOR
- }
-
- BeIncorrectServiceError: {
- type: SYSTEM_ERROR,
- code: ASDC_3014,
- severity: ERROR,
- description: "Service %s is not valid",
- alarmSeverity: MAJOR
- }
-
- BeRepositoryDeleteError: {
- type: SYSTEM_ERROR,
- code: ASDC_3015,
- severity: ERROR,
- description: "Failed to delete object %s from repository",
- alarmSeverity: CRITICAL
- }
-
- BeRepositoryQueryError: {
- type: SYSTEM_ERROR,
- code: ASDC_3016,
- severity: ERROR,
- description: "Failed to fetch from repository %s",
- alarmSeverity: MAJOR
- }
-
- BeInvalidConfigurationError: {
- type: CONFIG_ERROR,
- code: ASDC_3017,
- severity: FATAL,
- description: "Configuration parameter %s is invalid. Value configured is %s",
- alarmSeverity: MAJOR
- }
-
- BeUebConnectionError: {
- type: CONNECTION_PROBLEM,
- code: ASDC_4001,
- severity: ERROR,
- description: "Connection problem towards U-EB server. Reason: %s",
- alarmSeverity: MAJOR
- }
-
- BeUebSystemError: {
- type: SYSTEM_ERROR,
- code: ASDC_3019,
- severity: ERROR,
- description: "Error occured during access to U-EB Server. Operation: %s",
- alarmSeverity: MAJOR
- }
-
- BeUebObjectNotFoundError: {
- type: DATA_ERROR,
- code: ASDC_4005,
- severity: ERROR,
- description: "Error occured during access to U-EB Server. Data not found: %s",
- alarmSeverity: MAJOR
- }
-
- BeDistributionEngineSystemError: {
- type: SYSTEM_ERROR,
- code: ASDC_3021,
- severity: ERROR,
- description: "Error occured in Distribution Engine. Failed operation: %s",
- alarmSeverity: MAJOR
- }
-
- BeUebAuthenticationError: {
- type: AUTHENTICATION_PROBLEM,
- code: ASDC_4003,
- severity: ERROR,
- description: "Authentication problem towards U-EB server. Reason: %s",
- alarmSeverity: MAJOR
- }
-
- BeUebUnkownHostError: {
- type: CONNECTION_PROBLEM,
- code: ASDC_4002,
- severity: ERROR,
- description: "Connection problem towards U-EB server. Cannot reach host %s",
- alarmSeverity: MAJOR
- }
-
- BeDistributionEngineInvalidArtifactType: {
- type: DATA_ERROR,
- code: ASDC_4006,
- severity: WARN,
- description: "The artifact type %s does not appear in the list of valid artifacts %s",
- alarmSeverity: MAJOR
- }
- BeInvalidTypeError: {
- type: DATA_ERROR,
- code: ASDC_4008,
- severity: WARN,
- description: "The type %s of %s is invalid",
- alarmSeverity: MAJOR
- }
- BeInvalidValueError: {
- type: DATA_ERROR,
- code: ASDC_3028,
- severity: WARN,
- description: "The value %s of %s from type %s is invalid",
- alarmSeverity: MAJOR
- }
-
- BeFailedDeletingResourceInstanceError: {
- type: SYSTEM_ERROR,
- code: ASDC_3029,
- severity: ERROR,
- description: "Failed to delete resource instance %s from service %s",
- alarmSeverity: MAJOR
- }
-
- BeMissingConfigurationError: {
- type: CONFIG_ERROR,
- code: ASDC_3030,
- severity: FATAL,
- description: "Configuration parameter %s is missing",
- alarmSeverity: MAJOR
- }
-
- BeConfigurationInvalidListSizeError: {
- type: CONFIG_ERROR,
- code: ASDC_3031,
- severity: FATAL,
- description: "Configuration parameter %s is invalid. At least %s values shall be configured",
- alarmSeverity: MAJOR
- }
-
- ErrorConfigFileFormat: {
- type: CONFIG_ERROR,
- code: ASDC_3032,
- severity: ERROR,
- description: "Error element not found in YAML name: %s",
- alarmSeverity: MAJOR
- }
-
- BeMissingArtifactInformationError: {
- type: DATA_ERROR,
- code: ASDC_4010,
- severity: ERROR,
- description: "Artifact uploaded has missing information. Missing %s",
- alarmSeverity: MAJOR
- }
-
- BeArtifactMissingError: {
- type: DATA_ERROR,
- code: ASDC_4011,
- severity: ERROR,
- description: "Artifact %s requested is not found",
- alarmSeverity: MAJOR
- }
-
- BeArtifactPayloadInvalid: {
- type: DATA_ERROR,
- code: ASDC_4012,
- severity: ERROR,
- description: "Payload of artifact uploaded is invalid (invalid MD5 or encryption)",
- alarmSeverity: MAJOR
- }
-
- BeUserMissingError: {
- type: DATA_ERROR,
- code: ASDC_4009,
- severity: ERROR,
- description: "User %s requested is not found",
- alarmSeverity: MAJOR
- }
-
- BeArtifactInformationInvalidError: {
- type: DATA_ERROR,
- code: ASDC_4013,
- severity: ERROR,
- description: "Input for artifact metadata is invalid",
- alarmSeverity: MAJOR
- }
- BeFailedAddingCapabilityTypeError: {
- type: DATA_ERROR,
- code: ASDC_4015,
- severity: ERROR,
- description: "Failed adding capability type",
- alarmSeverity: CRITICAL
- }
-
- BeCapabilityTypeMissingError: {
- type: DATA_ERROR,
- code: ASDC_4016,
- severity: ERROR,
- description: "Capability Type %s not found",
- alarmSeverity: CRITICAL
- }
-
- BeInterfaceMissingError: {
- type: DATA_ERROR,
- code: ASDC_4020,
- severity: ERROR,
- description: "Interface %s required is missing",
- alarmSeverity: MAJOR
- }
-
- BeDaoSystemError: {
- type: SYSTEM_ERROR,
- code: ASDC_4014,
- severity: ERROR,
- description: "Operation towards database failed",
- alarmSeverity: CRITICAL
- }
-
- BeSystemError: {
- type: SYSTEM_ERROR,
- code: ASDC_4017,
- severity: ERROR,
- description: "Unexpected error during operation",
- alarmSeverity: CRITICAL
- }
-
- BeFailedLockObjectError: {
- type: SYSTEM_ERROR,
- code: ASDC_4007,
- severity: WARN,
- description: "Failed to lock object for update",
- alarmSeverity: CRITICAL
- }
-
- BeInvalidJsonInput: {
- type: SYSTEM_ERROR,
- code: ASDC_4018,
- severity: ERROR,
- description: "Failed to convert json input to object",
- alarmSeverity: MAJOR
- }
-
- BeDistributionMissingError: {
- type: DATA_ERROR,
- code: ASDC_4021,
- severity: ERROR,
- description: "Distribution %s required is missing",
- alarmSeverity: MAJOR
- }
-
- BeHealthCheckRecovery: {
- type: RECOVERY,
- code: ASDC_4022,
- severity: INFO,
- description: "BE Health Check Recovery",
- alarmSeverity: INFORMATIONAL
- }
- BeFailedCreateNodeError: {
- type: DATA_ERROR,
- code: ASDC_6000,
- severity: ERROR,
- description: "Failed to create node %s on graph. status is %s",
- alarmSeverity: MAJOR
- }
- BeFailedUpdateNodeError: {
- type: DATA_ERROR,
- code: ASDC_6001,
- severity: ERROR,
- description: "Failed to update node %s on graph. Status is %s",
- alarmSeverity: MAJOR
- }
-
- BeFailedDeleteNodeError: {
- type: DATA_ERROR,
- code: ASDC_6002,
- severity: ERROR,
- description: "Failed to delete node %s on graph. Status is %s",
- alarmSeverity: MAJOR
- }
-
- BeFailedRetrieveNodeError: {
- type: DATA_ERROR,
- code: ASDC_6003,
- severity: ERROR,
- description: "Failed to retrieve node %s from graph. Status is %s",
- alarmSeverity: MAJOR
- }
-
- BeExecuteRollbackError: {
- type: DATA_ERROR,
- code: ASDC_6004,
- severity: ERROR,
- description: "Going to execute rollback on graph.",
- alarmSeverity: MAJOR
- }
-
- BeFailedFindParentError: {
- type: DATA_ERROR,
- code: ASDC_6005,
- severity: ERROR,
- description: "Failed to find parent node %s on graph. Status is %s",
- alarmSeverity: MAJOR
- }
-
- BeFailedFindAllNodesError: {
- type: DATA_ERROR,
- code: ASDC_6006,
- severity: ERROR,
- description: "Failed to fetch all nodes with type %s of parent node %s . Status is %s",
- alarmSeverity: MAJOR
- }
-
- BeFailedFindAssociationError: {
- type: DATA_ERROR,
- code: ASDC_6007,
- severity: ERROR,
- description: "Cannot find node with type %s associated with node %s . Status is %s",
- alarmSeverity: MAJOR
- }
-
- BeFailedFindAssociationError: {
- type: DATA_ERROR,
- code: ASDC_6008,
- severity: ERROR,
- description: "Cannot find node with type %s associated with node %s . Status is %s",
- alarmSeverity: MAJOR
- }
- BeComponentCleanerSystemError: {
- type: SYSTEM_ERROR,
- code: ASDC_6009,
- severity: ERROR,
- description: "Error occured in Component Cleaner Task. Failed operation: %s",
- alarmSeverity: MAJOR
- }
- \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/config/test-apis-ci/error-configuration.yaml b/test-apis-ci/src/test/resources/config/test-apis-ci/error-configuration.yaml
deleted file mode 100644
index 268c440222..0000000000
--- a/test-apis-ci/src/test/resources/config/test-apis-ci/error-configuration.yaml
+++ /dev/null
@@ -1,1883 +0,0 @@
-# Errors
-errors:
- OK: {
- code: 200,
- message: "OK"
- }
- CREATED: {
- code: 201,
- message: "OK"
- }
- ACCEPTED: {
- code: 202,
- message: "Accepted"
- }
- NO_CONTENT: {
- code: 204,
- message: "No Content"
- }
-#--------POL4050-----------------------------
- NOT_ALLOWED: {
- code: 405,
- message: "Error: Method not allowed.",
- messageId: "POL4050"
- }
-#--------POL5000-----------------------------
- GENERAL_ERROR: {
- code: 500,
- message: "Error: Internal Server Error. Please try again later.",
- messageId: "POL5000"
- }
-#---------POL5001------------------------------
- MISSING_X_ECOMP_INSTANCE_ID: {
- code: 400 ,
- message: "Error: Missing 'X-ECOMP-InstanceID' HTTP header.",
- messageId: "POL5001"
- }
-#---------POL5002------------------------------
- AUTH_REQUIRED: {
- code: 401 ,
- message: "Error: Authentication is required to use the API.",
- messageId: "POL5002"
- }
-#---------POL5003------------------------------
- AUTH_FAILED: {
- code: 403 ,
- message: "Error: Not authorized to use the API.",
- messageId: "POL5003"
- }
-#---------POL5004------------------------------
- MISSING_USER_ID: {
- code: 400 ,
- message: "Error: Missing 'USER_ID' HTTP header.",
- messageId: "POL5004"
- }
-#---------SVC4000-----------------------------
- INVALID_CONTENT: {
- code: 400,
- message: "Error: Invalid content.",
- messageId: "SVC4000"
- }
-#---------SVC4002-----------------------------
- MISSING_INFORMATION: {
- code: 403,
- message: "Error: Missing information.",
- messageId: "SVC4002"
- }
-#---------SVC4003------------------------------
-# %1 - Users's ID
- USER_NOT_FOUND: {
- code: 404,
- message: "Error: User '%1' was not found.",
- messageId: "SVC4003"
- }
-#---------SVC4004-----------------------------
-# %1 - Users's email address
- INVALID_EMAIL_ADDRESS: {
- code: 400,
- message: "Error: Invalid email address '%1'.",
- messageId: "SVC4004"
- }
-#---------SVC4005------------------------------
-# %1 - role
- INVALID_ROLE: {
- code: 400,
- message: "Error: Invalid role '%1'.",
- messageId: "SVC4005"
- }
-#---------SVC4006------------------------------
-# %1 - Users's USER_ID
- USER_ALREADY_EXIST: {
- code: 409,
- message: "Error: User with '%1' ID already exists.",
- messageId: "SVC4006"
- }
-#---------SVC4007------------------------------
- DELETE_USER_ADMIN_CONFLICT: {
- code: 409,
- message: "Error: An administrator can only be deleted by another administrator.",
- messageId: "SVC4007"
- }
-#---------SVC4008-----------------------------
-# %1 - Users's userId
- INVALID_USER_ID: {
- code: 400,
- message: "Error: Invalid userId '%1'.",
- messageId: "SVC4008"
- }
-
-#---------SVC4049------------------------------
-# %1 - service/resource
- COMPONENT_MISSING_CONTACT: {
- code: 400,
- message: "Error: Invalid Content. Missing %1 contact.",
- messageId: "SVC4051"
- }
-#---------SVC4050-----------------------------
-# %1 - Service/Resource/Additional parameter
-# %2 - service/resource/label name
- COMPONENT_NAME_ALREADY_EXIST: {
- code: 409,
- message: "Error: %1 with name '%2' already exists.",
- messageId: "SVC4050"
- }
-#---------SVC4051------------------------------
-# %1 - resource/service
- COMPONENT_MISSING_CATEGORY: {
- code: 400,
- message: "Error: Invalid Content. Missing %1 category.",
- messageId: "SVC4051"
- }
-
-#---------SVC4052------------------------------
- COMPONENT_MISSING_TAGS: {
- code: 400,
- message: "Error: Invalid Content. At least one tag has to be specified.",
- messageId: "SVC4052"
- }
-
-#---------SVC4053------------------------------
-# %1 - service/resource
- COMPONENT_MISSING_DESCRIPTION: {
- code: 400,
- message: "Error: Invalid Content. Missing %1 description.",
- messageId: "SVC4053"
- }
-#---------SVC4054------------------------------
-# %1 - resource/service
- COMPONENT_INVALID_CATEGORY: {
- code: 400,
- message: "Error: Invalid Content. Value %1 for the field Category is invalid.",
- messageId: "SVC4054"
- }
-#---------SVC4055------------------------------
- MISSING_VENDOR_NAME: {
- code: 400,
- message: "Error: Invalid Content. Missing vendor name.",
- messageId: "SVC4055"
- }
-#---------SVC4056------------------------------
- MISSING_VENDOR_RELEASE: {
- code: 400,
- message: "Error: Invalid Content. Missing vendor release.",
- messageId: "SVC4056"
- }
-
-#---------SVC4057------------------------------
- MISSING_DERIVED_FROM_TEMPLATE: {
- code: 400,
- message: "Error: Invalid Content. Missing derived from template specification.",
- messageId: "SVC4057"
- }
-
-#---------SVC4058------------------------------
-# %1 - service/resource
- COMPONENT_MISSING_ICON: {
- code: 400,
- message: "Error: Invalid Content. Missing %1 icon.",
- messageId: "SVC4058"
- }
-#---------SVC4059------------------------------
-# %1 - service/resource
- COMPONENT_INVALID_ICON: {
- code: 400,
- message: "Error: Invalid Content. Invalid %1 icon.",
- messageId: "SVC4059"
- }
-#---------SVC4060------------------------------
- PARENT_RESOURCE_NOT_FOUND: {
- code: 400,
- message: "Error: Invalid Content. Derived from resource template was not found.",
- messageId: "SVC4060"
- }
-#---------SVC4061------------------------------
- MULTIPLE_PARENT_RESOURCE_FOUND: {
- code: 400,
- message: "Error: Invalid Content. Multiple derived from resource template is not allowed.",
- messageId: "SVC4061"
- }
-
-#---------SVC4062------------------------------
-# %1 - service/resource
- MISSING_COMPONENT_NAME: {
- code: 400,
- message: "Error: Invalid Content. Missing %1 name.",
- messageId: "SVC4062"
- }
-#---------SVC4063------------------------------
- #%1  -  resource/service name
- RESOURCE_NOT_FOUND: {
- code: 404,
- message: "Error: Requested '%1' resource was not found.",
- messageId: "SVC4063"
- }
-
-#---------SVC4064------------------------------
-# %1 - Service/Resource/Property
- COMPONENT_INVALID_DESCRIPTION: {
- code: 400,
- message: "Error: Invalid Content. %1 description contains non-english characters.",
- messageId: "SVC4064"
- }
-#---------SVC4065------------------------------
-# %1 - Service/Resource/Property
-# %2 - max resource/service name length
- COMPONENT_DESCRIPTION_EXCEEDS_LIMIT: {
- code: 400,
- message: "Error: Invalid Content. %1 description exceeds limit of %2 characters.",
- messageId: "SVC4065"
- }
-#---------SVC4066------------------------------
-# %1 - max length
- COMPONENT_TAGS_EXCEED_LIMIT: {
- code: 400,
- message: "Error: Invalid Content. Tags overall length exceeds limit of %1 characters.",
- messageId: "SVC4066"
- }
-#---------SVC4067------------------------------
-# %1 - max length
- VENDOR_NAME_EXCEEDS_LIMIT: {
- code: 400,
- message: "Error: Invalid Content. Vendor name exceeds limit of %1 characters.",
- messageId: "SVC4067"
- }
-#---------SVC4068------------------------------
-# %1 - max length
- VENDOR_RELEASE_EXCEEDS_LIMIT: {
- code: 400,
- message: "Error: Invalid Content. Vendor release exceeds limit of %1 characters.",
- messageId: "SVC4068"
- }
-
-#---------SVC4069------------------------------
-# %1 - Service/Resource/Product
- COMPONENT_INVALID_CONTACT: {
- code: 400,
- message: "Error: Invalid Content. %1 Contact Id should be in format 'mnnnnnn' or 'aannna' or 'aannnn', where m=m ,a=a-zA-Z and n=0-9",
- messageId: "SVC4069"
- }
-#---------SVC4070------------------------------
-# %1 - Service/Resource
- INVALID_COMPONENT_NAME: {
- code: 400,
- message: 'Error: Invalid Content. Value %1 for Component name is invalid. Only alphanumeric characters and regular spaces are allowed.',
- messageId: "SVC4070"
- }
-
-#---------SVC4071------------------------------
- INVALID_VENDOR_NAME: {
- code: 400,
- message: 'Error: Invalid Content. Value %1 for the field Vendor name is invalid. Only alphanumeric characters and regular spaces are allowed.',
- messageId: "SVC4071"
- }
-#---------SVC4072------------------------------
- INVALID_VENDOR_RELEASE: {
- code: 400,
- message: 'Error: Invalid Content. Value %1 for the field Vendor release is invalid. Only alphanumeric characters and regular spaces are allowed.',
- messageId: "SVC4072"
- }
-#---------SVC4073------------------------------
-# %1 - Service/Resource
-# %2 - max resource/service name
- COMPONENT_NAME_EXCEEDS_LIMIT: {
- code: 400,
- message: "Error: Invalid Content. %1 name exceeds limit of %2 characters.",
- messageId: "SVC4073"
- }
-#---------SVC4080------------------------------
-# %1 - resource/service name
-# %2 - resource/service
-# %3 - First name of last modifier
-# %4 - Last name of last modifier
-# %5 - USER_ID of last modifier
- COMPONENT_IN_CHECKOUT_STATE: {
- code: 403,
- message: "Error: Requested '%1' %2 is locked for modification by %3 %4(%5).",
- messageId: "SVC4080"
- }
-#---------SVC4081-----------------------------
-# %1 - resource/service name
-# %2 - resource/service
-# %3 - First name of last modifier
-# %4 - Last name of last modifier
-# %5 - USER_ID of last modifier
- COMPONENT_IN_CERT_IN_PROGRESS_STATE: {
- code: 403,
- message: "Error: Requested '%1' %2 is locked for certification by %3 %4(%5).",
- messageId: "SVC4081"
- }
-
-#-----------SVC4082---------------------------
-# %1 - resource/service name
-# %2 - resource/service
-# %3 - First name of last modifier
-# %4 - Last name of last modifier
-# %5 - USER_ID of last modifier
- COMPONENT_SENT_FOR_CERTIFICATION: {
- code: 403,
- message: "Error: Requested '%1' %2 is sent for certification by %3 %4(%5).",
- messageId: "SVC4082"
- }
-#-----------SVC4083---------------------------
- COMPONENT_VERSION_ALREADY_EXIST: {
- code: 409,
- message: "Error: Version of this %1 was already promoted.",
- messageId: "SVC4083"
- }
-#-----------SVC4084---------------------------
-# %1 - resource/service/product name
-# %2 - resource/service/product
-# %3 - First name of last modifier
-# %4 - Last name of last modifier
-# %5 - USER_ID of last modifier
- COMPONENT_ALREADY_CHECKED_IN: {
- code: 409,
- message: "Error: The current version of '%1' %2 was already checked-in by %3 %4(%5).",
- messageId: "SVC4084"
- }
-#-----------SVC4085---------------------------
-# %1 - resource/service/product name
-# %2 - resource/service/product
-# %3 - First name of last modifier
-# %4 - Last name of last modifier
-# %5 - USER_ID of last modifier
- COMPONENT_CHECKOUT_BY_ANOTHER_USER: {
- code: 403,
- message: "Error: %1 %2 has already been checked out by %3 %4(%5).",
- messageId: "SVC4085"
- }
-#-----------SVC4086---------------------------
-# %1  - resource/service name
-# %2  - resource/service
- COMPONENT_IN_USE: {
- code: 403,
- message: "Error: Requested '%1' %2 is in use by another user.",
- messageId: "SVC4086"
- }
-#-----------SVC4087---------------------------
-# %1 - component name
-# %2 - resource/service/product
- COMPONENT_HAS_NEWER_VERSION: {
- code: 409,
- message: "Error: Checking out of the requested version of the '%1' %2 is not allowed as a newer version exists.",
- messageId: "SVC4087"
- }
-#-----------SVC4088---------------------------
-# %1 - resource/service name
-# %2 - resource/service
-# %3 - First name of last modifier
-# %4 - Last name of last modifier
-# %5 - USER_ID of last modifier
- COMPONENT_ALREADY_CERTIFIED: {
- code: 403,
- message: "Error: Requested %1 %2 has already been certified by %3 %4(%5).",
- messageId: "SVC4088"
- }
-#-----------SVC4089---------------------------
-# %1 - resource/service name
-# %2 - resource/service
- COMPONENT_NOT_READY_FOR_CERTIFICATION: {
- code: 403,
- message: "Error: Requested '%1' %2 is not ready for certification.",
- messageId: "SVC4089"
- }
-#-----------SVC4100---------------------------
-#%1 - property name
- PROPERTY_NOT_FOUND: {
- code: 404,
- message: "Error: Requested '%1' property was not found.",
- messageId: "SVC4100"
- }
-#-----------SVC4101---------------------------
-#%1 - property name
- PROPERTY_ALREADY_EXIST: {
- code: 409,
- message: "Error: Property with '%1' name already exists.",
- messageId: "SVC4101"
- }
-
-#-----------SVC4102---------------------------
-# %1 - capability type name
- CAPABILITY_TYPE_ALREADY_EXIST: {
- code: 409,
- message: "Error: Capability Type with name '%1' already exists.",
- messageId: "SVC4102"
- }
-#-----------SVC4114---------------------------
- AUTH_FAILED_INVALIDE_HEADER: {
- code: 400,
- message: "Error: Invalid Authorization header.",
- messageId: "SVC4114"
- }
-#-----------SVC4115---------------------------
-# %1 - capability type name
- MISSING_CAPABILITY_TYPE: {
- code: 400,
- message: "Error: Invalid Content. Missing Capability Type '%1'.",
- messageId: "SVC4115"
- }
- RESOURCE_INSTANCE_BAD_REQUEST: {
- code: 400,
- message: "Error: Invalid Content.",
- messageId: "SVC4116"
- }
-#-----------SVC4117---------------------------
-# %1 - resource instance name
-# %2 - resource instance name
-# %3 - requirement name
- RESOURCE_INSTANCE_MATCH_NOT_FOUND: {
- code: 404,
- message: "Error: Match not found between resource instance '%1' and resource instance '%2' for requirement '%3'.",
- messageId: "SVC4117"
- }
-#-----------SVC4118---------------------------
-# %1 - resource instance name
-# %2 - resource instance name
-# %3 - requirement name
- RESOURCE_INSTANCE_ALREADY_EXIST: {
- code: 409,
- message: "Error: Resource instances '%1' and '%2' are already associated with requirement '%3'.",
- messageId: "SVC4118"
- }
-#-----------SVC4119---------------------------
-# %1 - resource instance name
-# %2 - resource instance name
-# %3 - requirement name
- RESOURCE_INSTANCE_RELATION_NOT_FOUND: {
- code: 404,
- message: "Error: No relation found between resource instances '%1' and '%2' for requirement '%3'.",
- messageId: "SVC4119"
- }
-#-----------SVC4120---------------------------
-# %1 - User's USER_ID
- USER_INACTIVE: {
- code: 404,
- message: "Error: User %1 was not found.",
- messageId: "SVC4120"
- }
-#-----------SVC4121---------------------------
-# %1 - User's USER_ID
- USER_HAS_ACTIVE_ELEMENTS: {
- code: 403,
- message: "Error: User with %1 ID can not be deleted since it has active elements(resources/services/artifacts).",
- messageId: "SVC4121"
- }
-#-----------SVC4122---------------------------
-# %1 - artifact type
- ARTIFACT_TYPE_NOT_SUPPORTED: {
- code: 400,
- message: "Error: Invalid artifact type '%1'.",
- messageId: "SVC4122"
- }
-#-----------SVC4123---------------------------
- ARTIFACT_LOGICAL_NAME_CANNOT_BE_CHANGED: {
- code: 400,
- message: "Error: Artifact logical name cannot be changed.",
- messageId: "SVC4123"
- }
-#-----------SVC4124---------------------------
- MISSING_ARTIFACT_TYPE: {
- code: 400,
- message: "Error: Missing artifact type.",
- messageId: "SVC4124"
- }
-#-----------SVC4125---------------------------
-# %1-artifact name
- ARTIFACT_EXIST: {
- code: 400,
- message: "Error: Artifact '%1' already exists.",
- messageId: "SVC4125"
- }
-#---------SVC4126------------------------------
-# %1 - resource/service/product/...
-# %2 - field (tag, vendor name...)
- INVALID_FIELD_FORMAT: {
- code: 400,
- message: "Error: Invalid %1 %2 format.",
- messageId: "SVC4126"
- }
-#-----------SVC4127---------------------------
- ARTIFACT_INVALID_MD5: {
- code: 400,
- message: "Error: Invalid artifact checksum.",
- messageId: "SVC4127"
- }
-#-----------SVC4128---------------------------
- MISSING_ARTIFACT_NAME: {
- code: 400,
- message: "Error: Invalid content. Missing artifact name.",
- messageId: "SVC4128"
- }
-#-----------SVC4129---------------------------
- MISSING_PROJECT_CODE: {
- code: 400,
- message: "Error: Invalid Content. Missing PROJECT_CODE number.",
- messageId: "SVC4129"
- }
-#-----------SVC4130---------------------------
- INVALID_PROJECT_CODE: {
- code: 400,
- message: "Error: Invalid Content. PROJECT_CODE must be from 3 up to 50 characters.",
- messageId: "SVC4130"
- }
-#-----------SVC4131---------------------------
-# %1-resource/service
-# %2-srtifact/artifacts
-# %3-semicolomn separated list of artifact
- COMPONENT_MISSING_MANDATORY_ARTIFACTS: {
- code: 403,
- message: "Error: Missing mandatory informational %1 %2: [%3].",
- messageId: "SVC4131"
- }
-#-----------SVC4132---------------------------
-# %1 - lifecycle type name
- LIFECYCLE_TYPE_ALREADY_EXIST: {
- code: 409,
- message: "Error: Lifecycle Type with name '%1' already exists.",
- messageId: "SVC4132"
- }
-#-----------SVC4133---------------------------
-# %1 - service version
-# %2 - service name
- SERVICE_NOT_AVAILABLE_FOR_DISTRIBUTION: {
- code: 403,
- message: "Error: Version %1 of '%2' service is not available for distribution.",
- messageId: "SVC4133"
- }
-#-----------SVC4134---------------------------
- MISSING_LIFECYCLE_TYPE: {
- code: 400,
- message: "Error: Invalid Content. Missing interface life-cycle type.",
- messageId: "SVC4134"
- }
-#---------SVC4135------------------------------
- SERVICE_CATEGORY_CANNOT_BE_CHANGED: {
- code: 400,
- message: "Error: Service category cannot be changed once the service is certified.",
- messageId: "SVC4135"
- }
-#---------SVC4136------------------------------
-# %1 - distribution environment name
- DISTRIBUTION_ENVIRONMENT_NOT_AVAILABLE: {
- code: 500,
- message: "Error: Requested distribution environment '%1' is not available.",
- messageId: "SVC4136"
- }
-#---------SVC4137------------------------------
-# %1 - distribution environment name
- DISTRIBUTION_ENVIRONMENT_NOT_FOUND: {
- code: 400,
- message: "Error: Requested distribution environment '%1' was not found.",
- messageId: "SVC4137"
- }
-#---------SVC4138------------------------------
- DISTRIBUTION_ENVIRONMENT_INVALID: {
- code: 400,
- message: "Error: Invalid distribution environment.",
- messageId: "SVC4138"
- }
-#---------SVC4139------------------------------
-# %1 - service name
- DISTRIBUTION_ARTIFACT_NOT_FOUND: {
- code: 409,
- message: "Error: Service '%1' cannot be distributed due to missing deployment artifacts.",
- messageId: "SVC4139"
- }
-#---------SVC4200------------------------------
-# %1 - Service/Resource
-# %2 - max icon name length
- COMPONENT_ICON_EXCEEDS_LIMIT: {
- code: 400,
- message: "Error: Invalid Content. %1 icon name exceeds limit of %2 characters.",
- messageId: "SVC4200"
- }
-#---------SVC4300------------------------------
- RESTRICTED_ACCESS: {
- code: 403,
- message: "Error: Restricted access.",
- messageId: "SVC4300"
- }
-#---------SVC4301------------------------------
- RESTRICTED_OPERATION: {
- code: 409,
- message: "Error: Restricted operation.",
- messageId: "SVC4301"
- }
-#---------SVC4500------------------------------
- MISSING_BODY: {
- code: 400 ,
- message: "Error: Missing request body.",
- messageId: "SVC4500"
- }
-#---------SVC4501------------------------------
- MISSING_PUBLIC_KEY: {
- code: 400 ,
- message: "Error: Invalid Content. Missing mandatory parameter 'apiPublicKey'." ,
- messageId: "SVC4501"
- }
-#---------SVC4502------------------------------
- DISTRIBUTION_ENV_DOES_NOT_EXIST: {
- code: 400 ,
- message: "Error: Invalid Body : Missing mandatory parameter 'distrEnvName'." ,
- messageId: "SVC4502"
- }
-#-----------SVC4503---------------------------
-# %1 - service name
- SERVICE_NOT_FOUND: {
- code: 404,
- message: "Error: Requested '%1' service was not found.",
- messageId: "SVC4503"
- }
-
-#---------SVC4504------------------------------
-# %1 - Service/Resource
-# %2 - service/resource version
- COMPONENT_VERSION_NOT_FOUND: {
- code: 404,
- message: "Error: %1 version %2 was not found.",
- messageId: "SVC4504"
- }
-#-----------SVC4505---------------------------
- #%1-artifact name
-
- ARTIFACT_NOT_FOUND: {
- code: 404,
- message: "Error: Artifact '%1' was not found.",
- messageId: "SVC4505"
- }
-#---------SVC4506------------------------------
- MISSING_ENV_NAME: {
- code: 400 ,
- message: "Error: Invalid Content. Missing mandatory parameter 'distrEnvName'.",
- messageId: "SVC4506"
- }
-#---------SVC4507------------------------------
- COMPONENT_INVALID_TAGS_NO_COMP_NAME: {
- code: 400,
- message: "Error: Invalid Content. One of the tags should be the component name.",
- messageId: "SVC4507"
- }
-
-#---------SVC4508------------------------------
- SERVICE_NAME_CANNOT_BE_CHANGED: {
- code: 400,
- message: "Error: Service name cannot be changed once the service is certified.",
- messageId: "SVC4508"
- }
-
-#---------SVC4509------------------------------
- SERVICE_ICON_CANNOT_BE_CHANGED: {
- code: 400,
- message: "Error: Icon cannot be changed once the service is certified.",
- messageId: "SVC4509"
- }
-#---------SVC4510------------------------------
-# %1 - icon name max length
- SERVICE_ICON_EXCEEDS_LIMIT: {
- code: 400,
- message: "Error: Invalid Content. Icon name exceeds limit of %1 characters.",
- messageId: "SVC4510"
- }
-#---------SVC4511------------------------------
- DISTRIBUTION_REQUESTED_NOT_FOUND: {
- code: 404,
- message: "Error: Requested distribution was not found.",
- messageId: "SVC4511"
- }
-#---------SVC4512------------------------------
-# %1 - Distribution ID
- DISTRIBUTION_REQUESTED_FAILED: {
- code: 403,
- message: "Error: Requested distribution '%1' failed.",
- messageId: "SVC4512"
- }
-#---------SVC4513------------------------------
- RESOURCE_CATEGORY_CANNOT_BE_CHANGED: {
- code: 400,
- message: "Error: Resource category cannot be changed once the resource is certified.",
- messageId: "SVC4513"
- }
-#---------SVC4514------------------------------
- RESOURCE_NAME_CANNOT_BE_CHANGED: {
- code: 400,
- message: "Error: Resource name cannot be changed once the resource is certified.",
- messageId: "SVC4514"
- }
-#---------SVC4515------------------------------
- RESOURCE_ICON_CANNOT_BE_CHANGED: {
- code: 400,
- message: "Error: Icon cannot be changed once the resource is certified.",
- messageId: "SVC4515"
- }
-#---------SVC4516------------------------------
- RESOURCE_VENDOR_NAME_CANNOT_BE_CHANGED: {
- code: 400,
- message: "Error: Vendor name cannot be changed once the resource is certified.",
- messageId: "SVC4516"
- }
-#---------SVC4517------------------------------
- RESOURCE_DERIVED_FROM_CANNOT_BE_CHANGED: {
- code: 400,
- message: "Error: Derived from resource template cannot be changed once the resource is certified.",
- messageId: "SVC4517"
- }
-#---------SVC4518------------------------------
-# %1 - max length
- COMPONENT_SINGLE_TAG_EXCEED_LIMIT: {
- code: 400,
- message: "Error: Invalid Content. Single tag exceeds limit of %1 characters.",
- messageId: "SVC4518"
- }
-#---------SVC4519------------------------------
- INVALID_DEFAULT_VALUE: {
- code: 400,
- message: "Error: mismatch in data-type occurred for property %1. data type is %2 and default value found is %3.",
- messageId: "SVC4519"
- }
-#---------SVC4520------------------------------
-# %1 - service or resource
- ADDITIONAL_INFORMATION_MAX_NUMBER_REACHED: {
- code: 409,
- message: "Error: Maximal number of additional %1 parameters was reached.",
- messageId: "SVC4520"
- }
-#---------SVC4521------------------------------
- ADDITIONAL_INFORMATION_EMPTY_STRING_NOT_ALLOWED: {
- code: 400,
- message: "Error: Invalid Content. The Additional information label and value cannot be empty.",
- messageId: "SVC4521"
- }
-#---------SVC4522------------------------------
-# %1 - label/value
-# %2 - Maximal length of %1
- ADDITIONAL_INFORMATION_EXCEEDS_LIMIT: {
- code: 400,
- message: "Error: Invalid Content. Additional information %1 exceeds limit of %2 characters.",
- messageId: "SVC4522"
- }
-#---------SVC4523------------------------------
- ADDITIONAL_INFORMATION_KEY_NOT_ALLOWED_CHARACTERS: {
- code: 400,
- message: 'Error: Invalid Content. Additional information label is not allowed to contain characters like <>:"\/|?* and space characters other than regular space.',
- messageId: "SVC4523"
- }
-#---------SVC4524------------------------------
- ADDITIONAL_INFORMATION_NOT_FOUND: {
- code: 409,
- message: "Error: Requested additional information was not found.",
- messageId: "SVC4524"
- }
-#---------SVC4525------------------------------
- ADDITIONAL_INFORMATION_VALUE_NOT_ALLOWED_CHARACTERS: {
- code: 400,
- message: 'Error: Invalid Content. Additional information contains non-english characters.',
- messageId: "SVC4525"
- }
-#---------SVC4526------------------------------
- RESOURCE_INSTANCE_NOT_FOUND: {
- code: 404,
- message: "Error: Requested '%1' resource instance was not found.",
- messageId: "SVC4526"
- }
-#---------SVC4527------------------------------
- ASDC_VERSION_NOT_FOUND: {
- code: 500,
- message: 'Error: ASDC version cannot be displayed.',
- messageId: "SVC4527"
- }
-#---------SVC4528------------------------------
-# %1-artifact url/artifact label/artifact description/VNF Service Indicator
- MISSING_DATA: {
- code: 400,
- message: "Error: Invalid content. Missing %1.",
- messageId: "SVC4528"
- }
-#---------SVC4529------------------------------
-# %1-artifact url/artifact label/artifact description/artifact name
-# %2 - Maximal length of %1
- EXCEEDS_LIMIT: {
- code: 400,
- message: "Error: Invalid Content. %1 exceeds limit of %2 characters.",
- messageId: "SVC4529"
- }
-#---------SVC4530------------------------------
- ARTIFACT_INVALID_TIMEOUT: {
- code: 400,
- message: "Error: Invalid Content. Artifact Timeout should be set to valid positive non-zero number of minutes.",
- messageId: "SVC4530"
- }
-#---------SVC4531------------------------------
- SERVICE_IS_VNF_CANNOT_BE_CHANGED: {
- code: 400,
- message: "Error: VNF Indicator cannot be updated for certified service.",
- messageId: "SVC4531"
- }
- #---------SVC4532------------------------------
- RESOURCE_INSTANCE_NOT_FOUND_ON_SERVICE: {
- code: 404,
- message: "Error: Requested '%1' resource instance was not found on the service '%2.",
- messageId: "SVC4532"
- }
- #---------SVC4533------------------------------
- # %1 - "HEAT"/"HEAT_ENV"/"MURANO_PKG"/"YANG_XML"
- WRONG_ARTIFACT_FILE_EXTENSION: {
- code: 400,
- message: "Error: Invalid file extension for %1 artifact type.",
- messageId: "SVC4533"
- }
-
-#---------SVC4534------------------------------
-# %1 - "HEAT"/"HEAT_ENV"
- INVALID_YAML: {
- code: 400,
- message: "Error: Uploaded YAML file for %1 artifact is invalid.",
- messageId: "SVC4534"
- }
-
-#---------SVC4535------------------------------
-# %1 - "HEAT"
- INVALID_DEPLOYMENT_ARTIFACT_HEAT: {
- code: 400,
- message: "Error: Invalid %1 artifact.",
- messageId: "SVC4535"
- }
-#---------SVC4536------------------------------
-# %1 - "Resource"/"Service"
-# %2 - resource/service name
-# %3 - "HEAT"/"HEAT_ENV"/"MURANO_PKG"
-# %4 - "HEAT"/"HEAT_ENV"/"MURANO_PKG
- DEPLOYMENT_ARTIFACT_OF_TYPE_ALREADY_EXISTS: {
- code: 400,
- message: "Error: %1 '%2' already has a deployment artifact of %3 type .Please delete or update an existing %4 artifact.",
- messageId: "SVC4536"
- }
-
-#---------SVC4537------------------------------
- MISSING_HEAT: {
- code: 400,
- message: "Error: Missing HEAT artifact. HEAT_ENV artifact cannot be uploaded without corresponding HEAT template.",
- messageId: "SVC4537"
- }
-#---------SVC4538------------------------------
- MISMATCH_HEAT_VS_HEAT_ENV: {
- code: 400,
- message: "Error: Invalid artifact content. Parameter's set in HEAT_ENV '%1' artifact doesn't match the parameters in HEAT '%2' artifact.",
- messageId: "SVC4538"
- }
-#---------SVC4539------------------------------
- INVALID_RESOURCE_PAYLOAD: {
- code: 400,
- message: "Error: Invalid resource payload.",
- messageId: "SVC4539"
- }
-#---------SVC4540------------------------------
- INVALID_TOSCA_FILE_EXTENSION: {
- code: 400,
- message: "Error: Invalid file extension for TOSCA template.",
- messageId: "SVC4540"
- }
-#---------SVC4541------------------------------
- INVALID_YAML_FILE: {
- code: 400,
- message: "Error: Invalid YAML file.",
- messageId: "SVC4541"
- }
-#---------SVC4542------------------------------
- INVALID_TOSCA_TEMPLATE: {
- code: 400,
- message: "Error: Invalid TOSCA template.",
- messageId: "SVC4542"
- }
-#---------SVC4543------------------------------
- NOT_RESOURCE_TOSCA_TEMPLATE: {
- code: 400,
- message: "Error: Imported Service TOSCA template.",
- messageId: "SVC4543"
- }
-#---------SVC4544------------------------------
- NOT_SINGLE_RESOURCE: {
- code: 400,
- message: "Error: Imported TOSCA template should contain one resource definition.",
- messageId: "SVC4544"
- }
-#---------SVC4545------------------------------
- INVALID_RESOURCE_NAMESPACE: {
- code: 400,
- message: "Error: Invalid resource namespace.",
- messageId: "SVC4545"
- }
-#---------SVC4546------------------------------
- RESOURCE_ALREADY_EXISTS: {
- code: 400,
- message: "Error: Imported resource already exists in ASDC Catalog.",
- messageId: "SVC4546"
- }
-#---------SVC4549------------------------------
- INVALID_RESOURCE_CHECKSUM: {
- code: 400,
- message: "Error: Invalid resource checksum.",
- messageId: "SVC4549"
- }
-#---------SVC4550------------------------------
- #%1  -  Consumer salt
- INVALID_LENGTH: {
- code: 400,
- message: "Error: Invalid %1 length.",
- messageId: "SVC4550"
- }
- #---------SVC4551------------------------------
- #%1  -  ECOMP User name
- ECOMP_USER_NOT_FOUND: {
- code: 404,
- message: "Error: ECOMP User '%1' was not found.",
- messageId: "SVC4551"
- }
-#---------SVC4552------------------------------
- CONSUMER_ALREADY_EXISTS: {
- code: 409,
- message: "Error: ECOMP User already exists.",
- messageId: "SVC4552"
- }
-#---------SVC4553-----------------------------
- #%1  -  Consumer name / Consumer password/ Consumer salt
- INVALID_CONTENT_PARAM: {
- code: 400,
- message: "Error: %1 is invalid.",
- messageId: "SVC4553"
- }
- #---------SVC4554------------------------------
-# %1 - "Resource"/"Service"
- COMPONENT_ARTIFACT_NOT_FOUND: {
- code: 404,
- message: "Error: Requested artifact doesn't belong to specified %1.",
- messageId: "SVC4554"
- }
-#---------SVC4554------------------------------
-# %1 - "Service name"
- SERVICE_DEPLOYMENT_ARTIFACT_NOT_FOUND: {
- code: 403,
- message: "Error: Requested '%1' service is not ready for certification. Service has to have at least one deployment artifact.",
- messageId: "SVC4554"
- }
-#---------SVC4555------------------------------
-#%1 - "Resource"/"Service"/"Product"
-#%2 - "category"
- COMPONENT_ELEMENT_INVALID_NAME_LENGTH: {
- code: 400,
- message: "Error: Invalid %1 %2 name length.",
- messageId: "SVC4555"
- }
-#---------SVC4556------------------------------
-#%1 - "Resource"/"Service"/"Product"
-#%2 - "category"
- COMPONENT_ELEMENT_INVALID_NAME_FORMAT: {
- code: 400,
- message: "Error: Invalid %1 %2 name format.",
- messageId: "SVC4556"
- }
-#---------SVC4557------------------------------
-#%1 - "Resource"/"Service"/"Product"
-#%2 - "category name"
- COMPONENT_CATEGORY_ALREADY_EXISTS: {
- code: 409,
- message: "Error: %1 category name '%2' already exists.",
- messageId: "SVC4557"
- }
-#---------SVC4558------------------------------
-# %1 - "service"/"VF"
-# %2 - "Resource name"
- VALIDATED_RESOURCE_NOT_FOUND: {
- code: 403,
- message: "Error: Submit for Testing is not permitted as your '%1' includes non-validated '%2' resource.",
- messageId: "SVC4558"
- }
-#---------SVC4559------------------------------
-# %1 - "service"/"VF"
-# %2 - "Resource name"
- FOUND_ALREADY_VALIDATED_RESOURCE: {
- code: 403,
- message: "Error: Submit for Testing is not permitted as your '%1' includes non-validated '%2' resource. Please use already available validated resource version.",
- messageId: "SVC4559"
- }
-#---------SVC4560------------------------------
-# %1 - "service"/"VF"
-# %2 - "Resource name"
- FOUND_LIST_VALIDATED_RESOURCES: {
- code: 403,
- message: "Error: Submit for Testing is not permitted as your '%1' includes non-validated '%2' resource. Please use one of available validated resource versions.",
- messageId: "SVC4560"
- }
-#---------SVC4561------------------------------
-# %1 - "resource"/"product"
-# %2 - "category"
-# %3 - "category name"
- COMPONENT_CATEGORY_NOT_FOUND: {
- code: 404,
- message: "Error: Requested %1 %2 '%3' was not found.",
- messageId: "SVC4561"
- }
-#---------SVC4562------------------------------
-# %1 - "Resource"/"Product"
-# %2 - "sub-category name"
-# %3 - "category name"
- COMPONENT_SUB_CATEGORY_EXISTS_FOR_CATEGORY: {
- code: 409,
- message: "Error: %1 sub-category '%2' already exists under '%3' category.",
- messageId: "SVC4562"
- }
-#---------SVC4563------------------------------
-# %1 - "Product"
-# %2 - "grouping name"
-# %3 - "sub-category name"
- COMPONENT_GROUPING_EXISTS_FOR_SUB_CATEGORY: {
- code: 409,
- message: "Error: %1 grouping '%2' already exists under '%3' sub-category.",
- messageId: "SVC4563"
- }
-#---------SVC4564------------------------------
-# %1 - product name
- PRODUCT_NOT_FOUND: {
- code: 404,
- message: "Error: Requested '%1' product was not found.",
- messageId: "SVC4564"
- }
-#---------SVC4565------------------------------
-# %1 - "HEAT"
-# %2 - parameter type ("string" , "boolean" , "number")
-# %3 - parameter name
- INVALID_HEAT_PARAMETER_VALUE: {
- code: 400,
- message: "Error: Invalid %1 artifact. Invalid %2 value set for '%3' parameter.",
- messageId: "SVC4565"
- }
-#---------SVC4566------------------------------
-# %1 - "HEAT"
-# %2 - parameter type ("string" , "boolean" , "number")
- INVALID_HEAT_PARAMETER_TYPE: {
- code: 400,
- message: "Error: Invalid %1 artifact. Unsupported '%2' parameter type.",
- messageId: "SVC4566"
- }
-#---------SVC4567------------------------------
-# %1 - "YANG_XML"
- INVALID_XML: {
- code: 400,
- message: "Error: Uploaded XML file for %1 artifact is invalid.",
- messageId: "SVC4567"
- }
-#---------SVC4567------------------------------
-# %1 - "User Name and UserId"
-# %2 -"checked-out"/"in-certification"
- CANNOT_DELETE_USER_WITH_ACTIVE_ELEMENTS: {
- code: 409,
- message: "Error: User cannot be deleted. User '%1' has %2 projects.",
- messageId: "SVC4567"
- }
-#---------SVC4568------------------------------
-# %1 - "User Name and UserId"
-# %2 -"checked-out"/"in-certification"
- CANNOT_UPDATE_USER_WITH_ACTIVE_ELEMENTS: {
- code: 409,
- message: "Error: Role cannot be changed. User '%1' has %2 projects.",
- messageId: "SVC4568"
- }
-#---------SVC4570------------------------------
- UPDATE_USER_ADMIN_CONFLICT: {
- code: 409,
- message: "Error: An administrator is not allowed to change his/her role.",
- messageId: "SVC4570"
- }
-#---------SVC4571------------------------------
- SERVICE_CANNOT_CONTAIN_SUBCATEGORY: {
- code: 400,
- message: "Error: Sub category cannot be defined for service",
- messageId: "SVC4571"
- }
-#---------SVC4572------------------------------
-# %1 - "Resource"/"Service"
- COMPONENT_TOO_MUCH_CATEGORIES: {
- code: 400,
- message: "Error: %1 must have only 1 category",
- messageId: "SVC4572"
- }
-#---------SVC4574------------------------------
- RESOURCE_TOO_MUCH_SUBCATEGORIES: {
- code: 400,
- message: "Error: Resource must have only 1 sub category",
- messageId: "SVC4574"
- }
-#---------SVC4575------------------------------
- COMPONENT_MISSING_SUBCATEGORY: {
- code: 400,
- message: "Error: Missing sub category",
- messageId: "SVC4575"
- }
- #---------SVC4576------------------------------
-# %1 - "component type"
- UNSUPPORTED_ERROR: {
- code: 400,
- message: "Error : Requested component type %1 is unsupported.",
- messageId: "SVC4576"
- }
- #---------SVC4577------------------------------
-# %1 - "resource type"
- RESOURCE_CANNOT_CONTAIN_RESOURCE_INSTANCES: {
- code: 409,
- message: "Error : Resource of type %1 cannot contain resource instances.",
- messageId: "SVC4577"
- }
-#---------SVC4578------------------------------
-# %1 - "Resource"/"Service"
-# %2 - resource/service name
-# %3 - "artifact name"
- DEPLOYMENT_ARTIFACT_NAME_ALREADY_EXISTS: {
- code: 400,
- message: "Error: %1 '%2' already has a deployment artifact named '%3'.",
- messageId: "SVC4578"
- }
-#---------SVC4579------------------------------
-# %1 - "Category"/"Sub-Category"/"Group"
-# %2 - category/sub-category/grouping name.
- INVALID_GROUP_ASSOCIATION: {
- code: 400,
- message: "Error: Invalid group association. %1 '%2' was not found.",
- messageId: "SVC4579"
- }
-#---------SVC4580------------------------------
- EMPTY_PRODUCT_CONTACTS_LIST: {
- code: 400,
- message: "Error: Invalid content. At least one Product Contact has to be specified.",
- messageId: "SVC4580"
- }
-#---------SVC4581------------------------------
-# %1 - UserId
- INVALID_PRODUCT_CONTACT: {
- code: 400,
- message: "Error: Invalid content. User '%1' cannot be set as Product Contact.",
- messageId: "SVC4581"
- }
-#---------SVC4582------------------------------
-# %1 - Product
-# %2 - "abbreviated"/"full"
- MISSING_ONE_OF_COMPONENT_NAMES: {
- code: 400,
- message: "Error: Invalid content. Missing %1 %2 name.",
- messageId: "SVC4582"
- }
-#---------SVC4583------------------------------
-# %1 - "Icon"
-# %2 - "resource"/"service"/"product"
- COMPONENT_PARAMETER_CANNOT_BE_CHANGED: {
- code: 400,
- message: "Error: %1 cannot be changed once the %2 is certified.",
- messageId: "SVC4583"
- }
-#---------SVC4584------------------------------
-# %1 - service/VF name
-# %2 - "service" /"VF"
-# %3 - resource instance origin type
-# %4 - resource instance name
-# %5 - requirement/capability
-# %6 - requirement/capability name
-# %7 - "fulfilled" (for req)/"consumed (for cap)"
- REQ_CAP_NOT_SATISFIED_BEFORE_CERTIFICATION: {
- code: 403,
- message: "Error: Requested '%1' %2 is not ready for certification. %3 '%4' has to have %5 '%6' %7.",
- messageId: "SVC4584"
- }
-#---------SVC4585------------------------------
- INVALID_OCCURRENCES: {
- code: 400,
- message: "Error: Invalid occurrences format.",
- messageId: "SVC4585"
- }
-#---------SVC4586------------------------------
-#---------SVC4586------------------------------
- INVALID_SERVICE_API_URL: {
- code: 400,
- message: 'Error: Invalid Service API URL. Please check whether your URL has a valid domain extension and does not contain the following characters - #?&@%+;,=$<>~^`\[]{}|"*!',
- messageId: "SVC4586"
- }
-#---------SVC4587------------------------------
-# %1 - Data type name
- DATA_TYPE_ALREADY_EXIST: {
- code: 409,
- message: 'Error: Data type %1 already exists.',
- messageId: "SVC4587"
- }
-#---------SVC4588------------------------------
-# %1 - Data type name
- DATA_TYPE_NOR_PROPERTIES_NEITHER_DERIVED_FROM: {
- code: 400,
- message: 'Error: Invalid Data type %1. Data type must have either a valid derived from declaration or at least one valid property',
- messageId: "SVC4588"
- }
-#---------SVC4589------------------------------
-# %1 - Data type name
- DATA_TYPE_PROPERTIES_CANNOT_BE_EMPTY: {
- code: 400,
- message: "Error: Invalid Data type %1. 'properties' parameter cannot be empty if provided.",
- messageId: "SVC4589"
- }
-#---------SVC4590------------------------------
-# %1 - Property type name
-# %2 - Property name
- INVALID_PROPERTY_TYPE: {
- code: 400,
- message: "Error: Invalid Property type %1 in property %2.",
- messageId: "SVC4590"
- }
-#---------SVC4591------------------------------
-# %1 - Property inner type
-# %2 - Property name
- INVALID_PROPERTY_INNER_TYPE: {
- code: 400,
- message: "Error: Invalid property inner type %1, in property %2",
- messageId: "SVC4591"
- }
-#---------SVC4592------------------------------
-# %1 - component instance name
-# %2 - "resource instance"/"service instance"
- COMPONENT_INSTANCE_NOT_FOUND: {
- code: 404,
- message: "Error: Requested '%1' %2 was not found.",
- messageId: "SVC4592"
- }
-#---------SVC4593------------------------------
-# %1 - component instance name
-# %2 - "resource instance"/"service instance"
-# %3 - "resource/"service"/"product"
-# %4 - container name
- COMPONENT_INSTANCE_NOT_FOUND_ON_CONTAINER: {
- code: 404,
- message: "Error: Requested '%1' %2 was not found on the %3 '%4'.",
- messageId: "SVC4593"
- }
-#---------SVC4594------------------------------
-#%1 - requirement / capability
-#%2 - requirement name
- IMPORT_DUPLICATE_REQ_CAP_NAME: {
- code: 400,
- message: "Error: Imported TOSCA template contains more than one %1 named '%2'.",
- messageId: "SVC4594"
- }
-#---------SVC4595------------------------------
-#%1 - requirement / capability
-#%2 - requirement name
-#%3 - parent containing the requirement
- IMPORT_REQ_CAP_NAME_EXISTS_IN_DERIVED: {
- code: 400,
- message: "Error: Imported TOSCA template contains %1 '%2' that is already defined by derived template %3.",
- messageId: "SVC4595"
- }
-#---------SVC4596------------------------------
-# %1 - Data type name
- DATA_TYPE_DERIVED_IS_MISSING: {
- code: 400,
- message: "Error: Invalid Content. The ancestor data type %1 cannot be found in the system.",
- messageId: "SVC4596"
- }
-#---------SVC4597------------------------------
-# %1 - Data type name
-# %2 - Property names
- DATA_TYPE_PROPERTY_ALREADY_DEFINED_IN_ANCESTOR: {
- code: 400,
- message: "Error: Invalid Content. The data type %1 contains properties named %2 which are already defined in one of its ancestors.",
- messageId: "SVC4597"
- }
-#---------SVC4598------------------------------
-# %1 - Data type name
- DATA_TYPE_DUPLICATE_PROPERTY: {
- code: 400,
- message: "Error: Invalid Content. The data type %1 contains duplicate property.",
- messageId: "SVC4598"
- }
-#---------SVC4599------------------------------
-# %1 - Data type name
-# %2 - Property names
- DATA_TYPE_PROEPRTY_CANNOT_HAVE_SAME_TYPE_OF_DATA_TYPE: {
- code: 400,
- message: "Error: Invalid Content. The data type %1 contains properties %2 which their type is this data type.",
- messageId: "SVC4599"
- }
-#---------SVC4600------------------------------
-# %1 - Data type name
- DATA_TYPE_CANNOT_HAVE_PROPERTIES: {
- code: 400,
- message: "Error: Invalid Content. The data type %1 cannot have properties since it is of type scalar",
- messageId: "SVC4600"
- }
-#---------SVC4601------------------------------
- NOT_TOPOLOGY_TOSCA_TEMPLATE: {
- code: 400,
- message: "Error: TOSCA yaml file %1 cannot be modeled to VF as it does not contain 'topology_template.",
- messageId: "SVC4601"
- }
-#---------SVC4602--------------------------------
-# %1 - yaml file name
-# %2 - node_template label
-# %3 - node_template type
- INVALID_NODE_TEMPLATE: {
- code: 400,
- message: "Error: TOSCA yaml file '%1' contains node_template '%2' of type '%3' that does not represent existing VFC/CP/VL",
- messageId: "SVC4602"
- }
-#---------SVC4603------------------------------
-# %1 - component type
-# %2 - component name
-# %3 - state
- ILLEGAL_COMPONENT_STATE: {
- code: 403,
- message: "Error: Component instance of %1 can not be created because the component '%2' is in an illegal state %3.",
- messageId: "SVC4603"
- }
-#---------SVC4604------------------------------
-# %1 - csar file name
- CSAR_INVALID: {
- code: 400,
- message: "Error: TOSCA CSAR '%1' is invalid. 'TOSCA-Metadata/Tosca.meta' file must be provided.",
- messageId: "SVC4604"
- }
-#---------SVC4605------------------------------
-# %1 - csar file name
- CSAR_INVALID_FORMAT: {
- code: 400,
- message: "Error: TOSCA CSAR '%1' is invalid. Invalid 'TOSCA-Metadata/Tosca.meta' file format.",
- messageId: "SVC4605"
- }
-#---------SVC4606------------------------------
-# %1 - property name
-# %2 - property type
-# %3 - property innerType
-# %4 - default value is
- INVALID_COMPLEX_DEFAULT_VALUE: {
- code: 400,
- message: "Error: Invalid default value of property %1. Data type is %2 with inner type %3 and default value found is %4.",
- messageId: "SVC4606"
- }
-#---------SVC4607------------------------------
-# %1 - csar file name
- CSAR_NOT_FOUND: {
- code: 400,
- message: "Error: TOSCA CSAR '%1' is not found.",
- messageId: "SVC4607"
- }
-#---------SVC4608------------------------------
-# %1 - artifact name
-# %2 - component type
-# %3 - actual component type
- MISMATCH_BETWEEN_ARTIFACT_TYPE_AND_COMPONENT_TYPE: {
- code: 400,
- message: "Error: Artifact %1 is only compatible with component of type %2, but component type is %3.",
- messageId: "SVC4608"
- }
-
-#---------SVC4609------------------------------
-# %1 - "INVALID_JSON"
- INVALID_JSON: {
- code: 400,
- message: "Error: Uploaded JSON file for %1 artifact is invalid.",
- messageId: "SVC4609"
- }
-#---------SVC4610------------------------------
-# %1 - csar file name
-# %2 - missing file name
- YAML_NOT_FOUND_IN_CSAR: {
- code: 400,
- message: "Error - TOSCA CSAR %1 is invalid. TOSCA-Metadata/Tosca.meta refers to file %2 that is not provided.",
- messageId: "SVC4610"
- }
-#---------SVC4611------------------------------
-# %1 - group name
- GROUP_MEMBER_EMPTY: {
- code: 400,
- message: "Error: Invalid Content. Group %1 member list was provided but does not have values",
- messageId: "SVC4611"
- }
-#---------SVC4612------------------------------
-# %1 - group name
- GROUP_TYPE_ALREADY_EXIST: {
- code: 409,
- message: 'Error: Group type %1 already exists.',
- messageId: "SVC4612"
- }
-#---------SVC4613------------------------------
-# %1 - group name
-# %2 - VF name(component name)
-# %3 - actual component type [VF]
- GROUP_ALREADY_EXIST: {
- code: 409,
- message: "Error: Group with name '%1' already exists in %2 %3.",
- messageId: "SVC4613"
- }
-#---------SVC4614------------------------------
-# %1 - group type
- GROUP_TYPE_IS_INVALID: {
- code: 400,
- message: "Error: Invalid content. Group type %1 does not exist",
- messageId: "SVC4614"
- }
-#---------SVC4615------------------------------
-# %1 - group name
- GROUP_MISSING_GROUP_TYPE: {
- code: 400,
- message: "Error: Invalid Content. Missing Group Type for group '%1'",
- messageId: "SVC4615"
- }
-#---------SVC4616------------------------------
-# %1 - member name
-# %2 - group name
-# %3 - VF name
-# %4 - component type [VF ]
- GROUP_INVALID_COMPONENT_INSTANCE: {
- code: 400,
- message: "Error: Member '%1' listed in group '%2' is not part of '%3' %4.",
- messageId: "SVC4616"
- }
-#---------SVC4617------------------------------
-# %1 - member name
-# %2 - group name
-# %3 - group type
- GROUP_INVALID_TOSCA_NAME_OF_COMPONENT_INSTANCE: {
- code: 400,
- message: "Error: member %1 listed in group %2 is not part of allowed members of group type %3.",
- messageId: "SVC4617"
- }
-#---------SVC4618------------------------------
-# %1 - missing file name
-# %2 - csar file name
- ARTIFACT_NOT_FOUND_IN_CSAR: {
- code: 400,
- message: "Error: artifact %1 is defined in CSAR %2 manifest but is not provided",
- messageId: "SVC4618"
- }
-#---------SVC4619------------------------------
-# %1 - artifact name
-# %2 - artifact type
-# %3 - existing artifact type
- ARTIFACT_ALREADY_EXIST_IN_DIFFERENT_TYPE_IN_CSAR: {
- code: 400,
- message: "Error: artifact %1 in type %2 already exists in type %3.",
- messageId: "SVC4619"
- }
-#---------SVC4620------------------------------
- FAILED_RETRIVE_ARTIFACTS_TYPES: {
- code: 400,
- message: "Error: Failed to retrieve list of suported artifact types.",
- messageId: "SVC4620"
- }
-#---------SVC4621------------------------------
-# %1 - artifact name
-# %2 - master
- ARTIFACT_ALRADY_EXIST_IN_MASTER_IN_CSAR: {
- code: 400,
- message: "Error: artifact %1 already exists in master %2 .",
- messageId: "SVC4621"
- }
-#---------SVC4622------------------------------
-# %1 - artifact name
-# %2 - artifact type
-# %3 - master name
-# %4 - master type
- ARTIFACT_NOT_VALID_IN_MASTER: {
- code: 400,
- message: "Error: artifact %1 in type %2 can not be exists under master %3 in type %4.",
- messageId: "SVC4622"
- }
-#---------SVC4623------------------------------
-# %1 - artifact name
-# %2 - artifact type
-# %3 - env name
-# %4 - existing env
- ARTIFACT_NOT_VALID_ENV: {
- code: 400,
- message: "Error: Artifact %1 in type %2 with env %3 already exists with another env %4",
- messageId: "SVC4623"
- }
-#---------SVC4624------------------------------
-# %1 - groups names
-# %2 - VF name
-# %3 - component type [VF ]
- GROUP_IS_MISSING: {
- code: 400,
- message: "Error: Invalid Content. The groups '%1' cannot be found under %2 %3.",
- messageId: "SVC4624"
- }
-#---------SVC4625------------------------------
-# %1 - groups name
- GROUP_ARTIFACT_ALREADY_ASSOCIATED: {
- code: 400,
- message: "Error: Invalid Content. Artifact already associated to group '%1'.",
- messageId: "SVC4625"
- }
-#---------SVC4626------------------------------
-# %1 - groups name
- GROUP_ARTIFACT_ALREADY_DISSOCIATED: {
- code: 400,
- message: "Error: Invalid Content. Artifact already dissociated from group '%1'.",
- messageId: "SVC4626"
- }
-#---------SVC4627------------------------------
-# %1 - property name
-# %2 - group name
-# %3 - group type name
- GROUP_PROPERTY_NOT_FOUND: {
- code: 400,
- message: "Error: property %1 listed in group %2 is not exist in group type %3.",
- messageId: "SVC4627"
- }
-#---------SVC4628------------------------------
-# %1 - csarUUID
-# %2 - VF name
- VSP_ALREADY_EXISTS: {
- code: 400,
- message: "Error: The VSP with UUID %1 was already imported for VF %2. Please select another or update the existing VF.",
- messageId: "SVC4628"
- }
-#---------SVC4629------------------------------
-# %1 - VF name
- MISSING_CSAR_UUID: {
- code: 400,
- message: "Error: The Csar UUID or payload name is missing for VF %1.",
- messageId: "SVC4629"
- }
-#---------SVC4630------------------------------
-# %1 - VF name
-# %2 - new csarUUID
-# %3 - old csarUUID
- RESOURCE_LINKED_TO_DIFFERENT_VSP: {
- code: 400,
- message: "Error: Resource %1 cannot be updated using CsarUUID %2 since the resource is linked to a different VSP with csarUUID %3.",
- messageId: "SVC4630"
- }
-#---------SVC4631------------------------------
-# %1 - policy name
- POLICY_TYPE_ALREADY_EXIST: {
- code: 409,
- message: "Error: Policy type %1 already exists.",
- messageId: "SVC4631"
- }
-#---------SVC4632------------------------------
-# %1 - target name
-# %2 - policy type name
- TARGETS_NON_VALID: {
- code: 400,
- message: "Error: target %1 listed in policy type %2 is not a group or resource.",
- messageId: "SVC4632"
- }
-#---------SVC4633------------------------------
-# %1 - policy name
- TARGETS_EMPTY: {
- code: 400,
- message: "Error: Invalid Content. Policy %1 target list was provided but does not have values",
- messageId: "SVC4633"
- }
-#---------SVC4634------------------------------
- DATA_TYPE_CANNOT_BE_EMPTY: {
- code: 500,
- message: "Error: Data types are empty. Please import the data types.",
- messageId: "SVC4634"
- }
-#---------SVC4635------------------------------
-# %1 - csar uuid
- RESOURCE_FROM_CSAR_NOT_FOUND: {
- code: 400,
- message: "Error: resource from csar uuid %1 not found",
- messageId: "SVC4635"
- }
-#---------SVC4636------------------------------
-# %1 - Data type name
- DATA_TYPE_CANNOT_BE_UPDATED_BAD_REQUEST: {
- code: 400,
- message: 'Error: Data type %1 cannot be upgraded. The new data type does not contain old properties or the type of one of the properties has been changed.',
- messageId: "SVC4636"
- }
-#-----------SVC4637---------------------------
-#%1 - attribute name
- ATTRIBUTE_NOT_FOUND: {
- code: 404,
- message: "Error: Requested '%1' attribute was not found.",
- messageId: "SVC4637"
- }
-#-----------SVC4638---------------------------
-#%1 - attribute name
- ATTRIBUTE_ALREADY_EXIST: {
- code: 409,
- message: "Error: Attribute with '%1' name already exists.",
- messageId: "SVC4638"
- }
-#-----------SVC4639---------------------------
-#%1 - property name
- PROPERTY_NAME_ALREADY_EXISTS: {
- code: 409,
- message: "Error: Property with '%1' name and different type already exists.",
- messageId: "SVC4639"
- }
-#-----------SVC4640---------------------------
-#%1 - property name
- INVALID_PROPERTY: {
- code: 409,
- message: "Error: Invalid property received.",
- messageId: "SVC4640"
- }
-#---------SVC4641-----------------------------
-#%1 - invalid filter
-#%2 - valid filters
- INVALID_FILTER_KEY: {
- code: 400,
- message: "Error: The filter %1 is not applicable. Please use one of the following filters: %2",
- messageId: "SVC4641"
- }
-#---------SVC4642-----------------------------
-#%1 - asset type
-#%2 - filter
- NO_ASSETS_FOUND: {
- code: 404,
- message: "No %1 were found to match criteria %2",
- messageId: "SVC4642"
- }
-#---------SVC4643------------------------------
-# %1 - "Resource"/"Product"
-# %2 - "sub-category name"
-# %3 - "category name"
- COMPONENT_SUB_CATEGORY_NOT_FOUND_FOR_CATEGORY: {
- code: 404,
- message: "Error: %1 sub-category '%2' not found under category '%3'.",
- messageId: "SVC4643"
- }
-#---------SVC4644------------------------------
-# %1 - Format
- CORRUPTED_FORMAT: {
- code: 400,
- message: "Error: %1 format is corrupted.",
- messageId: "SVC4644"
- }
-#---------SVC4645------------------------------
-# %1 - "groupType"
- INVALID_VF_MODULE_TYPE: {
- code: 400,
- message: "Error: Invalid group type '%1' (should be VfModule).",
- messageId: "SVC4645"
- }
-#---------SVC4646------------------------------
-# %1 - "groupName"
- INVALID_VF_MODULE_NAME: {
- code: 400,
- message: "Error: Invalid Content. VF Module name '%1' contains invalid characters",
- messageId: "SVC4646"
- }
-
-#---------SVC4647------------------------------
-# %1 - "modifiedName"
- INVALID_VF_MODULE_NAME_MODIFICATION: {
- code: 400,
- message: "Error: Invalid VF Module name modification, can not modify '%1'",
- messageId: "SVC4647"
- }
-#---------SVC4648------------------------------
-# %1 - "inputId"
-# %2 - "componentId"
- INPUT_IS_NOT_CHILD_OF_COMPONENT: {
- code: 400,
- message: "Error: Input id: '%1' is not child of component id: '%2'",
- messageId: "SVC4648"
- }
-#---------SVC4649------------------------------
-# %1 - "groupName"
- GROUP_HAS_CYCLIC_DEPENDENCY: {
- code: 400,
- message: "Error: The group '%1' has cyclic dependency",
- messageId: "SVC4649"
- }
-#---------SVC4650------------------------------
-# %1 - "Component Type"
-# %2 - <ServiceName>
-# %3 - error description
- AAI_ARTIFACT_GENERATION_FAILED: {
- code: 500,
- message: "Error: %1 %2 automatic generation of artifacts failed. Description: %3",
- messageId: "SVC4650"
- }
-#---------SVC4651------------------------------
- PARENT_RESOURCE_DOES_NOT_EXTEND: {
- code: 400,
- message: "Error: Once resource is certified, derived_from can be changed only to a sibling",
- messageId: "SVC4651"
- }
-#---------SVC4652------------------------------
-# %1 - resource/service
- COMPONENT_INVALID_SUBCATEGORY: {
- code: 400,
- message: "Error: Invalid Content. Invalid %1 sub category.",
- messageId: "SVC4652"
- }
-#---------SVC4653------------------------------
-# %1 - group instance uniqueId
-# %2 - service uniqueId
- GROUP_INSTANCE_NOT_FOUND_ON_COMPONENT_INSTANCE: {
- code: 404,
- message: "Error: Requested group instance %1 was not found on component %2.",
- messageId: "SVC4653"
- }
-#---------SVC4654------------------------------
-# %1 - group property name
-# %2 - valid min limit value
-# %3 - valid max limit value
- INVALID_GROUP_MIN_MAX_INSTANCES_PROPERTY_VALUE: {
- code: 400,
- message: "Error: Value of %1 must be not higher than %2, and not lower than %3.",
- messageId: "SVC4654"
- }
-#---------SVC4655------------------------------
-# %1 - group property name
-# %2 - valid min limit value
-# %3 - valid max limit value
- INVALID_GROUP_INITIAL_COUNT_PROPERTY_VALUE: {
- code: 400,
- message: "Error: Value of %1 must be between %2 and %3.",
- messageId: "SVC4655"
- }
-#---------SVC4656------------------------------
-# %1 - group property name
-# %2 - lower/higher
-# %3 - valid max/min value
- INVALID_GROUP_PROPERTY_VALUE_LOWER_HIGHER: {
- code: 400,
- message: "Error: Value of %1 must be %2 or equals to %3.",
- messageId: "SVC4656"
- }
-#---------SVC4657------------------------------
-# %1 - certificationRequest / startTesting
- RESOURCE_VFCMT_LIFECYCLE_STATE_NOT_VALID: {
- code: 400,
- message: "Error - Lifecycle state %1 is not valid for resource of type VFCMT",
- messageId: "SVC4657"
- }
-#---------SVC4658------------------------------
-# %1 – asset type [service / resource ]
-# %2 – main asset uuid
-# %3 – not found asset type [service / resource]
-# %4 – not found asset name
- ASSET_NOT_FOUND_DURING_CSAR_CREATION: {
- code: 400,
- message: "Error: CSAR packaging failed for %1 %2. %3 %4 was not found",
- messageId: "SVC4658"
- }
-#---------SVC4659------------------------------
-# %1 – asset type [service / resource ]
-# %2 – main asset uuid
-# %3 – Artifact name
-# %4 – Artifact uuid
- ARTIFACT_PAYLOAD_NOT_FOUND_DURING_CSAR_CREATION: {
- code: 400,
- message: "Error: CSAR packaging failed for %1 %2. Artifact %3 [%4] was not found",
- messageId: "SVC4659"
- }
-#---------SVC4660------------------------------
-# %1 - assetType
-# %2 - matching generic node type name
- GENERIC_TYPE_NOT_FOUND: {
- code: 404,
- message: "Creation of %1 failed. Generic type %2 was not found",
- messageId: "SVC4660"
- }
-#---------SVC4661------------------------------
-# %1 - assetType
-# %2 - matching generic node type name
- TOSCA_SCHEMA_FILES_NOT_FOUND: {
- code: 400,
- message: "Error: CSAR packaging failed. TOSCA schema files for SDC-Version: %1 and Conformance-Level %2 were not found",
- messageId: "SVC4661"
- }
-#---------SVC4662------------------------------
-# %1 - file name
-# %2 - parser error
- TOSCA_PARSE_ERROR: {
- code: 400,
- message: "Error: Invalid TOSCA template in file %1. %2",
- messageId: "SVC4662"
- }
-#---------SVC4663------------------------------
-# %1 - max length
- RESOURCE_VENDOR_MODEL_NUMBER_EXCEEDS_LIMIT: {
- code: 400,
- message: "Error: Invalid Content. Resource vendor model number exceeds limit of %1 characters.",
- messageId: "SVC4663"
- }
-#---------SVC4664------------------------------
- INVALID_RESOURCE_VENDOR_MODEL_NUMBER: {
- code: 400,
- message: 'Error: Invalid Content. Resource vendor model number is not allowed to contain characters like <>:"\/|?* and space characters other than regular space.',
- messageId: "SVC4664"
- }
-#---------SVC4665------------------------------
-# %1 - max length
- SERVICE_TYPE_EXCEEDS_LIMIT: {
- code: 400,
- message: "Error: Invalid Content. Service type exceeds limit of %1 characters.",
- messageId: "SVC4665"
- }
-#---------SVC4666------------------------------
- INVALID_SERVICE_TYPE: {
- code: 400,
- message: 'Error: Invalid Content. Serivce type is not allowed to contain characters like <>:"\/|?* and space characters other than regular space.',
- messageId: "SVC4666"
- }
-#---------SVC4667------------------------------
-# %1 - max length
- SERVICE_ROLE_EXCEEDS_LIMIT: {
- code: 400,
- message: "Error: Invalid Content. Service role exceeds limit of %1 characters.",
- messageId: "SVC4667"
- }
-#---------SVC4668------------------------------
- INVALID_SERVICE_ROLE: {
- code: 400,
- message: 'Error: Invalid Content. Service role is not allowed to contain characters like <>:"\/|?* and space characters other than regular space.',
- messageId: "SVC4668"
- }
-
-#---------SVC4669-----------------------------
- INVALID_RESOURCE_TYPE: {
- code: 400,
- message: "Error: Invalid resource type.",
- messageId: "SVC4669"
- }
-#---------SVC4670------------------------------
- ARTIFACT_NAME_INVALID: {
- code: 400,
- message: "Error: Artifact name is invalid.",
- messageId: "SVC4670"
- }
-#---------SVC4671------------------------------
-# %1 - VSP name
-# %2 - VFC name
- CFVC_LOOP_DETECTED: {
- code: 400,
- message: 'Error: VSP %1 cannot be imported. The VSP contains internal loop in VFC %2',
- messageId: "SVC4671"
- }
-#---------SVC4672------------------------------
-# %1 - capability uniqueId
-# %2 - instance uniqueId
-# %3 - container uniqueId
- COMPONENT_INSTANCE_NOT_FOUND_ON_CONTAINER: {
- code: 404,
- message: "Error: Requested capability %1 of instance %2 was not found on the container %3.",
- messageId: "SVC4672"
- }
-
-
-#---------SVC4673------------------------------
- INVALID_SERVICE_STATE: {
- code: 409,
- message: "Error: Invalid service state. Expected state: %1, actual state: %2",
- messageId: "SVC4673"
- }
-
-#---------SVC4674------------------------------
- INVALID_RESPONSE_FROM_PROXY: {
- code: 502,
- message: "Error: The server was acting as a gateway or proxy and received an invalid response from the upstream server",
- messageId: "SVC4674"
- } \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/config/test-apis-ci/neo4j-errors-configuration.yaml b/test-apis-ci/src/test/resources/config/test-apis-ci/neo4j-errors-configuration.yaml
deleted file mode 100644
index 7a0d6dbfd4..0000000000
--- a/test-apis-ci/src/test/resources/config/test-apis-ci/neo4j-errors-configuration.yaml
+++ /dev/null
@@ -1,60 +0,0 @@
-# Errors
-errors:
- Neo_ClientError_General_ReadOnly: "This is a read only database, writing or modifying the database is not allowed."
- Neo_ClientError_LegacyIndex_NoSuchIndex: "The request (directly or indirectly) referred to a index that does not exist."
- Neo_ClientError_Request_Invalid: "The client provided an invalid Request."
- Neo_ClientError_Request_InvalidFormat: "The client provided a request that was missing required fields, or had values that are not allowed."
- Neo_ClientError_Schema_ConstraintAlreadyExists: "Unable to perform operation because it would clash with a pre-existing constraint."
- Neo_ClientError_Schema_ConstraintVerificationFailure: "Unable to create constraint because data that exists in the database violates it."
- Neo_ClientError_Schema_ConstraintViolation: "A constraint imposed by the database was violated."
- Neo_ClientError_Schema_IllegalTokenName: "A token name, such as a label, relationship type or property key, used is not valid. Tokens cannot be empty strings and cannot be null."
- Neo_ClientError_Schema_IndexAlreadyExists: "Unable to perform operation because it would clash with a pre-existing index."
- Neo_ClientError_Schema_IndexBelongsToConstraint: "A requested operation can not be performed on the specified index because the index is part of a constraint. If you want to drop the index, for instance, you must drop the constraint."
- Neo_ClientError_Schema_IndexLimitReached: "The maximum number of index entries supported has been reached, no more entities can be indexed."
- Neo_ClientError_Schema_LabelLimitReached: "The maximum number of labels supported has been reached, no more labels can be created."
- Neo_ClientError_Schema_NoSuchConstraint: "The request (directly or indirectly) referred to a constraint that does not exist."
- Neo_ClientError_Schema_NoSuchIndex: "The request (directly or indirectly) referred to an index that does not exist."
- Neo_ClientError_Security_AuthenticationFailed: "The client provided an incorrect username and/or password."
- Neo_ClientError_Security_AuthenticationRateLimit: "The client has provided incorrect authentication details too many times in a row."
- Neo_ClientError_Security_AuthorizationFailed: "The client does not have privileges to perform the operation requested."
- Neo_ClientError_Statement_ArithmeticError: "Invalid use of arithmetic, such as dividing by zero."
- Neo_ClientError_Statement_ConstraintViolation: "A constraint imposed by the statement is violated by the data in the database."
- Neo_ClientError_Statement_EntityNotFound: "The statement is directly referring to an entity that does not exist."
- Neo_ClientError_Statement_InvalidArguments: "The statement is attempting to perform operations using invalid arguments"
- Neo_ClientError_Statement_InvalidSemantics: "The statement is syntactically valid, but expresses something that the database cannot do."
- Neo_ClientError_Statement_InvalidSyntax: "The statement contains invalid or unsupported syntax."
- Neo_ClientError_Statement_InvalidType: "The statement is attempting to perform operations on values with types that are not supported by the operation."
- Neo_ClientError_Statement_NoSuchLabel: "The statement is referring to a label that does not exist."
- Neo_ClientError_Statement_NoSuchProperty: "The statement is referring to a property that does not exist."
- Neo_ClientError_Statement_ParameterMissing: "The statement is referring to a parameter that was not provided in the Request."
- Neo_ClientError_Transaction_ConcurrentRequest: "There were concurrent requests accessing the same transaction, which is not allowed."
- Neo_ClientError_Transaction_EventHandlerThrewException: "A transaction event handler threw an exception. The transaction will be rolled back."
- Neo_ClientError_Transaction_HookFailed: "Transaction hook failure."
- Neo_ClientError_Transaction_InvalidType: "The transaction is of the wrong type to service the Request_ For instance, a transaction that has had schema modifications performed in it cannot be used to subsequently perform data operations, and vice versa."
- Neo_ClientError_Transaction_MarkedAsFailed: "Transaction was marked as both successful and failed. Failure takes precedence and so this transaction was rolled back although it may have looked like it was going to be committed"
- Neo_ClientError_Transaction_UnknownId: "The request referred to a transaction that does not exist."
- Neo_ClientError_Transaction_ValidationFailed: "Transaction changes did not pass validation checks"
- Neo_DatabaseError_General_CorruptSchemaRule: "A malformed schema rule was encountered. Please contact your support representative."
- Neo_DatabaseError_General_FailedIndex: "The request (directly or indirectly) referred to an index that is in a failed state. The index needs to be dropped and recreated manually."
- Neo_DatabaseError_General_UnknownFailure: "An unknown failure occurred."
- Neo_DatabaseError_Schema_ConstraintCreationFailure: "Creating a requested constraint failed."
- Neo_DatabaseError_Schema_ConstraintDropFailure: "The database failed to drop a requested constraint."
- Neo_DatabaseError_Schema_IndexCreationFailure: "Failed to create an index."
- Neo_DatabaseError_Schema_IndexDropFailure: "The database failed to drop a requested index."
- Neo_DatabaseError_Schema_NoSuchLabel: "The request accessed a label that did not exist."
- Neo_DatabaseError_Schema_NoSuchPropertyKey: "The request accessed a property that does not exist."
- Neo_DatabaseError_Schema_NoSuchRelationshipType: "The request accessed a relationship type that does not exist."
- Neo_DatabaseError_Schema_NoSuchSchemaRule: "The request referred to a schema rule that does not exist."
- Neo_DatabaseError_Statement_ExecutionFailure: "The database was unable to execute the Statement."
- Neo_DatabaseError_Transaction_CouldNotBegin: "The database was unable to start the Transaction."
- Neo_DatabaseError_Transaction_CouldNotCommit: "The database was unable to commit the Transaction."
- Neo_DatabaseError_Transaction_CouldNotRollback: "The database was unable to roll back the Transaction."
- Neo_DatabaseError_Transaction_CouldNotWriteToLog: "The database was unable to write transaction to log."
- Neo_DatabaseError_Transaction_ReleaseLocksFailed: "The transaction was unable to release one or more of its locks."
- Neo_TransientError_General_DatabaseUnavailable: "The database is not currently available to serve your request, refer to the database logs for more details. Retrying your request at a later time may succeed."
- Neo_TransientError_Network_UnknownFailure: "An unknown network failure occurred, a retry may resolve the issue."
- Neo_TransientError_Schema_ModifiedConcurrently: "The database schema was modified while this transaction was running, the transaction should be retried."
- Neo_TransientError_Security_ModifiedConcurrently: "The user was modified concurrently to this Request."
- Neo_TransientError_Statement_ExternalResourceFailure: "The external resource is not available"
- Neo_TransientError_Transaction_AcquireLockTimeout: "The transaction was unable to acquire a lock, for instance due to a timeout or the transaction thread being interrupted."
- Neo_TransientError_Transaction_DeadlockDetected: "This transaction, and at least one more transaction, has acquired locks in a way that it will wait indefinitely, and the database has aborted it. Retrying this transaction will most likely be successful." \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/config/test-apis-ci/users-configuration.yaml b/test-apis-ci/src/test/resources/config/test-apis-ci/users-configuration.yaml
deleted file mode 100644
index a6c23653f0..0000000000
--- a/test-apis-ci/src/test/resources/config/test-apis-ci/users-configuration.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-userCredentials:
- ci: 2a1f887d607d4515d4066fe0f5452a50:0a0dc557c3bf594b1a48030e3e99227580168b21f44e285c69740b8d5b13e33b \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/cucumber/tenantIsolation.feature b/test-apis-ci/src/test/resources/cucumber/tenantIsolation.feature
deleted file mode 100644
index f1a0f6f6e3..0000000000
--- a/test-apis-ci/src/test/resources/cucumber/tenantIsolation.feature
+++ /dev/null
@@ -1,38 +0,0 @@
-Feature: Tenant Isolation Feature
-
- #Get individual external AT&T Certificate API
- Scenario Outline: Create operational Envrionment
- Given AAI returns <retcode> and aai_body contains <tenant> and <workload>
- When The Number Of Operational Envrinoments that created is <numberOfEnvs> and Records are added with data <recordData>
- Then The Number Of Environment is <numberOfEnvs> with status <recordStatus>
- #Verify Succesfull A&AI Call
- And Operational Environment record contains tenant field <isTenantExist>
- And Operational Environment record contains workload field <isWorkloadtExist>
- #Verify Succesfull DME Call
- And Operational Environment record contains UEB Address field <isUebAddressExist>
-
- Examples:
- | retcode | tenant | workload | recordData | numberOfEnvs | recordStatus | isTenantExist | isWorkloadtExist | isUebAddressExist |
- | 200 | Test | VNF_Development | {"status": "failed", "last_modified_delta": 0} | 1 | completed | true | true | true |
-
- Scenario Outline: Distribute To Operational Environment
- Given ASDC Address is 127.0.0.1
- And The number of complete environments is <numberOfEnvs>
- #Start SImulator for each envrionment
- And The number of artifacts each Simulator downloads from a service is <numberOfArtifactsDownloaded>
- #5 (3 days) - run jar
- And MSO-WD Simulators Started with topic name MSHITRIT-D2D
- And ASDC Contains the following services <ListOfServicesUUID>
- # (1.5 days)
- And MSO Final Distribution Simulator is UP
- #4 (Sends 75 request )(2 days)
- When Distribution Requests are Sent By MSO
- Then All MSO-WD Simulators Sent The Distribution Complete Notifications
- And All Artifacts were downloaded by Simulators
- #6
- And MSO Final Distribution Recieved Correct Number Of Request
-
- Examples:
- | numberOfEnvs | numberOfArtifactsDownloaded | ListOfServicesUUID |
- #| 5 | 8 | 74e05aac-48d5-4642-8dc1-dc1ddeb5c0f5,fa86100a-409b-4310-835c-e401896181a5,8dbc41cc-2076-49c0-b95b-cb37b1539367,0c7eb2ac-06c0-41e1-b635-825037942e28,840123d1-b9d6-4036-8e94-471b268026bf,74331473-1eb0-4628-84b8-ab47948f7023, 3277af19-d152-4d94-a4d0-44ad6f226b52, e553c12b-b67b-4d66-a6a9-8676d5e0becf, f648052e-3207-4eb2-9336-29f2fe9df618, 535c6ad3-ad2b-429f-ab9b-b654cf647c86,611c764d-8862-4f09-a8e0-1622f8d97ce9, b5df0774-2445-4daf-b893-61c014652145, 01481626-b58a-49b5-ba1e-74eb8508ed15, 9e17345a-d11d-4219-b4e3-e86cfdb51d07, 5ff40fbc-f4e9-45f1-85de-0a04b8a5d60c |
- | 2 | 2 | 74e05aac-48d5-4642-8dc1-dc1ddeb5c0f5,fa86100a-409b-4310-835c-e401896181a5 |
diff --git a/test-apis-ci/src/test/resources/logback-test.xml b/test-apis-ci/src/test/resources/logback-test.xml
deleted file mode 100644
index 03ce9d1243..0000000000
--- a/test-apis-ci/src/test/resources/logback-test.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<!-- only one line, shut up logback ! -->
-<configuration>
- <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
- <encoder>
- <Pattern>
- %d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n
- </Pattern>
- </encoder>
- </appender>
- <root level="off">
- <appender-ref ref="STDOUT" />
- </root>
-</configuration> \ No newline at end of file
diff --git a/test-apis-ci/src/test/resources/preferredRouter.txt b/test-apis-ci/src/test/resources/preferredRouter.txt
deleted file mode 100644
index e69de29bb2..0000000000
--- a/test-apis-ci/src/test/resources/preferredRouter.txt
+++ /dev/null
diff --git a/test-apis-ci/testng.xml b/test-apis-ci/testng.xml
deleted file mode 100644
index f06b75aacf..0000000000
--- a/test-apis-ci/testng.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="Suite">
- <listeners>
- </listeners>
- <test name="Test">
- <classes>
- </classes>
- </test> <!-- Test -->
-</suite> <!-- Suite -->
-
-
-
diff --git a/test-apis-ci/testngLifeCycle.xml b/test-apis-ci/testngLifeCycle.xml
deleted file mode 100644
index 6188116210..0000000000
--- a/test-apis-ci/testngLifeCycle.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="lifeCycle" parallel="none">
- <test name="Test">
- <classes>
- <class name="LCSbaseTest"/>
- </classes>
- </test> <!-- Test -->
-</suite> <!-- lifeCycle -->
diff --git a/test-apis-ci/tmpCSAR b/test-apis-ci/tmpCSAR
deleted file mode 100644
index 0b8151088d..0000000000
--- a/test-apis-ci/tmpCSAR
+++ /dev/null
Binary files differ
diff --git a/ui-ci/.gitignore b/ui-ci/.gitignore
deleted file mode 100644
index 1b73d10df5..0000000000
--- a/ui-ci/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-/bin/
-test-output/
-sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/Files
-sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/testSuites \ No newline at end of file
diff --git a/ui-ci/pom.xml b/ui-ci/pom.xml
index 244f997966..e69de29bb2 100644
--- a/ui-ci/pom.xml
+++ b/ui-ci/pom.xml
@@ -1,553 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <artifactId>ui-ci</artifactId>
- <description>Selenium tests for the SDnC Application</description>
-
- <parent>
- <groupId>org.openecomp.sdc</groupId>
- <artifactId>sdc-main</artifactId>
- <version>1.7.0-SNAPSHOT</version>
- </parent>
-
- <properties>
- <sonar.skip>true</sonar.skip>
- <jacoco.skip>true</jacoco.skip>
- <aspectj.version>1.8.10</aspectj.version>
- </properties>
-
- <dependencies>
-
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- <version>${guava.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.seleniumhq.selenium</groupId>
- <artifactId>selenium-java</artifactId>
-
- <version>2.53.1</version>
- <exclusions>
- <exclusion>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-util</artifactId>
- </exclusion>
- <exclusion>
- <groupId>io.netty</groupId>
- <artifactId>netty</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-util</artifactId>
- <version>${jetty.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.seleniumhq.selenium</groupId>
- <artifactId>selenium-server</artifactId>
- <version>2.53.1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-net</groupId>
- <artifactId>commons-net</artifactId>
- <version>3.3</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>2.4</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- <version>${jackson.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.openecomp.sdc</groupId>
- <artifactId>test-apis-ci</artifactId>
- <version>${project.version}</version>
- <exclusions>
- <exclusion>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.yaml</groupId>
- <artifactId>snakeyaml</artifactId>
- <version>${snakeyaml.version}</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.functionaljava</groupId>
- <artifactId>functionaljava</artifactId>
- <version>${functionaljava.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <version>${gson.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <!-- http client -->
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
- <version>${httpclient.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpmime</artifactId>
- <version>${httpclient.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>${commons-logging}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>${slf4j-api.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- <version>${logback.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-core</artifactId>
- <version>${logback.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <!-- http core -->
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpcore</artifactId>
- <version>${httpcore.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- <version>${jackson.version}</version>
- <exclusions>
- <exclusion>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.openecomp.sdc.sdc-distribution-client</groupId>
- <artifactId>sdc-distribution-client</artifactId>
- <version>1.2.3</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.hamcrest</groupId>
- <artifactId>hamcrest</artifactId>
- <version>${hamcrest.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-library</artifactId>
- <version>${hamcrest.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter</artifactId>
- <version>${junitJupiter.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-junit-jupiter</artifactId>
- <version>${mockitoJupiter.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- <version>${testng.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- <version>1.4.01</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>com.googlecode.json-simple</groupId>
- <artifactId>json-simple</artifactId>
- <version>${json-simple.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-jci-core</artifactId>
- <version>${commons-jci-core.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>${commons-codec}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>com.aventstack</groupId>
- <artifactId>extentreports</artifactId>
- <version>3.0.6</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>net.lightbody.bmp</groupId>
- <!-- To use the legacy, Jetty-based implementation, change the artifactId
- to browsermob-core -->
- <artifactId>browsermob-core</artifactId>
- <version>2.1.4</version>
- <exclusions>
- <exclusion>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>com.github.markusbernhardt</groupId>
- <artifactId>proxy-vole</artifactId>
- <version>1.0.2</version>
- </dependency>
-
- <dependency>
- <groupId>com.paulhammant</groupId>
- <artifactId>ngwebdriver</artifactId>
- <version>0.9.7</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>com.google.inject</groupId>
- <artifactId>guice</artifactId>
- <version>4.1.0</version>
- </dependency>
-
- <dependency>
- <groupId>org.codehaus.groovy</groupId>
- <artifactId>groovy</artifactId>
- </dependency>
-
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-handler</artifactId>
- </dependency>
-
- </dependencies>
-
- <build>
-
- <plugins>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-clean-plugin</artifactId>
- <executions>
- <execution>
- <id>clean.tosca.chef.os.folder</id>
- <phase>clean</phase>
- <goals>
- <goal>clean</goal>
- </goals>
- <configuration>
- <filesets>
-
- <!-- Sanity jar -->
- <fileset>
- <directory>${project.basedir}/sdc-ui-tests</directory>
- <followSymlinks>false</followSymlinks>
- <includes>
- <include>*.jar</include>
- </includes>
- </fileset>
- <!-- Sanity test suites -->
- <fileset>
- <directory>
- ${project.basedir}/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/testSuites
- </directory>
- <followSymlinks>false</followSymlinks>
- </fileset>
- <!-- Package files -->
- <fileset>
- <directory>
- ${project.basedir}/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/Files
- </directory>
- <followSymlinks>false</followSymlinks>
- </fileset>
- </filesets>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-deploy-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>create.jar.with.dependencies</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- <configuration>
- <archive>
- <manifest>
- <mainClass>org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest</mainClass>
- </manifest>
- </archive>
- <descriptorRefs>
- <descriptorRef>jar-with-dependencies</descriptorRef>
- </descriptorRefs>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>com.github.sylvainlaurent.maven</groupId>
- <artifactId>yaml-json-validator-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>validate</id>
- <phase>validate</phase>
- <goals>
- <goal>validate</goal>
- </goals>
- <configuration>
- <validationSets>
- <validationSet>
- <includes>
- <include>src/main/resources/**/*.y*ml</include>
- <include>src/test/resources/**/*.y*ml</include>
- </includes>
- </validationSet>
- <validationSet>
- <includes>
- <include>src/main/resources/**/*.json</include>
- <include>src/test/resources/**/*.json</include>
- </includes>
- </validationSet>
- </validationSets>
- <skip>${skipYamlJsonValidator}</skip>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- <profiles>
- <profile>
- <id>docker</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- <executions>
- <execution>
- <id>copy-tests-suites</id>
- <phase>verify</phase>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <configuration>
- <outputDirectory>
- sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/testSuites
- </outputDirectory>
- <resources>
- <resource>
- <directory>${project.parent.basedir}/ui-ci/src/main/resources/ci/testSuites
- </directory>
- <includes>
- <include>*</include>
- </includes>
- </resource>
- </resources>
- </configuration>
- </execution>
-
- <execution>
- <id>copy-csar-files</id>
- <phase>verify</phase>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <configuration>
- <outputDirectory>
- sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/Files
- </outputDirectory>
- <resources>
- <resource>
- <directory>
- ${project.parent.basedir}/test-apis-ci/sdc-api-tests/chef-repo/cookbooks/sdc-api-tests/files/default/Files
- </directory>
- <filtering>false</filtering>
- <includes>
- <include>VNFs/*</include>
- <include>PNFs/*</include>
- </includes>
- </resource>
- </resources>
- </configuration>
- </execution>
-
- <execution>
- <id>copy-resources-ui-ci</id>
- <phase>verify</phase>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <configuration>
- <outputDirectory>${basedir}/sdc-ui-tests</outputDirectory>
- <resources>
- <resource>
- <directory>${project.parent.basedir}/ui-ci/target</directory>
- <includes>
- <include>ui-ci-${project.version}-jar-with-dependencies.jar</include>
- </includes>
- </resource>
- </resources>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>io.fabric8</groupId>
- <artifactId>docker-maven-plugin</artifactId>
- <configuration>
- <apiVersion>1.23</apiVersion>
- <registry>nexus3.onap.org:10001</registry>
- <authConfig>
- <pull>
- <username>docker</username>
- <password>docker</password>
- </pull>
- </authConfig>
- <images>
-
- <!-- Build sanity image -->
- <image>
- <name>onap/sdc-ui-tests</name>
- <alias>sdc-ui-sanity</alias>
- <build>
- <cleanup>try</cleanup>
- <dockerFileDir>${project.basedir}/sdc-ui-tests</dockerFileDir>
- <tags>
- <tag>${docker.tag}</tag>
- <tag>
- ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-latest
- </tag>
- </tags>
- </build>
- </image>
-
- </images>
- </configuration>
- <executions>
- <execution>
- <id>clean-images</id>
- <phase>pre-clean</phase>
- <goals>
- <goal>remove</goal>
- </goals>
- <configuration>
- <removeAll>true</removeAll>
- <image>onap/sdc-ui-tests</image>
- </configuration>
- </execution>
-
- <execution>
- <id>generate-images</id>
- <phase>install</phase>
- <goals>
- <goal>build</goal>
- </goals>
- </execution>
-
- <execution>
- <id>push-images</id>
- <phase>deploy</phase>
- <goals>
- <goal>push</goal>
- </goals>
- <configuration>
- <image>onap/sdc-ui-tests</image>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-</project>
diff --git a/ui-ci/sdc-ui-tests/Dockerfile b/ui-ci/sdc-ui-tests/Dockerfile
deleted file mode 100644
index e3025420ea..0000000000
--- a/ui-ci/sdc-ui-tests/Dockerfile
+++ /dev/null
@@ -1,28 +0,0 @@
-FROM onap/base_sdc-vnc:1.7.0
-
-# install packages
-RUN DEBIAN_FRONTEND=noninteractive \
- apt-get -y update \
- && \
- apt-get -y install \
- jq \
- openssl \
- && \
- apt-get -y clean
-
-COPY chef-solo /root/chef-solo/
-
-COPY chef-repo/cookbooks/. /root/chef-solo/cookbooks/
-
-
-ENV TESTS_BASE /var/lib/tests
-RUN mkdir -p "$TESTS_BASE"
-WORKDIR $TESTS_BASE
-
-ADD ui-ci-*.jar ${TESTS_BASE}/
-
-COPY startup.sh /root/
-
-RUN chmod 770 /root/startup.sh
-
-ENTRYPOINT [ "/root/startup.sh" ]
diff --git a/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/attributes/default.rb b/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/attributes/default.rb
deleted file mode 100644
index 4287ca8617..0000000000
--- a/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/attributes/default.rb
+++ /dev/null
@@ -1 +0,0 @@
-# \ No newline at end of file
diff --git a/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/conf/attsdc-packages.yaml b/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/conf/attsdc-packages.yaml
deleted file mode 100644
index 5d1a3e1537..0000000000
--- a/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/conf/attsdc-packages.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-packages:
- - org.openecomp.sdc.ci.tests.execute.general
- - org.openecomp.sdc.ci.tests.execute.user
- - org.openecomp.sdc.ci.tests.execute.property
- - org.openecomp.sdc.ci.tests.execute.lifecycle
- - org.openecomp.sdc.ci.tests.execute.resource
- - org.openecomp.sdc.ci.tests.execute.service
- - org.openecomp.sdc.ci.tests.execute.artifacts
- - org.openecomp.sdc.ci.tests.execute.imports
- - org.openecomp.sdc.ci.tests.execute.category
- - org.openecomp.sdc.ci.tests.execute.distribution
- - org.openecomp.sdc.ci.tests.execute.product \ No newline at end of file
diff --git a/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/conf/credentials.yaml b/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/conf/credentials.yaml
deleted file mode 100644
index 05f9a71c5c..0000000000
--- a/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/conf/credentials.yaml
+++ /dev/null
@@ -1,48 +0,0 @@
- designer: {
- username: cs0008,
- password: 123123a,
- firstname: SDC,
- lastname: SDC2
- }
- admin: {
- username: jh0003,
- password: 123123a,
- firstname: SDC,
- lastname: SDC2
- }
- ops: {
- username: op0001,
- password: 123123a,
- firstname: SDC,
- lastname: SDC2
- }
- tester: {
- username: jm0007,
- password: 123123a,
- firstname: SDC,
- lastname: SDC2
- }
- governor: {
- username: gv0001,
- password: 123123a,
- firstname: SDC,
- lastname: SDC2
- }
- product_strategist: {
- username: m99126,
- password: 123123a,
- firstname: SDC,
- lastname: SDC2
- }
- product_manager: {
- username: m99127,
- password: 123123a,
- firstname: SDC,
- lastname: SDC2
- }
- product_local: {
- username: pm0001,
- password: 123123a,
- firstname: SDC,
- lastname: SDC2
- } \ No newline at end of file
diff --git a/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/conf/log4j2.properties b/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/conf/log4j2.properties
deleted file mode 100644
index ec22601d6a..0000000000
--- a/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/conf/log4j2.properties
+++ /dev/null
@@ -1,49 +0,0 @@
-status = error
-dest = err
-name = PropertiesConfig
-
-property.filename = ${targetlog}logs/ci-log.out
-
-#filter.threshold.type = ThresholdFilter
-#filter.threshold.level = debug
-
-appender.rolling.type = RollingFile
-appender.rolling.name = RollingFile
-appender.rolling.fileName = ${filename}
-appender.rolling.filePattern = ${targetlog}logs/ci-%d{MM-dd-yy-HH-mm-ss}-%i.log.gz
-appender.rolling.layout.type = PatternLayout
-appender.rolling.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %5p [%10c] : %m%n
-appender.rolling.policies.type = Policies
-appender.rolling.policies.size.type = SizeBasedTriggeringPolicy
-appender.rolling.policies.size.size=5MB
-appender.rolling.strategy.type = DefaultRolloverStrategy
-appender.rolling.strategy.max = 10
-
-appender.console.type = Console
-appender.console.name = STDOUT
-appender.console.layout.type = PatternLayout
-appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %5p %10c:%L - %m%n
-appender.console.filter.threshold.type = ThresholdFilter
-appender.console.filter.threshold.level = info
-
-loggers=org.apache.cassandra.service.StorageProxy,org.janusgraph.diskstorage.cassandra.CassandraTransaction,org.openecomp.sdc.ci.tests.utils
-
-logger.org.apache.cassandra.service.StorageProxy.name = org.apache.cassandra.service.StorageProxy
-logger.org.apache.cassandra.service.StorageProxy.level=info
-logger.org.apache.cassandra.service.StorageProxy.appendRef.rolling.ref = RollingFile
-logger.org.apache.cassandra.service.StorageProxy.appendRef.stdout.ref = STDOUT
-
-logger.org.janusgraph.diskstorage.cassandra.CassandraTransaction.name = org.janusgraph.diskstorage.cassandra.CassandraTransaction
-logger.org.janusgraph.diskstorage.cassandra.CassandraTransaction.level =info
-logger.org.janusgraph.diskstorage.cassandra.CassandraTransaction.appendRef.rolling.ref = RollingFile
-logger.org.janusgraph.diskstorage.cassandra.CassandraTransaction.appendRef.stdout.ref = STDOUT
-
-logger.org.openecomp.sdc.ci.tests.utils.name = org.openecomp.sdc.ci.tests.utils
-logger.org.openecomp.sdc.ci.tests.utils.level = info
-logger.org.openecomp.sdc.ci.tests.utils.appendRef.rolling.ref = RollingFile
-logger.org.openecomp.sdc.ci.tests.utils.appendRef.stdout.ref = STDOUT
-logger.org.openecomp.sdc.ci.tests.utils.additivity = false
-
-rootLogger.level = info
-rootLogger.appenderRef.stdout.ref = STDOUT
-rootLogger.appenderRef.rolling.ref = RollingFile \ No newline at end of file
diff --git a/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/conf/logback.xml b/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/conf/logback.xml
deleted file mode 100644
index b41ee12695..0000000000
--- a/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/conf/logback.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<configuration scan="true" scanPeriod="5 seconds">
-
- <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
- <encoder>
- <pattern>%d{yyyy-MM-dd HH:mm:ss} | %-5p | [%thread] %logger{5}:%L - %msg%n</pattern>
- </encoder>
- </appender>
-
- <appender name="FILE" class="ch.qos.logback.core.FileAppender">
- <file>logFile.log</file>
- <append>true</append>
- <encoder>
- <pattern>%d{yyyy-MM-dd HH:mm:ss} | %-5p | [%thread] %logger{5}:%L - %msg%n</pattern>
- </encoder>
- </appender>
-
- <logger name="com.memorynotfound" level="INFO"/>
-
- <root level="INFO">
- <appender-ref ref="STDOUT" />
- <appender-ref ref="FILE" />
- </root>
-
-</configuration> \ No newline at end of file
diff --git a/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/org.onap.sdc.trust.jks b/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/org.onap.sdc.trust.jks
deleted file mode 100644
index e6686cc08c..0000000000
--- a/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/org.onap.sdc.trust.jks
+++ /dev/null
Binary files differ
diff --git a/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/startTest.sh b/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/startTest.sh
deleted file mode 100644
index d16d05400f..0000000000
--- a/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/files/default/startTest.sh
+++ /dev/null
@@ -1,147 +0,0 @@
-#!/bin/bash
-REMOTE_DEBUG=false
-RERUN=false
-debug_port=8000
-TEST_SUITES=testSuites
-fileName=testng-failed.xml
-JAVA_OPTIONS="${JAVA_OPTIONS} \
- -Djavax.net.ssl.trustStore=/var/lib/tests/etc/org.onap.sdc.trust.jks \
- -Dtestng.show.stack.frames=true \
- "
-
-function help_usage ()
-{
- echo
- echo "$0 (<jar_file_name> <suite file name>) [-r/rerun <true/false> -d/debug <true/false>]"
- echo "nohup ./startTest.sh ui-ci-1707.0.5-SNAPSHOT-jar-with-dependencies.jar extendedSanity.xml -r false -d true &"
- echo "by default rerun is true and remote debug is false."
- echo
- exit 2
-}
-
-function isBoolean ()
-{
- PARAM_NAME=$1
- VALUE=$2
- if [[ ${VALUE} != "true" ]] && [[ ${VALUE} != "false" ]]; then
- echo "Valid parameter" ${PARAM_NAME} "values are: true/false"
- help_usage
- fi
-}
-
-function prepareFailedXmlFile ()
-{
- echo "1="$1 "2="$2 "fileName="${fileName}
- PATTERN=`grep -w "test name=" ${FULL_PATH}/${TEST_SUITES}/$2 | awk -F'"' '{print $2}'`
- sed '/<test name="'${PATTERN}'"/,/<!-- '${PATTERN}' --/d' $1 > ${FULL_PATH}/${TEST_SUITES}/${fileName}
- sed -i 's/thread-count="[0-9]\+"/thread-count="1"/g' ${FULL_PATH}/${TEST_SUITES}/${fileName}
- if [ -s "ExtentReport/ShortReport.csv" ]
- then
- SKIP_TESTS_LIST=$(cat ExtentReport/ShortReport.csv |awk -F, '{print $2}' | sed 's/&.*//g' | uniq)
- for SKIP_TEST in ${SKIP_TESTS_LIST}; do
- sed -i "s/.*\"${SKIP_TEST}\".*//g" ${FULL_PATH}/${TEST_SUITES}/${fileName};
- done;
- fi
-}
-
-function setUpdatedTimeToReport ()
-{
- LINE_NUMBER_OF_START_REPORT_DATE=`grep -A1 -nw "Start" ExtentReport/SDC_UI_Extent_Report.html | tail -1 | awk '{print $1}' | tr -d -`
- END_REPORT_DATE=`grep -A1 -nw "End" ExtentReport/SDC_UI_Extent_Report.html | tail -1 | awk -F'[>|<]' '{print $3}'`
- EPOCH_START_REPORT_DATE=`date --date="${1}" +%s`
- EPOCH_END_REPORT_DATE=`date --date="${END_REPORT_DATE}" +%s`
- let DIFF_EPOCH_TIME=${EPOCH_END_REPORT_DATE}-${EPOCH_START_REPORT_DATE}
- TAKEN_TIME_IN_MINUTES=`echo $((${DIFF_EPOCH_TIME}/60))`
- LINE_NUMBER_OF_TAKEN_REPORT_TIME=`grep -A1 -nw "Time Taken" ExtentReport/SDC_UI_Extent_Report.html | tail -1 | awk '{print $1}' | tr -d -`
- PATTERN="div class='panel-lead'>";
- sed -i "${LINE_NUMBER_OF_START_REPORT_DATE}s/${PATTERN}.*\</${PATTERN}$1\<\//1" ExtentReport/SDC_UI_Extent_Report.html
- sed -i "${LINE_NUMBER_OF_TAKEN_REPORT_TIME}s/${PATTERN}.*\</${PATTERN}${TAKEN_TIME_IN_MINUTES} min\<\//1" ExtentReport/SDC_UI_Extent_Report.html
-}
-
-#main
-[ $# -lt 2 ] && help_usage
-
-JAR_FILE=$1
-SUITE_FILE=$2
-
-while [ $# -ne 0 ]; do
- case $1 in
- -r|rerun)
- RERUN=$2
- isBoolean $1 ${RERUN}
- shift 1
- shift 1
- ;;
- -d|debug)
- REMOTE_DEBUG=$2
- isBoolean $1 ${REMOTE_DEBUG}
- shift 1
- shift 1
- ;;
- *)
- shift 1
- ;;
- esac
-done
-
-CURRENT_DIR=`pwd`
-BASEDIR=$(dirname $0)
-
-if [ ${BASEDIR:0:1} = "/" ]
-then
- FULL_PATH=$BASEDIR
-else
- FULL_PATH=$CURRENT_DIR/$BASEDIR
-fi
-LOGS_PROP_FILE=conf/log4j2.properties
-#############################################
-TARGET_DIR=${FULL_PATH}/target
-CONF_FILE=${FULL_PATH}/conf/sdc.yaml
-
-DEBUG=true
-MainClass=org.openecomp.sdc.ci.tests.run.StartTest
-
-TESTS_DIR=/opt/app/sdc/ci/resources/tests
-COMPONENTS_DIR=/opt/app/sdc/ci/resources/components
-
-
-TARGET_LOG_DIR="${TARGET_DIR}/"
-
-
-
-
-
-
-if [ ${REMOTE_DEBUG} == "true" ]; then
- echo "Debug mode, Listen on port $debug_port";
- JAVA_OPTION="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=${debug_port}" ;
-fi
-
-cmd="java $JAVA_OPTIONS -DdisplayException=true -Dtargetlog=${TARGET_LOG_DIR} -DfilePath=${FILES_TEST} -Dconfig.resource=${CONF_FILE} -Ddebug=${DEBUG} -Dlog4j.configuration=${LOGS_PROP_FILE} -cp $JAR_FILE ${MainClass} $SUITE_FILE &"
-
-
-if [ $DEBUG == "true" ]
-then
- $cmd
-else
- $cmd >> /dev/null
-fi
-
-if [ ${RERUN} == "true" ]; then
- if [ -f ${TARGET_DIR}/${fileName} ]; then
- echo "Prepare" ${TARGET_DIR}/${fileName} "file to rerun all failed tests ...";
- prepareFailedXmlFile ${TARGET_DIR}/${fileName} $SUITE_FILE;
- SUITE_FILE=${fileName};
- cmd="java $JAVA_OPTIONS -DdisplayException=true -Dtargetlog=${TARGET_LOG_DIR} -DfilePath=${FILES_TEST} -Dconfig.resource=${CONF_FILE} -Ddebug=${DEBUG} -Dlog4j.configuration=${LOGS_PROP_FILE} -cp $JAR_FILE ${MainClass} $SUITE_FILE &"
- $cmd;
- fi
-fi
-
-status=`echo $?`
-
-
-echo "##################################################"
-echo "################# status is ${status} #################"
-echo "##################################################"
-
-exit $status
diff --git a/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/recipes/sanityUiTests_1_setup_env.rb b/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/recipes/sanityUiTests_1_setup_env.rb
deleted file mode 100644
index 61d0133888..0000000000
--- a/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/recipes/sanityUiTests_1_setup_env.rb
+++ /dev/null
@@ -1,64 +0,0 @@
-tests_base="/var/lib/tests"
-
- remote_directory '/var/lib/tests/testSuites' do
- source 'testSuites'
- owner 'root'
- group 'root'
- mode '0755'
- action :create
- end
-
- remote_directory '/var/lib/tests/Files' do
- source 'Files'
- owner 'root'
- group 'root'
- mode '0755'
- action :create
- end
-
- remote_directory '/var/lib/tests/conf' do
- source 'conf'
- owner 'root'
- group 'root'
- mode '0755'
- action :create
- end
-
- directory "create_target_dir" do
- path "/var/lib/tests/target"
- owner 'root'
- group 'root'
- mode '0755'
- action :create
- end
-
- directory "create_ExtentReport_dir" do
- path "/var/lib/tests/ExtentReport"
- owner 'root'
- group 'root'
- mode '0755'
- action :create
- end
-
- cookbook_file '/var/lib/tests/startTest.sh' do
- source 'startTest.sh'
- owner 'root'
- group 'root'
- mode '0755'
- action :create
- end
-
- directory "create_etc_dir" do
- path "/var/lib/tests/etc"
- owner 'root'
- group 'root'
- mode '0755'
- action :create
- end
-
-cookbook_file "/var/lib/tests/etc/org.onap.sdc.trust.jks" do
- source "org.onap.sdc.trust.jks"
- owner "root"
- group "root"
- mode 0644
-end \ No newline at end of file
diff --git a/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/recipes/sanityUiTests_2_setup_configuration.rb b/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/recipes/sanityUiTests_2_setup_configuration.rb
deleted file mode 100644
index 16dfff3da6..0000000000
--- a/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/recipes/sanityUiTests_2_setup_configuration.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-tests_base="/var/lib/tests"
-
-template "sdc-yaml-config" do
- path "#{tests_base}/conf/sdc.yaml"
- source "sdc-sanity.yaml.erb"
- owner "root"
- group "root"
- mode "0755"
- variables ({
- :catalogBE_host => node['Nodes']['BE'],
- :catalogBE_port => node['BE'][:http_port],
- :webportal_host => node['Nodes']['FE'],
- :webportal_port => node['FE'][:http_port],
- :janusgraph_file => "#{tests_base}/conf/janusgraph.properties",
- :tests_base_ci => "#{tests_base}/CI/tests",
- :components_path => "#{tests_base}/CI/components",
- :importResourceConfigDir => "#{tests_base}/CI/importResource",
- :importTypesDir => "#{tests_base}/CI/importTypesTest",
- :importResourceTestsConfigDir => "#{tests_base}/CI/importResourceTests",
- :ConfigurationFile => "#{tests_base}/conf/configuration.yaml",
- :errorConfigurationFile => "#{tests_base}/conf/error-configuration.yaml",
- :CASSANDRA_IP => node['Nodes']['CS'].join(",").gsub(/[|]/,''),
- :CASSANDRA_PORT => node['cassandra'][:cassandra_port],
- :CASSANDRA_PWD => node['cassandra'][:cassandra_password],
- :CASSANDRA_USR => node['cassandra'][:cassandra_user],
- :ES_IP => node['Nodes']['ES']
- })
-end
-
-template "janusgraph.properties" do
- path "/#{tests_base}/conf/janusgraph.properties"
- source "BE-janusgraph.properties.erb"
- owner "root"
- group "root"
- mode "0755"
- variables({
- :CASSANDRA_IP => node['Nodes']['CS'].join(",").gsub(/[|]/,''),
- :CASSANDRA_PORT => node['cassandra'][:cassandra_port],
- :CASSANDRA_PWD => node['cassandra'][:cassandra_password],
- :CASSANDRA_USR => node['cassandra'][:cassandra_user],
- :rep_factor => node['cassandra']['replication_factor'],
- :DC_NAME => node['cassandra']['datacenter_name']
- })
-end
diff --git a/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/recipes/sanityUiTests_3_sanity_execution.rb b/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/recipes/sanityUiTests_3_sanity_execution.rb
deleted file mode 100644
index 5f9ca0a3d1..0000000000
--- a/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/recipes/sanityUiTests_3_sanity_execution.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-tests_base="/var/lib/tests"
-ci_test_suite="#{ENV['SUITE_NAME']}.xml"
-
-bash "echo status" do
- code <<-EOH
- echo "DOCKER STARTED"
- EOH
-end
-
-bash "run asdc ci sanity tests" do
-cwd "#{tests_base}"
-code <<-EOH
- cd "#{tests_base}"
- jar_file=`ls ui-ci*-jar-with-dependencies.jar`
- ./startTest.sh $jar_file #{ci_test_suite} > #{tests_base}/target/startTest.log 2>&1
- echo "return code from startTest.sh = [$?]"
- echo "DOCKER STARTED"
-EOH
-end
diff --git a/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/templates/default/BE-janusgraph.properties.erb b/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/templates/default/BE-janusgraph.properties.erb
deleted file mode 100644
index 31a6614910..0000000000
--- a/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/templates/default/BE-janusgraph.properties.erb
+++ /dev/null
@@ -1,21 +0,0 @@
-
-storage.backend=cql
-storage.hostname=<%= @CASSANDRA_IP %>
-storage.port=<%= @CASSANDRA_PORT %>
-storage.username=<%= @CASSANDRA_USR %>
-storage.password=<%= @CASSANDRA_PWD %>
-storage.connection-timeout=10000
-storage.cql.keyspace=sdctitan
-storage.cql.ssl.enabled=false
-storage.cql.ssl.truststore.location=/var/lib/jetty/config/.truststore
-storage.cql.ssl.truststore.password=Aa123456
-cache.db-cache = false
-cache.db-cache-clean-wait = 20
-cache.db-cache-time = 180000
-cache.db-cache-size = 0.5
-storage.cql.read-consistency-level=LOCAL_QUORUM
-storage.cql.write-consistency-level=LOCAL_QUORUM
-storage.cql.replication-strategy-class=NetworkTopologyStrategy
-storage.cql.replication-strategy-options=<%= @DC_NAME %>,<%= @rep_factor %>
-storage.cql.local-datacenter=<%= @DC_NAME %>
-storage.lock.wait-time=500 \ No newline at end of file
diff --git a/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/templates/default/sdc-sanity.yaml.erb b/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/templates/default/sdc-sanity.yaml.erb
deleted file mode 100644
index 23d0abcdda..0000000000
--- a/ui-ci/sdc-ui-tests/chef-repo/cookbooks/sdc-ui-tests/templates/default/sdc-sanity.yaml.erb
+++ /dev/null
@@ -1,47 +0,0 @@
-browser: firefox
-uiSimulator: true
-
-
-<% if node[:disableHttp] -%>
-sdcHttpMethod: https
-onboardingBePort: <%= node['ONBOARDING_BE'][:https_port] %>
-onboardingBeHost: <%= node['ONBOARDING_BE'][:domain_name] %>
-url: https://<%= node['FE'][:domain_name] %>:8286/sdc1
-catalogBeHost: <%= node['BE'][:domain_name] %>
-catalogBePort: <%= node['BE'][:https_port] %>
-catalogFeHost: <%= node['FE'][:domain_name] %>
-catalogFePort: <%= node['FE'][:https_port] %>
-<% else %>
-sdcHttpMethod: http
-onboardingBePort: <%= node['ONBOARDING_BE'][:http_port] %>
-onboardingBeHost: <%= node['ONBOARDING_BE_VIP'] %>
-url: http://<%= @webportal_host %>:8285/sdc1
-catalogBeHost: <%= @catalogBE_host %>
-catalogBePort: <%= @catalogBE_port %>
-catalogFeHost: <%= @webportal_host %>
-catalogFePort: <%= @webportal_port %>
-<% end -%>
-
-
-esHost: <%= @ES_IP %>
-esPort: 9200
-disributionClientHost: disClient
-disributionClientPort: 8181
-
-remoteTesting: false
-systemUnderDebug: false
-reportDBhost: 135.76.210.43
-reportDBport: 27017
-
-useBrowserMobProxy: false
-captureTraffic: false
-
-
-resourceConfigDir: <%= @tests_path_ci %>
-componentsConfigDir: <%= @components_path %>
-importResourceConfigDir: <%= @importResourceConfigDir %>
-importResourceTestsConfigDir: <%= @importResourceTestsConfigDir %>
-errorConfigurationFile: <%= @errorConfigurationFile %>
-configurationFile: <%= @ConfigurationFile %>
-importTypesConfigDir: <%= @importTypesDir %>
-janusGraphPropertiesFile: <%= @janusgraph_file %>
diff --git a/ui-ci/sdc-ui-tests/chef-solo/LICENSE b/ui-ci/sdc-ui-tests/chef-solo/LICENSE
deleted file mode 100644
index 11069edd79..0000000000
--- a/ui-ci/sdc-ui-tests/chef-solo/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
-2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
-3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
-4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
-5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
-6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
-8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
-
-APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
-Copyright [yyyy] [name of copyright owner]
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
diff --git a/ui-ci/sdc-ui-tests/chef-solo/README.md b/ui-ci/sdc-ui-tests/chef-solo/README.md
deleted file mode 100644
index ddb0fda830..0000000000
--- a/ui-ci/sdc-ui-tests/chef-solo/README.md
+++ /dev/null
@@ -1,37 +0,0 @@
-Deprecated
-==========
-
-Use of this repository is deprecated. We recommend using the `chef generate repo` command that comes with [ChefDK](http://downloads.chef.io/chef-dk/).
-
-Overview
-========
-
-Every Chef installation needs a Chef Repository. This is the place where cookbooks, roles, config files and other artifacts for managing systems with Chef will live. We strongly recommend storing this repository in a version control system such as Git and treat it like source code.
-
-While we prefer Git, and make this repository available via GitHub, you are welcome to download a tar or zip archive and use your favorite version control system to manage the code.
-
-Repository Directories
-======================
-
-This repository contains several directories, and each directory contains a README file that describes what it is for in greater detail, and how to use it for managing your systems with Chef.
-
-* `cookbooks/` - Cookbooks you download or create.
-* `data_bags/` - Store data bags and items in .json in the repository.
-* `roles/` - Store roles in .rb or .json in the repository.
-* `environments/` - Store environments in .rb or .json in the repository.
-
-Configuration
-=============
-
-The repository contains a knife configuration file.
-
-* .chef/knife.rb
-
-The knife configuration file `.chef/knife.rb` is a repository specific configuration file for knife. If you're using Hosted Chef, you can download one for your organization from the management console. If you're using the Open Source Chef Server, you can generate a new one with `knife configure`. For more information about configuring Knife, see the Knife documentation.
-
-https://docs.chef.io/knife.html
-
-Next Steps
-==========
-
-Read the README file in each of the subdirectories for more information about what goes in those directories.
diff --git a/ui-ci/sdc-ui-tests/chef-solo/chefignore b/ui-ci/sdc-ui-tests/chef-solo/chefignore
deleted file mode 100644
index ba30af6cff..0000000000
--- a/ui-ci/sdc-ui-tests/chef-solo/chefignore
+++ /dev/null
@@ -1,11 +0,0 @@
-# Put files/directories that should be ignored in this file.
-# Lines that start with '# ' are comments.
-
-# emacs
-*~
-
-# vim
-*.sw[a-z]
-
-# subversion
-*/.svn/*
diff --git a/ui-ci/sdc-ui-tests/chef-solo/cookbooks/README.md b/ui-ci/sdc-ui-tests/chef-solo/cookbooks/README.md
deleted file mode 100644
index 86ea46bfbb..0000000000
--- a/ui-ci/sdc-ui-tests/chef-solo/cookbooks/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-This directory contains the cookbooks used to configure systems in your infrastructure with Chef.
-
-Knife needs to be configured to know where the cookbooks are located with the `cookbook_path` setting. If this is not set, then several cookbook operations will fail to work properly.
-
- cookbook_path ["./cookbooks"]
-
-This setting tells knife to look for the cookbooks directory in the present working directory. This means the knife cookbook subcommands need to be run in the `chef-repo` directory itself. To make sure that the cookbooks can be found elsewhere inside the repository, use an absolute path. This is a Ruby file, so something like the following can be used:
-
- current_dir = File.dirname(__FILE__)
- cookbook_path ["#{current_dir}/../cookbooks"]
-
-Which will set `current_dir` to the location of the knife.rb file itself (e.g. `~/chef-repo/.chef/knife.rb`).
-
-Configure knife to use your preferred copyright holder, email contact and license. Add the following lines to `.chef/knife.rb`.
-
- cookbook_copyright "Example, Com."
- cookbook_email "cookbooks@example.com"
- cookbook_license "apachev2"
-
-Supported values for `cookbook_license` are "apachev2", "mit","gplv2","gplv3", or "none". These settings are used to prefill comments in the default recipe, and the corresponding values in the metadata.rb. You are free to change the the comments in those files.
-
-Create new cookbooks in this directory with Knife.
-
- knife cookbook create COOKBOOK
-
-This will create all the cookbook directory components. You don't need to use them all, and can delete the ones you don't need. It also creates a README file, metadata.rb and default recipe.
-
-You can also download cookbooks directly from the Opscode Cookbook Site. There are two subcommands to help with this depending on what your preference is.
-
-The first and recommended method is to use a vendor branch if you're using Git. This is automatically handled with Knife.
-
- knife cookbook site install COOKBOOK
-
-This will:
-
-* Download the cookbook tarball from cookbooks.opscode.com.
-* Ensure its on the git master branch.
-* Checks for an existing vendor branch, and creates if it doesn't.
-* Checks out the vendor branch (chef-vendor-COOKBOOK).
-* Removes the existing (old) version.
-* Untars the cookbook tarball it downloaded in the first step.
-* Adds the cookbook files to the git index and commits.
-* Creates a tag for the version downloaded.
-* Checks out the master branch again.
-* Merges the cookbook into master.
-* Repeats the above for all the cookbooks dependencies, downloading them from the community site
-
-The last step will ensure that any local changes or modifications you have made to the cookbook are preserved, so you can keep your changes through upstream updates.
-
-If you're not using Git, use the site download subcommand to download the tarball.
-
- knife cookbook site download COOKBOOK
-
-This creates the COOKBOOK.tar.gz from in the current directory (e.g., `~/chef-repo`). We recommend following a workflow similar to the above for your version control tool.
diff --git a/ui-ci/sdc-ui-tests/chef-solo/data_bags/README.md b/ui-ci/sdc-ui-tests/chef-solo/data_bags/README.md
deleted file mode 100644
index 0c15a391fa..0000000000
--- a/ui-ci/sdc-ui-tests/chef-solo/data_bags/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-Data Bags
----------
-
-This directory contains directories of the various data bags you create for your infrastructure. Each subdirectory corresponds to a data bag on the Chef Server, and contains JSON files of the items that go in the bag.
-
-First, create a directory for the data bag.
-
- mkdir data_bags/BAG
-
-Then create the JSON files for items that will go into that bag.
-
- $EDITOR data_bags/BAG/ITEM.json
-
-The JSON for the ITEM must contain a key named "id" with a value equal to "ITEM". For example,
-
- {
- "id": "foo"
- }
-
-Next, create the data bag on the Chef Server.
-
- knife data bag create BAG
-
-Then upload the items in the data bag's directory to the Chef Server.
-
- knife data bag from file BAG ITEM.json
-
-
-Encrypted Data Bags
--------------------
-
-Added in Chef 0.10, encrypted data bags allow you to encrypt the contents of your data bags. The content of attributes will no longer be searchable. To use encrypted data bags, first you must have or create a secret key.
-
- openssl rand -base64 512 > secret_key
-
-You may use this secret_key to add items to a data bag during a create.
-
- knife data bag create --secret-file secret_key passwords mysql
-
-You may also use it when adding ITEMs from files,
-
- knife data bag create passwords
- knife data bag from file passwords data_bags/passwords/mysql.json --secret-file secret_key
-
-The JSON for the ITEM must contain a key named "id" with a value equal to "ITEM" and the contents will be encrypted when uploaded. For example,
-
- {
- "id": "mysql",
- "password": "abc123"
- }
-
-Without the secret_key, the contents are encrypted.
-
- knife data bag show passwords mysql
- id: mysql
- password: 2I0XUUve1TXEojEyeGsjhw==
-
-Use the secret_key to view the contents.
-
- knife data bag show passwords mysql --secret-file secret_key
- id: mysql
- password: abc123
-
diff --git a/ui-ci/sdc-ui-tests/chef-solo/environments/README.md b/ui-ci/sdc-ui-tests/chef-solo/environments/README.md
deleted file mode 100644
index 50ac48db2b..0000000000
--- a/ui-ci/sdc-ui-tests/chef-solo/environments/README.md
+++ /dev/null
@@ -1,5 +0,0 @@
-Requires Chef 0.10.0+.
-
-This directory is for Ruby DSL and JSON files for environments. For more information see the Chef wiki page:
-
-http://docs.chef.io/environments.html
diff --git a/ui-ci/sdc-ui-tests/chef-solo/roles/README.md b/ui-ci/sdc-ui-tests/chef-solo/roles/README.md
deleted file mode 100644
index b0ee0b4d21..0000000000
--- a/ui-ci/sdc-ui-tests/chef-solo/roles/README.md
+++ /dev/null
@@ -1,16 +0,0 @@
-Create roles here, in either the Role Ruby DSL (.rb) or JSON (.json) files. To install roles on the server, use knife.
-
-For example, create `roles/base_example.rb`:
-
- name "base_example"
- description "Example base role applied to all nodes."
- # List of recipes and roles to apply. Requires Chef 0.8, earlier versions use 'recipes()'.
- #run_list()
- # Attributes applied if the node doesn't have it set already.
- #default_attributes()
- # Attributes applied no matter what the node has set already.
- #override_attributes()
-
-Then upload it to the Chef Server:
-
- knife role from file roles/base_example.rb
diff --git a/ui-ci/sdc-ui-tests/chef-solo/roles/sanityUiTests.json b/ui-ci/sdc-ui-tests/chef-solo/roles/sanityUiTests.json
deleted file mode 100644
index a03e87793b..0000000000
--- a/ui-ci/sdc-ui-tests/chef-solo/roles/sanityUiTests.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "name": "sanityUiTests",
- "description": "Execute sanity tests",
- "json_class": "Chef::Role",
- "default_attributes": {
-
- },
- "override_attributes": {
-
- },
- "chef_type": "role",
- "run_list": [
- "recipe[sdc-ui-tests::sanityUiTests_1_setup_env]",
- "recipe[sdc-ui-tests::sanityUiTests_2_setup_configuration]",
- "recipe[sdc-ui-tests::sanityUiTests_3_sanity_execution]"
- ],
- "env_run_lists": {
- }
-}
-
diff --git a/ui-ci/sdc-ui-tests/chef-solo/solo.json b/ui-ci/sdc-ui-tests/chef-solo/solo.json
deleted file mode 100644
index 26a669a913..0000000000
--- a/ui-ci/sdc-ui-tests/chef-solo/solo.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "run_list": [
- "role[sanityUiTests]"
- ]
-}
-
diff --git a/ui-ci/sdc-ui-tests/chef-solo/solo.rb b/ui-ci/sdc-ui-tests/chef-solo/solo.rb
deleted file mode 100644
index 06c1af4592..0000000000
--- a/ui-ci/sdc-ui-tests/chef-solo/solo.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-root = File.absolute_path(File.dirname(__FILE__))
-file_cache_path root
-cookbook_path root + '/cookbooks'
-json_attribs root + '/solo.json'
-checksum_path root + '/checksums'
-data_bag_path root + '/data_bags'
-environment_path root + '/environments'
-file_backup_path root + '/backup'
-file_cache_path root + '/cache'
-log_level :info
-log_location STDOUT
-rest_timeout 300
-role_path root + '/roles'
-syntax_check_cache_path
-umask 0022
-verbose_logging nil
diff --git a/ui-ci/sdc-ui-tests/startup.sh b/ui-ci/sdc-ui-tests/startup.sh
deleted file mode 100644
index 6455c17e58..0000000000
--- a/ui-ci/sdc-ui-tests/startup.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/bash
-
-/dockerstartup/vnc_startup.sh &
-
-# prepare env for HTTPS if used
-
-is_https=$(cat /root/chef-solo/environments/${ENVNAME}.json | \
- jq -cr '.default_attributes.disableHttp' | \
- tr '[:upper:]' '[:lower:]')
-
-if [ "$is_https" = true ] ; then
- # setup /etc/hosts
- SDC_FE_IP=$(cat /root/chef-solo/environments/${ENVNAME}.json | \
- jq -cr '.default_attributes.Nodes.FE')
- SDC_FE_HOSTNAME=$(cat /root/chef-solo/environments/${ENVNAME}.json | \
- jq -cr '.override_attributes.FE.domain_name')
- if ! grep -q "^[[:space:]]*${SDC_FE_IP}[[:space:]]" ; then
- echo "${SDC_FE_IP}" "${SDC_FE_HOSTNAME}" >> /etc/hosts
- fi
-fi
-
-# run tests
-
-cd /root/chef-solo
-chef-solo -c solo.rb -E ${ENVNAME}
-
-rc=$?
-
-if [[ $rc != 0 ]]; then
- echo "Startup failed !!!"
- exit $rc
-else
-# Note that the output below is monitored in CSIT by
-# sdc/sdc-os-chef/scripts/docker_run.sh
-# If this text is changed, docker_run.sh check for sdc-ui-tests docker
-# startup must be adjusted accordingly!
- echo "Startup completed successfully"
-fi
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/AddComponentInstancesArtifactsInCsar.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/AddComponentInstancesArtifactsInCsar.java
deleted file mode 100644
index f71efa2ee3..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/AddComponentInstancesArtifactsInCsar.java
+++ /dev/null
@@ -1,341 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.US;
-
-import org.apache.commons.lang3.tuple.ImmutablePair;
-import org.apache.http.HttpStatus;
-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.Resource;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.HeatMetaFirstLevelDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.VendorLicenseModel;
-import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.execute.devCI.ArtifactFromCsar;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.HomePage;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.pages.ToscaArtifactsPage;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.OnboardingUiUtils;
-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.VendorLicenseModelRestUtils;
-import org.openecomp.sdc.ci.tests.utils.general.VendorSoftwareProductRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.testng.Assert;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
-
-public class AddComponentInstancesArtifactsInCsar extends SetupCDTest {
-
- public static final String DEPLOYMENT = "Deployment";
- public static final String INFORMATIONAL = "Informational";
- private String filePath;
-
- @BeforeClass
- public void beforeClass() {
- filePath = System.getProperty("filePath");
- if (filePath == null && System.getProperty("os.name").contains("Windows")) {
- filePath = FileHandling.getResourcesFilesPath() + "AddComponentInstancesArtifactsInCsar" + File.separator;
- } else if (filePath.isEmpty() && !System.getProperty("os.name").contains("Windows")) {
- filePath = FileHandling.getBasePath() + File.separator + "Files" + File.separator + "AddComponentInstancesArtifactsInCsar" + File.separator;
- }
- }
-
- // US847439 - Story [BE] - Add Component Instance's artifacts in CSAR
- // TC1521795 - VF CSAR - The Flow
- @Test
- public void vfAndServiceCsarTheFlow() throws Exception {
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
-
- String vnfFile = "FDNT.zip";
- String snmpFile = "Fault-alarms-ASDC-vprobes-vLB.zip";
-
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();//getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject createVSP = VendorSoftwareProductRestUtils.createVSP(resourceReqDetails, vnfFile, filePath, getUser(),
- vendorLicenseModel);
- String vspName = createVSP.getName();
- resourceMetaData.setName(vspName);
- VendorSoftwareProductRestUtils.addVFCArtifacts(filePath, snmpFile, null, createVSP, getUser());
- VendorSoftwareProductRestUtils.prepareVspForUse(getUser(), createVSP, true);
-
- HomePage.showVspRepository();
- OnboardingUiUtils.importVSP(createVSP);
- resourceMetaData.setVersion("0.1");
- Resource vfResource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resourceMetaData.getName(), resourceMetaData.getVersion());
-
- Map<String, Object> artifacts = getArtifactsOfComponentAndComponentsInstance(vfResource);
-
- List<ImmutablePair<ComponentInstance, ArtifactDefinition>> artifactsUploadedToComponentInstance = new LinkedList<>();
- Random random = new Random();
- final int randomIntForLoop = random.nextInt(10) + 10;
- for (int i = 0; i < randomIntForLoop; i++) {
- ImmutablePair<ComponentInstance, ArtifactDefinition> uploadArtifactOnRandomVfc = uploadArtifactOnRandomRI(vfResource);
-
- if (uploadArtifactOnRandomVfc.getRight().getArtifactName() != null) {
- artifactsUploadedToComponentInstance.add(uploadArtifactOnRandomVfc);
- }
- }
-
- if (!artifactsUploadedToComponentInstance.isEmpty()) {
- Map<String, Object> artifactsOfResourceInstance = getArtifactsOfResourceInstance(artifactsUploadedToComponentInstance);
- artifacts.put("Resources", artifactsOfResourceInstance);
- }
-
- ResourceGeneralPage.getLeftMenu().moveToToscaArtifactsScreen();
- ToscaArtifactsPage.downloadCsar();
- File latestFilefromDir = FileHandling.getLastModifiedFileNameFromDir();
- Map<String, Object> combineHeatArtifacstWithFolderArtifacsToMap = ArtifactFromCsar.getVFCArtifacts(latestFilefromDir.getAbsolutePath());
-
- compareArtifactFromFileStructureToArtifactsFromJavaObject(artifacts, combineHeatArtifacstWithFolderArtifacsToMap);
-
- }
-
- public void compareArtifactFromFileStructureToArtifactsFromJavaObject(Map<String, Object> artifactFromJavaObject, Map<String, Object> artifactsFromFileStructure) {
- for (String key : artifactFromJavaObject.keySet()) {
- if ((!key.equals(DEPLOYMENT)) && (!key.equals(INFORMATIONAL))) {
- Map<String, Object> newArtifactFromJavaObject = (Map<String, Object>) artifactFromJavaObject.get(key);
- Map<String, Object> newArtifactsFromFileStructure = (Map<String, Object>) artifactsFromFileStructure.get(key);
- compareArtifactFromFileStructureToArtifactsFromJavaObject(newArtifactFromJavaObject, newArtifactsFromFileStructure);
- } else {
- compareArtifacts(artifactFromJavaObject.get(key), artifactsFromFileStructure.get(key));
- }
- }
- }
-
-
- private void compareArtifacts(Object artifactFromJavaObject, Object artifactsFromFileStructure) {
- Map<String, List<String>> artifactsMap = (Map<String, List<String>>) artifactFromJavaObject;
- List<HeatMetaFirstLevelDefinition> artifactsList = (List<HeatMetaFirstLevelDefinition>) artifactsFromFileStructure;
-
- for (HeatMetaFirstLevelDefinition heatMetaFirstLevelDefinition : artifactsList) {
- Assert.assertTrue(artifactsMap.get(heatMetaFirstLevelDefinition.getType()).contains(heatMetaFirstLevelDefinition.getFileName()),
- "Expected that artifacts will be the same. Not exists: " + heatMetaFirstLevelDefinition.getFileName() + " of type: " + heatMetaFirstLevelDefinition.getType());
- }
-
- for (String key : artifactsMap.keySet()) {
- List<String> artifacts = artifactsMap.get(key);
-
- for (HeatMetaFirstLevelDefinition heatMetaFirstLevelDefinition : artifactsList) {
- if (heatMetaFirstLevelDefinition.getType().equals(key)) {
- if (artifacts.contains(heatMetaFirstLevelDefinition.getFileName())) {
- artifacts.remove(heatMetaFirstLevelDefinition.getFileName());
- }
- }
- }
-
- Assert.assertEquals(artifacts.size(), 0, "Expected that all artifacts equal. There is artifacts which not equal: " + artifacts.toString());
- }
- }
-
-
- public Map<String, Object> getArtifactsOfResourceInstance(List<ImmutablePair<ComponentInstance, ArtifactDefinition>> riList) {
- Map<String, Object> artifacts = new HashMap<>();
-
- for (ImmutablePair<ComponentInstance, ArtifactDefinition> ri : riList) {
- ArtifactDefinition artifactDefinition = ri.getRight();
- ComponentInstance componentInstance = ri.getLeft();
- if (artifacts.containsKey(componentInstance.getNormalizedName())) {
- if (((Map<String, ArrayList<String>>) ((Map<String, Object>) artifacts.get(componentInstance.getNormalizedName())).get(DEPLOYMENT)).containsKey(artifactDefinition.getArtifactType())) {
-
- ((Map<String, ArrayList<String>>) ((Map<String, Object>) artifacts.get(componentInstance.getNormalizedName())).get(DEPLOYMENT)).get(artifactDefinition.getArtifactType()).add(artifactDefinition.getArtifactName());
-
- } else {
- ArrayList<String> list = new ArrayList<>();
- list.add(artifactDefinition.getArtifactName());
- ((Map<String, ArrayList<String>>) ((Map<String, Object>) artifacts.get(componentInstance.getNormalizedName())).get(DEPLOYMENT)).put(artifactDefinition.getArtifactType(), list);
- }
-
- } else {
- try {
-
-
- ArrayList<String> list = new ArrayList<>();
- list.add(artifactDefinition.getArtifactName());
-
- Map<String, ArrayList<String>> map = new HashMap<>();
- map.put(artifactDefinition.getArtifactType(), list);
-
- Map<String, Map<String, ArrayList<String>>> addMap = new HashMap<>();
- addMap.put(DEPLOYMENT, map);
-
- artifacts.put(componentInstance.getNormalizedName(), addMap);
- } catch (Exception e) {
- Assert.fail("Artifact name is null for componentInstance: " + componentInstance.getNormalizedName());
- }
- }
- }
- return artifacts;
- }
-
- public Map<String, Object> getArtifactsOfComponentAndComponentsInstance(Component component) {
- Map<String, Object> artifacts = getArtifactsOfComponent(component);
-
- for (ComponentInstance componentInstance : component.getComponentInstances()) {
- Map<String, Object> artifactsOfComponentInstance = getArtifactsOfComponentInstance(componentInstance);
- if (!artifactsOfComponentInstance.isEmpty()) {
- artifacts.put(componentInstance.getToscaComponentName() + "." + componentInstance.getComponentVersion(), artifactsOfComponentInstance);
- }
- }
-
- return artifacts;
- }
-
- public Map<String, Object> getArtifactsOfComponentInstance(ComponentInstance componentInstance) {
- Map<String, Object> map = new HashMap<>();
-
- if (componentInstance.getArtifacts() != null) {
- Map<String, Object> informationalArtifacts = getArtifacts(componentInstance.getArtifacts());
- if (!informationalArtifacts.isEmpty()) {
- map.put(INFORMATIONAL, informationalArtifacts);
- }
- }
-
- if (componentInstance.getDeploymentArtifacts() != null) {
- Map<String, Object> deploymentArtifacts = getArtifacts(componentInstance.getDeploymentArtifacts());
- if (!deploymentArtifacts.isEmpty()) {
- map.put(DEPLOYMENT, deploymentArtifacts);
- }
- }
-
- return map;
- }
-
- public Map<String, Object> getArtifactsOfComponent(Component component) {
- Map<String, Object> map = new HashMap<>();
-
- if (component.getArtifacts() != null) {
- Map<String, Object> informationalArtifacts = getArtifacts(component.getArtifacts());
- if (!informationalArtifacts.isEmpty()) {
- map.put(INFORMATIONAL, informationalArtifacts);
- }
- }
-
- if (component.getDeploymentArtifacts() != null) {
- Map<String, Object> deploymentArtifacts = getArtifacts(component.getDeploymentArtifacts());
- if (!deploymentArtifacts.isEmpty()) {
- map.put(DEPLOYMENT, deploymentArtifacts);
- }
- }
-
- return map;
- }
-
- public Map<String, Object> getArtifacts(Map<String, ArtifactDefinition> artifacts) {
- Map<String, Object> map = new HashMap<>();
-
- for (String artifact : artifacts.keySet()) {
- ArtifactDefinition artifactDefinition = artifacts.get(artifact);
- if ((artifactDefinition.getEsId() != null) && (!artifactDefinition.getEsId().equals("")) && (!artifactDefinition.getArtifactType().equals("HEAT_ENV"))) {
- if (map.containsKey(artifactDefinition.getArtifactType())) {
- ((List<String>) map.get(artifactDefinition.getArtifactType())).add(artifactDefinition.getArtifactName());
- } else {
- ArrayList<String> list = new ArrayList<>();
- list.add(artifactDefinition.getArtifactName());
- map.put(artifactDefinition.getArtifactType(), list);
- }
- }
- }
-
- return map;
- }
-
- public ImmutablePair<ComponentInstance, ArtifactDefinition> uploadArtifactOnRandomRI(Component component) throws Exception {
- ArtifactReqDetails artifactReqDetails = getRandomArtifact();
- Random random = new Random();
- int randInt = random.nextInt(component.getComponentInstances().size());
- User defaultUser = ElementFactory.getDefaultUser(getRole());
- ComponentInstance componentInstance = component.getComponentInstances().get(randInt);
-
- RestResponse uploadArtifactRestResponse = ArtifactRestUtils.externalAPIUploadArtifactOfComponentInstanceOnAsset(component, defaultUser, artifactReqDetails, componentInstance);
-
- // Check response of external API
- Integer responseCode = uploadArtifactRestResponse.getErrorCode();
- Assert.assertEquals(responseCode, (Integer) HttpStatus.SC_OK, "Response code is not correct.");
-
- ImmutablePair<ComponentInstance, ArtifactDefinition> pair = ImmutablePair.of(componentInstance, ResponseParser.convertArtifactDefinitionResponseToJavaObject(uploadArtifactRestResponse.getResponse()));
-
- return pair;
- }
-
- public ImmutablePair<ComponentInstance, ArtifactDefinition> uploadArtifactOnRandomRI(Resource resource) throws Exception {
- ArtifactReqDetails artifactReqDetails = getRandomVfcArtifact();
- Random random = new Random();
- int randInt = random.nextInt(resource.getComponentInstances().size());
- User defaultUser = ElementFactory.getDefaultUser(getRole());
- ComponentInstance componentInstance = resource.getComponentInstances().get(randInt);
-
- RestResponse uploadArtifactRestResponse = ArtifactRestUtils.externalAPIUploadArtifactOfComponentInstanceOnAsset(resource, defaultUser, artifactReqDetails, componentInstance);
- // Check response of external API
- Integer responseCode = uploadArtifactRestResponse.getErrorCode();
- Assert.assertEquals(responseCode, (Integer) HttpStatus.SC_OK, "Response code is not correct.");
- ImmutablePair<ComponentInstance, ArtifactDefinition> pair = ImmutablePair.of(componentInstance, ResponseParser.convertArtifactDefinitionResponseToJavaObject(uploadArtifactRestResponse.getResponse()));
- return pair;
- }
-
- public ArtifactReqDetails getRandomArtifact() throws Exception {
- List<String> artifactsTypeList = Arrays.asList("Other");
- return getRandomArtifact(artifactsTypeList);
- }
-
- public ArtifactReqDetails getRandomVfcArtifact() throws Exception {
- List<String> vfcArtifactsTypeList = Arrays.asList(
- ArtifactTypeEnum.DCAE_INVENTORY_TOSCA.getType(),
- ArtifactTypeEnum.DCAE_INVENTORY_JSON.getType(),
- ArtifactTypeEnum.DCAE_INVENTORY_POLICY.getType(),
- ArtifactTypeEnum.DCAE_INVENTORY_DOC.getType(),
- ArtifactTypeEnum.DCAE_INVENTORY_BLUEPRINT.getType(),
- ArtifactTypeEnum.DCAE_INVENTORY_EVENT.getType(),
- ArtifactTypeEnum.SNMP_POLL.getType(),
- ArtifactTypeEnum.SNMP_TRAP.getType());
- return getRandomArtifact(vfcArtifactsTypeList);
- }
-
- public ArtifactReqDetails getRandomArtifact(List<String> artifactType) throws Exception {
- Random random = new Random();
- return ElementFactory.getArtifactByType("ci", artifactType.get(random.nextInt(artifactType.size())), true, false);
- }
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/ImportUpdateInformationalDeploymentArtifacts.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/ImportUpdateInformationalDeploymentArtifacts.java
deleted file mode 100644
index 42dd59b05b..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/ImportUpdateInformationalDeploymentArtifacts.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.US;
-
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.ArtifactDefinition;
-import org.openecomp.sdc.be.model.ComponentInstance;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.common.api.ArtifactTypeEnum;
-import org.testng.annotations.Test;
-
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import static org.testng.AssertJUnit.assertTrue;
-
-public class ImportUpdateInformationalDeploymentArtifacts extends SetupCDTest {
-
- private String folder = "US747946";
-
- // US747946 - Import artifacts to component instances
- // TC1407822 - Import VFC Artifacts - Deployment Artifacts - Multiple Artifacts, Multiple Types
- @Test
- public void importVfvArtifactsDeploymentArtifactsMultipleArtifactsMultipleTypes() throws Exception {
-
- String filePath = FileHandling.getFilePath(folder);
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
-
- String fileName = "TC1407822.csar";
-
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName, getUser());
-
- Resource resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resourceMetaData.getName(), "0.1");
-
- List<String> snmpPollArtifactList = Stream
- .of("base_cgi_frwl.mib", "base_vIECCF_volume.yml", "node_userdata_script.sh", "vendor-license-model.xml")
- .collect(Collectors.toList());
- List<String> snmpTrapArtifactList = Stream
- .of("module_1_ixlt.mib", "module_1_ixlt.yaml")
- .collect(Collectors.toList());
-
-
- List<ArtifactDefinition> filteredArtifactNames =
- //Stream of component Instances
- resource.getComponentInstances().stream()
- //filter out all nulls
- .filter(e -> e.getDeploymentArtifacts() != null)
- //Stream of all the artifacts on all the component instances
- .flatMap(e -> e.getDeploymentArtifacts().values().stream())
- //filter relevant artifact types
- .filter(e -> e.getArtifactType().equals(ArtifactTypeEnum.SNMP_TRAP.getType()) || e.getArtifactType().equals(ArtifactTypeEnum.SNMP_POLL.getType()))
- //collect to list
- .collect(Collectors.toList());
-
- assertTrue("Not contain all SNMP TRAP artifacts.", filteredArtifactNames.stream()
- .filter(e -> e.getArtifactType().equals(ArtifactTypeEnum.SNMP_TRAP.getType()))
- .map(e -> e.getArtifactName())
- .collect(Collectors.toList())
- .containsAll(snmpTrapArtifactList));
-
- assertTrue("Not contain all SNMP POLL artifacts.", filteredArtifactNames.stream()
- .filter(e -> e.getArtifactType().equals(ArtifactTypeEnum.SNMP_POLL.getType()))
- .map(e -> e.getArtifactName())
- .collect(Collectors.toList())
- .containsAll(snmpPollArtifactList));
-
- filteredArtifactNames.stream()
- .map(e -> e.getArtifactDisplayName())
- .collect(Collectors.toList())
- .forEach(e -> {
- assertTrue("Wrong artifact appear on deployment artifact UI page.",
- !GeneralUIUtils.isWebElementExistByTestId(DataTestIdEnum.ArtifactPageEnum.UUID.getValue() + e));
- });
-
- }
-
- // TODO: Note there is performance issue with this CSAR
- // US747946 - Import artifacts to component instances
- // TC1407998 - Import VFC Artifacts - Deployment & Informational Artifacts - Multiple VFCs
- @Test
- public void importVfcArtifactsDeploymentAndInformationalArtifactsMultipleVfcs() throws Exception {
-
- String filePath = FileHandling.getFilePath(folder);
- String fileName = "TC1407998.csar";
-
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
-
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName, getUser());
- Resource resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resourceMetaData.getName(), "0.1");
-
- resource.getComponentInstances().forEach(e -> {
-
- if (e.getToscaComponentName().endsWith("heat.cm")) {
- Map<String, List<String>> deployArtifactsMap = new HashMap<String, List<String>>() {
- {
- put(ArtifactTypeEnum.SNMP_POLL.getType(), Arrays.asList("PS_DEPL_Poll1.mib", "PS_DEPL_Poll2.xml", "PS_DEPL_Poll3.yaml"));
- put(ArtifactTypeEnum.SNMP_TRAP.getType(), Arrays.asList("PS_DEPL_Trap1.mib", "PS_DEPL_Trap2.xml", "PS_DEPL_Trap3.sh", "PS_DEPL_Trap4.yml"));
- }
- };
- validateDeploymentArtifactOnComponetInstance(e, deployArtifactsMap, "heat.cm");
-
- } else if (e.getToscaComponentName().endsWith("heat.sm")) {
- Map<String, List<String>> deployArtifactsMap = new HashMap<String, List<String>>() {
- {
- put(ArtifactTypeEnum.SNMP_POLL.getType(), Arrays.asList("SM_DEPL_Poll1.mib", "SM_DEPL_Poll2.mib", "SM_DEPL_Poll3.xml"));
- put(ArtifactTypeEnum.SNMP_TRAP.getType(), Arrays.asList("SM_DEPL_Trap1.mib", "SM_DEPL_Trap2.xml"));
- }
- };
- validateDeploymentArtifactOnComponetInstance(e, deployArtifactsMap, "heat.sm");
- }
- });
-
- }
-
- // US747946 - Import artifacts to component instances
- // TC1410352 - Import VFC Artifacts - Deployment Artifacts - Extra folder Under VFC-Identification
- @Test
- public void importVfcArtifactsDeploymentArtifactsExtraFolderUnderVfcIdentification() throws Exception {
-
- String filePath = FileHandling.getFilePath(folder);
- String fileName = "TC1410352.csar";
-
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
-
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName, getUser());
- Resource resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resourceMetaData.getName(), "0.1");
-
- resource.getComponentInstances().forEach(e -> {
-
- if (e.getToscaComponentName().endsWith("heat.ltm")) {
- Map<String, List<String>> deployArtifactsMap = new HashMap<String, List<String>>() {
- {
- put(ArtifactTypeEnum.SNMP_POLL.getType(), Arrays.asList("Poll1.mib", "Poll2.xml", "Poll3.sh", "Poll4.yml"));
- put(ArtifactTypeEnum.SNMP_TRAP.getType(), Arrays.asList("Trap1.mib", "Trap2.yaml"));
- }
- };
- validateDeploymentArtifactOnComponetInstance(e, deployArtifactsMap, "heat.ltm");
- }
- });
- }
-
-
- // US747946 - Import artifacts to component instances
- // TC1410352 - Import VFC Artifacts - Deployment Artifacts - Invalid Artifact Type
- @Test
- public void importVfcArtifactsDeploymentArtifactsInvalidArtifactType() throws Exception {
-
- String filePath = FileHandling.getFilePath(folder);
- String fileName = "TC1425032.csar";
-
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
-
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName, getUser());
- Resource resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resourceMetaData.getName(), "0.1");
-
- resource.getComponentInstances().forEach(e -> {
-
- if (e.getToscaComponentName().endsWith("heat.ltm")) {
- Map<String, List<String>> deployArtifactsMap = new HashMap<String, List<String>>() {
- {
- put(ArtifactTypeEnum.SNMP_POLL.getType(), Arrays.asList("DeploySNMPPoll1.mib", "DeploySNMPPoll2.yml", "DeploySNMPPoll3.sh", "DeploySNMPPoll4.xml"));
- put(ArtifactTypeEnum.OTHER.getType(), Arrays.asList("DeploySNMPTrapB1.mib", "DeploySNMPTrapB2.yaml"));
- }
- };
- validateDeploymentArtifactOnComponetInstance(e, deployArtifactsMap, "heat.ltm");
- }
- });
- }
-
- private void validateDeploymentArtifactOnComponetInstance(ComponentInstance instance, Map<String, List<String>> artifactsMap, String endswith) {
- if (instance.getToscaComponentName().endsWith(endswith)) {
- Set<String> types = artifactsMap.keySet();
-
- Map<String, List<ArtifactDefinition>> collect = instance.getDeploymentArtifacts().values().stream()
- .filter(a -> types.contains(a.getArtifactType()))
- .collect(Collectors.groupingBy(e -> e.getArtifactType()));
-
- types.forEach(m -> {
- if (collect.containsKey(m)) {
- List<String> found = collect.get(m).stream().map(e -> e.getArtifactName()).collect(Collectors.toList());
- boolean isValid = found.containsAll(artifactsMap.get(m)) && artifactsMap.get(m).containsAll(found);
- assertTrue("Not contain all artifact of type: " + m, isValid);
- } else {
- assertTrue("Contains deployment artifact which not in provided list", false);
- }
- });
- }
- }
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Inputs.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Inputs.java
deleted file mode 100644
index aa927326b8..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Inputs.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.US;
-
-import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.CompositionPage;
-import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.InputsPage;
-import org.openecomp.sdc.ci.tests.pages.PropertyPopup;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ServiceUIUtils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebElement;
-import org.testng.Assert;
-import org.testng.TestException;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class Inputs extends SetupCDTest {
-
- private static final String DESCRIPTION = "kuku";
- private static final String ARTIFACT_LABEL = "artifact3";
- private static final String ARTIFACT_LABEL_UPDATE = "artifactUpdate";
- private static final String GET_ARTIFACT_LIST_BY_CLASS_NAME = "i-sdc-designer-sidebar-section-content-item-artifact";
- private static final String HEAT_FILE_YAML_NAME = "Heat-File.yaml";
- private static final String HEAT_FILE_YAML_UPDATE_NAME = "Heat-File-Update.yaml";
- private String filePath;
-
- @BeforeMethod
- public void beforeTest() {
- filePath = FileHandling.getFilePath("");
- }
-
- // TODO: There is defect that imported VFC checkin not appear in service until refresh
- // TODO: add support for CP (there is no normative CP's with complex properties which can be selected - import one) - importVFCWithComplexProperty.yml
- // TC1508249
- // Delete Input declared from VLi/CPi in service level - Deleting an Input that was declared from Complex property.
- @Test
- public void deletingAnInputThatWasDeclaredFromComplexProperty() throws Exception {
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
-
- DeploymentArtifactPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
- Map<String, List<String>> resourceInstanceToProperty = new HashMap<>();
- CompositionPage.searchForElement("ExtVL");
- CanvasElement computeElement = canvasManager.createElementOnCanvas("ExtVL");
- canvasManager.clickOnCanvaElement(computeElement);
- resourceInstanceToProperty.put(CompositionPage.getSelectedInstanceName(), Arrays.asList("network_homing", "instance_node_target"));
-
- GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
- DeploymentArtifactPage.getLeftMenu().moveToInputsScreen();
-
-
- for (String element : resourceInstanceToProperty.keySet()) {
- String propertyName = resourceInstanceToProperty.get(element).get(0);
- String innerPropertyName = resourceInstanceToProperty.get(element).get(1);
- String dataTestIdPropertyCheckbox = DataTestIdEnum.InputsScreenService.RESOURCE_INSTANCE_PROPERTY_CHECKBOX.getValue() + propertyName;
-
- GeneralUIUtils.clickOnElementByText(element);
- GeneralUIUtils.ultimateWait();
-
- InputsPage.clickOnProperty(propertyName);
-
- PropertyPopup propertyPopup = new PropertyPopup();
- propertyPopup.selectPropertyRadioButton(innerPropertyName);
- propertyPopup.clickSave();
-
- InputsPage.clickOnAddInputButton();
-
- // Verify that input checkbox selected
- verifyPropertyCheckBoxSelected(dataTestIdPropertyCheckbox);
-
- InputsPage.deleteServiceInput(element, propertyName + "_" + innerPropertyName);
-
- // Trying to find deleted service input
- try {
- InputsPage.getServiceInput(element, propertyName + "_" + innerPropertyName);
- assert false;
- } catch (TestException e) {
- System.out.println("Verfied that service input deleted");
- }
-
- // Verify that input checkbox not selected
- verifyPropertyCheckBoxNotSelected(dataTestIdPropertyCheckbox);
-
- GeneralUIUtils.clickOnElementByText(element);
- GeneralUIUtils.ultimateWait();
- }
-
- }
-
-
- // TC1508248
- // Delete inputs who come from CP/VL properties
- @Test
- public void deleteInputsWhoComeFromCpVlProperties() throws Exception {
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
-
- DeploymentArtifactPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
- Map<String, String> resourceInstanceToProperty = new HashMap<>();
- CompositionPage.searchForElement("ExtVL");
- CanvasElement computeElement = canvasManager.createElementOnCanvas("ExtVL");
- canvasManager.clickOnCanvaElement(computeElement);
- resourceInstanceToProperty.put(CompositionPage.getSelectedInstanceName(), "network_role");
-
- CompositionPage.searchForElement("ExtCP");
- computeElement = canvasManager.createElementOnCanvas("ExtCP");
- canvasManager.clickOnCanvaElement(computeElement);
- resourceInstanceToProperty.put(CompositionPage.getSelectedInstanceName(), "order");
-
- GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
- DeploymentArtifactPage.getLeftMenu().moveToInputsScreen();
-
-
- for (String element : resourceInstanceToProperty.keySet()) {
- GeneralUIUtils.clickOnElementByText(element);
- GeneralUIUtils.ultimateWait();
-
- WebElement webElementByTestID = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.InputsScreenService.RESOURCE_INSTANCE_PROPERTY_CHECKBOX.getValue() + resourceInstanceToProperty.get(element));
- InputsPage.clickOnVFInputCheckbox(webElementByTestID);
-
- InputsPage.clickOnAddInputButton();
-
- // Verify that input checkbox selected
- verifyPropertyCheckBoxSelected(DataTestIdEnum.InputsScreenService.RESOURCE_INSTANCE_PROPERTY_CHECKBOX.getValue() + resourceInstanceToProperty.get(element));
-
- InputsPage.deleteServiceInput(element, resourceInstanceToProperty.get(element));
-
- // Trying to find deleted service input
- try {
- InputsPage.getServiceInput(element, resourceInstanceToProperty.get(element));
- assert false;
- } catch (TestException e) {
- System.out.println("Verfied that service input deleted");
- }
-
- // Verify that input checkbox not selected
- verifyPropertyCheckBoxNotSelected(DataTestIdEnum.InputsScreenService.RESOURCE_INSTANCE_PROPERTY_CHECKBOX.getValue() + resourceInstanceToProperty.get(element));
-
- GeneralUIUtils.clickOnElementByText(element);
- GeneralUIUtils.ultimateWait();
- }
-
- }
-
-
- public String verifyPropertyCheckBox(String dataTestId) {
- WebElement webElementByTestID = GeneralUIUtils.getWebElementByTestID(dataTestId);
- webElementByTestID = webElementByTestID.findElement(By.className("tlv-checkbox-i"));
- if (webElementByTestID.getAttribute("checked") == null) {
- return "false";
- }
- return "true";
- }
-
- public void verifyPropertyCheckBoxSelected(String dataTestId) {
- if (!verifyPropertyCheckBox(dataTestId).equals("true")) {
- Assert.assertEquals(true, false, "Expected that checkbox will be selected.");
- }
- }
-
- public void verifyPropertyCheckBoxNotSelected(String dataTestId) {
- if (!verifyPropertyCheckBox(dataTestId).equals("false")) {
- Assert.assertEquals(false, true, "Expected that checkbox will not be selected.");
- }
- }
-
- public String getNormalizedName(String notNormalizedName) {
- String normalizedName = notNormalizedName.toLowerCase();
- normalizedName = normalizedName.replaceAll(" ", "");
-
- return normalizedName;
- }
-
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/LocalGeneralUtilities.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/LocalGeneralUtilities.java
deleted file mode 100644
index 01cd57a133..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/LocalGeneralUtilities.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.US;
-
-import org.json.JSONArray;
-import org.json.simple.JSONObject;
-import org.json.simple.JSONValue;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.VendorLicenseModel;
-import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.pages.HomePage;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.OnboardingUiUtils;
-import org.openecomp.sdc.ci.tests.utils.general.VendorLicenseModelRestUtils;
-import org.openecomp.sdc.ci.tests.utils.general.VendorSoftwareProductRestUtils;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-public class LocalGeneralUtilities {
-
- public LocalGeneralUtilities() {
- }
-
- public static final String FILE_PATH = FileHandling.getBasePath() + "\\src\\main\\resources\\Files\\VNFs\\";
- public static final String Env_FILE_PATH = FileHandling.getBasePath() + "\\src\\main\\resources\\Files\\Env_files\\";
- public static String downloadPath = "C:\\Users\\th0695\\Downloads";
-
- public static String getValueFromJsonResponse(String response, String fieldName) {
- try {
- JSONObject jsonResp = (JSONObject) JSONValue.parse(response);
- Object fieldValue = jsonResp.get(fieldName);
- return fieldValue.toString();
-
- } catch (Exception e) {
- return null;
- }
-
- }
-
- public static List<String> getValuesFromJsonArray(RestResponse message) throws Exception {
- List<String> artifactTypesArrayFromApi = new ArrayList<String>();
-
- org.json.JSONObject responseObject = new org.json.JSONObject(message.getResponse());
- JSONArray jArr = responseObject.getJSONArray("componentInstances");
-
- for (int i = 0; i < jArr.length(); i++) {
- org.json.JSONObject jObj = jArr.getJSONObject(i);
- String value = jObj.get("uniqueId").toString();
-
- artifactTypesArrayFromApi.add(value);
- }
- return artifactTypesArrayFromApi;
- }
-
- public static String simpleOnBoarding(ResourceReqDetails resourceReqDetails, String fileName, String filePath, User user) throws Exception {
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(user);
- VendorSoftwareProductObject createVendorSoftwareProduct = VendorSoftwareProductRestUtils.createVendorSoftwareProduct(resourceReqDetails, fileName, filePath, user,
- vendorLicenseModel);
- String vspName = createVendorSoftwareProduct.getName();
- HomePage.showVspRepository();
- OnboardingUiUtils.importVSP(createVendorSoftwareProduct);
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.CHECKIN_BUTTON.getValue()).click();
- GeneralUIUtils.waitForLoader();
- return vspName;
- }
-
- //check if file downloaded successfully.
- public static boolean isFileDownloaded(String downloadPath, String fileName) {
- File dir = new File(downloadPath);
- File[] dir_contents = dir.listFiles();
- for (File dir_content : dir_contents) {
- if (dir_content.getName().equals(fileName)) {
- return true;
- }
- }
- return false;
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/MIBsArtifactsOnResourceInstance.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/MIBsArtifactsOnResourceInstance.java
deleted file mode 100644
index 59c18fe311..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/MIBsArtifactsOnResourceInstance.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.US;
-
-import org.apache.commons.io.FileUtils;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactInfo;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.CompositionPage;
-import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.pages.UploadArtifactPopup;
-import org.openecomp.sdc.ci.tests.utilities.ArtifactUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ServiceUIUtils;
-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.ArtifactRestUtils;
-import org.testng.Assert;
-import org.testng.annotations.DataProvider;
-import org.testng.annotations.Test;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import static org.testng.AssertJUnit.assertTrue;
-
-
-public class MIBsArtifactsOnResourceInstance extends SetupCDTest {
-
- private String folder = "";
-
- @DataProvider(name = "mibsArtifactCRUDUi")
- public static Object[][] dataProviderMibsArtifactCRUDUi() {
- return new Object[][]{
- {"mibsvFW_VFC.yml", ResourceTypeEnum.VFC},
- {"mibsVL.yml", ResourceTypeEnum.VL},
- {"mibsCP.yml", ResourceTypeEnum.CP}
- };
- }
-
- // US820414
- // Artifact UI CRUD on VFC/VL/CP
- // TODO: Change download validation from download artifact via external API to UI
- @Test(dataProvider = "mibsArtifactCRUDUi")
- public void mibsArtifactCRUDUi(String fileName, ResourceTypeEnum resourceTypeEnum) throws Exception {
- setLog(fileName);
- String filePath = FileHandling.getFilePath(folder);
-
- // import Resource
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(resourceTypeEnum, getUser());
- ResourceUIUtils.importVfc(resourceMetaData, filePath, fileName, getUser());
-
- // get resourceUUID from BE
- String resourceUUID = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resourceMetaData.getName(), "0.1").getUUID();
-
- // 2. Upload MIBs artifacts - SNMP_TRAP & SNMP_POLL.
- ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
-
- List<ArtifactInfo> deploymentArtifactList = new ArrayList<>();
- deploymentArtifactList.add(new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", "SNMP_TRAP"));
- deploymentArtifactList.add(new ArtifactInfo(filePath, "sample-xml-alldata-1-1.xml", "cuku", "artifact2", "SNMP_POLL"));
- for (ArtifactInfo deploymentArtifact : deploymentArtifactList) {
- DeploymentArtifactPage.clickAddNewArtifact();
- ArtifactUIUtils.fillAndAddNewArtifactParameters(deploymentArtifact, new UploadArtifactPopup(true));
-
- assertTrue("Only created artifact need to be exist", DeploymentArtifactPage.checkElementsCountInTable(1));
-
- String artifactUUID = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.UUID.getValue() + deploymentArtifact.getArtifactLabel()).getText();
- ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(deploymentArtifact.getArtifactLabel(), null, "1", deploymentArtifact.getArtifactType(), true, true, true, false);
-
- // Verify that uploaded correct file by download artifact via external api
- RestResponse restResponse = ArtifactRestUtils.getResourceDeploymentArtifactExternalAPI(resourceUUID, artifactUUID, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), ComponentTypeEnum.RESOURCE.toString());
- File file = new File(deploymentArtifact.getFilepath() + deploymentArtifact.getFilename());
-
- String readFileToString = FileUtils.readFileToString(file);
- Assert.assertEquals(restResponse.getResponse(), readFileToString);
-
- DeploymentArtifactPage.clickEditArtifact(deploymentArtifact.getArtifactLabel());
- UploadArtifactPopup artifactPopup = new UploadArtifactPopup(true);
- artifactPopup.loadFile(filePath, "CP.yml");
- artifactPopup.clickDoneButton();
-
- assertTrue("Only updated artifact need to be exist", DeploymentArtifactPage.checkElementsCountInTable(1));
- Assert.assertNotEquals(GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.UUID.getValue() + deploymentArtifact.getArtifactLabel()).getText(), artifactUUID);
- ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(deploymentArtifact.getArtifactLabel(), null, "2", deploymentArtifact.getArtifactType(), true, true, true, false);
-
- // Verify that updated correct file by download artifact via external api
- artifactUUID = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.UUID.getValue() + deploymentArtifact.getArtifactLabel()).getText();
- restResponse = ArtifactRestUtils.getResourceDeploymentArtifactExternalAPI(resourceUUID, artifactUUID, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER), ComponentTypeEnum.RESOURCE.toString());
- file = new File(deploymentArtifact.getFilepath() + "CP.yml");
- readFileToString = FileUtils.readFileToString(file);
- Assert.assertEquals(restResponse.getResponse(), readFileToString);
-
- DeploymentArtifactPage.clickDeleteArtifact(deploymentArtifact.getArtifactLabel());
- DeploymentArtifactPage.clickOK();
-
- assertTrue("No artifact need to be exist", DeploymentArtifactPage.checkElementsCountInTable(0));
- }
-
- }
-
- @DataProvider(name = "mibsArtifacsOnResourceInstanceShouldOnlyHaveDownloadOption")
- public static Object[][] dataProviderMibsArtifacsOnResourceInstanceShouldOnlyHaveDownloadOption() {
- return new Object[][]{
-// {"mibs1vFW_VFC.yml", ResourceTypeEnum.VFC},
- // TODO: delete comment below when we will have support for VL on canvas
-// {"mibs1VL.yml", ResourceTypeEnum.VL},
- {"mibs1CP.yml", ResourceTypeEnum.CP}
- };
- }
-
- // US820414
- // Import VFC/VL/CP, upload MIBs artifacts then drag it on VF & verify that deployment artifact have only download option
- @Test(dataProvider = "mibsArtifacsOnResourceInstanceShouldOnlyHaveDownloadOption")
- public void mibsArtifacsOnResourceInstanceShouldOnlyHaveDownloadOption(String fileName, ResourceTypeEnum resourceTypeEnum) throws Exception {
-
-// if(resourceTypeEnum.equals(ResourceTypeEnum.CP)){
-// throw new SkipException("Open bug 322930");
-// }
-
- setLog(fileName);
-
- String filePath = FileHandling.getFilePath(folder);
-
- // import Resource
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(resourceTypeEnum, getUser());
- ResourceUIUtils.importVfc(resourceMetaData, filePath, fileName, getUser());
-
- // 2. Upload MIBs artifacts - SNMP_TRAP & SNMP_POLL.
- ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
-
- List<ArtifactInfo> deploymentArtifactList = new ArrayList<ArtifactInfo>();
- deploymentArtifactList.add(new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", "SNMP_TRAP"));
- deploymentArtifactList.add(new ArtifactInfo(filePath, "sample-xml-alldata-1-1.xml", "cuku", "artifact2", "SNMP_POLL"));
- for (ArtifactInfo deploymentArtifact : deploymentArtifactList) {
- DeploymentArtifactPage.clickAddNewArtifact();
- ArtifactUIUtils.fillAndAddNewArtifactParameters(deploymentArtifact, new UploadArtifactPopup(true));
- }
- assertTrue("artifact table does not contain artifacts uploaded", DeploymentArtifactPage.checkElementsCountInTable(deploymentArtifactList.size()));
-
- // 3. Check-in DataProvider resource.
- ResourceGeneralPage.clickCheckinButton(resourceMetaData.getName());
-
- // 4. Create VF.
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(vfMetaData, getUser());
-
- // 5. Click on composition.
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
-
- // 6. Drag created DataProvider resource to canvas.
- CanvasManager vfCanvasManager = CanvasManager.getCanvasManager();
- CompositionPage.searchForElement(resourceMetaData.getName());
- CanvasElement resourceInstance = vfCanvasManager.createElementOnCanvas(resourceMetaData.getName());
-
- // 7. Click on DataProvider resource.
- vfCanvasManager.clickOnCanvaElement(resourceInstance);
-
- // 8. Click on deployment artifacts in right menu.
- CompositionPage.showDeploymentArtifactTab();
-
- // 9. Verify that each uploaded MIBs artifacts shows in deployment artifacts.
- // 10. Verify that only have download option.
- for (ArtifactInfo deploymentArtifact : deploymentArtifactList) {
- // Hover over webelement -> check that only dowload button displayed
- GeneralUIUtils.hoverOnAreaByTestId(DataTestIdEnum.DeploymentArtifactCompositionRightMenu.ARTIFACT_DISPLAY_NAME.getValue() + deploymentArtifact.getArtifactLabel());
- Assert.assertEquals(GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.DeploymentArtifactCompositionRightMenu.DOWNLOAD.getValue() + deploymentArtifact.getArtifactLabel()).isDisplayed(), true);
- Assert.assertEquals(GeneralUIUtils.isWebElementExistByTestId(DataTestIdEnum.DeploymentArtifactCompositionRightMenu.DELETE.getValue() + deploymentArtifact.getArtifactLabel()), false);
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.DeploymentArtifactCompositionRightMenu.ARTIFACT_DISPLAY_NAME.getValue() + deploymentArtifact.getArtifactLabel());
- Assert.assertEquals(GeneralUIUtils.isWebElementExistByTestId(DataTestIdEnum.ArtifactPopup.MODAL_WINDOW.getValue()), false);
- }
-
-
- }
-
- // US820414
- // Create VF, upload MIBs artifacts then drag it on service & verify that deployment artifact have only download option
- @Test
- public void mibsArtifacsOnVFInstanceShouldOnlyHaveDownloadOption() throws Exception {
- String filePath = FileHandling.getFilePath(folder);
-
- // 1. Create VF.
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(resourceMetaData, getUser());
-
- // 2. Upload MIBs artifacts - SNMP_TRAP & SNMP_POLL.
- ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
-
- List<ArtifactInfo> deploymentArtifactList = new ArrayList<ArtifactInfo>();
- deploymentArtifactList.add(new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", "SNMP_TRAP"));
- deploymentArtifactList.add(new ArtifactInfo(filePath, "sample-xml-alldata-1-1.xml", "cuku", "artifact2", "SNMP_POLL"));
- for (ArtifactInfo deploymentArtifact : deploymentArtifactList) {
- DeploymentArtifactPage.clickAddNewArtifact();
- ArtifactUIUtils.fillAndAddNewArtifactParameters(deploymentArtifact, new UploadArtifactPopup(true));
- }
- assertTrue("artifact table does not contain artifacts uploaded", DeploymentArtifactPage.checkElementsCountInTable(deploymentArtifactList.size()));
-
- // 3. Check-in VF.
- ResourceGeneralPage.clickCheckinButton(resourceMetaData.getName());
-
- // 4. Create service.
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
-
- // 5. Click on composition.
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
-
- // 6. Drag created DataProvider s to canvas.
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
- CompositionPage.searchForElement(resourceMetaData.getName());
- CanvasElement resourceInstance = canvasManager.createElementOnCanvas(resourceMetaData.getName());
-
- // 7. Click on DataProvider resource.
- canvasManager.clickOnCanvaElement(resourceInstance);
-
- // 8. Click on deployment artifacts in right menu.
- CompositionPage.showDeploymentArtifactTab();
-
- // 9. Verify that each uploaded MIBs artifacts shows in deployment artifacts.
- // 10. Verify that only have download option.
- for (ArtifactInfo deploymentArtifact : deploymentArtifactList) {
- // Hover over webelement -> check that only dowload button displayed
- GeneralUIUtils.hoverOnAreaByTestId(DataTestIdEnum.DeploymentArtifactCompositionRightMenu.ARTIFACT_DISPLAY_NAME.getValue() + deploymentArtifact.getArtifactLabel());
- Assert.assertEquals(GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.DeploymentArtifactCompositionRightMenu.DOWNLOAD.getValue() + deploymentArtifact.getArtifactLabel()).isDisplayed(), true);
- Assert.assertEquals(GeneralUIUtils.isWebElementExistByTestId(DataTestIdEnum.DeploymentArtifactCompositionRightMenu.DELETE.getValue() + deploymentArtifact.getArtifactLabel()), false);
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.DeploymentArtifactCompositionRightMenu.ARTIFACT_DISPLAY_NAME.getValue() + deploymentArtifact.getArtifactLabel());
- Assert.assertEquals(GeneralUIUtils.isWebElementExistByTestId(DataTestIdEnum.ArtifactPopup.MODAL_WINDOW.getValue()), false);
- }
- }
-
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/MobProxy.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/MobProxy.java
deleted file mode 100644
index a335ad6514..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/MobProxy.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.US;
-
-import com.github.markusbernhardt.proxy.ProxySearch;
-import com.github.markusbernhardt.proxy.ProxySearch.Strategy;
-import net.lightbody.bmp.BrowserMobProxyServer;
-import net.lightbody.bmp.client.ClientUtil;
-import net.lightbody.bmp.core.har.Har;
-import net.lightbody.bmp.proxy.CaptureType;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.firefox.FirefoxDriver;
-import org.openqa.selenium.remote.CapabilityType;
-import org.openqa.selenium.remote.DesiredCapabilities;
-import org.testng.AssertJUnit;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.net.Proxy;
-import java.net.ProxySelector;
-import java.net.SocketAddress;
-import java.net.URI;
-import java.util.List;
-
-public class MobProxy {
- private static final int THREAD_SLEEP_TIME = 2000;
- public static WebDriver driver;
- public static BrowserMobProxyServer server;
-
- @BeforeClass
- public void setup() throws Exception {
-
- ProxySearch proxySearch = new ProxySearch();
- proxySearch.addStrategy(Strategy.OS_DEFAULT);
- proxySearch.addStrategy(Strategy.JAVA);
- proxySearch.addStrategy(Strategy.BROWSER);
- ProxySelector proxySelector = proxySearch.getProxySelector();
-
- ProxySelector.setDefault(proxySelector);
- URI home = URI.create("http://www.google.com");
- System.out.println("ProxySelector: " + proxySelector);
- System.out.println("URI: " + home);
- List<Proxy> proxyList = proxySelector.select(home);
- String host = null;
- String port = null;
- if (proxyList != null && !proxyList.isEmpty()) {
- for (Proxy proxy : proxyList) {
- System.out.println(proxy);
- SocketAddress address = proxy.address();
- if (address instanceof InetSocketAddress) {
- host = ((InetSocketAddress) address).getHostName();
- port = Integer.toString(((InetSocketAddress) address).getPort());
- System.setProperty("http.proxyHost", host);
- System.setProperty("http.proxyPort", port);
- }
- }
- }
-
- server = new BrowserMobProxyServer();
- InetSocketAddress address = new InetSocketAddress(host, Integer.parseInt(port));
- server.setChainedProxy(address);
- server.start();
- int port1 = server.getPort();
- DesiredCapabilities seleniumCapabilities = new DesiredCapabilities();
- seleniumCapabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
- seleniumCapabilities.setCapability(CapabilityType.PROXY, ClientUtil.createSeleniumProxy(server));
- driver = new FirefoxDriver(seleniumCapabilities);
- server.enableHarCaptureTypes(CaptureType.REQUEST_CONTENT, CaptureType.RESPONSE_CONTENT);
- System.out.println("Port started:" + port1);
- }
-
- @Test
- public void first_test1() throws InterruptedException {
- final int shortSleepTime = 300;
-
- server.newHar("asdc.har");
-
- driver.get("https://www.e-access.att.com/QA-SCRUM1/sdc1/portal#/dashboard");
- driver.manage().window().maximize();
-
- WebElement userNameTextbox = driver.findElement(By.name("userid"));
- userNameTextbox.sendKeys("m99121");
- WebElement passwordTextbox = driver.findElement(By.name("password"));
- passwordTextbox.sendKeys("66-Percent");
-
- WebElement submitButton = driver.findElement(By.name("btnSubmit"));
- submitButton.click();
- Thread.sleep(shortSleepTime);
- WebElement buttonOK = driver.findElement(By.name("successOK"));
- AssertJUnit.assertTrue(buttonOK.isDisplayed());
- buttonOK.click();
- Thread.sleep(THREAD_SLEEP_TIME);
- driver.findElement(By.xpath(getXpath("main-menu-button-catalog"))).click();
- Thread.sleep(THREAD_SLEEP_TIME);
- driver.findElement(By.xpath(getXpath("checkbox-service"))).click();
- Thread.sleep(THREAD_SLEEP_TIME);
- }
-
- public static String getXpath(String dataTestId) {
- return String.format("//*[@data-tests-id='%s']", dataTestId);
- }
-
- @AfterClass
- public void shutdown() {
- try {
-
- // Get the HAR data
- Har har = server.getHar();
- File harFile = new File("C:\\temp\\asdc.har");
- har.writeTo(harFile);
-
- } catch (IOException ioe) {
- ioe.printStackTrace();
- }
- driver.quit();
- server.stop();
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/NewArtifactTypeGuide.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/NewArtifactTypeGuide.java
deleted file mode 100644
index 59a82b52ff..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/NewArtifactTypeGuide.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.US;
-
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactInfo;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.InformationalArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.pages.UploadArtifactPopup;
-import org.openecomp.sdc.ci.tests.utilities.ArtifactUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-import static org.testng.AssertJUnit.assertTrue;
-
-
-public class NewArtifactTypeGuide extends SetupCDTest {
-
- private String folder = "";
-
- // US820276
- // Upload information artifact of type GUIDE to VF
- @Test
- public void crudGuideInformationArtifactForVf() throws Exception {
- String filePath = FileHandling.getFilePath(folder);
-
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(resourceMetaData, getUser());
-
- ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen();
-
- ArtifactInfo informationArtifact = new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", "GUIDE");
-
- InformationalArtifactPage.clickAddNewArtifact();
- ArtifactUIUtils.fillAndAddNewArtifactParameters(informationArtifact);
-
- assertTrue("Only created artifact need to be exist", DeploymentArtifactPage.checkElementsCountInTable(1));
-
- String artifactUUID = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.UUID.getValue() + informationArtifact.getArtifactLabel()).getText();
- ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(informationArtifact.getArtifactLabel(), null, "1", informationArtifact.getArtifactType(), true, true, true, false);
-
- InformationalArtifactPage.clickEditArtifact(informationArtifact.getArtifactLabel());
- UploadArtifactPopup artifactPopup = new UploadArtifactPopup();
- artifactPopup.loadFile(filePath, "CP.yml");
- artifactPopup.clickDoneButton();
-
- assertTrue("Only updated artifact need to be exist", DeploymentArtifactPage.checkElementsCountInTable(1));
- Assert.assertNotEquals(GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.UUID.getValue() + informationArtifact.getArtifactLabel()).getText(), artifactUUID);
- ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(informationArtifact.getArtifactLabel(), null, "2", informationArtifact.getArtifactType(), true, true, true, false);
-
- InformationalArtifactPage.clickDeleteArtifact(informationArtifact.getArtifactLabel());
- InformationalArtifactPage.clickOK();
- }
-
- // US820276
- // Upload information artifact of type GUIDE to VFC
- @Test
- public void crudGuideInformationArtifactForVfc() throws Exception {
- String filePath = FileHandling.getFilePath(folder);
-
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VFC, getUser());
- ResourceUIUtils.importVfc(resourceMetaData, filePath, "guidevFW_VFC.yml", getUser());
-
- ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen();
-
- ArtifactInfo informationArtifact = new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", "GUIDE");
-
- InformationalArtifactPage.clickAddNewArtifact();
- ArtifactUIUtils.fillAndAddNewArtifactParameters(informationArtifact);
-
- assertTrue("Only created artifact need to be exist", DeploymentArtifactPage.checkElementsCountInTable(1));
- String artifactUUID = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.UUID.getValue() + informationArtifact.getArtifactLabel()).getText();
- ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(informationArtifact.getArtifactLabel(), null, "1", informationArtifact.getArtifactType(), true, true, true, false);
-
- InformationalArtifactPage.clickEditArtifact(informationArtifact.getArtifactLabel());
- UploadArtifactPopup artifactPopup = new UploadArtifactPopup();
- artifactPopup.loadFile(filePath, "CP.yml");
- artifactPopup.clickDoneButton();
-
- assertTrue("Only updated artifact need to be exist", DeploymentArtifactPage.checkElementsCountInTable(1));
- Assert.assertNotEquals(GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.UUID.getValue() + informationArtifact.getArtifactLabel()).getText(), artifactUUID);
- ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(informationArtifact.getArtifactLabel(), null, "2", informationArtifact.getArtifactType(), true, true, true, false);
-
- InformationalArtifactPage.clickDeleteArtifact(informationArtifact.getArtifactLabel());
- InformationalArtifactPage.clickOK();
- }
-
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/RemoveRestrictionOfDeploymentArtifacts.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/RemoveRestrictionOfDeploymentArtifacts.java
deleted file mode 100644
index 1bde1c1767..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/RemoveRestrictionOfDeploymentArtifacts.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.US;
-
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactInfo;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.LeftPanelCanvasItems;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.InformationalArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.pages.UploadArtifactPopup;
-import org.openecomp.sdc.ci.tests.utilities.ArtifactUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ServiceUIUtils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.testng.annotations.Test;
-
-import java.util.ArrayList;
-import java.util.List;
-
-
-public class RemoveRestrictionOfDeploymentArtifacts extends SetupCDTest {
-
- private String folder = "";
-
- // US833330 - Story [BE] - remove restriction of deployment artifacts
- // Create service without resource instance and without deployment artifacts and verify it can submit for testing
- @Test
- public void createServiceWithoutRIAndArtifacts() throws Exception {
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
- //TODO Andrey should click on certify button
- ResourceGeneralPage.clickSubmitForTestingButton(serviceMetadata.getName());
- }
-
-
- // US833330 - Story [BE] - remove restriction of deployment artifacts
- // Create service with VL resource instance and without deployment artifacts and verify it can submit for testing
- @Test
- public void createServiceWithVlAndWithoutArtfiacts() throws Exception {
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
-
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
- canvasManager.createElementOnCanvas(LeftPanelCanvasItems.NETWORK);
- canvasManager.createElementOnCanvas(LeftPanelCanvasItems.NETWORK);
- canvasManager.createElementOnCanvas(LeftPanelCanvasItems.NETWORK);
-
- ResourceGeneralPage.clickSubmitForTestingButton(serviceMetadata.getName());
- }
-
- // US833330 - Story [BE] - remove restriction of deployment artifacts
- // Create service with VF with informational artifacts and verify it can submit for testing
- @Test
- public void createServiceWithInformationalArtifacts() throws Exception {
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(resourceMetaData, getUser());
-
- ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen();
-
- String filePath = FileHandling.getFilePath(folder);
- List<ArtifactInfo> informationalArtifactList = new ArrayList<ArtifactInfo>();
- informationalArtifactList.add(new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", "OTHER"));
- informationalArtifactList.add(new ArtifactInfo(filePath, "sample-xml-alldata-1-1.xml", "cuku", "artifact2", "GUIDE"));
- for (ArtifactInfo informationalArtifact : informationalArtifactList) {
- InformationalArtifactPage.clickAddNewArtifact();
- ArtifactUIUtils.fillAndAddNewArtifactParameters(informationalArtifact, new UploadArtifactPopup(true));
- }
- //TODO Andrey should click on certify button
- ResourceGeneralPage.clickCertifyButton(resourceMetaData.getName());
-
- /*reloginWithNewRole(UserRoleEnum.TESTER);
- GeneralUIUtils.findComponentAndClick(resourceMetaData.getName());
- TesterOperationPage.certifyComponent(resourceMetaData.getName());
- reloginWithNewRole(UserRoleEnum.DESIGNER);*/
-
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
- CanvasElement resourceInstance = canvasManager.createElementOnCanvas(resourceMetaData.getName());
-
- ResourceGeneralPage.clickSubmitForTestingButton(serviceMetadata.getName());
- }
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Service_Tests_UI.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Service_Tests_UI.java
deleted file mode 100644
index b8430c433a..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Service_Tests_UI.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.US;
-
-import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.StepsEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.CompositionPage;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.OnboardingUiUtils;
-import org.openecomp.sdc.ci.tests.utilities.ServiceUIUtils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
-import org.testng.annotations.Test;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class Service_Tests_UI extends SetupCDTest {
-
- public Service_Tests_UI() {
- }
-
- // US839610 - E2E Declare VL / CP properties as inputs in service level
- @Test
- public void declareVL_CP_InputsInServiceLevel() throws Exception {
- String vnfFile = "FDNT.zip";
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject vendorSoftwareProductObject = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, FileHandling.getVnfRepositoryPath(), vnfFile, getUser());
- ServiceReqDetails servicemetadata = ElementFactory.getDefaultService(getUser());
- ServiceUIUtils.createService(servicemetadata);
- GeneralUIUtils.moveToStep(StepsEnum.COMPOSITION);
- CanvasManager service_CanvasManager = CanvasManager.getCanvasManager();
- CompositionPage.searchForElement(vendorSoftwareProductObject.getName());
- GeneralUIUtils.waitForLoader();
- CanvasElement vfi_Element = service_CanvasManager.createElementOnCanvas(vendorSoftwareProductObject.getName());
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue())
- .click();
- GeneralUIUtils.findComponentAndClick(servicemetadata.getName());
- GeneralUIUtils.moveToStep(StepsEnum.INPUTS);
- GeneralUIUtils.getWebElementByTestID("inputs-vf-instance-1").click();
-// GeneralUIUtils.onNameClicked(input);
- }
-
- @Test
- public void CreateServiceWithCpInstance() throws Exception {
- String vnfFile = "FDNT.zip";
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject vendorSoftwareProductObject = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, FileHandling.getVnfRepositoryPath(), vnfFile, getUser());
- ServiceReqDetails servicemetadata = ElementFactory.getDefaultService(getUser());
- ServiceUIUtils.createService(servicemetadata);
- GeneralUIUtils.moveToStep(StepsEnum.COMPOSITION);
- CanvasManager service_CanvasManager = CanvasManager.getCanvasManager();
- CompositionPage.searchForElement(vendorSoftwareProductObject.getName());
- GeneralUIUtils.waitForLoader();
- CanvasElement vfi_Element = service_CanvasManager.createElementOnCanvas(vendorSoftwareProductObject.getName());
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue())
- .click();
- GeneralUIUtils.findComponentAndClick(servicemetadata.getName());
- GeneralUIUtils.moveToStep(StepsEnum.DEPLOYMENT_VIEW);
- String version = GeneralUIUtils.getWebElementByTestID("versionHeader").getText();
- RestResponse service = ServiceRestUtils.getServiceByNameAndVersion(getUser(), servicemetadata.getName(),
- version.substring(1));
- List<String> serviceResponseArray = new ArrayList<>();
- serviceResponseArray = LocalGeneralUtilities.getValuesFromJsonArray(service);
- servicemetadata.setUniqueId(serviceResponseArray.get(0));
- RestResponse serviceResponse = ServiceRestUtils.getService(servicemetadata, getUser());
- if (serviceResponseArray.get(0).contains("VL")) {
- System.out.println("OK");
- }
-
- }
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Testing.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Testing.java
deleted file mode 100644
index 9949d63686..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Testing.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.US;
-
-import org.openecomp.sdc.be.model.DataTypeDefinition;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaDefinition;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaTopologyTemplateDefinition;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utils.ToscaParserUtils;
-import org.testng.Assert;
-
-import java.io.File;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-
-public class Testing {
-
-// public static void main(String[] args) throws Exception {
-// // TODO Auto-generated method stub
-//
-// File path = new File("C:\\Users\\rp955r\\Desktop\\US\\US831517\\TCExport\\TC1459238.yml");
-// ToscaDefinition toscaDefinition = ToscaParserUtils.parseToscaYamlToJavaObject(path);
-//
-// Map<String, Object> vl_us831517_1 = new HashMap<String, Object>();
-// vl_us831517_1.put("property_1", true);
-// vl_us831517_1.put("property_2", "init_value_2");
-// vl_us831517_1.put("property_3", "init_value_3");
-//
-//
-// Map<String, Object> vl_us831517_2 = new HashMap<String, Object>();
-// vl_us831517_2.put("property_1", false);
-// vl_us831517_2.put("property_2", "init_value_2");
-// vl_us831517_2.put("property_3", "new_value_3");
-//
-// Map<String, Object> vl_us831517_3 = new HashMap<String, Object>();
-// vl_us831517_3.put("property_1", true);
-// vl_us831517_3.put("property_2", "init_value_2");
-// vl_us831517_3.put("property_3", "init_value_3");
-// vl_us831517_3.put("property_4", false);
-// vl_us831517_3.put("property_5", "init_value_5");
-//
-// Map<String, Map<String, Object>> predefinedProperties = new HashMap<String, Map<String, Object>>();
-// predefinedProperties.put("VL_US831517_1", vl_us831517_1);
-// predefinedProperties.put("VL_US831517_2", vl_us831517_2);
-// predefinedProperties.put("VL_US831517_3", vl_us831517_3);
-//
-// validateNodeTemplatesProperties(predefinedProperties, toscaDefinition);
-//
-//
-//
-// }
-
-
- private static void validateNodeTemplatesProperties(Map<String, Map<String, Object>> predefinedMap, ToscaDefinition toscaDefinition) {
-
- for (String key : predefinedMap.keySet()) {
- Map<String, Object> nodeTemplateProperties = getNodeTemplatePropertiesByNodeTemplateType(key, toscaDefinition);
-
- predefinedMap.get(key).forEach((i, j) -> {
- Assert.assertEquals(nodeTemplateProperties.get(i), j, "Expected that the properties will be equal");
- });
- }
-
- }
-
- // Get properties by type
- private static Map<String, Object> getNodeTemplatePropertiesByNodeTemplateType(String nodeTemplateType, ToscaDefinition toscaDefinition) {
- Map<String, Object> propertiesMap = null;
-
- Set<String> nodeTemplates = getNodeTemplates(toscaDefinition);
-
- for (String nodeTemplate : nodeTemplates) {
- String currentNodeTemplateType = getNodeTemplateType(toscaDefinition, nodeTemplate);
- currentNodeTemplateType = currentNodeTemplateType.substring(currentNodeTemplateType.lastIndexOf(".") + 1);
- if (currentNodeTemplateType.equals(nodeTemplateType)) {
- propertiesMap = getNodeTemplateProperties(toscaDefinition, nodeTemplate);
- break;
- }
- }
-
- return propertiesMap;
- }
-
- // Get node templates
- private static Set<String> getNodeTemplates(ToscaDefinition toscaDefinition) {
- Set<String> resourceInstanceArray = toscaDefinition.getTopology_template().getNode_templates().keySet();
- return resourceInstanceArray;
- }
-
- // Get type of node template
- private static String getNodeTemplateType(ToscaDefinition toscaDefinition, String nodeTemplate) {
- return toscaDefinition.getTopology_template().getNode_templates().get(nodeTemplate).getType();
- }
-
- // Get properties of node template
- private static Map<String, Object> getNodeTemplateProperties(ToscaDefinition toscaDefinition, String nodeTemplate) {
- Map<String, Object> propertiesMap = toscaDefinition.getTopology_template().getNode_templates().get(nodeTemplate).getProperties();
- return propertiesMap;
- }
-
-
- public static void main(String[] args) throws Exception {
- ToscaDefinition toscaMainAmdocsDefinition, toscaMainVfDefinition, toscaMainServiceDefinition;
- File filesFolder = new File("C:/Users/al714h/Downloads/Design/");
- File importToscaFilesFolder = new File("C:/Git_work/sdc/catalog-be/src/main/resources/import/tosca/");
-
- File dataTypesLocation = new File(importToscaFilesFolder.getPath() + "/data-types/dataTypes.yml");
-
- File genericVfFileLocation = new File(importToscaFilesFolder.getPath() + "/heat-types/Generic_VF/Generic_VF.yml");
- File genericVfcFileLocation = new File(importToscaFilesFolder.getPath() + "/heat-types/Generic_VFC/Generic_VFC.yml");
- File genericPnfFileLocation = new File(importToscaFilesFolder.getPath() + "/heat-types/Generic_PNF/Generic_PNF.yml");
- File genericServiceFileLocation = new File(importToscaFilesFolder.getPath() + "/heat-types/Generic_Service/Generic_Service.yml");
-
- File amdocsCsarFileName = new File("/77e6b842669f441db20a83489da3f4be.csar");
- File VfCsarFileName = new File("/resource-Civfonboarded2016012VmxAv301072E2e1424cb9d-csar.csar");
- File serviceCsarFileName = new File("/service-Ciservicefeba0521131d-csar.csar");
-
- Map<String, DataTypeDefinition> parseDataTypesYaml = FileHandling.parseDataTypesYaml(dataTypesLocation.getAbsoluteFile().toString());
- System.out.println("start " + new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(new Date()));
-
- toscaMainAmdocsDefinition = ToscaParserUtils.parseToscaMainYamlToJavaObjectByCsarLocation(new File(filesFolder.getPath() + amdocsCsarFileName));
- toscaMainVfDefinition = ToscaParserUtils.parseToscaMainYamlToJavaObjectByCsarLocation(new File(filesFolder.getPath() + VfCsarFileName));
- toscaMainServiceDefinition = ToscaParserUtils.parseToscaMainYamlToJavaObjectByCsarLocation(new File(filesFolder.getPath() + serviceCsarFileName));
- ToscaTopologyTemplateDefinition topologyTemplate = toscaMainAmdocsDefinition.getTopology_template();
- ToscaDefinition objectHelper = ToscaParserUtils.parseToscaYamlToJavaObject(genericVfFileLocation);
-
- Map<String, Object> additionalInputs = new HashMap<>();
- Set<String> keySet = objectHelper.getNode_types().keySet();
- if (keySet != null) {
- for (String key : keySet) {
- additionalInputs = objectHelper.getNode_types().get(key).getProperties();
- }
- }
-// topologyTemplate.addInputs(additionalInputs);
-
-
-// toscaDefinition = ToscaParserUtils.parseToscaYamlToJavaObject(path);
- System.out.println("listTypeHeatMetaDefinition start " + new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(new Date()));
-// List<TypeHeatMetaDefinition> listTypeHeatMetaDefinition = CsarParserUtils.getListTypeHeatMetaDefinition(csarPath);
- System.out.println("get service start " + new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(new Date()));
-// System.out.println(listTypeHeatMetaDefinition);
-// for(TypeHeatMetaDefinition typeHeatMetaDefinition : listTypeHeatMetaDefinition){
-// for(GroupHeatMetaDefinition groupHeatMetaDefinition : typeHeatMetaDefinition.getGroupHeatMetaDefinition()){
-// List<HeatMetaFirstLevelDefinition> artifactList = groupHeatMetaDefinition.getArtifactList();
-// boolean isBase = groupHeatMetaDefinition.getPropertyHeatMetaDefinition().getValue();
-// }
-//
-// }
- System.out.println("Finished");
- System.out.println("get service start " + new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(new Date()));
-
-
- }
-
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/VfModule.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/VfModule.java
deleted file mode 100644
index 0a7d814572..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/VfModule.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.US;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.be.model.Service;
-import org.openecomp.sdc.ci.tests.data.providers.OnboardingDataProviders;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.ToscaArtifactsScreenEnum;
-import org.openecomp.sdc.ci.tests.datatypes.HeatMetaFirstLevelDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.TypeHeatMetaDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.VendorLicenseModel;
-import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.execute.devCI.ArtifactFromCsar;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.CompositionPage;
-import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.HomePage;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.pages.ServiceGeneralPage;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaDefinition;
-import org.openecomp.sdc.ci.tests.utilities.ArtifactUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.DownloadManager;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.OnboardingUiUtils;
-import org.openecomp.sdc.ci.tests.utilities.ServiceUIUtils;
-import org.openecomp.sdc.ci.tests.utils.CsarParserUtils;
-import org.openecomp.sdc.ci.tests.utils.ToscaParserUtils;
-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.OnboardingUtils;
-import org.openecomp.sdc.ci.tests.utils.general.VendorLicenseModelRestUtils;
-import org.openecomp.sdc.ci.tests.utils.general.VendorSoftwareProductRestUtils;
-import org.openecomp.sdc.ci.tests.verificator.ServiceVerificator;
-import org.openecomp.sdc.ci.tests.verificator.VfModuleVerificator;
-import org.testng.annotations.Test;
-
-import java.awt.*;
-import java.io.File;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import static org.testng.AssertJUnit.assertNotNull;
-
-/**
- * @author al714h
- */
-
-public class VfModule extends SetupCDTest {
-
-
- @Test
- public void checkVfModulesCountAndStructure() throws Exception, AWTException {
-
-// String filePath = "src\\main\\resources\\Files\\VNFs";
- String filepath = FileHandling.getVnfRepositoryPath();
-// String vnfFile = "LDSA.zip";
-// String vnfFile = "FDNT.zip";
- List<String> fileNamesFromFolder = OnboardingUtils.getVnfNamesFileListExcludeToscaParserFailure();
- List<String> newRandomFileNamesFromFolder = OnboardingDataProviders.getRandomElements(1, fileNamesFromFolder);
- String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
- String vnfFile = newRandomFileNamesFromFolder.get(0);
- getExtendTest().log(Status.INFO, String.format("Going to onboard the VNF %s......", vnfFile));
- System.out.println(String.format("Going to onboard the VNF %s......", vnfFile));
-
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject createVendorSoftwareProduct = VendorSoftwareProductRestUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile, filepath, getUser(),
- vendorLicenseModel);
- String vspName = createVendorSoftwareProduct.getName();
- //
- DownloadManager.downloadCsarByNameFromVSPRepository(vspName, createVendorSoftwareProduct.getVspId());
- File latestFilefromDir = FileHandling.getLastModifiedFileNameFromDir();
- List<TypeHeatMetaDefinition> listTypeHeatMetaDefinition = CsarParserUtils.getListTypeHeatMetaDefinition(latestFilefromDir);
- //
- getExtendTest().log(Status.INFO, String.format("Searching for onboarded %s", vnfFile));
- HomePage.showVspRepository();
- getExtendTest().log(Status.INFO, String.format("Going to import %s......", vnfFile.substring(0, vnfFile.indexOf("."))));
-
- OnboardingUiUtils.importVSP(createVendorSoftwareProduct);
-
- ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
-
- // Verify deployment artifacts
- Map<String, Object> combinedMap = ArtifactFromCsar.combineHeatArtifacstWithFolderArtifacsToMap(latestFilefromDir.getAbsolutePath());
- LinkedList<HeatMetaFirstLevelDefinition> deploymentArtifacts = ((LinkedList<HeatMetaFirstLevelDefinition>) combinedMap.get("Deployment"));
- for (HeatMetaFirstLevelDefinition deploymentArtifact : deploymentArtifacts) {
- if (deploymentArtifact.getType().equals("HEAT_ENV")) {
- continue;
- }
- System.out.println("--------------");
- System.out.println(deploymentArtifact.getFileName());
- System.out.println(deploymentArtifact.getType());
-// System.out.println(deploymentArtifact.getFileName().trim().substring(0, deploymentArtifact.getFileName().lastIndexOf(".")));
- if (deploymentArtifact.getFileName().contains(".")) {
- ArtifactUIUtils.validateArtifactNameVersionType(deploymentArtifact.getFileName().trim().substring(0, deploymentArtifact.getFileName().lastIndexOf(".")), "1", deploymentArtifact.getType());
- } else {
- ArtifactUIUtils.validateArtifactNameVersionType(deploymentArtifact.getFileName().trim(), "1", deploymentArtifact.getType());
- }
-
- }
-
- DeploymentArtifactPage.verifyArtifactsExistInTable(filepath, vnfFile);
-//TODO Andrey should click on certify button
- DeploymentArtifactPage.clickCertifyButton(vspName);
-
- // create service
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
-
- ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CompositionPage.searchForElement(vspName);
- CanvasManager serviceCanvasManager = CanvasManager.getCanvasManager();
- CanvasElement vfElement = serviceCanvasManager.createElementOnCanvas(vspName);
- assertNotNull(vfElement);
- ServiceVerificator.verifyNumOfComponentInstances(serviceMetadata, "0.1", 1, getUser());
-
- GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
- ResourceGeneralPage.getLeftMenu().moveToToscaArtifactsScreen();
- GeneralUIUtils.clickOnElementByTestId(ToscaArtifactsScreenEnum.TOSCA_TEMPLATE.getValue());
- latestFilefromDir = FileHandling.getLastModifiedFileNameFromDir();
-
-// verification
- Service service = AtomicOperationUtils.getServiceObjectByNameAndVersion(UserRoleEnum.DESIGNER, serviceMetadata.getName(), serviceMetadata.getVersion());
- ToscaDefinition toscaDefinition = ToscaParserUtils.parseToscaYamlToJavaObject(latestFilefromDir);
-
-// compare number of vf modules defined in HEAT.meta file vs Service TOSCA yaml
- VfModuleVerificator.compareNumberOfVfModules(listTypeHeatMetaDefinition, toscaDefinition);
- VfModuleVerificator.verifyGroupMetadata(toscaDefinition, service);
-
- getExtendTest().log(Status.INFO, String.format("Onboarding %s test is passed ! ", vnfFile));
-
- }
-
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Vf_Tests_UI.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Vf_Tests_UI.java
deleted file mode 100644
index e878fec9e2..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Vf_Tests_UI.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.US;
-
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-
-public class Vf_Tests_UI extends SetupCDTest {
-
- public Vf_Tests_UI() {
- }
-
- public void uploadHeatEnvVFLevel() throws Exception {
-
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(vfMetaData, getUser());
-
- }
-
- // @Test
-// // Download ENV file from VF level.
-// public void downloadEnvVFLevel() throws AWTException, Exception {
-// String firstEnvArtifact = "base_stsi_dnt_frwl.env";
-// String secondEnvArtifact = "mod_vmsi_dnt_fw_parent.env";
-// String filePath=Config.instance().getWindowsDownloadDirectory();
-// String vnfFile = "FDNT.zip";
-// OnboardingUiUtils.onboardAndValidate(Onboard.getFilePath(), vnfFile, getUser());
-// Map<String,File> mD5OfFilesToValidate = new HashMap<String,File>();
-// mD5OfFilesToValidate.put(firstEnvArtifact,new File(FileHandling.getResourcesEnvFilesPath() + firstEnvArtifact));
-// mD5OfFilesToValidate.put(secondEnvArtifact,new File(FileHandling.getResourcesEnvFilesPath() + secondEnvArtifact));
-// List<File>filesToBeDeleted=new ArrayList<>(mD5OfFilesToValidate.values());
-// FileHandling.deleteLastDowloadedFiles(filesToBeDeleted);
-// ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
-// List<WebElement> allDisplayedArtifcats = DeploymentArtifactPage.getDeploymentArtifactsNamesWorkSpace();
-// for (int i=0;i<allDisplayedArtifcats.size();i++) {
-// if (DeploymentArtifactPage.geteArtifactType(allDisplayedArtifcats.get(i).getText()).equalsIgnoreCase("heat")) {
-// DeploymentArtifactPage.clickDownloadEnvArtifact(allDisplayedArtifcats.get(i));
-// GeneralUIUtils.waitForLoader();
-// File latestFilefromDir = FileHandling.getRequiredFromDir(filePath,allDisplayedArtifcats.get(i).getText()+".env");
-// VfVerificator.verifyFilesChecksum(latestFilefromDir,mD5OfFilesToValidate.get(latestFilefromDir.getName()));
-//
-// }
-// }
-// }
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/extendNode_TemplatePropertiesWithDefaultValues.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/extendNode_TemplatePropertiesWithDefaultValues.java
deleted file mode 100644
index 92ab4a7ba8..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/extendNode_TemplatePropertiesWithDefaultValues.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.US;
-
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.ToscaArtifactsScreenEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.CompositionPage;
-import org.openecomp.sdc.ci.tests.pages.GeneralPageElements;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaDefinition;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.PropertiesUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.RestCDUtils;
-import org.openecomp.sdc.ci.tests.utilities.ServiceUIUtils;
-import org.openecomp.sdc.ci.tests.utils.ToscaParserUtils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.testng.Assert;
-import org.testng.annotations.DataProvider;
-import org.testng.annotations.Test;
-
-import java.io.File;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.Map;
-import java.util.Set;
-
-
-public class extendNode_TemplatePropertiesWithDefaultValues extends SetupCDTest {
-
- @DataProvider(name = "customizeServiceVfUsedVlsCps")
- public static Object[][] dataProviderCustomizeServiceVfUsedVlsCps() {
- return new Object[][]{
-// {"VL_US831517_1.yml", "VL_US831517_2.yml", "VL_US831517_3.yml", ResourceTypeEnum.VL, ComponentTypeEnum.SERVICE},
- {"CP_US831517_1.yml", "CP_US831517_2.yml", "CP_US831517_3.yml", ResourceTypeEnum.CP, ComponentTypeEnum.SERVICE},
- {"VL_US831517_1.yml", "VL_US831517_2.yml", "VL_US831517_3.yml", ResourceTypeEnum.VL, ComponentTypeEnum.RESOURCE},
- {"CP_US831517_1.yml", "CP_US831517_2.yml", "CP_US831517_3.yml", ResourceTypeEnum.CP, ComponentTypeEnum.RESOURCE},
- };
- }
-
- // US831517 - Story [BE] - Extend node_template properties with default values
- @Test(dataProvider = "customizeServiceVfUsedVlsCps")
- public void customizeServiceVfUsedVlsCps(String fileName_vl1, String fileName_vl2, String fileName_vl3, ResourceTypeEnum resourceTypeEnum, ComponentTypeEnum componentTypeEnum) throws Exception {
- setLog("Extend node_template properties with default values");
-
- // import Resource
- LinkedList<String> assetsName = importThreeAsset(fileName_vl1, fileName_vl2, fileName_vl3, resourceTypeEnum);
-
- if (ComponentTypeEnum.SERVICE == componentTypeEnum) {
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
- } else {
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(resourceMetaData, getUser());
- }
-
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
- CanvasElement resourceInstance1 = canvasManager.createElementOnCanvas(assetsName.get(0));
- CanvasElement resourceInstance2 = canvasManager.createElementOnCanvas(assetsName.get(1));
- CanvasElement resourceInstance3 = canvasManager.createElementOnCanvas(assetsName.get(2));
-
- canvasManager.clickOnCanvaElement(resourceInstance1);
- CompositionPage.showPropertiesAndAttributesTab();
- PropertiesUIUtils.changePropertyDefaultValueInComposition("property_1", "false");
-
- canvasManager.clickOnCanvaElement(resourceInstance2);
- CompositionPage.showPropertiesAndAttributesTab();
- PropertiesUIUtils.changePropertyDefaultValueInComposition("property_3", "customize");
-
- canvasManager.clickOnCanvaElement(resourceInstance3);
- CompositionPage.showPropertiesAndAttributesTab();
- PropertiesUIUtils.changePropertyDefaultValueInComposition("property_2", "customize derived");
- PropertiesUIUtils.changePropertyDefaultValueInComposition("property_5", "customize new");
-
- GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
- ResourceGeneralPage.getLeftMenu().moveToToscaArtifactsScreen();
- GeneralUIUtils.clickOnElementByTestId(ToscaArtifactsScreenEnum.TOSCA_TEMPLATE.getValue());
-
- // TODO: Replace it by automatic download to path
- // TODO: After it remove
- File path = new File("C:\\Users\\rp955r\\Desktop\\US\\US831517\\TCExport\\TC1459238.yml");
- ToscaDefinition toscaDefinition = ToscaParserUtils.parseToscaYamlToJavaObject(path);
-
- Map<String, Object> vl_us831517_1 = new HashMap<String, Object>();
- vl_us831517_1.put("property_1", false);
- vl_us831517_1.put("property_2", "init_value_2");
- vl_us831517_1.put("property_3", "init_value_3");
-
-
- Map<String, Object> vl_us831517_2 = new HashMap<String, Object>();
- vl_us831517_2.put("property_1", false);
- vl_us831517_2.put("property_2", "init_value_2");
- vl_us831517_2.put("property_3", "customize");
-
- Map<String, Object> vl_us831517_3 = new HashMap<String, Object>();
- vl_us831517_3.put("property_1", true);
- vl_us831517_3.put("property_2", "customize derived");
- vl_us831517_3.put("property_3", "init_value_3");
- vl_us831517_3.put("property_4", false);
- vl_us831517_3.put("property_5", "customize new");
-
- Map<String, Map<String, Object>> predefinedProperties = new HashMap<String, Map<String, Object>>();
- predefinedProperties.put("VL_US831517_1", vl_us831517_1);
- predefinedProperties.put("VL_US831517_2", vl_us831517_2);
- predefinedProperties.put("VL_US831517_3", vl_us831517_3);
-
- validateNodeTemplatesProperties(predefinedProperties, toscaDefinition);
-
- RestCDUtils.deleteOnDemand();
- }
-
- @DataProvider(name = "serviceVfUsedVlsCps")
- public static Object[][] dataProviderServiceVfUsedVlsCps() {
- return new Object[][]{
- {"VL_US831517_1.yml", "VL_US831517_2.yml", "VL_US831517_3.yml", ResourceTypeEnum.VL, ComponentTypeEnum.SERVICE},
- {"CP_US831517_1.yml", "CP_US831517_2.yml", "CP_US831517_3.yml", ResourceTypeEnum.CP, ComponentTypeEnum.SERVICE},
- {"VL_US831517_1.yml", "VL_US831517_2.yml", "VL_US831517_3.yml", ResourceTypeEnum.VL, ComponentTypeEnum.RESOURCE},
- {"CP_US831517_1.yml", "CP_US831517_2.yml", "CP_US831517_3.yml", ResourceTypeEnum.CP, ComponentTypeEnum.RESOURCE},
- };
- }
-
-
- // US831517 - Story [BE] - Extend node_template properties with default values
- @Test(dataProvider = "serviceVfUsedVlsCps")
- public void serviceVfUsedVlsCps(String fileName_vl1, String fileName_vl2, String fileName_vl3, ResourceTypeEnum resourceTypeEnum, ComponentTypeEnum componentTypeEnum) throws Exception {
- setLog("Extend node_template properties with default values");
-
- // import Resource
- LinkedList<String> assetsName = importThreeAsset(fileName_vl1, fileName_vl2, fileName_vl3, resourceTypeEnum);
-
- if (ComponentTypeEnum.SERVICE == componentTypeEnum) {
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
- } else {
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(resourceMetaData, getUser());
- }
-
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
- canvasManager.createElementOnCanvas(assetsName.get(0));
- canvasManager.createElementOnCanvas(assetsName.get(1));
- canvasManager.createElementOnCanvas(assetsName.get(2));
-
- GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
- ResourceGeneralPage.getLeftMenu().moveToToscaArtifactsScreen();
- GeneralUIUtils.clickOnElementByTestId(ToscaArtifactsScreenEnum.TOSCA_TEMPLATE.getValue());
-
- // TODO: Replace it by automatic download to path
- // TODO: After it remove
- File path = new File("C:\\Users\\rp955r\\Desktop\\US\\US831517\\TCExport\\TC1459238.yml");
- ToscaDefinition toscaDefinition = ToscaParserUtils.parseToscaYamlToJavaObject(path);
-
- Map<String, Object> vl_us831517_1 = new HashMap<String, Object>();
- vl_us831517_1.put("property_1", true);
- vl_us831517_1.put("property_2", "init_value_2");
- vl_us831517_1.put("property_3", "init_value_3");
-
-
- Map<String, Object> vl_us831517_2 = new HashMap<String, Object>();
- vl_us831517_2.put("property_1", false);
- vl_us831517_2.put("property_2", "init_value_2");
- vl_us831517_2.put("property_3", "new_value_3");
-
- Map<String, Object> vl_us831517_3 = new HashMap<String, Object>();
- vl_us831517_3.put("property_1", true);
- vl_us831517_3.put("property_2", "init_value_2");
- vl_us831517_3.put("property_3", "init_value_3");
- vl_us831517_3.put("property_4", false);
- vl_us831517_3.put("property_5", "init_value_5");
-
- Map<String, Map<String, Object>> predefinedProperties = new HashMap<String, Map<String, Object>>();
- predefinedProperties.put("VL_US831517_1", vl_us831517_1);
- predefinedProperties.put("VL_US831517_2", vl_us831517_2);
- predefinedProperties.put("VL_US831517_3", vl_us831517_3);
-
- validateNodeTemplatesProperties(predefinedProperties, toscaDefinition);
-
- RestCDUtils.deleteOnDemand();
- }
-
- private LinkedList<String> importThreeAsset(String fileName_vl1, String fileName_vl2, String fileName_vl3, ResourceTypeEnum resourceTypeEnum) throws Exception {
- LinkedList<String> assetsNames = new LinkedList<String>();
-
- String filePath = System.getProperty("filepath");
- if (filePath == null && System.getProperty("os.name").contains("Windows")) {
- filePath = FileHandling.getResourcesFilesPath() + File.separator + "US831517" + File.separator;
- } else if (filePath.isEmpty() && !System.getProperty("os.name").contains("Windows")) {
- filePath = FileHandling.getBasePath() + File.separator + "Files" + File.separator + "US831517" + File.separator;
- }
-
- // import Resource
- ResourceReqDetails resourceMetaDataVl1 = ElementFactory.getDefaultResourceByType(resourceTypeEnum, getUser());
- assetsNames.add(resourceMetaDataVl1.getName());
- ResourceUIUtils.importVfc(resourceMetaDataVl1, filePath, fileName_vl1, getUser());
- //TODO Andrey should click on certify button
- GeneralPageElements.clickCertifyButton(resourceMetaDataVl1.getName());
- /*reloginWithNewRole(UserRoleEnum.TESTER);
- GeneralUIUtils.findComponentAndClick(resourceMetaDataVl1.getName());
- TesterOperationPage.certifyComponent(resourceMetaDataVl1.getName());
- reloginWithNewRole(UserRoleEnum.DESIGNER);*/
-
- ResourceReqDetails resourceMetaDataVl2 = ElementFactory.getDefaultResourceByType(resourceTypeEnum, getUser());
- assetsNames.add(resourceMetaDataVl2.getName());
- ResourceUIUtils.importVfc(resourceMetaDataVl2, filePath, fileName_vl2, getUser());
- GeneralPageElements.clickCheckinButton(resourceMetaDataVl2.getName());
-
- ResourceReqDetails resourceMetaDataVl3 = ElementFactory.getDefaultResourceByType(resourceTypeEnum, getUser());
- assetsNames.add(resourceMetaDataVl3.getName());
- ResourceUIUtils.importVfc(resourceMetaDataVl3, filePath, fileName_vl3, getUser());
- GeneralPageElements.clickCheckinButton(resourceMetaDataVl2.getName());
-
- return assetsNames;
- }
-
-
- private static void validateNodeTemplatesProperties(Map<String, Map<String, Object>> predefinedMap, ToscaDefinition toscaDefinition) {
-
- for (String key : predefinedMap.keySet()) {
- Map<String, Object> nodeTemplateProperties = getNodeTemplatePropertiesByNodeTemplateType(key, toscaDefinition);
-
- predefinedMap.get(key).forEach((i, j) -> {
- Assert.assertEquals(nodeTemplateProperties.get(i), j, "Expected that the properties will be equal");
- });
- }
-
- }
-
- // Get properties by type
- private static Map<String, Object> getNodeTemplatePropertiesByNodeTemplateType(String nodeTemplateType, ToscaDefinition toscaDefinition) {
- Map<String, Object> propertiesMap = null;
-
- Set<String> nodeTemplates = getNodeTemplates(toscaDefinition);
-
- for (String nodeTemplate : nodeTemplates) {
- String currentNodeTemplateType = getNodeTemplateType(toscaDefinition, nodeTemplate);
- currentNodeTemplateType = currentNodeTemplateType.substring(currentNodeTemplateType.lastIndexOf(".") + 1);
- if (currentNodeTemplateType.equals(nodeTemplateType)) {
- propertiesMap = getNodeTemplateProperties(toscaDefinition, nodeTemplate);
- break;
- }
- }
-
- return propertiesMap;
- }
-
- // Get node templates
- private static Set<String> getNodeTemplates(ToscaDefinition toscaDefinition) {
- Set<String> resourceInstanceArray = toscaDefinition.getTopology_template().getNode_templates().keySet();
- return resourceInstanceArray;
- }
-
- // Get type of node template
- private static String getNodeTemplateType(ToscaDefinition toscaDefinition, String nodeTemplate) {
- return toscaDefinition.getTopology_template().getNode_templates().get(nodeTemplate).getType();
- }
-
- // Get properties of node template
- private static Map<String, Object> getNodeTemplateProperties(ToscaDefinition toscaDefinition, String nodeTemplate) {
- Map<String, Object> propertiesMap = toscaDefinition.getTopology_template().getNode_templates().get(nodeTemplate).getProperties();
- return propertiesMap;
- }
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/businesslogic/ArtifactBusinessLogic.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/businesslogic/ArtifactBusinessLogic.java
deleted file mode 100644
index 9b3611ced5..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/businesslogic/ArtifactBusinessLogic.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.businesslogic;
-
-import com.clearspring.analytics.util.Pair;
-import com.google.gson.Gson;
-import org.openecomp.sdc.be.datatypes.elements.HeatParameterDataDefinition;
-import org.openecomp.sdc.be.model.ArtifactDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.HeatAndHeatEnvNamesPair;
-import org.openecomp.sdc.ci.tests.datatypes.HeatMetaFirstLevelDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.HeatWithParametersDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
-import org.openecomp.sdc.ci.tests.execute.devCI.ArtifactFromCsar;
-import org.openecomp.sdc.ci.tests.pages.HomePage;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import static org.junit.Assert.assertTrue;
-
-public class ArtifactBusinessLogic {
-
- private static final String[] OK_FILE_EXTENSIONS = new String[]{"yaml", "yml", "env"};
- private static final String PARAMETERS = "parameters";
- private static final String DEPLOYMENT = "Deployment";
-
- public static synchronized Map<String, File> createEnvFilesListFromCsar(String vspName, String filePath) throws Exception {
- Map<String, File> generatedEnvFiles;
- File csarFile = HomePage.downloadVspCsarToDefaultDirectory(vspName);
- FileHandling.unzip(csarFile.toString(), filePath);
- List<File> yamlList = getHeatFilesCreatedFromCsar(csarFile, filePath);
- Map<String, HeatAndHeatEnvNamesPair> filesPairMap = getFilesPairMap(yamlList);
- generatedEnvFiles = generateDefaultEnvFiles(filesPairMap, filePath);
- return generatedEnvFiles;
- }
-
- public static synchronized List<File> getHeatFilesCreatedFromCsar(File pathToDirectory, String filePath) throws Exception {
- List<File> fileList = new ArrayList<>();
- String artifactsFilePath = filePath + "Artifacts" + File.separator;
- List<File> fileListFromArtifactsDirectory = FileHandling.getHeatAndHeatEnvArtifactsFromZip(new File(artifactsFilePath), OK_FILE_EXTENSIONS);
- Map<String, Object> combinedMap = ArtifactFromCsar.combineHeatArtifacstWithFolderArtifacsToMap(pathToDirectory.toString());
- LinkedList<HeatMetaFirstLevelDefinition> deploymentArtifacts = (LinkedList<HeatMetaFirstLevelDefinition>) combinedMap.get(DEPLOYMENT);
- for (HeatMetaFirstLevelDefinition deploymentArtifact : deploymentArtifacts) {
- String type = deploymentArtifact.getType();
- if (type.equals(ArtifactTypeEnum.HEAT.getType())
- || type.equals(ArtifactTypeEnum.HEAT_ENV.getType())
- || type.equals(ArtifactTypeEnum.HEAT_VOL.getType())
- || type.equals(ArtifactTypeEnum.HEAT_NET.getType())) {
- File file = new File(artifactsFilePath + deploymentArtifact.getFileName());
- if (fileListFromArtifactsDirectory.contains(file)) {
- fileList.add(file);
- } else {
- assertTrue("File " + file + " does not exist", false);
- }
- }
- }
- return fileList;
- }
-
- private static synchronized Map<String, HeatAndHeatEnvNamesPair> getFilesPairMap(List<File> generatedEnvFiles) {
-
- Map<String, HeatAndHeatEnvNamesPair> heatAndHeatEnvPairs = new HashMap<>();
- for (File file : generatedEnvFiles) {
- String[] fileName = file.getName().split("\\.");
- String currentKey = fileName[0];
- String currentExtension = fileName[1];
- HeatAndHeatEnvNamesPair pair;
- if (!heatAndHeatEnvPairs.containsKey(currentKey)) {
- pair = new HeatAndHeatEnvNamesPair();
- heatAndHeatEnvPairs.put(currentKey, pair);
- } else {
- pair = heatAndHeatEnvPairs.get(currentKey);
- }
- setFileToPair(file, currentExtension, pair);
- }
- return heatAndHeatEnvPairs;
- }
-
- /**
- * The method fill list of HeatWithParametersDefinition parameters
- *
- * @param deploymentArtifacts
- * @return
- */
- public static synchronized List<HeatWithParametersDefinition> extractHeatWithParametersDefinition(Map<String, ArtifactDefinition> deploymentArtifacts) {
-
- List<HeatWithParametersDefinition> heatAndEnvLabelList = new ArrayList<>();
-
- for (Entry<String, ArtifactDefinition> artifactDefinitionChild : deploymentArtifacts.entrySet()) {
- if (artifactDefinitionChild.getValue().getArtifactType().equals(ArtifactTypeEnum.HEAT_ENV.getType())) {
- for (Entry<String, ArtifactDefinition> artifactDefinitionParent : deploymentArtifacts.entrySet()) {
- if (artifactDefinitionChild.getValue().getGeneratedFromId().equals(artifactDefinitionParent.getValue().getUniqueId())) {
- String heatLabel = artifactDefinitionParent.getValue().getArtifactLabel();
- String heatArtifactType = artifactDefinitionParent.getValue().getArtifactType();
- String heatArtifactDisplayName = artifactDefinitionParent.getValue().getArtifactDisplayName();
- List<HeatParameterDataDefinition> heatParameterDefinition = artifactDefinitionParent.getValue().getHeatParameters();
- String heatEnvLabel = artifactDefinitionChild.getValue().getArtifactLabel();
- String heatEnvArtifactType = artifactDefinitionChild.getValue().getArtifactType();
- heatAndEnvLabelList.add(new HeatWithParametersDefinition(heatLabel, heatEnvLabel, heatArtifactType, heatEnvArtifactType, heatArtifactDisplayName, heatParameterDefinition));
- break;
- }
- }
- }
- }
- return heatAndEnvLabelList;
- }
-
-
- private static synchronized void setFileToPair(File file, String currentExtension, HeatAndHeatEnvNamesPair pair) {
- if (!currentExtension.equals("env")) {
- pair.setHeatFileName(file);
- } else {
- pair.setHeatEnvFileName(file);
- }
- }
-
- private static synchronized Map<String, File> generateDefaultEnvFiles(Map<String, HeatAndHeatEnvNamesPair> filesPairMap, String filePath) throws Exception {
-
- Map<String, File> generatedEnvFilesMap = new HashMap<>();
- for (Entry<String, HeatAndHeatEnvNamesPair> pair : filesPairMap.entrySet()) {
- Map<String, Pair<String, Object>> envParametersMap = getEnvParametersMap(pair);
- File generatedEnvFile = createEnvFile(envParametersMap, new File(filePath + pair.getKey() + ".env"));
- generatedEnvFilesMap.put(pair.getKey(), generatedEnvFile);
- }
- return generatedEnvFilesMap;
- }
-
- private static synchronized File createEnvFile(Map<String, Pair<String, Object>> envParametersMap, File fileToWrite) throws IOException {
-
- FileHandling.writeToFile(fileToWrite, PARAMETERS + ":", 0);
- FileHandling.writeToFile(fileToWrite, envParametersMap, 2);
- return fileToWrite;
- }
-
- private static synchronized Map<String, Pair<String, Object>> getEnvParametersMap(Entry<String, HeatAndHeatEnvNamesPair> pair) throws Exception {
- File heatFileName = pair.getValue().getHeatFileName();
- File heatEnvFileName = pair.getValue().getHeatEnvFileName();
- Map<String, Pair<String, Object>> envParametersMap = new HashMap<>();
- fillParametersMapFromHeatFile(heatFileName, envParametersMap);
- fillParametersMapFromHeatEnvFile(heatEnvFileName, envParametersMap);
- return envParametersMap;
- }
-
- private static synchronized void fillParametersMapFromHeatEnvFile(File heatEnvFileName, Map<String, Pair<String, Object>> envParametersMap) throws Exception {
- if (heatEnvFileName != null) {
- Map<String, Object> mapHeatEnvFileParameters = FileHandling.parseYamlFileToMapByPattern(heatEnvFileName, PARAMETERS);
- for (Map.Entry<String, Object> parameter : mapHeatEnvFileParameters.entrySet()) {
- String key = parameter.getKey();
- Pair<String, Object> pair;
- if (envParametersMap.containsKey(key)) {
- if (envParametersMap.get(key).left.equals("string") && parameter.getValue() != null) {
- pair = Pair.create(envParametersMap.get(key).left, "\"" + parameter.getValue() + "\"");
- } else if (envParametersMap.get(key).left.equals("string") && parameter.getValue() == null) {
- pair = Pair.create(envParametersMap.get(key).left, "");
- } else if (parameter.getValue() == null) {
- pair = Pair.create(envParametersMap.get(key).left, "");
- } else if (envParametersMap.get(key).left.equals("json") && parameter.getValue() != null) {
- String pairValue = "";
- Gson gson = new Gson();
- if (parameter.getValue() instanceof java.util.LinkedHashMap) {
- pairValue = gson.toJson(parameter.getValue());
- }
- pair = Pair.create(envParametersMap.get(key).left, pairValue);
-
- } else if (envParametersMap.get(key).left.equals("json") && parameter.getValue() == null) {
- pair = Pair.create(envParametersMap.get(key).left, "");
- } else {
- pair = Pair.create(envParametersMap.get(key).left, parameter.getValue());
- }
- envParametersMap.put(key, pair);
- }
- }
- }
- }
-
- @SuppressWarnings("unchecked")
- private static synchronized void fillParametersMapFromHeatFile(File heatFileName, Map<String, Pair<String, Object>> envParametersMap) throws Exception {
- Map<String, Object> mapHeatFileParameters = FileHandling.parseYamlFileToMapByPattern(heatFileName, PARAMETERS);
- for (Map.Entry<String, Object> parameter : mapHeatFileParameters.entrySet()) {
- Map<String, Object> value = (Map<String, Object>) parameter.getValue();
- Pair<String, Object> pair;
- if (value.get("type").toString().equals("string") && value.get("default") != null) {
- pair = Pair.create(value.get("type").toString(), "\"" + value.get("default") + "\"");
- } else if (value.get("type").toString().equals("string") && value.get("default") == null) {
- pair = Pair.create(value.get("type").toString(), "");
- } else if (value.get("default") == null) {
- pair = Pair.create(value.get("type").toString(), "");
- } else {
- pair = Pair.create(value.get("type").toString(), value.get("default"));
- }
- envParametersMap.put(parameter.getKey(), pair);
- }
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/dataProvider/OnbordingDataProviders.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/dataProvider/OnbordingDataProviders.java
deleted file mode 100644
index 2536e090c5..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/dataProvider/OnbordingDataProviders.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.dataProvider;
-
-import org.openecomp.sdc.ci.tests.datatypes.enums.XnfTypeEnum;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utils.general.OnboardingUtils;
-import org.testng.Assert;
-import org.testng.annotations.DataProvider;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-public class OnbordingDataProviders {
-
- private static final String VSP_VGW_CSAR = "vsp-vgw.csar";
- private static final int NUMBER_OF_RANDOMLY_ONBOARD_VNF = 3;
- protected static String filepath = FileHandling.getVnfRepositoryPath();
-
- // -----------------------dataProviders-----------------------------------------
- @DataProvider(name = "randomVNF_List", parallel = false)
- private static Object[][] randomVnfList() throws Exception {
- int randomElementNumber = NUMBER_OF_RANDOMLY_ONBOARD_VNF; //how many VNFs to onboard randomly
- List<String> fileNamesFromFolder = OnboardingUtils.getVnfNamesFileListExcludeToscaParserFailure();
- List<String> newRandomFileNamesFromFolder = getRandomElements(randomElementNumber, fileNamesFromFolder);
- System.out.println(String.format("There are %s zip file(s) to test", newRandomFileNamesFromFolder.size()));
- return provideData(newRandomFileNamesFromFolder, filepath);
- }
-
- @DataProvider(name = "VNF_List", parallel = true)
- private static Object[][] VnfList() throws Exception {
-
- List<String> fileNamesFromFolder = OnboardingUtils.getXnfNamesFileList(XnfTypeEnum.VNF);
-
- System.out.println(String.format("There are %s zip file(s) to test", fileNamesFromFolder.size()));
- return provideData(fileNamesFromFolder, filepath);
- }
-
- @DataProvider(name = "updateList")
- private static Object[][] updateList() throws Exception {
-
- Object[][] objectArr = new Object[2][];
-
- Object[][] filteredArObject = null;
-
- objectArr[0] = new Object[] {"1-2016-20-visbc3vf-(VOIP)_v2.1.zip",
- "2-2016-20-visbc3vf-(VOIP)_v2.1_RenameResourceToShay.zip"};
- objectArr[1] = new Object[] {"1-2017-404_vUSP_vCCF_AIC3.0-(VOIP)_v6.0.zip",
- "2-2017-404_vUSP_vCCF_AIC3.0-(VOIP)_v6.0_Added2TestParameters.zip"};
-
- filteredArObject = OnboardingUtils.filterObjectArrWithExcludedVnfs(objectArr);
-
- return filteredArObject;
-
-
- }
-
- @DataProvider(name = "Single_Vsp_Test_Csar", parallel = true)
- private static Object[][] singleVspTestCsar() throws Exception {
-
- List<String> fileNamesFromFolder = OnboardingUtils.getXnfNamesFileList(XnfTypeEnum.VNF);
- if (!fileNamesFromFolder.contains(VSP_VGW_CSAR)) {
- Assert.fail("Vsp Test file is not exits in the path");
- }
- return provideData(Arrays.asList(VSP_VGW_CSAR), filepath);
- }
-
- // -----------------------methods-----------------------------------------
- static Object[][] provideData(List<String> fileNamesFromFolder, String filepath) {
-
- Object[][] arObject = new Object[fileNamesFromFolder.size()][];
- int index = 0;
- for (Object obj : fileNamesFromFolder) {
- arObject[index++] = new Object[] {filepath, obj};
- }
- return arObject;
- }
-
- static List<String> getRandomElements(int randomElementNumber, List<String> fileNamesFromFolder) {
- if (fileNamesFromFolder.size() == 0 || fileNamesFromFolder.size() < randomElementNumber) {
- return null;
- } else {
- List<Integer> indexList = new ArrayList<>();
- List<String> newRandomFileNamesFromFolder = new ArrayList<>();
- for (int i = 0; i < fileNamesFromFolder.size(); i++) {
- indexList.add(i);
- }
- Collections.shuffle(indexList);
- Integer[] randomArray = indexList.subList(0, randomElementNumber).toArray(new Integer[randomElementNumber]);
- for (Integer integer : randomArray) {
- newRandomFileNamesFromFolder.add(fileNamesFromFolder.get(integer));
- }
- return newRandomFileNamesFromFolder;
- }
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ArtifactInfo.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ArtifactInfo.java
deleted file mode 100644
index db44155615..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ArtifactInfo.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-public class ArtifactInfo {
-
- private String filepath;
- private String filename;
- private String description;
- private String artifactType;
- private String artifactLabel;
- private String artifactVersion;
-
- public ArtifactInfo(String filepath, String filename, String description, String artifactLabel,
- String artifactType) {
- super();
- this.filepath = filepath;
- this.filename = filename;
- this.description = description;
- this.artifactType = artifactType;
- this.artifactLabel = artifactLabel;
- }
-
- public ArtifactInfo(String filepath, String filename, String description, String artifactLabel,
- String artifactType, String artifactVersion) {
- super();
- this.filepath = filepath;
- this.filename = filename;
- this.description = description;
- this.artifactType = artifactType;
- this.artifactLabel = artifactLabel;
- this.artifactVersion = artifactVersion;
- }
-
- public ArtifactInfo() {
- super();
- }
-
- public String getArtifactVersion() {
- return artifactVersion;
- }
-
- public void setArtifactVersion(String artifactVersion) {
- this.artifactVersion = artifactVersion;
- }
-
- public String getFilepath() {
- return filepath;
- }
-
- public void setFilepath(String filepath) {
- this.filepath = filepath;
- }
-
- public String getFilename() {
- return filename;
- }
-
- public void setFilename(String filename) {
- this.filename = filename;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public String getArtifactType() {
- return artifactType;
- }
-
- public void setArtifactType(String artifactType) {
- this.artifactType = artifactType;
- }
-
- public String getArtifactLabel() {
- return artifactLabel;
- }
-
- public void setArtifactLabel(String artifactLabel) {
- this.artifactLabel = artifactLabel;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CanvasElement.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CanvasElement.java
deleted file mode 100644
index 0ecc04bac5..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CanvasElement.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-import org.apache.commons.lang3.tuple.ImmutablePair;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.LeftPanelCanvasItems;
-
-public final class CanvasElement {
- private final String uniqueId;
- private ImmutablePair<Integer, Integer> location;
- private LeftPanelCanvasItems normativeElementType;
- private String elementType;
- private String elementNameOnCanvas;
-
- CanvasElement(String name, ImmutablePair<Integer, Integer> location, LeftPanelCanvasItems canvasItem) {
- super();
- this.uniqueId = name;
- this.location = location;
- normativeElementType = canvasItem;
- this.elementNameOnCanvas = generateCanvasName(name);
- }
-
- CanvasElement(String name, ImmutablePair<Integer, Integer> location, String canvasItem) {
- super();
- this.uniqueId = name;
- this.location = location;
- elementType = canvasItem;
- this.elementNameOnCanvas = generateCanvasNameFromCanvasItem(canvasItem);
- }
-
- public CanvasElement(String name, ImmutablePair<Integer, Integer> location) {
- super();
- this.uniqueId = name;
- this.location = location;
- this.elementNameOnCanvas = generateCanvasName(name);
- }
-
- public String generateCanvasName(String name) {
- if (name.toLowerCase().contains("service")) {
- return name.toLowerCase().substring(0, name.indexOf("_")) + "_proxy 0";
- }
- return name.substring(0, name.indexOf("_")) + " 0";
- }
-
- public String generateCanvasNameFromCanvasItem(String name) {
- if (name.toLowerCase().contains("service")) {
- return name.toLowerCase() + "_proxy 0";
- }
- return name + " 0";
- }
-
- public String getUniqueId() {
- return uniqueId;
- }
-
- public ImmutablePair<Integer, Integer> getLocation() {
- return location;
- }
-
- public void setLocation(ImmutablePair<Integer, Integer> location) {
- this.location = location;
- }
-
- public LeftPanelCanvasItems getNormativeElementType() {
- return normativeElementType;
- }
-
- public String getElementType() {
- return elementType;
- }
-
- public String getElementNameOnCanvas() {
- return elementNameOnCanvas;
- }
-
- public void setElementNameOnCanvas(String newName) {
- elementNameOnCanvas = newName;
- }
-
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CanvasManager.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CanvasManager.java
deleted file mode 100644
index 012895fc86..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CanvasManager.java
+++ /dev/null
@@ -1,622 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-import com.aventstack.extentreports.Status;
-import com.clearspring.analytics.util.Pair;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonParser;
-import org.apache.commons.lang3.tuple.ImmutablePair;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.LeftPanelCanvasItems;
-import org.openecomp.sdc.ci.tests.datatypes.enums.CircleSize;
-import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.CompositionPage;
-import org.openecomp.sdc.ci.tests.pages.PropertiesAssignmentPage;
-import org.openecomp.sdc.ci.tests.pages.PropertyNameBuilder;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openqa.selenium.By;
-import org.openqa.selenium.StaleElementReferenceException;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.interactions.Actions;
-import org.testng.Assert;
-import org.testng.SkipException;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
-import java.util.UUID;
-import java.util.concurrent.TimeUnit;
-import java.util.stream.Collectors;
-
-public final class CanvasManager {
- public static final int VIEW_BUTTON_X_DELTA = 30;
- public static final int VIEW_BUTTON_Y_DELTA = 11;
- public static final int DELTET_BUTTON_X_DELTA = 30;
- public static final int CANVAS_ELEMENT_TYPE_SPLITER = 4;
- public static final int MAX_WAIT_DIVIDER = 1000;
- public static final int THREAD_SLEEP_TIME = 5000;
- private Map<String, CanvasElement> canvasElements;
- private Actions actions;
- private WebElement canvas;
- private int reduceCanvasWidthFactor;
- private CanvasElement canvasElement;
- // Offsets Are used to find upper right corner of canvas element in order to
- // connect links
- private static final int CANVAS_VF_Y_OFFSET = 30;
- private static final int CANVAS_VF_X_OFFSET = 18; // 14 - 27
-
- private static final int CANVAS_NORMATIVE_ELEMENT_Y_OFFSET = 12;
- private static final int CANVAS_NORMATIVE_ELEMENT_X_OFFSET = 7;
-
- private static final int CANVAS_SERVICE_Y_OFFSET = 27;
- private static final int CANVAS_SERVICE_X_OFFSET = 16;
-
- private CanvasManager() {
- canvasElements = new HashMap<>();
- actions = new Actions(GeneralUIUtils.getDriver());
- canvas = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralCanvasItems.CANVAS.getValue());
- try {
- WebElement webElement = GeneralUIUtils
- .getWebElementByTestID(DataTestIdEnum.GeneralCanvasItems.CANVAS_RIGHT_PANEL.getValue());
- reduceCanvasWidthFactor = webElement.getSize().width;
- } catch (Exception e) {
- reduceCanvasWidthFactor = 0;
- }
- }
-
- public static CanvasManager getCanvasManager() {
- return new CanvasManager();
- }
-
- public List<CanvasElement> getCanvasElements() {
- return canvasElements.values().stream().collect(Collectors.toList());
- }
-
- private void addCanvasElement(CanvasElement element) {
- String prefix = element.getElementType();
- List<CanvasElement> canvasElementsFromSameTemplate = new ArrayList<>();
-
- // collect all elements from from same template
- for (CanvasElement currElement : canvasElements.values()) {
- if (currElement.getElementNameOnCanvas().toLowerCase().startsWith(prefix.toLowerCase())) {
- canvasElementsFromSameTemplate.add(currElement);
- }
- }
-
- // match element name to actual name on canvas
- if (canvasElementsFromSameTemplate.size() > 0) {
- String newName = prefix + " " + canvasElementsFromSameTemplate.size();
- element.setElementNameOnCanvas(newName);
- }
-
- canvasElements.put(element.getUniqueId(), element);
- }
-
- private void moveElementOnCanvas(CanvasElement canvasElement, ImmutablePair<Integer, Integer> newLocation)
- throws Exception {
- GeneralUIUtils.waitForLoader();
- actions.moveToElement(canvas, canvasElement.getLocation().left, canvasElement.getLocation().right);
- actions.clickAndHold();
- actions.moveToElement(canvas, newLocation.left, newLocation.right);
- actions.release();
- actions.perform();
- canvasElement.setLocation(newLocation);
- GeneralUIUtils.waitForLoader();
-
- }
-
- public void moveToFreeLocation(String containerName) {
- final int maxWait = 5000;
- final int napPeriod = 200;
- int sumOfWaiting = 0;
- boolean isKeepWaiting = false;
- while (!isKeepWaiting) {
- ImmutablePair<Integer, Integer> freePosition = getFreePosition();
- actions.moveToElement(canvas, freePosition.left, freePosition.right);
- actions.clickAndHold();
- actions.release();
- actions.perform();
- isKeepWaiting = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.CompositionRightPanel.COMPONENT_TITLE.getValue()).getText()
- .equals(containerName);
- sumOfWaiting += napPeriod;
- if (sumOfWaiting > maxWait) {
- Assert.fail("Can't click on VF");
- }
- }
- }
-
- public void clickOnCanvaElement(CanvasElement canvasElement) {
- ImmutablePair<Integer, Integer> coordinates = getElementCoordinates(canvasElement.getElementNameOnCanvas());
- actions.moveToElement(canvas, coordinates.left, coordinates.right);
- actions.clickAndHold();
- actions.release();
- actions.perform();
- GeneralUIUtils.ultimateWait();
- actions.click().perform();
- GeneralUIUtils.ultimateWait();
-
- validateInstanceSelected(canvasElement);
- ExtentTestActions.log(Status.INFO, String.format("Canvas element %s selected", canvasElement.getElementType()));
- }
-
- public void openLinkPopupReqsCapsConnection(CanvasElement canvasElement) {
- ExtentTestActions.log(Status.INFO, "Open Link popup");
- clickOnCanvasLink(canvasElement);
- int x = canvasElement.getLocation().getLeft() + VIEW_BUTTON_X_DELTA;
- int y = canvasElement.getLocation().getRight() + VIEW_BUTTON_Y_DELTA;
- clickOnCanvasPosition(x, y);
- GeneralUIUtils.ultimateWait();
- }
-
- public void openLinkPopupReqsCapsConnection(CanvasElement sourceElement, CanvasElement destElement) {
- ExtentTestActions.log(Status.INFO, "Open Link popup");
- ImmutablePair<Integer, Integer> sourceCoordinates = getElementCoordinates(sourceElement.getElementNameOnCanvas());
- ImmutablePair<Integer, Integer> destCoordinates = getElementCoordinates(destElement.getElementNameOnCanvas());
- ImmutablePair<Integer, Integer> linkPosition = calcMidOfLink(sourceCoordinates, destCoordinates);
-
- clickOnCanvasPosition(linkPosition.left, linkPosition.right); // click on link
- int x = linkPosition.left + VIEW_BUTTON_X_DELTA;
- int y = linkPosition.right + VIEW_BUTTON_Y_DELTA;
- clickOnCanvasPosition(x, y); // click on view popup
- GeneralUIUtils.ultimateWait();
- }
-
- public void closeLinkPopupReqsCapsConnection() {
- GeneralUIUtils.clickOnElementByTestId("Cancel");
- //GeneralUIUtils.ultimateWait();
- }
-
- public void clickSaveOnLinkPopup() {
- ExtentTestActions.log(Status.INFO, "Click save on link popup");
- GeneralUIUtils.clickOnElementByTestId("Save");
- //GeneralUIUtils.ultimateWait();
- }
-
- public void deleteLinkPopupReqsCapsConnection(CanvasElement canvasElement) {
- ExtentTestActions.log(Status.INFO, "Delete Link ");
- clickOnCanvasLink(canvasElement);
- int x = canvasElement.getLocation().getLeft() + DELTET_BUTTON_X_DELTA;
- int y = canvasElement.getLocation().getRight() + DELTET_BUTTON_X_DELTA;
- clickOnCanvasPosition(x, y);
- }
-
- public void deleteLinkPopupReqsCapsConnection(CanvasElement sourceElement, CanvasElement destElement) {
- ExtentTestActions.log(Status.INFO, "Delete Link ");
- ImmutablePair<Integer, Integer> sourceCoordinates = getElementCoordinates(sourceElement.getElementNameOnCanvas());
- ImmutablePair<Integer, Integer> destCoordinates = getElementCoordinates(destElement.getElementNameOnCanvas());
- ImmutablePair<Integer, Integer> linkPosition = calcMidOfLink(sourceCoordinates, destCoordinates);
- clickOnCanvasPosition(linkPosition.left, linkPosition.right); // click on link
- int x = linkPosition.left + DELTET_BUTTON_X_DELTA;
- int y = linkPosition.right + DELTET_BUTTON_X_DELTA;
- clickOnCanvasPosition(x, y);
- }
-
- public void clickOnCanvasLink(CanvasElement canvasElement) {
- actions.moveToElement(canvas, canvasElement.getLocation().left, canvasElement.getLocation().right);
- actions.click().perform();
- GeneralUIUtils.ultimateWait();
- }
-
- public void clickOnCanvasPosition(int x, int y) {
-
- try {
- actions.moveToElement(canvas, x, y);
- actions.click();
- actions.perform();
- GeneralUIUtils.ultimateWait();
- } catch (Exception e) {
- System.out.println(e);
- }
- }
-
- public void moveElementOnCanvas(CanvasElement canvasElement) throws Exception {
- moveElementOnCanvas(canvasElement, getFreePosition());
- }
-
- public void deleteElementFromCanvas(CanvasElement canvasElement) throws Exception {
- GeneralUIUtils.waitForLoader();
- actions.moveToElement(canvas, canvasElement.getLocation().left, canvasElement.getLocation().right);
- actions.click();
- actions.perform();
- ExtentTestActions.log(Status.INFO, String.format("Removing canvas element %s ", canvasElement.getElementType()));
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralCanvasItems.DELETE_INSTANCE_BUTTON.getValue())
- .click();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ModalItems.DELETE_INSTANCE_CANCEL.getValue()).click();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralCanvasItems.DELETE_INSTANCE_BUTTON.getValue())
- .click();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ModalItems.DELETE_INSTANCE_OK.getValue()).click();
- canvasElements.remove(canvasElement.getUniqueId());
- GeneralUIUtils.ultimateWait();
- if (canvasElement.getElementType().contains("-")) {
- ExtentTestActions.log(Status.INFO, String.format(
- "Canvas element %s is removed",
- canvasElement.getElementType().split("-")[CANVAS_ELEMENT_TYPE_SPLITER]));
- } else {
- ExtentTestActions.log(Status.INFO, String.format(
- "Canvas element %s is removed",
- canvasElement.getElementType()));
- }
- }
-
- private WebElement findClickElement(String dataTestId) {
- int attempts = 0;
- while (attempts < 2) {
- try {
- return GeneralUIUtils.getWebElementByTestID(dataTestId);
- } catch (StaleElementReferenceException e) {
- }
- attempts++;
- }
- return null;
- }
-
- public CanvasElement createElementOnCanvas(String elementName) {
- String actionDuration = GeneralUIUtils.getActionDuration(() -> {
- try {
- canvasElement = createElementOnCanvasWithoutDuration(elementName);
- } catch (Exception e) {
- e.printStackTrace();
- }
- });
-
- if (canvasElement != null) {
- ExtentTestActions.log(Status.INFO, String.format("The element %s should now be on the canvas", elementName), actionDuration);
- }
- return canvasElement;
- }
-
- private CanvasElement createElementOnCanvasWithoutDuration(String elementDataTestId) throws Exception {
- final int offset = 20;
- try {
- CompositionPage.searchForElement(elementDataTestId);
- WebElement element = findClickElement(elementDataTestId);
- ImmutablePair<Integer, Integer> freePosition = getFreePosition();
- actions.moveToElement(element, offset, offset);
- actions.clickAndHold();
- actions.moveToElement(canvas, freePosition.left, freePosition.right);
- actions.release();
- actions.perform();
- GeneralUIUtils.ultimateWait();
- String uniqueId = elementDataTestId + "_" + UUID.randomUUID().toString();
- CanvasElement canvasElement = new CanvasElement(uniqueId, freePosition, elementDataTestId);
- addCanvasElement(canvasElement);
- GeneralUIUtils.ultimateWait();
- return canvasElement;
- } catch (Exception e) {
- System.out.println("Can't create element on canvas");
- e.printStackTrace();
- }
- return null;
- }
-
- public CanvasElement createElementOnCanvas(LeftPanelCanvasItems canvasItem) {
- return createElementOnCanvas(canvasItem.getValue());
- }
-
- private ImmutablePair<Integer, Integer> getFreePosition() {
- ImmutablePair<Integer, Integer> randomPosition = null;
- boolean freePosition = false;
- final int minSpace = 150;
- while (!freePosition) {
- ImmutablePair<Integer, Integer> tempRandomPosition = getRandomPosition();
- freePosition = !canvasElements.values().stream().map(e -> e.getLocation())
- .filter(e -> Math.abs(e.left - tempRandomPosition.left) < minSpace
- && Math.abs(e.right - tempRandomPosition.right) < minSpace)
- .findAny().isPresent();
- randomPosition = tempRandomPosition;
- }
- return randomPosition;
- }
-
- private ImmutablePair<Integer, Integer> getRandomPosition() {
- final int edgeBuffer = 50;
- Random random = new Random();
- int xElement = random.nextInt(canvas.getSize().width - 2 * edgeBuffer - reduceCanvasWidthFactor) + edgeBuffer;
- int yElement = random.nextInt(canvas.getSize().height - 2 * edgeBuffer) + edgeBuffer;
- return new ImmutablePair<Integer, Integer>(xElement, yElement);
- }
-
- // Will work only if 2 elements are big sized (VF size), if one of the elements is Small use the function linkElements
- public void linkElements(CanvasElement firstElement, CanvasElement secondElement) throws Exception {
- ExtentTestActions.log(Status.INFO, String.format("Linking between the %s instance and the %s instance.", firstElement.getElementType(), secondElement.getElementType()));
- drawSimpleLink(firstElement.getElementNameOnCanvas(), secondElement.getElementNameOnCanvas());
- selectReqAndCapAndConnect();
- ExtentTestActions.log(Status.INFO, String.format("The instances %s and %s should now be connected.", firstElement.getElementType(), secondElement.getElementType()));
- }
-
- // old version, depricated
- public void linkElements(CanvasElement firstElement, CircleSize firstElementSize, CanvasElement secondElement, CircleSize secondElementSize) throws Exception {
- drawSimpleLink(firstElement, firstElementSize, secondElement, secondElementSize);
- selectReqAndCapAndConnect();
- ExtentTestActions.log(Status.INFO, String.format("The instances %s and %s should now be connected.", firstElement.getElementType(), secondElement.getElementType()));
- }
-
- public void linkElements(String firstElement, String secondElement) throws Exception {
- drawSimpleLink(firstElement, secondElement);
- selectReqAndCapAndConnect();
- ExtentTestActions.log(Status.INFO, String.format("The instances %s and %s should now be connected.", firstElement, secondElement));
- }
-
- // use JS to get coordinates of elements
- private void drawSimpleLink(String firstElement, String secondElement) {
- ImmutablePair<Integer, Integer> firstElementCoordinates = getGreenDotCoordinatesOfElement(firstElement);
- ImmutablePair<Integer, Integer> secondElementCoordinates = getElementCoordinates(secondElement);
-
- actions.moveToElement(canvas, firstElementCoordinates.left, firstElementCoordinates.right);
- actions.perform();
- actions.moveToElement(canvas, firstElementCoordinates.left, firstElementCoordinates.right);
- actions.clickAndHold();
- actions.moveToElement(canvas, secondElementCoordinates.left, secondElementCoordinates.right);
- actions.release();
- actions.perform();
- GeneralUIUtils.ultimateWait();
- }
-
- private void selectReqAndCapAndConnect() throws Exception {
- addFirstReqOrCapAndPressNext();
- addFirstReqOrCapAndPressNext();
- linkMenuClickOnFinishButton();
- }
-
- private void addFirstReqOrCapAndPressNext() throws Exception {
- addFirstReqOrCap();
- linkMenuClickOnNextButton();
- }
-
- private void addFirstReqOrCap() {
- GeneralUIUtils.getWebElementsListByClassName(DataTestIdEnum.LinkMenuItems.LINK_ITEM_CAP_OR_REQ.getValue()).get(0).click();
- }
-
- private void linkMenuClickOnNextButton() throws Exception {
- GeneralUIUtils.clickOnElementByText("Next");
- GeneralUIUtils.ultimateWait();
- }
-
- private void linkMenuClickOnFinishButton() throws Exception {
- GeneralUIUtils.clickOnElementByText("Finish");
- GeneralUIUtils.ultimateWait();
- }
-
-
- private void drawSimpleLink(CanvasElement firstElement, CanvasElement secondElement) throws Exception {
- int yOffset = CANVAS_VF_Y_OFFSET;
- int xOffset = CANVAS_VF_X_OFFSET;
-
- actions.moveToElement(canvas, firstElement.getLocation().left + xOffset,
- firstElement.getLocation().right - yOffset);
-
- actions.clickAndHold();
- actions.moveToElement(canvas, secondElement.getLocation().left + xOffset, secondElement.getLocation().right - yOffset);
- actions.release();
- actions.perform();
- GeneralUIUtils.ultimateWait();
- }
-
- private void drawSimpleLink(CanvasElement firstElement, CircleSize firstElementSize, CanvasElement secondElement, CircleSize secondElementSize) throws Exception {
- ExtentTestActions.log(Status.INFO, String.format("Linking between the %s instance and the %s instance.", firstElement.getElementType(), secondElement.getElementType()));
- Integer yOffset = getCircleOffset(firstElementSize).right;
- Integer xOffset = getCircleOffset(firstElementSize).left;
- firstElement.getElementType();
-
-
- actions.moveToElement(canvas, firstElement.getLocation().left + xOffset,
- firstElement.getLocation().right - yOffset);
-
- actions.clickAndHold();
-
- yOffset = getCircleOffset(secondElementSize).right;
- xOffset = getCircleOffset(secondElementSize).left;
-
- actions.moveToElement(canvas, secondElement.getLocation().left + xOffset, secondElement.getLocation().right - yOffset);
- actions.release();
- actions.build();
- actions.perform();
- GeneralUIUtils.ultimateWait();
- }
-
- private Pair<Integer, Integer> getCircleOffset(CircleSize circleSize) {
- Pair<Integer, Integer> circleSizes;
- if (circleSize.equals(CircleSize.VF)) {
- circleSizes = new Pair<Integer, Integer>(CANVAS_VF_X_OFFSET, CANVAS_VF_Y_OFFSET);
- } else if (circleSize.equals(CircleSize.NORMATIVE)) {
- circleSizes = new Pair<Integer, Integer>(CANVAS_NORMATIVE_ELEMENT_X_OFFSET, CANVAS_NORMATIVE_ELEMENT_Y_OFFSET);
- } else {
- circleSizes = new Pair<Integer, Integer>(CANVAS_SERVICE_X_OFFSET, CANVAS_SERVICE_Y_OFFSET);
- }
- return circleSizes;
- }
-
- public String updateElementNameInCanvas(CanvasElement canvasElement, String newInstanceName) {
- GeneralUIUtils.ultimateWait();
- clickOnCanvaElement(canvasElement);
- GeneralUIUtils.getWebElementBy(By.id("editPencil")).click();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ModalItems.RENAME_INSTANCE_CANCEL.getValue()).click();
- GeneralUIUtils.getWebElementBy(By.id("editPencil")).click();
- WebElement instanceNameField = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralCanvasItems.INSTANCE_NAME_FIELD.getValue());
- String oldInstanceName = instanceNameField.getAttribute("value");
- instanceNameField.clear();
- instanceNameField.sendKeys(newInstanceName);
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ModalItems.RENAME_INSTANCE_OK.getValue()).click();
- GeneralUIUtils.ultimateWait();
- GeneralUIUtils.waitForElementInVisibilityByTestId(By.className("w-sdc-modal-resource-instance-name"));
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Name of element instance changed from %s to %s", oldInstanceName, newInstanceName));
- return oldInstanceName;
- }
-
- /**
- * @param canvasElement Validate that instance was selected on right sidebar
- */
- private void validateInstanceSelected(CanvasElement canvasElement) {
- final long maxWait = 5000;
- final long napPeriod = 200;
- long sumOfWaiting = 0;
- boolean isInstanceSelected;
- do {
- isInstanceSelected = CompositionPage.getSelectedInstanceName().toLowerCase().contains(canvasElement.getElementType().toLowerCase());
-
- if (!isInstanceSelected) {
- try {
- TimeUnit.MILLISECONDS.sleep(napPeriod);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- sumOfWaiting += napPeriod;
- if (sumOfWaiting > maxWait) {
- throw new SkipException(String.format("Bug 342260, can't select instance properly, waited for %s seconds after click on instance", (int) (maxWait / MAX_WAIT_DIVIDER)));
- }
- } while (!isInstanceSelected);
- }
-
- public void validateLinkIsSelected() {
- final long maxWait = 5000;
- final long napPeriod = 200;
- long sumOfWaiting = 0;
- boolean isInstanceSelected;
- do {
- isInstanceSelected = GeneralUIUtils.isWebElementExistByClass("w-sdc-menu-item w-sdc-canvas-menu-item-view");
-
- if (!isInstanceSelected) {
- try {
- TimeUnit.MILLISECONDS.sleep(napPeriod);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- sumOfWaiting += napPeriod;
- if (sumOfWaiting > maxWait) {
- Assert.fail(String.format("Can't select link properly, waited for %s seconds", (int) (maxWait / MAX_WAIT_DIVIDER)));
- }
- } while (!isInstanceSelected);
- }
-
- private void selectReqCapByName(String reqCapName) {
- GeneralUIUtils.clickOnElementByText(reqCapName);
- GeneralUIUtils.ultimateWait();
- }
-
- private void selectTypeOfReqCap(String dataTestId, String reqCapType) {
- GeneralUIUtils.selectByValueTextContained(dataTestId, reqCapType);
- }
-
- public void linkElementsAndSelectCapReqTypeAndCapReqName(CanvasElement firstElement, CanvasElement secondElement, ConnectionWizardPopUpObject connectionWizardPopUpObject) throws Exception {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating link between %s and %s", firstElement.getElementType(), secondElement.getElementType()));
- drawSimpleLink(firstElement.getElementNameOnCanvas(), secondElement.getElementNameOnCanvas());
- selectTypeOfReqCap(DataTestIdEnum.LinkMenuItems.REQ_CAP_SELECT_DATA_TESTS_ID.getValue(), connectionWizardPopUpObject.getCapabilityTypeSecondItem());
- addFirstReqOrCapAndPressNext();
- selectReqCapByName(connectionWizardPopUpObject.getCapabilityNameSecondItem());
- linkMenuClickOnNextButton();
- linkMenuClickOnFinishButton();
- }
-
- public Map<String, String> linkElementsWithCapPropAssignment(CanvasElement firstElement, CanvasElement secondElement, ConnectionWizardPopUpObject connectionWizardPopUpObject) throws Exception {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating link between %s and %s", firstElement.getElementType(), secondElement.getElementType()));
- drawSimpleLink(firstElement.getElementNameOnCanvas(), secondElement.getElementNameOnCanvas());
- selectTypeOfReqCap(DataTestIdEnum.LinkMenuItems.REQ_CAP_SELECT_DATA_TESTS_ID.getValue(), connectionWizardPopUpObject.getCapabilityTypeSecondItem());
- addFirstReqOrCapAndPressNext();
- selectReqCapByName(connectionWizardPopUpObject.getCapabilityNameSecondItem());
- linkMenuClickOnNextButton();
- Map<String, String> mapOfValues = connectionWizardAssignCapPropValues();
- linkMenuClickOnFinishButton();
- Thread.sleep(THREAD_SLEEP_TIME);
- return mapOfValues;
- }
-
-
- public Map<String, String> connectionWizardAssignCapPropValues() throws Exception {
- //get list of capability property value fields data-tests-ids in connection wizard
- List<String> valueField = getListOfValueFieldIDs();
- //get map of field ids and their values, fill in values if empty
- Map<String, String> propValues = getMapOfCapPropValues(valueField, true);
- return propValues;
- }
-
- public Map<String, String> connectionWizardCollectCapPropValues() throws Exception {
- //get list of capability property value fields data-tests-ids in connection wizard
- List<String> valueField = getListOfValueFieldIDs();
- //get map of field ids and their values, collect existing values
- Map<String, String> propValues = getMapOfCapPropValues(valueField, false);
- return propValues;
- }
-
- private List<String> getListOfValueFieldIDs() {
- String propName = GeneralUIUtils.getWebElementsListByContainsClassName("multiline-ellipsis-content").get(0).getText();
- List<WebElement> valueNameElement = GeneralUIUtils.findElementsByXpath("//div[@class='dynamic-property-row nested-level-1']/div[1]");
- List<String> valueName = new ArrayList<>();
- for (int i = 0; i < valueNameElement.size(); i++) {
- valueName.add(valueNameElement.get(i).getText());
- }
- //get list of value field names as appear in data-tests-id
- List<String> valueField = new ArrayList<>();
- for (int i = 0; i < valueName.size(); i++) {
- valueField.add(PropertyNameBuilder.buildIComplexField(propName, valueName.get(i)));
- }
- return valueField;
- }
-
- private Map<String, String> getMapOfCapPropValues(List<String> valueField, boolean isValueAssign) throws Exception {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Assigning values to properties of capabilities and/or collecting existing ones"));
- Map<String, String> propValues = new HashMap<>();
- for (int i = 0; i < valueField.size(); i++) {
- String fieldId = valueField.get(i);
- if (GeneralUIUtils.getWebElementByTestID(fieldId).getAttribute("value").isEmpty() && isValueAssign) {
- //add value and put into map
- propValues.put(fieldId, "value" + i);
- PropertiesAssignmentPage.editPropertyValue(fieldId, "value" + i);
- } else {
- //put existing value into map
- propValues.put(fieldId, GeneralUIUtils.getWebElementByTestID(valueField.get(i)).getAttribute("value"));
- }
- }
- return propValues;
- }
-
-
- public ImmutablePair<Integer, Integer> calcMidOfLink(ImmutablePair<Integer, Integer> location1, ImmutablePair<Integer, Integer> location2) {
- int x = (location1.getLeft() + location2.getLeft()) / 2;
- int y = (location1.getRight() + location2.getRight()) / 2;
-
- ImmutablePair<Integer, Integer> location = new ImmutablePair<>(x, y);
- return location;
- }
-
- public ImmutablePair<Integer, Integer> getElementCoordinates(String elementName) {
- Object position = GeneralUIUtils.getElementPositionOnCanvas(elementName);
- return converJSJsonToCoordinates(position);
- }
-
- public ImmutablePair<Integer, Integer> getGreenDotCoordinatesOfElement(String elementName) {
- Object position = GeneralUIUtils.getElementGreenDotPositionOnCanvas(elementName);
- return converJSJsonToCoordinates(position);
- }
-
- public ImmutablePair<Integer, Integer> converJSJsonToCoordinates(Object position) {
- JsonElement root = new JsonParser().parse(position.toString());
- int xElement = root.getAsJsonObject().get("x").getAsInt();
- int yElement = root.getAsJsonObject().get("y").getAsInt();
- return new ImmutablePair<Integer, Integer>(xElement, yElement);
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CatalogFilterTitlesEnum.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CatalogFilterTitlesEnum.java
deleted file mode 100644
index 44c445380d..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CatalogFilterTitlesEnum.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-public enum CatalogFilterTitlesEnum {
-
- TYPE("typeFilterTitle"), CATEGORIES("categoriesFilterTitle"), STATUS("statusFilterTitle");
-
- private String value;
-
- public String getValue() {
- return value;
- }
-
- CatalogFilterTitlesEnum(String value) {
- this.value = value;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CheckBoxStatusEnum.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CheckBoxStatusEnum.java
deleted file mode 100644
index 1363010fd6..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CheckBoxStatusEnum.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-public enum CheckBoxStatusEnum {
- CHECKOUT("", "checkbox-checkout"),
- CHECKIN("", "checkbox-checkin"),
- READY_FOR_TESTING("checkbox-readyforcertification", "checkbox-1"),
- IN_TESTING("checkbox-incertification", "checkbox-2"),
- WAITING_FOR_DISTRIBUTION("", "checkbox-waitingforapproval"),
- DISTRIBUTION_REJECTED("", "checkbox-distributionrejected"),
- DISTRIBUTION_APPROVED("", "checkbox-distributionapproved"),
- CERTIFIED("checkbox-certified", "checkbox-3"),
- DISTRIBUTED("checkbox-distributed", "checkbox-4"),
- IN_DESIGN("checkbox-indesign", "checkbox-0");
-
- private String value;
- private String value2;
-
- public String getValue() {
- return value;
- }
-
- public String getCatalogValue() {
- return value2;
- }
-
- CheckBoxStatusEnum(String value, String value2) {
- this.value = value;
- this.value2 = value2;
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ConnectionWizardPopUpObject.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ConnectionWizardPopUpObject.java
deleted file mode 100644
index c6146479d0..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ConnectionWizardPopUpObject.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-public class ConnectionWizardPopUpObject {
-
- private String capabilityTypeFirstItem;
- private String capabilityTypeSecondItem;
- private String capabilityNameFirstItem;
- private String capabilityNameSecondItem;
-
- public ConnectionWizardPopUpObject(String capabilityTypeFirstItem, String capabilityNameFirstItem, String capabilityTypeSecondItem, String capabilityNameSecondItem) {
- this.capabilityTypeFirstItem = capabilityTypeFirstItem;
- this.capabilityTypeSecondItem = capabilityTypeSecondItem;
- this.capabilityNameFirstItem = capabilityNameFirstItem;
- this.capabilityNameSecondItem = capabilityNameSecondItem;
- }
-
- public String getCapabilityTypeFirstItem() {
- return capabilityTypeFirstItem;
- }
-
- public void setCapabilityTypeFirstItem(String capabilityTypeFirstItem) {
- this.capabilityTypeFirstItem = capabilityTypeFirstItem;
- }
-
- public String getCapabilityTypeSecondItem() {
- return capabilityTypeSecondItem;
- }
-
- public void setCapabilityTypeSecondItem(String capabilityTypeSecondItem) {
- this.capabilityTypeSecondItem = capabilityTypeSecondItem;
- }
-
- public String getCapabilityNameFirstItem() {
- return capabilityNameFirstItem;
- }
-
- public void setCapabilityNameFirstItem(String capabilityNameFirstItem) {
- this.capabilityNameFirstItem = capabilityNameFirstItem;
- }
-
- public String getCapabilityNameSecondItem() {
- return capabilityNameSecondItem;
- }
-
- public void setCapabilityNameSecondItem(String capabilityNameSecondItem) {
- this.capabilityNameSecondItem = capabilityNameSecondItem;
- }
-
- @Override
- public String toString() {
- return "ConnectionWizardPopUpObject{"
- + "capabilityTypeFirstItem='" + capabilityTypeFirstItem + '\''
- + ", capabilityTypeSecondItem='" + capabilityTypeSecondItem + '\''
- + ", capabilityNameFirstItem='" + capabilityNameFirstItem + '\''
- + ", capabilityNameSecondItem='" + capabilityNameSecondItem + '\''
- + '}';
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CreateAndImportButtonsEnum.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CreateAndImportButtonsEnum.java
deleted file mode 100644
index aeef7d98d3..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/CreateAndImportButtonsEnum.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-public enum CreateAndImportButtonsEnum {
-
- IMPORT_VF, IMPORT_VFC, IMPORT_CP, IMPORT_VL, CREATE_VF, CREATE_SERVICE, CREATE_PRODUCT;
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/DataTestIdEnum.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/DataTestIdEnum.java
deleted file mode 100644
index 0046489a7d..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/DataTestIdEnum.java
+++ /dev/null
@@ -1,840 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import org.openecomp.sdc.ci.tests.pages.TopSearchComponent;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-public final class DataTestIdEnum {
-
- private DataTestIdEnum() {
- }
-
- @AllArgsConstructor
- @Getter
- public enum Dashboard {
- IMPORT_AREA("importButtonsArea"),
- ADD_AREA("AddButtonsArea"),
- BUTTON_ADD_VF("createResourceButton"),
- BUTTON_ADD_SERVICE("createServiceButton"),
- IMPORT_VFC("importVFCbutton"),
- IMPORT_VF("importVFbutton"),
- IMPORT_VFC_FILE("file-importVFCbutton"),
- IMPORT_VF_FILE("file-importVFbutton"),
- BUTTON_ADD_PRODUCT("createProductButton"),
- BUTTON_ADD_PNF("createPNFButton"),
- BUTTON_ADD_CR("createCRButton");
-
- private final String value;
- }
-
- @AllArgsConstructor
- @Getter
- public enum LifeCyleChangeButtons {
- CREATE("create/save"),
- CHECK_IN("check_in"),
- SUBMIT_FOR_TESTING("submit_for_testing"),
- START_TESTING("start_testing"),
- ACCEPT("accept"),
- CERTIFY("certify"),
- CHECKOUT("check_out");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum DistributionChangeButtons {
- APPROVE("approve"),
- REJECT("reject"),
- DISTRIBUTE("distribute"),
- MONITOR("monitor"),
- APPROVE_MESSAGE("checkindialog"),
- RE_DISTRIBUTE("redistribute");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum InformationalArtifactsPlaceholders {
- CLOUD_QUESTIONNAIRE("Cloud Questionnaire (completed)"),
- FEATURES("Features"),
- VENDOR_TEST_RESULT("Vendor Test Result"),
- TEST_SCRIPTS("Test Scripts"),
- RESOURCE_SECURITY_TEMPLATE("Resource Security Template"),
- HEAT_TEMPLATE_FROM_VENDOR("HEAT Template from Vendor"),
- CAPACITY("Capacity");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum ModalItems {
- BROWSE_BUTTON("browseButton"),
- ADD("Add"),
- DESCRIPTION("description"),
- SUMBIT_FOR_TESTING_MESSAGE("changeLifeCycleMessage"),
- OK("confirm-modal-button-ok"),
- CANCEL("Cancel"),
- DELETE_INSTANCE_OK("deleteInstanceModal-button-ok"),
- DELETE_INSTANCE_CANCEL("deleteInstanceModal-button-cancel"),
- RENAME_INSTANCE_OK("renameInstanceModal-button-ok"),
- RENAME_INSTANCE_CANCEL("renameInstanceModal-button-cancel"),
- UPGRADE_SERVICES_CANCEL("upgradeVspModal-close"),
- UPGRADE_SERVICES_OK("upgradeVspModal-button-upgrade"),
- UPDATE_SERVICES_OK("upgradeVspModal-button-update"),
- UPGRADE_SERVICES_CLOSE("upgradeVspModal-button-close"),
- UPGRADE_ARTIFACT_BUTTON("upgradeVspModal-button-done"),
- ACCEPT_TESTING_MESSAGE("checkindialog");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum LeftPanelCanvasItems {
- BLOCK_STORAGE("BlockStorage"),
- CINDER_VOLUME("CinderVolume"),
- COMPUTE("Compute"),
- LOAD_BALANCER("LoadBalancer"),
- NOVA_SERVER("NovaServer"),
- OBJECT_STORAGE("ObjectStorage"),
- NEUTRON_PORT("NeutronPort"),
- PORT("Port"), DATABASE("Database"),
- NETWORK("Network"),
- CONTRAIL_PORT("ContrailPort"),
- CONTRAIL_VIRTUAL_NETWORK("ContrailVirtualNetwork");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum LinkMenuItems {
- LINK_ITEM_CAP_OR_REQ("req-or-cap-item"),
- REQ_CAP_SELECT_DATA_TESTS_ID("value-select");
-
- private final String value;
-
- }
-
-
- @AllArgsConstructor
- @Getter
- public enum GeneralCanvasItems {
- CANVAS("canvas"),
- CANVAS_RIGHT_PANEL("w-sdc-designer-sidebar-head"),
- DELETE_INSTANCE_BUTTON("deleteInstance"),
- UPDATE_INSTANCE_NAME("e-sdc-small-icon-update"),
- INSTANCE_NAME_FIELD("instanceName");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum ResourceMetadataEnum {
- RESOURCE_NAME("name"),
- DESCRIPTION("description"),
- CATEGORY("selectGeneralCategory"),
- VENDOR_NAME("vendorName"),
- VENDOR_RELEASE("vendorRelease"),
- TAGS("i-sdc-tag-input"),
- CONTACT_ID("contactId"),
- ICON(" iconBox"),
- TAGS_TABLE("i-sdc-tag-text"),
- SELECT_VSP("filename");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum GeneralElementsEnum {
- CREATE_BUTTON("create/save"),
- CHECKIN_BUTTON("check_in"),
- CHECKOUT_BUTTON("check_out"),
- SUBMIT_FOR_TESTING_BUTTON("submit_for_testing"),
- DELETE_VERSION_BUTTON("delete_version"),
- REVERT_BUTTON("revert"),
- LIFECYCLE_STATE("formlifecyclestate"),
- VERSION_HEADER("versionHeader"),
- OK("OK"),
- UPDATE_SERVICES_BUTTON("open-upgrade-vsp-popup"),
- UPLOAD_FILE_INPUT("browseButton"),
- RESTORE_BUTTON("restore-component-button"),
- ARCHIVE_BUTTON("archive-component-button");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum ArtifactPageEnum {
- ADD_DEPLOYMENT_ARTIFACT("add_artifact_btn"),
- ADD_INFORMATIONAL_ARTIFACT("add-information-artifact-button"),
- DOWNLOAD_ARTIFACT_ENV("download_env_"),
- ADD_ANOTHER_ARTIFACT("add-another-artifact-button"),
- EDIT_ARTIFACT("edit_"), //upload env file by its label(via deployment artifact view)/displayName(via Canvas)
- DELETE_ARTIFACT("delete_"),
- DOWNLOAD_ARTIFACT("download_"),
- BROWSE_ARTIFACT("gab-"),
- GET_DEPLOYMENT_ARTIFACT_DESCRIPTION("description"),
- GET_INFORMATIONAL_ARTIFACT_DESCRIPTION("Description"),
- OK("OK"),
- TYPE("artifactType_"),
- DEPLOYMENT_TIMEOUT("timeout_"),
- VERSION("artifactVersion_"),
- UUID("artifactUUID_"),
- EDIT_PARAMETERS_OF_ARTIFACT("edit-parameters-of-"),
- DELETE_PARAMETER_OF_ARTIFACT("delete-"),
- ARTIFACT_NAME("artifactDisplayName_"),
- UPLOAD_HEAT_ENV_PARAMETERS("uplaodEnv_"),
- VERSION_ENV("artifactEnvVersion_"),
- ADD_OTHER_ARTIFACT_BUTTON("//button[@class='add-button ng-scope']");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum PropertiesPageEnum {
- ADD_NEW_PROPERTY("addGrey"),
- EDIT_PROPERTY("edit_"),
- DELETE_PROPERTY("delete_"),
- DELETE_PROPERTY_POPUP("delete_property"),
- PROPERTY_NAME("propertyName_"),
- PROPERTY_DESCRIPTION("propertyDescription_"),
- PROPERTY_TYPE("propertyType_"),
- ENTRY_SCHEMA("propertySchema_"),
- ADD("Add"), CANCEL("Cancel"),
- DONE("Done"),
- PROPERTY_ROW("propertyRow"),
- SAVE("Save"),
- POPUP_FORM("sdc-edit-property-container");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum PropertiesPopupEnum {
- PROPERTY_NAME("propertyName"),
- PROPERTY_VALUE("defaultvalue"),
- PROPERTY_BOOLEAN_VALUE("booleantype"),
- PROPERTY_DESCRIPTION("description"),
- PROPERTY_TYPE("propertyType"),
- ENTRY_SCHEMA("schema-type"),
- CANCEL("Cancel"),
- SAVE("Save"),
- POPUP_FORM("sdc-edit-property-container"),
- ADD("Add"),
- DONE("Done"),
- PROPERTY_RADIO_BUTTON_CONTAINER("propertyRadioButton_"),
- RADIO_BUTTON_CLASS("tlv-radio-label");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum AdminPageTabs {
- USER_MANAGEMENT("usermanagmenttab"),
- CATEGORY_MANAGEMENT("categorymanagmenttab");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum UserManagementEnum {
- SEARCH_BOX("searchbox"),
- NEW_USER_FIELD("newuserId"),
- ROLE_SELECT("selectrole"),
- CREATE_BUTTON("creategreen"),
- CLASS_USER_MANAGEMENT_TABLE("sdc-user-management-table"),
- ROW_TABLE("row_"),
- FIRST_NAME("firstName_"),
- LAST_NAME("lastName__"),
- USER_ID("userId_"),
- EMAIL("email_"),
- ROLE("role_"),
- LAST_ACTIVE("lastActive_"),
- UPDATE_ROLE("selectRole_"),
- UPDATE_USER_BUTTON("updateUser_"),
- SAVE_USER("save_"),
- DELETE_USER("delete_");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum CategoryManagement {
- SERVICE_CATEGORY_HEADER("servicecategoryheader"),
- RESOURCE_CATEGORY_HEADER("resourcecategoryheader"),
- SERVICE_CATEGORY_LIST("servicecategory"),
- RESOURCE_CATEGORY_LIST("resourcecategory"),
- NEW_CATEGORY_BUTTON("newcategory"),
- NEW_SUB_CATEGORY_BUTTON("newsubcategory"),
- NEW_CATEGORY_NAME("i-sdc-form-input");
-
- private final String value;
-
- }
-
-
- @AllArgsConstructor
- @Getter
- public enum MainMenuButtons {
- HOME_BUTTON("main-menu-button-home"),
- CATALOG_BUTTON("main-menu-button-catalog"),
- ONBOARD_BUTTON("main-menu-button-onboard"),
- SEARCH_BOX(TopSearchComponent.SEARCH_INPUT_TEST_ID),
- REPOSITORY_ICON("repository-icon");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum CatalogSwitchButtons {
- CATALOG_SWITCH_BUTTON("catalog-selector-button"), // get possible catalog types(active/archive)
- CATALOG_ACTIVE_ITEMS("catalog-selector-0"), // select active catalog
- CATALOG_ARCHIVE("catalog-selector-1"); // select archive catalog
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum MainMenuButtonsFromInsideFrame {
- HOME_BUTTON("breadcrumbs-button-0");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum MenuOptionsEnum {
- EDIT("Edit"),
- CHECK_IN("Check in"),
- CHECK_OUT("Check out"),
- VIEW("View"),
- SUBMIT_FOR_TEST("Submit For Test"),
- ACCEPT("Accept"),
- REJECT("Reject"),
- START_TEST("Start test"),
- DISTREBUTE("Distribute");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum StepsEnum {
- GENERAL("GeneralLeftSideMenu"),
- ICON("Iconstep"),
- DEPLOYMENT_ARTIFACT("Deployment ArtifactLeftSideMenu"),
- INFORMATION_ARTIFACT("Information ArtifactLeftSideMenu"),
- PROPERTIES("PropertiesLeftSideMenu"),
- COMPOSITION("CompositionLeftSideMenu"),
- ACTIVITY_LOG("Activity LogLeftSideMenu"),
- DEPLOYMENT_VIEW("DeploymentLeftSideMenu"),
- TOSCA_ARTIFACTS("TOSCA ArtifactsLeftSideMenu"),
- MONITOR("DistributionLeftSideMenu"),
- MANAGEMENT_WORKFLOW("Management WorkflowLeftSideMenu"),
- INPUTS("Inputs"),
- HIERARCHY("Hierarchy"),
- PROPERTIES_ASSIGNMENT("Properties AssignmentLeftSideMenu");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum ArtifactPopup {
- BROWSE("browseButton"),
- FILE_UNDEFINED("fileundefined"),
- ARTIFACT_DESCRIPTION("description"),
- ARTIFACT_LABEL("artifactLabel"),
- ARTIFACT_TYPE("artifacttype"),
- ARTIFACT_TYPE_ICON("artifacttype-icon"),
- OK("OK"),
- SAVE("Save"),
- DONE_BUTTON("Done"),
- CANCEL_BUTTON("Cancel"),
- URL("input[class^='i-sdc-form-input']"),
- MODAL_WINDOW("sdc-add-artifact");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum ServiceMetadataEnum {
- SERVICE_NAME("name"),
- DESCRIPTION("description"),
- CATEGORY("selectGeneralCategory"),
- PROJECT_CODE("projectCode"),
- NAMING_POLICY("namingPolicy"),
- SERVICE_FUNCTION("serviceFunction"),
- TAGS("i-sdc-tag-input"),
- CONTACT_ID("contactId"),
- ICON(" iconBox"),
- INSTANTIATION_TYPE("selectInstantiationType");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum ProductMetadataEnum {
- PRODUCT_NAME("name"),
- FULL_NAME("fullName"),
- DESCRIPTION("description"),
- PROJECT_CODE("projectCode"),
- TAGS("i-sdc-tag-input"),
- ATT_CONTACT("attContact"),
- ICON(" iconBox");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum DashboardCardEnum {
- ASSET_TYPE("asset-type"), LIFECYCLE_STATE("span[class^='w-sdc-dashboard-card-info-lifecycleState']"),
- INFO_NAME("div.sdc-tile-info-line"),
- VERSION("div[class^='w-sdc-dashboard-card-info-user']"),
- DASHBOARD_CARD("div[class^='w-sdc-dashboard-card ']"),
- INFO_TITLE_XPATH("//div[contains(@class,'sdc-tile-info-line title')]"),
- ASSET_TYPE_CSS("span[data-tests-id='asset-type']");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum CatalogPageLeftPanelCategoryCheckbox {
- GENERIC_CHECKBOX("span[data-tests-id='checkbox-resourcenewcategory.generic']"),
- NETWORK_L2_3("span[data-tests-id='checkbox-resourcenewcategory.networkl2-3']"),
- NETWORK_L4_PLUS("span[data-tests-id='checkbox-resourcenewcategory.networkl4+']"),
- NETWORK_CONNECTIVITY("span[data-tests-id='checkbox-resourcenewcategory.networkconnectivity']"),
- APPLICATION_L4_PLUS("span[data-tests-id='checkbox-resourcenewcategory.applicationl4+']"),
- DCAE("span[data-tests-id='checkbox-resourcenewcategory.dcaecomponent']");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum CatalogPageLeftPanelFilterTitle {
- TYPE("span[data-tests-id='typeFilterTitle']"),
- CATEGORIES("span[data-tests-id='categoriesFilterTitle']"),
- STATUS("span[data-tests-id='statusFilterTitle']");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum CatalogPageLeftPanelSubCategoryCheckbox {
- COMMON_NETWORK_RESOURCES("span[data-tests-id='checkbox-resourcenewcategory.networkl4+.commonnetworkresources']"),
- ROUTER("span[data-tests-id='checkbox-resourcenewcategory.networkl2-3.router']"),
- WAN_CONNECTORS("span[data-tests-id='checkbox-resourcenewcategory.networkl2-3.wanconnectors']"),
- LAN_CONNECTORS("span[data-tests-id='checkbox-resourcenewcategory.networkl2-3.lanconnectors']"),
- INFRASTRUCTURE_NETWORK_L2_3("span[data-tests-id='checkbox-resourcenewcategory.networkl2-3.infrastructure']"),
- GATEWAY("span[data-tests-id='checkbox-resourcenewcategory.networkl2-3.gateway']"),
- NETWORK_ELEMENTS("span[data-tests-id='checkbox-resourcenewcategory.generic.networkelements']"),
- ABSTRACT("span[data-tests-id='checkbox-resourcenewcategory.generic.abstract']"),
- RULES("span[data-tests-id='checkbox-resourcenewcategory.generic.rules']"),
- DATABASE("span[data-tests-id='checkbox-resourcenewcategory.generic.database']"),
- INFRASTRUCTERE_GENERIC("span[data-tests-id='checkbox-resourcenewcategory.generic.infrastructure']"),
- VIRTUAL_LINKS("span[data-tests-id='checkbox-resourcenewcategory.networkconnectivity.virtuallinks']"),
- CONNECTION_POINTS("span[data-tests-id='checkbox-resourcenewcategory.networkconnectivity.connectionpoints']"),
- APPLICATION_SERVER("span[data-tests-id='checkbox-resourcenewcategory.applicationl4+.applicationserver']"),
- CALL_CONTROL("span[data-tests-id='checkbox-resourcenewcategory.applicationl4+.callcontrol']"),
- MEDIASERVERS("span[data-tests-id='checkbox-resourcenewcategory.applicationl4+.mediaservers']"),
- WEBSERVER("span[data-tests-id='checkbox-resourcenewcategory.applicationl4+.webserver']"),
- LOAD_BALANCER("span[data-tests-id='checkbox-resourcenewcategory.applicationl4+.loadbalancer']"),
- BORDER_ELEMENT("span[data-tests-id='checkbox-resourcenewcategory.applicationl4+.borderelement']"),
- DATABASE_APPLIVATION_L4_PLUS("span[data-tests-id='checkbox-resourcenewcategory.applicationl4+.database']"),
- FIREWALL("span[data-tests-id='checkbox-resourcenewcategory.applicationl4+.firewall']"),
- DATABASE_DCAE("span[data-tests-id='checkbox-resourcenewcategory.dcaecomponent.database']"),
- POLICY("span[data-tests-id='checkbox-resourcenewcategory.dcaecomponent.policy']"),
- MICROSERVICE("span[data-tests-id='checkbox-resourcenewcategory.dcaecomponent.microservice']"),
- SOURCE("span[data-tests-id='checkbox-resourcenewcategory.dcaecomponent.source']"),
- COLLECTOR("span[data-tests-id='checkbox-resourcenewcategory.dcaecomponent.collector']"),
- UTILITY("span[data-tests-id='checkbox-resourcenewcategory.dcaecomponent.utility']"),
- ANALYTICS("span[data-tests-id='checkbox-resourcenewcategory.dcaecomponent.analytics']");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum CompositionScreenEnum {
- CHANGE_VERSION("changeVersion", Collections.emptyList()),
- DEPLOYMENT_ARTIFACT_TAB("deployment-artifact-tab", Collections.singletonList("Deployment Artifacts")),
- ADD_ARTIFACT("add_Artifact_Button", Collections.emptyList()),
- SEARCH_ASSET("searchAsset-input", Arrays.asList()),
- PROPERTIES_AND_ATTRIBUTES_TAB("properties-and-attributes-tab", Collections.emptyList()),
- MENU_INPUTS("sub-menu-button-inputs", Collections.emptyList()),
- MENU_ONBOARD("sub-menu-button-onboard", Collections.emptyList()),
- MENU_HOME("sub-menu-button-home", Collections.emptyList()),
- MENU_PROPERTIES_ASSIGNMENT("sub-menu-button-properties assignment", Collections.emptyList()),
- MENU_TRIANGLE_DROPDOWN("triangle-dropdown", Collections.emptyList()),
- ARTIFACTS_LIST("artifactName", Collections.emptyList()),
- INFORMATION_ARTIFACTS("button[tooltip-content='Information Artifacts']",
- Collections.singletonList("Informational Artifacts")),
- API("button[tooltip-content='API']", Collections.singletonList("API Artifacts")),
- INFORMATION("button[tooltip-content='Information']", Arrays.asList("General Info", "Additional Information", "Tags")),
- COMPOSITION("button[tooltip-content='Composition']", Collections.singletonList("Composition")),
- INPUTS("button[tooltip-content='Inputs']", Collections.singletonList("")),
- REQUIREMENTS_AND_CAPABILITIES("button[tooltip-content='Requirements and Capabilities']",
- Collections.emptyList()),
- INFORMATION_TAB("information-tab", Collections.emptyList()),
- CUSTOMIZATION_UUID("rightTab_customizationModuleUUID", Collections.emptyList());
-
- private final String value;
- private final List<String> title;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum ToscaArtifactsScreenEnum {
- TOSCA_MODEL("download-Tosca Model"),
- TOSCA_TEMPLATE("download-Tosca Template"),
- ARTIFACT_VERSION("version-"),
- ARTIFACT_NAME("name-"),
- ARTIFACT_TYPE("type-"),
- ARTIFACT_DETAILS("details-"),
- DOWNLOAD_ARTIFACT("download-"),
- DOWNLOAD_CSAR("download-Tosca Model");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum InformationalArtifactsService {
- AFFINITY_RULES("artifact_Display_Name-Affinity Rules"),
- CONTROL_LOOP_FUNCTIONS("artifact_Display_Name-Control Loop Functions"),
- DEPLOYMENT_VOTING_RECORD("artifact_Display_Name-Deployment Voting Record"),
- DIMENSIONING_INFO("artifact_Display_Name-Dimensioning Info"),
- DISTRIBUTION_INSTRUCTION("artifact_Display_Name-Distribution Instructions"),
- ENGINEERING_RULES("artifact_Display_Name-Engineering Rules (ERD)"),
- OPERATIONAL_POLICES("artifact_Display_Name-Operational Policies"),
- SERVICE_ARTIFACT_PLAN("artifact_Display_Name-Service Artifact Plan"),
- SERVICE_QUESTIONNAIRE("artifact_Display_Name-Service Questionnaire"),
- SERVICE_SECURITY_TEMPLATE("artifact_Display_Name-Service Security Template"),
- SERVICE_SPECIFIC_POLICIES("artifact_Display_Name-Service-specific Policies"),
- SUMMARY_OF_IMPACTS_TO_ECOMP("artifact_Display_Name-Summary of impacts to ECOMP elements,OSSs, BSSs"),
- TD_CERTIFICATION_TEST_RESULTS("artifact_Display_Name-TD Certification Test Results");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum APIArtifactsService {
- CONFIGURATION("artifact_Display_Name-Configuration"),
- INSTANTIATION("artifact_Display_Name-Instantiation"),
- LOGGING("artifact_Display_Name-Logging"),
- MONITORING("artifact_Display_Name-Monitoring"),
- REPORTING("artifact_Display_Name-Reporting"),
- TESTING("artifact_Display_Name-Testing");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum DeploymentArtifactCompositionRightMenu {
- ARTIFACT_NAME("artifactName-"),
- ARTIFACT_DISPLAY_NAME("artifact_Display_Name-"),
- DOWNLOAD("download_"),
- DELETE("delete_"),
- ADD_ARTIFACT_BUTTON("add_Artifact_Button"),
- EDIT_PARAMETERS_OF_ARTIFACT("edit-parameters-of-"),
- ARTIFACT_ITEM("artifact-item-"),
- ARTIFACT_ENV("heat_env_");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum InputsScreenService {
- ADD_SELECTED_INPUTS_BTN("add-inputs-to-service-button"),
- VF_INSTANCE_ROWS("expand-collapse[expanded-selector^='.vf-instance-list.']"),
- VF_INSTANCE_ROW_NAME("span[class^='title-text']"),
- VF_INSTANCE_INPUTS("div[class^='vf-instance-list ']"),
- VF_INSTANCE_INPUT("div[class^='input-row ng-scope']"),
- VF_INSTNCE_PROPERTY_NAME("div[class^='title-text']"),
- INPUT_CHECKBOX("span[class^='tlv-checkbox-label']"),
- SERVICE_INPUT_ROW("div[class^='service-input-row input-row']"),
- DELETE_INPUT_BTN("span[class$='remove-input-icon']"),
- RESOURCE_INSTANCE_PROPERTY_NAME("propertyName_"),
- RESOURCE_INSTANCE_PROPERTY_TYPE("propertyType_"),
- RESOURCE_INSTANCE_PROPERTY_CHECKBOX("propertyCheckbox_"),
- SERVICE_INPUTS_DELETE_BUTTON("deleteInput_");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum DeploymentScreen {
- MODULES("span[class^='expand-collapse-title-text']"),
- MEMBERS("div[class^='expand-collapse-sub-title']"),
- PROPERTIES("list-of-Properties"),
- ARTIFACTS("list-of-Artifacts"),
- BUTTON_PROPERTIES("div[data-tests-id='list-of-Properties'] span[class^='hand']"),
- BUTTON_ARTIFACTS("div[data-tests-id='list-of-Artifacts'] span[class^='hand']"),
- PROPERTY_NAMES("div[data-tests-id='selected-module-property-name'] span"),
- PROPERTY_TYPES("selected-module-property-type"),
- PROPERTY_SCHEMA_TYPE("selected-module-property-schema-type"),
- ARTIFACT_NAME("selected-module-artifact-name"),
- ARTIFACT_UUID("selected-module-artifact-uuid"),
- ARTIFACT_VERSION("selected-module-artifact-version"),
- PENCIL_ICON("edit-name-popover-icon"),
- MODULE_NAME("selected-module-name"),
- MODULE_ID("selected-module-group-uuid"),
- RESOURCE_NAME_ON_POPOVER("popover-vfinstance-name"),
- MODULE_NAME_ON_POPOVER("popover-module-name"),
- NAME_INPUT("popover-heat-name"),
- SAVE("popover-save-button"),
- CANCEL("popover-close-button"),
- X_BUTTON("popover-x-button");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum PropertiesAssignmentScreen {
- PROPERTIES_TAB("Properties"),
- INPUTS_TAB("Inputs"),
- COMPOSITION_TAB("Composition"),
- PROPERTY_STRUCTURE_TAB("Property Structure"),
- SEARCH_BOX("search-box"),
- FILTER_BOX("filter-box"),
- SAVE_BUTTON("properties-save-button"),
- DISCARD_BUTTON("properties-reverse-button"),
- DECLARE_BUTTON("declare-button"),
- SEARCH_BUTTON("search-button"),
- FILTER_BUTTON("filter-button"),
- EXPAND_BUTTON("expand-"),
- CLEAR_FILTER_BUTTON("clear-filter-button"),
- INPUT_DELETE_BUTTON("delete-input-button"),
- INPUT_DELETE_DIALOG_DELETE("Delete"),
- INPUT_DELETE_DIALOG_CLOSE("Close"),
- SAVE_DIALOG_CANCEL("id-button-cancel"),
- SAVE_DIALOG_DISCARD("id-button-discard"),
- SAVE_DIALOG_SAVE("id-button-save"),
- PROPERTY_KEY_FIELD_PREFIX("value-prop-key-"),
- PROPERTY_VALUE_FIELD_PREFIX("value-prop-"),
- INPUT_VALUE_FIELD_PREFIX("value-input-"),
- POPUP_VALUE_FIELD_PREFIX("edit-button-prop-"),
- ADD_TO_LIST_BUTTON("add-to-list-"),
- DELETE_FROM_LIST_BUTTON("delete-from-list-"),
- FILTER_CHECKBOX_ALL("filter-checkbox-all"),
- FILTER_CHECKBOX_CP("filter-checkbox-cp"),
- FILTER_CHECKBOX_VFC("filter-checkbox-vfc"),
- FILTER_CHECKBOX_VL("filter-checkbox-vl"),
- FILTER_APPLY_BUTTON("filter-apply-button"),
- FILTER_CLOSE_BUTTON("filter-close-button"),
- FILTER_SET_BUTTON("filter-set-button"),
- PROPERTY_NAME_COLUMN("property-name");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum ImportVfRepository {
- SEARCH("onboarding-search-input"),
- IMPORT_VSP("import-csar"),
- DOWNLOAD_CSAR("download-csar"),
- UPDATE_VSP("update-csar");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum EnvParameterView {
- SEARCH_ENV_PARAM_NAME("search-env-param-name"),
- ENV_CURRENT_VALUE("value-field-of-"), //value-field-of-oam_volume_name_0 - parameter name
- ENV_DEFAULT_VALUE("default-value-of-"); // default-value-of-vnf_name
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum ComplexServiceAmdocs {
- CREATE_BUTTON("Create"),
- DELETE_COMPONENT("deleteInstance"),
- PATH_LIST_BUTTON("pathsListMenuItem"),
- UPDATE_VF("create/save"),
- PATH_LIST_NAME("path-name"),
- PATH_LIST_EDIT("update-service-path-btn"),
- PATH_LIST_DELETE("delete-service-path-btn"),
- CREATE_PATH_MENU_BUTTON("createPathMenuItem"),
- PATH_NAME("pathName"),
- PATH_PROTOCOL("pathProtocol"),
- PATH_PORT_NUMBER("pathPortNumbers"),
- PATH_MENU_BUTTON("pathsMenuBtn"),
- SAVE("Save"),
- SEARCH("expandable-input-closed"),
- LINK_SOURCE("linkSrc"),
- LINK_SOURCE_CP("linkSrcCP"),
- LINK_TARGET("linkTarget"),
- LINK_TARGET_CP("linkTargetCP"),
- SERVICE_PATH_SELECTOR("service-path-selector"),
- SUBMIT_FOR_TESTING("submit_for_testing"),
- CHANGE_LIFE_CYCLE_MESSAGE("changeLifeCycleMessage"),
- REMOVE_LINK("removeLnk"),
- OK("OK"),
- ONBOARD_CATALOG("onboard-onboard-tab"),
- CLOSE("Close"),
- HOME_FROM_COMPOSITION("breadcrumbs-button-0"),
- NEW_VSP_VERSION_DESCRIPTION("new-version-description"),
- SUBMIT_NEW_VSP_VERSION_DESCRIPTION("form-submit-button"),
- EXTEND_BUTTON("extendPathlnk");
-
- private final String value;
-
- }
-
-
- @AllArgsConstructor
- @Getter
- public enum PortMirroring {
- COLLECTOR_NODE("collector_node"),
- EQUIP_MODEL("equip_model"),
- EQUIP_VENDOR("equip_vendor"),
- PMC_NAME_IN_PALLETE("Port Mirroring Configuration"),
- PMCP_NAME_IN_PALLETE("Port Mirroring Configuration By Policy");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum CompositionRightPanelGeneralInfo {
- TYPE("rightTab_componentType"),
- RESOURCE_TYPE("rightTab_resourceType"),
- SELECT_VERSION("changeVersion"),
- CATEGORY("rightTab_category"),
- SUB_CATEGORY("rightTab_subCategory");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum CompositionRightPanel {
- COMPONENT_TITLE("selectedCompTitle"),
- REQS_AND_CAPS_TAB("requirements-and-capabilities"),
- EDIT_PENCIL("editPencil"),
- INSTANCE_NAME_TEXTBOX("instanceName"),
- DELETE_ITEM("deleteInstance"),
- REQS_AND_CAPS_TAB_XPATH("//button[@tooltip-content='Requirements and Capabilities']");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum VspValidationPage {
- VSP_VALIDATION_PAGE_NAVBAR("navbar-group-item-SOFTWARE_PRODUCT_VALIDATION"),
- VSP_VALIDATION_PAGE_BREADCRUMBS("sub-menu-button-validation"),
- VSP_VALIDATION_PAGE_PROCEED_TO_INPUTS_BUTTON("go-to-vsp-validation-inputs"),
- VSP_VALIDATION_PAGE_PROCEED_TO_SETUP_BUTTON("go-to-vsp-validation-setup"),
- VSP_VALIDATION_PAGE_INPUT("%s_%s_input"),
- VSP_VALIDATION_PAGE_PROCEED_TO_RESULTS_BUTTON("proceed-to-validation-results-btn"),
- VSP_VALIDATION_PAGE_COMPLIANCE_CHECKBOX_TREE("vsp-validation-compliance-checks-checkbox-tree"),
- VSP_VALIDATION_PAGE_CERTIFICATION_CHECKBOX_TREE("vsp-validation-certifications-query-checkbox-tree");
-
- private final String value;
-
- }
-
- @AllArgsConstructor
- @Getter
- public enum VspValidationResultsPage {
- VSP_VALIDATION_RESULTS_PAGE_NAVBAR("navbar-group-item-SOFTWARE_PRODUCT_VALIDATION_RESULTS"),
- VSP_VALIDATION_RESULTS_PAGE_BREADCRUMBS("sub-menu-button-validation results");
-
- private final String value;
-
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ErrorMessageProperties.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ErrorMessageProperties.java
deleted file mode 100644
index 1538543e91..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ErrorMessageProperties.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-public class ErrorMessageProperties {
-
- private String messageId;
- private String code;
-
- public ErrorMessageProperties() {
-
- }
-
- public ErrorMessageProperties(String messageId, String code) {
- this.messageId = messageId;
- this.code = code;
- }
-
- public String getMessageId() {
- return messageId;
- }
-
- public void setMessageId(String messageId) {
- this.messageId = messageId;
- }
-
- public String getCode() {
- return code;
- }
-
- public void setCode(String code) {
- this.code = code;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/GeneralCanvasItemsEnum.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/GeneralCanvasItemsEnum.java
deleted file mode 100644
index a612dc7a9a..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/GeneralCanvasItemsEnum.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-public enum GeneralCanvasItemsEnum {
- CANVAS("canvas"),
- CANVAS_RIGHT_PANEL("w-sdc-designer-sidebar-head"),
- DELETE_INSTANCE_BUTTON("deleteInstance");
-
- private String value;
-
- public String getValue() {
- return value;
- }
-
- GeneralCanvasItemsEnum(String value) {
- this.value = value;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/HeatAndHeatEnvNamesPair.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/HeatAndHeatEnvNamesPair.java
deleted file mode 100644
index 4986bca883..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/HeatAndHeatEnvNamesPair.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-import java.io.File;
-
-public class HeatAndHeatEnvNamesPair {
-
- private File heatFileName;
- private File heatEnvFileName;
-
- public HeatAndHeatEnvNamesPair() {
- super();
- }
-
- public HeatAndHeatEnvNamesPair(File heatFileName, File heatEnvFileName) {
- super();
- this.heatFileName = heatFileName;
- this.heatEnvFileName = heatEnvFileName;
- }
-
- public File getHeatFileName() {
- return heatFileName;
- }
-
- public void setHeatFileName(File heatFileName) {
- this.heatFileName = heatFileName;
- }
-
- public File getHeatEnvFileName() {
- return heatEnvFileName;
- }
-
- public void setHeatEnvFileName(File heatEnvFileName) {
- this.heatEnvFileName = heatEnvFileName;
- }
-
- @Override
- public String toString() {
- return "HeatHeatEnvNamesPair [heatFileName=" + heatFileName + ", heatEnvFileName=" + heatEnvFileName + "]";
- }
-
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/HeatWithParametersDefinition.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/HeatWithParametersDefinition.java
deleted file mode 100644
index 7b9223bc84..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/HeatWithParametersDefinition.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-import org.openecomp.sdc.be.datatypes.elements.HeatParameterDataDefinition;
-
-import java.util.List;
-
-public class HeatWithParametersDefinition {
-
- private String heatLabel;
- private String heatEnvLabel;
- private String heatArtifactType;
- private String heatEnvArtifactType;
- private String heatArtifactDisplayName;
- private List<HeatParameterDataDefinition> heatParameterDefinition;
-
- public HeatWithParametersDefinition(String heatLabel, String heatEnvLabel, String heatArtifactType, String heatEnvArtifactType, String heatArtifactDisplayName, List<HeatParameterDataDefinition> heatParameterDefinition) {
- super();
- this.heatLabel = heatLabel;
- this.heatEnvLabel = heatEnvLabel;
- this.heatArtifactType = heatArtifactType;
- this.heatEnvArtifactType = heatEnvArtifactType;
- this.heatArtifactDisplayName = heatArtifactDisplayName;
- this.heatParameterDefinition = heatParameterDefinition;
- }
-
- public String getHeatArtifactDisplayName() {
- return heatArtifactDisplayName;
- }
-
- public void setHeatArtifactDisplayName(String heatArtifactDisplayName) {
- this.heatArtifactDisplayName = heatArtifactDisplayName;
- }
-
- public String getHeatLabel() {
- return heatLabel;
- }
-
- public void setHeatLabel(String heatLabel) {
- this.heatLabel = heatLabel;
- }
-
- public String getHeatEnvLabel() {
- return heatEnvLabel;
- }
-
- public void setHeatEnvLabel(String heatEnvLabel) {
- this.heatEnvLabel = heatEnvLabel;
- }
-
- public String getHeatArtifactType() {
- return heatArtifactType;
- }
-
- public void setHeatArtifactType(String heatArtifactType) {
- this.heatArtifactType = heatArtifactType;
- }
-
- public String getHeatEnvArtifactType() {
- return heatEnvArtifactType;
- }
-
- public void setHeatEnvArtifactType(String heatEnvArtifactType) {
- this.heatEnvArtifactType = heatEnvArtifactType;
- }
-
- public List<HeatParameterDataDefinition> getHeatParameterDefinition() {
- return heatParameterDefinition;
- }
-
- public void setHeatParameterDefinition(List<HeatParameterDataDefinition> heatParameterDefinition) {
- this.heatParameterDefinition = heatParameterDefinition;
- }
-
- @Override
- public String toString() {
- return "HeatWithParametersDefinition [heatLabel=" + heatLabel + ", heatEnvLabel=" + heatEnvLabel + ", heatArtifactType=" + heatArtifactType + ", heatEnvArtifactType=" + heatEnvArtifactType + ", heatArtifactDisplayName="
- + heatArtifactDisplayName + ", heatParameterDefinition=" + heatParameterDefinition + "]";
- }
-
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/LifeCycleStateEnum.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/LifeCycleStateEnum.java
deleted file mode 100644
index b45a3328b9..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/LifeCycleStateEnum.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-public enum LifeCycleStateEnum {
-
- CHECKOUT("IN DESIGN CHECK OUT"),
- CHECKIN("IN DESIGN CHECK IN"),
- READY_FOR_TESTING("READY FOR TESTING"),
- IN_TESTING("IN TESTING"),
- WAITING_FOR_DISTRIBUTION("WAITING FOR DISTRIBUTION"),
- DISTRIBUTION_REJECTED("DISTRIBUTION REJECTED"),
- DISTRIBUTION_APPROVED("DISTRIBUTION APPROVED"),
- CERTIFIED("CERTIFIED"),
- DISTRIBUTED("DISTRIBUTED"),
- IN_DESIGN("IN DESIGN");
-
- private String value;
- private String value2;
-
- public String getValue() {
- return value;
- }
-
- LifeCycleStateEnum(String value) {
- this.value = value;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/MenuOptionsEnum.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/MenuOptionsEnum.java
deleted file mode 100644
index f644db2c47..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/MenuOptionsEnum.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-public enum MenuOptionsEnum {
-
- EDIT("Edit"), CHECK_IN("Check in"), CHECK_OUT("Check out"), VIEW("View"), SUBMIT_FOR_TEST("Submit For Test"), ACCEPT("Accept"), REJECT("Reject"), START_TEST("Start test"), DISTREBUTE("Distribute");
-
- private String value;
-
- public String getValue() {
- return value;
- }
-
- MenuOptionsEnum(String value) {
- this.value = value;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PortMirrioringConfigurationObject.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PortMirrioringConfigurationObject.java
deleted file mode 100644
index 8475d0602b..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PortMirrioringConfigurationObject.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-import org.openecomp.sdc.be.model.Service;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class PortMirrioringConfigurationObject {
-
- private ServiceReqDetails serviceReqDetails;
- private String vmmeSourceName;
- private String vprobeSourceName;
- private CanvasManager canvasManager;
- private CanvasElement serviceElementVmmeSourceName;
- private CanvasElement serviceElementVprobeCollector;
- private CanvasElement portMirroringConfigurationElement;
- private Service service;
- private Service serviceContainerVmme_Source;
- private Service serviceContainerVprobe_Collector;
- private Map<String, String> capPropValues = new HashMap<>();
-
- public Map<String, String> getCapPropValues() {
- return capPropValues;
- }
-
- public void setCapPropValues(Map<String, String> capPropValues) {
- this.capPropValues = capPropValues;
- }
-
-
- public PortMirrioringConfigurationObject(ServiceReqDetails serviceReqDetails, String vmmeSourceName, String vprobeSourceName,
- CanvasManager canvasManager, CanvasElement serviceElementVmmeSourceName,
- CanvasElement serviceElementVprobeCollector, Service service, CanvasElement portMirroringConfigurationElement,
- Service serviceContainerVmme_Source, Service serviceContainerVprobe_Collector) {
- this.serviceReqDetails = serviceReqDetails;
- this.vmmeSourceName = vmmeSourceName;
- this.vprobeSourceName = vprobeSourceName;
- this.canvasManager = canvasManager;
- this.serviceElementVmmeSourceName = serviceElementVmmeSourceName;
- this.serviceElementVprobeCollector = serviceElementVprobeCollector;
- this.service = service;
- this.portMirroringConfigurationElement = portMirroringConfigurationElement;
- this.serviceContainerVmme_Source = serviceContainerVmme_Source;
- this.serviceContainerVprobe_Collector = serviceContainerVprobe_Collector;
- }
-
- public Service getServiceContainerVmme_Source() {
- return serviceContainerVmme_Source;
- }
-
- public Service getServiceContainerVprobe_Collector() {
- return serviceContainerVprobe_Collector;
- }
-
- public CanvasElement getPortMirroringConfigurationElement() {
- return portMirroringConfigurationElement;
- }
-
- public ServiceReqDetails getServiceReqDetails() {
- return serviceReqDetails;
- }
-
- public String getVmmeSourceName() {
- return vmmeSourceName;
- }
-
- public String getVprobeSourceName() {
- return vprobeSourceName;
- }
-
- public CanvasManager getCanvasManager() {
- return canvasManager;
- }
-
- public CanvasElement getServiceElementVmmeSourceName() {
- return serviceElementVmmeSourceName;
- }
-
- public CanvasElement getServiceElementVprobeCollector() {
- return serviceElementVprobeCollector;
- }
-
- public Service getService() {
- return service;
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PortMirroringEnum.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PortMirroringEnum.java
deleted file mode 100644
index 2c51c26d24..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PortMirroringEnum.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-public enum PortMirroringEnum {
-
- PMC_ELEMENT_IN_PALLETE("Port Mirroring Configuration"),
- PMCP_ELEMENT_IN_PALLETE("Port Mirroring Configuration By Policy"),
- PM_REQ_TYPE("org.openecomp.capabilities.PortMirroring"),
- PMC_SOURCE_CAP("Port Mirroring Configuration 0: source: [1, UNBOUNDED]"),
- PMC1_SOURCE_CAP("Port Mirroring Configuration 1: source: [1, UNBOUNDED]"),
- PMCP_SOURCE_CAP("Port Mirroring Configuration By Policy 0: source: [1, UNBOUNDED]"),
- PMCP1_SOURCE_CAP("Port Mirroring Configuration By Policy 1: source: [1, UNBOUNDED]"),
- PMC_COLLECTOR_CAP("Port Mirroring Configuration 0: collector: [1, 1]"),
- CISCO_VENDOR_NAME("CISCO"),
- CISCO_VENDOR_MODEL_NUMBER("4500x"),
- APCON1_VENDOR_NAME("APCON1"),
- APCON1_VENDOR_MODEL_NUMBER("Test_APCON1"),
- APCON2_VENDOR_NAME("APCON2"),
- APCON2_VENDOR_MODEL_NUMBER("Test_APCON2"),
- VMME_ZIP("2016-227_vmme_vmme_30_1610_e2e.zip"),
- VPROBE_ZIP("vProbe_2017-10-22_07-24.zip"),
- SERVICE_PROXY_TYPE("Service Proxy"),
- SERVICE_TYPE("transport"),
- TYPE("Resource"),
- RESOURCE_TYPE("Configuration"),
- CATEGORY("Configuration"),
- SUB_CATEGORY("Configuration"),
- NETWORK_ROLE_XPATH("//input[@name='network_role']"),
- NFC_TYPE_XPATH("//input[@name='nfc_type']"),
- PPS_CAPACITY_XPATH("//input[@name='pps_capacity']"),
- NF_TYPE_XPATH("//input[@name='nf_type']"),
- NETWORK_ROLE_VALUE("NETWORK ROLE TEXT"),
- NFC_TYPE_VALUE("NFC TYPE TEXT"),
- PPS_CAPACITY_VALUE("PPS CAPACITY TEXT"),
- NF_TYPE_VALUE("NF TYPE TEXT"),
- PMCP_NEWNAME("NewPMCP_Name");
-
-
- private String value;
-
- public String getValue() {
- return value;
- }
-
- PortMirroringEnum(String value) {
- this.value = value;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PropertyInfo.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PropertyInfo.java
deleted file mode 100644
index e78e09da79..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/PropertyInfo.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-import org.openecomp.sdc.ci.tests.datatypes.enums.PropertyTypeEnum;
-
-public class PropertyInfo {
-
- public PropertyInfo() {
- super();
- }
-
- public PropertyInfo(PropertyTypeEnum prop) {
- super();
- this.name = prop.getName();
- this.value = prop.getValue();
- this.type = prop.getType();
- this.description = prop.getDescription();
- }
-
- private String name;
- private String value;
- private String type;
- private String description;
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceCategoriesNameEnum.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceCategoriesNameEnum.java
deleted file mode 100644
index 465609c02b..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceCategoriesNameEnum.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-public enum ResourceCategoriesNameEnum {
-
- GENERIC("checkbox-resourcenewcategory.generic"), NETWORK_CONNECTIVITY("checkbox-resourcenewcategory.networkconnectivity"), NETWORK_ELEMENTS("checkbox-resourcenewcategory.generic.networkelements"),
- ABSTRACT("checkbox-resourcenewcategory.generic.abstract"), DATABASE_GENERIC("checkbox-resourcenewcategory.generic.database"), INFRASTRUCTURE("checkbox-resourcenewcategory.generic.infrastructure"),
- VIRTUAL_LINKS("checkbox-resourcenewcategory.networkconnectivity.virtuallinks"), CONNECTION_POINTS("checkbox-resourcenewcategory.networkconnectivity.connectionpoints"), NETWORKL4("checkbox-resourcenewcategory.networkl4+"),
- COMMON_NETWORK_RESOURCES("checkbox-resourcenewcategory.networkl4+.commonnetworkresources"), APPLICATIONL4("checkbox-resourcenewcategory.applicationl4+"), WEB_SERVER("checkbox-resourcenewcategory.applicationl4+.webserver"),
- APPLICATION_SERVER("checkbox-resourcenewcategory.applicationl4+.applicationserver"), CALL_CONTROL("checkbox-resourcenewcategory.applicationl4+.callcontrol"), BORDER_ELEMENT("checkbox-resourcenewcategory.applicationl4+.borderelement"),
- MEDIA_SERVERS("checkbox-resourcenewcategory.applicationl4+.mediaservers"), DATABASE("checkbox-resourcenewcategory.applicationl4+.database"), FIREWALL("checkbox-resourcenewcategory.applicationl4+.firewall"),
- LOAD_BALANCER("checkbox-resourcenewcategory.applicationl4+.loadbalancer"), NETWORK_L23("checkbox-resourcenewcategory.networkl2-3"), Router("checkbox-resourcenewcategory.networkl2-3.router"),
- WAN_Connectors("checkbox-resourcenewcategory.networkl2-3.wanconnectors"), LAN_CONNECTORS("checkbox-resourcenewcategory.networkl2-3.lanconnectors"), GATEWAY("checkbox-resourcenewcategory.networkl2-3.gateway"),
- INFRASTRUCTUREL23("checkbox-resourcenewcategory.networkl2-3.infrastructure");
-
- private String value;
-
- public String getValue() {
- return value;
- }
-
- ResourceCategoriesNameEnum(String value) {
- this.value = value;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceCategoriesNameEnum.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceCategoriesNameEnum.java
deleted file mode 100644
index 05de740013..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceCategoriesNameEnum.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-public enum ServiceCategoriesNameEnum {
-
- NETWORK_L13("checkbox-servicenewcategory.networkl1-3"), VOIPCALL_CONTROL("checkbox-servicenewcategory.voipcallcontrol"), NETWORKL4("checkbox-servicenewcategory.networkl4+"), MOBILITY("checkbox-servicenewcategory.mobility");
-
- private String value;
-
- public String getValue() {
- return value;
- }
-
- private ServiceCategoriesNameEnum(String value) {
- this.value = value;
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceContainer.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceContainer.java
deleted file mode 100644
index 8181ae90d2..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceContainer.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.model.Service;
-
-
-public class ServiceContainer {
- private Service service;
- private Resource resource;
- private VendorSoftwareProductObject vendorSoftwareProductObject;
- private VendorLicenseModel vendorLicenseModel;
-
- public ServiceContainer(Service service, Resource resource, VendorSoftwareProductObject vendorSoftwareProductObject, VendorLicenseModel vendorLicenseModel) {
- this.service = service;
- this.resource = resource;
- this.vendorSoftwareProductObject = vendorSoftwareProductObject;
- this.vendorLicenseModel = vendorLicenseModel;
- }
-
- public Service getService() {
- return service;
- }
-
- public void setService(Service service) {
- this.service = service;
- }
-
- public Resource getResource() {
- return resource;
- }
-
- public void setResource(Resource resource) {
- this.resource = resource;
- }
-
- public VendorSoftwareProductObject getVendorSoftwareProductObject() {
- return vendorSoftwareProductObject;
- }
-
- public void setVendorSoftwareProductObject(VendorSoftwareProductObject vendorSoftwareProductObject) {
- this.vendorSoftwareProductObject = vendorSoftwareProductObject;
- }
-
- public VendorLicenseModel getVendorLicenseModel() {
- return vendorLicenseModel;
- }
-
- public void setVendorLicenseModel(VendorLicenseModel vendorLicenseModel) {
- this.vendorLicenseModel = vendorLicenseModel;
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/TopMenuButtonsEnum.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/TopMenuButtonsEnum.java
deleted file mode 100644
index 4b6eec10b6..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/TopMenuButtonsEnum.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-public enum TopMenuButtonsEnum {
-
- HOME("main-menu-button-home"),
- CATALOG("main-menu-button-catalog"),
- ON_BOARDING("main-menu-button-onboard");
-
- private String value;
- private String value2;
-
- public String getButton() {
- return value;
- }
-
- TopMenuButtonsEnum(String value) {
- this.value = value;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/TypesEnum.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/TypesEnum.java
deleted file mode 100644
index a553538758..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/TypesEnum.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-public enum TypesEnum {
-
- RESOURCE("checkbox-resource"), VF("checkbox-vf"), VFC("checkbox-vfc"), PNF("checkbox-pnf"), CP("checkbox-cp"), VL("checkbox-vl"), SERVICE("checkbox-service"), PRODUCT("checkbox-product");
- private String value;
-
- public String getValue() {
- return value;
- }
-
- TypesEnum(String value) {
- this.value = value;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/UserCredentials.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/UserCredentials.java
deleted file mode 100644
index c5f4640b05..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/UserCredentials.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-import org.openecomp.sdc.be.model.User;
-
-public class UserCredentials extends User {
-
- private String password;
-
- public UserCredentials(String userId, String password, String firstname, String lastname, String role) {
- super();
- setUserId(userId);
- this.password = password;
- setFirstName(firstname);
- setLastName(lastname);
- setRole(role);
- }
-
- public UserCredentials() {
- super();
- }
-
- public String getPassword() {
- return password;
- }
-
- public void setPassword(String password) {
- this.password = password;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/UserManagementTab.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/UserManagementTab.java
deleted file mode 100644
index b7b235befd..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/UserManagementTab.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.pages.GeneralPageElements;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openqa.selenium.WebElement;
-
-import java.util.List;
-
-public class UserManagementTab {
-
- public void searchUser(String searchCriterion) {
- ExtentTestActions.log(Status.INFO, "Searching a user by the value : " + searchCriterion);
- WebElement searchBoxWebElement = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.UserManagementEnum.SEARCH_BOX.getValue());
- searchBoxWebElement.clear();
- searchBoxWebElement.sendKeys(searchCriterion);
- GeneralUIUtils.ultimateWait();
- }
-
- public void setNewUserBox(String user) {
- ExtentTestActions.log(Status.INFO, "Inserting userid " + user);
- WebElement createNewUserWebElement = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.UserManagementEnum.NEW_USER_FIELD.getValue());
- createNewUserWebElement.clear();
- createNewUserWebElement.sendKeys(user);
- GeneralUIUtils.ultimateWait();
- }
-
- public void selectUserRole(UserRoleEnum userRole) {
- String role = userRole.name().toLowerCase();
- ExtentTestActions.log(Status.INFO, "Selecting role " + userRole.name());
- GeneralUIUtils.getSelectList(role, DataTestIdEnum.UserManagementEnum.ROLE_SELECT.getValue());
- }
-
- public void updateUserRole(UserRoleEnum userRole, int rowIndx) {
- String role = userRole.name().toLowerCase();
- ExtentTestActions.log(Status.INFO, "Updating the user role to " + userRole.name());
- GeneralUIUtils.getSelectList(role, DataTestIdEnum.UserManagementEnum.UPDATE_ROLE.getValue() + rowIndx);
- }
-
- public void clickCreateButton() {
- ExtentTestActions.log(Status.INFO, "Clicking on 'Create' button.");
- GeneralUIUtils.ultimateWait();
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.UserManagementEnum.CREATE_BUTTON.getValue());
- }
-
- public WebElement getRow(int index) {
- return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.UserManagementEnum.ROW_TABLE.getValue() + index);
- }
-
- public WebElement getFirstName(int index) {
- return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.UserManagementEnum.FIRST_NAME.getValue() + index);
- }
-
- public WebElement getLastName(int index) {
- return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.UserManagementEnum.LAST_NAME.getValue() + index);
- }
-
- public WebElement getUserId(int index) {
- return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.UserManagementEnum.USER_ID.getValue() + index);
- }
-
- public WebElement getEmail(int index) {
- return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.UserManagementEnum.EMAIL.getValue() + index);
- }
-
- public WebElement getRole(int index) {
- return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.UserManagementEnum.ROLE.getValue() + index);
- }
-
- public WebElement getLastActive(int index) {
- return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.UserManagementEnum.LAST_ACTIVE.getValue() + index);
- }
-
- public void updateUser(int index) {
- GeneralUIUtils.ultimateWait();
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.UserManagementEnum.UPDATE_USER_BUTTON.getValue() + index);
- }
-
- public void deleteUser(int index) {
- ExtentTestActions.log(Status.INFO, "Deleting the user in row " + (index + 1));
- GeneralUIUtils.ultimateWait();
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.UserManagementEnum.DELETE_USER.getValue() + index);
- //GeneralUIUtils.ultimateWait();
- GeneralPageElements.clickOKButton();
- }
-
- public void saveAfterUpdateUser(int index) {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.UserManagementEnum.SAVE_USER.getValue() + index);
- }
-
- public List<WebElement> getAllRowsDisplayed() {
- return GeneralUIUtils.getWebElementsListByContainTestID(DataTestIdEnum.UserManagementEnum.ROW_TABLE.getValue());
- }
-
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/VFCArtifact.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/VFCArtifact.java
deleted file mode 100644
index 8039771a56..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/VFCArtifact.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-public class VFCArtifact {
-
- private String artifactUUID;
- private String artifactVersion;
- private String artifactname;
- private String artifacttype;
-
-
- public VFCArtifact(String artifactName, String artifactType, String uuid, String version) {
- artifactname = artifactName;
- artifactUUID = uuid;
- artifactVersion = version;
- artifacttype = artifactType;
- }
-
- public String getArtifactUUID() {
- return artifactUUID;
- }
-
- public void setArtifactUUID(String artifactUUID) {
- this.artifactUUID = artifactUUID;
- }
-
- public String getArtifactVersion() {
- return artifactVersion;
- }
-
- public void setArtifactVersion(String artifactVersion) {
- this.artifactVersion = artifactVersion;
- }
-
- public String getArtifactname() {
- return artifactname;
- }
-
- public void setArtifactname(String artifactname) {
- this.artifactname = artifactname;
- }
-
- public String getArtifacttype() {
- return artifacttype;
- }
-
- public void setArtifacttype(String artifacttype) {
- this.artifacttype = artifacttype;
- }
-
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/VendorSoftwareProductObject.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/VendorSoftwareProductObject.java
deleted file mode 100644
index 45a1fffdf5..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/VendorSoftwareProductObject.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.datatypes;
-
-public class VendorSoftwareProductObject extends VendorSoftwareProductObjectReqDetails {
-
- private String vspId;
- private String componentId;
- private String attContact;
- private String version;
-
- public VendorSoftwareProductObject() {
- super();
- }
-
- public VendorSoftwareProductObject(String vspId, String componentId, String attContact, String version) {
- this.vspId = vspId;
- this.componentId = componentId;
- this.attContact = attContact;
- this.version = version;
- }
-
- public VendorSoftwareProductObject(String name, String description, String category, String subCategory, String vendorId, String vendorName, String licensingVersion, LicensingData licensingData, String onboardingMethod, String networkPackageName, String onboardingOrigin, String icon, String vspId, String componentId, String attContact, String version) {
- super(name, description, category, subCategory, vendorId, vendorName, licensingVersion, licensingData, onboardingMethod, networkPackageName, onboardingOrigin, icon);
- this.vspId = vspId;
- this.componentId = componentId;
- this.attContact = attContact;
- this.version = version;
- }
-
- public String getVspId() {
- return vspId;
- }
-
- public void setVspId(String vspId) {
- this.vspId = vspId;
- }
-
- public String getComponentId() {
- return componentId;
- }
-
- public void setComponentId(String componentId) {
- this.componentId = componentId;
- }
-
- public String getAttContact() {
- return attContact;
- }
-
- public void setAttContact(String attContact) {
- this.attContact = attContact;
- }
-
- public String getVersion() {
- return version;
- }
-
- public void setVersion(String version) {
- this.version = version;
- }
-
- @Override
- public String toString() {
- return "VendorSoftwareProductObject{"
- + "vspId='" + vspId + '\''
- + ", componentId='" + componentId + '\''
- + ", attContact='" + attContact + '\''
- + ", version='" + version + '\''
- + '}';
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/exception/GeneralUiRuntimeException.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/exception/GeneralUiRuntimeException.java
deleted file mode 100644
index 81b8500f53..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/exception/GeneralUiRuntimeException.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.exception;
-
-@SuppressWarnings("serial")
-public class GeneralUiRuntimeException extends RuntimeException {
-
- public GeneralUiRuntimeException(final String s, final Throwable throwable) {
- super(s, throwable);
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/exception/HomePageRuntimeException.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/exception/HomePageRuntimeException.java
deleted file mode 100644
index bcb201374e..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/exception/HomePageRuntimeException.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.exception;
-
-@SuppressWarnings("serial")
-public class HomePageRuntimeException extends RuntimeException {
-
- public HomePageRuntimeException(final String s, final Throwable throwable) {
- super(s, throwable);
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/exception/PropertiesAssignmentPageException.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/exception/PropertiesAssignmentPageException.java
deleted file mode 100644
index f2a7990326..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/exception/PropertiesAssignmentPageException.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.exception;
-
-@SuppressWarnings("serial")
-public class PropertiesAssignmentPageException extends Exception {
-
- public PropertiesAssignmentPageException(final String s, final Throwable throwable) {
- super(s, throwable);
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/exception/WebDriverThreadRuntimeException.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/exception/WebDriverThreadRuntimeException.java
deleted file mode 100644
index 8cf55f7d15..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/exception/WebDriverThreadRuntimeException.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.exception;
-
-@SuppressWarnings("serial")
-public class WebDriverThreadRuntimeException extends RuntimeException {
-
- public WebDriverThreadRuntimeException(final String s, final Throwable throwable) {
- super(s, throwable);
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/CreatePath.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/CreatePath.java
deleted file mode 100644
index 485b069f15..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/CreatePath.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.AmdocsComplexService;
-
-import com.aventstack.extentreports.Status;
-import com.clearspring.analytics.util.Pair;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
-import org.openecomp.sdc.ci.tests.datatypes.enums.CircleSize;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.CompositionPage;
-import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.GovernorOperationPage;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.pages.ServiceGeneralPage;
-import org.openecomp.sdc.ci.tests.pages.TesterOperationPage;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.OnboardingUiUtils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Optional;
-import org.testng.annotations.Parameters;
-import org.testng.annotations.Test;
-
-import java.util.ArrayList;
-import java.util.List;
-
-
-public class CreatePath extends SetupCDTest {
-
- protected static String filePath = FileHandling.getFilePath("ComplexService");
- private static String fullCompositionFile = "fullComposition.zip";
- private static String fullCompositionFile2 = "fullCompositionNew.zip";
- private static String HSSFile = "HSS.zip";
- private static String VMMEFile = "VMME.zip";
- private static String makeDistributionValue;
-
- @Parameters({"makeDistribution"})
- @BeforeMethod
- public void beforeTestReadParams(@Optional("true") String makeDistributionReadValue) {
- makeDistributionValue = makeDistributionReadValue;
- }
-
- //------------------------------------------Tests-----------------------------------------------------
-
-
- // Test#1 Jira issue 5610
- @Test
- public void AssertPathButtons() throws Exception {
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- getToPathFlow(resourceReqDetails, filePath, fullCompositionFile);
- reloginWithNewRole(UserRoleEnum.DESIGNER);
- PathUtilities.createService(getUser());
- PathUtilities.openCreatePath();
- PathValidations.AssertCreatePath();
- PathValidations.AssertExtendPath();
- }
-
- // Test#2 Jira issue 5441
- @Test
- public void CreatePathTestSanity() throws Exception {
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- Pair<String, ServiceReqDetails> pair = getToPathFlow(resourceReqDetails, filePath, fullCompositionFile);
- String vspName = pair.left;
- String serviceName = pair.right.getName();
- String pathName = "Test1";
- PathUtilities.createPath(pathName, vspName);
- PathValidations.validateServicePath(serviceName, pathName);
- }
-
- // Test#3 Jira issue 5611
- @Test
- public void CreatePathCheckIO() throws Exception {
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- String vspName = onboardAndCertify(resourceReqDetails, filePath, fullCompositionFile);
- reloginWithNewRole(UserRoleEnum.DESIGNER);
- String serviceName = PathUtilities.createService(getUser()).getName();
- String pathName = PathUtilities.createPath("Test3", vspName);
-
- // @@ check in @@
- ResourceGeneralPage.clickCheckinButton(serviceName);
- GeneralUIUtils.findComponentAndClick(serviceName);
- ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
- PathValidations.AssertCreatedPathExistInCompositionPage(pathName);
-
- // @@ check out @@
- ResourceGeneralPage.clickCheckoutButton();
- PathValidations.AssertCreatedPathExistInCompositionPage(pathName);
- }
-
- // Test#4 Jira issue 5441
- @Test
- public void CreateMultiplePaths() throws Exception {
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- Pair<String, ServiceReqDetails> pair = getToPathFlow(resourceReqDetails, filePath, HSSFile);
- String vspName = pair.left;
- PathUtilities.createPath("Test4_path1", vspName);
- PathUtilities.createPath("Test4_path2", vspName);
- PathValidations.createPathNumOfRows(7);
- PathValidations.createPathNumOfRows(6);
- SetupCDTest.getExtendTest().log(Status.INFO, "multiple paths have been created");
- }
-
- // Test#5 Jira issue 5506
- @Test
- public void CreatePathWithComplex() throws Exception {
- List<String> vnfFiles = new ArrayList<>();
- vnfFiles.add(HSSFile);
- vnfFiles.add(VMMEFile);
- Pair<String, String> complex = CreatePathComplexServiceFlow(filePath, vnfFiles);
- String serviceName = complex.left;
- String pathName = complex.right;
- PathValidations.validateServicePath(serviceName, pathName);
- SetupCDTest.getExtendTest().log(Status.INFO, "path with complex service has been created");
- }
-
- // Test#6 Jira issue 5506
- @Test
- public void CreateExtendedPathWithComplex() throws Exception {
- List<String> vnfFiles = new ArrayList<>();
- vnfFiles.add(fullCompositionFile);
- vnfFiles.add(fullCompositionFile2);
- String[] services = getToComplexService(filePath, vnfFiles);
- PathValidations.validateComplexExtendedPath(services);
- SetupCDTest.getExtendTest().log(Status.INFO, "path with complex service has been created");
- }
-
- // Test#7 Jira issue 5441
- @Test
- public void CreatePathExtendedTest() throws Exception {
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- runCreateExtendedPathFlow(resourceReqDetails, filePath, fullCompositionFile);
- }
-
- ////////////////////////////////////////////////////////////////////////////////////////
- // flow methods //
- ////////////////////////////////////////////////////////////////////////////////////////
-
- // workflow leading to path
- public String onboardAndCertify(ResourceReqDetails resourceReqDetails, String filePath, String vnfFile) throws Exception {
- VendorSoftwareProductObject vendorSoftwareProductObject = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, filePath, vnfFile, getUser());
- String vspName = vendorSoftwareProductObject.getName();
-
- DeploymentArtifactPage.getLeftPanel().moveToCompositionScreen();
- ExtentTestActions.addScreenshot(Status.INFO, "TopologyTemplate_" + vnfFile, "The topology template for " + vnfFile + " is as follows : ");
-
- DeploymentArtifactPage.clickSubmitForTestingButton(vspName);
- SetupCDTest.getExtendTest().log(Status.INFO, "relogin as TESTER");
- reloginWithNewRole(UserRoleEnum.TESTER);
- GeneralUIUtils.findComponentAndClick(vspName);
- TesterOperationPage.certifyComponent(vspName);
- return vspName;
- }
-
- public List<String> onboardAndCertifyMultipleVFs(String filePath, List<String> vnfFiles) throws Exception {
- List<String> VFNames = new ArrayList<>();
- for (int i = 0; i < vnfFiles.size(); i++) {
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- VendorSoftwareProductObject vendorSoftwareProductObject = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, filePath, vnfFiles.get(i), getUser());
- VFNames.add(i, vendorSoftwareProductObject.getName());
- DeploymentArtifactPage.getLeftPanel().moveToCompositionScreen();
- ExtentTestActions.addScreenshot(Status.INFO, "TopologyTemplate_" + vnfFiles.get(i), "The topology template for " + vnfFiles.get(i) + " is as follows : ");
- DeploymentArtifactPage.clickSubmitForTestingButton(VFNames.get(i));
- }
- SetupCDTest.getExtendTest().log(Status.INFO, "relogin as TESTER");
- reloginWithNewRole(UserRoleEnum.TESTER);
- for (String VFName : VFNames) {
- GeneralUIUtils.findComponentAndClick(VFName);
- TesterOperationPage.certifyComponent(VFName);
- }
- return VFNames;
- }
-
- public Pair<String, ServiceReqDetails> getToPathFlow(ResourceReqDetails resourceReqDetails, String filepath, String vnfFile) throws Exception {
- String vspName = onboardAndCertify(resourceReqDetails, filepath, vnfFile);
- reloginWithNewRole(UserRoleEnum.DESIGNER);
- ServiceReqDetails serviceMetadata = PathUtilities.createService(getUser());
- return new Pair<>(vspName, serviceMetadata);
- }
-
- public String[] getToComplexService(String filepath, List<String> vnfFiles) throws Exception {
- // create & certify 2 VF
- List<String> VFNames = onboardAndCertifyMultipleVFs(filepath, vnfFiles);
- reloginWithNewRole(UserRoleEnum.DESIGNER);
- ServiceReqDetails serviceMetadata1 = PathUtilities.createService(getUser());
-
- // create path 1
- PathUtilities.createPath("newPath", VFNames.get(0));
- PathUtilities.submitForTesting();
- GeneralUIUtils.ultimateWait();
- ServiceReqDetails serviceMetadata2 = PathUtilities.createService(getUser());
-
- // create path 2
- PathUtilities.createPath("newPath2", VFNames.get(1));
- PathUtilities.submitForTesting();
-
- //tester
- reloginWithNewRole(UserRoleEnum.TESTER);
- GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
- TesterOperationPage.certifyComponent(serviceMetadata1.getName());
- GeneralUIUtils.findComponentAndClick(serviceMetadata2.getName());
- TesterOperationPage.certifyComponent(serviceMetadata2.getName());
-
- //governor
- reloginWithNewRole(UserRoleEnum.GOVERNOR);
- GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
- GovernorOperationPage.approveService(serviceMetadata1.getName());
- GeneralUIUtils.findComponentAndClick(serviceMetadata2.getName());
- GovernorOperationPage.approveService(serviceMetadata2.getName());
-
- //create service for complex service
- reloginWithNewRole(UserRoleEnum.DESIGNER);
- ServiceReqDetails serviceMetadata3 = PathUtilities.createService(getUser());
- return new String[]{serviceMetadata1.getName(), serviceMetadata2.getName(), serviceMetadata3.getName()};
- }
-
- public Pair<String, String> CreatePathComplexServiceFlow(String filepath, List<String> vnfFiles) throws Exception {
- String[] servicesName = getToComplexService(filepath, vnfFiles);
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
- CompositionPage.searchForElement(servicesName[0]);
- CanvasElement service1 = canvasManager.createElementOnCanvas(servicesName[0]);
- CompositionPage.searchForElement(servicesName[1]);
- CanvasElement service2 = canvasManager.createElementOnCanvas(servicesName[1]);
- canvasManager.linkElements(service1, CircleSize.SERVICE, service2, CircleSize.SERVICE);
-
- // create path
- String pathName = "name1";
- PathUtilities.openCreatePath();
- PathUtilities.insertValues(pathName, "pathProtocol1", "pathPortNumbers1");
- PathUtilities.selectFirstLineParam();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue()).click();
- return new Pair<>(servicesName[2], pathName);
- }
-
- public void runCreateExtendedPathFlow(ResourceReqDetails resourceReqDetails, String filepath, String vnfFile) throws Exception {
- Pair<String, ServiceReqDetails> pair = getToPathFlow(resourceReqDetails, filepath, vnfFile);
- String vspName = pair.left;
- PathUtilities.linkVFs(vspName, 4);
-
- //create path
- PathUtilities.openCreatePath();
- String pathName = "name1";
- PathUtilities.insertValues(pathName, "pathProtocol1", "pathPortNumbers1");
- PathUtilities.selectFirstLineParam();
- int numOfLines = 3;
- PathValidations.extendPath(numOfLines);
-
- //delete line
- PathUtilities.deleteLines(1, numOfLines);
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
- ExtentTestActions.log(Status.INFO, "path has been created");
-
- // check path is on the list
- PathUtilities.openPathList();
- String PathListName1 = GeneralUIUtils.findByText(pathName).getText();
- String newPathName = "name2";
- PathUtilities.editPathName(pathName, newPathName);
- GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.PATH_MENU_BUTTON.getValue() + "']/parent::*").get(0).click();
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.PATH_LIST_BUTTON.getValue());
- String PathListName2 = GeneralUIUtils.findByText(newPathName).getText();
- PathValidations.AssertNameChangeFromPathList(PathListName1, PathListName2);
-
- // delete path and validate
- PathValidations.ValidateAndDeletePathFromPathList(newPathName);
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.PropertiesAssignmentScreen.INPUT_DELETE_DIALOG_CLOSE.getValue());
- SetupCDTest.getExtendTest().log(Status.INFO, "Path has been created");
- }
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/ElementsChanges.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/ElementsChanges.java
deleted file mode 100644
index 67d3f3df56..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/ElementsChanges.java
+++ /dev/null
@@ -1,735 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.AmdocsComplexService;
-
-import com.aventstack.extentreports.Status;
-import com.clearspring.analytics.util.Pair;
-import org.apache.http.HttpStatus;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.CompositionPage;
-import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.GovernorOperationPage;
-import org.openecomp.sdc.ci.tests.pages.HomePage;
-import org.openecomp.sdc.ci.tests.pages.ServiceGeneralPage;
-import org.openecomp.sdc.ci.tests.pages.TesterOperationPage;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.OnboardingUiUtils;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.general.VendorSoftwareProductRestUtils;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Optional;
-import org.testng.annotations.Parameters;
-import org.testng.annotations.Test;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertNotSame;
-
-
-public class
-ElementsChanges extends SetupCDTest {
-
- private static final int NUMBER_OF_LINKS = 3;
- protected static String filePath = FileHandling.getFilePath("ComplexService");
- private static String fullCompositionFile = "fullComposition.zip";
- private static String test = "test.zip";
- private static String fullCompositionFile2 = "test.zip";
- private static String HSSFile = "HSS.zip";
- private static String VMMEFile = "VMME.zip";
- private static String WithPort = "withPort.zip";
- private static String withoutPort = "withoutPort.zip";
- private static String makeDistributionValue;
-
- @Parameters({"makeDistribution"})
- @BeforeMethod
- public void beforeTestReadParams(@Optional("true") String makeDistributionReadValue) {
- makeDistributionValue = makeDistributionReadValue;
- }
-
- //------------------------------------------Tests-----------------------------------------------------
-
- // Test#1 Jira issue 6324
- @Test
- public void DeleteComponent() throws Exception {
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- String vspName = onboardAndCertify(resourceReqDetails, filePath, fullCompositionFile);
- reloginWithNewRole(UserRoleEnum.DESIGNER);
- ServiceReqDetails serviceMetadata = PathUtilities.createService(getUser());
- List<CanvasElement> VFs = PathUtilities.linkVFs(vspName, NUMBER_OF_LINKS);
- String pathName = PathUtilities.createPathWithoutLink("DeleteComponent", vspName);
- PathUtilities.deleteComponents(VFs);
- PathValidations.validatePathListIsEmpty();
- certifyServiceAsTester(serviceMetadata);
-
- }
-
- // Test#2 Jira issue 6325
- @Test
- public void DeleteServiceComponent() throws Exception {
- ServiceReqDetails serviceMetadata = getToComplexService(filePath, fullCompositionFile);
- reloginWithNewRole(UserRoleEnum.DESIGNER);
- ServiceReqDetails complexService = PathUtilities.createService(getUser());
- List<CanvasElement> services = createComplexPath(serviceMetadata.getName());
- PathUtilities.deleteComponents(services);
- PathValidations.validatePathListIsEmpty();
- certifyServiceAsTester(complexService);
- }
-
- // Test#3 Jira issue 6364
- @Test
- public void ManualUpdateVF() throws Exception {
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- String vspName = onboardAndCertify(resourceReqDetails, filePath, fullCompositionFile);
- reloginWithNewRole(UserRoleEnum.DESIGNER);
- ServiceReqDetails serviceMetadata = PathUtilities.createService(getUser());
- PathUtilities.createPath("ManualUpdateVF", vspName);
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.HOME_FROM_COMPOSITION.getValue());
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.MainMenuButtons.ONBOARD_BUTTON.getValue());
- /// GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.ONBOARD_CATALOG.getValue());
- ResourceUIUtils.clickOnElementByText(vspName, null);
- ResourceUIUtils.clickOnElementByText("Create New Version", null);
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ComplexServiceAmdocs.NEW_VSP_VERSION_DESCRIPTION.getValue()).sendKeys("new vsap version for service path");
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.SUBMIT_NEW_VSP_VERSION_DESCRIPTION.getValue());
-
- // VendorSoftwareProductObject v = new VendorSoftwareProductObject();
- //VendorSoftwareProductRestUtils.uploadHeatPackage(filePath,fullCompositionFile,v,getUser());
-//upload new heat +commit submit
- //go to home
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.MainMenuButtons.ONBOARD_BUTTON.getValue());
-
- GeneralUIUtils.findComponentAndClick(serviceMetadata.getName());
- ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
- // CanvasManager.getCanvasManager().clickOnCanvaElement(vf);
- //update version
- //validate path still exist
- certifyServiceAsTester(serviceMetadata);
- }
-
- @Test
- public void UpdateComponent() throws Exception {
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- String vspName = onboardAndCertify(resourceReqDetails, filePath, VMMEFile);
-
- }
-
- @Test
- public void UpdateComponentWithouForwarder() throws Exception {
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- String vsp_v2_description = "change description for version 2";
- VendorSoftwareProductObject vendorSoftwareProductObject = getToPathServiceVersions(resourceReqDetails, filePath, WithPort, vsp_v2_description, withoutPort, getUser());
-
- // create service
- ServiceReqDetails service = PathUtilities.createService(getUser());
-
- // create path
- String vspName = vendorSoftwareProductObject.getName();
- String pathName = "path1";
- List<CanvasElement> VFs = PathUtilities.linkVFs(vspName, 2);
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
- for (CanvasElement element : VFs) {
- CompositionPage.changeComponentVersion(canvasManager, element, "1.0", false);
- }
- PathUtilities.openCreatePath();
- PathUtilities.insertValues(pathName, "pathProtocol1", "pathPortNumbers1");
- PathUtilities.selectFirstLineParam();
- PathValidations.extendPath(NUMBER_OF_LINKS);
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
-
- /////////////////
- // test case //
- /////////////////
-
- // validate version change has no effect
- for (CanvasElement element : VFs) {
- RestResponse ServiceForwardingPathsResponse = PathUtilities.getServiceForwardingPathsAPI(service.getName());
- // change to version with different capabiliteis
- CompositionPage.changeComponentVersion(canvasManager, element, "3.0", false);
- // click on warning message
- GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.OK.getValue() + "']").get(0).click();
- GeneralUIUtils.ultimateWait();
- // validate paths changed
- RestResponse ServiceForwardingPathsResponse2 = PathUtilities.getServiceForwardingPathsAPI(service.getName());
- assertNotSame(
- "response message failed expectation, expectation is to change",
- ServiceForwardingPathsResponse.getResponse(),
- ServiceForwardingPathsResponse2.getResponse());
- // validate there are no error messages
- PathValidations.ValidateThereIsNoErrorMessage();
-
- CompositionPage.changeComponentVersion(canvasManager, element, "1.0", false);
- GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.OK.getValue() + "']").get(0).click();
- GeneralUIUtils.ultimateWait();
- // validate paths hasn't changed
- RestResponse ServiceForwardingPathsResponse3 = PathUtilities.getServiceForwardingPathsAPI(service.getName());
- assertEquals(
- "response message failed expectation, expectation is not to change",
- ServiceForwardingPathsResponse2.getResponse(),
- ServiceForwardingPathsResponse3.getResponse());
- // validate there are no error messages
- PathValidations.ValidateThereIsNoErrorMessage();
- }
-
- ///////////////////////
- // post requisites //
- ///////////////////////
-
- // finish flow
- certifyServiceAsTester(service);
- }
-
- //TODO run and debug
-// Test#3 Jira issue - 6230
- @Test
- public void ValidatePathServiceVersions() throws Exception {
-
- //////////////////////
- // pre requisites //
- //////////////////////
-
- // start flow
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- String vsp_v2_description = "change description for version 2";
- VendorSoftwareProductObject vendorSoftwareProductObject = getToPathServiceVersions(resourceReqDetails, filePath, HSSFile, vsp_v2_description, fullCompositionFile, getUser());
-
- // create service
- ServiceReqDetails service = PathUtilities.createService(getUser());
-
- // create path
- String vspName = vendorSoftwareProductObject.getName();
- String pathName = "path1";
- List<CanvasElement> VFs = PathUtilities.linkVFs(vspName, 2);
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
- for (CanvasElement element : VFs) {
- CompositionPage.changeComponentVersion(canvasManager, element, "1.0", false);
- }
- PathUtilities.openCreatePath();
- PathUtilities.insertValues(pathName, "pathProtocol1", "pathPortNumbers1");
- PathUtilities.selectFirstLineParam();
- PathValidations.extendPath(NUMBER_OF_LINKS);
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
-
- /////////////////
- // test case //
- /////////////////
-
- // validate version change has no effect
- for (CanvasElement element : VFs) {
- RestResponse ServiceForwardingPathsResponse = PathUtilities.getServiceForwardingPathsAPI(service.getName());
-
- CompositionPage.changeComponentVersion(canvasManager, element, "2.0", false);
- // validate paths hasn't changed
- RestResponse ServiceForwardingPathsResponse2 = PathUtilities.getServiceForwardingPathsAPI(service.getName());
- assertEquals(
- "response message failed expectation, expectation is not to change",
- ServiceForwardingPathsResponse.getResponse(),
- ServiceForwardingPathsResponse2.getResponse());
- // validate there are no error messages
- PathValidations.ValidateThereIsNoErrorMessage();
-
- CompositionPage.changeComponentVersion(canvasManager, element, "1.0", false);
- // validate paths hasn't changed
- RestResponse ServiceForwardingPathsResponse3 = PathUtilities.getServiceForwardingPathsAPI(service.getName());
- assertEquals(
- "response message failed expectation, expectation is not to change",
- ServiceForwardingPathsResponse.getResponse(),
- ServiceForwardingPathsResponse3.getResponse());
- // validate there are no error messages
- PathValidations.ValidateThereIsNoErrorMessage();
- }
-
- ///////////////////////
- // post requisites //
- ///////////////////////
-
- // finish flow
- certifyServiceAsTester(service);
- }
-
- //TODO run and debug
-// Test#3 Jira issue - 6189
- @Test
- public void ValidatePathServiceVersionsDifferentCapabilities() throws Exception {
-
- //////////////////////
- // pre requisites //
- //////////////////////
-
- // start flow
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- String vsp_v2_description = "change description for version 2";
- VendorSoftwareProductObject vendorSoftwareProductObject = getToPathServiceVersions(resourceReqDetails, filePath, HSSFile, vsp_v2_description, fullCompositionFile, getUser());
-
- // create service
- ServiceReqDetails service = PathUtilities.createService(getUser());
-
- // create path
- String vspName = vendorSoftwareProductObject.getName();
- String pathName = "path1";
- List<CanvasElement> VFs = PathUtilities.linkVFs(vspName, 2);
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
- for (CanvasElement element : VFs) {
- CompositionPage.changeComponentVersion(canvasManager, element, "1.0", false);
- }
- PathUtilities.openCreatePath();
- PathUtilities.insertValues(pathName, "pathProtocol1", "pathPortNumbers1");
- PathUtilities.selectFirstLineParam();
- PathValidations.extendPath(NUMBER_OF_LINKS);
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
-
- /////////////////
- // test case //
- /////////////////
-
- // validate version change has no effect
- for (CanvasElement element : VFs) {
- RestResponse ServiceForwardingPathsResponse = PathUtilities.getServiceForwardingPathsAPI(service.getName());
- // change to version with different capabiliteis
- CompositionPage.changeComponentVersion(canvasManager, element, "3.0", false);
- // click on warning message
- GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.OK.getValue() + "']").get(0).click();
- GeneralUIUtils.ultimateWait();
- // validate paths changed
- RestResponse ServiceForwardingPathsResponse2 = PathUtilities.getServiceForwardingPathsAPI(service.getName());
- assertNotSame(
- "response message failed expectation, expectation is to change",
- ServiceForwardingPathsResponse.getResponse(),
- ServiceForwardingPathsResponse2.getResponse());
- // validate there are no error messages
- PathValidations.ValidateThereIsNoErrorMessage();
-
- CompositionPage.changeComponentVersion(canvasManager, element, "1.0", false);
- GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.OK.getValue() + "']").get(0).click();
- GeneralUIUtils.ultimateWait();
- // validate paths hasn't changed
- RestResponse ServiceForwardingPathsResponse3 = PathUtilities.getServiceForwardingPathsAPI(service.getName());
- assertEquals(
- "response message failed expectation, expectation is not to change",
- ServiceForwardingPathsResponse2.getResponse(),
- ServiceForwardingPathsResponse3.getResponse());
- // validate there are no error messages
- PathValidations.ValidateThereIsNoErrorMessage();
- }
-
- ///////////////////////
- // post requisites //
- ///////////////////////
-
- // finish flow
- certifyServiceAsTester(service);
- }
-
- //TODO run and debug
-// Test#3 Jira issue - 6231
- @Test
- public void ValidatePathServiceVersionsnegative() throws Exception {
-
- //////////////////////
- // pre requisites //
- //////////////////////
-
- // start flow
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- String vsp_v2_description = "change description for version 2";
- VendorSoftwareProductObject vendorSoftwareProductObject = getToPathServiceVersions(resourceReqDetails, filePath, HSSFile, vsp_v2_description, fullCompositionFile, getUser());
-
- // create service
- ServiceReqDetails service = PathUtilities.createService(getUser());
-
- // create path
- String vspName = vendorSoftwareProductObject.getName();
- String pathName = "path1";
- List<CanvasElement> VFs = PathUtilities.linkVFs(vspName, 2);
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
- for (CanvasElement element : VFs) {
- CompositionPage.changeComponentVersion(canvasManager, element, "1.0", false);
- }
- PathUtilities.openCreatePath();
- PathUtilities.insertValues(pathName, "pathProtocol1", "pathPortNumbers1");
- PathUtilities.selectFirstLineParam();
- PathValidations.extendPath(NUMBER_OF_LINKS);
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
-
- /////////////////
- // test case //
- /////////////////
-
- // validate version change has no effect
- for (CanvasElement element : VFs) {
- RestResponse ServiceForwardingPathsResponse = PathUtilities.getServiceForwardingPathsAPI(service.getName());
- // change to version with different capabiliteis
- CompositionPage.changeComponentVersion(canvasManager, element, "3.0", false);
- // click on warning message to cancel
- GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ModalItems.CANCEL.getValue() + "']").get(0).click();
- GeneralUIUtils.ultimateWait();
- // validate paths changed
- RestResponse ServiceForwardingPathsResponse2 = PathUtilities.getServiceForwardingPathsAPI(service.getName());
- assertEquals(
- "response message failed expectation, expectation is not to change",
- ServiceForwardingPathsResponse.getResponse(),
- ServiceForwardingPathsResponse2.getResponse());
- // validate there are no error messages
- PathValidations.ValidateThereIsNoErrorMessage();
-
- CompositionPage.changeComponentVersion(canvasManager, element, "3.0", true);
- // click on warning message
- GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.OK.getValue() + "']").get(0).click();
- GeneralUIUtils.ultimateWait();
- // validate paths hasn't changed
- RestResponse ServiceForwardingPathsResponse3 = PathUtilities.getServiceForwardingPathsAPI(service.getName());
- assertNotSame(
- "response message failed expectation, expectation is to change",
- ServiceForwardingPathsResponse2.getResponse(),
- ServiceForwardingPathsResponse3.getResponse());
- // validate there are no error messages
- PathValidations.ValidateThereIsNoErrorMessage();
- }
-
- ///////////////////////
- // post requisites //
- ///////////////////////
-
- // finish flow
- certifyServiceAsTester(service);
- }
-
- //TODO finish
-// Test#3 Jira issue - 6189
- @Test
- public void ValidatePathServiceVersionsDifferentCapabilitiesInComplexService() throws Exception {
-
- //////////////////////
- // pre requisites //
- //////////////////////
-
- // start flow
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- String vsp_v2_description = "change description for version 2";
- VendorSoftwareProductObject vendorSoftwareProductObject = getToPathServiceVersions(resourceReqDetails, filePath, HSSFile, vsp_v2_description, fullCompositionFile, getUser());
-
- // create service
- ServiceReqDetails service = PathUtilities.createService(getUser());
-
- // create path
- String vspName = vendorSoftwareProductObject.getName();
- String pathName = "path1";
- List<CanvasElement> VFs = PathUtilities.linkVFs(vspName, 2);
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
- for (CanvasElement element : VFs) {
- CompositionPage.changeComponentVersion(canvasManager, element, "1.0", false);
- }
- PathUtilities.openCreatePath();
- PathUtilities.insertValues(pathName, "pathProtocol1", "pathPortNumbers1");
- PathUtilities.selectFirstLineParam();
- PathValidations.extendPath(NUMBER_OF_LINKS);
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
-
- // certify Service
- certifyServiceAsTester(service);
-
- reloginWithNewRole(UserRoleEnum.DESIGNER);
-
- // create new version
- GeneralUIUtils.findComponentAndClick(service.getName());
- ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
- canvasManager = CanvasManager.getCanvasManager();
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.LifeCyleChangeButtons.CHECKOUT.getValue());
-
- /////////////////
- // test case //
- /////////////////
-
- // validate version change has no effect
- for (CanvasElement element : VFs) {
- RestResponse ServiceForwardingPathsResponse = PathUtilities.getServiceForwardingPathsAPI(service.getName());
- // change to version with different capabilities
- CompositionPage.changeComponentVersion(canvasManager, element, "3.0", false);
- // click on warning message
- GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.OK.getValue() + "']").get(0).click();
- GeneralUIUtils.ultimateWait();
- // validate paths changed
- RestResponse ServiceForwardingPathsResponse2 = PathUtilities.getServiceForwardingPathsAPI(service.getName());
- assertNotSame(
- "response message failed expectation, expectation is to change",
- ServiceForwardingPathsResponse.getResponse(),
- ServiceForwardingPathsResponse2.getResponse());
- // validate there are no error messages
- PathValidations.ValidateThereIsNoErrorMessage();
-
- CompositionPage.changeComponentVersion(canvasManager, element, "1.0", false);
- GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.OK.getValue() + "']").get(0).click();
- GeneralUIUtils.ultimateWait();
- // validate paths hasn't changed
- RestResponse ServiceForwardingPathsResponse3 = PathUtilities.getServiceForwardingPathsAPI(service.getName());
- assertEquals(
- "response message failed expectation, expectation is not to change",
- ServiceForwardingPathsResponse2.getResponse(),
- ServiceForwardingPathsResponse3.getResponse());
- // validate there are no error messages
- PathValidations.ValidateThereIsNoErrorMessage();
- }
-
- ///////////////////////
- // post requisites //
- ///////////////////////
-
- // finish flow
- certifyServiceAsTester(service);
- }
-
- @Test
- public void ComplexServiceSanity() throws Exception {
- // create & certify 2 VFs
- List<String> vnfFiles = new ArrayList<>();
- vnfFiles.add(HSSFile);
- vnfFiles.add(fullCompositionFile);
- List<String> VFNames = onboardAndCertifyMultipleVFs(filePath, vnfFiles);
- reloginWithNewRole(UserRoleEnum.DESIGNER);
-
- // create service 1
- ServiceReqDetails serviceMetadata1 = PathUtilities.createService(getUser());
-
- // create path 1
- String path1 = "newPath";
- PathUtilities.createPath(path1, VFNames.get(0));
- PathUtilities.submitForTesting();
- GeneralUIUtils.ultimateWait();
-
- // create service 2
- ServiceReqDetails serviceMetadata2 = PathUtilities.createService(getUser());
-
- // create path 2
- String path2 = "newPath2";
- PathUtilities.createPath(path2, VFNames.get(1));
- PathUtilities.submitForTesting();
-
- // tester
- reloginWithNewRole(UserRoleEnum.TESTER);
- GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
- TesterOperationPage.certifyComponent(serviceMetadata1.getName());
- GeneralUIUtils.findComponentAndClick(serviceMetadata2.getName());
- TesterOperationPage.certifyComponent(serviceMetadata2.getName());
-
- // governor
- reloginWithNewRole(UserRoleEnum.GOVERNOR);
- GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
- GovernorOperationPage.approveService(serviceMetadata1.getName());
- GeneralUIUtils.findComponentAndClick(serviceMetadata2.getName());
- GovernorOperationPage.approveService(serviceMetadata2.getName());
-
- // create service for complex service
- reloginWithNewRole(UserRoleEnum.DESIGNER);
- ServiceReqDetails serviceMetadata3 = PathUtilities.createService(getUser());
-
- // validate complex's path
- String[] services = {serviceMetadata1.getName(), serviceMetadata2.getName(), serviceMetadata3.getName()};
- PathValidations.validateComplexExtendedPath(services);
-
- // validate certification
- certifyServiceAsTester(serviceMetadata3);
- }
-
- ////////////////////////////////////////////////////////////////////////////////////////
- // flow methods //
- ////////////////////////////////////////////////////////////////////////////////////////
-
- // workflow leading to path
- public String onboardAndCertify(ResourceReqDetails resourceReqDetails, String filePath, String vnfFile) throws Exception {
- VendorSoftwareProductObject vendorSoftwareProductObject = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, filePath, vnfFile, getUser());
- String vspName = vendorSoftwareProductObject.getName();
-
- DeploymentArtifactPage.getLeftPanel().moveToCompositionScreen();
- ExtentTestActions.addScreenshot(Status.INFO, "TopologyTemplate_" + vnfFile, "The topology template for " + vnfFile + " is as follows : ");
-
- DeploymentArtifactPage.clickSubmitForTestingButton(vspName);
- SetupCDTest.getExtendTest().log(Status.INFO, "relogin as TESTER");
- reloginWithNewRole(UserRoleEnum.TESTER);
- GeneralUIUtils.findComponentAndClick(vspName);
- TesterOperationPage.certifyComponent(vspName);
- return vspName;
- }
-
- public List<String> onboardAndCertifyMultipleVFs(String filePath, List<String> vnfFiles) throws Exception {
- List<String> VFNames = new ArrayList<>();
- for (int i = 0; i < vnfFiles.size(); i++) {
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- VendorSoftwareProductObject vendorSoftwareProductObject = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, filePath, vnfFiles.get(i), getUser());
- VFNames.add(i, vendorSoftwareProductObject.getName());
- DeploymentArtifactPage.getLeftPanel().moveToCompositionScreen();
- ExtentTestActions.addScreenshot(Status.INFO, "TopologyTemplate_" + vnfFiles.get(i), "The topology template for " + vnfFiles.get(i) + " is as follows : ");
- DeploymentArtifactPage.clickSubmitForTestingButton(VFNames.get(i));
- }
- SetupCDTest.getExtendTest().log(Status.INFO, "relogin as TESTER");
- reloginWithNewRole(UserRoleEnum.TESTER);
- for (String VFName : VFNames) {
- GeneralUIUtils.findComponentAndClick(VFName);
- TesterOperationPage.certifyComponent(VFName);
- }
- return VFNames;
- }
-
- public static List<CanvasElement> createComplexPath(String service) throws Exception {
- List<CanvasElement> services = PathUtilities.linkServices(service, service, NUMBER_OF_LINKS);
- PathUtilities.createPathWithoutLink("name1", service);
- PathUtilities.createPathWithoutLink("name2", service);
- return services;
- }
-
- public ServiceReqDetails getToComplexService(String filepath, String vnfFile) throws Exception {
- // create & certify VF
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- String vspName = onboardAndCertify(resourceReqDetails, filepath, vnfFile);
- reloginWithNewRole(UserRoleEnum.DESIGNER);
- ServiceReqDetails serviceMetadata1 = PathUtilities.createService(getUser());
-
- // create path
- PathUtilities.createPath("newPath", vspName);
- PathUtilities.submitForTesting();
- GeneralUIUtils.ultimateWait();
-
- //tester
- reloginWithNewRole(UserRoleEnum.TESTER);
- GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
- TesterOperationPage.certifyComponent(serviceMetadata1.getName());
-
- //governor
- reloginWithNewRole(UserRoleEnum.GOVERNOR);
- GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
- GovernorOperationPage.approveService(serviceMetadata1.getName());
- return serviceMetadata1;
- }
-
- public VendorSoftwareProductObject getToPathServiceVersions(ResourceReqDetails resourceReqDetails, String filepath, String vnfFileV1, String descriptionV2, String vnfFileV3, User user) throws Exception {
-
- ////////////////////////////////////
- // VF v1 //
- ////////////////////////////////////
-
- VendorSoftwareProductObject vendorSoftwareProduct = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, filePath, vnfFileV1, getUser());
- String vspName = vendorSoftwareProduct.getName();
-
- DeploymentArtifactPage.getLeftPanel().moveToCompositionScreen();
- ExtentTestActions.addScreenshot(Status.INFO, "TopologyTemplate_" + vnfFileV1, "The topology template for " + vnfFileV1 + " is as follows : ");
- DeploymentArtifactPage.clickSubmitForTestingButton(vspName);
- SetupCDTest.getExtendTest().log(Status.INFO, "relogin as TESTER");
- reloginWithNewRole(UserRoleEnum.TESTER);
- GeneralUIUtils.findComponentAndClick(vspName);
- TesterOperationPage.certifyComponent(vspName);
- reloginWithNewRole(UserRoleEnum.DESIGNER);
-
- ////////////////////////////////////
- // VF v2 //
- ////////////////////////////////////
-
- // vsp create new version
- Pair<RestResponse, OnboardItemObject> newItemVersion = PathUtilities.createNewItemVersion(
- vendorSoftwareProduct.getVspId(),
- vendorSoftwareProduct.getComponentId(),
- "version with different description", user);
- assertEquals("did not succeed to create new item version", HttpStatus.SC_OK, newItemVersion.left.getErrorCode().intValue());
- vendorSoftwareProduct.setVersion(newItemVersion.right.getItemId());
- vendorSoftwareProduct.setComponentId(newItemVersion.right.getItemId());
-
- // update vsp description
- vendorSoftwareProduct.setDescription(descriptionV2);
- RestResponse restResponse = PathUtilities.updateVendorSoftwareProduct(vendorSoftwareProduct, user);
- assertEquals("did not succeed to update vsp", HttpStatus.SC_OK, restResponse.getErrorCode().intValue());
-
- // commit & submit vsp
- VendorSoftwareProductRestUtils.prepareVspForUse(user, vendorSoftwareProduct, false);
-
- // update VF
- HomePage.showVspRepository();
- PathUtilities.updateVF(vspName, vendorSoftwareProduct);
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.UPDATE_VF.getValue());
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.SUBMIT_FOR_TESTING_BUTTON.getValue()).click();
- GeneralUIUtils.ultimateWait();
-
- // certify VF
- reloginWithNewRole(UserRoleEnum.TESTER);
- GeneralUIUtils.findComponentAndClick(vspName);
- TesterOperationPage.certifyComponent(vspName);
- reloginWithNewRole(UserRoleEnum.DESIGNER);
-
- ////////////////////////////////////
- // VF v3 //
- ////////////////////////////////////
-
- // create new version
- newItemVersion = PathUtilities.createNewItemVersion(
- vendorSoftwareProduct.getVspId(),
- vendorSoftwareProduct.getVersion(),
- "version with different heat", user);
- assertEquals("did not succeed to create new item version", HttpStatus.SC_OK, newItemVersion.left.getErrorCode().intValue());
- vendorSoftwareProduct.setVersion(newItemVersion.right.getItemId());
- vendorSoftwareProduct.setComponentId(newItemVersion.right.getItemId());
-
- // upload new heat
- RestResponse uploadHeatPackage = VendorSoftwareProductRestUtils.uploadHeatPackage(filepath, vnfFileV3, vendorSoftwareProduct, user);
- assertEquals("did not succeed to upload HEAT package", HttpStatus.SC_OK, uploadHeatPackage.getErrorCode().intValue());
-
- RestResponse validateUpload = VendorSoftwareProductRestUtils.validateUpload(vendorSoftwareProduct, user);
- assertEquals("did not succeed to validate upload process, reason: " + validateUpload.getResponse(), HttpStatus.SC_OK, validateUpload.getErrorCode().intValue());
-
- // commit & submit vsp
- VendorSoftwareProductRestUtils.prepareVspForUse(user, vendorSoftwareProduct, false);
-
- // update VF
- HomePage.showVspRepository();
- PathUtilities.updateVF(vspName, vendorSoftwareProduct);
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ImportVfRepository.UPDATE_VSP.getValue());
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.SUBMIT_FOR_TESTING_BUTTON.getValue()).click();
- GeneralUIUtils.ultimateWait();
-
- // certify VF
- reloginWithNewRole(UserRoleEnum.TESTER);
- GeneralUIUtils.findComponentAndClick(vspName);
- TesterOperationPage.certifyComponent(vspName);
- reloginWithNewRole(UserRoleEnum.DESIGNER);
-
- return vendorSoftwareProduct;
- }
-
- public void certifyServiceAsTester(ServiceReqDetails serviceMetaData) throws Exception {
- PathUtilities.submitForTesting();
- reloginWithNewRole(UserRoleEnum.TESTER);
- GeneralUIUtils.findComponentAndClick(serviceMetaData.getName());
- TesterOperationPage.certifyComponent(serviceMetaData.getName());
- }
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/OnboardItemObject.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/OnboardItemObject.java
deleted file mode 100644
index 516cc3aea5..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/OnboardItemObject.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.AmdocsComplexService;
-
-
-public class OnboardItemObject extends OnboardItemObjectReqDetails {
-
- private String itemId;
- private String name;
- private String baseId;
- private String status;
-
- public OnboardItemObject() {
- super();
- }
-
- public OnboardItemObject(String itemId, String name, String baseId, String status) {
- this.itemId = itemId;
- this.name = name;
- this.baseId = baseId;
- this.status = status;
- }
-
- public String getItemId() {
- return itemId;
- }
-
- public void setItemId(String itemId) {
- this.itemId = itemId;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String itemId) {
- this.name = name;
- }
-
- public String getBaseId() {
- return baseId;
- }
-
- public void setBaseId(String baseId) {
- this.baseId = baseId;
- }
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
- @Override
- public String toString() {
- return "OnboardItemObject{"
- + "itemId='" + itemId + '\''
- + ", name='" + name + '\''
- + ", baseId='" + baseId + '\''
- + ", status='" + status + '\''
- + '}';
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/OnboardItemObjectReqDetails.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/OnboardItemObjectReqDetails.java
deleted file mode 100644
index 181dc434ca..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/OnboardItemObjectReqDetails.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.AmdocsComplexService;
-
-
-public class OnboardItemObjectReqDetails {
-
- private String creationMethod;
- private String description;
-
- public OnboardItemObjectReqDetails() {
- }
-
- public OnboardItemObjectReqDetails(String creationMethod, String description) {
- this.creationMethod = creationMethod;
- this.description = description;
- }
-
- public String getCreationMethod() {
- return creationMethod;
- }
-
- public void setCreationMethod(String creationMethod) {
- this.creationMethod = creationMethod;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- @Override
- public String toString() {
- return "OnboardItemObjectReqDetails{"
- + "creationMethod='" + creationMethod + '\''
- + ", description='" + description + '\''
- + '}';
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/PathName.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/PathName.java
deleted file mode 100644
index 16c5553fbc..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/PathName.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.AmdocsComplexService;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.TesterOperationPage;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.OnboardingUiUtils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Optional;
-import org.testng.annotations.Parameters;
-import org.testng.annotations.Test;
-
-public class PathName extends SetupCDTest {
-
- protected static String filePath = FileHandling.getFilePath("ComplexService");
- private static String fullCompositionFile = "fullComposition.zip";
- private static String fullCompositionFile2 = "fullCompositionNew.zip";
- private static String HSSFile = "HSS.zip";
- private static String VMMEFile = "VMME.zip";
- private static String makeDistributionValue;
-
- @Parameters({"makeDistribution"})
- @BeforeMethod
- public void beforeTestReadParams(@Optional("true") String makeDistributionReadValue) {
- makeDistributionValue = makeDistributionReadValue;
- }
-
- //------------------------------------------Tests-----------------------------------------------------
-
- // Test#8 Jira issue 6168
- @Test
- public void ValidateSameNameTest() throws Exception {
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- String vspName = onboardAndCertify(resourceReqDetails, filePath, fullCompositionFile);
- reloginWithNewRole(UserRoleEnum.DESIGNER);
- PathUtilities.createService(getUser());
- String firstPathName = PathUtilities.createPath("Oren", vspName);
- PathUtilities.createPathWithoutLink(firstPathName, vspName);
- try {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.OK.getValue());
- } catch (Exception e) {
- throw new Exception("when creating another path with duplicate name, expected error did not appear");
- }
- }
-
- // Test#9 Jira issue 6183
- @Test
- public void ValidateEditName() throws Exception {
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- String vspName = onboardAndCertify(resourceReqDetails, filePath, fullCompositionFile);
- reloginWithNewRole(UserRoleEnum.DESIGNER);
- PathUtilities.createService(getUser());
- String firstPathName = PathUtilities.createPath("Oren", vspName);
- String secondPathName = PathUtilities.createPathWithoutLink("blabla", vspName);
- PathValidations.validateEditToExistingName(firstPathName, secondPathName);
- }
-
- // Test#10 Jira issue 6411
- @Test
- public void SpacesName() throws Exception {
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- String vspName = onboardAndCertify(resourceReqDetails, filePath, fullCompositionFile);
- reloginWithNewRole(UserRoleEnum.DESIGNER);
- PathUtilities.createService(getUser());
- PathUtilities.createPath(" ", vspName);
- try {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.OK.getValue());
- } catch (Exception e) {
- throw new Exception("service path name cannot be empty or spaces ");
- }
- }
-
- // Test#11 Jira issue 6186
- @Test
- public void ValidateNameWithSpaces() throws Exception {
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- String vspName = onboardAndCertify(resourceReqDetails, filePath, fullCompositionFile);
- reloginWithNewRole(UserRoleEnum.DESIGNER);
- PathUtilities.createService(getUser());
- PathValidations.validateNameWithSpaces("New", vspName);
- }
-
- ////////////////////////////////////////////////////////////////////////////////////////
- // flow methods //
- ////////////////////////////////////////////////////////////////////////////////////////
-
- // workflow leading to path
- public String onboardAndCertify(ResourceReqDetails resourceReqDetails, String filePath, String vnfFile) throws Exception {
- VendorSoftwareProductObject vendorSoftwareProductObject = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, filePath, vnfFile, getUser());
- String vspName = vendorSoftwareProductObject.getName();
-
- DeploymentArtifactPage.getLeftPanel().moveToCompositionScreen();
- ExtentTestActions.addScreenshot(Status.INFO, "TopologyTemplate_" + vnfFile, "The topology template for " + vnfFile + " is as follows : ");
-
- DeploymentArtifactPage.clickSubmitForTestingButton(vspName);
- SetupCDTest.getExtendTest().log(Status.INFO, "relogin as TESTER");
- reloginWithNewRole(UserRoleEnum.TESTER);
- GeneralUIUtils.findComponentAndClick(vspName);
- TesterOperationPage.certifyComponent(vspName);
- return vspName;
- }
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-
-} \ No newline at end of file
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/PathUrls.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/PathUrls.java
deleted file mode 100644
index de1150c110..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/PathUrls.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.openecomp.sdc.ci.tests.execute.AmdocsComplexService;
-
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-import org.openecomp.sdc.ci.tests.utils.Utils;
-
-
-public interface PathUrls {
-
- String SDC_HTTP_METHOD = Utils.getConfigHandleException() == null ? "http" : Utils.getConfigHandleException().getSdcHttpMethod();
- String AMDOCS_HTTP_METHOD = SDC_HTTP_METHOD;
-
- // onboard
- String CREATE_NEW_ITEM_VERSION = SDC_HTTP_METHOD + "://%s:%s/onboarding-api/v1.0/items/%s/versions/%s/";
- String UPDATE_VENDOR_SOFTWARE_PRODUCT = SDC_HTTP_METHOD + "://%s:%s/onboarding-api/v1.0/vendor-software-products/%s/versions/%s";
- String GET_SERVICE_PATHS = SDC_HTTP_METHOD + "://%s:%s/sdc1/feProxy/rest/v1/catalog/services/%s/filteredDataByParams?include=componentInstancesRelations&include=componentInstances&include=forwardingPaths";
- String SERVICE_PATH_LINK_MAP = SDC_HTTP_METHOD + "://%s:%s/sdc1/rest/v1/catalog/services/%s/linksMap";
- String SERVICE_FORWARDING_PATHS = SDC_HTTP_METHOD + "://%s:%s/sdc1/rest/v1/catalog/services/%s/filteredDataByParams?include=componentInstancesRelations&include=componentInstances&include=forwardingPaths";
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/PathUtilities.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/PathUtilities.java
deleted file mode 100644
index 3ee26d3f2e..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/PathUtilities.java
+++ /dev/null
@@ -1,439 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.AmdocsComplexService;
-
-import com.aventstack.extentreports.Status;
-import com.clearspring.analytics.util.Pair;
-import com.google.gson.Gson;
-import org.apache.http.HttpStatus;
-import org.openecomp.sdc.be.model.Service;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.CompositionPage;
-import org.openecomp.sdc.ci.tests.pages.GeneralPageElements;
-import org.openecomp.sdc.ci.tests.pages.HomePage;
-import org.openecomp.sdc.ci.tests.pages.ServiceGeneralPage;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.OnboardingUiUtils;
-import org.openecomp.sdc.ci.tests.utilities.ServiceUIUtils;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
-import org.openecomp.sdc.ci.tests.verificator.VfVerificator;
-import org.openqa.selenium.WebElement;
-import org.testng.Assert;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import static org.testng.AssertJUnit.assertEquals;
-
-
-public class PathUtilities {
-
- private static final int WAITING_FOR_LOADRE_TIME_OUT = 60 * 10;
- private static final int NUMBER_OF_LINKS = 3;
-
- static void openPathList() throws Exception {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.PATH_MENU_BUTTON.getValue());
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.PATH_LIST_BUTTON.getValue());
- }
-
- public static ServiceReqDetails createService(User user) throws Exception {
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
- ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
- GeneralUIUtils.ultimateWait();
- return serviceMetadata;
- }
-
- public static List<CanvasElement> linkVFs(String vspName, int linksNum) throws Exception {
- CompositionPage.searchForElement(vspName);
- GeneralUIUtils.ultimateWait();
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
- GeneralUIUtils.ultimateWait();
- List<CanvasElement> VFs = new ArrayList<CanvasElement>();
- VFs.add(canvasManager.createElementOnCanvas(vspName));
- for (int i = 1; i < linksNum; i++) {
- VFs.add(canvasManager.createElementOnCanvas(vspName));
- GeneralUIUtils.ultimateWait();
-// for(int a=0; a<3; a++)
-// try {
-// canvasManager.linkElements(VFs.get(i), CircleSize.VF, VFs.get(i - 1), CircleSize.VF);
-// break;
-// } catch (Exception ignore) {}
- SetupCDTest.getExtendTest().log(Status.INFO, "link VFs");
- GeneralUIUtils.ultimateWait();
- }
- return VFs;
- }
-
- public static List<CanvasElement> linkServices(String service1, String service2, int linksNum) throws Exception {
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
- List<CanvasElement> VFs = new ArrayList<CanvasElement>();
-
- // get first service
- CompositionPage.searchForElement(service1);
- VFs.add(canvasManager.createElementOnCanvas(service1));
-
- String service = service2;
- for (int i = 1; i < linksNum; i++) {
- CompositionPage.searchForElement(service);
- VFs.add(canvasManager.createElementOnCanvas(service));
- GeneralUIUtils.ultimateWait();
-// for(int a=0; a<3; a++)
-// try {
-// canvasManager.linkElements(VFs.get(i), CircleSize.SERVICE, VFs.get(i-1), CircleSize.SERVICE);
-// break;
-// } catch (Exception ignore) {}
- SetupCDTest.getExtendTest().log(Status.INFO, "link services");
- GeneralUIUtils.ultimateWait();
-
- // change service to link
- if (service.equals(service2)) {
- service = service1;
- } else {
- service = service2;
- }
- }
- return VFs;
- }
-
- public static void openCreatePath() throws Exception {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.PATH_MENU_BUTTON.getValue());
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_PATH_MENU_BUTTON.getValue());
- }
-
- public static void sendValue(String DataTestId, String value) throws Exception {
- GeneralUIUtils.getWebElementByTestID(DataTestId).sendKeys(value);
- GeneralUIUtils.ultimateWait();
- }
-
- public static void insertValues(String pathName, String pathProtocol, String pathPortNumbers) throws Exception {
- sendValue(DataTestIdEnum.ComplexServiceAmdocs.PATH_NAME.getValue(), pathName);
- sendValue(DataTestIdEnum.ComplexServiceAmdocs.PATH_PROTOCOL.getValue(), pathProtocol);
- sendValue(DataTestIdEnum.ComplexServiceAmdocs.PATH_PORT_NUMBER.getValue(), pathPortNumbers);
- GeneralUIUtils.ultimateWait();
- }
-
- public static void selectFirstLineParam() throws Exception {
- GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.LINK_SOURCE.getValue() + "']//option").get(0).click();
- GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.LINK_SOURCE_CP.getValue() + "']//option").get(0).click();
- GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.LINK_TARGET.getValue() + "']//option").get(0).click();
- GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.LINK_TARGET_CP.getValue() + "']//option").get(0).click();
- }
-
- public static void editPathName(String pathName, String newName) throws Exception {
- GeneralUIUtils.findElementsByXpath("//*[text()='" + pathName + "']/parent::*//span").get(0).click();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ComplexServiceAmdocs.PATH_NAME.getValue()).clear();
- sendValue(DataTestIdEnum.ComplexServiceAmdocs.PATH_NAME.getValue(), newName);
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.SAVE.getValue());
- }
-
- public static void editPathProtocol(String pathName, String newProtocol) throws Exception {
- GeneralUIUtils.findElementsByXpath("//*[text()='" + pathName + "']/parent::*//span").get(0).click();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ComplexServiceAmdocs.PATH_PROTOCOL.getValue()).clear();
- sendValue(DataTestIdEnum.ComplexServiceAmdocs.PATH_PROTOCOL.getValue(), newProtocol);
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.SAVE.getValue());
- }
-
- public static int deleteLines(int numOfLinesToDelete, int numOfLines) throws Exception {
- for (int i = 0; i < numOfLinesToDelete; i++) {
- GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.REMOVE_LINK.getValue() + "']//span").get(0).click();
- numOfLines--;
- }
- if (GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.LINK_TARGET_CP + "']//option").size() > (numOfLines + 1)) {
- throw new Exception("Path element was not deleted");
- }
- GeneralUIUtils.ultimateWait();
- return numOfLines;
- }
-
- public static String createPath(String pathName, String vspName) throws Exception {
- linkVFs(vspName, NUMBER_OF_LINKS);
- openCreatePath();
- insertValues(pathName, "pathProtocol1", "pathPortNumbers1");
- selectFirstLineParam();
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
- SetupCDTest.getExtendTest().log(Status.INFO, "path" + pathName + " has been created");
- return pathName;
- }
-
- public static void deleteComponents(List<CanvasElement> elements) throws Exception {
- for (CanvasElement element : elements) {
- CanvasManager.getCanvasManager().clickOnCanvaElement(element);
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.DELETE_COMPONENT.getValue());
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.OK.getValue());
- }
- }
-
- public static void updateVF(String vspName, VendorSoftwareProductObject vendorSoftwareProduct) throws Exception {
- boolean vspFound = HomePage.searchForVSP(vspName);
- if (vspFound) {
- final List<WebElement> elementsFromTable = GeneralPageElements.getElementsFromTable();
- elementsFromTable.get(1).click();
- GeneralUIUtils.waitForLoader();
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ImportVfRepository.UPDATE_VSP.getValue());
-
- OnboardingUiUtils.doCheckOut();
-
- //Metadata verification
- VfVerificator.verifyOnboardedVnfMetadata(vspName, vendorSoftwareProduct);
-
- ExtentTestActions.log(Status.INFO, "Clicking create/update VNF");
- String duration = GeneralUIUtils.getActionDuration(() -> waitUntilVnfCreated());
- ExtentTestActions.log(Status.INFO, "Succeeded in importing/updating " + vspName, duration);
- } else {
- Assert.fail("Did not find VSP named " + vspName);
- }
- }
-
- public static void waitUntilVnfCreated() {
- GeneralUIUtils.clickOnElementByTestIdWithoutWait(DataTestIdEnum.GeneralElementsEnum.CREATE_BUTTON.getValue());
- GeneralUIUtils.waitForLoader(WAITING_FOR_LOADRE_TIME_OUT);
- GeneralUIUtils.waitForAngular();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.CHECKIN_BUTTON.getValue());
- }
-
- public static void deleteComponent(CanvasElement element) throws Exception {
- CanvasManager.getCanvasManager().clickOnCanvaElement(element);
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.DELETE_COMPONENT.getValue());
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.OK.getValue());
- }
-
- public static void submitForTesting() {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.SUBMIT_FOR_TESTING.getValue());
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ComplexServiceAmdocs.CHANGE_LIFE_CYCLE_MESSAGE.getValue()).sendKeys("new service to certify");
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.OK.getValue());
- }
-
- public static String createPathWithoutLink(String pathName, String vspName) throws Exception {
- openCreatePath();
- insertValues(pathName, "pathProtocol1", "pathPortNumbers1");
- selectFirstLineParam();
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
- SetupCDTest.getExtendTest().log(Status.INFO, "path" + pathName + " has been created");
- return pathName;
- }
-
- // rest apis
- private static String getServiceUUIDfromCompositionURL() throws Exception {
- String url = SetupCDTest.getDriver().getCurrentUrl();
- String[] result = url.split("/");
- for (int i = 0; i < result.length; i++) {
- if (result[i].equals("workspace")) {
- return result[i + 1];
- }
- }
- throw new Exception("service uuid not found in the url");
- }
-
- private static Map<String, String> prepareHeadersMap(String userId) {
- Map<String, String> headersMap = new HashMap<String, String>();
- headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "application/json");
- headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), "application/json");
- headersMap.put(HttpHeaderEnum.USER_ID.getValue(), userId);
- return headersMap;
- }
-
- public static Pair<RestResponse, ServiceReqDetails> getServiceIDByNameAndVersion(String serviceName, String version) throws Exception {
- User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
-
- RestResponse restResponse = ServiceRestUtils.getServiceByNameAndVersion(sdncUserDetails, serviceName, version);
- ServiceReqDetails service = new ServiceReqDetails();
- service.setName(serviceName);
- service.setUniqueId(ResponseParser.getUniqueIdFromResponse(restResponse));
- service.setVersion(version);
-
- return new Pair<>(restResponse, service);
- }
-
- public static RestResponse createServiceAPI(User sdncUserDetails, ServiceReqDetails serviceDetails) throws Exception {
- String serviceBaseVersion = "0.1";
- RestResponse restResponse = ServiceRestUtils.createService(serviceDetails, sdncUserDetails);
- assertEquals("Check API response code for CreateServiceAPI call", HttpStatus.SC_CREATED, restResponse.getErrorCode().intValue());
- return restResponse;
- }
-
- public static RestResponse getServiceAPI(User sdncUserDetails, ServiceReqDetails serviceDetails) throws Exception {
- String serviceBaseVersion = "0.1";
- // choose user
- // User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-
- // create serviceDetails
- // ServiceReqDetails serviceDetails = ElementFactory.getDefaultService();
-
- // get service
- RestResponse restResponse = ServiceRestUtils.getServiceByNameAndVersion(sdncUserDetails, serviceDetails.getName(),
- serviceBaseVersion);
- assertEquals("Check API response code for GetServiceAPI call", HttpStatus.SC_OK, restResponse.getErrorCode().intValue());
-
- Service service = ResponseParser.convertServiceResponseToJavaObject(restResponse.getResponse());
- String uniqueId = service.getUniqueId();
- serviceDetails.setUniqueId(uniqueId);
- // ServiceValidationUtils.validateServiceResponseMetaData(serviceDetails, service, sdncUserDetails, (LifecycleStateEnum) null);
- return restResponse;
- }
-
- public static RestResponse getServiceForwardingPathsAPI(String serviceName) throws Exception {
- User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-
- // get service
- Pair<RestResponse, ServiceReqDetails> servicePaths = getServiceIDByNameAndVersion(serviceName, "0.1");
-
- // set url
- Config config = Utils.getConfig();
- String url = String.format(
- PathUrls.SERVICE_FORWARDING_PATHS,
- config.getCatalogBeHost(),
- config.getCatalogBePort(),
- servicePaths.right.getUniqueId()
- );
- String userId = sdncUserDetails.getUserId();
-
- Map<String, String> headersMap = prepareHeadersMap(userId);
-
- HttpRequest http = new HttpRequest();
- RestResponse restResponse = http.httpSendGet(url, headersMap);
- assertEquals("Check API response code for GetServiceForwardingPathsAPI call", HttpStatus.SC_OK, restResponse.getErrorCode().intValue());
- return restResponse;
- }
-
- public static RestResponse getServicePathLinkMapAPI(String serviceName) throws Exception {
- User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
-
- // get service
- Pair<RestResponse, ServiceReqDetails> servicePaths = getServiceIDByNameAndVersion(serviceName, "0.1");
-
- // set url
- Config config = Utils.getConfig();
- String url = String.format(
- PathUrls.SERVICE_PATH_LINK_MAP,
- config.getCatalogBeHost(),
- config.getCatalogBePort(),
- servicePaths.right.getUniqueId()
- );
-
- String userId = sdncUserDetails.getUserId();
-
- Map<String, String> headersMap = prepareHeadersMap(userId);
-
- HttpRequest http = new HttpRequest();
- RestResponse restResponse = http.httpSendGet(url, headersMap);
- assertEquals("Check API response code for GetServiceForwardingPathsAPI call", HttpStatus.SC_OK, restResponse.getErrorCode().intValue());
- return restResponse;
- }
-
- public static Pair<RestResponse, ServiceReqDetails> getServicePathsAPI(String serviceName) throws Exception {
- User sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- // get service
- Pair<RestResponse, ServiceReqDetails> servicePaths = getServiceIDByNameAndVersion(serviceName, "0.1");
-
- // set url
- Config config = Utils.getConfig();
- String url = String.format(
- PathUrls.GET_SERVICE_PATHS,
- config.getCatalogFeHost(),
- config.getCatalogFePort(),
- servicePaths.right.getUniqueId());
-
- String userId = sdncUserDetails.getUserId();
-
- Map<String, String> headersMap = prepareHeadersMap(userId);
-
- HttpRequest http = new HttpRequest();
- RestResponse restResponse = http.httpSendGet(url, headersMap);
- assertEquals("Check API response code for GetServiceForwardingPathsAPI call", HttpStatus.SC_OK, restResponse.getErrorCode().intValue());
- return new Pair<>(restResponse, servicePaths.right);
- }
-
- public static Pair<RestResponse, OnboardItemObject> createNewItemVersion(String itemId, String itemVersion, String description, User user) throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(
- PathUrls.CREATE_NEW_ITEM_VERSION,
- config.getCatalogBeHost(),
- config.getCatalogBePort(),
- itemId, itemVersion);
- String userId = user.getUserId();
- OnboardItemObject onboardItemObject = new OnboardItemObject();
-
- onboardItemObject.setCreationMethod("major");
- onboardItemObject.setDescription(description);
-
- Map<String, String> headersMap = prepareHeadersMap(userId);
- HttpRequest http = new HttpRequest();
- Gson gson = new Gson();
- String body = gson.toJson(onboardItemObject);
-
- RestResponse response = http.httpSendPost(url, body, headersMap);
-
- onboardItemObject.setItemId(ResponseParser.getValueFromJsonResponse(response.getResponse(), "id"));
- onboardItemObject.setName(ResponseParser.getValueFromJsonResponse(response.getResponse(), "name"));
- onboardItemObject.setBaseId(ResponseParser.getValueFromJsonResponse(response.getResponse(), "baseId"));
- onboardItemObject.setStatus(ResponseParser.getValueFromJsonResponse(response.getResponse(), "status"));
-
- return new Pair<>(response, onboardItemObject);
- }
-
- public static RestResponse updateVendorSoftwareProduct(VendorSoftwareProductObject vendorSoftwareProductObject, User user) throws Exception {
- Config config = Utils.getConfig();
- String url = String.format(
- PathUrls.UPDATE_VENDOR_SOFTWARE_PRODUCT,
- config.getCatalogBeHost(),
- config.getCatalogBePort(),
- vendorSoftwareProductObject.getVspId(),
- vendorSoftwareProductObject.getComponentId());
- String userId = user.getUserId();
- VendorSoftwareProductObject updateVendorSoftwareProductObject = new VendorSoftwareProductObject();
-
- updateVendorSoftwareProductObject.setName(vendorSoftwareProductObject.getName());
- updateVendorSoftwareProductObject.setDescription(vendorSoftwareProductObject.getDescription());
- updateVendorSoftwareProductObject.setCategory(vendorSoftwareProductObject.getCategory());
- updateVendorSoftwareProductObject.setSubCategory(vendorSoftwareProductObject.getSubCategory());
- updateVendorSoftwareProductObject.setVendorName(vendorSoftwareProductObject.getVendorName());
- updateVendorSoftwareProductObject.setVendorId(vendorSoftwareProductObject.getVendorId());
- updateVendorSoftwareProductObject.setIcon(vendorSoftwareProductObject.getIcon());
- updateVendorSoftwareProductObject.setLicensingData(vendorSoftwareProductObject.getLicensingData());
- updateVendorSoftwareProductObject.setLicensingVersion(vendorSoftwareProductObject.getLicensingVersion());
-
- Map<String, String> headersMap = prepareHeadersMap(userId);
- HttpRequest http = new HttpRequest();
- Gson gson = new Gson();
- String body = gson.toJson(updateVendorSoftwareProductObject);
-
- return http.httpSendPut(url, body, headersMap);
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/PathValidations.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/PathValidations.java
deleted file mode 100644
index 5396d75dae..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/PathValidations.java
+++ /dev/null
@@ -1,362 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.AmdocsComplexService;
-
-import com.aventstack.extentreports.Status;
-import com.clearspring.analytics.util.Pair;
-import org.apache.commons.lang.RandomStringUtils;
-import org.json.JSONObject;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.HeatMetaFirstLevelDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.execute.devCI.ArtifactFromCsar;
-import org.openecomp.sdc.ci.tests.execute.setup.ArtifactsCorrelationManager;
-import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.utilities.DownloadManager;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.OnboardingUiUtils;
-import org.openqa.selenium.WebElement;
-
-import java.io.File;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
-import java.util.stream.Collectors;
-
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertNotSame;
-
-
-public class PathValidations {
-
-
- public static final int NUMBER_OF_LINKS = 5;
- public static final int NUMBER_OF_LINES = 3;
- public static final int NUMBER_OF_LINES_TO_DELETE = 1;
-
- public static String[] validateServiceExtendedPath(String vspName) throws Exception {
- PathUtilities.linkVFs(vspName, NUMBER_OF_LINKS);
- PathUtilities.openCreatePath();
- String pathName = "name1";
- PathUtilities.insertValues(pathName, "pathProtocol1", "pathPortNumbers1");
- PathUtilities.selectFirstLineParam();
- PathValidations.extendPath(NUMBER_OF_LINES);
- //delete line
- PathUtilities.deleteLines(NUMBER_OF_LINES_TO_DELETE, NUMBER_OF_LINES);
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
- ExtentTestActions.log(Status.INFO, "path has been created");
- PathValidations.checkPathFilter(pathName, true);
- GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.PATH_MENU_BUTTON.getValue() + "']/parent::*").get(0).click();
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.PATH_LIST_BUTTON.getValue());
- String PathListName1 = GeneralUIUtils.findByText(pathName).getText();
- // edit path
- String newPathName = "name2";
- PathUtilities.editPathName(pathName, newPathName);
-
- GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.PATH_MENU_BUTTON.getValue() + "']/parent::*").get(0).click();
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.PATH_LIST_BUTTON.getValue());
- String PathListName2 = GeneralUIUtils.findByText(newPathName).getText();
-
- // assert names changed
- assertNotSame("path name expected to change after edit but did not", PathListName1, PathListName2);
-
- // delete path
- int paths_before_deletion = GeneralUIUtils.findElementsByXpath("//*[text()='" + newPathName + "']/parent::*//span").size();
- GeneralUIUtils.findElementsByXpath(newPathName).get(1).click();
- GeneralUIUtils.ultimateWait();
- int paths_after_deletion = GeneralUIUtils.findElementsByXpath("//*[text()='" + newPathName + "']/parent::*//span").size();
- assertNotSame("path expected to be deleted but did not", paths_after_deletion, paths_before_deletion);
-
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.PropertiesAssignmentScreen.INPUT_DELETE_DIALOG_CLOSE.getValue());
- SetupCDTest.getExtendTest().log(Status.INFO, "Path has been created");
- // check that path got deleted in the path filter list
- PathValidations.checkPathFilter(newPathName, false);
- return new String[]{pathName, newPathName};
- }
-
- public static String[] validateComplexExtendedPath(String[] services) throws Exception {
- PathUtilities.linkServices(services[0], services[1], NUMBER_OF_LINKS);
- PathUtilities.openCreatePath();
- String pathName = "name1";
- PathUtilities.insertValues(pathName, "pathProtocol1", "pathPortNumbers");
- PathUtilities.selectFirstLineParam();
- PathValidations.extendPath(NUMBER_OF_LINES);
- //delete line
- PathUtilities.deleteLines(NUMBER_OF_LINES_TO_DELETE, NUMBER_OF_LINES);
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
- ExtentTestActions.log(Status.INFO, "path has been created");
- PathUtilities.openPathList();
- String PathListName1 = GeneralUIUtils.findByText(pathName).getText();
- String newPathName = "name2";
- PathUtilities.editPathName(pathName, newPathName);
- GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.PATH_MENU_BUTTON.getValue() + "']/parent::*").get(0).click();
- GeneralUIUtils.ultimateWait();
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.PATH_LIST_BUTTON.getValue());
- String PathListName2 = GeneralUIUtils.findByText(newPathName).getText();
-
- // assert names changed
- assertNotSame("path name expected to change after edit but did not", PathListName1, PathListName2);
-
- // delete path
- int paths_before_deletion = GeneralUIUtils.findElementsByXpath("//*[text()='" + newPathName + "']/parent::*//span").size();
- GeneralUIUtils.findElementsByXpath("//*[text()='" + newPathName + "']/parent::*//span").get(1).click();
- GeneralUIUtils.ultimateWait();
-
- int paths_after_deletion = GeneralUIUtils.findElementsByXpath("//*[text()='" + newPathName + "']/parent::*//span").size();
- assertNotSame("path expected to be deleted but did not", paths_after_deletion, paths_before_deletion);
-
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.PropertiesAssignmentScreen.INPUT_DELETE_DIALOG_CLOSE.getValue());
- PathValidations.validateServicePath(services[2], pathName);
- PathValidations.validateServicePath(services[2], newPathName);
- SetupCDTest.getExtendTest().log(Status.INFO, "Paths have been validated");
- return new String[]{pathName, newPathName};
- }
-
- public static void createPathNumOfRows(int numOfPathRows) throws Exception {
- final int numberOfRandomCharacters = 8;
- PathUtilities.openCreatePath();
- PathUtilities.insertValues("extended" + RandomStringUtils.randomAlphanumeric(numberOfRandomCharacters), "pathProtocol1", "pathPortNumbers1");
- PathUtilities.selectFirstLineParam();
- extendPath(numOfPathRows);
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
- SetupCDTest.getExtendTest().log(Status.INFO, "Path with " + numOfPathRows + " rows has been created");
- }
-
- public static void extendPath(int numOfLines) throws Exception {
- for (int i = 0; i < numOfLines; i++) {
- String check;
- String index = Integer.toString(i + 2);
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.EXTEND_BUTTON.getValue());
-
- List<WebElement> linkSrcs = GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.LINK_SOURCE.getValue() + "']//select");
- List<WebElement> linkSrcCPs = GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.LINK_SOURCE_CP.getValue() + "']//select");
- List<WebElement> linkTargets = GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.LINK_TARGET.getValue() + "']//select");
- List<WebElement> linkTargetCPs = GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.LINK_TARGET_CP.getValue() + "']//select");
- for (int j = 0; j < i + 2; j++) {
- validateExtendedPathDisabledButtons(linkSrcs, j, "Source should be disabled. open bug to UI team");
- check = linkSrcCPs.get(j).getAttribute("class");
- validateElementDisabledAttribute(check, "Source connection point");
- }
- for (int j = 0; j < i + 1; j++) {
- check = linkTargets.get(j).getAttribute("class");
- validateElementDisabledAttribute(check, "Target");
- check = linkTargetCPs.get(j).getAttribute("class");
- validateElementDisabledAttribute(check, "Target connection point");
- }
- List<WebElement> choices = GeneralUIUtils.findElementsByXpath("//*[" + index + "]/*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.LINK_TARGET.getValue() + "']//option");
- choices.get((new Random()).nextInt(choices.size())).click();
- choices = GeneralUIUtils.findElementsByXpath("//*[" + index + "]/*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.LINK_TARGET_CP.getValue() + "']//option");
- choices.get((new Random()).nextInt(choices.size())).click();
- }
- }
-
- public static void validateElementDisabledAttribute(String check, String param) throws Exception {
- assertEquals(param + " of last lines should be disabled", check.contains("disabled"), true);
- }
-
- public static void validateExtendedPathDisabledButtons(List<WebElement> linkSrcs, int i, String errMsg) throws Exception {
- String check = linkSrcs.get(i).getAttribute("class");
- assertEquals(errMsg, check.contains("disabled"), true);
- }
-
- public static void validatePathListIsEmpty() throws Exception {
- PathUtilities.openPathList();
- try {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.PATH_LIST_DELETE.getValue());
- } catch (Exception e) {
- SetupCDTest.getExtendTest().log(Status.INFO, "path list is empty");
- }
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CLOSE.getValue());
- }
-
- public static void AssertNameChangeFromPathList(String pathListName1, String pathListName2) throws Exception {
- assertNotSame("path name is expected to change after edit", pathListName1, pathListName2);
- }
-
- public static void ValidateAndDeletePathFromPathList(String pathName) throws Exception {
- // count paths
- List<WebElement> path_list_name = GeneralUIUtils.getWebElementsListByTestID(DataTestIdEnum.ComplexServiceAmdocs.PATH_LIST_NAME.getValue());
- // delete paths
- List<WebElement> path_delete = GeneralUIUtils.getWebElementsListByTestID(DataTestIdEnum.ComplexServiceAmdocs.PATH_LIST_DELETE.getValue());
- int paths_before_deletion = 0;
- for (int i = 0; i < path_list_name.size(); i++) {
- if (path_list_name.get(i).getText().equals(pathName)) {
- paths_before_deletion++;
- path_delete.get(i).click();
- }
- }
- int paths_after_deletion = 0;
- List<WebElement> path_list_name2;
- try {
- path_list_name2 = GeneralUIUtils.getWebElementsListByTestID(DataTestIdEnum.ComplexServiceAmdocs.PATH_LIST_NAME.getValue());
- for (WebElement path_list_element : path_list_name2) {
- if (path_list_element.getText().equals(pathName)) {
- paths_after_deletion++;
- }
- }
- } catch (Exception ignore) {
- }
- // assert deletion
- assertNotSame("path is expected to be deleted", paths_after_deletion, paths_before_deletion);
- }
-
- public static void checkPathFilter(String pathName, boolean isFound) throws Exception {
- List<WebElement> pathFilterList = GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.SERVICE_PATH_SELECTOR.getValue() + "']//option");
- GeneralUIUtils.ultimateWait();
- if (isFound) {
- for (int i = 0; i < pathFilterList.size(); i++) {
- String element_text = pathFilterList.get(i).getText();
- if (element_text.equals(pathName)) {
- break;
- }
- assertNotSame("path filter list is missing a path", i, pathFilterList.size() - 1);
- }
- } else {
- for (WebElement aPathFilterList : pathFilterList) {
- String element_text = aPathFilterList.getText();
- assertNotSame("path filter list is has a path that should be deleted", element_text, pathName);
- }
- }
- SetupCDTest.getExtendTest().log(Status.INFO, "path list filter check passed");
- }
-
- public static void AssertCreatePath() throws Exception {
- String check = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue()).getAttribute("disabled");
- assertEquals("create button path should be disabled", check, "true");
- }
-
- public static void AssertCreatedPathExistInCompositionPage(String pathName) throws Exception {
- checkPathFilter(pathName, true);
- PathUtilities.openPathList();
-
- // assert path is in the list
- GeneralUIUtils.findByText(pathName).getText();
- GeneralUIUtils.ultimateWait();
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.PropertiesAssignmentScreen.INPUT_DELETE_DIALOG_CLOSE.getValue());
-// GeneralUIUtils.ultimateWait();
- SetupCDTest.getExtendTest().log(Status.INFO, "Path is in the path list");
-// GeneralUIUtils.ultimateWait();
- }
-
- public static void AssertExtendPath() throws Exception {
- String check = GeneralUIUtils.getWebElementsListByTestID(DataTestIdEnum.ComplexServiceAmdocs.EXTEND_BUTTON.getValue()).get(0).getAttribute("class");
- assertEquals("Extend button should be disabled", check, "disabled");
- }
-
- public static Pair<RestResponse, ServiceReqDetails> validateServicePath(String serviceName, String name) throws Exception {
- Pair<RestResponse, ServiceReqDetails> servicePaths = PathUtilities.getServicePathsAPI(serviceName);
- String response = servicePaths.left.getResponse();
-
- JSONObject jsonResponse = new JSONObject(response);
- JSONObject forwardingPaths = jsonResponse.getJSONObject("forwardingPaths");
- Boolean validation_complete = Boolean.FALSE;
- for (Object key : forwardingPaths.keySet()) {
- String keyStr = (String) key;
- JSONObject forwardingPath = forwardingPaths.getJSONObject(keyStr);
- if (forwardingPath.getString("name").equals(name)) {
- JSONObject pathElements = forwardingPath.getJSONObject("pathElements");
- Boolean empty = pathElements.getBoolean("empty");
- assertEquals("assert pathElements are not empty", empty, Boolean.FALSE);
- validation_complete = Boolean.TRUE;
- break;
- }
- }
- assertEquals("validation success", validation_complete, Boolean.TRUE);
- return servicePaths;
- }
-
- public static void ValidateThereIsNoErrorMessage() throws Exception {
- try {
- GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.OK.getValue() + "']");
- throw new Exception("element should not be found");
- } catch (Exception e) {
- if (e.getMessage().equals("element should not be found")) {
- throw e;
- }
- }
- }
-
- public static void validateEditToExistingName(String firstPathName, String secondPathName) throws Exception {
- PathUtilities.openPathList();
- PathUtilities.editPathName(secondPathName, firstPathName);
- try {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.OK.getValue());
- } catch (Exception e) {
- throw new Exception("when creating another path with duplicate name, expected error did not appear");
- }
- PathUtilities.openPathList();
- PathUtilities.editPathName(secondPathName, firstPathName + " ");
- try {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.OK.getValue());
- } catch (Exception e) {
- throw new Exception("space in beggining or end does not count. when creating another path with duplicate name, expected error did not appear");
- }
- PathUtilities.openPathList();
- PathUtilities.editPathName(secondPathName, " " + firstPathName);
- try {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.OK.getValue());
- } catch (Exception e) {
- throw new Exception("space in beggining or end does not count. when creating another path with duplicate name, expected error did not appear");
- }
- PathUtilities.openPathList();
- PathUtilities.editPathProtocol(secondPathName, "pathProtocol2");
- }
-
- public static void validateNameWithSpaces(String pathName, String vspName) throws Exception {
- PathUtilities.createPath(pathName + " ", vspName);
- PathUtilities.openPathList();
- PathUtilities.editPathName(pathName, "newName");
- PathUtilities.createPathWithoutLink(" " + pathName, vspName);
- PathUtilities.openPathList();
- PathUtilities.editPathName(pathName, "newName2");
- }
-
- public static void importAndVerifyVSP(VendorSoftwareProductObject createVendorSoftwareProduct, String filepath, String vnfFile) throws Exception {
- DownloadManager.downloadCsarByNameFromVSPRepository(createVendorSoftwareProduct.getName(), createVendorSoftwareProduct.getVspId());
- File latestFilefromDir = FileHandling.getLastModifiedFileNameFromDir();
-
- OnboardingUiUtils.importVSP(createVendorSoftwareProduct);
-
- ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
-
- // Verify deployment artifacts
- Map<String, Object> combinedMap = ArtifactFromCsar.combineHeatArtifacstWithFolderArtifacsToMap(latestFilefromDir.getAbsolutePath());
-
- LinkedList<HeatMetaFirstLevelDefinition> deploymentArtifacts = ((LinkedList<HeatMetaFirstLevelDefinition>) combinedMap.get("Deployment"));
- ArtifactsCorrelationManager.addVNFartifactDetails(vnfFile, deploymentArtifacts);
-
- List<String> heatEnvFilesFromCSAR = deploymentArtifacts.stream().filter(e -> e.getType().equals("HEAT_ENV")).
- map(e -> e.getFileName()).
- collect(Collectors.toList());
-
- OnboardingUiUtils.validateDeploymentArtifactsVersion(deploymentArtifacts, heatEnvFilesFromCSAR);
-
- DeploymentArtifactPage.verifyArtifactsExistInTable(filepath, vnfFile);
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/AdminUserManagment.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/AdminUserManagment.java
deleted file mode 100644
index 5dd7412666..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/AdminUserManagment.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.sanity;
-
-import com.aventstack.extentreports.Status;
-import org.apache.http.HttpStatus;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.AdminGeneralPage;
-import org.openecomp.sdc.ci.tests.utilities.AdminWorkspaceUIUtilies;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.UserRestUtils;
-import org.openecomp.sdc.ci.tests.verificator.ErrorMessageUIVerificator;
-import org.openecomp.sdc.ci.tests.verificator.UserManagementVerificator;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebElement;
-import org.testng.Assert;
-import org.testng.annotations.DataProvider;
-import org.testng.annotations.Test;
-
-import java.io.IOException;
-import java.util.List;
-
-public class AdminUserManagment extends SetupCDTest {
-
- @DataProvider(name = "searchValues")
- private Object[][] searchString() {
- User newUser = createNewUserUsingAPI();
- GeneralUIUtils.getDriver().navigate().refresh();
- return new Object[][]{{newUser.getUserId(), newUser}, {newUser.getFirstName(), newUser}, {newUser.getLastName(), newUser}, {newUser.getEmail(), newUser}};
- }
-
- //TC915101
- @Test(dataProvider = "searchValues")
- public void searchUserByCriterionsTest(String searchCriterion, User user) throws IOException {
- setLog(searchCriterion);
- AdminWorkspaceUIUtilies.searchForUser(searchCriterion);
- UserManagementVerificator.validateFirstRowDisplayedCorrectly(user);
- }
-
- //TC915100
- @Test
- public void createNewUserTest() throws Exception {
-
- String userId = generateValidUserId();
- UserRoleEnum userRole = UserRoleEnum.DESIGNER;
- AdminWorkspaceUIUtilies.createNewUser(userId, userRole);
- GeneralUIUtils.ultimateWait();
- UserManagementVerificator.validateUserCreated(userId, userRole);
- }
-
- //TC922253
- @Test
- public void createNewUser_MacIdTest() throws Exception {
-
- String macId = generateValidMacId();
- UserRoleEnum userRole = UserRoleEnum.DESIGNER;
- AdminWorkspaceUIUtilies.createNewUser(macId, userRole);
- GeneralUIUtils.ultimateWait();
- UserManagementVerificator.validateUserCreated(macId, userRole);
- }
-
- //TC922253
- @Test
- public void createExistingUserTest() {
- String userId = generateValidUserId();
- UserRoleEnum userRole = UserRoleEnum.DESIGNER;
- AdminWorkspaceUIUtilies.createNewUser(userId, userRole);
- ExtentTestActions.log(Status.INFO, "Trying to create the same user once again.");
- GeneralUIUtils.ultimateWait(); // extra wait, necessary for system with large user list
- AdminWorkspaceUIUtilies.createNewUser(userId, userRole);
- ErrorMessageUIVerificator.validateErrorMessage(ActionStatus.USER_ALREADY_EXIST);
- }
-
-
- // design changed and now one letter user should exist
- //TC922253
- @Test(enabled = true)
- public void createInvalidMacIdTest() {
-
- ExtentTestActions.log(Status.INFO, "Open bug 324032");
-
- String macId = generateValidMacId();
- StringBuilder invalidMacId = new StringBuilder(macId);
- invalidMacId.setCharAt(0, 'a');
- UserRoleEnum userRole = UserRoleEnum.DESIGNER;
- ExtentTestActions.log(Status.INFO, "Trying to create an invalid macId.");
- AdminWorkspaceUIUtilies.createNewUser(invalidMacId.toString(), userRole);
- GeneralUIUtils.ultimateWait();
- ErrorMessageUIVerificator.validateErrorMessage(ActionStatus.INVALID_USER_ID);
- }
-
- //TC922253
- @Test
- public void specialCharInUserIdTest() {
- String expectedErrorMsg = "User id not valid.";
- String userId = generateValidUserId();
- StringBuilder invalidUserId = new StringBuilder(userId);
- invalidUserId.setCharAt(1, '#');
- ExtentTestActions.log(Status.INFO, String.format("Trying to create an invalid user with special character (%s)", userId));
- AdminGeneralPage.getUserManagementTab().setNewUserBox(invalidUserId.toString());
- ExtentTestActions.log(Status.INFO, "Validating an error message is displayed as a result of invalid character.");
- List<WebElement> inputErrors = null;
- int inputErrorsSize = 0;
-
- try {
- WebElement inputField = GeneralUIUtils.getWebElementByClassName("input-error");
- ExtentTestActions.log(Status.INFO, String.format("Validating the message is : '%s'", expectedErrorMsg));
- inputErrors = inputField.findElements(By.className("ng-scope"));
- inputErrorsSize = inputErrors.size();
- for (WebElement err : inputErrors) {
- String actualErrorMessage = err.getText();
- if (actualErrorMessage.equals(expectedErrorMsg)) {
- inputErrorsSize--;
- }
- }
- } catch (Exception e) {
- ExtentTestActions.log(Status.INFO, "Did not find an error input.");
- Assert.fail("Did not find an error message input.");
- }
-
- Assert.assertEquals(inputErrors.size() - 1, inputErrorsSize, "Did not find an error : " + expectedErrorMsg);
- }
-
-
- //TC915101
- @Test
- public void searchForUserByRoleTest() {
- String userId = generateValidUserId();
- UserRoleEnum userRole = UserRoleEnum.DESIGNER;
- AdminWorkspaceUIUtilies.createNewUser(userId, userRole);
- AdminWorkspaceUIUtilies.searchForUser(userRole.name());
- List<WebElement> allRows = GeneralUIUtils.getWebElementsListByContainTestID(DataTestIdEnum.UserManagementEnum.USER_ID.getValue());
- ExtentTestActions.log(Status.INFO, String.format("Found %s rows, looking for the user %s.", allRows.size(), userId));
- int rowsCount = allRows.size();
- for (WebElement allRow : allRows) {
- String userIdFromTable = GeneralUIUtils.getTextContentAttributeValue(allRow);
- if (userIdFromTable.equals(userId)) {
- rowsCount--;
- break;
- }
- }
- Assert.assertEquals(allRows.size() - 1, rowsCount, "Did not find a row with the userId " + userId);
- }
-
- //TC915102
- @Test
- public void modifyUserRoleTest() {
- User user = new User();
- user.setUserId(generateValidUserId());
- UserRoleEnum userRole = UserRoleEnum.DESIGNER;
- AdminWorkspaceUIUtilies.createNewUser(user.getUserId(), userRole);
- UserRoleEnum updatedUserRole = UserRoleEnum.TESTER;
- AdminWorkspaceUIUtilies.updateUserRole(0, updatedUserRole);
- UserManagementVerificator.validateUserRoleUpdated(0, updatedUserRole);
- UserManagementVerificator.validateUserRoleUpdatedViaRest(user, getUser(), updatedUserRole);
- }
-
- //TC915103
- @Test
- public void deleteUserTest() {
- User user = new User();
- user.setUserId(generateValidUserId());
- UserRoleEnum userRole = UserRoleEnum.DESIGNER;
- AdminWorkspaceUIUtilies.createNewUser(user.getUserId(), userRole);
- AdminWorkspaceUIUtilies.deleteFirstRow();
- UserManagementVerificator.validateUserIdNotFound(user.getUserId());
- UserManagementVerificator.validateUserNotFoundViaRest(user, getUser());
- }
-
- //TC951428
- @Test
- public void modifyUserRoleWithTaskInHand_Checkout() throws Exception {
- User newUser = new User();
- newUser.setUserId(generateValidUserId());
- UserRoleEnum userRole = UserRoleEnum.DESIGNER;
- AdminWorkspaceUIUtilies.createNewUser(newUser.getUserId(), userRole);
-
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, newUser);
- ExtentTestActions.log(Status.INFO, "Creating a new VF named " + resourceMetaData.getName() + " with the user " + newUser.getUserId());
- RestResponse createResourceResp = ResourceRestUtils.createResource(resourceMetaData, newUser);
- Assert.assertEquals(createResourceResp.getErrorCode().intValue(), HttpStatus.SC_CREATED, "Did not succeed to create a VF");
-
- UserRoleEnum updatedUserRole = UserRoleEnum.TESTER;
- AdminWorkspaceUIUtilies.updateUserRole(0, updatedUserRole);
-
- ErrorMessageUIVerificator.validateErrorMessage(ActionStatus.CANNOT_UPDATE_USER_WITH_ACTIVE_ELEMENTS);
- }
-
-
- private static String generateValidUserId() {
- final int charsPatternLength = 2;
- final int digitsPatternLength = 4;
- String charsPattern = "abcdefghijklmnopqrstuvwxyz";
- String digitPatter = "0123456789";
- String chars = ResourceUIUtils.buildStringFromPattern(charsPattern, charsPatternLength);
- String digits = ResourceUIUtils.buildStringFromPattern(digitPatter, digitsPatternLength);
- return chars + digits;
- }
-
- private String generateValidMacId() {
- final int digitsPatternLength = 5;
- String digitPatter = "0123456789";
- String digits = ResourceUIUtils.buildStringFromPattern(digitPatter, digitsPatternLength);
- return "m" + digits;
- }
-
- private User createNewUserUsingAPI() {
- UserRoleEnum role = UserRoleEnum.DESIGNER;
- String userId = generateValidUserId();
- User userByEnv = new User(generateValidUserId(), generateValidUserId(), userId, generateValidUserId() + "@intl.sdc.com", role.name(), null);
- User adminUser = getUserByEnv(UserRoleEnum.ADMIN);
- try {
- RestResponse createUserResp = UserRestUtils.createUser(userByEnv, adminUser);
- Assert.assertEquals(createUserResp.getErrorCode().intValue(), HttpStatus.SC_CREATED, "Did not succeed to create a new user using API.");
- } catch (IOException e) {
- e.printStackTrace();
- }
- return userByEnv;
- }
-
-
- private User getUserByEnv(UserRoleEnum userRole) {
- try {
- return getUser(userRole);
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.ADMIN;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Annotation.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Annotation.java
deleted file mode 100644
index cbab0e9bf7..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Annotation.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.sanity;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.ToscaArtifactsScreenEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-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.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaDefinition;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-import org.openecomp.sdc.ci.tests.utils.ToscaParserUtils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.io.File;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class Annotation extends SetupCDTest {
- private String filePath;
-
- @BeforeMethod
- public void beforeTest() {
- filePath = FileHandling.getFilePath("SRIOV");
- }
-
- @Test
- public void importCsarWithAnnotationVerifyDownloadYmlContainsAnnotationSection() throws Exception {
- String fileName = "SIROV_annotations_VSP.csar";
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VF,
- NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
- ResourceUIUtils.importVfFromCsar(vfMetaData, filePath, fileName, getUser());
- getExtendTest().log(Status.INFO, "Csar with annotations imported successfully.");
- ResourceGeneralPage.getLeftMenu().moveToToscaArtifactsScreen();
- GeneralUIUtils.clickOnElementByTestId(ToscaArtifactsScreenEnum.TOSCA_MODEL.getValue());
- File latestFilefromDir = FileHandling.getLastModifiedFileNameFromDir();
- ToscaDefinition toscaMainVfDefinition = ToscaParserUtils.parseToscaMainYamlToJavaObjectByCsarLocation(latestFilefromDir);
- assertTrueAnnotationTestSuite(toscaMainVfDefinition);
- getExtendTest().log(Status.INFO, "Success to validate the ToscaMainYaml contains annotation type source with properties.");
- }
-
-
- public void assertTrueAnnotationTestSuite(ToscaDefinition toscaMainVfDefinition) {
- assertThat(toscaMainVfDefinition.getTopology_template().getInputs().get("availabilityzone_name").annotations).containsKey("source");
- assertThat(toscaMainVfDefinition.getTopology_template().getInputs().get("availabilityzone_name").getAnnotations().get("source").getType()).isEqualTo("org.openecomp.annotations.Source");
- assertThat(toscaMainVfDefinition.getTopology_template().getInputs().get("availabilityzone_name").getAnnotations().get("source").getProperties().get("source_type")).isEqualTo("HEAT");
- }
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ArchiveRestoreTest.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ArchiveRestoreTest.java
deleted file mode 100644
index 95ee634050..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ArchiveRestoreTest.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.sanity;
-
-import com.aventstack.extentreports.Status;
-import fj.data.Either;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.ComponentInstance;
-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.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.TopMenuButtonsEnum;
-import org.openecomp.sdc.ci.tests.datatypes.VendorLicenseModel;
-import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
-import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.CompositionPage;
-import org.openecomp.sdc.ci.tests.pages.GeneralPageElements;
-import org.openecomp.sdc.ci.tests.pages.GovernorOperationPage;
-import org.openecomp.sdc.ci.tests.pages.HomePage;
-import org.openecomp.sdc.ci.tests.pages.OpsOperationPage;
-import org.openecomp.sdc.ci.tests.utilities.CatalogUIUtilitis;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.HomeUtils;
-import org.openecomp.sdc.ci.tests.utilities.OnboardingUiUtils;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-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.openecomp.sdc.ci.tests.utils.general.VendorLicenseModelRestUtils;
-import org.openecomp.sdc.ci.tests.utils.general.VendorSoftwareProductRestUtils;
-import org.testng.annotations.Test;
-
-import static org.testng.AssertJUnit.assertTrue;
-
-public class ArchiveRestoreTest extends SetupCDTest {
-
- private User sdncDesignerDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
-
-
- @Test
- public void updateVSP_WhenVF_Archived() throws Throwable {
-
- String vnfFile1 = "1-2017-404_vUSP_vCCF_AIC3.0-(VOIP)_v6.0.zip";
- String vnfFile2 = "2-2017-404_vUSP_vCCF_AIC3.0-(VOIP)_v6.0_Added2TestParameters.zip";
-
-// 1. Import VSP v1.0
- String filePath = org.openecomp.sdc.ci.tests.utilities.FileHandling.getUpdateVSPVnfRepositoryPath();
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails);
- getExtendTest().log(Status.INFO, String.format("Creating Vendor Software License (VLM): %s v1.0", vendorLicenseModel
- .getVendorLicenseName()));
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- getExtendTest().log(Status.INFO, String.format("Creating Vendor Software Product (VSP): %s v1.0 from heat file: %s ", resourceReqDetails.getName(), vnfFile1));
- VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile1, filePath, this.sdncDesignerDetails,
- vendorLicenseModel, null);
-// 2. Create VF from VSP, certify - v1.0 is created
- resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
- Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- getExtendTest().log(Status.INFO, String.format("Creating Virtual Function (VF): %s v1.0", resourceReqDetails.getName()));
- getExtendTest().log(Status.INFO, String.format("Certify the VF"));
-// 3. Create Service add to it the certified VF and certify the Service v1.0
- ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();
- org.openecomp.sdc.be.model.Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
- getExtendTest().log(Status.INFO, String.format("Creating Service: %s v1.0", serviceReqDetails.getName()));
- Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
- ComponentInstance componentInstance = addComponentInstanceToComponentContainer.left().value();
- getExtendTest().log(Status.INFO, String.format("Adding VF instance to Service"));
-// 4. archive VF(1.0)
- GeneralPageElements.clickArchivedButtonFromCatalog(resource.getName());
-// 5. service certification should send error message - unable to certify, service contains archived resource via UI
- HomeUtils.findComponentAndClick(service.getName());
- GeneralPageElements.clickSubmitForTestingButtonErrorCase(service.getName());
-// 6. Update VSP to v2.0 - onboard level
- getExtendTest().log(Status.INFO, "Upgrading the VSP with new file: " + vnfFile2);
- VendorSoftwareProductRestUtils.updateVendorSoftwareProductToNextVersion(vendorSoftwareProductObject, sdncDesignerDetails, filePath, vnfFile2);
- getExtendTest().log(Status.INFO, String.format("Validating VSP %s upgrade to version 2.0: ", vnfFile2));
- VendorSoftwareProductRestUtils.validateVspExist(vendorSoftwareProductObject, sdncDesignerDetails);
-// 7. Update the VF from VSP when it archived and restore - via UI
- getExtendTest().log(Status.INFO, String.format("Going to update VF %s with VSP v2.0", resourceReqDetails.getName()));
- CompositionPage.moveToHomeScreen();
- HomePage.showVspRepository();
- OnboardingUiUtils.updateVSP(vendorSoftwareProductObject, true);
-// 8. Certify and update restored VF from with VSP v2.0
- GeneralPageElements.clickCertifyButton(resource.getName());
-// 9. Update the Service with the VFi version 2.0 and certify
- HomeUtils.findComponentAndClick(service.getName());
- GeneralPageElements.clickSubmitForTestingButton(service.getName());
- }
-
- // https://sdp.web.att.com/fa3qm1/web/console/Application_Development_Tools_QM_20.20.01#action=com.ibm.rqm.planning.home.actionDispatcher&subAction=viewTestScript&id=896098
- @Test
- public void certifyVF_WhenVSP_Archived() throws Exception {
-
- String vnfFile1 = "1-2017-404_vUSP_vCCF_AIC3.0-(VOIP)_v6.0.zip";
-
-// 1. Import VSP v1.0
- String filePath = org.openecomp.sdc.ci.tests.utilities.FileHandling.getUpdateVSPVnfRepositoryPath();
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails);
- getExtendTest().log(Status.INFO, String.format("Creating Vendor Software License (VLM): %s v1.0", vendorLicenseModel
- .getVendorLicenseName()));
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- getExtendTest().log(Status.INFO, String.format("Creating Vendor Software Product (VSP): %s v1.0 from heat file: %s ", resourceReqDetails.getName(), vnfFile1));
- VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile1, filePath, this.sdncDesignerDetails,
- vendorLicenseModel, null);
-// 2. Create VF from VSP, certify - v1.0 is created
- resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
- Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- getExtendTest().log(Status.INFO, String.format("Creating Virtual Function (VF): %s v1.0", resourceReqDetails.getName()));
- getExtendTest().log(Status.INFO, String.format("Certify the VF"));
-// 3. Archive VSP (onboarding page-Amdocs side)
- getExtendTest().log(Status.INFO, String.format("Going to archive component OB side: %s", resource.getName()));
- VendorSoftwareProductRestUtils.archiveVendorSoftwareProduct(vendorSoftwareProductObject, sdncDesignerDetails);
- getExtendTest().log(Status.INFO, String.format("Succeed to archive component %s, OB side", resource.getName()));
-// 4. chekout resource and check that VF is archived
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- HomeUtils.findComponentAndClick(resource.getName());
- GeneralPageElements.clickCheckoutButton();
- resource = AtomicOperationUtils.getResourceObject(resource.getUniqueId());
- getExtendTest().log(Status.INFO, String.format("Going to validate is VSP archived: %s", resource.getName()));
- assertTrue("Validate isVspArchived flag, expected: true, but was: " + resource.isVspArchived(), resource.isVspArchived().equals(true));
- String expectedText = "VSP is archived";
- getExtendTest().log(Status.INFO, String.format("Going to validate text box message, expected: %s", expectedText));
- String actualElementText = GeneralPageElements.getWebElementTextByTestId(DataTestIdEnum.ResourceMetadataEnum.SELECT_VSP.getValue());
- assertTrue("Validate text box message, expected: [" + expectedText + "], but was: " + actualElementText, actualElementText.equals(expectedText));
-// 5. certify new resource - should fail, via API
- getExtendTest().log(Status.INFO, String.format("Going to certify archived on OB side resource %s , expected failure certification", resource.getName()));
- GeneralPageElements.clickCertifyButtonNoUpgradePopupDismissErrorCase(resource.getName());
-// 6. restore
- getExtendTest().log(Status.INFO, String.format("Going to restore component OB side: %s", resource.getName()));
- VendorSoftwareProductRestUtils.restoreVendorSoftwareProduct(vendorSoftwareProductObject, sdncDesignerDetails);
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Succeed to restore component %s, OB side", resource.getName()));
-// 7. certify - should pass
- getExtendTest().log(Status.INFO, String.format("Going to certify resource %s ", resource.getName()));
- GeneralPageElements.clickCertifyButtonNoUpgradePopupDismiss(resource.getName());
- resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resource.getName(), "2.0");
- assertTrue("Validate isVspArchived flag, expected: false, but was: " + resource.isVspArchived(), resource.isVspArchived().equals(false));
- }
-
- @Test
- public void distributeServiceIncludedArchivedResource() throws Exception {
-
- String vnfFile1 = "1-2017-404_vUSP_vCCF_AIC3.0-(VOIP)_v6.0.zip";
-// 1. Import VSP v1.0
- String filePath = org.openecomp.sdc.ci.tests.utilities.FileHandling.getUpdateVSPVnfRepositoryPath();
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails);
- getExtendTest().log(Status.INFO, String.format("Creating Vendor Software License (VLM): %s v1.0", vendorLicenseModel
- .getVendorLicenseName()));
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- getExtendTest().log(Status.INFO, String.format("Creating Vendor Software Product (VSP): %s v1.0 from heat file: %s ", resourceReqDetails.getName(), vnfFile1));
- VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile1, filePath, this.sdncDesignerDetails,
- vendorLicenseModel, null);
-// 2. Create VF from VSP, certify - v1.0 is created
- resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
- getExtendTest().log(Status.INFO, String.format("Creating Virtual Function (VF): %s v1.0", resourceReqDetails.getName()));
- Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
- getExtendTest().log(Status.INFO, String.format("Certify the VF"));
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-// 3. Create Service add to it the certified VF and certify the Service v1.0
- ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();
- org.openecomp.sdc.be.model.Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
- getExtendTest().log(Status.INFO, String.format("Creating Service: %s v1.0", serviceReqDetails.getName()));
- Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
- ComponentInstance componentInstance = addComponentInstanceToComponentContainer.left().value();
- getExtendTest().log(Status.INFO, String.format("Adding VF instance to Service"));
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- reloginWithNewRole(UserRoleEnum.GOVERNOR);
- GeneralUIUtils.findComponentAndClick(service.getName());
- GovernorOperationPage.approveService(service.getName());
-// 4. archive VF(1.0)
- reloginWithNewRole(UserRoleEnum.DESIGNER);
- GeneralPageElements.clickArchivedButtonFromCatalog(resource.getName());
-// 5. Distribute service - should pass
- reloginWithNewRole(UserRoleEnum.OPS);
- GeneralUIUtils.findComponentAndClick(service.getName());
- OpsOperationPage.distributeService();
-
- }
-
-
- @Test
- public void certificationOfArchivedCR() throws Exception {
-
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.CR, getUser());
- ResourceUIUtils.createCR(resourceReqDetails, sdncDesignerDetails);
- GeneralPageElements.clickCertifyButtonNoUpgradePopupDismiss(resourceReqDetails.getName());
- GeneralUIUtils.ultimateWait();
- Resource resource = (Resource) AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resourceReqDetails.getName(), "1.0");
-// 1. Create Service add to it the certified CR and certify the Service v1.0
- ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();
- org.openecomp.sdc.be.model.Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
- getExtendTest().log(Status.INFO, String.format("Creating Service: %s v1.0", serviceReqDetails.getName()));
- Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
- ComponentInstance componentInstance = addComponentInstanceToComponentContainer.left().value();
- getExtendTest().log(Status.INFO, String.format("Adding CR instance to Service"));
-// 2. archive CR(1.0)
- GeneralPageElements.clickArchivedButtonFromCatalog(resource.getName());
-// 3. service certification should send error message - unable to certify, service contains archived resource via UI
- HomeUtils.findComponentAndClick(service.getName());
- GeneralPageElements.clickSubmitForTestingButtonErrorCase(service.getName());
-// 4. restore CR
- GeneralPageElements.restoreComponentFromArchivedCatalog(resource.getName());
-// 5. Certify and update restored CR(v2.0)
- GeneralPageElements.clickCheckoutButton();
- GeneralPageElements.clickCertifyButton(resource.getName());
-// 6. Update the Service with the CRi version 2.0 and certify service
- HomeUtils.findComponentAndClick(service.getName());
- GeneralPageElements.clickSubmitForTestingButton(service.getName());
- }
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CatalogLeftPanelTest.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CatalogLeftPanelTest.java
deleted file mode 100644
index f939dda60a..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CatalogLeftPanelTest.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.sanity;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.CheckBoxStatusEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.CatalogPageLeftPanelSubCategoryCheckbox;
-import org.openecomp.sdc.ci.tests.datatypes.LifeCycleStateEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.TopMenuButtonsEnum;
-import org.openecomp.sdc.ci.tests.datatypes.TypesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.utilities.CatalogUIUtilitis;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ServiceUIUtils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.verificator.CatalogVerificator;
-import org.openqa.selenium.WebElement;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.DataProvider;
-import org.testng.annotations.Test;
-
-import java.util.Arrays;
-import java.util.List;
-
-import static org.testng.AssertJUnit.assertTrue;
-
-@Test(singleThreaded = true)
-public class CatalogLeftPanelTest extends SetupCDTest {
-
- private String filePath;
-
- @BeforeMethod
- public void beforeTest() {
- filePath = FileHandling.getFilePath("");
- }
-
- private static String[] resourceTypes = Arrays.stream(ResourceTypeEnum.class.getEnumConstants()).
- map(ResourceTypeEnum::name).toArray(String[]::new);
-
- private static String[] catalogTypes = {"RESOURCE", "SERVICE"};
-
- private static Object[][] provideData(String[] arObj) {
- Object[][] arObject = new Object[arObj.length][];
-
- int index = 0;
- for (Object obj : arObj) {
- arObject[index++] = new Object[]{obj};
- }
- return arObject;
- }
-
- @DataProvider(name = "Resource_Type_List")
- private static Object[][] resourceTypeList() {
- // Extract names of constants from enum as array of Strings
- ResourceTypeEnum[] resourceEnums = {ResourceTypeEnum.CP, ResourceTypeEnum.VF, ResourceTypeEnum.VFC, ResourceTypeEnum.VL};
- String[] resourcesForTest = Arrays.stream(resourceEnums).map(ResourceTypeEnum::name).toArray(String[]::new);
- return provideData(resourcesForTest);
- }
-
- @DataProvider(name = "Type_List")
- private static Object[][] typeList() {
- // Extract names of constants from enum as array of Strings
- Object[][] arObject = new Object[catalogTypes.length][];
- int index = 0;
- for (String catalogType : catalogTypes) {
- if (catalogType.equals("RESOURCE")) {
- arObject[index++] = new Object[]{catalogType, resourceTypes};
- } else {
- arObject[index++] = new Object[]{catalogType, new String[]{catalogType}};
- }
- }
- return arObject;
- }
-
- @DataProvider(name = "Status_List")
- private static Object[][] statusList() {
- CheckBoxStatusEnum[] checkboxes = {CheckBoxStatusEnum.CERTIFIED,
- CheckBoxStatusEnum.IN_DESIGN,
- CheckBoxStatusEnum.DISTRIBUTED,
- CheckBoxStatusEnum.IN_TESTING,
- CheckBoxStatusEnum.READY_FOR_TESTING};
- Object[][] arObject = new Object[checkboxes.length][];
- int index = 0;
- for (CheckBoxStatusEnum checkbox : checkboxes) {
- if (checkbox.equals(CheckBoxStatusEnum.CERTIFIED)) {
- arObject[index++] = new Object[]{checkbox, Arrays.asList(LifeCycleStateEnum.CERTIFIED, LifeCycleStateEnum.DISTRIBUTED, LifeCycleStateEnum.WAITING_FOR_DISTRIBUTION)};
- } else if (checkbox.equals(CheckBoxStatusEnum.IN_DESIGN)) {
- arObject[index++] = new Object[]{checkbox, Arrays.asList(LifeCycleStateEnum.CHECKIN, LifeCycleStateEnum.CHECKOUT)};
- } else if (checkbox.equals(CheckBoxStatusEnum.DISTRIBUTED)) {
- arObject[index++] = new Object[]{checkbox, Arrays.asList(LifeCycleStateEnum.DISTRIBUTED)};
- } else if (checkbox.equals(CheckBoxStatusEnum.IN_TESTING)) {
- arObject[index++] = new Object[]{checkbox, Arrays.asList(LifeCycleStateEnum.IN_TESTING)};
- } else if (checkbox.equals(CheckBoxStatusEnum.READY_FOR_TESTING)) {
- arObject[index++] = new Object[]{checkbox, Arrays.asList(LifeCycleStateEnum.READY_FOR_TESTING)};
- }
- }
- return arObject;
- }
-
- // filter by Type Resource in catalog
- @Test(dataProvider = "Type_List")
- public void filterByType(String catalogType, String[] classValues) throws Exception {
- setLog(catalogType);
-// getExtendTest().setDescription(catalogType);
-
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- CatalogUIUtilitis.catalogFilterTypeChecBox(TypesEnum.valueOf(catalogType));
- CatalogVerificator.validateType(TypesEnum.valueOf(catalogType));
- }
-
- @Test(dataProvider = "Resource_Type_List")
- public void filterByResourceType(String resourceType) throws Exception {
- setLog(resourceType);
-// getExtendTest().setDescription(resourceType);
-
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- CatalogUIUtilitis.catalogFilterTypeChecBox(TypesEnum.valueOf(resourceType));
-
- CatalogVerificator.validateType(TypesEnum.valueOf(resourceType));
- }
-
- @Test(dataProvider = "Status_List")
- public void filterByStatus(CheckBoxStatusEnum statusCheckbox, List<LifeCycleStateEnum> lifecycleStates) throws Exception {
- setLog(statusCheckbox.name());
-// getExtendTest().setDescription(statusCheckbox.name());
-
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- CatalogUIUtilitis.clickOnLeftPanelElement(DataTestIdEnum.CatalogPageLeftPanelFilterTitle.CATEGORIES);
- CatalogUIUtilitis.catalogFilterStatusChecBox(statusCheckbox);
- //TODO check the test after removing lifecycle steps for resource
- CatalogVerificator.validateStatus(lifecycleStates, statusCheckbox.name());
- }
-
- @Test
- public void filterByUpperCategory() throws Exception {
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- CatalogUIUtilitis.clickOnLeftPanelElement(DataTestIdEnum.CatalogPageLeftPanelFilterTitle.TYPE);
-
- WebElement categoryCheckbox = CatalogUIUtilitis.clickOnUpperCategoryCheckbox();
-
- CatalogVerificator.validateCategory(categoryCheckbox.getAttribute("textContent").trim());
- }
-
- @Test
- public void filterByGenericDatabaseSubCategory() throws Exception {
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- CatalogUIUtilitis.clickOnLeftPanelElement(DataTestIdEnum.CatalogPageLeftPanelFilterTitle.TYPE);
-
- WebElement checkboxElement = GeneralUIUtils.getElementsByCSS(CatalogPageLeftPanelSubCategoryCheckbox.DATABASE.getValue()).get(0);
- String checkboxElementName = checkboxElement.getAttribute("textContent").trim();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on %s subcategory ...", checkboxElementName));
- GeneralUIUtils.clickOnAreaJS(checkboxElement);
- CatalogVerificator.validateSubCategory("Generic", checkboxElementName);
- }
-
- @Test(priority = 1)
- public void lastUpdatedService() throws Exception {
- // create service
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
-
- ResourceGeneralPage.clickCheckinButton(serviceMetadata.getName());
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- List<WebElement> cardElements = GeneralUIUtils.getElementsByCSS(DataTestIdEnum.DashboardCardEnum.INFO_NAME.getValue());
- String firstElementName = cardElements.get(0).getAttribute("textContent").trim();
- assertTrue(String.format("Wrong element name, Expected : %s , Actual: %s", serviceMetadata.getName(), firstElementName), serviceMetadata.getName().equals(firstElementName));
- }
-
- @Test(priority = 17)
- public void lastUpdatedResource() throws Exception {
- // create resource
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(vfMetaData, getUser());
-
- ResourceGeneralPage.clickCheckinButton(vfMetaData.getName());
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- List<WebElement> cardElements = GeneralUIUtils.getElementsByCSS(DataTestIdEnum.DashboardCardEnum.INFO_NAME.getValue());
- String firstElementName = cardElements.get(0).getAttribute("textContent").trim();
- assertTrue(String.format("Wrong element name, Expected : %s , Actual: %s", vfMetaData.getName(), firstElementName), vfMetaData.getName().equals(firstElementName));
- }
-
- @Test(priority = 5)
- public void fromCatalogCheckout() throws Exception {
- // create resource
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(vfMetaData, getUser());
- ResourceGeneralPage.clickCheckinButton(vfMetaData.getName());
-
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
- ResourceGeneralPage.clickCheckoutButton();
- ResourceGeneralPage.clickCheckinButton(vfMetaData.getName());
- }
-
- @Test
- public void keepSearchResultsInCatalogAfterBrowserBack() throws Exception {
- ResourceReqDetails resourceMetadata = ElementFactory.getDefaultResource();
- ResourceUIUtils.createVF(resourceMetadata, getUser());
- ResourceGeneralPage.clickCheckinButton(resourceMetadata.getName());
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- CatalogUIUtilitis.catalogSearchBox(resourceMetadata.getName());
- GeneralUIUtils.findComponentAndClick(resourceMetadata.getName());
-
- GeneralUIUtils.clickOnBrowserBackButton();
-
- int numOfElementsInFilteredCatalog = CatalogVerificator.getNumberOfElementsFromCatalogHeader();
- assertTrue(String.format("Wrong number fo elements, Expected : %s , Actual: %s", 1, numOfElementsInFilteredCatalog), numOfElementsInFilteredCatalog == 1);
-
- List<WebElement> cardElements = GeneralUIUtils.getElementsByCSS(DataTestIdEnum.DashboardCardEnum.INFO_NAME.getValue());
- String firstElementName = cardElements.get(0).getAttribute("textContent").trim();
- assertTrue(String.format("Wrong element name, Expected : %s , Actual: %s", resourceMetadata.getName(), firstElementName), resourceMetadata.getName().equals(firstElementName));
- }
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CatalogLeftPanelTestWithTime.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CatalogLeftPanelTestWithTime.java
deleted file mode 100644
index b38b54d80e..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CatalogLeftPanelTestWithTime.java
+++ /dev/null
@@ -1,295 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.sanity;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.CheckBoxStatusEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.CatalogPageLeftPanelSubCategoryCheckbox;
-import org.openecomp.sdc.ci.tests.datatypes.LifeCycleStateEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.TopMenuButtonsEnum;
-import org.openecomp.sdc.ci.tests.datatypes.TypesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.utilities.CatalogUIUtilitis;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ServiceUIUtils;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.verificator.CatalogVerificator;
-import org.openqa.selenium.WebElement;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.DataProvider;
-import org.testng.annotations.Test;
-
-import java.util.Arrays;
-import java.util.List;
-
-import static org.testng.AssertJUnit.assertTrue;
-
-@Test(singleThreaded = true)
-public class CatalogLeftPanelTestWithTime extends SetupCDTest {
-
- private static final int REGULAR_TEST_RUN_TIME = 400;
- private String filePath;
-
- @BeforeMethod
- public void beforeTest() {
- filePath = FileHandling.getFilePath("");
- }
-
- private static String[] resourceTypes = Arrays.stream(ResourceTypeEnum.class.getEnumConstants()).
- map(ResourceTypeEnum::name).toArray(String[]::new);
-
- private static String[] catalogTypes = {"RESOURCE", "SERVICE"};
-
- private static Object[][] provideData(String[] arObj) {
- Object[][] arObject = new Object[arObj.length][];
-
- int index = 0;
- for (Object obj : arObj) {
- arObject[index++] = new Object[]{obj};
- }
- return arObject;
- }
-
- @DataProvider(name = "Resource_Type_List")
- private static Object[][] resourceTypeList() {
- // Extract names of constants from enum as array of Strings
- ResourceTypeEnum[] resourceEnums = {ResourceTypeEnum.CP, ResourceTypeEnum.VF, ResourceTypeEnum.VFC, ResourceTypeEnum.VL};
- String[] resourcesForTest = Arrays.stream(resourceEnums).map(ResourceTypeEnum::name).toArray(String[]::new);
- return provideData(resourcesForTest);
- }
-
- @DataProvider(name = "Type_List")
- private static Object[][] typeList() {
- // Extract names of constants from enum as array of Strings
- Object[][] arObject = new Object[catalogTypes.length][];
- int index = 0;
- for (String catalogType : catalogTypes) {
- if (catalogType.equals("RESOURCE")) {
- arObject[index++] = new Object[]{catalogType, resourceTypes};
- } else {
- arObject[index++] = new Object[]{catalogType, new String[]{catalogType}};
- }
- }
- return arObject;
- }
-
- @DataProvider(name = "Status_List")
- private static Object[][] statusList() {
- CheckBoxStatusEnum[] checkboxes = {CheckBoxStatusEnum.CERTIFIED,
- CheckBoxStatusEnum.IN_DESIGN,
- CheckBoxStatusEnum.DISTRIBUTED,
- CheckBoxStatusEnum.IN_TESTING,
- CheckBoxStatusEnum.READY_FOR_TESTING};
- Object[][] arObject = new Object[checkboxes.length][];
- int index = 0;
- for (CheckBoxStatusEnum checkbox : checkboxes) {
- if (checkbox.equals(CheckBoxStatusEnum.CERTIFIED)) {
- arObject[index++] = new Object[]{checkbox, Arrays.asList(LifeCycleStateEnum.CERTIFIED, LifeCycleStateEnum.DISTRIBUTED, LifeCycleStateEnum.WAITING_FOR_DISTRIBUTION)};
- } else if (checkbox.equals(CheckBoxStatusEnum.IN_DESIGN)) {
- arObject[index++] = new Object[]{checkbox, Arrays.asList(LifeCycleStateEnum.CHECKIN, LifeCycleStateEnum.CHECKOUT)};
- } else if (checkbox.equals(CheckBoxStatusEnum.DISTRIBUTED)) {
- arObject[index++] = new Object[]{checkbox, Arrays.asList(LifeCycleStateEnum.DISTRIBUTED)};
- } else if (checkbox.equals(CheckBoxStatusEnum.IN_TESTING)) {
- arObject[index++] = new Object[]{checkbox, Arrays.asList(LifeCycleStateEnum.IN_TESTING)};
- } else if (checkbox.equals(CheckBoxStatusEnum.READY_FOR_TESTING)) {
- arObject[index++] = new Object[]{checkbox, Arrays.asList(LifeCycleStateEnum.READY_FOR_TESTING)};
- }
- }
- return arObject;
- }
-
- // filter by Type Resource in catalog
- @Test(dataProvider = "Type_List")
- public void filterByTypeWithTime(String catalogType, String[] classValues) throws Exception {
- setLog(catalogType);
- //Load catalog
- Long actualTestRunTime = GeneralUIUtils.getAndValidateActionDuration(() ->
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG), REGULAR_TEST_RUN_TIME);
- SetupCDTest.getExtendTest().log(Status.INFO, "Actual catalog loading time is "
- + actualTestRunTime + " seconds");
- //Filter by type
- actualTestRunTime = Utils.getAndValidateActionDuration(() -> {
- try {
- CatalogUIUtilitis.catalogFilterTypeChecBox(TypesEnum.valueOf(catalogType));
- } catch (Exception e) {
- e.printStackTrace();
- }
- }, REGULAR_TEST_RUN_TIME);
- SetupCDTest.getExtendTest().log(Status.INFO, "Actual catalog filtering time is "
- + actualTestRunTime + " seconds");
- //Validate number of elements after filtering
- CatalogVerificator.validateType(TypesEnum.valueOf(catalogType));
- }
-
- @Test(dataProvider = "Resource_Type_List")
- public void filterByResourceTypeWithTime(String resourceType) throws Exception {
- setLog(resourceType);
- //Load catalog
- Long actualTestRunTime = Utils.getAndValidateActionDuration(() ->
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG), REGULAR_TEST_RUN_TIME);
- SetupCDTest.getExtendTest().log(Status.INFO, "Actual catalog loading time is "
- + actualTestRunTime + " seconds");
- //Filter by resource type
- actualTestRunTime = Utils.getAndValidateActionDuration(() -> {
- try {
- CatalogUIUtilitis.catalogFilterTypeChecBox(TypesEnum.valueOf(resourceType));
- } catch (Exception e) {
- e.printStackTrace();
- }
- }, REGULAR_TEST_RUN_TIME);
- SetupCDTest.getExtendTest().log(Status.INFO, "Actual catalog filtering time is "
- + actualTestRunTime + " seconds");
- //Validate number of elements after filtering
- CatalogVerificator.validateType(TypesEnum.valueOf(resourceType));
- }
-
- @Test(dataProvider = "Status_List")
- public void filterByStatus(CheckBoxStatusEnum statusCheckbox, List<LifeCycleStateEnum> lifecycleStates) throws Exception {
- setLog(statusCheckbox.name());
- //Load catalog
- Long actualTestRunTime = Utils.getAndValidateActionDuration(() ->
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG), REGULAR_TEST_RUN_TIME);
- SetupCDTest.getExtendTest().log(Status.INFO, "Actual catalog loading time is "
- + actualTestRunTime + " seconds");
- CatalogUIUtilitis.clickOnLeftPanelElement(DataTestIdEnum.CatalogPageLeftPanelFilterTitle.CATEGORIES);
- //Filter by resource type
- actualTestRunTime = Utils.getAndValidateActionDuration(() -> CatalogUIUtilitis.catalogFilterStatusChecBox(statusCheckbox), REGULAR_TEST_RUN_TIME);
- SetupCDTest.getExtendTest().log(Status.INFO, "Actual catalog filtering time is "
- + actualTestRunTime + " seconds");
- //TODO check the test after removing lifecycle steps for resource
- //Validate number of elements after filtering
- CatalogVerificator.validateStatus(lifecycleStates, statusCheckbox.name());
- }
-
- @Test
- public void filterByUpperCategory() throws Exception {
- //Load catalog
- Long actualTestRunTime = Utils.getAndValidateActionDuration(() ->
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG), REGULAR_TEST_RUN_TIME);
- SetupCDTest.getExtendTest().log(Status.INFO, "Actual catalog loading time is "
- + actualTestRunTime + " seconds");
- //Filter by Upper Category
- CatalogUIUtilitis.clickOnLeftPanelElement(DataTestIdEnum.CatalogPageLeftPanelFilterTitle.TYPE);
- actualTestRunTime = Utils.getAndValidateActionDuration(() -> CatalogUIUtilitis.clickOnUpperCategoryCheckbox(), REGULAR_TEST_RUN_TIME);
- SetupCDTest.getExtendTest().log(Status.INFO, "Actual catalog filtering time is "
- + actualTestRunTime + " seconds");
- WebElement categoryCheckbox = CatalogUIUtilitis.getCategoryCheckbox();
- CatalogVerificator.validateCategory(categoryCheckbox.getAttribute("textContent").trim());
- }
-
- @Test
- public void filterByGenericDatabaseSubCategory() throws Exception {
- //Load catalog
- Long actualTestRunTime = Utils.getAndValidateActionDuration(() ->
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG), REGULAR_TEST_RUN_TIME);
- SetupCDTest.getExtendTest().log(Status.INFO, "Actual catalog loading time is "
- + actualTestRunTime + " seconds");
- CatalogUIUtilitis.clickOnLeftPanelElement(DataTestIdEnum.CatalogPageLeftPanelFilterTitle.TYPE);
- WebElement checkboxElement = GeneralUIUtils.getElementsByCSS(CatalogPageLeftPanelSubCategoryCheckbox.DATABASE.getValue()).get(0);
- String checkboxElementName = checkboxElement.getAttribute("textContent").trim();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on %s subcategory ...", checkboxElementName));
- //Filter by sub category
- actualTestRunTime = Utils.getAndValidateActionDuration(() -> {
- try {
- GeneralUIUtils.clickOnAreaJS(checkboxElement);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }, REGULAR_TEST_RUN_TIME);
- SetupCDTest.getExtendTest().log(Status.INFO, "Actual catalog filtering time is "
- + actualTestRunTime + " seconds");
- //Validate filtering results
- CatalogVerificator.validateSubCategory("Generic", checkboxElementName);
- }
-
- @Test(priority = 1)
- public void lastUpdatedService() throws Exception {
- // create service
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
-
- ResourceGeneralPage.clickCheckinButton(serviceMetadata.getName());
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- List<WebElement> cardElements = GeneralUIUtils.getElementsByCSS(DataTestIdEnum.DashboardCardEnum.INFO_NAME.getValue());
- String firstElementName = cardElements.get(0).getAttribute("textContent").trim();
- assertTrue(String.format("Wrong element name, Expected : %s , Actual: %s", serviceMetadata.getName(), firstElementName), serviceMetadata.getName().equals(firstElementName));
- }
-
- @Test(priority = 17)
- public void lastUpdatedResource() throws Exception {
- // create resource
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(vfMetaData, getUser());
-
- ResourceGeneralPage.clickCheckinButton(vfMetaData.getName());
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- List<WebElement> cardElements = GeneralUIUtils.getElementsByCSS(DataTestIdEnum.DashboardCardEnum.INFO_NAME.getValue());
- String firstElementName = cardElements.get(0).getAttribute("textContent").trim();
- assertTrue(String.format("Wrong element name, Expected : %s , Actual: %s", vfMetaData.getName(), firstElementName), vfMetaData.getName().equals(firstElementName));
- }
-
- @Test(priority = 5)
- public void fromCatalogCheckout() throws Exception {
- // create resource
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(vfMetaData, getUser());
- ResourceGeneralPage.clickCheckinButton(vfMetaData.getName());
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- //Search in catalog
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
- ResourceGeneralPage.clickCheckoutButton();
- ResourceGeneralPage.clickCheckinButton(vfMetaData.getName());
- }
-
- @Test
- public void keepSearchResultsInCatalogAfterBrowserBack() throws Exception {
- ResourceReqDetails resourceMetadata = ElementFactory.getDefaultResource();
- ResourceUIUtils.createVF(resourceMetadata, getUser());
- ResourceGeneralPage.clickCheckinButton(resourceMetadata.getName());
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- CatalogUIUtilitis.catalogSearchBox(resourceMetadata.getName());
- GeneralUIUtils.findComponentAndClick(resourceMetadata.getName());
-
- GeneralUIUtils.clickOnBrowserBackButton();
-
- int numOfElementsInFilteredCatalog = CatalogVerificator.getNumberOfElementsFromCatalogHeader();
- assertTrue(String.format("Wrong number fo elements, Expected : %s , Actual: %s", 1, numOfElementsInFilteredCatalog), numOfElementsInFilteredCatalog == 1);
-
- List<WebElement> cardElements = GeneralUIUtils.getElementsByCSS(DataTestIdEnum.DashboardCardEnum.INFO_NAME.getValue());
- String firstElementName = cardElements.get(0).getAttribute("textContent").trim();
- assertTrue(String.format("Wrong element name, Expected : %s , Actual: %s", resourceMetadata.getName(), firstElementName), resourceMetadata.getName().equals(firstElementName));
- }
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Categories.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Categories.java
deleted file mode 100644
index 844552c58b..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Categories.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.sanity;
-
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.category.CategoryDefinition;
-import org.openecomp.sdc.be.model.category.SubCategoryDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.AdminGeneralPage;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ServiceUIUtils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
-import org.openqa.selenium.WebElement;
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-import java.util.List;
-import java.util.stream.Collectors;
-
-public class Categories extends SetupCDTest {
-
-
- @Test
- public void createResourceCategory() throws Exception {
-
- AdminGeneralPage.selectCategoryManagmetTab();
- String newResourceCategory = ElementFactory.getDefaultCategory().getName();
- AdminGeneralPage.createNewResourceCategory(newResourceCategory);
- List<WebElement> resourceCategoriesList = AdminGeneralPage.getResourceCategoriesList();
- List<String> collect = resourceCategoriesList.stream().map(f -> f.getText()).collect(Collectors.toList());
- collect.contains(newResourceCategory);
-
-
- }
-
- @Test
- public void createServiceCategory() throws Exception {
-
- AdminGeneralPage.selectCategoryManagmetTab();
- String newserviceCategory = ElementFactory.getDefaultCategory().getName();
- AdminGeneralPage.createNewServiceCategory(newserviceCategory);
- List<WebElement> serviceCategoriesList = AdminGeneralPage.getServiceCategoriesList();
- List<String> collect = serviceCategoriesList.stream().map(f -> f.getText()).collect(Collectors.toList());
- collect.contains(newserviceCategory);
-
- }
-
-
- @Test
- public void createResourceSubCategory() throws Exception {
-
- AdminGeneralPage.selectCategoryManagmetTab();
- String newResourceCategory = ElementFactory.getDefaultCategory().getName();
- String newserviceCategory = ElementFactory.getDefaultCategory().getName();
- String newSubCategory = ElementFactory.getDefaultSubCategory().getName();
- AdminGeneralPage.createNewResourceCategory(newResourceCategory);
- AdminGeneralPage.createNewServiceCategory(newserviceCategory);
- List<WebElement> serviceCategoriesList = AdminGeneralPage.getServiceCategoriesList();
- List<WebElement> resourceCategoriesList = AdminGeneralPage.getResourceCategoriesList();
- AdminGeneralPage.addSubCategoryToResource(resourceCategoriesList, newResourceCategory, newSubCategory);
- GeneralUIUtils.waitForLoader();
- }
-
-
- @Test
- public void createExistingResourceCategory() throws Exception {
-
- AdminGeneralPage.selectCategoryManagmetTab();
- String newResourceCategory = ElementFactory.getDefaultCategory().getName();
- AdminGeneralPage.createNewResourceCategory(newResourceCategory);
- AdminGeneralPage.createNewResourceCategory(newResourceCategory);
-
- String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
- String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.COMPONENT_CATEGORY_ALREADY_EXISTS.name());
- Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
-
-
- }
-
- @Test
- public void createExistingServiceCategory() throws Exception {
-
- AdminGeneralPage.selectCategoryManagmetTab();
- String newserviceCategory = ElementFactory.getDefaultCategory().getName();
- AdminGeneralPage.createNewServiceCategory(newserviceCategory);
- AdminGeneralPage.createNewServiceCategory(newserviceCategory);
-
- String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
- String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.COMPONENT_CATEGORY_ALREADY_EXISTS.name());
- Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
-
- }
-
- @Test
- public void createExsitingResourceSubCategory() throws Exception {
-
-
- AdminGeneralPage.selectCategoryManagmetTab();
- String newResourceCategory = ElementFactory.getDefaultCategory().getName();
- String newserviceCategory = ElementFactory.getDefaultCategory().getName();
- String newSubCategory = ElementFactory.getDefaultSubCategory().getName();
- AdminGeneralPage.createNewResourceCategory(newResourceCategory);
- AdminGeneralPage.createNewServiceCategory(newserviceCategory);
- List<WebElement> serviceCategoriesList = AdminGeneralPage.getServiceCategoriesList();
- List<WebElement> resourceCategoriesList = AdminGeneralPage.getResourceCategoriesList();
- AdminGeneralPage.addSubCategoryToResource(resourceCategoriesList, newResourceCategory, newSubCategory);
- AdminGeneralPage.addSubCategoryToResource(resourceCategoriesList, newResourceCategory, newSubCategory);
- GeneralUIUtils.waitForLoader();
- String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
- String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.COMPONENT_SUB_CATEGORY_EXISTS_FOR_CATEGORY.name());
- Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
-
- }
-
-
- @Test
- public void createServiceWithNewCategory() throws Exception {
-
- AdminGeneralPage.selectCategoryManagmetTab();
- String newResourceCategory = ElementFactory.getDefaultCategory().getName();
- String newserviceCategory = ElementFactory.getDefaultCategory().getName();
- String newSubCategory = ElementFactory.getDefaultSubCategory().getName();
- AdminGeneralPage.createNewResourceCategory(newResourceCategory);
- AdminGeneralPage.createNewServiceCategory(newserviceCategory);
- List<WebElement> serviceCategoriesList = AdminGeneralPage.getServiceCategoriesList();
- List<WebElement> resourceCategoriesList = AdminGeneralPage.getResourceCategoriesList();
- AdminGeneralPage.addSubCategoryToResource(resourceCategoriesList, newResourceCategory, newSubCategory);
- GeneralUIUtils.waitForLoader();
- AdminGeneralPage.selectUserManagmetTab();
- reloginWithNewRole(UserRoleEnum.DESIGNER);
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
-
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- List<CategoryDefinition> categories = serviceMetadata.getCategories();
- categories.get(0).setName(newserviceCategory);
-
- ServiceUIUtils.createService(serviceMetadata);
-
- }
-
-
- @Test
- public void createResourceWithNewCategory() throws Exception {
-
- AdminGeneralPage.selectCategoryManagmetTab();
- String newResourceCategory = ElementFactory.getDefaultCategory().getName();
- String newserviceCategory = ElementFactory.getDefaultCategory().getName();
- String newSubCategory = ElementFactory.getDefaultSubCategory().getName();
- AdminGeneralPage.createNewResourceCategory(newResourceCategory);
- AdminGeneralPage.createNewServiceCategory(newserviceCategory);
- List<WebElement> serviceCategoriesList = AdminGeneralPage.getServiceCategoriesList();
- List<WebElement> resourceCategoriesList = AdminGeneralPage.getResourceCategoriesList();
- AdminGeneralPage.addSubCategoryToResource(resourceCategoriesList, newResourceCategory, newSubCategory);
- GeneralUIUtils.waitForLoader();
- AdminGeneralPage.selectUserManagmetTab();
- reloginWithNewRole(UserRoleEnum.DESIGNER);
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
-
- List<CategoryDefinition> categories = resourceMetaData.getCategories();
- CategoryDefinition categoryDefinition = categories.get(0);
- categoryDefinition.setName(newResourceCategory);
- SubCategoryDefinition subCategoryDefinition = categoryDefinition.getSubcategories().get(0);
- subCategoryDefinition.setName(newSubCategory);
-
- ResourceUIUtils.createVF(resourceMetaData, getUser());
-
-
- }
-
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.ADMIN;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CustomizationUUID.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CustomizationUUID.java
deleted file mode 100644
index 9bd14ebd11..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CustomizationUUID.java
+++ /dev/null
@@ -1,332 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.sanity;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactInfo;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.LeftPanelCanvasItems;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.CompositionPage;
-import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.GeneralPageElements;
-import org.openecomp.sdc.ci.tests.pages.HomePage;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.pages.ServiceGeneralPage;
-import org.openecomp.sdc.ci.tests.utilities.ArtifactUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ServiceUIUtils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.verificator.CustomizationUUIDVerificator;
-import org.openecomp.sdc.ci.tests.verificator.ServiceVerificator;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebElement;
-import org.testng.AssertJUnit;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class CustomizationUUID extends SetupCDTest {
-
- private static final String DESCRIPTION = "kuku";
- private static final String ARTIFACT_LABEL = "artifact3";
- private static final String ARTIFACT_LABEL_UPDATE = "artifactUpdate";
- private static final String GET_ARTIFACT_LIST_BY_CLASS_NAME = "i-sdc-designer-sidebar-section-content-item-artifact";
- private static final String HEAT_FILE_YAML_NAME = "Heat-File.yaml";
- private static final String HEAT_FILE_YAML_UPDATE_NAME = "Heat-File-Update.yaml";
- private String filePath;
-
- private CustomizationUUID() {
- }
-
- @BeforeMethod
- public void beforeTest() {
- filePath = FileHandling.getFilePath("");
- }
-
- @Test
- public void uniqueCustomizationUUIDforeachVFi() throws Exception {
-
-
- ResourceReqDetails vfMetaData = createNewResourceWithArtifactCertifyState();
-
- List customizationUUIDs = new ArrayList<String>();
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
-
-
- DeploymentArtifactPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
- CanvasElement VFiElement1 = addElemntToCanvas(vfMetaData, canvasManager);
- CanvasElement VFiElement2 = addElemntToCanvas(vfMetaData, canvasManager);
- CanvasElement VFiElement3 = addElemntToCanvas(vfMetaData, canvasManager);
-
-
- ServiceGeneralPage.clickCheckinButton(serviceMetadata.getName());
-
- canvasManager = findServiceAndNavigateToCanvas(serviceMetadata);
- addCanvasElementToList(customizationUUIDs, canvasManager, VFiElement1);
- addCanvasElementToList(customizationUUIDs, canvasManager, VFiElement2);
- addCanvasElementToList(customizationUUIDs, canvasManager, VFiElement3);
-
- ServiceGeneralPage.clickCheckoutButton();
- canvasManager = CanvasManager.getCanvasManager();
- CanvasElement VFiElement4 = addElemntToCanvas(vfMetaData, canvasManager);
- CanvasElement VFiElement5 = addElemntToCanvas(vfMetaData, canvasManager);
- CanvasElement VFiElement6 = addElemntToCanvas(vfMetaData, canvasManager);
-
- ServiceGeneralPage.clickCheckinButton(serviceMetadata.getName());
- canvasManager = findServiceAndNavigateToCanvas(serviceMetadata);
- addCanvasElementToList(customizationUUIDs, canvasManager, VFiElement4);
- addCanvasElementToList(customizationUUIDs, canvasManager, VFiElement5);
- addCanvasElementToList(customizationUUIDs, canvasManager, VFiElement6);
-
- CustomizationUUIDVerificator.validateCustomizationUUIDuniqueness(customizationUUIDs);
-
-
- }
-
-
- @Test
- public void uniqueCustomizationUUIDafterArtifactCRUDofVFi() throws Exception {
-
-
- ResourceReqDetails vfMetaData = createNewResourceWithArtifactCertifyState();
-
- List customizationUUIDs = new ArrayList<>();
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
-
- DeploymentArtifactPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
- CanvasElement VFiElement1 = addElemntToCanvas(vfMetaData, canvasManager);
-
- ServiceGeneralPage.clickCheckinButton(serviceMetadata.getName());
-
- canvasManager = findServiceAndNavigateToCanvas(serviceMetadata);
- addCanvasElementToList(customizationUUIDs, canvasManager, VFiElement1);
-
- ServiceGeneralPage.clickCheckoutButton();
- canvasManager = CanvasManager.getCanvasManager();
-
- ArtifactInfo artifact = new ArtifactInfo(filePath, HEAT_FILE_YAML_NAME, DESCRIPTION, ARTIFACT_LABEL, ArtifactTypeEnum.SNMP_POLL.getType());
-
- canvasManager.clickOnCanvaElement(VFiElement1);
- CompositionPage.showDeploymentArtifactTab();
- CompositionPage.clickAddArtifactButton();
- ArtifactUIUtils.fillAndAddNewArtifactParameters(artifact, CompositionPage.artifactPopup());
-
-
- ServiceGeneralPage.clickCheckinButton(serviceMetadata.getName());
- canvasManager = findServiceAndNavigateToCanvas(serviceMetadata);
- addCanvasElementToList(customizationUUIDs, canvasManager, VFiElement1);
-
-
- ServiceGeneralPage.clickCheckoutButton();
- canvasManager = CanvasManager.getCanvasManager();
- canvasManager.clickOnCanvaElement(VFiElement1);
- CompositionPage.showDeploymentArtifactTab();
- List<WebElement> actualArtifactList = GeneralUIUtils.getWebElementsListBy(By.className(GET_ARTIFACT_LIST_BY_CLASS_NAME));
- GeneralUIUtils.hoverOnAreaByTestId(DataTestIdEnum.DeploymentArtifactCompositionRightMenu.ARTIFACT_ITEM.getValue() + ARTIFACT_LABEL);
- SetupCDTest.getExtendTest().log(Status.INFO, "Going to delete " + HEAT_FILE_YAML_NAME + " artifact" + " and check if deleted");
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.DeploymentArtifactCompositionRightMenu.DELETE.getValue() + ARTIFACT_LABEL);
- GeneralPageElements.clickOKButton();
-
-
- ServiceGeneralPage.clickCheckinButton(serviceMetadata.getName());
- canvasManager = findServiceAndNavigateToCanvas(serviceMetadata);
- addCanvasElementToList(customizationUUIDs, canvasManager, VFiElement1);
-
-
- CustomizationUUIDVerificator.validateCustomizationUUIDuniqueness(customizationUUIDs);
-
- }
-
-
- @Test
- public void uniqueCustomizationUUIDchangeVFiVersion() throws Exception {
-
-
- ResourceReqDetails vfMetaData = createNewResourceWithArtifactCertifyState();
-
- List customizationUUIDs = new ArrayList<>();
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
-
- DeploymentArtifactPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
- CanvasElement VFiElement1 = addElemntToCanvas(vfMetaData, canvasManager);
-
- ServiceGeneralPage.clickCheckinButton(serviceMetadata.getName());
-
- canvasManager = findServiceAndNavigateToCanvas(serviceMetadata);
- addCanvasElementToList(customizationUUIDs, canvasManager, VFiElement1);
-
- HomePage.navigateToHomePage();
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
- ResourceGeneralPage.clickCheckoutButton();
- ResourceGeneralPage.clickCertifyButton(vfMetaData.getName());
-
-
- canvasManager = findServiceAndNavigateToCanvas(serviceMetadata);
- ServiceGeneralPage.clickCheckoutButton();
- canvasManager = CanvasManager.getCanvasManager();
- canvasManager.clickOnCanvaElement(VFiElement1);
- CompositionPage.changeComponentVersion(canvasManager, VFiElement1, "2.0");
-
- ServiceGeneralPage.clickCheckinButton(serviceMetadata.getName());
- canvasManager = findServiceAndNavigateToCanvas(serviceMetadata);
- addCanvasElementToList(customizationUUIDs, canvasManager, VFiElement1);
-
- CustomizationUUIDVerificator.validateCustomizationUUIDuniqueness(customizationUUIDs);
-
- }
-
-
- @Test
- public void uniqueCustomizationUUIDaddRelation() throws Exception {
-
-
- ResourceReqDetails vfMetaData = createNewResourceWithArtifactCertifyState();
-
- List customizationUUIDs = new ArrayList<>();
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
-
- DeploymentArtifactPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
- CanvasElement VFiElement1 = addElemntToCanvas(vfMetaData, canvasManager);
-
- ServiceGeneralPage.clickCheckinButton(serviceMetadata.getName());
-
- canvasManager = findServiceAndNavigateToCanvas(serviceMetadata);
- addCanvasElementToList(customizationUUIDs, canvasManager, VFiElement1);
-
- HomePage.navigateToHomePage();
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
- ResourceGeneralPage.clickCheckoutButton();
- //TODO Andrey should click on certify button
- ResourceGeneralPage.clickCertifyButton(vfMetaData.getName());
-
- canvasManager = findServiceAndNavigateToCanvas(serviceMetadata);
- ServiceGeneralPage.clickCheckoutButton();
- canvasManager = CanvasManager.getCanvasManager();
- CanvasElement contrailPortElement = canvasManager.createElementOnCanvas(LeftPanelCanvasItems.CONTRAIL_PORT);
- canvasManager.linkElements(contrailPortElement, VFiElement1);
-
- canvasManager.clickOnCanvaElement(VFiElement1);
-
-
- ServiceGeneralPage.clickCheckinButton(serviceMetadata.getName());
- canvasManager = findServiceAndNavigateToCanvas(serviceMetadata);
- addCanvasElementToList(customizationUUIDs, canvasManager, VFiElement1);
-
- CustomizationUUIDVerificator.validateCustomizationUUIDuniqueness(customizationUUIDs);
-
- }
-
-
- public CanvasManager findServiceAndNavigateToCanvas(ServiceReqDetails serviceMetadata) throws Exception {
- CanvasManager canvasManager;
- GeneralUIUtils.findComponentAndClick(serviceMetadata.getName());
- ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
- canvasManager = CanvasManager.getCanvasManager();
- return canvasManager;
- }
-
- public ResourceReqDetails createNewResourceWithArtifactCertifyState() throws Exception {
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(vfMetaData, getUser());
-
- ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
-
- List<ArtifactInfo> deploymentArtifactList = new ArrayList<>();
- deploymentArtifactList.add(new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", "OTHER"));
- deploymentArtifactList.add(new ArtifactInfo(filePath, "sample-xml-alldata-1-1.xml", "cuku", "artifact2", "YANG_XML"));
- for (ArtifactInfo deploymentArtifact : deploymentArtifactList) {
- DeploymentArtifactPage.clickAddNewArtifact();
- ArtifactUIUtils.fillAndAddNewArtifactParameters(deploymentArtifact);
- }
- AssertJUnit.assertTrue("artifact table does not contain artifacts uploaded", DeploymentArtifactPage.checkElementsCountInTable(deploymentArtifactList.size()));
-
- String newDescription = "new description";
- DeploymentArtifactPage.clickEditArtifact(deploymentArtifactList.get(0).getArtifactLabel());
- DeploymentArtifactPage.artifactPopup().insertDescription(newDescription);
- DeploymentArtifactPage.artifactPopup().clickDoneButton();
- String actualArtifactDescription = DeploymentArtifactPage.getArtifactDescription(deploymentArtifactList.get(0).getArtifactLabel());
- AssertJUnit.assertTrue("artifact description is not updated", newDescription.equals(actualArtifactDescription));
-
- DeploymentArtifactPage.clickDeleteArtifact(deploymentArtifactList.get(0).getArtifactLabel());
- DeploymentArtifactPage.clickOK();
-
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
-
- CompositionPage.searchForElement(NormativeTypesEnum.COMPUTE.name());
- CanvasManager canvasManagerVF = CanvasManager.getCanvasManager();
- CanvasElement VFiElement1 = canvasManagerVF.createElementOnCanvas(LeftPanelCanvasItems.COMPUTE);
-
- //TODO Andrey should click on certify button
- ResourceGeneralPage.clickCertifyButton(vfMetaData.getName());
- return vfMetaData;
- }
-
- public void addCanvasElementToList(List customizationUUIDs, CanvasManager canvasManager, CanvasElement VFiElement1)
- throws Exception {
- canvasManager.clickOnCanvaElement(VFiElement1);
- WebElement VFi1customizationUUID = CompositionPage.getCustomizationUUID();
- customizationUUIDs.add(VFi1customizationUUID.getText());
- }
-
- public CanvasElement addElemntToCanvas(ResourceReqDetails vfMetaData, CanvasManager canvasManager)
- throws Exception {
- CompositionPage.searchForElement(vfMetaData.getName());
- CanvasElement VFiElement1 = canvasManager.createElementOnCanvas(vfMetaData.getName());
- return VFiElement1;
- }
-
- public static void changeDeleteAndValidateVersionOnGeneralPage(String previousVersion, String currentVersion, String serviceName) throws Exception {
- GeneralPageElements.selectVersion("V" + previousVersion);
- ServiceVerificator.verifyVersionUI(previousVersion);
- GeneralUIUtils.clickJSOnElementByText("latest version");
- ServiceVerificator.verifyVersionUI(currentVersion);
- GeneralPageElements.clickTrashButtonAndConfirm();
- GeneralUIUtils.findComponentAndClick(serviceName);
- ServiceVerificator.verifyVersionUI(previousVersion);
- }
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/DeploymentViewTests.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/DeploymentViewTests.java
deleted file mode 100644
index 96db11c0db..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/DeploymentViewTests.java
+++ /dev/null
@@ -1,290 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.sanity;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-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.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.DeploymentPage;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.verificator.DeploymentViewVerificator;
-import org.openqa.selenium.WebElement;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.DataProvider;
-import org.testng.annotations.Test;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import static org.testng.Assert.assertTrue;
-
-public class DeploymentViewTests extends SetupCDTest {
-
- private static final int EXPECTED_NUMBER_OF_GROUPS = 3;
- private String filePath;
-
- @BeforeMethod
- public void beforeTest() {
- filePath = FileHandling.getFilePath("");
- }
-
- @DataProvider(name = "CSAR_VF_Files", parallel = false)
- public Object[][] createDataX() {
- return new Object[][]{{"vSeGWNew.csar"}, {"vSeGWNewDoubleMembers.csar"}, {"vSeGWNewSingleModule.csar"}};
- }
-
-
- @Test(dataProvider = "CSAR_VF_Files")
- public void deploymentScreenDCAEAssetImportCSARTest(String baseFileName) throws Exception {
- //
- setLog(baseFileName);
-// getExtendTest().setDescription(baseFileName);
-
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, baseFileName, getUser());
-
- ResourceGeneralPage.getLeftMenu().moveToDeploymentViewScreen();
- List<WebElement> moduleRowsFromTable = GeneralUIUtils.getElementsByCSS(DataTestIdEnum.DeploymentScreen.MODULES.getValue());
- DeploymentViewVerificator verificator = new DeploymentViewVerificator(filePath + baseFileName);
- verificator.verifyDeploymentPageModules(moduleRowsFromTable);
- for (WebElement moduleRow : moduleRowsFromTable) {
- String moduleRowText = moduleRow.getText();
- verificator.verifyDeploymentPageSubElements(moduleRowText.split("\\.\\.")[1]);
- DeploymentPage.updateModuleName(moduleRowText, "updatedName");
- String updatedModuleName = DeploymentPage.reconstructModuleName(moduleRowText.split("\\.\\."), "updatedName");
- verificator.verifyComponentNameChanged(moduleRowText, updatedModuleName);
- // Close module
- GeneralUIUtils.clickOnElementByText(updatedModuleName);
- }
- }
-
- @Test
- public void deploymentScreenDCAEAssetUpdateWithNewGroupCSAR_TC1368223_Test() throws Exception {
- String baseFileName = "baseUpdateMinusGroupFlowVF_NEW.csar";
- String updateFileName = "baseUpdateFlowVF_NEW.csar";
-
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating resource with %s groups ", 2));
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, baseFileName, getUser());
-
- Map<String, HashMap<String, String>> metaDataFromUI = DeploymentPage.collectMetaDataFromUI();
- metaDataFromUI.put("base_ldsa", new HashMap<String, String>() {
- {
- put("version", "0");
- put("moduleID", "primary");
- }
- });
-
- // add new group, base_ldsa
- ResourceGeneralPage.getLeftMenu().moveToGeneralScreen();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating VF with new file, should be %s groups now", EXPECTED_NUMBER_OF_GROUPS));
- ResourceUIUtils.updateVfWithCsar(filePath, updateFileName);
-
- DeploymentViewVerificator.regularDepoymentScreenVerificator(metaDataFromUI, new DeploymentViewVerificator(filePath + updateFileName));
- DeploymentViewVerificator.validateModuleNameUpadate();
- }
-
- @Test
- public void deploymentScreenDCAEAssetDeleteGroupFromCSAR_TC1368281_Test() throws Exception {
- String baseFileName = "baseUpdateFlowVF_NEW.csar";
- String updateFileName = "baseUpdateMinusGroupFlowVF_NEW.csar";
-
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating resource with %s groups ", EXPECTED_NUMBER_OF_GROUPS));
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, baseFileName, getUser());
-
- Map<String, HashMap<String, String>> metaDataFromUI = DeploymentPage.collectMetaDataFromUI();
-
- // remove group base_ldsa
- ResourceGeneralPage.getLeftMenu().moveToGeneralScreen();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating VF with new file, should be %s groups now, base_ldsa group should be removed", 2));
- ResourceUIUtils.updateVfWithCsar(filePath, updateFileName);
-
- // validate that group was removed
- DeploymentViewVerificator.regularDepoymentScreenVerificator(metaDataFromUI, new DeploymentViewVerificator(filePath + updateFileName));
-
- Map<String, HashMap<String, String>> metaDataFromUI2 = DeploymentPage.collectMetaDataFromUI();
- metaDataFromUI2.put("base_ldsa", new HashMap<String, String>() {
- {
- put("version", "0");
- put("moduleID", "primary");
- }
- });
-
- ResourceGeneralPage.getLeftMenu().moveToGeneralScreen();
- // add group base_ldsa
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating VF with new file, should be %s groups now, base_ldsa group should be added", EXPECTED_NUMBER_OF_GROUPS));
- ResourceUIUtils.updateVfWithCsar(filePath, baseFileName);
-
- // validate that group was added
- DeploymentViewVerificator.regularDepoymentScreenVerificator(metaDataFromUI2, new DeploymentViewVerificator(filePath + baseFileName));
- DeploymentViewVerificator.validateModuleNameUpadate();
- }
-
- @Test
- public void deploymentScreenDCAEAssetUpdateWithNewGroupWithoutMembersCSAR_TC1368280_Test() throws Exception {
-
- String baseFileName = "baseUpdateMinusGroupFlowVF_NEW.csar";
- String updateFileName = "baseUpdateAddGroupNoMembersUpdateFlow_NEW.csar";
- String updateFileName2 = "baseUpdateFlowVF_NEW.csar";
-
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating resource with %s groups ", 2));
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, baseFileName, getUser());
-
- // add new group without members, base_ldsa
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating VF with new file, should be %s groups now, base_ldsa group without members", EXPECTED_NUMBER_OF_GROUPS));
- ResourceUIUtils.updateVfWithCsar(filePath, updateFileName);
-
- Map<String, HashMap<String, String>> metaDataFromUI = DeploymentPage.collectMetaDataFromUI();
-
- // validate that group was added and no members exist
- DeploymentViewVerificator.regularDepoymentScreenVerificator(null, new DeploymentViewVerificator(filePath + updateFileName));
-
- ResourceGeneralPage.getLeftMenu().moveToGeneralScreen();
- // add group base_ldsa with members
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating VF with new file, should be %s groups now, base_ldsa group with members", EXPECTED_NUMBER_OF_GROUPS));
- ResourceUIUtils.updateVfWithCsar(filePath, updateFileName2);
-
- // validate that member was added to base_ldsa group
- DeploymentViewVerificator.regularDepoymentScreenVerificator(metaDataFromUI, new DeploymentViewVerificator(filePath + updateFileName2));
- DeploymentViewVerificator.validateModuleNameUpadate();
- }
-
-
- @Test
- public void deploymentScreenDCAEAssetImportCSARWithArtifactSection_TC1368282_1_Test() throws Exception {
- String baseFileName = "baseUpdateFlowTwoArtifactsToGroup_NEW.csar";
-
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating resource with %s groups, should be 4 artifacts in every group ", EXPECTED_NUMBER_OF_GROUPS));
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, baseFileName, getUser());
-
- DeploymentViewVerificator.regularDepoymentScreenVerificator(null, new DeploymentViewVerificator(filePath + baseFileName));
- DeploymentViewVerificator.validateModuleNameUpadate();
- }
-
- @Test
- public void deploymentScreenDCAEAssetImportCSARRemoveArtifact_TC1368282_2_Test() throws Exception {
- String baseFileName = "baseUpdateFlowTwoArtifactsToGroup_NEW.csar";
- String updateFileName = "baseUpdateFlowOneArtifactToGroup_NEW.csar";
-
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating resource with %s groups, should be 4 artifacts in every group ", EXPECTED_NUMBER_OF_GROUPS));
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, baseFileName, getUser());
-
- Map<String, HashMap<String, String>> metaDataFromUI = DeploymentPage.collectMetaDataFromUI();
-
- ResourceGeneralPage.getLeftMenu().moveToGeneralScreen();
- // remove artifact from every group
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating VF with new file, should be 3 artifacts in every group"));
- ResourceUIUtils.updateVfWithCsar(filePath, updateFileName);
-
- DeploymentViewVerificator.regularDepoymentScreenVerificator(metaDataFromUI, new DeploymentViewVerificator(filePath + updateFileName));
- DeploymentViewVerificator.validateModuleNameUpadate();
- }
-
- @Test
- public void deploymentScreenDCAEAssetImportCSARAddArtifact_TC1368282_3_Test() throws Exception {
- String baseFileName = "baseUpdateFlowTwoArtifactsToGroup_NEW.csar";
- String updateFileName = "baseUpdateFlowOneArtifactToGroup_NEW.csar";
-
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating resource with %s groups, should be 3 artifacts in every group ", EXPECTED_NUMBER_OF_GROUPS));
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, updateFileName, getUser());
-
- Map<String, HashMap<String, String>> metaDataFromUI = DeploymentPage.collectMetaDataFromUI();
-
- ResourceGeneralPage.getLeftMenu().moveToGeneralScreen();
- // add artifact to every group
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating VF with new file, should be 4 artifacts in every group"));
- ResourceUIUtils.updateVfWithCsar(filePath, baseFileName);
-
- DeploymentViewVerificator.regularDepoymentScreenVerificator(metaDataFromUI, new DeploymentViewVerificator(filePath + baseFileName));
- DeploymentViewVerificator.validateModuleNameUpadate();
- }
-
- @Test
- public void deploymentScreenDCAEAssetImportCSARMixArtifacts_TC1368282_4_Test() throws Exception {
- String baseFileName = "baseUpdateFlowTwoArtifactsToGroup_NEW.csar";
- String updateFileName = "baseUpdateMixedArtifacts_NEW.csar";
-
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating resource with %s groups, should be 4 artifacts in every group ", EXPECTED_NUMBER_OF_GROUPS));
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, baseFileName, getUser());
-
- Map<String, HashMap<String, String>> metaDataFromUI = DeploymentPage.collectMetaDataFromUI();
-
- ResourceGeneralPage.getLeftMenu().moveToGeneralScreen();
- //mix artifacts between groups
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating VF with new file, mixing between artifacts and groups", EXPECTED_NUMBER_OF_GROUPS));
- ResourceUIUtils.updateVfWithCsar(filePath, updateFileName);
-
- DeploymentViewVerificator.regularDepoymentScreenVerificator(metaDataFromUI, new DeploymentViewVerificator());
- DeploymentViewVerificator.validateModuleNameUpadate();
- }
-
- @Test
- public void deploymentScreenDCAEAssetUpdateVFModule_TC1296437_Test() throws Exception {
- String baseFileName = "baseUpdateMinusGroupFlowVF_NEW.csar";
- String updateFileName = "baseUpdateFlowVF_NEW.csar";
-
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating resource with %s groups ", 2));
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, baseFileName, getUser());
-// SetupCDTest.getExtendTest().log(Status.INFO, String.format("Validating %s group version, should be %s ", moduleRowText, metaDataFromUI.get(moduleRowText.split("\\.\\.")[1])));
-
- Map<String, HashMap<String, String>> metaDataFromUI = DeploymentPage.collectMetaDataFromUI();
- metaDataFromUI.put("base_ldsa", new HashMap<String, String>() {
- {
- put("version", "0");
- put("moduleID", "primary");
- }
- });
-
- DeploymentViewVerificator.validateEditPopover();
-
- ResourceGeneralPage.getLeftMenu().moveToGeneralScreen();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating VF with new file, should be %s groups now", EXPECTED_NUMBER_OF_GROUPS));
- ResourceUIUtils.updateVfWithCsar(filePath, updateFileName);
-
- assertTrue(resourceMetaData.getName().equals(ResourceGeneralPage.getNameText()));
- DeploymentViewVerificator.regularDepoymentScreenVerificator(metaDataFromUI, new DeploymentViewVerificator(filePath + updateFileName));
- DeploymentViewVerificator.validateModuleNameUpadate();
- }
-
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/GAB.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/GAB.java
deleted file mode 100644
index 757c34926a..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/GAB.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2020 Nokia Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.sanity;
-
-import com.aventstack.extentreports.Status;
-import java.util.Collections;
-import java.util.List;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactInfo;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.GeneralPageElements;
-import org.openecomp.sdc.ci.tests.utilities.ArtifactUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebElement;
-import org.testng.AssertJUnit;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-public class GAB extends SetupCDTest {
-
- private static final int THREAD_SLEEP_TIME = 1000;
-
- private String pnfFilePath;
- private String vnfFilePath;
-
- @BeforeClass
- public void beforeClass() {
- pnfFilePath = FileHandling.getFilePath("PNFs");
- vnfFilePath = FileHandling.getFilePath("VNFs");
- }
-
- @Test
- public void addPmDictionaryDeploymentArtifactToPnfAndCheckMagnifierTest() throws Exception {
- final int expectedHeaderSize = 10;
- final int expectedRowSize = 3;
- ResourceReqDetails pnfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.PNF, getUser());
- ResourceUIUtils.createPNF(pnfMetaData, getUser());
- GeneralPageElements.getLeftMenu().moveToDeploymentArtifactScreen();
- ArtifactInfo art1 = new ArtifactInfo(pnfFilePath, "pmDictionary.yml", "desc", "artifactpm", "PM_DICTIONARY");
- addArtifactAndOpenGAB(art1);
- assertHeaderAndRowSize(expectedHeaderSize, expectedRowSize);
- }
-
- @Test
- public void addVesEventsDeploymentArtifactToVfAndCheckMagnifierTest() throws Exception {
- final int expectedHeaderSize = 4;
- final int expectedRowSize = 3;
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(vfMetaData, getUser());
- GeneralPageElements.getLeftMenu().moveToDeploymentArtifactScreen();
- ArtifactInfo art1 = new ArtifactInfo(vnfFilePath, "vesEvent.yml", "desc", "artifactfault", "VES_EVENTS");
- addArtifactAndOpenGAB(art1);
- assertHeaderAndRowSize(expectedHeaderSize, expectedRowSize);
- }
-
- private void addArtifactAndOpenGAB(ArtifactInfo art1) throws Exception {
- addNewArtifact(Collections.singletonList(art1));
- openGABPopup(art1);
- }
-
- private void assertHeaderAndRowSize(final int expectedHeaderSize, final int expectedRowSize) {
- final List<WebElement> headers = getListOfHeaders();
- AssertJUnit.assertEquals(expectedHeaderSize, headers.size());
- final List<WebElement> rows = getListOfRows();
- AssertJUnit.assertEquals(expectedRowSize, rows.size());
- }
-
- private List<WebElement> getListOfRows() {
- return GeneralUIUtils.getWebElementsListBy(By.xpath("//sdc-modal//datatable-body//datatable-body-row"));
- }
-
- private void openGABPopup(ArtifactInfo art1) throws InterruptedException {
- SetupCDTest.getExtendTest()
- .log(Status.INFO, String.format("Clicking on magnifier button %s", art1.getArtifactLabel()));
- WebElement magnifierButtonElement = GeneralUIUtils.getWebElementByTestID(
- DataTestIdEnum.ArtifactPageEnum.BROWSE_ARTIFACT.getValue() + art1.getArtifactLabel());
- SetupCDTest.getExtendTest()
- .log(Status.INFO, String.format("Found magnifier button: %s", magnifierButtonElement.getText()));
- magnifierButtonElement.click();
- Thread.sleep(THREAD_SLEEP_TIME); // have to wait until table will be rendered
- }
-
- private List<WebElement> getListOfHeaders() {
- return GeneralUIUtils.getWebElementsListBy(By.xpath("//sdc-modal//datatable-header//datatable-header-cell"));
- }
-
- private void addNewArtifact(List<ArtifactInfo> deploymentArtifactList) throws Exception {
- for (ArtifactInfo deploymentArtifact : deploymentArtifactList) {
- DeploymentArtifactPage.clickAddNewArtifact();
- ArtifactUIUtils.fillAndAddNewArtifactParameters(deploymentArtifact);
- }
- AssertJUnit.assertTrue(DeploymentArtifactPage.checkElementsCountInTable(deploymentArtifactList.size()));
- }
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ImportDCAE.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ImportDCAE.java
deleted file mode 100644
index 5e240c025b..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ImportDCAE.java
+++ /dev/null
@@ -1,682 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.sanity;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.LifecycleStateEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactInfo;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.InformationalArtifactsPlaceholders;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.LeftPanelCanvasItems;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.ResourceMetadataEnum;
-import org.openecomp.sdc.ci.tests.datatypes.LifeCycleStateEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.PropertyTypeEnum;
-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.http.RestResponse;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.CompositionPage;
-import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.GeneralPageElements;
-import org.openecomp.sdc.ci.tests.pages.InformationalArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.InputsPage;
-import org.openecomp.sdc.ci.tests.pages.PropertiesPage;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.pages.ToscaArtifactsPage;
-import org.openecomp.sdc.ci.tests.utilities.ArtifactUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.PropertiesUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.RestCDUtils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
-import org.openecomp.sdc.ci.tests.verificator.ServiceVerificator;
-import org.openecomp.sdc.ci.tests.verificator.VfVerificator;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebElement;
-import org.testng.Assert;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.testng.AssertJUnit.assertTrue;
-
-public class ImportDCAE extends SetupCDTest {
-
- private static final int CLICKING_ON_ELEMENT_TIMEOUT = 30;
-
- private static final String SERVICE_INPUT_TEST_VF2_CSAR = "service_input_test_VF2.csar";
- private String filePath;
-
- @BeforeMethod
- public void beforeTest() {
- filePath = FileHandling.getFilePath("");
- }
-
- @Test
- public void updateDCAEAsset() throws Exception {
- ResourceReqDetails resourceMetaData = createDCAEAsset();
-
- // update Resource
- ResourceReqDetails updatedResource = new ResourceReqDetails();
- updatedResource.setName(ElementFactory.getResourcePrefix() + "UpdatedName" + resourceMetaData.getName());
- updatedResource.setDescription("kuku");
- updatedResource.setVendorName("updatedVendor");
- updatedResource.setVendorRelease("updatedRelease");
- updatedResource.setContactId("ab0001");
- updatedResource.setCategories(resourceMetaData.getCategories());
- updatedResource.setVersion("0.1");
- List<String> newTags = resourceMetaData.getTags();
- newTags.remove(resourceMetaData.getName());
- newTags.add(updatedResource.getName());
- updatedResource.setTags(newTags);
- ResourceUIUtils.updateResource(updatedResource, getUser());
-
- VfVerificator.verifyVFMetadataInUI(updatedResource);
- VfVerificator.verifyVFUpdated(updatedResource, getUser());
- }
-
- @Test
- public void vfcLinkedToComputeInDCAEAssetFlowTest() throws Exception {
- final int expectedNumberOfComponentInstances = 4;
- String fileName = "importVFC_VFC14.yml";
- ResourceReqDetails atomicResourceMetaData =
- ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(
- ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT,
- ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
-
- try {
- ResourceUIUtils.importVfc(atomicResourceMetaData, filePath, fileName, getUser());
- //TODO Andrey should click on certify button
- ResourceGeneralPage.clickCertifyButton(atomicResourceMetaData.getName());
-
- /*reloginWithNewRole(UserRoleEnum.TESTER);
- GeneralUIUtils.findComponentAndClick(atomicResourceMetaData.getName());
- TesterOperationPage.certifyComponent(atomicResourceMetaData.getName());
-
- reloginWithNewRole(UserRoleEnum.DESIGNER);*/
- ResourceReqDetails resourceMetaData = createDCAEAsset();
-
- DeploymentArtifactPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
- CanvasElement computeElement = canvasManager.createElementOnCanvas(LeftPanelCanvasItems.COMPUTE);
- CompositionPage.searchForElement(atomicResourceMetaData.getName());
- CanvasElement cpElement = canvasManager.createElementOnCanvas(atomicResourceMetaData.getName());
- Assert.assertNotNull(cpElement);
- ServiceVerificator.verifyNumOfComponentInstances(
- resourceMetaData, "0.1",
- expectedNumberOfComponentInstances, getUser());
-
- canvasManager.linkElements(cpElement, computeElement);
-
- resourceMetaData.setVersion("0.1");
- VfVerificator.verifyLinkCreated(resourceMetaData, getUser(), 1);
- } finally {
- ResourceRestUtils.deleteResourceByNameAndVersion(atomicResourceMetaData.getName(), "1.0");
- }
-
- }
-
- @Test
- public void addUpdateDeleteDeploymentArtifactToDCAEAssetTest() throws Exception {
- createDCAEAsset();
- ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
-
- List<ArtifactInfo> deploymentArtifactList = new ArrayList<>();
- deploymentArtifactList.add(new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", ArtifactTypeEnum.OTHER.getType()));
- deploymentArtifactList.add(new ArtifactInfo(filePath, "sample-xml-alldata-1-1.xml", "cuku", "artifact2", ArtifactTypeEnum.YANG_XML.getType()));
- for (ArtifactInfo deploymentArtifact : deploymentArtifactList) {
- DeploymentArtifactPage.clickAddNewArtifact();
- ArtifactUIUtils.fillAndAddNewArtifactParameters(deploymentArtifact);
- }
- assertTrue("artifact table does not contain artifacts uploaded", DeploymentArtifactPage.checkElementsCountInTable(deploymentArtifactList.size()));
-
- String newDescription = "new description";
- DeploymentArtifactPage.clickEditArtifact(deploymentArtifactList.get(0).getArtifactLabel());
- DeploymentArtifactPage.artifactPopup().insertDescription(newDescription);
- DeploymentArtifactPage.artifactPopup().clickDoneButton();
- String actualArtifactDescription = DeploymentArtifactPage.getArtifactDescription(deploymentArtifactList.get(0).getArtifactLabel());
- assertTrue("artifact description is not updated", newDescription.equals(actualArtifactDescription));
-
- DeploymentArtifactPage.clickDeleteArtifact(deploymentArtifactList.get(0).getArtifactLabel());
- DeploymentArtifactPage.clickOK();
- assertTrue("artifact " + deploymentArtifactList.get(0).getArtifactLabel() + "is not deleted", DeploymentArtifactPage.checkElementsCountInTable(deploymentArtifactList.size() - 1));
-
- assertTrue("artifact " + deploymentArtifactList.get(1).getArtifactLabel() + "is not displayed", DeploymentArtifactPage.clickOnArtifactDescription(deploymentArtifactList.get(1).getArtifactLabel()).isDisplayed());
- }
-
- @Test
- public void addUpdateDeleteInformationalArtifactDCAEAssetTest() throws Exception {
- createDCAEAsset();
- ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen();
-
- ArtifactInfo informationalArtifact = new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", ArtifactTypeEnum.OTHER.getType());
- InformationalArtifactPage.clickAddNewArtifact();
- ArtifactUIUtils.fillAndAddNewArtifactParameters(informationalArtifact);
-
- assertTrue("artifact table does not contain artifacts uploaded", InformationalArtifactPage.checkElementsCountInTable(1));
-
- String newDescription = "new description";
- InformationalArtifactPage.clickEditArtifact(informationalArtifact.getArtifactLabel());
- InformationalArtifactPage.artifactPopup().insertDescription(newDescription);
- InformationalArtifactPage.artifactPopup().clickDoneButton();
- String actualArtifactDescription = InformationalArtifactPage.getArtifactDescription(informationalArtifact.getArtifactLabel());
- assertTrue("artifact description is not updated", newDescription.equals(actualArtifactDescription));
-
- InformationalArtifactPage.clickDeleteArtifact(informationalArtifact.getArtifactLabel());
- InformationalArtifactPage.clickOK();
- assertTrue("artifact " + informationalArtifact.getArtifactLabel() + "is not deleted", InformationalArtifactPage.checkElementsCountInTable(0));
- }
-
- @Test
- public void addPropertiesToVfcInstanceInDCAEAssetTest() throws Exception {
-
- if (true) {
-// throw new SkipException("Open bug 373762, can't update properties on CP or VFC instance on Composition screen");
- SetupCDTest.getExtendTest().log(Status.INFO, "Open bug 373762, can't update properties on CP or VFC instance on Composition screen");
- }
-
- String fileName = "importVFC_VFC15.yml";
- ResourceReqDetails atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
-
- try {
- ResourceUIUtils.importVfc(atomicResourceMetaData, filePath, fileName, getUser());
- ResourceGeneralPage.clickCheckinButton(atomicResourceMetaData.getName());
-
- createDCAEAsset();
-
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager vfCanvasManager = CanvasManager.getCanvasManager();
- CompositionPage.searchForElement(atomicResourceMetaData.getName());
- CanvasElement vfcElement = vfCanvasManager.createElementOnCanvas(atomicResourceMetaData.getName());
-
- vfCanvasManager.clickOnCanvaElement(vfcElement);
- CompositionPage.showPropertiesAndAttributesTab();
- List<WebElement> properties = CompositionPage.getProperties();
- String propertyValue = "abc123";
- for (int i = 0; i < 2; i++) {
- WebElement findElement = properties.get(i).findElement(By.className("i-sdc-designer-sidebar-section-content-item-property-and-attribute-label"));
- findElement.click();
- PropertiesPage.getPropertyPopup().insertPropertyDefaultValue(propertyValue);
- PropertiesPage.getPropertyPopup().clickSave();
-
- findElement = properties.get(i).findElement(By.className("i-sdc-designer-sidebar-section-content-item-property-value"));
- assertTrue(findElement.getText().equals(propertyValue));
- }
- } finally {
- ResourceRestUtils.deleteResourceByNameAndVersion(atomicResourceMetaData.getName(), "0.1");
- }
- }
-
- @Test
- public void changeInstanceVersionDCAEAssetTest() throws Exception {
- ResourceReqDetails atomicResourceMetaData = null;
- ResourceReqDetails vfMetaData = null;
- CanvasManager vfCanvasManager;
- CanvasElement vfcElement = null;
- String fileName = "importVFC_VFC16.yml";
- try {
- atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
- ResourceUIUtils.importVfc(atomicResourceMetaData, filePath, fileName, getUser());
- //TODO Andrey changed to click on checkIn button
- ResourceGeneralPage.clickCheckinButton(atomicResourceMetaData.getName());
-
- vfMetaData = createDCAEAsset();
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- vfCanvasManager = CanvasManager.getCanvasManager();
- CompositionPage.searchForElement(atomicResourceMetaData.getName());
- vfcElement = vfCanvasManager.createElementOnCanvas(atomicResourceMetaData.getName());
- //TODO Andrey should click on certify button
- CompositionPage.clickCertifyButton(vfMetaData.getName());
- assert (false);
- } catch (Exception e) {
- String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
- String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.VALIDATED_RESOURCE_NOT_FOUND.name());
- Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
- GeneralUIUtils.closeErrorMessage();
- GeneralPageElements.clickOnHomeButton();
-
- GeneralUIUtils.findComponentAndClick(atomicResourceMetaData.getName());
- ResourceGeneralPage.clickCertifyButton(atomicResourceMetaData.getName());
-
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
- ResourceGeneralPage.clickCheckoutButton();
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- vfMetaData.setVersion("0.2");
- vfCanvasManager = CanvasManager.getCanvasManager();
- CompositionPage.changeComponentVersion(vfCanvasManager, vfcElement, "1.0");
-
- //verfication
- VfVerificator.verifyInstanceVersion(vfMetaData, getUser(), atomicResourceMetaData.getName(), "1.0");
- } finally {
- ResourceRestUtils.deleteResourceByNameAndVersion(atomicResourceMetaData.getName(), "1.0");
- }
-
- }
-
- // future removed from ui
- @Test(enabled = true)
- public void addUpdateDeleteSimplePropertiesToDCAEAssetTest() throws Exception {
- createDCAEAsset();
-
- ResourceGeneralPage.getLeftMenu().moveToPropertiesScreen();
- List<PropertyTypeEnum> propertyList = Arrays.asList(PropertyTypeEnum.STRING, PropertyTypeEnum.INTEGER);
- int propertiesCount = PropertiesPage.getElemenetsFromTable().size();
- for (PropertyTypeEnum prop : propertyList) {
- PropertiesUIUtils.addNewProperty(prop);
- }
- assertTrue(GeneralUIUtils.checkElementsCountInTable(propertiesCount + propertyList.size(), () -> PropertiesPage.getElemenetsFromTable()));
- VfVerificator.verifyPropertiesInUI(propertyList);
- PropertiesPage.verifyTotalProperitesField(propertiesCount + propertyList.size());
-
- PropertyTypeEnum prop = propertyList.get(0);
- prop.setDescription("updatedDescription");
- prop.setValue("value");
- PropertiesUIUtils.updateProperty(prop);
-
- PropertiesPage.clickDeletePropertyArtifact(prop.getName());
- assertTrue(GeneralUIUtils.checkElementsCountInTable(propertiesCount + propertyList.size() - 1, () -> PropertiesPage.getElemenetsFromTable()));
- }
-
- // future removed from ui
- @Test(enabled = true)
- public void DCAEAssetInstancesInputScreenTest() throws Exception {
- createDCAEAsset();
-
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager vfCanvasManager = CanvasManager.getCanvasManager();
-
- Map<String, String> elementsIntancesMap = new HashMap<String, String>();
- for (LeftPanelCanvasItems element : Arrays.asList(LeftPanelCanvasItems.DATABASE)) {
- CanvasElement elementOnCanvas = vfCanvasManager.createElementOnCanvas(element);
- vfCanvasManager.clickOnCanvaElement(elementOnCanvas);
- String selectedInstanceName = CompositionPage.getSelectedInstanceName();
- elementsIntancesMap.put(selectedInstanceName, element.getValue());
- }
-
- CompositionPage.moveToInputsScreen();
- int canvasElementsSize = vfCanvasManager.getCanvasElements().size() + 2;
- List<String> inputsNamesFromTable = InputsPage.getVFCInstancesNamesFromTable();
- assertTrue(String.format("Instances count is not as Expected: %s Actual: %s", canvasElementsSize, inputsNamesFromTable.size()), inputsNamesFromTable.size() == canvasElementsSize);
-
- for (String instanceName : inputsNamesFromTable) {
- String resourceName = instanceName.split(" ")[0];
- ResourceReqDetails resource = new ResourceReqDetails();
- resource.setName(resourceName);
- resource.setVersion("1.0");
- if (resourceName.equals("Port")) {
- resource.setResourceType(ResourceTypeEnum.CP.toString());
- } else {
- resource.setResourceType(ResourceTypeEnum.VFC.toString());
- }
- RestResponse restResponse = RestCDUtils.getResource(resource, getUser());
- Map<String, String> propertiesNameTypeJson = ResponseParser.getPropertiesNameType(restResponse);
-
- List<WebElement> propertyRowsFromTable = InputsPage.getInstancePropertiesList(resourceName);
- assertTrue("Some properties are missing in table. Instance name is : " + resourceName, propertyRowsFromTable.size() == propertiesNameTypeJson.size());
- VfVerificator.verifyVfInputs(instanceName, propertiesNameTypeJson, propertyRowsFromTable);
-
- GeneralUIUtils.clickOnElementByText(resourceName);
- }
- }
-
- @Test
- public void addAllInformationalArtifactPlaceholdersInDCAEAssetTest() throws Exception {
- createDCAEAsset();
- ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen();
- int fileNameCounter = 0;
- String fileName;
- for (InformationalArtifactsPlaceholders informArtifact : InformationalArtifactsPlaceholders.values()) {
- fileName = HEAT_FILE_YAML_NAME_PREFIX + fileNameCounter + HEAT_FILE_YAML_NAME_SUFFIX;
- ArtifactUIUtils.fillPlaceHolderInformationalArtifact(informArtifact,
- FileHandling.getFilePath("uniqueFileNames"), fileName, informArtifact.getValue());
- fileNameCounter++;
- }
-
- assertThat(InformationalArtifactPage.checkElementsCountInTable(InformationalArtifactsPlaceholders.values().length)).isTrue();
- }
-
- @Test
- public void verifyToscaArtifactsExistDCAEAssetTest() throws Exception {
- ResourceReqDetails vfMetaData = createDCAEAsset();
-
- final int numOfToscaArtifacts = 2;
- ResourceGeneralPage.getLeftMenu().moveToToscaArtifactsScreen();
- assertTrue(ToscaArtifactsPage.checkElementsCountInTable(numOfToscaArtifacts));
-
- for (int i = 0; i < numOfToscaArtifacts; i++) {
- String typeFromScreen = ToscaArtifactsPage.getArtifactType(i);
- assertTrue(typeFromScreen.equals(ArtifactTypeEnum.TOSCA_CSAR.getType()) || typeFromScreen.equals(ArtifactTypeEnum.TOSCA_TEMPLATE.getType()));
- }
- //TODO Andrey should click on certify button
- ToscaArtifactsPage.clickCertifyButton(vfMetaData.getName());
- vfMetaData.setVersion("1.0");
- VfVerificator.verifyToscaArtifactsInfo(vfMetaData, getUser());
- }
-
- @Test
- public void DCAEAssetCertificationTest() throws Exception {
- ResourceReqDetails vfMetaData = createDCAEAsset();
-
- String vfName = vfMetaData.getName();
-
- ResourceGeneralPage.clickCheckinButton(vfName);
- GeneralUIUtils.findComponentAndClick(vfName);
- //TODO Andrey should click on certify button
- ResourceGeneralPage.clickCertifyButton(vfName);
-
- /*reloginWithNewRole(UserRoleEnum.TESTER);
- GeneralUIUtils.findComponentAndClick(vfName);
- TesterOperationPage.certifyComponent(vfName);*/
-
- vfMetaData.setVersion("1.0");
- VfVerificator.verifyVFLifecycle(vfMetaData, getUser(), LifecycleStateEnum.CERTIFIED);
-
- /*reloginWithNewRole(UserRoleEnum.DESIGNER);*/
- GeneralUIUtils.findComponentAndClick(vfName);
- VfVerificator.verifyVfLifecycleInUI(LifeCycleStateEnum.CERTIFIED);
- }
-
- @Test
- public void deleteDCAEAssetCheckedoutTest() throws Exception {
- ResourceReqDetails vfMetaData = createDCAEAsset();
-
- GeneralPageElements.clickTrashButtonAndConfirm();
-
- vfMetaData.setVersion("0.1");
- VfVerificator.verifyVfDeleted(vfMetaData, getUser());
- }
-
- @Test
- public void revertDCAEAssetMetadataTest() throws Exception {
- ResourceReqDetails vfMetaData = createDCAEAsset();
-
- ResourceReqDetails vfRevertDetails = new ResourceReqDetails();
- vfRevertDetails.setName("ciUpdatedName");
- vfRevertDetails.setDescription("kuku");
- vfRevertDetails.setCategories(vfMetaData.getCategories());
- vfRevertDetails.setVendorName("updatedVendor");
- vfRevertDetails.setVendorRelease("updatedRelease");
- ResourceUIUtils.fillResourceGeneralInformationPage(vfRevertDetails, getUser(), false);
-
- GeneralPageElements.clickRevertButton();
-
- VfVerificator.verifyVFMetadataInUI(vfMetaData);
- }
-
- @Test
- public void addDeploymentArtifactInCompositionScreenDCAEAssetTest() throws Exception {
- createDCAEAsset();
-
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
-
- ArtifactInfo artifact = new ArtifactInfo(filePath, "Heat-File.yaml", "kuku", "artifact3", ArtifactTypeEnum.OTHER.getType());
- CompositionPage.showDeploymentArtifactTab();
- CompositionPage.clickAddArtifactButton();
- ArtifactUIUtils.fillAndAddNewArtifactParameters(artifact, CompositionPage.artifactPopup());
-
- List<WebElement> actualArtifactList = GeneralUIUtils.getWebElementsListBy(By.className("i-sdc-designer-sidebar-section-content-item-artifact"));
- Assert.assertEquals(1, actualArtifactList.size());
- }
-
- // future removed from ui
- @Test(enabled = true)
- public void addPropertyInCompositionScreenDCAEAssetTest() throws Exception {
- createDCAEAsset();
-
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
-
- CompositionPage.showPropertiesAndAttributesTab();
- List<PropertyTypeEnum> propertyList = Arrays.asList(PropertyTypeEnum.STRING, PropertyTypeEnum.INTEGER);
- int propertiesCount = CompositionPage.getProperties().size();
- for (PropertyTypeEnum prop : propertyList) {
- PropertiesUIUtils.addNewProperty(prop);
- }
- assertTrue(GeneralUIUtils.checkElementsCountInTable(propertiesCount + propertyList.size(), () -> CompositionPage.getProperties()));
- }
-
- @Test
- public void addDeploymentArtifactAndVerifyInCompositionScreenDCAEAssetTest() throws Exception {
- createDCAEAsset();
-
- ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
-
- ArtifactInfo deploymentArtifact = new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", ArtifactTypeEnum.OTHER.getType());
- DeploymentArtifactPage.clickAddNewArtifact();
- ArtifactUIUtils.fillAndAddNewArtifactParameters(deploymentArtifact);
- assertTrue(DeploymentArtifactPage.checkElementsCountInTable(1));
-
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
-
- CompositionPage.showDeploymentArtifactTab();
- List<WebElement> deploymentArtifactsFromScreen = CompositionPage.getDeploymentArtifacts();
- assertTrue(1 == deploymentArtifactsFromScreen.size());
-
- String actualArtifactFileName = deploymentArtifactsFromScreen.get(0).getText();
- assertTrue("asc_heat-0-2.yaml".equals(actualArtifactFileName));
- }
-
- @Test
- public void checkoutDCAEAssetTest() throws Exception {
- ResourceReqDetails vfMetaData = createDCAEAsset();
-
- ResourceGeneralPage.clickCheckinButton(vfMetaData.getName());
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
- GeneralPageElements.clickCheckoutButton();
-
- vfMetaData.setVersion("0.2");
- VfVerificator.verifyVFLifecycle(vfMetaData, getUser(), LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
- VfVerificator.verifyVfLifecycleInUI(LifeCycleStateEnum.CHECKOUT);
- //TODO Andrey should click on certify button
- ResourceGeneralPage.clickCertifyButton(vfMetaData.getName());
-
- /*reloginWithNewRole(UserRoleEnum.TESTER);
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
- TesterOperationPage.certifyComponent(vfMetaData.getName());
-
- reloginWithNewRole(UserRoleEnum.DESIGNER);*/
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
- ResourceGeneralPage.clickCheckoutButton();
-
- vfMetaData.setVersion("1.1");
- vfMetaData.setUniqueId(null);
- VfVerificator.verifyVFLifecycle(vfMetaData, getUser(), LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
- VfVerificator.verifyVfLifecycleInUI(LifeCycleStateEnum.CHECKOUT);
- }
-
- @Test
- public void deleteInstanceFromDCAEAssetCanvas() throws Exception {
- ResourceReqDetails vfMetaData = createDCAEAsset();
-
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager vfCanvasManager = CanvasManager.getCanvasManager();
- CanvasElement computeElement = CompositionPage.addElementToCanvasScreen(LeftPanelCanvasItems.COMPUTE, vfCanvasManager);
-
- vfCanvasManager.clickOnCanvaElement(computeElement);
- vfCanvasManager.deleteElementFromCanvas(computeElement);
-
- VfVerificator.verifyNumOfComponentInstances(vfMetaData, 2, getUser());
- }
-
- @Test
- public void changeInstanceNameInDCAEAssetTest() throws Exception {
- createDCAEAsset();
-
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager vfCanvasManager = CanvasManager.getCanvasManager();
- CanvasElement computeElement = CompositionPage.addElementToCanvasScreen(LeftPanelCanvasItems.COMPUTE, vfCanvasManager);
-
- String updatedInstanceName = "updatedName";
- vfCanvasManager.updateElementNameInCanvas(computeElement, updatedInstanceName);
-
- String actualSelectedInstanceName = CompositionPage.getSelectedInstanceName();
- assertTrue(updatedInstanceName.equals(actualSelectedInstanceName));
- }
-
- @Test
- public void submitDCAEAssetForTestingWithNonCertifiedAsset() throws Exception {
- String fileName = "importVFC_VFC17.yml";
-
- ResourceReqDetails atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
- ResourceUIUtils.importVfc(atomicResourceMetaData, filePath, fileName, getUser());
- //TODO Andrey changed to click on checkIn button
- ResourceGeneralPage.clickCheckinButton(atomicResourceMetaData.getName());
-
- ResourceReqDetails vfMetaData = createDCAEAsset();
- DeploymentArtifactPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
- CompositionPage.addElementToCanvasScreen(atomicResourceMetaData.getName(), canvasManager);
-
- try {
- //TODO Andrey should click on certify button
- CompositionPage.clickCertifyButton(vfMetaData.getName());
- assert (false);
- } catch (Exception e) {
- String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
- String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.VALIDATED_RESOURCE_NOT_FOUND.name());
- Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
- } finally {
- ResourceRestUtils.deleteResourceByNameAndVersion(atomicResourceMetaData.getName(), "0.1");
- }
- }
-
- @Test
- public void isDisabledAndReadOnlyInCheckinDCAEAssetTest() throws Exception {
- ResourceReqDetails vfMetaData = createDCAEAsset();
- ResourceGeneralPage.clickCheckinButton(vfMetaData.getName());
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
-
- ResourceMetadataEnum[] fieldsForCheck = {ResourceMetadataEnum.RESOURCE_NAME,
- ResourceMetadataEnum.DESCRIPTION,
- ResourceMetadataEnum.VENDOR_NAME,
- ResourceMetadataEnum.VENDOR_RELEASE,
- ResourceMetadataEnum.CONTACT_ID,
- ResourceMetadataEnum.CATEGORY,
- ResourceMetadataEnum.TAGS};
-
- for (ResourceMetadataEnum field : fieldsForCheck) {
- VfVerificator.verifyIsElementDisabled(field.getValue(), field.name());
- }
- VfVerificator.verifyIsElementDisabled(DataTestIdEnum.LifeCyleChangeButtons.CREATE.getValue(), DataTestIdEnum.LifeCyleChangeButtons.CREATE.name());
- }
-
- @Test
- public void removeFileFromGeneralPageDCAEAssetTest() throws Exception {
- String fileName2 = SERVICE_INPUT_TEST_VF2_CSAR;
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- ResourceUIUtils.importVfFromCsarNoCreate(resourceMetaData, filePath, fileName2, getUser());
- GeneralPageElements.clickDeleteFile();
-
- try {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.GeneralElementsEnum.CREATE_BUTTON.getValue(), CLICKING_ON_ELEMENT_TIMEOUT);
- assert (false);
- } catch (Exception e) {
- assert (true);
- }
- }
-
- @Test
- public void activityLogDCAEAssetTest() throws Exception {
- createDCAEAsset();
-
- ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen();
-
- ArtifactInfo informationalArtifact = new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", ArtifactTypeEnum.OTHER.getType());
- InformationalArtifactPage.clickAddNewArtifact();
- ArtifactUIUtils.fillAndAddNewArtifactParameters(informationalArtifact);
-
- ResourceGeneralPage.getLeftMenu().moveToActivityLogScreen();
-
- int numberOfRows = GeneralUIUtils.getElementsByCSS("div[class^='flex-container']").size();
- assertTrue("Wrong rows number, should be 2", numberOfRows == 2);
- }
-
- @Test
- public void checkinCheckoutChangeDeleteVersionDCAEAssetTest() throws Exception {
- ResourceReqDetails atomicResourceMetaData = createDCAEAsset();
-
- ResourceGeneralPage.clickCheckinButton(atomicResourceMetaData.getName());
- GeneralUIUtils.findComponentAndClick(atomicResourceMetaData.getName());
- GeneralPageElements.clickCheckoutButton();
- VfVerificator.verifyVfLifecycleInUI(LifeCycleStateEnum.CHECKOUT);
-
- GeneralPageElements.selectVersion("V0.1");
- VfVerificator.verifyVfLifecycleInUI(LifeCycleStateEnum.CHECKIN);
- GeneralUIUtils.clickJSOnElementByText("latest version");
-
- GeneralPageElements.clickTrashButtonAndConfirm();
- GeneralUIUtils.findComponentAndClick(atomicResourceMetaData.getName());
- String actualVersion = GeneralUIUtils.getSelectedElementFromDropDown(DataTestIdEnum.GeneralElementsEnum.VERSION_HEADER.getValue()).getText();
- assertTrue("Expected version: V0.1, Actual version: " + actualVersion, actualVersion.equals("V0.1"));
- }
-
- @Test
- public void badFileDCAEAssetTest() throws Exception {
- String customFileName = "badVF.csar";
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- try {
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, customFileName, getUser());
- assert (false);
- } catch (Exception e) {
- String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
- String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.CSAR_INVALID.name());
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Validating error messdge..."));
- Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
- }
- }
-
- @Test
- public void validContactAfterCreateDCAEAssetTest() throws Exception {
- ResourceReqDetails resourceMetaData = createDCAEAsset();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Validating that userID equal to user that was logged in..."));
- assertTrue("Wrong userId", resourceMetaData.getContactId().equals(ResourceGeneralPage.getContactIdText()));
- }
-
- public ResourceReqDetails createDCAEAsset() throws Exception {
- String fileName2 = SERVICE_INPUT_TEST_VF2_CSAR;
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName2, getUser());
- resourceMetaData.setVersion("0.1");
- return resourceMetaData;
- }
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ImportVFCAsset.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ImportVFCAsset.java
deleted file mode 100644
index a7d495a32d..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ImportVFCAsset.java
+++ /dev/null
@@ -1,371 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.sanity;
-
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.LifecycleStateEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactInfo;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.InformationalArtifactsPlaceholders;
-import org.openecomp.sdc.ci.tests.datatypes.LifeCycleStateEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.PropertyTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.GeneralPageElements;
-import org.openecomp.sdc.ci.tests.pages.InformationalArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.PropertiesPage;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.pages.UploadArtifactPopup;
-import org.openecomp.sdc.ci.tests.utilities.ArtifactUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.PropertiesUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
-import org.openecomp.sdc.ci.tests.verificator.PropertyVerificator;
-import org.openecomp.sdc.ci.tests.verificator.VfVerificator;
-import org.testng.Assert;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.DataProvider;
-import org.testng.annotations.Test;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.testng.AssertJUnit.assertTrue;
-
-@Test(singleThreaded = true)
-public class ImportVFCAsset extends SetupCDTest {
-
- private static final int CLICKING_ON_ELEMENT_TIMEOUT = 30;
- private ResourceReqDetails atomicResourceMetaData;
- private String filePath;
-
- @BeforeClass
- public void beforeClass() {
- filePath = FileHandling.getFilePath("");
- }
-
- @DataProvider(name = "assetFiles", parallel = false)
- public Object[][] createDataX() {
- return new Object[][]{{"importVFC_VFC9.yml"}, {"CP.yml"}, {"VL.yml"}};
- }
-
- @Test
- public void importVFCTest() throws Exception {
- String fileName = "importVFC_VFC1.yml";
- atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT,
- ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
- ResourceUIUtils.importVfc(atomicResourceMetaData, filePath, fileName, getUser());
- }
-
- @Test
- public void importDuplicateVFCTest() throws Exception {
- String fileName = "importVFC_VFC2.yml";
- atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT,
- ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
- ResourceUIUtils.importVfc(atomicResourceMetaData, filePath, fileName, getUser());
- ResourceGeneralPage.clickCheckinButton(atomicResourceMetaData.getName());
-
- ResourceReqDetails atomicResourceMetaDataDup = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT,
- ResourceCategoryEnum.NETWORK_L2_3_INFRASTRUCTURE, getUser());
- try {
- ResourceUIUtils.importVfc(atomicResourceMetaDataDup, filePath, fileName, getUser());
- assert (false);
- } catch (Exception e) {
- String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
- String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.RESOURCE_ALREADY_EXISTS.name());
- Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
- }
- }
-
- @Test
- public void badFileVFCTest() throws Exception {
- String fileName = "importVFC_VFC3.yml";
- String customFileName = "Heat-File 1.yaml";
-
- atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT,
- ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
- try {
- ResourceUIUtils.importVfc(atomicResourceMetaData, filePath, customFileName, getUser());
- assert (false);
- } catch (Exception e) {
- String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
- String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.INVALID_TOSCA_TEMPLATE.name());
- Assert.assertTrue(errorMessage.contains(checkUIResponseOnError));
- }
- }
-
- @Test
- public void validContactAfterCreateVFCTest() throws Exception {
- String fileName = "importVFC_VFC4.yml";
- atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT,
- ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
- ResourceUIUtils.importVfc(atomicResourceMetaData, filePath, fileName, getUser());
-
- assertTrue("wrong userId", atomicResourceMetaData.getContactId().equals(ResourceGeneralPage.getContactIdText()));
- }
-
- @Test
- public void validContactAfterUpdateVFCTest() throws Exception {
- String fileName = "importVFC_VFC5.yml";
- String userIdUpdated = "up1234";
-
- atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
- ResourceUIUtils.importVfc(atomicResourceMetaData, filePath, fileName, getUser());
-
- ResourceUIUtils.defineUserId(userIdUpdated);
- assertTrue("userId is not updated", userIdUpdated.equals(ResourceGeneralPage.getContactIdText()));
- }
-
- @Test
- public void addUpdateDeleteDeploymentArtifactToVFCTest() throws Exception {
- String fileName = "importVFC_VFC6.yml";
- atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT,
- ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
- ResourceUIUtils.importVfc(atomicResourceMetaData, filePath, fileName, getUser());
-
- ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
-
- List<ArtifactInfo> deploymentArtifactList = new ArrayList<ArtifactInfo>();
- deploymentArtifactList.add(new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", "OTHER"));
- deploymentArtifactList.add(new ArtifactInfo(filePath, "sample-xml-alldata-1-1.xml", "cuku", "artifact2", "YANG_XML"));
- for (ArtifactInfo deploymentArtifact : deploymentArtifactList) {
- DeploymentArtifactPage.clickAddNewArtifact();
- ArtifactUIUtils.fillAndAddNewArtifactParameters(deploymentArtifact, new UploadArtifactPopup(true));
- }
- assertTrue("artifact table does not contain artifacts uploaded", DeploymentArtifactPage.checkElementsCountInTable(deploymentArtifactList.size()));
-
- String newDescription = "new description";
- DeploymentArtifactPage.updateDescription(newDescription, deploymentArtifactList.get(0));
- String actualArtifactDescription = DeploymentArtifactPage.getArtifactDescription(deploymentArtifactList.get(0).getArtifactLabel());
- assertTrue("artifact description is not updated", newDescription.equals(actualArtifactDescription));
-
- DeploymentArtifactPage.clickDeleteArtifact(deploymentArtifactList.get(0).getArtifactLabel());
- DeploymentArtifactPage.clickOK();
- assertTrue("artifact " + deploymentArtifactList.get(0).getArtifactLabel() + "is not deleted", DeploymentArtifactPage.checkElementsCountInTable(deploymentArtifactList.size() - 1));
-
- assertTrue("artifact " + deploymentArtifactList.get(1).getArtifactLabel() + "is not displayed", DeploymentArtifactPage.clickOnArtifactDescription(deploymentArtifactList.get(1).getArtifactLabel()).isDisplayed());
- }
-
- @Test
- public void addUpdateDeletePlaceholdersInformationalArtifactVFCTest() throws Exception {
- String fileName = "importVFC_VFC7.yml";
- atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT,
- ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
- ResourceUIUtils.importVfc(atomicResourceMetaData, filePath, fileName, getUser());
-
- ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen();
-
- // create artifacts
- List<ArtifactInfo> informationalArtifactList = new ArrayList<ArtifactInfo>();
- informationalArtifactList.add(new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", "OTHER"));
- informationalArtifactList.add(new ArtifactInfo(filePath, "sample-xml-alldata-1-1.xml", "cuuuuku", "artifact3", "HEAT"));
- for (ArtifactInfo informationalArtifact : informationalArtifactList) {
- InformationalArtifactPage.clickAddNewArtifact();
- ArtifactUIUtils.fillAndAddNewArtifactParameters(informationalArtifact);
- }
- assertThat(InformationalArtifactPage.checkElementsCountInTable(informationalArtifactList.size())).
- as("Check that artifact table contains artifacts uploaded").isTrue();
-
- // update artifact description
- String newDescription = "new description";
- InformationalArtifactPage.clickEditArtifact(informationalArtifactList.get(0).getArtifactLabel());
- InformationalArtifactPage.artifactPopup().insertDescription(newDescription);
- InformationalArtifactPage.artifactPopup().clickDoneButton();
- String actualArtifactDescription = InformationalArtifactPage.getArtifactDescription(informationalArtifactList.get(0).getArtifactLabel());
- assertThat(actualArtifactDescription).as("Check artifact description update").isEqualTo(newDescription);
-
- // delete artifacts
- for (ArtifactInfo informationalArtifact : informationalArtifactList) {
- InformationalArtifactPage.clickDeleteArtifact(informationalArtifact.getArtifactLabel());
- InformationalArtifactPage.clickOK();
- }
-
- assertThat(InformationalArtifactPage.checkElementsCountInTable(0)).
- as("Check that all artifacts were deleted").isTrue();
-
- // fill placeholders
- int fileNameCounter = 0;
- for (InformationalArtifactsPlaceholders informArtifact : InformationalArtifactsPlaceholders.values()) {
- fileName = HEAT_FILE_YAML_NAME_PREFIX + fileNameCounter + HEAT_FILE_YAML_NAME_SUFFIX;
- ArtifactUIUtils.fillPlaceHolderInformationalArtifact(informArtifact, FileHandling.getFilePath("uniqueFileNames"),
- fileName, informArtifact.getValue());
- fileNameCounter++;
- }
- assertThat(InformationalArtifactPage.checkElementsCountInTable(InformationalArtifactsPlaceholders.values().length)).isTrue();
- }
-
- @Test
- public void addSimplePropertiesToVFCTest() throws Exception {
- String fileName = "importVFC_VFC8.yml";
- atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT,
- ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
- ResourceUIUtils.importVfc(atomicResourceMetaData, filePath, fileName, getUser());
-
- ResourceGeneralPage.getLeftMenu().moveToPropertiesScreen();
- List<PropertyTypeEnum> propertyList = Arrays.asList(PropertyTypeEnum.STRING, PropertyTypeEnum.INTEGER, PropertyTypeEnum.FLOAT);
- int propertiesCount = PropertiesPage.getElemenetsFromTable().size();
- for (PropertyTypeEnum prop : propertyList) {
- PropertiesUIUtils.addNewProperty(prop);
- }
- assertTrue(GeneralUIUtils.checkElementsCountInTable(propertiesCount + propertyList.size(), () -> PropertiesPage.getElemenetsFromTable()));
-
- }
-
- @Test
- public void updateAfterCheckoutNewSimplePropertiesVFCTest() throws Exception {
- String fileName = "importVFC_VFC16.yml";
- atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT,
- ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
- ResourceUIUtils.importVfc(atomicResourceMetaData, filePath, fileName, getUser());
-
- ResourceGeneralPage.getLeftMenu().moveToPropertiesScreen();
- List<PropertyTypeEnum> propertyList = Arrays.asList(PropertyTypeEnum.STRING, PropertyTypeEnum.INTEGER, PropertyTypeEnum.FLOAT);
- int propertiesCount = PropertiesPage.getElemenetsFromTable().size();
- for (PropertyTypeEnum prop : propertyList) {
- PropertiesUIUtils.addNewProperty(prop);
- }
- ResourceGeneralPage.clickCheckinButton(atomicResourceMetaData.getName());
- GeneralUIUtils.findComponentAndClick(atomicResourceMetaData.getName());
- GeneralPageElements.clickCheckoutButton();
- ResourceGeneralPage.getLeftMenu().moveToPropertiesScreen();
-
- for (PropertyTypeEnum prop : propertyList) {
- PropertiesUIUtils.updateProperty(prop);
- }
- assertTrue(GeneralUIUtils.checkElementsCountInTable(propertiesCount + propertyList.size(), () -> PropertiesPage.getElemenetsFromTable()));
-
- for (PropertyTypeEnum prop : propertyList) {
- PropertiesPage.clickOnProperty(prop.getName());
- PropertyVerificator.validateEditVFCPropertiesPopoverFields(prop);
- PropertiesPage.getPropertyPopup().clickCancel();
- }
-
- }
-
-
- @Test(dataProvider = "assetFiles")
- public void checkinCheckoutChangeDeleteVersionVFCTest(String customfileName) throws Exception {
- setLog(customfileName);
-
- atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT,
- ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
- ResourceUIUtils.importVfc(atomicResourceMetaData, filePath, customfileName, getUser());
-
- ResourceGeneralPage.clickCheckinButton(atomicResourceMetaData.getName());
- GeneralUIUtils.findComponentAndClick(atomicResourceMetaData.getName());
- GeneralPageElements.clickCheckoutButton();
- VfVerificator.verifyVfLifecycleInUI(LifeCycleStateEnum.CHECKOUT);
-
- GeneralPageElements.selectVersion("V0.1");
- VfVerificator.verifyVfLifecycleInUI(LifeCycleStateEnum.CHECKIN);
- GeneralUIUtils.clickJSOnElementByText("latest version");
-
- GeneralPageElements.clickTrashButtonAndConfirm();
- GeneralUIUtils.findComponentAndClick(atomicResourceMetaData.getName());
- String actualVersion = GeneralUIUtils.getSelectedElementFromDropDown(DataTestIdEnum.GeneralElementsEnum.VERSION_HEADER.getValue()).getText();
- assertTrue("Expected version: V0.1, Actual version: " + actualVersion, actualVersion.equals("V0.1"));
- }
-
- @Test
- public void certificationVFCTest() throws Exception {
- String fileName = "importVFC_VFC10.yml";
- atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT,
- ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
- ResourceUIUtils.importVfc(atomicResourceMetaData, filePath, fileName, getUser());
-
- String vfName = atomicResourceMetaData.getName();
-
- ResourceGeneralPage.clickCheckinButton(vfName);
- GeneralUIUtils.findComponentAndClick(vfName);
- //TODO Andrey should click on certify button
- ResourceGeneralPage.clickCertifyButton(vfName);
-
- atomicResourceMetaData.setVersion("1.0");
- VfVerificator.verifyVFLifecycle(atomicResourceMetaData, getUser(), LifecycleStateEnum.CERTIFIED);
-
- GeneralUIUtils.findComponentAndClick(vfName);
- VfVerificator.verifyVfLifecycleInUI(LifeCycleStateEnum.CERTIFIED);
- }
-
- @Test
- public void activityLogVFCTest() throws Exception {
- String fileName = "importVFC_VFC11.yml";
- atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT,
- ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
- ResourceUIUtils.importVfc(atomicResourceMetaData, filePath, fileName, getUser());
-
- ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen();
-
- ArtifactInfo informationalArtifact = new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", "OTHER");
- InformationalArtifactPage.clickAddNewArtifact();
- ArtifactUIUtils.fillAndAddNewArtifactParameters(informationalArtifact);
-
- ResourceGeneralPage.getLeftMenu().moveToActivityLogScreen();
-
- int numberOfRows = GeneralUIUtils.getElementsByCSS("div[class^='flex-container']").size();
- assertTrue("Wrong rows number, should be 2", numberOfRows == 2);
- }
-
- @Test
- public void removeFileFromGeneralPageVFCTest() throws Exception {
- String fileName = "importVFC_VFC12.yml";
-
- atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT,
- ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
- ResourceUIUtils.importVfcNoCreate(atomicResourceMetaData, filePath, fileName, getUser());
-
- GeneralPageElements.clickDeleteFile();
-
- try {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.GeneralElementsEnum.CREATE_BUTTON.getValue(), CLICKING_ON_ELEMENT_TIMEOUT);
- assert (false);
- } catch (Exception e) {
- assert (true);
- }
- }
-
- @Test
- public void maxLengthGeneralInformationVFCTest() throws Exception {
- String fileName = "importVFC_VFC13.yml";
- atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT,
- ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
- ResourceUIUtils.importVfc(atomicResourceMetaData, filePath, fileName, getUser());
- ResourceUIUtils.fillMaxValueResourceGeneralInformationPage(atomicResourceMetaData);
- assertTrue(GeneralUIUtils.checkForDisabledAttribute(DataTestIdEnum.GeneralElementsEnum.CREATE_BUTTON.getValue()));
- }
-
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardViaApis.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardViaApis.java
deleted file mode 100644
index a751cc2126..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardViaApis.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.sanity;
-
-import ch.qos.logback.classic.Level;
-import ch.qos.logback.classic.LoggerContext;
-import fj.data.Either;
-import org.openecomp.sdc.be.model.ComponentInstance;
-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.ci.tests.dataProvider.OnbordingDataProviders;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.VendorLicenseModel;
-import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
-import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-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.openecomp.sdc.ci.tests.utils.general.VendorLicenseModelRestUtils;
-import org.openecomp.sdc.ci.tests.utils.general.VendorSoftwareProductRestUtils;
-import org.slf4j.LoggerFactory;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.sql.Timestamp;
-import java.util.List;
-
-import static org.testng.AssertJUnit.assertTrue;
-
-
-public class OnboardViaApis {
-
-
- private static final String FULL_PATH = "C://tmp//CSARs//";
- protected static String filepath = FileHandling.getVnfRepositoryPath();
-
- //-------------------------------------------------------------------------------------------------------
- User sdncDesignerDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- // ResourceReqDetails resourceDetails;
- Timestamp timestamp = new Timestamp(System.currentTimeMillis());
-
-
- @BeforeMethod
- public void before() {
- LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
- lc.getLogger("org.apache").setLevel(Level.OFF);
- lc.getLogger("org.*").setLevel(Level.OFF);
- lc.getLogger("org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest").setLevel(Level.OFF);
- }
-
- @Test(dataProviderClass = OnbordingDataProviders.class, dataProvider = "randomVNF_List")
- public void onboardVNFTestViaApis(String filepath, String vnfFile) throws Exception, Throwable {
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService(); //getServiceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- Service service = runOnboardViaApisOnly(serviceReqDetails, resourceReqDetails, filepath, vnfFile);
- }
-
-
- @Test
- public void onboardingAndParser() throws Exception {
- final int fileFromFolderToGet =7;
- Service service = null;
- List<String> fileNamesFromFolder = FileHandling.getZipFileNamesFromFolder(filepath);
- String vnfFile = fileNamesFromFolder.get(fileFromFolderToGet);
- System.err.println(timestamp + " Starting test with VNF: " + vnfFile);
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService(); //getServiceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- service = runOnboardViaApisOnly(serviceReqDetails, resourceReqDetails, filepath, vnfFile);
- }
-
- @Test(dataProviderClass = OnbordingDataProviders.class, dataProvider = "randomVNF_List")
- public void updateVSPFullScenario(String filepath, String vnfFile) throws Exception {
- //CREATE DATA REQUIRED FOR TEST
- boolean skipReport = true;
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails1);
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile, filepath, sdncDesignerDetails1,
- vendorLicenseModel);
- resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
- Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService(); //getServiceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
- Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
- ComponentInstance componentInstanceDefinition = addComponentInstanceToComponentContainer.left().value();
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- // TEST START
-
- VendorLicenseModelRestUtils.updateVendorLicense(vendorLicenseModel, sdncDesignerDetails1, false);
- VendorLicenseModelRestUtils.validateVlmExist(vendorLicenseModel.getVendorId(), vendorLicenseModel.getVersion(), sdncDesignerDetails1);
-
- // Update the VSP With the VLM new version and submit the VSP
- vendorSoftwareProductObject = VendorSoftwareProductRestUtils.updateVSPWithNewVLMParameters(vendorSoftwareProductObject,
- vendorLicenseModel, sdncDesignerDetails1);
- VendorSoftwareProductRestUtils.validateVspExist(vendorSoftwareProductObject, sdncDesignerDetails1);
- Boolean distributeAndValidateService = AtomicOperationUtils.distributeAndValidateService(service);
- assertTrue("Distribution status is " + distributeAndValidateService, distributeAndValidateService);
- System.out.println(distributeAndValidateService);
- }
-
- public Service runOnboardViaApisOnly(ServiceReqDetails serviceReqDetails, ResourceReqDetails resourceReqDetails, String filepath, String vnfFile) throws Exception {
-
- VendorSoftwareProductObject vendorSoftwareProductObject = OnboardingUtillViaApis.createVspViaApis(resourceReqDetails, filepath, vnfFile, sdncDesignerDetails1);
- vendorSoftwareProductObject.setName(vendorSoftwareProductObject.getName());
-
- resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
- Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
-
- Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
- ComponentInstance componentInstanceDefinition = addComponentInstanceToComponentContainer.left().value();
-
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- return service;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardingFlowsThroughAPI.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardingFlowsThroughAPI.java
deleted file mode 100644
index d2851efc17..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardingFlowsThroughAPI.java
+++ /dev/null
@@ -1,499 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.sanity;
-
-import com.aventstack.extentreports.Status;
-import fj.data.Either;
-import org.openecomp.sdc.be.model.ArtifactDefinition;
-import org.openecomp.sdc.be.model.ComponentInstance;
-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.ci.tests.data.providers.OnboardingDataProviders;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.TopMenuButtonsEnum;
-import org.openecomp.sdc.ci.tests.datatypes.VendorLicenseModel;
-import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
-import org.openecomp.sdc.ci.tests.datatypes.enums.CvfcTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.GeneralPageElements;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.utilities.CatalogUIUtilitis;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.OnboardingUiUtils;
-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.FileHandling;
-import org.openecomp.sdc.ci.tests.utils.general.OnboardingUtillViaApis;
-import org.openecomp.sdc.ci.tests.utils.general.OnboardingUtils;
-import org.openecomp.sdc.ci.tests.utils.general.VendorLicenseModelRestUtils;
-import org.openecomp.sdc.ci.tests.utils.general.VendorSoftwareProductRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
-import org.openecomp.sdc.ci.tests.verificator.CatalogVerificator;
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-import java.io.File;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import static org.testng.AssertJUnit.assertTrue;
-
-public class OnboardingFlowsThroughAPI extends SetupCDTest {
-
- protected boolean skipReport = false;
- private User sdncDesignerDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
-
-
-// https://sdp.web.att.com/fa3qm1/web/console/Application_Development_Tools_QM_20.20.01#action=com.ibm.rqm.planning.home.actionDispatcher&subAction=viewTestPlan&id=6184
-
- @Test
- public void addVesFileToVsp() throws Exception {
- String vnfFile = "vMME_Ericsson_small_v2.zip";
- String vesArtifactFile = "VES.zip";
- String filePath = FileHandling.getFilePath("VFCArtifacts");
- String vesArtifactFileLocation = filePath + File.separator + vesArtifactFile;
- List<String> vesArtifacts = FileHandling.getFileNamesFromZip(vesArtifactFileLocation);
- List<String> tempVesArtifacts = FileHandling.getFileNamesFromZip(vesArtifactFileLocation);
- Map<CvfcTypeEnum, String> cvfcArtifacts = new HashMap<>();
- cvfcArtifacts.put(CvfcTypeEnum.VES_EVENTS, vesArtifactFileLocation);
- getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
-
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
- vendorLicenseModel, cvfcArtifacts);
- resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
- Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
- List<ComponentInstance> componentInstances = resource.getComponentInstances();
- for (ComponentInstance componentInstance : componentInstances) {
- if (componentInstance.getDeploymentArtifacts() != null && !componentInstance.getDeploymentArtifacts().isEmpty()) {
- Map<String, ArtifactDefinition> deploymentArtifacts = componentInstance.getDeploymentArtifacts();
- for (Entry<String, ArtifactDefinition> entry : deploymentArtifacts.entrySet()) {
- if (entry.getValue().getArtifactType().equals(CvfcTypeEnum.VES_EVENTS.getValue())) {
- for (String vesArtifact : vesArtifacts) {
- if (entry.getValue().getArtifactName().equals(vesArtifact)) {
- tempVesArtifacts.remove(vesArtifact);
- }
- }
- }
- }
- }
- }
- assertTrue("Not all VES_EVENTS artifact files are on the resource instance", tempVesArtifacts.isEmpty());
- }
-
-// 741433: Update Old VSP
-// 2. Updated VSP "JSA AUG 2017" with the attached zip from v3 to v4. Follow normal steps to update the VF
-// 3. Update the VSP "vHSS-EPC-RDM3-Lab-0830" using the attached zip. Follow the normal steps to update the VF
-// @Test(dataProviderClass = OnbordingDataProviders.class, dataProvider = "randomVNF_List")
-// public void create2(String filePath, String vnfFile) throws Exception{
-// setLog(vnfFile);
-// }
-
-
- // 741509: E2E flow using old VLM
- @Test
- public void VlmReuse() throws Exception {
- List<String> fileNamesFromFolder = OnboardingUtils.getVnfNamesFileListExcludeToscaParserFailure();
- List<String> newRandomFileNamesFromFolder = OnboardingDataProviders.getRandomElements(2, fileNamesFromFolder);
- String filePath = FileHandling.getVnfRepositoryPath();
- String vnfFile = newRandomFileNamesFromFolder.get(0);
- getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
-// setLog(vnfFile);
- getExtendTest().log(Status.INFO, "Create Vendor License");
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- getExtendTest().log(Status.INFO, "Create Vendor Software Product: " + resourceReqDetails.getName());
- VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
- vendorLicenseModel, null);
- resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
- getExtendTest().log(Status.INFO, "Create Resource: " + resourceReqDetails.getName());
- Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
- getExtendTest().log(Status.INFO, "Certify the Resource: " + resourceReqDetails.getName());
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- ServiceReqDetails serviceReqDetails = OnboardingUtillViaApis.prepareServiceDetailsBeforeCreate(sdncDesignerDetails);
- getExtendTest().log(Status.INFO, "Create Service: " + serviceReqDetails.getName());
- org.openecomp.sdc.be.model.Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
-
- getExtendTest().log(Status.INFO, "Add VF to service");
- Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
- addComponentInstanceToComponentContainer.left().value();
- getExtendTest().log(Status.INFO, "Certify the service");
- service = (org.openecomp.sdc.be.model.Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- getExtendTest().log(Status.INFO, "Start distributing the service");
- Boolean distributeAndValidateService = AtomicOperationUtils.distributeAndValidateService(service);
- getExtendTest().log(Status.INFO, "Service distributed");
- assertTrue("Distribution of service " + service.getName() + " failed", distributeAndValidateService);
-
-// update
- vnfFile = newRandomFileNamesFromFolder.get(1);
- getExtendTest().log(Status.INFO, "Going to update VLM with new file " + vnfFile);
- VendorLicenseModelRestUtils.updateVendorLicense(vendorLicenseModel, sdncDesignerDetails, false);
- vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
- vendorLicenseModel, null);
- getExtendTest().log(Status.INFO, "Create new VSP: " + vendorSoftwareProductObject.getName());
- resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
- getExtendTest().log(Status.INFO, "Create new resource: " + resourceReqDetails.getName());
- resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
- getExtendTest().log(Status.INFO, "Certify the resource");
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- serviceReqDetails = OnboardingUtillViaApis.prepareServiceDetailsBeforeCreate(sdncDesignerDetails);
- getExtendTest().log(Status.INFO, "Create new service: " + serviceReqDetails.getName());
- service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
-
- getExtendTest().log(Status.INFO, "Add VF to service");
- addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
- addComponentInstanceToComponentContainer.left().value();
- getExtendTest().log(Status.INFO, "Certify the service");
- service = (org.openecomp.sdc.be.model.Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- getExtendTest().log(Status.INFO, "Start distributing the service");
- distributeAndValidateService = AtomicOperationUtils.distributeAndValidateService(service);
- getExtendTest().log(Status.INFO, "Service distributed");
- assertTrue("Distribution of service " + service.getName() + " failed", distributeAndValidateService);
- }
-
-
- // 741607: E2E flow using old VSP
- @Test
- public void updateVfiVersionOnServiceLevel() throws Throwable {
- List<String> fileNamesFromFolder = OnboardingUtils.getVnfNamesFileListExcludeToscaParserFailure();
- List<String> newRandomFileNamesFromFolder = OnboardingDataProviders.getRandomElements(2, fileNamesFromFolder);
- String filePath = FileHandling.getVnfRepositoryPath();
- String vnfFile = newRandomFileNamesFromFolder.get(0);
- getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
- vendorLicenseModel, null);
- resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
- Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- ServiceReqDetails serviceReqDetails = OnboardingUtillViaApis.prepareServiceDetailsBeforeCreate(sdncDesignerDetails);
- org.openecomp.sdc.be.model.Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
-
- Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
- ComponentInstance componentInstance = addComponentInstanceToComponentContainer.left().value();
- service = (org.openecomp.sdc.be.model.Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- Boolean distributeAndValidateService = AtomicOperationUtils.distributeAndValidateService(service);
- assertTrue("Distribution of service " + service.getName() + " failed", distributeAndValidateService);
-
-// update resource to v2.0
- String updateVnfFile = newRandomFileNamesFromFolder.get(1);
- getExtendTest().log(Status.INFO, "Going to update VNF with file " + vnfFile);
- VendorSoftwareProductRestUtils.updateVendorSoftwareProductToNextVersion(vendorSoftwareProductObject, sdncDesignerDetails, filePath, updateVnfFile);
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- resourceReqDetails.setUniqueId(resource.getUniqueId());
- resourceReqDetails.setVersion(resource.getVersion());
- resource = AtomicOperationUtils.updateResource(resourceReqDetails, sdncDesignerDetails, true).left().value();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- service = (org.openecomp.sdc.be.model.Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- AtomicOperationUtils.changeComponentInstanceVersion(service, componentInstance, resource, UserRoleEnum.DESIGNER, true);
-
- service = (org.openecomp.sdc.be.model.Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- distributeAndValidateService = AtomicOperationUtils.distributeAndValidateService(service);
- assertTrue("Distribution of service " + service.getName() + " failed", distributeAndValidateService);
- }
-
-
-// 741608: E2E flow using old Service
-// @Test(dataProviderClass = OnbordingDataProviders.class, dataProvider = "randomVNF_List")
-// public void create5(String filePath, String vnfFile) throws Exception{
-// setLog(vnfFile);
-// // 1. Create Service with old resource -> Certify this Service - > Distribute
-// // 2. Service is distributed
-// // 3. Update old Service: fetch few new resources and few old resources -> Certify this Service - > Distribute
-// // 4. Service is distributed
-// }
-
- // 741633: Update HEAT parameter value
- @Test()
- public void updateHeatParametersValue() throws Throwable {
- String msg = "VfArtifacts-->checkDefaultCreatedEnvArtifactsAfterVspUpdate tests with data provider index 4(last one) check it fully";
- getExtendTest().log(Status.INFO, msg);
- }
-
- // temporaly disabled, until fixed
- @Test()
- public void updateVSPNameTest() throws Throwable {
- // External Defect: 430425
-// Import VSP v1.0
- List<String> fileNamesFromFolder = OnboardingUtils.getVnfNamesFileListExcludeToscaParserFailure();
- List<String> newRandomFileNamesFromFolder = OnboardingDataProviders.getRandomElements(1, fileNamesFromFolder);
- String filePath = FileHandling.getVnfRepositoryPath();
- String vnfFile = newRandomFileNamesFromFolder.get(0);
- getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
- User sdncDesignerDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails1);
- getExtendTest().log(Status.INFO, "Create Vendor License Model " + vendorLicenseModel.getVendorLicenseName());
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- getExtendTest().log(Status.INFO, "Create Vendor Software Product " + resourceReqDetails.getName());
- VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
- vendorLicenseModel, null);
-
-// Create VF, certify - v1.0 is created
- resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
- getExtendTest().log(Status.INFO, "Create VF " + resourceReqDetails.getName());
- Resource resource_v1 = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
- getExtendTest().log(Status.INFO, "Certify VF " + resourceReqDetails.getName());
- AtomicOperationUtils.changeComponentState(resource_v1, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
-// Update VSP to v2.0 wih the zip from v1.0, update VSP name
- getExtendTest().log(Status.INFO, "Update VSP to version 2.0");
- String origVspName = vendorSoftwareProductObject.getName();
- vendorSoftwareProductObject.setName("Upd" + ElementFactory.generateUUIDforSufix());
- vendorSoftwareProductObject = VendorSoftwareProductRestUtils.updateVSPWithNewVLMParameters(vendorSoftwareProductObject,
- vendorLicenseModel, sdncDesignerDetails1);
- VendorSoftwareProductRestUtils.validateVspExist(vendorSoftwareProductObject, sdncDesignerDetails1);
-
- //Validate that VF cannot be found by the updated VSP name
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- CatalogUIUtilitis.catalogSearchBox(vendorSoftwareProductObject.getName());
- int numOfElementsInFilteredCatalog = CatalogVerificator.getNumberOfElementsFromCatalogHeader();
- assertTrue(String.format("Wrong number fo elements, Expected : %s , Actual: %s", 0, numOfElementsInFilteredCatalog), numOfElementsInFilteredCatalog == 0);
-
- //Update VF with the new VSP version
- GeneralUIUtils.findComponentAndClick(origVspName);
- GeneralPageElements.clickCheckoutButton();
- GeneralPageElements.clickBrowseButton();
- OnboardingUiUtils.updateVSP(vendorSoftwareProductObject);
-
-
- //Validate that VF name in v1.1 is not changed to new VSP name (it is required to keep the name if at least one certification was done)
- Assert.assertTrue(origVspName.equals(ResourceGeneralPage.getNameText()));
-
- //Validate that VF name in v1.0 is the old VF name
- GeneralPageElements.selectVersion("V1.0");
- Assert.assertTrue(origVspName.equals(ResourceGeneralPage.getNameText()));
- }
-
- @Test()
- public void UpdateVSPRevertToEarlierVersion() throws Throwable {
- // Test Case: 745821
-// 1. Import VSP v1.0
- List<String> fileNamesFromFolder = OnboardingUtils.getVnfNamesFileListExcludeToscaParserFailure();
- List<String> newRandomFileNamesFromFolder = OnboardingDataProviders.getRandomElements(1, fileNamesFromFolder);
- String filePath = FileHandling.getVnfRepositoryPath();
- String vnfFile = newRandomFileNamesFromFolder.get(0);
- getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
- User sdncDesignerDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails1);
- getExtendTest().log(Status.INFO, "Create Vendor License Model " + vendorLicenseModel.getVendorLicenseName());
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- getExtendTest().log(Status.INFO, "Create Vendor Software Product " + resourceReqDetails.getName());
- VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
- vendorLicenseModel, null);
-// 2. Create VF, certify - v1.0 is created
- resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
- getExtendTest().log(Status.INFO, "Create VF " + resourceReqDetails.getName());
- Resource resource_v1 = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
- getExtendTest().log(Status.INFO, "Certify VF " + resourceReqDetails.getName());
- resource_v1 = (Resource) AtomicOperationUtils.changeComponentState(resource_v1, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-// 3. Update VSP to v2.0
- getExtendTest().log(Status.INFO, "Update VSP to version 2.0");
- VendorSoftwareProductRestUtils.updateVendorSoftwareProductToNextVersion(vendorSoftwareProductObject, sdncDesignerDetails1, filePath, vnfFile);
- VendorSoftwareProductRestUtils.validateVspExist(vendorSoftwareProductObject, sdncDesignerDetails1);
-// 4. Update the VF with v2.0 of the VSP
- getExtendTest().log(Status.INFO, "Checkout VF v1.1");
- resource_v1 = (Resource) AtomicOperationUtils.changeComponentState(resource_v1, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- resourceReqDetails.setUniqueId(resource_v1.getUniqueId());
- resourceReqDetails.setVersion("1.1");
- resourceReqDetails.setCsarVersion("2.0");
- getExtendTest().log(Status.INFO, "Update VF to v2.0");
- resource_v1 = AtomicOperationUtils.updateResource(resourceReqDetails, sdncDesignerDetails, true).left().value();
- getExtendTest().log(Status.INFO, "Certify VF");
- Resource resource_v2 = (Resource) AtomicOperationUtils.changeComponentState(resource_v1, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-// 5. Update VSP to v3.0 wih the zip from v1.0
- getExtendTest().log(Status.INFO, "Update VSP to version 3.0");
- VendorSoftwareProductRestUtils.updateVendorSoftwareProductToNextVersion(vendorSoftwareProductObject, sdncDesignerDetails1, false);
- VendorSoftwareProductRestUtils.validateVspExist(vendorSoftwareProductObject, sdncDesignerDetails1);
- getExtendTest().log(Status.INFO, "Checkout VF v2.1");
- resource_v1 = (Resource) AtomicOperationUtils.changeComponentState(resource_v1, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- resourceReqDetails.setUniqueId(resource_v1.getUniqueId());
- resourceReqDetails.setVersion("2.1");
- resourceReqDetails.setCsarVersion("3.0");
- getExtendTest().log(Status.INFO, "Update VF to v3.0");
- ResourceRestUtils.updateResource(resourceReqDetails, sdncDesignerDetails1, resource_v1.getUniqueId());
-// 6. Update VF to v3.0
- getExtendTest().log(Status.INFO, "Certify VF");
- Resource resource_v3 = (Resource) AtomicOperationUtils.changeComponentState(resource_v1, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-// 7. Compare versions v1.0 and v3.0 - should be the same
-// TODO: Shay add resource comparison.
-// 8. Add each of the versions to service, certify - OK
- ServiceReqDetails serviceReqDetails = OnboardingUtillViaApis.prepareServiceDetailsBeforeCreate(sdncDesignerDetails1);
- getExtendTest().log(Status.INFO, "Create Service " + serviceReqDetails.getName());
- org.openecomp.sdc.be.model.Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
- getExtendTest().log(Status.INFO, "Add vf's v1 & v2 to service");
- Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource_v1, service, UserRoleEnum.DESIGNER, true);
- Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer1 = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource_v3, service, UserRoleEnum.DESIGNER, true);
- getExtendTest().log(Status.INFO, "Certify Service");
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- System.out.println("");
- }
-
- @Test(dataProviderClass = org.openecomp.sdc.ci.tests.dataProvider.OnbordingDataProviders.class, dataProvider = "updateList")
- public void updateVSPFlowFromOnboardToDistribution(String vnfFile1, String vnfFile2) throws Throwable {
- setLog(String.format("Create VSP from %s , update VSP with %s ", vnfFile1, vnfFile2));
-// 1. Import VSP v1.0
- String filePath = org.openecomp.sdc.ci.tests.utilities.FileHandling.getUpdateVSPVnfRepositoryPath();
- User sdncDesignerDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails1);
- getExtendTest().log(Status.INFO, String.format("Creating Vendor Software License (VLM): %s v1.0", vendorLicenseModel
- .getVendorLicenseName()));
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- getExtendTest().log(Status.INFO, String.format("Creating Vendor Software Product (VSP): %s v1.0 from heat file: %s ", resourceReqDetails.getName(), vnfFile1));
- VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile1, filePath, sdncDesignerDetails,
- vendorLicenseModel, null);
-// 2. Create VF, certify - v1.0 is created
- resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
- Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- getExtendTest().log(Status.INFO, String.format("Creating Virtual Function (VF): %s v1.0", resourceReqDetails.getName()));
- getExtendTest().log(Status.INFO, String.format("Certify the VF"));
-// 3. Create Service add to it the certified VF and certify the Service v1.0
- ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();
- Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
- getExtendTest().log(Status.INFO, String.format("Creating Service: %s v1.0", serviceReqDetails.getName()));
- Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
- ComponentInstance componentInstance = addComponentInstanceToComponentContainer.left().value();
- getExtendTest().log(Status.INFO, String.format("Adding VF instance to Service"));
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- getExtendTest().log(Status.INFO, String.format("Certify the Service"));
-// 4. Distribute the Service v1.0
- Boolean distributeAndValidateService = AtomicOperationUtils.distributeAndValidateService(service);
- getExtendTest().log(Status.INFO, String.format("Distribute and validate the Service"));
- assertTrue("Distribution status is " + distributeAndValidateService, distributeAndValidateService);
-// 5. Update VSP to v2.0
- getExtendTest().log(Status.INFO, "Upgrading the VSP with new file: " + vnfFile2);
- VendorSoftwareProductRestUtils.updateVendorSoftwareProductToNextVersion(vendorSoftwareProductObject, sdncDesignerDetails1, filePath, vnfFile2);
- getExtendTest().log(Status.INFO, String.format("Validating VSP %s upgrade to version 2.0: ", vnfFile2));
- VendorSoftwareProductRestUtils.validateVspExist(vendorSoftwareProductObject, sdncDesignerDetails1);
-// 6. Update the VF with v2.0 of the VSP and certify the VF
- getExtendTest().log(Status.INFO, String.format("Checkout the VF %s v1.1 ", resourceReqDetails.getName()));
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- resourceReqDetails.setUniqueId(resource.getUniqueId());
- resourceReqDetails.setVersion("1.1");
- resourceReqDetails.setCsarVersion("2.0");
- getExtendTest().log(Status.INFO, String.format("Upgrade the VF %s v1.1 with the new VSP %s v2.0 ", resourceReqDetails.getName(), vendorSoftwareProductObject.getName()));
- resource = AtomicOperationUtils.updateResource(resourceReqDetails, sdncDesignerDetails, true).left().value();
- getExtendTest().log(Status.INFO, String.format("Certify the VF to v2.0"));
- Resource resource_v2 = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-// 7. Update the Service with the VFi version 2.0
- getExtendTest().log(Status.INFO, String.format("Checkout the Service v1.1"));
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- getExtendTest().log(Status.INFO, String.format("Change the instance of the VF in the service to VFi v2.0"));
- AtomicOperationUtils.changeComponentInstanceVersion(service, componentInstance, resource, UserRoleEnum.DESIGNER, true);
- getExtendTest().log(Status.INFO, String.format("Certify the Service to v2.0"));
- service = (org.openecomp.sdc.be.model.Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-// 8. Distribute the service v2.0
- distributeAndValidateService = AtomicOperationUtils.distributeAndValidateService(service);
- getExtendTest().log(Status.INFO, String.format("Distribute and validate the Service"));
- assertTrue("Distribution status is " + distributeAndValidateService, distributeAndValidateService);
- }
-
- @Test(dataProviderClass = org.openecomp.sdc.ci.tests.dataProvider.OnbordingDataProviders.class, dataProvider = "VNF_List")
- public void fromOnboardToDistribution(String filePath, String vnfFile) throws Throwable {
-// String vnfFile1 = "1-2016-20-visbc3vf-(VOIP)_v2.1.zip";
-// String vnfFile2 = "2-2016-20-visbc3vf-(VOIP)_v2.0.zip";
- setLog(String.format("%s", vnfFile));
-// 1. Import VSP v1.0
- //String filePath = FileHandling.getVnfRepositoryPath();
- User sdncDesignerDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails1);
- getExtendTest().log(Status.INFO, String.format("Creating Vendor Software License (VLM): %s v1.0", vendorLicenseModel
- .getVendorLicenseName()));
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- getExtendTest().log(Status.INFO, String.format("Creating Vendor Software Product (VSP): %s v1.0 from heat file: %s ", resourceReqDetails.getName(), vnfFile));
- VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails1,
- vendorLicenseModel);
-// VendorSoftwareProductObject vendorSoftwareProductObject = OnboardViaApis.fillVendorSoftwareProductObjectWithMetaData(vnfFile, createVendorSoftwareProduct);
-// 2. Create VF, certify - v1.0 is created
- resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
- Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- getExtendTest().log(Status.INFO, String.format("Creating Virtual Function (VF): %s v1.0", resourceReqDetails.getName()));
- getExtendTest().log(Status.INFO, String.format("Certify the VF"));
-// 3. Create Service add to it the certified VF and certify the Service v1.0
- ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();
- Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
- getExtendTest().log(Status.INFO, String.format("Creating Service: %s v1.0", serviceReqDetails.getName()));
- Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
- ComponentInstance componentInstance = addComponentInstanceToComponentContainer.left().value();
- getExtendTest().log(Status.INFO, String.format("Adding VF instance to Service"));
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- getExtendTest().log(Status.INFO, String.format("Certify the Service"));
-// 4. Distribute the Service v1.0
- Boolean distributeAndValidateService = AtomicOperationUtils.distributeAndValidateService(service);
- getExtendTest().log(Status.INFO, String.format("Distribute and validate the Service"));
- assertTrue("Distribution status is " + distributeAndValidateService, distributeAndValidateService);
- }
-
- @Test()
- public void onboardE2EviaAPI() throws Throwable {
-// 1. Import VSP v1.0
- String filePath = FileHandling.getVnfRepositoryPath();
- String vnfFile1 = "1-VF-vCSCF-StateDB-new-update_v3.0.zip";
- User sdncDesignerDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails1);
- getExtendTest().log(Status.INFO, String.format("Creating Vendor Software License (VLM): %s v1.0", vendorLicenseModel
- .getVendorLicenseName()));
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- getExtendTest().log(Status.INFO, String.format("Creating Vendor Software Product (VSP): %s v1.0 from heat file: %s ", resourceReqDetails.getName(), vnfFile1));
- VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile1, filePath, sdncDesignerDetails1,
- vendorLicenseModel);
-// VendorSoftwareProductObject vendorSoftwareProductObject = OnboardViaApis.fillVendorSoftwareProductObjectWithMetaData(vnfFile1, createVendorSoftwareProduct);
-// 2. Create VF, certify - v1.0 is created
- resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
- Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- getExtendTest().log(Status.INFO, String.format("Creating Virtual Function (VF): %s v1.0", resourceReqDetails.getName()));
- getExtendTest().log(Status.INFO, String.format("Certify the VF"));
-// 3. Create Service add to it the certified VF and certify the Service v1.0
- ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();
- Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
- getExtendTest().log(Status.INFO, String.format("Creating Service: %s v1.0", serviceReqDetails.getName()));
- Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
- ComponentInstance componentInstance = addComponentInstanceToComponentContainer.left().value();
- getExtendTest().log(Status.INFO, String.format("Adding VF instance to Service"));
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- getExtendTest().log(Status.INFO, String.format("Certify the Service"));
-// 4. Distribute the Service v1.0
- Boolean distributeAndValidateService = AtomicOperationUtils.distributeAndValidateService(service);
- getExtendTest().log(Status.INFO, String.format("Distribute and validate the Service"));
- assertTrue("Distribution status is " + distributeAndValidateService, distributeAndValidateService);
- }
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardingFlowsUi.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardingFlowsUi.java
deleted file mode 100644
index a3a9d1a9e0..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardingFlowsUi.java
+++ /dev/null
@@ -1,626 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.sanity;
-
-import com.aventstack.extentreports.ExtentTest;
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.be.model.ComponentInstance;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.model.Service;
-import org.openecomp.sdc.ci.tests.data.providers.OnboardingDataProviders;
-import org.openecomp.sdc.ci.tests.dataProvider.OnbordingDataProviders;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.VendorLicenseModel;
-import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.XnfTypeEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.DriverFactory;
-import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.flow.CheckSoftwareVersionPropertyFlow;
-import org.openecomp.sdc.ci.tests.flow.CreateResourceFlow;
-import org.openecomp.sdc.ci.tests.flow.CreateVspFlow;
-import org.openecomp.sdc.ci.tests.flow.ImportVspFlow;
-import org.openecomp.sdc.ci.tests.flow.exception.UiTestFlowRuntimeException;
-import org.openecomp.sdc.ci.tests.pages.CompositionPage;
-import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.GovernorOperationPage;
-import org.openecomp.sdc.ci.tests.pages.HomePage;
-import org.openecomp.sdc.ci.tests.pages.OpsOperationPage;
-import org.openecomp.sdc.ci.tests.pages.ResourceCreatePage;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.pages.ServiceGeneralPage;
-import org.openecomp.sdc.ci.tests.pages.TesterOperationPage;
-import org.openecomp.sdc.ci.tests.pages.TopNavComponent;
-import org.openecomp.sdc.ci.tests.pages.VspValidationPage;
-import org.openecomp.sdc.ci.tests.pages.VspValidationResultsPage;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.OnboardingUiUtils;
-import org.openecomp.sdc.ci.tests.utilities.ServiceUIUtils;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-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.OnboardingUtils;
-import org.openecomp.sdc.ci.tests.utils.general.VendorLicenseModelRestUtils;
-import org.openecomp.sdc.ci.tests.utils.general.VendorSoftwareProductRestUtils;
-import org.openecomp.sdc.ci.tests.verificator.ServiceVerificator;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.AssertJUnit;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Optional;
-import org.testng.annotations.Parameters;
-import org.testng.annotations.Test;
-
-import java.io.File;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-import static org.openecomp.sdc.ci.tests.pages.GeneralPageElements.clickOKButton;
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertFalse;
-import static org.testng.AssertJUnit.assertNotNull;
-import static org.testng.AssertJUnit.assertTrue;
-import static org.testng.AssertJUnit.fail;
-
-public class OnboardingFlowsUi extends SetupCDTest {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(OnboardingFlowsUi.class);
- private static final String NO_TESTS_ARE_AVAILABLE = "No Tests are Available";
- private static final String NEXT_BUTTON_IS_ENABLED_IT_SHOULD_HAVE_BEEN_ENABLED =
- "Next Button is enabled, it should have been enabled";
- private static final String NEXT_BUTTON_IS_DISABLED_IT_SHOULD_HAVE_BEEN_ENABLED =
- "Next Button is disabled, it should have been enabled";
- private static final String RESULTS_ARE_NOT_AVAILABLE = "Results are not available";
- private static final String THE_TESTS_ARE_ALREADY_SELECTED_THE_LIST_SHOULD_INITIALLY_BE_EMPTY =
- "The tests are already selected, the list should initially be empty";
- private static final String THE_SELECTED_TESTS_ARE_NOT_POPULATED_IN_THE_LIST =
- "The selected tests are not populated in the list";
- private static final String THE_SELECTED_TESTS_ARE_NOT_DELETED_FROM_THE_LIST =
- "The selected tests are not deleted from the list";
- private static final String NEXT_BUTTON_IS_ENABLED_IT_SHOULD_HAVE_BEEN_DISABLED =
- "Next Button is enabled, it should have been disabled";
-
- protected static String filePath = FileHandling.getVnfRepositoryPath();
- private Boolean makeDistributionValue;
-
- @Parameters({"makeDistribution"})
- @BeforeMethod
- public void beforeTestReadParams(@Optional("true") String makeDistributionReadValue) {
- LOGGER.debug("makeDistribution parameter is '{}'", makeDistributionReadValue);
- makeDistributionValue = Boolean.valueOf(makeDistributionReadValue);
- }
-
- @Test
- public void onboardVNFTestSanityOneFile() throws Exception {
- String vnfFile = "1-VF-vUSP-vCCF-DB_v11.1.zip";
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();
- runOnboardToDistributionFlow(resourceReqDetails, serviceReqDetails, filePath, vnfFile);
- }
-
- @Test
- public void performanceTest() throws Exception {
- LOGGER.debug("Start test");
- Long actualTestRunTime = Utils.getActionDuration(() -> {
- try {
- onboardVNFTestSanityOneFile();
- } catch (final Exception e) {
- LOGGER.debug("An error has occurred during the performance test", e);
- }
- });
- long regularTestRunTime = 400L;
- double factor = 1.5;
- assertTrue("Expected test run time should be less from " + regularTestRunTime * factor + ", actual time is " + actualTestRunTime, regularTestRunTime * factor > actualTestRunTime);
- }
-
- @Test
- public void onboardVNFTestSanity() throws Exception {
- List<String> fileNamesFromFolder = OnboardingUtils.getXnfNamesFileList(XnfTypeEnum.VNF);
- String vnfFile = fileNamesFromFolder.get(0);
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();
- runOnboardToDistributionFlow(resourceReqDetails, serviceReqDetails, filePath, vnfFile);
- }
-
- @Test(dataProviderClass = OnboardingDataProviders.class, dataProvider = "Single_VNF")
- public void onapOnboardVNFflow(String filePath, String vnfFile) throws Exception {
- setLog(vnfFile);
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();
- runOnboardToDistributionFlow(resourceReqDetails, serviceReqDetails, filePath, vnfFile);
- }
-
- @Test(dataProviderClass = OnboardingDataProviders.class, dataProvider = "Single_VNF")
- public void onapOnboardVSPValidationsSanityFlow(String filePath, String vnfFile) throws Exception {
- setLog(vnfFile);
- String vspName = createNewVSP(filePath, vnfFile);
- if (OnboardingUiUtils.getVspValidationCongiguration()) {
- goToVspScreen(true, vspName);
-
- //check links are available
- checkVspValidationLinksVisibility();
-
- VspValidationPage.navigateToVspValidationPageUsingNavbar();
- assertTrue(NEXT_BUTTON_IS_ENABLED_IT_SHOULD_HAVE_BEEN_DISABLED,
- VspValidationPage.checkNextButtonDisabled());
- VspValidationResultsPage.navigateToVspValidationResultsPageUsingNavbar();
- GeneralUIUtils.ultimateWait();
- assertNotNull(GeneralUIUtils.findByText("No Test Performed"));
- } else {
- goToVspScreen(true, vspName);
-
- //check links are not available
- checkVspValidationLinksInvisibility();
- }
- }
-
- @Test(dataProviderClass = OnboardingDataProviders.class, dataProvider = "softwareInformationPnf")
- public void onboardPNFSoftwareInformationFlow(final String rootFolder, final String pnfFile,
- final List<String> softwareVersionList) {
- setLog(pnfFile);
- final String resourceName = ElementFactory.addRandomSuffixToName(ElementFactory.getResourcePrefix());
- runOnboardPnfSoftwareVersion(resourceName, rootFolder, pnfFile, softwareVersionList);
- }
-
- @Test(dataProviderClass = OnboardingDataProviders.class, dataProvider = "Single_VNF")
- public void onapOnboardVSPValidationsConfigurationChangeCheck(String filePath, String vnfFile) throws Exception {
- setLog(vnfFile);
- String vspName = createNewVSP(filePath, vnfFile);
- if (OnboardingUiUtils.getVspValidationCongiguration()) {
- goToVspScreen(true, vspName);
- //check links are available
- checkVspValidationLinksVisibility();
-
- //change config
- changeVspValidationConfig(false, vspName, OnboardingUiUtils.getVspValidationCongiguration());
-
- //check links are not available
- checkVspValidationLinksInvisibility();
- } else {
- goToVspScreen(true, vspName);
- //check links are not available
- checkVspValidationLinksInvisibility();
-
- changeVspValidationConfig(false, vspName, OnboardingUiUtils.getVspValidationCongiguration());
-
- //check links are available
- checkVspValidationLinksVisibility();
- }
- }
-
- @Test(dataProviderClass = OnboardingDataProviders.class, dataProvider = "Single_VNF")
- public void onapOnboardVSPCertificationQueryFlow(String filePath, String vnfFile) throws Exception {
- setLog(vnfFile);
- String vspName = createNewVSP(filePath, vnfFile);
- if (!OnboardingUiUtils.getVspValidationCongiguration()) {
- //change config to true to test the feature
- changeVspValidationConfig(true, vspName, OnboardingUiUtils.getVspValidationCongiguration());
- } else {
- goToVspScreen(true, vspName);
- }
- VspValidationPage.navigateToVspValidationPageUsingNavbar();
- assertTrue(NEXT_BUTTON_IS_ENABLED_IT_SHOULD_HAVE_BEEN_DISABLED, VspValidationPage.checkNextButtonDisabled());
-
- if (VspValidationPage.checkCertificationQueryExists()) {
- VspValidationPage.clickCertificationQueryAll();
- GeneralUIUtils.ultimateWait();
- assertTrue(NEXT_BUTTON_IS_DISABLED_IT_SHOULD_HAVE_BEEN_ENABLED,
- !VspValidationPage.checkNextButtonDisabled());
- VspValidationPage.clickOnNextButton();
- GeneralUIUtils.ultimateWait();
- VspValidationPage.clickOnSubmitButton();
- GeneralUIUtils.waitForLoader();
- assertTrue(RESULTS_ARE_NOT_AVAILABLE, VspValidationResultsPage.checkResultsExist());
- } else {
- assertNotNull(GeneralUIUtils.findByText("No Certifications Query are Available"));
- }
-
- }
-
- @Test(dataProviderClass = OnbordingDataProviders.class, dataProvider = "Single_Vsp_Test_Csar")
- public void onapOnboardVSPComplianceCheckFlow(String filePath, String vnfFile) throws Exception {
- setLog(vnfFile);
- String vspName = createNewVSP(filePath, vnfFile);
- if (!OnboardingUiUtils.getVspValidationCongiguration()) {
- //change config to true to test the feature
- changeVspValidationConfig(true, vspName, OnboardingUiUtils.getVspValidationCongiguration());
- } else {
- goToVspScreen(true, vspName);
- }
-
- VspValidationPage.navigateToVspValidationPageUsingNavbar();
- assertTrue(NEXT_BUTTON_IS_ENABLED_IT_SHOULD_HAVE_BEEN_ENABLED, VspValidationPage.checkNextButtonDisabled());
- if (VspValidationPage.checkComplianceCheckExists()) {
- VspValidationPage.clickComplianceChecksAll();
- GeneralUIUtils.ultimateWait();
- assertFalse(NEXT_BUTTON_IS_DISABLED_IT_SHOULD_HAVE_BEEN_ENABLED,
- VspValidationPage.checkNextButtonDisabled());
- VspValidationPage.clickOnNextButton();
- GeneralUIUtils.ultimateWait();
- VspValidationPage.loadVSPFile(filePath, vnfFile);
- VspValidationPage.clickOnSubmitButton();
- GeneralUIUtils.ultimateWait();
- assertTrue(RESULTS_ARE_NOT_AVAILABLE, VspValidationResultsPage.checkResultsExist());
- } else {
- assertNotNull(GeneralUIUtils.findByText(NO_TESTS_ARE_AVAILABLE));
- }
-
- }
-
- @Test(dataProviderClass = OnboardingDataProviders.class, dataProvider = "Single_VNF")
- public void onapOnboardVSPComplianceCheckOperations(String filePath, String vnfFile) throws Exception {
- setLog(vnfFile);
- String vspName = createNewVSP(filePath, vnfFile);
- if (!OnboardingUiUtils.getVspValidationCongiguration()) {
- //change config to true to test the feature
- changeVspValidationConfig(true, vspName, OnboardingUiUtils.getVspValidationCongiguration());
- } else {
- goToVspScreen(true, vspName);
- }
-
- VspValidationPage.navigateToVspValidationPageUsingNavbar();
- assertTrue(NEXT_BUTTON_IS_ENABLED_IT_SHOULD_HAVE_BEEN_ENABLED, VspValidationPage.checkNextButtonDisabled());
- if (VspValidationPage.checkComplianceCheckExists()) {
- assertFalse(THE_TESTS_ARE_ALREADY_SELECTED_THE_LIST_SHOULD_INITIALLY_BE_EMPTY,
- VspValidationPage.checkSelectedComplianceCheckExists());
- VspValidationPage.clickComplianceChecksAll();
- GeneralUIUtils.ultimateWait();
- assertTrue(THE_SELECTED_TESTS_ARE_NOT_POPULATED_IN_THE_LIST,
- VspValidationPage.checkSelectedComplianceCheckExists());
- VspValidationPage.clickComplianceChecksAll();
- GeneralUIUtils.ultimateWait();
- assertFalse(THE_SELECTED_TESTS_ARE_NOT_DELETED_FROM_THE_LIST,
- VspValidationPage.checkSelectedComplianceCheckExists());
- } else {
- assertNotNull(GeneralUIUtils.findByText(NO_TESTS_ARE_AVAILABLE));
- }
-
- }
-
- @Test(dataProviderClass = OnboardingDataProviders.class, dataProvider = "Single_VNF")
- public void onapOnboardVSPCertificationQueryOperations(String filePath, String vnfFile) throws Exception {
- setLog(vnfFile);
- String vspName = createNewVSP(filePath, vnfFile);
- if (!OnboardingUiUtils.getVspValidationCongiguration()) {
- //change config to true to test the feature
- changeVspValidationConfig(true, vspName, OnboardingUiUtils.getVspValidationCongiguration());
- } else {
- goToVspScreen(true, vspName);
- }
-
- VspValidationPage.navigateToVspValidationPageUsingNavbar();
- assertTrue(NEXT_BUTTON_IS_ENABLED_IT_SHOULD_HAVE_BEEN_ENABLED, VspValidationPage.checkNextButtonDisabled());
- if (VspValidationPage.checkCertificationQueryExists()) {
- assertFalse(THE_TESTS_ARE_ALREADY_SELECTED_THE_LIST_SHOULD_INITIALLY_BE_EMPTY,
- VspValidationPage.checkSelectedCertificationQueryExists());
- VspValidationPage.clickCertificationQueryAll();
- GeneralUIUtils.ultimateWait();
- assertTrue(THE_SELECTED_TESTS_ARE_NOT_POPULATED_IN_THE_LIST, VspValidationPage.checkSelectedCertificationQueryExists());
- VspValidationPage.clickCertificationQueryAll();
- GeneralUIUtils.ultimateWait();
- assertFalse(THE_SELECTED_TESTS_ARE_NOT_DELETED_FROM_THE_LIST,
- VspValidationPage.checkSelectedCertificationQueryExists());
- } else {
- assertNotNull(GeneralUIUtils.findByText(NO_TESTS_ARE_AVAILABLE));
- }
-
- }
-
- private void checkVspValidationLinksVisibility() {
- //check links are available
- assertTrue("Validation Link is not available", GeneralUIUtils.isElementVisibleByTestId(DataTestIdEnum.VspValidationPage.VSP_VALIDATION_PAGE_NAVBAR.getValue()));
- assertTrue("Validation Results Link is not available", GeneralUIUtils.isElementVisibleByTestId(DataTestIdEnum.VspValidationResultsPage.VSP_VALIDATION_RESULTS_PAGE_NAVBAR.getValue()));
- }
-
- private void checkVspValidationLinksInvisibility() {
- //check links not available
- assertTrue("Validation Link is still available", GeneralUIUtils.isElementInvisibleByTestId(DataTestIdEnum.VspValidationPage.VSP_VALIDATION_PAGE_NAVBAR.getValue()));
- assertTrue("Validation Results Link is still available", GeneralUIUtils.isElementInvisibleByTestId(DataTestIdEnum.VspValidationResultsPage.VSP_VALIDATION_RESULTS_PAGE_NAVBAR.getValue()));
- }
-
- private void changeVspValidationConfig(boolean isCurrentScreenCatalogPage, String vspName, boolean vspConfig) throws Exception {
- //change config
- OnboardingUiUtils.putVspValidationCongiguration(!vspConfig);
- assertTrue(String.format("Failed to set Congiguration to %s", !vspConfig), OnboardingUiUtils.getVspValidationCongiguration() != vspConfig);
-
- if (!isCurrentScreenCatalogPage) {
- GeneralUIUtils.refreshWebpage();
- GeneralUIUtils.ultimateWait();
- }
-
- goToVspScreen(isCurrentScreenCatalogPage, vspName);
-
- //revert the config
- OnboardingUiUtils.putVspValidationCongiguration(vspConfig);
- assertEquals(String.format("Failed to revert Configuration to %s", vspConfig), vspConfig,
- OnboardingUiUtils.getVspValidationCongiguration());
- }
-
- private void goToVspScreen(boolean isCurrentScreenCatalogPage, String vspName) {
- if (isCurrentScreenCatalogPage) {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.MainMenuButtons.ONBOARD_BUTTON.getValue());
- }
- GeneralUIUtils.clickOnElementByText(vspName);
- GeneralUIUtils.ultimateWait();
- }
-
- private String createNewVSP(String filePath, String vnfFile) throws Exception {
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- return OnboardingUiUtils.createVSP(resourceReqDetails, vnfFile, filePath, getUser()).getName();
- }
-
- public void runOnboardPnfSoftwareVersion(final String resourceName, final String rootFolder,
- final String pnfFile, final List<String> softwareVersionList) {
- final ExtentTest extendTest = getExtendTest();
-
- final String swVersionsToString = String.join(", ", softwareVersionList);
-
- extendTest.log(Status.INFO,
- String.format("Creating VSP '%s' by onboarding package '%s' with software version '%s'",
- resourceName, pnfFile, swVersionsToString)
- );
- final WebDriver webDriver = DriverFactory.getDriver();
- final CreateVspFlow createVspFlow = new CreateVspFlow(webDriver, resourceName, pnfFile, rootFolder);
- createVspFlow.run(new TopNavComponent(webDriver));
-
- final ImportVspFlow importVspFlow = new ImportVspFlow(webDriver, resourceName);
- final ResourceCreatePage resourceCreatePage =
- (ResourceCreatePage) importVspFlow.run()
- .orElseThrow(() -> new UiTestFlowRuntimeException("Missing expected return ResourceCreatePage"));
-
- final CreateResourceFlow createResourceFlow = new CreateResourceFlow(webDriver, resourceName);
- createResourceFlow.run(resourceCreatePage);
-
- final CheckSoftwareVersionPropertyFlow checkSoftwareVersionPropertyFlow =
- new CheckSoftwareVersionPropertyFlow(webDriver, softwareVersionList);
- checkSoftwareVersionPropertyFlow.run();
-
- extendTest.log(Status.INFO,
- String.format("Successfully onboarded the package '%s' with software version '%s'",
- pnfFile, swVersionsToString)
- );
- }
-
- private void runOnboardToDistributionFlow(ResourceReqDetails resourceReqDetails, ServiceReqDetails serviceMetadata, String filePath, String vnfFile) throws Exception {
- getExtendTest().log(Status.INFO, "Going to create resource with category: " + resourceReqDetails.getCategories().get(0).getName()
- + " subCategory: " + resourceReqDetails.getCategories().get(0).getSubcategories().get(0).getName()
- + " and service category: " + serviceMetadata.getCategory());
- final String vspName = onboardAndCertify(resourceReqDetails, filePath, vnfFile);
-
- ServiceUIUtils.createService(serviceMetadata);
-
- ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
- Service containerObject = AtomicOperationUtils.getServiceObjectByNameAndVersion(UserRoleEnum.DESIGNER, serviceMetadata.getName(), "0.1");
- Resource instanceObject = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, vspName, "1.0");
- ComponentInstance componentInstanceDetails = AtomicOperationUtils.addComponentInstanceToComponentContainer(instanceObject, containerObject, UserRoleEnum.DESIGNER, true).left().value();
-
- GeneralUIUtils.clickOnAreaJS(DataTestIdEnum.LifeCyleChangeButtons.CERTIFY.getValue());
-
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.DistributionChangeButtons.APPROVE_MESSAGE.getValue())
- .sendKeys("service " + serviceMetadata.getName() + " certified successfully");
- clickOKButton();
- getExtendTest().log(Status.INFO, String.format("Successfully onboarded the package '%s'", vnfFile));
- }
-
- private void runDistributionFlow(final ServiceReqDetails serviceMetadata) throws Exception {
- if (makeDistributionValue) {
- reloginWithNewRole(UserRoleEnum.OPS);
- GeneralUIUtils.findComponentAndClick(serviceMetadata.getName());
- OpsOperationPage.distributeService();
- OpsOperationPage.displayMonitor();
-
- final List<WebElement> rowsFromMonitorTable = OpsOperationPage.getRowsFromMonitorTable();
- AssertJUnit.assertEquals(1, rowsFromMonitorTable.size());
-
- OpsOperationPage.waitUntilArtifactsDistributed(0);
- }
- }
-
- private String onboardAndCertify(ResourceReqDetails resourceReqDetails, String filePath, String vnfFile) throws Exception {
- VendorSoftwareProductObject onboardAndValidate = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, filePath, vnfFile, getUser());
- String vspName = onboardAndValidate.getName();
-
- DeploymentArtifactPage.getLeftPanel().moveToCompositionScreen();
- ExtentTestActions.addScreenshot(Status.INFO, "TopologyTemplate_" + vnfFile, "The topology template for " + vnfFile + " is as follows : ");
-
- DeploymentArtifactPage.clickCertifyButton(vspName);
- return vspName;
- }
-
-
- @Test(dataProviderClass = OnbordingDataProviders.class, dataProvider = "VNF_List")
- public void onboardVNFTest(String filePath, String vnfFile) throws Exception {
- setLog(vnfFile);
- ResourceReqDetails resourceReqDetails = ElementFactory.getRandomCategoryResource();
- ServiceReqDetails serviceReqDetails = ElementFactory.getRandomCategoryService();
- runOnboardToDistributionFlow(resourceReqDetails, serviceReqDetails, filePath, vnfFile);
- }
-
- @Test(dataProviderClass = OnbordingDataProviders.class, dataProvider = "VNF_List")
- public void onboardVNFShotFlow(String filePath, String vnfFile) throws Exception {
- setLog(vnfFile);
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- onboardAndCertify(resourceReqDetails, filePath, vnfFile);
- }
-
- @Test(dataProviderClass = OnbordingDataProviders.class, dataProvider = "randomVNF_List")
- public void onboardRandomVNFsTest(String filePath, String vnfFile) throws Exception {
- setLog(vnfFile);
- LOGGER.debug("Vnf File name is: {}", vnfFile);
- ResourceReqDetails resourceReqDetails = ElementFactory.getRandomCategoryResource();
- ServiceReqDetails serviceReqDetails = ElementFactory.getRandomCategoryService();
- runOnboardToDistributionFlow(resourceReqDetails, serviceReqDetails, filePath, vnfFile);
- }
-
-
- @Test
- public void onboardUpdateVNFTest() throws Exception {
- List<String> fileNamesFromFolder = FileHandling.getZipFileNamesFromFolder(filePath);
- String vnfFile = fileNamesFromFolder.get(0);
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- VendorSoftwareProductObject vsp = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, filePath, vnfFile, getUser());
- String vspName = vsp.getName();
- ResourceGeneralPage.clickCertifyButton(vspName);
-
- // create service
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
-
- ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CompositionPage.searchForElement(vspName);
- CanvasManager serviceCanvasManager = CanvasManager.getCanvasManager();
- CanvasElement vfElement = serviceCanvasManager.createElementOnCanvas(vspName);
- assertNotNull(vfElement);
- ServiceVerificator.verifyNumOfComponentInstances(serviceMetadata, "0.1", 1, getUser());
-
- if (!HomePage.navigateToHomePage()) {
- fail("Could not go to the home page");
- }
-
- ///update flow
- String updatedVnfFile = fileNamesFromFolder.get(1);
-
- getExtendTest().log(Status.INFO, String.format("Going to update the VNF with %s......", updatedVnfFile));
- // update VendorSoftwareProduct
- OnboardingUiUtils.updateVnfAndValidate(filePath, vsp, updatedVnfFile, getUser());
- ResourceGeneralPage.clickCertifyButton(vspName);
-
- // replace exiting VFI in service with new updated
-
- GeneralUIUtils.findComponentAndClick(serviceMetadata.getName());
- ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
- serviceCanvasManager = CanvasManager.getCanvasManager();
- CompositionPage.changeComponentVersion(serviceCanvasManager, vfElement, "2.0");
- ServiceVerificator.verifyNumOfComponentInstances(serviceMetadata, "0.1", 1, getUser());
-
- ServiceGeneralPage.clickSubmitForTestingButton(serviceMetadata.getName());
-
- reloginWithNewRole(UserRoleEnum.TESTER);
- GeneralUIUtils.findComponentAndClick(serviceMetadata.getName());
- TesterOperationPage.certifyComponent(serviceMetadata.getName());
-
- reloginWithNewRole(UserRoleEnum.GOVERNOR);
- GeneralUIUtils.findComponentAndClick(serviceMetadata.getName());
- GovernorOperationPage.approveService(serviceMetadata.getName());
-
-
- reloginWithNewRole(UserRoleEnum.OPS);
- GeneralUIUtils.findComponentAndClick(serviceMetadata.getName());
- OpsOperationPage.distributeService();
- OpsOperationPage.displayMonitor();
-
- List<WebElement> rowsFromMonitorTable = OpsOperationPage.getRowsFromMonitorTable();
- AssertJUnit.assertEquals(1, rowsFromMonitorTable.size());
-
- OpsOperationPage.waitUntilArtifactsDistributed(0);
- getExtendTest().log(Status.INFO, String.format("Onboarding %s test is passed ! ", vnfFile));
- }
-
-
- @Test
- public void threeVMMSCsInServiceTest() throws Exception {
- String pathFile = FileHandling.getFilePath("VmmscArtifacts");
- final String[] list = new File(pathFile).list();
- assertNotNull("Did not find vMMSCs", list);
- assertFalse("Did not find vMMSCs", list.length == 0);
- List<String> vmmscList = Arrays.stream(list).filter(e -> e.contains("vmmsc") && e.endsWith(".zip"))
- .collect(Collectors.toList());
- assertFalse("Did not find vMMSCs", vmmscList.isEmpty());
-
- Map<String, String> vspNames = new HashMap<>();
- for (String vnfFile : vmmscList) {
- String msg = String.format("Going to onboard the VNF %s", vnfFile);
- getExtendTest().log(Status.INFO, msg);
- LOGGER.info(msg);
-
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- VendorSoftwareProductObject createVendorSoftwareProduct = VendorSoftwareProductRestUtils
- .createVendorSoftwareProduct(resourceReqDetails, vnfFile, pathFile, getUser(), vendorLicenseModel);
-
- getExtendTest().log(Status.INFO, String.format("Searching for onboarded %s", vnfFile));
- HomePage.showVspRepository();
- getExtendTest().log(Status.INFO, String.format("Going to import %s......", vnfFile.substring(0, vnfFile.indexOf("."))));
- OnboardingUiUtils.importVSP(createVendorSoftwareProduct);
-
- ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
- DeploymentArtifactPage.verifyArtifactsExistInTable(pathFile, vnfFile);
-
- String vspName = createVendorSoftwareProduct.getName();
- DeploymentArtifactPage.clickCertifyButton(vspName);
- vspNames.put(vnfFile, vspName);
- }
-
- // create service
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
- ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager serviceCanvasManager = CanvasManager.getCanvasManager();
-
- for (String vsp : vspNames.values()) {
- CompositionPage.searchForElement(vsp);
- CanvasElement vfElement = serviceCanvasManager.createElementOnCanvas(vsp);
- assertNotNull(vfElement);
- }
- ServiceVerificator.verifyNumOfComponentInstances(serviceMetadata, "0.1", vspNames.values().size(), getUser());
- File imageFilePath = GeneralUIUtils.takeScreenshot(null, SetupCDTest.getScreenshotFolder(), "Info_" + getExtendTest().getModel().getName());
- final String absolutePath = new File(SetupCDTest.getReportFolder()).toURI().relativize(imageFilePath.toURI()).getPath();
- SetupCDTest.getExtendTest().log(Status.INFO, "Three kinds of vMMSC are in canvas now." + getExtendTest().addScreenCaptureFromPath(absolutePath));
-
- ServiceGeneralPage.clickSubmitForTestingButton(serviceMetadata.getName());
-
- reloginWithNewRole(UserRoleEnum.TESTER);
- GeneralUIUtils.findComponentAndClick(serviceMetadata.getName());
- TesterOperationPage.certifyComponent(serviceMetadata.getName());
-
- reloginWithNewRole(UserRoleEnum.GOVERNOR);
- GeneralUIUtils.findComponentAndClick(serviceMetadata.getName());
- GovernorOperationPage.approveService(serviceMetadata.getName());
-
- reloginWithNewRole(UserRoleEnum.OPS);
- GeneralUIUtils.findComponentAndClick(serviceMetadata.getName());
- OpsOperationPage.distributeService();
- OpsOperationPage.displayMonitor();
-
- List<WebElement> rowsFromMonitorTable = OpsOperationPage.getRowsFromMonitorTable();
- AssertJUnit.assertEquals(1, rowsFromMonitorTable.size());
-
- OpsOperationPage.waitUntilArtifactsDistributed(0);
- }
-
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PNF.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PNF.java
deleted file mode 100644
index a39e4f2f91..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PNF.java
+++ /dev/null
@@ -1,432 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.sanity;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.LifecycleStateEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactInfo;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.LeftPanelCanvasItems;
-import org.openecomp.sdc.ci.tests.datatypes.LifeCycleStateEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.TopMenuButtonsEnum;
-import org.openecomp.sdc.ci.tests.datatypes.TypesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
-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.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.CompositionPage;
-import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.GeneralPageElements;
-import org.openecomp.sdc.ci.tests.pages.GovernorOperationPage;
-import org.openecomp.sdc.ci.tests.pages.InformationalArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.OpsOperationPage;
-import org.openecomp.sdc.ci.tests.pages.PropertiesPage;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.pages.ServiceGeneralPage;
-import org.openecomp.sdc.ci.tests.pages.TesterOperationPage;
-import org.openecomp.sdc.ci.tests.pages.ToscaArtifactsPage;
-import org.openecomp.sdc.ci.tests.utilities.ArtifactUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.CatalogUIUtilitis;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ServiceUIUtils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
-import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
-import org.openecomp.sdc.ci.tests.verificator.VfVerificator;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebElement;
-import org.testng.AssertJUnit;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.util.List;
-
-import static org.testng.Assert.assertTrue;
-
-public class PNF extends SetupCDTest {
-
- private String filePath;
-
- @BeforeClass
- public void beforeClass() {
- filePath = FileHandling.getFilePath("");
- }
-
- @BeforeMethod
- public void beforeTest() {
- System.out.println("File repository is : " + filePath);
- getExtendTest().log(Status.INFO, "File repository is : " + filePath);
- }
-
- @Test
- public void updatePNF() throws Exception {
-
- ResourceReqDetails pnfMetaData = createPNFWithGenerateName();
-
- // update Resource
- ResourceReqDetails updatedResource = new ResourceReqDetails();
- updatedResource.setName(ElementFactory.getResourcePrefix() + "UpdatedName" + pnfMetaData.getName());
- updatedResource.setDescription("kuku");
- updatedResource.setVendorName("updatedVendor");
- updatedResource.setVendorRelease("updatedRelease");
- updatedResource.setContactId("ab0001");
- updatedResource.setCategories(pnfMetaData.getCategories());
- updatedResource.setVersion("0.1");
- updatedResource.setResourceType(ResourceTypeEnum.VF.getValue());
- List<String> newTags = pnfMetaData.getTags();
- newTags.remove(pnfMetaData.getName());
- newTags.add(updatedResource.getName());
- updatedResource.setTags(newTags);
- ResourceUIUtils.updateResource(updatedResource, getUser());
-
- VfVerificator.verifyVFMetadataInUI(updatedResource);
- VfVerificator.verifyVFUpdated(updatedResource, getUser());
- }
-
- @Test
- public void addUpdateDeleteInformationalArtifactPNFTest() throws Exception {
- ResourceReqDetails pnfMetaData = createPNFWithGenerateName();
-
- ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen();
-
- ArtifactInfo informationalArtifact = new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", "OTHER");
- InformationalArtifactPage.clickAddNewArtifact();
- ArtifactUIUtils.fillAndAddNewArtifactParameters(informationalArtifact);
-
- AssertJUnit.assertTrue("artifact table does not contain artifacts uploaded", InformationalArtifactPage.checkElementsCountInTable(1));
-
- String newDescription = "new description";
- InformationalArtifactPage.clickEditArtifact(informationalArtifact.getArtifactLabel());
- InformationalArtifactPage.artifactPopup().insertDescription(newDescription);
- InformationalArtifactPage.artifactPopup().clickDoneButton();
- String actualArtifactDescription = InformationalArtifactPage.getArtifactDescription(informationalArtifact.getArtifactLabel());
- AssertJUnit.assertTrue("artifact description is not updated", newDescription.equals(actualArtifactDescription));
-
- InformationalArtifactPage.clickDeleteArtifact(informationalArtifact.getArtifactLabel());
- InformationalArtifactPage.clickOK();
- AssertJUnit.assertTrue("artifact " + informationalArtifact.getArtifactLabel() + "is not deleted", InformationalArtifactPage.checkElementsCountInTable(0));
- }
-
- @Test
- public void addPropertiesToVfcInstanceInPNFTest() throws Exception {
-
- if (true) {
-// throw new SkipException("Open bug 373762, can't update properties on CP or VFC instance on Composition screen");
- SetupCDTest.getExtendTest().log(Status.INFO, "Open bug 373762, can't update properties on CP or VFC instance on Composition screen");
- }
-
- String fileName = "CP02.yml";
- ResourceReqDetails atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.CP, NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
-
- try {
- ResourceUIUtils.importVfc(atomicResourceMetaData, filePath, fileName, getUser());
- ResourceGeneralPage.clickCheckinButton(atomicResourceMetaData.getName());
-
- ResourceReqDetails pnfMetaData = createPNFWithGenerateName();
-
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager vfCanvasManager = CanvasManager.getCanvasManager();
- CompositionPage.searchForElement(atomicResourceMetaData.getName());
- CanvasElement cpElement = vfCanvasManager.createElementOnCanvas(atomicResourceMetaData.getName());
-
- vfCanvasManager.clickOnCanvaElement(cpElement);
- CompositionPage.showPropertiesAndAttributesTab();
- List<WebElement> properties = CompositionPage.getProperties();
- String propertyValue = "abc123";
- for (int i = 0; i < 2; i++) {
- WebElement findElement = properties.get(i).findElement(By.className("i-sdc-designer-sidebar-section-content-item-property-and-attribute-label"));
- findElement.click();
- PropertiesPage.getPropertyPopup().insertPropertyDefaultValue(propertyValue);
- PropertiesPage.getPropertyPopup().clickSave();
-
- findElement = properties.get(i).findElement(By.className("i-sdc-designer-sidebar-section-content-item-property-value"));
- SetupCDTest.getExtendTest().log(Status.INFO, "Validating properties");
- AssertJUnit.assertTrue(findElement.getText().equals(propertyValue));
- }
- } finally {
- ResourceRestUtils.deleteResourceByNameAndVersion(atomicResourceMetaData.getName(), "0.1");
- }
- }
-
- @Test
- public void changeInstanceVersionPNFTest() throws Exception {
-
- ResourceReqDetails atomicResourceMetaData = null;
- ResourceReqDetails pnfMetaData = null;
- CanvasManager vfCanvasManager;
- CanvasElement cpElement = null;
- String fileName = "CP03.yml";
- try {
- atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.CP, NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
- ResourceUIUtils.importVfc(atomicResourceMetaData, filePath, fileName, getUser());
- //TODO Andrey should click on certify button
- ResourceGeneralPage.clickCertifyButton(atomicResourceMetaData.getName());
-
- pnfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.PNF, getUser());
- ResourceUIUtils.createPNF(pnfMetaData, getUser());
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- vfCanvasManager = CanvasManager.getCanvasManager();
- CompositionPage.searchForElement(atomicResourceMetaData.getName());
- cpElement = vfCanvasManager.createElementOnCanvas(atomicResourceMetaData.getName());
-
- //TODO Andrey should click on certify button
- CompositionPage.clickCertifyButton(pnfMetaData.getName());
- assert (false);
- } catch (Exception e) {
- String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
- String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.VALIDATED_RESOURCE_NOT_FOUND.name());
- AssertJUnit.assertTrue(errorMessage.contains(checkUIResponseOnError));
-
- /*reloginWithNewRole(UserRoleEnum.TESTER);
- GeneralUIUtils.findComponentAndClick(atomicResourceMetaData.getName());
- TesterOperationPage.certifyComponent(atomicResourceMetaData.getName());
-
- reloginWithNewRole(UserRoleEnum.DESIGNER);*/
- GeneralUIUtils.findComponentAndClick(pnfMetaData.getName());
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- vfCanvasManager = CanvasManager.getCanvasManager();
- CompositionPage.changeComponentVersion(vfCanvasManager, cpElement, "1.0");
-
- //verfication
- VfVerificator.verifyInstanceVersion(pnfMetaData, getUser(), atomicResourceMetaData.getName(), "1.0");
- } finally {
- ResourceRestUtils.deleteResourceByNameAndVersion(atomicResourceMetaData.getName(), "1.0");
- }
-
- }
-
- @Test
- public void verifyToscaArtifactsExistPNFTest() throws Exception {
- ResourceReqDetails pnfMetaData = createPNFWithGenerateName();
-
- final int numOfToscaArtifacts = 2;
- ResourceGeneralPage.getLeftMenu().moveToToscaArtifactsScreen();
- AssertJUnit.assertTrue(ToscaArtifactsPage.checkElementsCountInTable(numOfToscaArtifacts));
-
- for (int i = 0; i < numOfToscaArtifacts; i++) {
- String typeFromScreen = ToscaArtifactsPage.getArtifactType(i);
- AssertJUnit.assertTrue(typeFromScreen.equals(ArtifactTypeEnum.TOSCA_CSAR.getType()) || typeFromScreen.equals(ArtifactTypeEnum.TOSCA_TEMPLATE.getType()));
- }
- //TODO Andrey should click on certify button
- ToscaArtifactsPage.clickCertifyButton(pnfMetaData.getName());
- pnfMetaData.setVersion("1.0");
- VfVerificator.verifyToscaArtifactsInfo(pnfMetaData, getUser());
- }
-
- @Test
- public void pnfCertificationTest() throws Exception {
- ResourceReqDetails pnfMetaData = createPNFWithGenerateName();
-
- String vfName = pnfMetaData.getName();
-
- ResourceGeneralPage.clickCheckinButton(vfName);
- GeneralUIUtils.findComponentAndClick(vfName);
- //TODO Andrey should click on certify button
- ResourceGeneralPage.clickCertifyButton(vfName);
-
- /*reloginWithNewRole(UserRoleEnum.TESTER);
- GeneralUIUtils.findComponentAndClick(vfName);
- TesterOperationPage.certifyComponent(vfName);*/
-
- pnfMetaData.setVersion("1.0");
- VfVerificator.verifyVFLifecycle(pnfMetaData, getUser(), LifecycleStateEnum.CERTIFIED);
-
- /*reloginWithNewRole(UserRoleEnum.DESIGNER);*/
- GeneralUIUtils.findComponentAndClick(vfName);
- VfVerificator.verifyVfLifecycleInUI(LifeCycleStateEnum.CERTIFIED);
- }
-
- @Test
- public void deletePNFTest() throws Exception {
- ResourceReqDetails pnfMetaData = createPNFWithGenerateName();
-
- GeneralPageElements.clickTrashButtonAndConfirm();
-
- pnfMetaData.setVersion("0.1");
- VfVerificator.verifyVfDeleted(pnfMetaData, getUser());
- }
-
- @Test
- public void revertPNFMetadataTest() throws Exception {
- ResourceReqDetails pnfMetaData = createPNFWithGenerateName();
-
- ResourceReqDetails pvfRevertDetails = new ResourceReqDetails();
- pvfRevertDetails.setName("ciUpdatedName");
- pvfRevertDetails.setDescription("kuku");
- pvfRevertDetails.setCategories(pnfMetaData.getCategories());
- pvfRevertDetails.setVendorName("updatedVendor");
- pvfRevertDetails.setVendorRelease("updatedRelease");
- ResourceUIUtils.fillResourceGeneralInformationPage(pvfRevertDetails, getUser(), false);
-
- GeneralPageElements.clickRevertButton();
-
- VfVerificator.verifyVFMetadataInUI(pnfMetaData);
- }
-
- @Test
- public void checkoutPnfTest() throws Exception {
- ResourceReqDetails pnfMetaData = createPNFWithGenerateName();
-
- ResourceGeneralPage.clickCheckinButton(pnfMetaData.getName());
- GeneralUIUtils.findComponentAndClick(pnfMetaData.getName());
- GeneralPageElements.clickCheckoutButton();
-
- pnfMetaData.setVersion("0.2");
- VfVerificator.verifyVFLifecycle(pnfMetaData, getUser(), LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
- VfVerificator.verifyVfLifecycleInUI(LifeCycleStateEnum.CHECKOUT);
- //TODO Andrey should click on certify button
- ResourceGeneralPage.clickCertifyButton(pnfMetaData.getName());
-
- /*reloginWithNewRole(UserRoleEnum.TESTER);
- GeneralUIUtils.findComponentAndClick(pnfMetaData.getName());
- TesterOperationPage.certifyComponent(pnfMetaData.getName());
-
- reloginWithNewRole(UserRoleEnum.DESIGNER);*/
- GeneralUIUtils.findComponentAndClick(pnfMetaData.getName());
- ResourceGeneralPage.clickCheckoutButton();
-
- pnfMetaData.setVersion("1.1");
- pnfMetaData.setUniqueId(null);
- VfVerificator.verifyVFLifecycle(pnfMetaData, getUser(), LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
- VfVerificator.verifyVfLifecycleInUI(LifeCycleStateEnum.CHECKOUT);
- }
-
- public ResourceReqDetails createPNFWithGenerateName() throws Exception {
- ResourceReqDetails pnfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.PNF, getUser());
- ResourceUIUtils.createPNF(pnfMetaData, getUser());
- return pnfMetaData;
- }
-
- @Test
- public void verifyPNF_UI_Limitations() throws Exception {
- ResourceReqDetails pnfMetaData = createPNFWithGenerateName();
-
- SetupCDTest.getExtendTest().log(Status.INFO, "Validating Deployment Artifact Left Side Menu not exist");
- assertTrue(GeneralUIUtils.isElementInvisibleByTestId("Deployment ArtifactLeftSideMenu"));
- SetupCDTest.getExtendTest().log(Status.INFO, "Validating Deployment Left Side Menu not exist");
- assertTrue(GeneralUIUtils.isElementInvisibleByTestId("DeploymentLeftSideMenu"));
- }
-
- @Test
- public void filteringCatalogByPNF() throws Exception {
- ResourceReqDetails pnfMetaData = createPNFWithGenerateName();
-
- String pnfName = pnfMetaData.getName();
- //TODO Andrey should click on certify button
- ResourceGeneralPage.clickCertifyButton(pnfName);
- /*reloginWithNewRole(UserRoleEnum.TESTER);
- GeneralUIUtils.findComponentAndClick(pnfName);
- TesterOperationPage.certifyComponent(pnfName);*/
-
- pnfMetaData.setVersion("1.0");
- VfVerificator.verifyVFLifecycle(pnfMetaData, getUser(), LifecycleStateEnum.CERTIFIED);
-
- /*reloginWithNewRole(UserRoleEnum.DESIGNER);*/
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- CatalogUIUtilitis.catalogFilterTypeChecBox(TypesEnum.valueOf("PNF"));
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Validating resource %s found", pnfName));
- GeneralUIUtils.clickOnElementByTestId(pnfName);
- }
-
- @Test
- public void addPNFtoServiceAndDistribute() throws Exception {
- ResourceReqDetails pnfMetaData = createPNFWithGenerateName();
-
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager vfCanvasManager = CanvasManager.getCanvasManager();
- CompositionPage.searchForElement("ContrailPort");
- vfCanvasManager.createElementOnCanvas("ContrailPort");
-
- String pnfName = pnfMetaData.getName();
- //TODO Andrey should click on certify button
- ResourceGeneralPage.clickCertifyButton(pnfName);
-
- /*reloginWithNewRole(UserRoleEnum.TESTER);
- GeneralUIUtils.findComponentAndClick(pnfName);
- TesterOperationPage.certifyComponent(pnfName);*/
-
- pnfMetaData.setVersion("1.0");
- VfVerificator.verifyVFLifecycle(pnfMetaData, getUser(), LifecycleStateEnum.CERTIFIED);
-
- /*reloginWithNewRole(UserRoleEnum.DESIGNER);*/
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
- DeploymentArtifactPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
- CompositionPage.searchForElement(pnfName);
- CanvasElement pnfElement = canvasManager.createElementOnCanvas(pnfName);
- CanvasElement networkElement = canvasManager.createElementOnCanvas(LeftPanelCanvasItems.CONTRAIL_VIRTUAL_NETWORK);
-
- canvasManager.linkElements(pnfElement, networkElement);
- String serviceName = serviceMetadata.getName();
- ServiceGeneralPage.clickSubmitForTestingButton(serviceName);
- reloginWithNewRole(UserRoleEnum.TESTER);
- GeneralUIUtils.findComponentAndClick(serviceName);
- TesterOperationPage.certifyComponent(serviceName);
-
- reloginWithNewRole(UserRoleEnum.GOVERNOR);
- GeneralUIUtils.findComponentAndClick(serviceName);
- GovernorOperationPage.approveService(serviceName);
-
- reloginWithNewRole(UserRoleEnum.OPS);
- GeneralUIUtils.findComponentAndClick(serviceName);
- OpsOperationPage.distributeService();
- }
-
- @Test
- public void checkInfomationArtifactUploadLimitation() throws Exception {
- ResourceReqDetails pnfMetaData = createPNFWithGenerateName();
- ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen();
- List<WebElement> webElements = GeneralUIUtils.getWebElementsListBy(By.xpath(DataTestIdEnum.ArtifactPageEnum.ADD_OTHER_ARTIFACT_BUTTON.getValue()));
- int numberOfElements = webElements.size();
- String buttonText = webElements.get(0).getText();
- SetupCDTest.getExtendTest().log(Status.INFO, "Verifying only one button exist: Add Other Artifact");
- assertTrue(buttonText.equalsIgnoreCase(("Add Other Artifact")));
- assertTrue(1 == numberOfElements, "There should be only one option for uploading artifact in PNF");
- }
-
- @Test
- public void checkNonCPVLObjectsNotExistInComosition() throws Exception {
- ResourceReqDetails pnfMetaData = createPNFWithGenerateName();
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- String pnfName = pnfMetaData.getName();
- // Searching for VFC element and make sure it not exist in PNF composition (Only VL/CP are allowed).
- CompositionPage.searchForElement("BlockStorage");
- SetupCDTest.getExtendTest().log(Status.INFO, "Verifying Element found");
- assertTrue(GeneralUIUtils.isElementInvisibleByTestId("BlockStorage"));
- }
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PortMirroring.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PortMirroring.java
deleted file mode 100644
index 9f7f5adcd3..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PortMirroring.java
+++ /dev/null
@@ -1,613 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.sanity;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.model.Service;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
-import org.openecomp.sdc.ci.tests.datatypes.ConnectionWizardPopUpObject;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.PortMirrioringConfigurationObject;
-import org.openecomp.sdc.ci.tests.datatypes.PortMirroringEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceContainer;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.TopMenuButtonsEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.CompositionPage;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.pages.ServiceGeneralPage;
-import org.openecomp.sdc.ci.tests.utilities.CatalogUIUtilitis;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.HomeUtils;
-import org.openecomp.sdc.ci.tests.utilities.PortMirroringUtils;
-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.FileHandling;
-import org.openecomp.sdc.ci.tests.verificator.PortMirroringVerificator;
-import org.openecomp.sdc.ci.tests.verificator.ServiceVerificator;
-import org.testng.AssertJUnit;
-import org.testng.annotations.Test;
-
-import java.io.File;
-
-import static org.testng.Assert.assertTrue;
-
-public class PortMirroring extends SetupCDTest {
-
- private static final int THREAD_SLEEP_TIME = 3000;
-
- @Test
- public void createPortMirroringConfigurationServiceProxy() throws Throwable {
- PortMirrioringConfigurationObject portMirrioringConfigurationObject = PortMirroringUtils.createPortMirriongConfigurationStructure(false);
- ServiceReqDetails serviceReqDetails = portMirrioringConfigurationObject.getServiceReqDetails();
- CanvasManager canvasManager = portMirrioringConfigurationObject.getCanvasManager();
- CanvasElement serviceElementVmmeSourceName = portMirrioringConfigurationObject.getServiceElementVmmeSourceName();
- String vmmeSourceName = portMirrioringConfigurationObject.getVmmeSourceName();
- CanvasElement serviceElementVprobeCollector = portMirrioringConfigurationObject.getServiceElementVprobeCollector();
- String vprobeSourceName = portMirrioringConfigurationObject.getVprobeSourceName();
-
- serviceReqDetails.setVersion("0.1");
- getExtendTest().log(Status.INFO, "Validating links between elements were created");
- ServiceVerificator.verifyLinkCreated(serviceReqDetails, getUser(), 2);
-
- canvasManager.clickOnCanvaElement(serviceElementVmmeSourceName);
- PortMirroringVerificator.validatingProxyServiceNameAndType(vmmeSourceName, "0");
-
- canvasManager.clickOnCanvaElement(serviceElementVprobeCollector);
- PortMirroringVerificator.validatingProxyServiceNameAndType(vprobeSourceName, "0");
- }
-
- @Test
- public void distributePortMirroringConfigurationServiceProxy() throws Throwable {
- PortMirrioringConfigurationObject portMirrioringConfigurationObject = PortMirroringUtils.createPortMirriongConfigurationStructure(false);
- ServiceReqDetails serviceReqDetails = portMirrioringConfigurationObject.getServiceReqDetails();
- Service service = portMirrioringConfigurationObject.getService();
-
- serviceReqDetails.setVersion("0.1");
- getExtendTest().log(Status.INFO, "Validating links between elements were created");
- ServiceVerificator.verifyLinkCreated(serviceReqDetails, getUser(), 2);
-
- getExtendTest().log(Status.INFO, String.format("Going to certify the Service"));
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- getExtendTest().log(Status.INFO, String.format("Service is certified"));
- Boolean distributeAndValidateService = AtomicOperationUtils.distributeAndValidateService(service);
- getExtendTest().log(Status.INFO, String.format("Distribute and validate the Service"));
- AssertJUnit.assertTrue("Distribution status is " + distributeAndValidateService, distributeAndValidateService);
- }
-
- @Test
- public void createPortMirroringByPolicyServiceProxy() throws Throwable {
- //Using API onboard and certify 2 zip files Source: vmmme and Collector: Vprobe
- String filePath = FileHandling.getPortMirroringRepositoryPath();
- ServiceContainer serviceContainerVmme_Source = PortMirroringUtils.createServiceFromHeatFile(filePath, "2016-227_vmme_vmme_30_1610_e2e.zip");
-
- // create service with required pnf's and certify it
- Resource resourceCisco = PortMirroringUtils.generatePNFAndUpdateInput(PortMirroringEnum.CISCO_VENDOR_NAME.getValue(), PortMirroringEnum.CISCO_VENDOR_MODEL_NUMBER.getValue(), getUser());
- Resource resourceAPCON1 = PortMirroringUtils.generatePNFAndUpdateInput(PortMirroringEnum.APCON1_VENDOR_NAME.getValue(), PortMirroringEnum.APCON1_VENDOR_MODEL_NUMBER.getValue(), getUser());
- Resource resourceAPCON2 = PortMirroringUtils.generatePNFAndUpdateInput(PortMirroringEnum.APCON2_VENDOR_NAME.getValue(), PortMirroringEnum.APCON2_VENDOR_MODEL_NUMBER.getValue(), getUser());
-
- ServiceReqDetails serviceReqDetailsCollector = ElementFactory.getDefaultService();
- serviceReqDetailsCollector.setServiceType(PortMirroringEnum.SERVICE_TYPE.getValue());
- getExtendTest().log(Status.INFO, String.format("Creating collector service %s (PNF container)", serviceReqDetailsCollector.getName()));
- Service serviceCollector = AtomicOperationUtils.createCustomService(serviceReqDetailsCollector, UserRoleEnum.DESIGNER, true).left().value();
-
- getExtendTest().log(Status.INFO, String.format("Adding pnf's: %s,%s,%s to service %s", resourceCisco.getName(), resourceAPCON1.getName(), resourceAPCON2.getName(), serviceCollector.getName()));
-
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceCisco, serviceCollector, UserRoleEnum.DESIGNER, true, "80", "80");
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceAPCON1, serviceCollector, UserRoleEnum.DESIGNER, true, "80", "200");
- AtomicOperationUtils.addComponentInstanceToComponentContainer(resourceAPCON2, serviceCollector, UserRoleEnum.DESIGNER, true, "200", "200");
-
- serviceCollector = (Service) AtomicOperationUtils.changeComponentState(serviceCollector, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- // create container service
- ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();
- getExtendTest().log(Status.INFO, String.format("Creating container service %s", serviceReqDetails.getName()));
- Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
-
- String vmmeSourceName = serviceContainerVmme_Source.getService().getName();
- String collectorServiceName = serviceCollector.getName();
-
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(service.getName());
-
- ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
-
- CompositionPage.searchForElement(vmmeSourceName);
- CanvasElement serviceElementVmmeSource = canvasManager.createElementOnCanvas(vmmeSourceName);
-
- CompositionPage.searchForElement(collectorServiceName);
- CanvasElement serviceElementCollectorService = canvasManager.createElementOnCanvas(collectorServiceName);
-
- CompositionPage.searchForElement(PortMirroringEnum.PMCP_ELEMENT_IN_PALLETE.getValue());
- CanvasElement portMirroringConfigurationByPolicyElement = canvasManager.createElementOnCanvas(PortMirroringEnum.PMCP_ELEMENT_IN_PALLETE.getValue());
-
- ConnectionWizardPopUpObject connectionWizardPopUpObjectVMME = new ConnectionWizardPopUpObject("",
- "",
- PortMirroringEnum.PM_REQ_TYPE.getValue(),
- PortMirroringEnum.PMCP_SOURCE_CAP.getValue());
-
- canvasManager.linkElementsAndSelectCapReqTypeAndCapReqName(serviceElementVmmeSource,
- portMirroringConfigurationByPolicyElement,
- connectionWizardPopUpObjectVMME);
-
- serviceReqDetails.setVersion("0.1");
- getExtendTest().log(Status.INFO, "Validating link between elements was created");
- ServiceVerificator.verifyLinkCreated(serviceReqDetails, getUser(), 1);
-
- canvasManager.clickOnCanvaElement(serviceElementVmmeSource);
- PortMirroringVerificator.validatingProxyServiceNameAndType(vmmeSourceName, "0");
-
- getExtendTest().log(Status.INFO, "Adding properties to PMCP");
-
- SetupCDTest.getExtendTest().log(Status.INFO, "Open bug 373762, can't update properties on CP or VFC instance on Composition screen");
-
- canvasManager.clickOnCanvaElement(portMirroringConfigurationByPolicyElement);
- CompositionPage.showPropertiesAndAttributesTab();
- CompositionPage.setSingleProperty(DataTestIdEnum.PortMirroring.COLLECTOR_NODE.getValue(), PortMirroringUtils.createproxyinstanceservicename(collectorServiceName, "1"));
- CompositionPage.setSingleProperty(DataTestIdEnum.PortMirroring.EQUIP_MODEL.getValue(), PortMirroringEnum.CISCO_VENDOR_MODEL_NUMBER.getValue());
- CompositionPage.setSingleProperty(DataTestIdEnum.PortMirroring.EQUIP_VENDOR.getValue(), PortMirroringEnum.CISCO_VENDOR_NAME.getValue());
-
- // Distribute the Port Mirroning Configuration By Policy
- getExtendTest().log(Status.INFO, String.format("Going to certify the Service"));
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- getExtendTest().log(Status.INFO, String.format("Service is certified"));
- Boolean distributeAndValidateService = AtomicOperationUtils.distributeAndValidateService(service);
- getExtendTest().log(Status.INFO, String.format("Distribute and validate the Service"));
- AssertJUnit.assertTrue("Distribution status is " + distributeAndValidateService, distributeAndValidateService);
- }
-
- @Test
- public void deletePMCPLink() throws Throwable {
- ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();
- getExtendTest().log(Status.INFO, String.format("Creating container service %s", serviceReqDetails.getName()));
- Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
-
- String filePath = FileHandling.getPortMirroringRepositoryPath();
- ServiceContainer serviceContainerVmme_Source = PortMirroringUtils.createServiceFromHeatFile(filePath, "2016-227_vmme_vmme_30_1610_e2e.zip");
-
- String vmmeSourceName = serviceContainerVmme_Source.getService().getName();
-
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(service.getName());
-
- ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
-
- CompositionPage.searchForElement(vmmeSourceName);
- CanvasElement serviceElementVmmeSource = canvasManager.createElementOnCanvas(vmmeSourceName);
-
- CompositionPage.searchForElement(PortMirroringEnum.PMCP_ELEMENT_IN_PALLETE.getValue());
- CanvasElement portMirroringConfigurationByPolicyElement = canvasManager.createElementOnCanvas(PortMirroringEnum.PMCP_ELEMENT_IN_PALLETE.getValue());
-
- ConnectionWizardPopUpObject connectionWizardPopUpObjectVMME = new ConnectionWizardPopUpObject("",
- "",
- PortMirroringEnum.PM_REQ_TYPE.getValue(),
- PortMirroringEnum.PMCP_SOURCE_CAP.getValue());
-
- canvasManager.linkElementsAndSelectCapReqTypeAndCapReqName(serviceElementVmmeSource,
- portMirroringConfigurationByPolicyElement,
- connectionWizardPopUpObjectVMME);
-
- serviceReqDetails.setVersion("0.1");
- getExtendTest().log(Status.INFO, "Validating link between elements was created");
- ServiceVerificator.verifyLinkCreated(serviceReqDetails, getUser(), 1);
-
- canvasManager.openLinkPopupReqsCapsConnection(serviceElementVmmeSource, portMirroringConfigurationByPolicyElement);
- canvasManager.closeLinkPopupReqsCapsConnection();
- canvasManager.deleteLinkPopupReqsCapsConnection(serviceElementVmmeSource, portMirroringConfigurationByPolicyElement);
-
- getExtendTest().log(Status.INFO, "Validating link deleted");
- ServiceVerificator.verifyLinkCreated(serviceReqDetails, getUser(), 0);
- }
-
- @Test
- public void verifyPMCNotExistInVF() throws Exception {
- Resource resource = PortMirroringUtils.getresourcebytype(ResourceTypeEnum.VF, "VF", "VendorModel");
-
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
-
- GeneralUIUtils.findComponentAndClick(resource.getName());
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
-
- CompositionPage.searchForElement(PortMirroringEnum.PMC_ELEMENT_IN_PALLETE.getValue());
-
- getExtendTest().log(Status.INFO, "Verify that Port Mirroring Configuration and Configuration by Policy doesn't exist for VF ");
- boolean isPMCFound = GeneralUIUtils.isElementInvisibleByTestId(DataTestIdEnum.PortMirroring.PMC_NAME_IN_PALLETE.getValue());
- boolean isPMCPFound = GeneralUIUtils.isElementInvisibleByTestId(DataTestIdEnum.PortMirroring.PMCP_NAME_IN_PALLETE.getValue());
-
- assertTrue(isPMCFound);
- assertTrue(isPMCPFound);
- }
-
- @Test
- public void verifyPMCPTabs() throws Exception {
-
- ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();
- getExtendTest().log(Status.INFO, String.format("Creating container service %s", serviceReqDetails.getName()));
- Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
-
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(service.getName());
-
- ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
-
- CompositionPage.searchForElement(PortMirroringEnum.PMCP_ELEMENT_IN_PALLETE.getValue());
- CanvasElement portMirroringConfigurationByPolicyElement = canvasManager.createElementOnCanvas(PortMirroringEnum.PMCP_ELEMENT_IN_PALLETE.getValue());
- canvasManager.clickOnCanvaElement(portMirroringConfigurationByPolicyElement);
-
- PortMirroringVerificator.validateGeneralInfo();
- PortMirroringVerificator.validateReqsAndCapsTabExist();
- }
-
-
- @Test
- public void editPMCPName() throws Exception {
-
- ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();
- getExtendTest().log(Status.INFO, String.format("Creating container service %s", serviceReqDetails.getName()));
- Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
-
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(service.getName());
-
- ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
-
- CompositionPage.searchForElement(PortMirroringEnum.PMCP_ELEMENT_IN_PALLETE.getValue());
- CanvasElement portMirroringConfigurationByPolicyElement = canvasManager.createElementOnCanvas(PortMirroringEnum.PMCP_ELEMENT_IN_PALLETE.getValue());
-
- canvasManager.clickOnCanvaElement(portMirroringConfigurationByPolicyElement);
-
- getExtendTest().log(Status.INFO, "Edit PMCP Name");
- canvasManager.updateElementNameInCanvas(portMirroringConfigurationByPolicyElement, PortMirroringEnum.PMCP_NEWNAME.getValue());
-
- PortMirroringVerificator.validateElementName(PortMirroringEnum.PMCP_NEWNAME.getValue());
- }
-
-
- @Test
- public void deletePMCP() throws Exception {
-
- ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();
- getExtendTest().log(Status.INFO, String.format("Creating container service %s", serviceReqDetails.getName()));
- Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
-
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(service.getName());
-
- ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
-
- CompositionPage.searchForElement(PortMirroringEnum.PMCP_ELEMENT_IN_PALLETE.getValue());
- CanvasElement portMirroringConfigurationByPolicyElement = canvasManager.createElementOnCanvas(PortMirroringEnum.PMCP_ELEMENT_IN_PALLETE.getValue());
-
- canvasManager.clickOnCanvaElement(portMirroringConfigurationByPolicyElement);
-
- getExtendTest().log(Status.INFO, String.format("Delete element %s", portMirroringConfigurationByPolicyElement.getElementType()));
- canvasManager.deleteElementFromCanvas(portMirroringConfigurationByPolicyElement);
-
- PortMirroringVerificator.validateElementName(service.getName());
- }
-
- @Test
- public void createPortMirroringConfigurationMulipleInstances() throws Throwable {
- PortMirrioringConfigurationObject portMirrioringConfigurationObject = PortMirroringUtils.createPortMirriongConfigurationStructure(false);
- ServiceReqDetails serviceReqDetails = portMirrioringConfigurationObject.getServiceReqDetails();
- CanvasElement serviceElementVmmeSourceName = portMirrioringConfigurationObject.getServiceElementVmmeSourceName();
-
- serviceReqDetails.setVersion("0.1");
- getExtendTest().log(Status.INFO, "Validating 2 links between elements were created");
- ServiceVerificator.verifyLinkCreated(serviceReqDetails, getUser(), 2);
-
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- GeneralUIUtils.ultimateWait();
- GeneralUIUtils.findComponentAndClick(serviceReqDetails.getName());
-
- getExtendTest().log(Status.INFO, "Adding second PMC to composition");
- ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
-
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
- CompositionPage.searchForElement(PortMirroringEnum.PMC_ELEMENT_IN_PALLETE.getValue());
- CanvasElement portMirroringConfigurationElement = canvasManager.createElementOnCanvas(PortMirroringEnum.PMC_ELEMENT_IN_PALLETE.getValue());
-
- ConnectionWizardPopUpObject connectionWizardPopUpObjectVMME = new ConnectionWizardPopUpObject("", "",
- PortMirroringEnum.PM_REQ_TYPE.getValue(), PortMirroringEnum.PMC_SOURCE_CAP.getValue());
-
- getExtendTest().log(Status.INFO, "Connect VMME to PMC again");
- canvasManager.linkElementsAndSelectCapReqTypeAndCapReqName(serviceElementVmmeSourceName, portMirroringConfigurationElement,
- connectionWizardPopUpObjectVMME);
-
- getExtendTest().log(Status.INFO, "Connect VMME to PMC again");
- canvasManager.linkElementsAndSelectCapReqTypeAndCapReqName(serviceElementVmmeSourceName, portMirroringConfigurationElement,
- connectionWizardPopUpObjectVMME);
-
- getExtendTest().log(Status.INFO, "Validating 4 links between elements exist");
- ServiceVerificator.verifyLinkCreated(serviceReqDetails, getUser(), 4);
-
- getExtendTest().log(Status.INFO, "Adding second PMCP to composition");
- CompositionPage.searchForElement(PortMirroringEnum.PMCP_ELEMENT_IN_PALLETE.getValue());
- CanvasElement portMirroringConfigurationByPolicyElement = canvasManager.createElementOnCanvas(PortMirroringEnum.PMCP_ELEMENT_IN_PALLETE.getValue());
-
- ConnectionWizardPopUpObject connectionWizardPopUpObjectVMME_PMCP = new ConnectionWizardPopUpObject("",
- "",
- PortMirroringEnum.PM_REQ_TYPE.getValue(),
- PortMirroringEnum.PMCP_SOURCE_CAP.getValue());
-
- getExtendTest().log(Status.INFO, "Connect VMME to PMCP again");
- canvasManager.linkElementsAndSelectCapReqTypeAndCapReqName(serviceElementVmmeSourceName, portMirroringConfigurationByPolicyElement,
- connectionWizardPopUpObjectVMME_PMCP);
-
- getExtendTest().log(Status.INFO, "Connect VMME to PMCP again");
- canvasManager.linkElementsAndSelectCapReqTypeAndCapReqName(serviceElementVmmeSourceName, portMirroringConfigurationByPolicyElement,
- connectionWizardPopUpObjectVMME_PMCP);
-
- serviceReqDetails.setVersion("0.1");
- getExtendTest().log(Status.INFO, "Validating 6 links between elements exist");
- ServiceVerificator.verifyLinkCreated(serviceReqDetails, getUser(), 6);
- }
-
- @Test
- public void downloadArtifactFromPMCService() throws Throwable {
- //Scenario of bug 362271
- PortMirrioringConfigurationObject portMirrioringConfigurationObject = PortMirroringUtils.createPortMirriongConfigurationStructure(false);
- ServiceReqDetails serviceReqDetails = portMirrioringConfigurationObject.getServiceReqDetails();
-
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- GeneralUIUtils.ultimateWait();
- GeneralUIUtils.findComponentAndClick(serviceReqDetails.getName());
-
- ServiceGeneralPage.getLeftMenu().moveToToscaArtifactsScreen();
-
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ToscaArtifactsScreenEnum.TOSCA_MODEL.getValue());
- File latestFilefromDir = org.openecomp.sdc.ci.tests.utilities.FileHandling.getLastModifiedFileNameFromDir();
- String actualToscaModelFilename = latestFilefromDir.getName();
-
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ToscaArtifactsScreenEnum.TOSCA_TEMPLATE.getValue());
- latestFilefromDir = org.openecomp.sdc.ci.tests.utilities.FileHandling.getLastModifiedFileNameFromDir();
- String actualToscaTemplateFilename = latestFilefromDir.getName();
-
- String expectedToscaModelFilename = String.format("service-%s-csar.csar", serviceReqDetails.getName());
- String expectedToscaTemplateFilename = String.format("service-%s-template.yml", serviceReqDetails.getName());
-
- getExtendTest().log(Status.INFO, "Validating tosca artifact downloaded successfully");
- AssertJUnit.assertTrue(actualToscaModelFilename.equalsIgnoreCase(expectedToscaModelFilename));
- AssertJUnit.assertTrue(actualToscaTemplateFilename.equalsIgnoreCase(expectedToscaTemplateFilename));
- }
-
- @Test
- public void checkoutMirroringConfigurationServiceProxyAndDeletePMC() throws Throwable {
- PortMirrioringConfigurationObject portMirrioringConfigurationObject = PortMirroringUtils.createPortMirriongConfigurationStructure(false);
- ServiceReqDetails serviceReqDetails = portMirrioringConfigurationObject.getServiceReqDetails();
- Service service = portMirrioringConfigurationObject.getService();
- CanvasElement portMirroringConfigurationElement = portMirrioringConfigurationObject.getPortMirroringConfigurationElement();
-
- serviceReqDetails.setVersion("0.1");
- getExtendTest().log(Status.INFO, "Validating links between elements were created");
- ServiceVerificator.verifyLinkCreated(serviceReqDetails, getUser(), 2);
-
- getExtendTest().log(Status.INFO, String.format("Going to certify the Service"));
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- getExtendTest().log(Status.INFO, String.format("Checkout Port Mirroring Service"));
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
-
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- GeneralUIUtils.ultimateWait();
- HomeUtils.findComponentAndClickByVersion(service.getName(), "1.1");
-
- ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
- GeneralUIUtils.ultimateWait();
- canvasManager.clickOnCanvaElement(portMirroringConfigurationElement);
- getExtendTest().log(Status.INFO, String.format("Delete element %s", portMirroringConfigurationElement.getElementType()));
- canvasManager.deleteElementFromCanvas(portMirroringConfigurationElement);
-
- PortMirroringVerificator.validateElementName(service.getName());
- getExtendTest().log(Status.INFO, "Validating 0 links after delete the port mirroring element");
- serviceReqDetails.setVersion("1.1");
- ServiceVerificator.verifyLinkCreated(serviceReqDetails, getUser(), 0);
-
- getExtendTest().log(Status.INFO, String.format("Going to certify the Service"));
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- getExtendTest().log(Status.INFO, String.format("Service is certified"));
- Boolean distributeAndValidateService = AtomicOperationUtils.distributeAndValidateService(service);
- getExtendTest().log(Status.INFO, String.format("Distribute and validate the Service"));
- AssertJUnit.assertTrue("Distribution status is " + distributeAndValidateService, distributeAndValidateService);
- }
-
- @Test
- public void updatePortMirroringServiceInstance() throws Throwable {
-
- PortMirrioringConfigurationObject portMirrioringConfigurationObject = PortMirroringUtils.createPortMirriongConfigurationStructure(false);
- Service service = portMirrioringConfigurationObject.getService();
- CanvasElement vmmeCanvasElement = portMirrioringConfigurationObject.getServiceElementVmmeSourceName();
-
- getExtendTest().log(Status.INFO, String.format("Going to certify the Service"));
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- Service serviceContainerVmme_Source = portMirrioringConfigurationObject.getServiceContainerVmme_Source();
- getExtendTest().log(Status.INFO, String.format("Checkout the vmme Service"));
- serviceContainerVmme_Source = (Service) AtomicOperationUtils.changeComponentState(serviceContainerVmme_Source, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- getExtendTest().log(Status.INFO, String.format("Going to certify the vmme Service"));
- serviceContainerVmme_Source = (Service) AtomicOperationUtils.changeComponentState(serviceContainerVmme_Source, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- getExtendTest().log(Status.INFO, String.format("Checkout Port Mirroring Service"));
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
-
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- GeneralUIUtils.ultimateWait();
- HomeUtils.findComponentAndClickByVersion(service.getName(), "1.1");
-
- ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
-
- getExtendTest().log(Status.INFO, String.format("Change vmme source %s instance to version 2.0", serviceContainerVmme_Source.getName()));
- CompositionPage.changeComponentVersion(canvasManager, vmmeCanvasElement, "2.0", false);
-
- getExtendTest().log(Status.INFO, String.format("Going to certify the Service"));
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- getExtendTest().log(Status.INFO, String.format("Service is certified"));
- Boolean distributeAndValidateService = AtomicOperationUtils.distributeAndValidateService(service);
- getExtendTest().log(Status.INFO, String.format("Distribute and validate the Service"));
- AssertJUnit.assertTrue("Distribution status is " + distributeAndValidateService, distributeAndValidateService);
- }
-
- @Test
- public void updateLinkPropertiesPortMirroringService() throws Throwable {
-
- ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();
- getExtendTest().log(Status.INFO, String.format("Creating container service %s", serviceReqDetails.getName()));
- Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
-
- String filePath = FileHandling.getPortMirroringRepositoryPath();
- ServiceContainer serviceContainerVmme_Source = PortMirroringUtils.createServiceFromHeatFile(filePath, "2016-227_vmme_vmme_30_1610_e2e.zip");
-
- String vmmeSourceName = serviceContainerVmme_Source.getService().getName();
-
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(service.getName());
-
- ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
-
- CompositionPage.searchForElement(vmmeSourceName);
- CanvasElement serviceElementVmmeSource = canvasManager.createElementOnCanvas(vmmeSourceName);
-
- CompositionPage.searchForElement(PortMirroringEnum.PMCP_ELEMENT_IN_PALLETE.getValue());
- CanvasElement portMirroringConfigurationByPolicyElement = canvasManager.createElementOnCanvas(PortMirroringEnum.PMCP_ELEMENT_IN_PALLETE.getValue());
-
- ConnectionWizardPopUpObject connectionWizardPopUpObjectVMME = new ConnectionWizardPopUpObject("",
- "",
- PortMirroringEnum.PM_REQ_TYPE.getValue(),
- PortMirroringEnum.PMCP_SOURCE_CAP.getValue());
-
- canvasManager.linkElementsAndSelectCapReqTypeAndCapReqName(serviceElementVmmeSource,
- portMirroringConfigurationByPolicyElement,
- connectionWizardPopUpObjectVMME);
-
- serviceReqDetails.setVersion("0.1");
- getExtendTest().log(Status.INFO, "Validating link between elements was created");
- ServiceVerificator.verifyLinkCreated(serviceReqDetails, getUser(), 1);
-
- canvasManager.openLinkPopupReqsCapsConnection(serviceElementVmmeSource, portMirroringConfigurationByPolicyElement);
-
- getExtendTest().log(Status.INFO, "Fill link properties with data");
- GeneralUIUtils.setTextInElementByXpath(PortMirroringEnum.NETWORK_ROLE_XPATH.getValue(), PortMirroringEnum.NETWORK_ROLE_VALUE.getValue());
- GeneralUIUtils.setTextInElementByXpath(PortMirroringEnum.NFC_TYPE_XPATH.getValue(), PortMirroringEnum.NFC_TYPE_VALUE.getValue());
- GeneralUIUtils.setTextInElementByXpath(PortMirroringEnum.PPS_CAPACITY_XPATH.getValue(), PortMirroringEnum.PPS_CAPACITY_VALUE.getValue());
- GeneralUIUtils.setTextInElementByXpath(PortMirroringEnum.NF_TYPE_XPATH.getValue(), PortMirroringEnum.NF_TYPE_VALUE.getValue());
- GeneralUIUtils.ultimateWait();
-
- canvasManager.clickSaveOnLinkPopup();
- Thread.sleep(THREAD_SLEEP_TIME); //Temp solution. Don't remove.
- canvasManager.openLinkPopupReqsCapsConnection(serviceElementVmmeSource, portMirroringConfigurationByPolicyElement);
-
- PortMirroringVerificator.validateLinkProperties();
- }
-
- @Test
- public void restorePortMirroringServiceLink() throws Throwable {
-
- //Scenario is taken from bug 361475 - Second Scenario
- PortMirrioringConfigurationObject portMirrioringConfigurationObject = PortMirroringUtils.createPortMirriongConfigurationStructure(false);
- ServiceReqDetails serviceReqDetails = portMirrioringConfigurationObject.getServiceReqDetails();
- Service service = portMirrioringConfigurationObject.getService();
- CanvasElement vmmeCanvasElement = portMirrioringConfigurationObject.getServiceElementVmmeSourceName();
- Service serviceContainerVmme_Source = portMirrioringConfigurationObject.getServiceContainerVmme_Source();
-
- getExtendTest().log(Status.INFO, String.format("Checkout the vmme Service"));
- serviceContainerVmme_Source = (Service) AtomicOperationUtils.changeComponentState(serviceContainerVmme_Source, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- getExtendTest().log(Status.INFO, String.format("Going to certify the vmme Service"));
- serviceContainerVmme_Source = (Service) AtomicOperationUtils.changeComponentState(serviceContainerVmme_Source, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- GeneralUIUtils.ultimateWait();
- HomeUtils.findComponentAndClick(service.getName());
-
- ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
-
- getExtendTest().log(Status.INFO, String.format("Changing vmme source %s instance to version 2.0", serviceContainerVmme_Source.getName()));
- CompositionPage.changeComponentVersion(canvasManager, vmmeCanvasElement, "2.0", false);
-
- getExtendTest().log(Status.INFO, "Validating 1 link exist after change version to the vmme service (Newer version)");
- ServiceVerificator.verifyLinkCreated(serviceReqDetails, getUser(), 2);
-
- getExtendTest().log(Status.INFO, String.format("Changing vmme source %s instance to version 1.0", serviceContainerVmme_Source.getName()));
- CompositionPage.changeComponentVersion(canvasManager, vmmeCanvasElement, "1.0", false);
-
- ServiceVerificator.verifyLinkCreated(serviceReqDetails, getUser(), 2);
- }
-
- @Test
- public void restoreServiceVersionOnContainerService() throws Throwable {
- //Scenario is taken from bug 361475 - First Scenario
- PortMirrioringConfigurationObject portMirrioringConfigurationObject = PortMirroringUtils.createPortMirriongConfigurationStructure(false);
- ServiceReqDetails serviceReqDetails = portMirrioringConfigurationObject.getServiceReqDetails();
- Service service = portMirrioringConfigurationObject.getService();
- CanvasElement vmmeCanvasElement = portMirrioringConfigurationObject.getServiceElementVmmeSourceName();
- Service serviceContainerVmme_Source = portMirrioringConfigurationObject.getServiceContainerVmme_Source();
- Service serviceContainerVprobe_Vprobe_Collector = portMirrioringConfigurationObject.getServiceContainerVprobe_Collector();
- CanvasElement vprobeCanvasElement = portMirrioringConfigurationObject.getServiceElementVprobeCollector();
-
-
- getExtendTest().log(Status.INFO, String.format("Checkout the vmme Service"));
- serviceContainerVmme_Source = (Service) AtomicOperationUtils.changeComponentState(serviceContainerVmme_Source, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- getExtendTest().log(Status.INFO, String.format("Going to certify the vmme Service"));
- serviceContainerVmme_Source = (Service) AtomicOperationUtils.changeComponentState(serviceContainerVmme_Source, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- GeneralUIUtils.ultimateWait();
- HomeUtils.findComponentAndClick(service.getName());
-
- ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
-
- canvasManager.linkElements(vmmeCanvasElement, vprobeCanvasElement);
-
- getExtendTest().log(Status.INFO, String.format("Changing vmme source %s instance to version 2.0", serviceContainerVmme_Source.getName()));
- CompositionPage.changeComponentVersion(canvasManager, vmmeCanvasElement, "2.0", false);
-
- getExtendTest().log(Status.INFO, "Validating 1 link exist after change version to the vmme service (Newer version)");
- ServiceVerificator.verifyLinkCreated(serviceReqDetails, getUser(), 3);
-
- getExtendTest().log(Status.INFO, String.format("Changing vmme source %s instance to version 1.0", serviceContainerVmme_Source.getName()));
- CompositionPage.changeComponentVersion(canvasManager, vmmeCanvasElement, "1.0", false);
-
- ServiceVerificator.verifyLinkCreated(serviceReqDetails, getUser(), 3);
- }
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-}
-
-
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Product.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Product.java
deleted file mode 100644
index 15f0456086..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Product.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.sanity;
-
-import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
-import org.openecomp.sdc.ci.tests.datatypes.ProductReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.CompositionPage;
-import org.openecomp.sdc.ci.tests.pages.GeneralPageElements;
-import org.openecomp.sdc.ci.tests.pages.ProductGeneralPage;
-import org.openecomp.sdc.ci.tests.pages.TesterOperationPage;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ProductUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ServiceUIUtils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.testng.annotations.Test;
-
-/**
- * @author al714h
- */
-
-public class Product extends SetupCDTest {
-
-
- @Test
- public void createProductAndAddCertifiedServiceInstance() throws Exception {
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ProductReqDetails productReqDetails = ElementFactory.getDefaultProduct();
-
- ServiceUIUtils.createService(serviceMetadata);
- GeneralPageElements.clickSubmitForTestingButton(serviceMetadata.getName());
- reloginWithNewRole(UserRoleEnum.TESTER);
- GeneralUIUtils.findComponentAndClick(serviceMetadata.getName());
- TesterOperationPage.certifyComponent(serviceMetadata.getName());
- reloginWithNewRole(UserRoleEnum.PRODUCT_MANAGER1);
- ProductUIUtils.createProduct(productReqDetails, getUser());
- ProductGeneralPage.getProductLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
- CanvasElement canvasElement = CompositionPage.addElementToCanvasScreen(serviceMetadata.getName(), canvasManager);
- canvasManager.clickOnCanvaElement(canvasElement);
- }
-
- @Test
- public void loginAsProductStrateger() throws Exception {
- reloginWithNewRole(UserRoleEnum.PRODUCT_STRATEGIST1);
- }
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PropertiesAssignment.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PropertiesAssignment.java
deleted file mode 100644
index 2b35d3b4ed..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PropertiesAssignment.java
+++ /dev/null
@@ -1,581 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.sanity;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-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.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.GeneralPageElements;
-import org.openecomp.sdc.ci.tests.pages.HomePage;
-import org.openecomp.sdc.ci.tests.pages.PropertiesAssignmentPage;
-import org.openecomp.sdc.ci.tests.pages.PropertyNameBuilder;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.verificator.PropertiesAssignmentVerificator;
-import org.testng.AssertJUnit;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-
-public class PropertiesAssignment extends SetupCDTest {
-
- private static String filePath;
- private static String csarFile = "PCRF_OS_FIXED.csar";
- private static String csarFile1 = "437285.csar";
-
- @BeforeClass
- public void beforeClass() {
- filePath = FileHandling.getFilePath("");
- }
-
- @BeforeMethod
- public void beforeTest() {
- System.out.println("File repository is : " + filePath);
- getExtendTest().log(Status.INFO, "File repository is : " + filePath);
- }
-
-
- //VF - Simple Properties Tests
- @Test
- public void declareAndDeleteInputVfTest() throws Exception {
-
- String csarTestFile = csarFile;
- String componentName = "abstract_psm";
- String propertyName = "service_template_filter";
-
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- resourceMetaData.setVersion("0.1");
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, csarTestFile, getUser());
-
-
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
- PropertiesAssignmentPage.findSearchBoxAndClick(propertyName);
- PropertiesAssignmentPage.clickOnDeclareButton();
- GeneralUIUtils.ultimateWait();
- AssertJUnit.assertTrue(PropertiesAssignmentPage.isPropertyChecked(propertyName));
-
- PropertiesAssignmentPage.clickOnInputTab();
- PropertiesAssignmentPage.findInput(componentName, propertyName);
- PropertiesAssignmentPage.clickOnDeleteInputButton();
- PropertiesAssignmentPage.clickOnDeleteInputDialogConfirmationButton();
- PropertiesAssignmentPage.clickOnPropertiesTab();
- PropertiesAssignmentPage.findProperty(propertyName);
- AssertJUnit.assertFalse(PropertiesAssignmentPage.isPropertyChecked(propertyName));
-
-
- }
-
-
- @Test
- public void editAndSaveSimplePropertyValueTest() throws Exception {
-
- String csarTestFile = csarFile;
- String componentName = "abstract_psm";
- String propertyNameString = PropertyNameBuilder.buildSimpleField("nfc_function");
- String propertyNameInt = PropertyNameBuilder.buildSimpleField("index_value");
- String propertyValueString = "abc";
- String propertyValueInt = "123";
-
- //Create VF
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(
- "ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- resourceMetaData.setVersion("0.1");
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, csarTestFile, getUser());
-
- //Navigate to Properties Assignment screen, edit simple properties values and save
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
- PropertiesAssignmentPage.editPropertyValue(propertyNameString, propertyValueString);
- PropertiesAssignmentPage.editPropertyValue(propertyNameInt, propertyValueInt);
- PropertiesAssignmentPage.clickOnSaveButton();
-
- //Verify that properties values are saved
- HomePage.navigateToHomePage();
- GeneralUIUtils.findComponentAndClick(resourceMetaData.getName());
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
- PropertiesAssignmentVerificator.validatePropertyValue(propertyNameString, propertyValueString);
- PropertiesAssignmentVerificator.validatePropertyValue(propertyNameInt, propertyValueInt);
- }
-
- @Test
- public void editAndSaveBooleanPropertyValueTest() throws Exception {
-
- String csarTestFile = csarFile;
- String componentName = "oam_volume_0";
- String propertyNameTrue = "value-prop-read_only";
- String propertyValueTrue = "TRUE";
- String propertyNameFalse = "value-prop-delete_on_termination";
- String propertyValueFalse = "FALSE";
-
- //Create VF
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- resourceMetaData.setVersion("0.1");
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, csarTestFile, getUser());
-
- //Navigate to Properties Assignment screen, edit simple properties values and save from a dialog
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
- PropertiesAssignmentPage.selectBooleanPropertyValue(propertyNameTrue, propertyValueTrue);
- PropertiesAssignmentPage.selectBooleanPropertyValue(propertyNameFalse, propertyValueFalse);
- PropertiesAssignmentPage.clickOnSaveButton();
-
- //Verify that properties values are saved
- ResourceGeneralPage.getLeftMenu().moveToDeploymentViewScreen();
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
- PropertiesAssignmentVerificator.validateBooleanPropertyValue(propertyNameTrue, propertyValueTrue);
- PropertiesAssignmentVerificator.validateBooleanPropertyValue(propertyNameFalse, propertyValueFalse);
- }
-
- @Test
- public void editAndSavePopupPropertyValueTest() throws Exception {
-// Internal bug 391466
-// Popup Property: value editing is done in a popup text field, opened by clicking Edit button
-// Example: subnetpoolid property
-
- String csarTestFile = csarFile1;
- String componentName = "abstract_cif";
- String propertyName = "port_cif_imsli_port_subnetpoolid";
- String propertyValue = "updated by designer";
-
- //Create VF
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(
- "ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- resourceMetaData.setVersion("0.1");
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, csarTestFile, getUser());
-
- //Navigate to Properties Assignment screen, edit popup property value and save
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
- PropertiesAssignmentPage.clickOnEditButton(propertyName);
- PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildSimpleField(propertyName), propertyValue);
- PropertiesAssignmentPage.clickOnSetButton();
- PropertiesAssignmentPage.clickOnSaveButton();
-
- //Verify that popup property value is saved
- ResourceGeneralPage.getLeftMenu().moveToDeploymentViewScreen();
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
- PropertiesAssignmentPage.clickOnEditButton(propertyName);
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildSimpleField(propertyName), propertyValue);
-
- }
-
-
- @Test
- public void editAndDiscardSimplePropertyValueTest() throws Exception {
-
- String csarTestFile = csarFile;
- String componentName = "abstract_psm";
- String propertyNameString = "value-prop-nfc_function";
- String propertyNameInt = "value-prop-index_value";
- String propertyValueString = "abc";
- String propertyValueInt = "123";
- String propertyOrigValueString = "";
- String propertyOrigValueInt = "0";
-
- //Create VF
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- resourceMetaData.setVersion("0.1");
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, csarTestFile, getUser());
-
- //Navigate to Properties Assignment screen, edit simple properties values and discard changes
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
- PropertiesAssignmentPage.editPropertyValue(propertyNameString, propertyValueString);
- PropertiesAssignmentPage.editPropertyValue(propertyNameInt, propertyValueInt);
- PropertiesAssignmentPage.clickOnDiscardButton();
-
- //Verify that properties values are not saved
- HomePage.navigateToHomePage();
- GeneralUIUtils.findComponentAndClick(resourceMetaData.getName());
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
- PropertiesAssignmentVerificator.validatePropertyValue(propertyNameString, propertyOrigValueString);
- PropertiesAssignmentVerificator.validatePropertyValue(propertyNameInt, propertyOrigValueInt);
- }
-
- @Test
- public void editAndSaveSimplePropertyFromDialogTest() throws Exception {
-
- String csarTestFile = csarFile;
- String componentName = "abstract_psm";
- String propertyNameString = "value-prop-nfc_function";
- String propertyNameInt = "value-prop-index_value";
- String propertyValueString = "abc";
- String propertyValueInt = "123";
-
- //Create VF
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- resourceMetaData.setVersion("0.1");
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, csarTestFile, getUser());
-
- //Navigate to Properties Assignment screen, edit simple properties values and save from a dialog
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
- PropertiesAssignmentPage.editPropertyValue(propertyNameString, propertyValueString);
- PropertiesAssignmentPage.editPropertyValue(propertyNameInt, propertyValueInt);
- PropertiesAssignmentPage.clickOnInputTab();
- PropertiesAssignmentPage.clickOnDialogCancelButton();
-
- //Verify that properties values are not removed
- PropertiesAssignmentVerificator.validatePropertyValue(propertyNameString, propertyValueString);
- PropertiesAssignmentVerificator.validatePropertyValue(propertyNameInt, propertyValueInt);
-
- PropertiesAssignmentPage.clickOnInputTab();
- PropertiesAssignmentPage.clickOnDialogSaveButton();
-
- //Verify that properties values are saved
- HomePage.navigateToHomePage();
- GeneralUIUtils.findComponentAndClick(resourceMetaData.getName());
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
- PropertiesAssignmentVerificator.validatePropertyValue(propertyNameString, propertyValueString);
- PropertiesAssignmentVerificator.validatePropertyValue(propertyNameInt, propertyValueInt);
- }
-
-
- @Test
- public void editAndDiscardSimplePropertyFromDialogTest() throws Exception {
-
- String csarTestFile = csarFile;
- String componentName = "abstract_psm";
- String propertyNameString = "value-prop-nfc_function";
- String propertyNameInt = "value-prop-index_value";
- String propertyValueString = "abc";
- String propertyValueInt = "123";
- String propertyOrigValueString = "";
- String propertyOrigValueInt = "0";
-
- //Create VF
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- resourceMetaData.setVersion("0.1");
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, csarTestFile, getUser());
-
- //Navigate to Properties Assignment screen, edit simple properties values and save from a dialog
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
- PropertiesAssignmentPage.editPropertyValue(propertyNameString, propertyValueString);
- PropertiesAssignmentPage.editPropertyValue(propertyNameInt, propertyValueInt);
- PropertiesAssignmentPage.clickOnInputTab();
- PropertiesAssignmentPage.clickOnDialogCancelButton();
-
- ///Verify that properties values are not removed
- PropertiesAssignmentVerificator.validatePropertyValue(propertyNameString, propertyValueString);
- PropertiesAssignmentVerificator.validatePropertyValue(propertyNameInt, propertyValueInt);
-
- PropertiesAssignmentPage.clickOnInputTab();
- PropertiesAssignmentPage.clickOnDialogDiscardButton();
-
- //Verify that properties values are saved
- HomePage.navigateToHomePage();
- GeneralUIUtils.findComponentAndClick(resourceMetaData.getName());
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
- PropertiesAssignmentVerificator.validatePropertyValue(propertyNameString, propertyOrigValueString);
- PropertiesAssignmentVerificator.validatePropertyValue(propertyNameInt, propertyOrigValueInt);
- }
-
-
- @Test
- public void editAndSaveInputValueTest() throws Exception {
-
- String csarTestFile = csarFile;
- String componentName = "abstract_psm";
- String propertyNameString = "value-input-nf_type";
- String propertyNameFloat = "value-input-pcm_volume_size_0";
- String propertyNameBoolean = "value-input-multi_stage_design";
- String propertyValueString = "POLICY";
- String propertyValueFloat = "80.1";
- String propertyValueBoolean = "TRUE";
-
- //Create VF
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- resourceMetaData.setVersion("0.1");
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, csarTestFile, getUser());
-
- //Navigate to Properties Assignment screen - Inputs
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
- PropertiesAssignmentPage.clickOnInputTab();
-
- //Verify that Save button is disabled when inserting invalid value into Input field
- PropertiesAssignmentPage.editPropertyValue(propertyNameFloat, propertyValueString);
- AssertJUnit.assertTrue(PropertiesAssignmentPage.isButtonDisabled(DataTestIdEnum.PropertiesAssignmentScreen.SAVE_BUTTON.getValue()));
-
- //Insert valid values for different Input types and save
- PropertiesAssignmentPage.editPropertyValue(propertyNameFloat, propertyValueFloat);
- PropertiesAssignmentPage.editPropertyValue(propertyNameString, propertyValueString);
- PropertiesAssignmentPage.selectBooleanPropertyValue(propertyNameBoolean, propertyValueBoolean);
- PropertiesAssignmentPage.clickOnSaveButton();
-
- //Verify that input values are saved after changing VF version
- ResourceGeneralPage.clickCheckinButton(resourceMetaData.getName());
- GeneralUIUtils.findComponentAndClick(resourceMetaData.getName());
- GeneralPageElements.clickCheckoutButton();
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
- PropertiesAssignmentPage.clickOnInputTab();
- PropertiesAssignmentVerificator.validatePropertyValue(propertyNameString, propertyValueString);
- PropertiesAssignmentVerificator.validatePropertyValue(propertyNameFloat, propertyValueFloat);
- PropertiesAssignmentVerificator.validateBooleanPropertyValue(propertyNameBoolean, propertyValueBoolean);
- }
-
- //VF - List and Map Properties Tests
-
- @Test
- public void editAndSaveListPropertyValueTest() throws Exception {
-
- String csarTestFile = csarFile;
- String componentName = "abstract_pps";
- String propertyName = "compute_pps_user_data_format";
- String propertyListValueZero = "RAW";
- String propertyListValueOne = "property-value-one";
- String propertyListValueTwo = "property-value-two";
-
-
- //Create VF
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- resourceMetaData.setVersion("0.1");
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, csarTestFile, getUser());
-
- //Navigate to Properties Assignment screen, edit "list of strings" properties values and save
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
- PropertiesAssignmentPage.clickOnAddValueToList(propertyName);
- PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildIndexedField(propertyName, 1), propertyListValueOne);
- PropertiesAssignmentPage.clickOnAddValueToList(propertyName);
- PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildIndexedField(propertyName, 2), propertyListValueTwo);
- PropertiesAssignmentPage.clickOnSaveButton();
- PropertiesAssignmentPage.clickODeleteValueFromList(propertyName, 1);
- PropertiesAssignmentPage.clickOnSaveButton();
-
- //Verify that properties values are saved
- ResourceGeneralPage.clickCheckinButton(resourceMetaData.getName());
- GeneralUIUtils.findComponentAndClick(resourceMetaData.getName());
- GeneralPageElements.clickCheckoutButton();
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildIndexedField(propertyName, 0), propertyListValueZero);
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildIndexedField(propertyName, 1), propertyListValueTwo);
-
-
- //Declare property as input, delete input
- PropertiesAssignmentPage.findSearchBoxAndClick(propertyName);
- PropertiesAssignmentPage.clickOnDeclareButton();
- AssertJUnit.assertTrue(PropertiesAssignmentPage.isPropertyChecked(propertyName));
-
- PropertiesAssignmentPage.clickOnInputTab();
- PropertiesAssignmentPage.findInput(componentName, propertyName);
- PropertiesAssignmentPage.clickOnDeleteInputButton();
- PropertiesAssignmentPage.clickOnDeleteInputDialogConfirmationButton();
- PropertiesAssignmentPage.clickOnPropertiesTab();
- PropertiesAssignmentPage.findProperty(propertyName);
- AssertJUnit.assertFalse(PropertiesAssignmentPage.isPropertyChecked(propertyName));
- }
-
- @Test
- public void editAndSaveListOfComplexPropertyValueTest() throws Exception {
-
- //External Defect 437285 - PLEASE DON'T DELETE THE TEST!!!!
-
- String csarTestFile = csarFile1;
- String componentName = "abstract_cdi";
- String propertyName = "port_cdi_imscore_port_ip_requirements";
- String nestedPropertyName = "ip_count";
- String propertyListValue = "12345";
-
- //Create VF
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- resourceMetaData.setVersion("0.1");
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, csarTestFile, getUser());
-
- //Navigate to Properties Assignment screen, edit "list of strings" properties values and save
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
- PropertiesAssignmentPage.clickOnAddValueToList(propertyName);
- PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildIComplexListField(propertyName, nestedPropertyName, 1), propertyListValue);
- PropertiesAssignmentPage.clickOnSaveButton();
- PropertiesAssignmentPage.clickOnExpandButton(propertyName, 1);
- PropertiesAssignmentPage.deletePropertyValue(PropertyNameBuilder.buildIComplexListField(propertyName, nestedPropertyName, 1));
- PropertiesAssignmentPage.clickOnSaveButton();
-
- //Verify that properties values are saved
- HomePage.navigateToHomePage();
- GeneralUIUtils.findComponentAndClick(resourceMetaData.getName());
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
- PropertiesAssignmentPage.clickOnExpandButton(propertyName, 1);
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildIComplexListField(propertyName, nestedPropertyName, 1), "");
-
-
- }
-
-
- @Test
- public void editAndSaveMapPropertyValueTest() throws Exception {
-
- String csarTestFile = csarFile;
- String componentName = "oam_volume_0";
- String propertyName = "metadata";
- String propertyMapKeyOne = "KEY1";
- String propertyMapValueOne = "property-value-one";
- String propertyMapKeyTwo = "KEY2";
- String propertyMapValueTwo = "property-value-two";
-
- //Create VF
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- resourceMetaData.setVersion("0.1");
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, csarTestFile, getUser());
-
- //Navigate to Properties Assignment screen, edit "map of strings" properties values and save
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
- PropertiesAssignmentPage.clickOnAddValueToList(propertyName);
- PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildIndexedField(propertyName, 0), propertyMapValueOne);
-
-
- //Verify that Save and Declare buttons are disabled when leaving Key value empty
- AssertJUnit.assertTrue(PropertiesAssignmentPage.isButtonDisabled(DataTestIdEnum.PropertiesAssignmentScreen.SAVE_BUTTON.getValue()));
- AssertJUnit.assertTrue(PropertiesAssignmentPage.isButtonDisabled(DataTestIdEnum.PropertiesAssignmentScreen.DECLARE_BUTTON.getValue()));
-
- PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildIndexedKeyField(propertyName, 0), propertyMapKeyOne);
- PropertiesAssignmentPage.clickOnSaveButton();
- PropertiesAssignmentPage.clickOnAddValueToList(propertyName);
- PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildIndexedKeyField(propertyName, 1), propertyMapKeyTwo);
- PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildIndexedField(propertyName, 1), propertyMapValueTwo);
- PropertiesAssignmentPage.clickODeleteValueFromList(propertyName, 0);
- PropertiesAssignmentPage.clickOnSaveButton();
-
- //Verify that properties values are saved
- ResourceGeneralPage.clickCheckinButton(resourceMetaData.getName());
- GeneralUIUtils.findComponentAndClick(resourceMetaData.getName());
- GeneralPageElements.clickCheckoutButton();
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildIndexedKeyField(propertyName, 0), propertyMapKeyTwo);
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildIndexedField(propertyName, 0), propertyMapValueTwo);
-
- //Declare property as input, delete input
- PropertiesAssignmentPage.findSearchBoxAndClick(propertyName);
- PropertiesAssignmentPage.clickOnDeclareButton();
- AssertJUnit.assertTrue(PropertiesAssignmentPage.isPropertyChecked(propertyName));
-
- PropertiesAssignmentPage.clickOnInputTab();
- PropertiesAssignmentPage.findInput(componentName, propertyName);
- PropertiesAssignmentPage.clickOnDeleteInputButton();
- PropertiesAssignmentPage.clickOnDeleteInputDialogConfirmationButton();
- PropertiesAssignmentPage.clickOnPropertiesTab();
- PropertiesAssignmentPage.findProperty(propertyName);
- AssertJUnit.assertFalse(PropertiesAssignmentPage.isPropertyChecked(propertyName));
- }
-
-
- //VF - Complex Properties Tests
- @Test
- public void editAndSaveComplexPropertyValueTest() throws Exception {
-
- String csarTestFile = csarFile;
- String componentName = "abstract_psm";
- String propertyName = "service_template_filter";
- String propertyNameString = "substitute_service_template";
- String propertyNameInt = "index_value";
- String propertyNameBoolean = "scaling_enabled";
- String propertyValueString = "Modified_psmServiceTemplate.yaml";
- String propertyValueInt = "2147483647";
- String propertyValueBoolean = "FALSE";
-
- //Create VF
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- resourceMetaData.setVersion("0.1");
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, csarTestFile, getUser());
-
- //Navigate to Properties Assignment screen, edit simple properties values and save
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
- PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildIComplexField(propertyName, propertyNameString), propertyValueString);
- PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildIComplexField(propertyName, propertyNameInt), propertyValueInt);
- PropertiesAssignmentPage.selectBooleanPropertyValue(PropertyNameBuilder.buildIComplexField(propertyName, propertyNameBoolean), propertyValueBoolean);
- PropertiesAssignmentPage.clickOnSaveButton();
-
- //Verify that properties values are saved
- ResourceGeneralPage.clickCheckinButton(resourceMetaData.getName());
- GeneralUIUtils.findComponentAndClick(resourceMetaData.getName());
- GeneralPageElements.clickCheckoutButton();
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildIComplexField(propertyName, propertyNameString), propertyValueString);
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildIComplexField(propertyName, propertyNameInt), propertyValueInt);
- PropertiesAssignmentVerificator.validateBooleanPropertyValue(PropertyNameBuilder.buildIComplexField(propertyName, propertyNameBoolean), propertyValueBoolean);
-
- //Select complex property and declare as input
- PropertiesAssignmentPage.findSearchBoxAndClick(propertyName);
- PropertiesAssignmentPage.clickOnDeclareButton();
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildSimpleField(propertyName), PropertyNameBuilder.buildVfDeclaredPropValue(componentName, propertyName));
- }
-
-
- //VF - Filter Tests
- @Test
- public void filterAllVfTest() throws Exception {
- final int propertiesCountFilter = 22;
- int propertiesCountWithoutFilter;
-
- String csarTestFile = csarFile;
- String propertyName = "name";
- String propertyLocation = DataTestIdEnum.PropertiesAssignmentScreen.PROPERTY_NAME_COLUMN.getValue();
-
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- resourceMetaData.setVersion("0.1");
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, csarTestFile, getUser());
-
-
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- //Count current properties number before filter is applied
- propertiesCountWithoutFilter = GeneralUIUtils.getWebElementsListByContainsClassName(propertyLocation).size();
- PropertiesAssignmentPage.clickOnFilterButton();
- PropertiesAssignmentPage.clickOnFilterAllCheckbox();
- PropertiesAssignmentPage.findFilterBoxAndClick(propertyName);
- PropertiesAssignmentPage.clickOnFilterApplyButton();
- PropertiesAssignmentVerificator.validateFilteredPropertiesCount(propertiesCountFilter, propertyLocation);
-
- PropertiesAssignmentPage.clickOnFilterClearAllButton();
- PropertiesAssignmentVerificator.validateFilteredPropertiesCount(propertiesCountWithoutFilter, propertyLocation);
- }
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-
-}
-
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PropertiesAssignmentUpdateFlow.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PropertiesAssignmentUpdateFlow.java
deleted file mode 100644
index 41c0d406b7..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PropertiesAssignmentUpdateFlow.java
+++ /dev/null
@@ -1,688 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.sanity;
-
-import com.aventstack.extentreports.Status;
-import fj.data.Either;
-import org.apache.commons.lang3.StringUtils;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.ComponentInstance;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.TopMenuButtonsEnum;
-import org.openecomp.sdc.ci.tests.datatypes.VendorLicenseModel;
-import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
-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.http.RestResponse;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.CompositionPage;
-import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.GeneralPageElements;
-import org.openecomp.sdc.ci.tests.pages.HeatParamNameBuilder;
-import org.openecomp.sdc.ci.tests.pages.HomePage;
-import org.openecomp.sdc.ci.tests.pages.PropertiesAssignmentPage;
-import org.openecomp.sdc.ci.tests.pages.PropertiesPage;
-import org.openecomp.sdc.ci.tests.pages.PropertyNameBuilder;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.utilities.CatalogUIUtilitis;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-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.openecomp.sdc.ci.tests.utils.general.VendorLicenseModelRestUtils;
-import org.openecomp.sdc.ci.tests.utils.general.VendorSoftwareProductRestUtils;
-import org.openecomp.sdc.ci.tests.verificator.PropertiesAssignmentVerificator;
-import org.openecomp.sdc.ci.tests.verificator.VfVerificator;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.DataProvider;
-import org.testng.annotations.Test;
-
-import java.util.List;
-
-import static org.testng.Assert.assertTrue;
-
-public class PropertiesAssignmentUpdateFlow extends SetupCDTest {
-
- private static String filePath;
- private static String origFile = "virc_fe_be.csar";
- private static String origFile1 = "virc.csar";
- protected User sdncDesignerDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
-
-
- @BeforeClass
- public void beforeClass() {
- filePath = FileHandling.getFilePath("");
- }
-
- @BeforeMethod
- public void beforeTest() {
- System.out.println("File repository is : " + filePath);
- }
-
- @DataProvider(name = "assetFilesInputs", parallel = false)
- public Object[][] createDataInputs() {
- return new Object[][]{
- {"editInputValueTopChange.csar", ""},
- {"editInputValueNoTopChange.csar", "Updated-SRE-Mgt"}};
- }
-
- /**
- * Topoplogy change in updated file - designer changes in inputs values are not kept after update
- * No topoplogy change in updated file - designer changes in inputs values are kept after update
- *
- * @param updFileName - csar for update
- * @param validationValue - expected property value after update
- * @throws Exception
- */
- @Test(dataProvider = "assetFilesInputs")
- public void updateInputDefaultValueTest(String updFileName, String validationValue) throws Exception {
- setLog(updFileName);
-
- String origTestFile = origFile;
- String componentName = "abstract_virc_fe_be_0";
- String inputName = "management_net_name";
- String inputUpdValue = "Updated-SRE-Mgt";
-
- //Import csar
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT,
- ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- resourceMetaData.setVersion("0.1");
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, origTestFile, getUser());
-
- //Edit Input value
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
- PropertiesAssignmentPage.clickOnInputTab();
- PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildInputField(inputName), inputUpdValue);
- PropertiesAssignmentPage.clickOnSaveButton();
-
- //Certify VF via API
- Resource resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resourceMetaData.getName(), "0.1");
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
-
- HomePage.navigateToHomePage();
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(resourceMetaData.getName());
-
- //Update VF
- ResourceGeneralPage.getLeftMenu().moveToGeneralScreen();
- GeneralPageElements.clickCheckoutButton();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating VF with new file"));
- ResourceUIUtils.updateVfWithCsar(filePath, updFileName);
-
- //Validate Input value - 1) empty in case of topology change; 2) user value is kept if no topology change
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
- PropertiesAssignmentPage.clickOnInputTab();
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildInputField(inputName), validationValue);
-
- }
-
-
- @DataProvider(name = "assetFilesProperties", parallel = false)
- public Object[][] createDataProp() {
- return new Object[][]{
- {"editedPropValueToEmpty.csar", "value-prop-vm_type_tag", "updated_by_designer"},
- {"newPropValueToEmpty.csar", "value-prop-high_availablity", "updated_by_designer"},
- {"editedPropValueToNew.csar", "value-prop-vm_type_tag", "updated_by_file"},
- {"editedPropValueToEmptyTopChange.csar", "value-prop-vm_type_tag", ""},
- {"newPropValueToEmptyTopChange.csar", "value-prop-high_availablity", ""},
- {"editedPropValueToNewTopChange.csar", "value-prop-vm_type_tag", "updated_by_file"}};
-
- }
-
- /**
- * No topoplogy change in updated file - designer changes in properties values are kept after update
- * OrigFile Designer UpdFile Result After Update
- * ---------------------------------------------------------------
- * prop1=value1 prop1=value2 prop1=null prop1=value2
- * prop1=null prop1=value1 prop1=null prop1=value1
- * prop1=value1 prop1=value2 prop1=value3 prop1=value3
- *
- *
- * Topoplogy change in updated file - designer changes in properties values are not kept after update
- * OrigFile Designer UpdFile Result After Update
- * ---------------------------------------------------------------
- * prop1=value1 prop1=value2 prop1=null prop1=null
- * prop1=null prop1=value1 prop1=null prop1=null
- * prop1=value1 prop1=value2 prop1=value3 prop1=value3
- *
- * @param updFileName - csar for update
- * @param propertyName
- * @param validationValue - expected property value after update
- * @throws Exception
- */
- @Test(dataProvider = "assetFilesProperties")
- public void updatePropertyDefaultValueTest(String updFileName, String propertyName, String validationValue) throws Exception {
- setLog(updFileName);
- String origTestFile = origFile;
- String componentName = "abstract_virc_fe_be_0";
- String propertyUpdValue = "updated_by_designer";
-
- //Import csar
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT,
- ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- resourceMetaData.setVersion("0.1");
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, origTestFile, getUser());
-
- //Edit Input value
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
- PropertiesAssignmentPage.editPropertyValue(propertyName, propertyUpdValue);
- PropertiesAssignmentPage.clickOnSaveButton();
-
- //Certify VF via API
- Resource resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resourceMetaData.getName(), "0.1");
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
-
- HomePage.navigateToHomePage();
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(resourceMetaData.getName());
-
- //Update VF
- ResourceGeneralPage.getLeftMenu().moveToGeneralScreen();
- GeneralPageElements.clickCheckoutButton();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating VF with new file"));
- ResourceUIUtils.updateVfWithCsar(filePath, updFileName);
-
- //Validate Input value
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
- PropertiesAssignmentVerificator.validatePropertyValue(propertyName, validationValue);
- }
-
-
- @Test
- public void updatePropertyChangeVfiVersionTest() throws Throwable {
- String vnfFile = "vIRC_FE_BE.zip";
- String componentName = "virc_fe_be_volume_0";
- String propertyName = "disk_bus";
- String propertyValue = "added_by_designer";
- String propertyValueUpd = "updated_by_designer";
- String inputName = componentName + "_" + propertyName;
-
- //Import VSP, create VF - v0.1
- String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
- getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
- vendorLicenseModel, null);
- resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
- Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
-
- //Edit Property Value and declare as input
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(resourceReqDetails.getName());
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
- PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildSimpleField(propertyName), propertyValue);
- PropertiesAssignmentPage.clickOnSaveButton();
- PropertiesAssignmentPage.findSearchBoxAndClick(propertyName);
- PropertiesAssignmentPage.clickOnDeclareButton();
- PropertiesAssignmentPage.clickOnInputTab();
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildInputField(inputName), propertyValue);
-
- //Check in VF and add VFi to Service
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- ServiceReqDetails serviceReqDetails = OnboardingUtillViaApis.prepareServiceDetailsBeforeCreate(sdncDesignerDetails);
- getExtendTest().log(Status.INFO, "Create Service: " + serviceReqDetails.getName());
- org.openecomp.sdc.be.model.Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
- Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
- ComponentInstance componentInstance = addComponentInstanceToComponentContainer.left().value();
-
- //Find the VF input in Service properties, declare it as service input
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- GeneralUIUtils.findComponentAndClick(serviceReqDetails.getName());
- CompositionPage.moveToPropertiesScreen();
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildSimpleField(inputName), propertyValue);
- PropertiesAssignmentPage.findSearchBoxAndClick(inputName);
- PropertiesAssignmentPage.clickOnDeclareButton();
- PropertiesAssignmentPage.clickOnInputTab();
- PropertiesAssignmentVerificator.validatePropertyValue(
- PropertyNameBuilder.buildServiceDeclaredFieldVfLevel(componentInstance, componentName, propertyName),
- propertyValue
- );
-
- //Checkout VF, update input value and check in - v0.2
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- GeneralUIUtils.findComponentAndClick(resourceReqDetails.getName());
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnInputTab();
- PropertiesAssignmentPage.editPropertyValue(
- PropertyNameBuilder.buildDeclaredInputField(componentName, propertyName),
- propertyValueUpd
- );
-// PropertiesAssignmentPage.deletePropertyValue(PropertyNameBuilder.buildDeclaredInputField(componentName, propertyName));
- PropertiesAssignmentPage.clickOnSaveButton();
- ResourceGeneralPage.clickCheckinButton(resourceReqDetails.getName());
-
- //Change resource version on service
- resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resource.getName(), "0.2");
- AtomicOperationUtils.changeComponentInstanceVersion(service, componentInstance, resource, UserRoleEnum.DESIGNER, true);
-
- //Validate that service contains property with "get_input" value and input with the updated value
- GeneralUIUtils.findComponentAndClick(serviceReqDetails.getName());
- CompositionPage.moveToPropertiesScreen();
- PropertiesAssignmentPage.isPropertyChecked(inputName);
- PropertiesAssignmentVerificator.validatePropertyValue(
- PropertyNameBuilder.buildServicePropertyValue(componentName, propertyName),
- PropertyNameBuilder.buildServiceDeclaredPropertyValue(componentInstance, componentName, propertyName)
- );
- PropertiesAssignmentPage.clickOnInputTab();
- PropertiesAssignmentVerificator.validatePropertyValue(
- PropertyNameBuilder.buildServiceDeclaredFieldVfLevel(componentInstance, componentName, propertyName),
- propertyValueUpd
- );
- }
-
- @Test
- public void updateServicePropertyChangeVfiVersionTest() throws Throwable {
- String vnfFile = "vIRC_FE_BE.zip";
- String componentName = "virc_fe_be_volume_0";
- String propertyName = "multi_stage_design";
- String propertyValueBoolean = "TRUE";
-
- //Import VSP, create VF - v0.1
- String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
- getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
- vendorLicenseModel, null);
- resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
- Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
-
- //Check in VF and add VFi to Service
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- ServiceReqDetails serviceReqDetails = OnboardingUtillViaApis.prepareServiceDetailsBeforeCreate(sdncDesignerDetails);
- getExtendTest().log(Status.INFO, "Create Service: " + serviceReqDetails.getName());
- org.openecomp.sdc.be.model.Service service = AtomicOperationUtils.createCustomService(
- serviceReqDetails,
- UserRoleEnum.DESIGNER, true
- ).left().value();
- Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
- ComponentInstance componentInstance = addComponentInstanceToComponentContainer.left().value();
-
- //Find the VF input in Service properties, declare it as service input
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(serviceReqDetails.getName());
- CompositionPage.moveToPropertiesScreen();
- PropertiesAssignmentPage.findSearchBoxAndClick(propertyName);
- String defaultPropertyValueBoolean = PropertiesAssignmentPage.selectBooleanPropertyValue(PropertyNameBuilder.buildSimpleField(propertyName), propertyValueBoolean);
- PropertiesAssignmentPage.clickOnSaveButton();
- PropertiesAssignmentPage.clickOnDeclareButton();
- PropertiesAssignmentPage.clickOnInputTab();
- PropertiesAssignmentVerificator.validateBooleanPropertyValue(
- PropertyNameBuilder.buildServiceDeclaredFieldServiceLevel(componentInstance, propertyName),
- propertyValueBoolean
- );
-
-// //Checkout VF and check in - v0.2
- AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
-
-// //Change resource version on service
- resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resource.getName(), "0.2");
- AtomicOperationUtils.changeComponentInstanceVersion(service, componentInstance, resource, UserRoleEnum.DESIGNER, true);
-
-// //Validate that service contains property with "get_input" value and input with the updated value
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- GeneralUIUtils.findComponentAndClick(serviceReqDetails.getName());
- CompositionPage.moveToPropertiesScreen();
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildSimpleField(propertyName),
- PropertyNameBuilder.buildServiceDeclaredPropValueServiceLevel(componentInstance, propertyName));
- PropertiesAssignmentPage.isPropertyChecked(propertyName);
- PropertiesAssignmentPage.clickOnInputTab();
- PropertiesAssignmentVerificator.validateBooleanPropertyValue(
- PropertyNameBuilder.buildServiceDeclaredFieldServiceLevel(componentInstance, propertyName),
- StringUtils.isEmpty(defaultPropertyValueBoolean) ? propertyValueBoolean : defaultPropertyValueBoolean
- );
- }
-
- @Test
- public void deletePropertyChangeVfiVersionTest() throws Throwable {
- String vnfFile = "vIRC_FE_BE.zip";
- String componentName = "abstract_virc_fe_be_1";
- String propertyNameProp1 = "max_instances"; //empty property
- String propertyNameProp2 = "nfc_naming_code"; //non-empty property
- String propertyNameProp3 = "min_instances"; //non-empty property
- String propertyNameProp4 = "nf_type";
- String propertyValueProp2 = "virc_fe_be";
- String propertyValueProp3 = "0";
- String propertyValueUpd1 = "111";
- String propertyValueUpd2 = "updated_by_designer";
- String propertyValueUpd4 = "added_by_designer_on_service";
- String inputName1 = componentName + "_" + propertyNameProp1;
- String inputName2 = componentName + "_" + propertyNameProp2;
- String inputName3 = componentName + "_" + propertyNameProp3;
-
- //Import VSP, create VF - v0.1
- String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
- getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
- vendorLicenseModel, null);
- resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
- Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
-
- //VF - Declare properties as inputs
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(resourceReqDetails.getName());
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
- PropertiesAssignmentPage.findSearchBoxAndClick(propertyNameProp1);
- PropertiesAssignmentPage.clickOnDeclareButton();
- PropertiesAssignmentPage.findSearchBoxAndClick(propertyNameProp2);
- PropertiesAssignmentPage.clickOnDeclareButton();
- PropertiesAssignmentPage.findSearchBoxAndClick(propertyNameProp3);
- PropertiesAssignmentPage.clickOnDeclareButton();
- PropertiesAssignmentPage.clickOnInputTab();
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildInputField(inputName1), "");
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildInputField(inputName2), propertyValueProp2);
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildInputField(inputName3), propertyValueProp3);
-
- //Check in VF, create Service and add VFi to Service
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- ServiceReqDetails serviceReqDetails = OnboardingUtillViaApis.prepareServiceDetailsBeforeCreate(sdncDesignerDetails);
- getExtendTest().log(Status.INFO, "Create Service: " + serviceReqDetails.getName());
- org.openecomp.sdc.be.model.Service service = AtomicOperationUtils.createCustomService(
- serviceReqDetails, UserRoleEnum.DESIGNER,
- true
- ).left().value();
- Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
- ComponentInstance componentInstance = addComponentInstanceToComponentContainer.left().value();
-
- //Find the VF inputs in Service properties, add or edit properties values
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- GeneralUIUtils.findComponentAndClick(serviceReqDetails.getName());
- CompositionPage.moveToPropertiesScreen();
- PropertiesAssignmentPage.findSearchBoxAndClick(inputName1);
- PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildSimpleField(inputName1), propertyValueUpd1);
- PropertiesAssignmentPage.clickOnSaveButton();
- PropertiesAssignmentPage.findSearchBoxAndClick(inputName2);
- PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildSimpleField(inputName2), propertyValueUpd2);
- PropertiesAssignmentPage.clickOnSaveButton();
- PropertiesAssignmentPage.findSearchBoxAndClick(inputName3);
- PropertiesAssignmentPage.deletePropertyValue(PropertyNameBuilder.buildSimpleField(inputName3));
- PropertiesAssignmentPage.clickOnSaveButton();
- PropertiesAssignmentPage.findSearchBoxAndClick(propertyNameProp4);
- PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildSimpleField(propertyNameProp4), propertyValueUpd4);
- PropertiesAssignmentPage.clickOnSaveButton();
-
- //Checkout and check in VF, change VFi version on Service to 0.2
- AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- AtomicOperationUtils.changeComponentInstanceVersion(service, componentInstance, resource, UserRoleEnum.DESIGNER, true);
-
- //Service - Validate properties values
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- GeneralUIUtils.findComponentAndClick(serviceReqDetails.getName());
- CompositionPage.moveToPropertiesScreen();
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildSimpleField(inputName1), propertyValueUpd1);
-// PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildSimpleField(inputName2), propertyValueProp2);
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildSimpleField(inputName3), propertyValueProp3);
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildSimpleField(propertyNameProp4), propertyValueUpd4);
-
- //Service - Declare properties as inputs
- PropertiesAssignmentPage.findSearchBoxAndClick(inputName1);
- PropertiesAssignmentPage.clickOnDeclareButton();
-// PropertiesAssignmentPage.findSearchBoxAndClick(inputName2);
-// PropertiesAssignmentPage.clickOnDeclareButton();
- PropertiesAssignmentPage.findSearchBoxAndClick(inputName3);
- PropertiesAssignmentPage.clickOnDeclareButton();
- PropertiesAssignmentPage.findSearchBoxAndClick(propertyNameProp4);
- PropertiesAssignmentPage.clickOnDeclareButton();
- // TODO: 5/9/2018 Add validation for input values
-
- //VF - delete some declared inputs
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- GeneralUIUtils.findComponentAndClick(resourceReqDetails.getName());
- GeneralPageElements.clickCheckoutButton();
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnInputTab();
- PropertiesAssignmentPage.findInput(componentName, propertyNameProp1);
- PropertiesAssignmentPage.clickOnDeleteInputButton();
- PropertiesAssignmentPage.clickOnDeleteInputDialogConfirmationButton();
-//// PropertiesAssignmentPage.findInput(componentName, propertyNameProp2);
-// PropertiesAssignmentPage.clickOnDeleteInputButton();
-// PropertiesAssignmentPage.clickOnDeleteInputDialogConfirmationButton();
-
- //VF - check in VF, change VFi version on Service to 0.3
- ResourceGeneralPage.clickCheckinButton(resourceReqDetails.getName());
- resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resource.getName(), "0.3");
- AtomicOperationUtils.changeComponentInstanceVersion(service, componentInstance, resource, UserRoleEnum.DESIGNER, true);
-
- //Service - Validate that deleted inputs are not found in Service properties, others are found
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(serviceReqDetails.getName());
- CompositionPage.moveToPropertiesScreen();
- PropertiesAssignmentPage.findProperty(inputName1);
- assertTrue(GeneralUIUtils.isElementInvisibleByTestId(PropertyNameBuilder.buildSimpleField(inputName1)));
-// PropertiesAssignmentPage.findProperty(inputName2);
-// assertTrue(GeneralUIUtils.isElementInvisibleByTestId(PropertyNameBuilder.buildSimpleField(inputName2)));
- PropertiesAssignmentPage.findProperty(inputName3);
- assertTrue(GeneralUIUtils.isElementVisibleByTestId(PropertyNameBuilder.buildSimpleField(inputName3)));
- PropertiesAssignmentPage.findProperty(propertyNameProp4);
- assertTrue(GeneralUIUtils.isElementVisibleByTestId(PropertyNameBuilder.buildSimpleField(propertyNameProp4)));
-
- //Service - Validate that Service inputs that were declared from deleted properties are not found
- // - Validate that other inputs remain - Currently input of min_instances disappears - BUG 411833!!!
- }
-
- @Test
- public void updateVFCPropertyChangeVFCiVersionTest() throws Throwable {
- ResourceReqDetails atomicResourceMetaData;
- String prop1 = "network_role";
- String propValue1 = "added_value_1";
- String prop2 = "is_default";
- String propValue2 = "TRUE";
-
- //Import VFC, certify VFC
- String fileName = "importVFC_VFC23.yml";
- atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT,
- ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
- ResourceUIUtils.importVfc(atomicResourceMetaData, filePath, fileName, getUser());
- String vfcName = atomicResourceMetaData.getName();
- ResourceGeneralPage.clickCheckinButton(vfcName);
-
- //Create VF
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(vfMetaData, getUser());
-
- //Add VFCi to VF canvas
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager vfCanvasManager = CanvasManager.getCanvasManager();
- CanvasElement vfcElement = vfCanvasManager.createElementOnCanvas(vfcName);
-
- //VF Properties Assignment - edit properties values and declare as input
- CompositionPage.moveToPropertiesScreen();
- PropertiesAssignmentPage.findSearchBoxAndClick(prop1);
- PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildSimpleField(prop1), propValue1);
- PropertiesAssignmentPage.clickOnSaveButton();
- PropertiesAssignmentPage.clickOnDeclareButton();
- PropertiesAssignmentPage.findSearchBoxAndClick(prop2);
- String propDefaultValue2 = PropertiesAssignmentPage.selectBooleanPropertyValue(PropertyNameBuilder.buildSimpleField(prop2), propValue2);
- PropertiesAssignmentPage.clickOnSaveButton();
- PropertiesAssignmentPage.clickOnDeclareButton();
-
- //Check out and check in VFC - v0.2
- HomePage.navigateToHomePage();
- GeneralUIUtils.findComponentAndClick(vfcName);
- ResourceGeneralPage.clickCheckoutButton();
- ResourceGeneralPage.clickCheckinButton(vfcName);
-
- //Change VFCi version in VF
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- vfCanvasManager = CanvasManager.getCanvasManager();
- CompositionPage.changeComponentVersion(vfCanvasManager, vfcElement, "0.2");
- VfVerificator.verifyInstanceVersion(vfMetaData, getUser(), atomicResourceMetaData.getName(), "0.2");
-
- Resource resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, vfMetaData.getName(), "0.1");
- List<ComponentInstance> components = resource.getComponentInstances();
- String normalizedName = components.get(0).getNormalizedName();
- CompositionPage.moveToPropertiesScreen();
- PropertiesAssignmentPage.clickOnInputTab();
- //Verify that input value of the declared property that is EMPTY by default hasn't changed
-// PropertiesAssignmentVerificator.validateBooleanPropertyValue(PropertyNameBuilder.buildDeclaredInputField(normalizedName, prop2), propValue2);
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildDeclaredInputField(normalizedName, prop1), propValue1);
- //Verify that input value of the declared property that is NOT EMPTY by default has been changed
- PropertiesAssignmentVerificator.validateBooleanPropertyValue(PropertyNameBuilder.buildDeclaredInputField(normalizedName, prop2),
- StringUtils.isEmpty(propDefaultValue2) ? propValue2 : propDefaultValue2);
-
- //Check out VFC - v0.3, delete a property, check in VFC
- HomePage.navigateToHomePage();
- GeneralUIUtils.findComponentAndClick(vfcName);
- ResourceGeneralPage.clickCheckoutButton();
- ResourceGeneralPage.getLeftMenu().moveToPropertiesScreen();
- PropertiesPage.clickDeletePropertyFromPopup(prop1);
- PropertiesPage.clickDeletePropertyFromPopup(prop2);
- ResourceGeneralPage.clickCheckinButton(vfcName);
-
- //Change VFCi version in VF
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- vfCanvasManager = CanvasManager.getCanvasManager();
- CompositionPage.changeComponentVersion(vfCanvasManager, vfcElement, "0.3");
- VfVerificator.verifyInstanceVersion(vfMetaData, getUser(), atomicResourceMetaData.getName(), "0.3");
-
- //Verify that properties and inputs were removed
- CompositionPage.moveToPropertiesScreen();
- PropertiesAssignmentPage.findProperty(prop1);
- assertTrue(GeneralUIUtils.isElementInvisibleByTestId(PropertyNameBuilder.buildSimpleField(prop1)));
- PropertiesAssignmentPage.findProperty(prop2);
- assertTrue(GeneralUIUtils.isElementInvisibleByTestId(PropertyNameBuilder.buildSimpleField(prop2)));
- PropertiesAssignmentPage.clickOnInputTab();
- PropertiesAssignmentPage.findProperty(normalizedName + "_" + prop1);
- assertTrue(GeneralUIUtils.isElementInvisibleByTestId(PropertyNameBuilder.buildDeclaredInputField(normalizedName, prop1)));
- PropertiesAssignmentPage.findProperty(normalizedName + "_" + prop2);
- assertTrue(GeneralUIUtils.isElementInvisibleByTestId(PropertyNameBuilder.buildDeclaredInputField(normalizedName, prop2)));
- }
-
- @Test
- public void updateHeatParamChangeVfiVersionTest() throws Throwable {
- String vnfFile = "vIRC_FE_BE.zip";
- String artifactName = "base_fe_be";
- String heatParamName = "availability_zone_0";
- String heatParamUpdValue = "Updated_ZoneA";
-
- //Import VSP, create VF - v0.1
- String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
- getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
- vendorLicenseModel, null);
- resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
- Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
-
- //Check in VF and add VFi to Service
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- ServiceReqDetails serviceReqDetails = OnboardingUtillViaApis.prepareServiceDetailsBeforeCreate(sdncDesignerDetails);
- getExtendTest().log(Status.INFO, "Create Service: " + serviceReqDetails.getName());
- org.openecomp.sdc.be.model.Service service = AtomicOperationUtils.createCustomService(
- serviceReqDetails,
- UserRoleEnum.DESIGNER, true
- ).left().value();
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(service.getName());
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager vfCanvasManager = CanvasManager.getCanvasManager();
- CanvasElement vfElement = vfCanvasManager.createElementOnCanvas(resource.getName());
-
- //Select VFi on canvas, open Deployment Artifacts tab
- vfCanvasManager.clickOnCanvaElement(vfElement);
- CompositionPage.showDeploymentArtifactTab();
- DeploymentArtifactPage.hoverArtifact(artifactName);
- DeploymentArtifactPage.clickEditEnvArtifact(artifactName);
- DeploymentArtifactPage.editHeatParamValue(HeatParamNameBuilder.buildCurrentHeatParamValue(heatParamName), heatParamUpdValue);
- DeploymentArtifactPage.clickSaveEnvParameters();
-
- //Checkout and check in VF - v0.2
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
-
- //Change VFi version on Service canvas - v0.2
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- GeneralUIUtils.findComponentAndClick(service.getName());
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- vfCanvasManager = CanvasManager.getCanvasManager();
- CompositionPage.changeComponentVersion(vfCanvasManager, vfElement, "0.2");
-// VfVerificator.verifyInstanceVersion(service, getUser(), resource.getName(), "0.2");
-
- //Validate that edited heatparam value is kept
- CompositionPage.showDeploymentArtifactTab();
- DeploymentArtifactPage.hoverArtifact(artifactName);
- DeploymentArtifactPage.clickEditEnvArtifact(artifactName);
- PropertiesAssignmentVerificator.validatePropertyValue(HeatParamNameBuilder.buildCurrentHeatParamValue(heatParamName), heatParamUpdValue);
- DeploymentArtifactPage.clickCloseEnvParameters();
-
- //Check out VF, delete heatparam value, check in VF - v0.3
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- GeneralUIUtils.findComponentAndClick(resource.getName());
- ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
- DeploymentArtifactPage.clickEditEnvArtifact(artifactName);
- DeploymentArtifactPage.clickOnDeleteHeatParamValue(heatParamName);
- DeploymentArtifactPage.clickSaveEnvParameters();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
-
- //Change VFi version on Service canvas - v0.3
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- GeneralUIUtils.findComponentAndClick(service.getName());
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- vfCanvasManager = CanvasManager.getCanvasManager();
- CompositionPage.changeComponentVersion(vfCanvasManager, vfElement, "0.3");
-
- //Validate that edited heatparam value is kept, default value is empty
- CompositionPage.showDeploymentArtifactTab();
- DeploymentArtifactPage.hoverArtifact(artifactName);
- DeploymentArtifactPage.clickEditEnvArtifact(artifactName);
- PropertiesAssignmentVerificator.validatePropertyValue(HeatParamNameBuilder.buildCurrentHeatParamValue(heatParamName), heatParamUpdValue);
- PropertiesAssignmentVerificator.validatePropertyValueIsNull(HeatParamNameBuilder.buildDefaultHeatParamValue(heatParamName));
- DeploymentArtifactPage.clickCloseEnvParameters();
- }
-
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-
-}
-
-
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PropertiesAssignmentUpdateFlow_New.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PropertiesAssignmentUpdateFlow_New.java
deleted file mode 100644
index c4b17f6594..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PropertiesAssignmentUpdateFlow_New.java
+++ /dev/null
@@ -1,926 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.sanity;
-
-import com.aventstack.extentreports.Status;
-import fj.data.Either;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.ComponentInstance;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.TopMenuButtonsEnum;
-import org.openecomp.sdc.ci.tests.datatypes.VendorLicenseModel;
-import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
-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.http.RestResponse;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.CompositionPage;
-import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.GeneralPageElements;
-import org.openecomp.sdc.ci.tests.pages.HeatParamNameBuilder;
-import org.openecomp.sdc.ci.tests.pages.HomePage;
-import org.openecomp.sdc.ci.tests.pages.PropertiesAssignmentPage;
-import org.openecomp.sdc.ci.tests.pages.PropertiesPage;
-import org.openecomp.sdc.ci.tests.pages.PropertyNameBuilder;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.utilities.CatalogUIUtilitis;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-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.openecomp.sdc.ci.tests.utils.general.VendorLicenseModelRestUtils;
-import org.openecomp.sdc.ci.tests.utils.general.VendorSoftwareProductRestUtils;
-import org.openecomp.sdc.ci.tests.verificator.PropertiesAssignmentVerificator;
-import org.openecomp.sdc.ci.tests.verificator.VfVerificator;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.DataProvider;
-import org.testng.annotations.Test;
-
-import java.util.List;
-
-import static org.testng.Assert.assertTrue;
-
-public class PropertiesAssignmentUpdateFlow_New extends SetupCDTest {
-
- private static String filePath;
- private static String origFile = "virc_fe_be.csar";
- private static String origFile1 = "virc.csar";
- private User sdncDesignerDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
-
-
- @BeforeClass
- public void beforeClass() {
- filePath = FileHandling.getFilePath("");
- }
-
- @BeforeMethod
- public void beforeTest() {
- System.out.println("File repository is : " + filePath);
-// SetupCDTest.getExtendTest().log(Status.INFO, "File repository is : " + filePath);
- }
-
- //Update VSP tests - validating VF properties/inputs values after updating VF with a new VSP
- @DataProvider(name = "assetFilesInputs", parallel = false)
- public Object[][] createDataInputs() {
- return new Object[][]{
- {"editInputValueTopChange.csar", ""},
- {"editInputValueNoTopChange.csar", "Updated-SRE-Mgt"}};
- }
-
- /**
- * Topoplogy change in updated file - designer changes in inputs values are not kept after update
- * No topoplogy change in updated file - designer changes in inputs values are kept after update
- *
- * @param updFileName - csar for update
- * @param validationValue - expected property value after update
- * @throws Exception
- */
- @Test(dataProvider = "assetFilesInputs")
- public void updateInputDefaultValueTest(String updFileName, String validationValue) throws Exception {
- setLog(updFileName);
-
- String origTestFile = origFile;
- String componentName = "abstract_virc_fe_be_0";
- String inputName = "management_net_name";
- String inputUpdValue = "Updated-SRE-Mgt";
-
- //Import csar
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT,
- ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- resourceMetaData.setVersion("0.1");
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, origTestFile, getUser());
-
- //Edit Input value
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
- PropertiesAssignmentPage.clickOnInputTab();
- PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildInputField(inputName), inputUpdValue);
- PropertiesAssignmentPage.clickOnSaveButton();
-
- //Certify VF via API
- Resource resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resourceMetaData.getName(), "0.1");
- AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
-
- HomePage.navigateToHomePage();
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(resourceMetaData.getName());
-
- //Update VF
- ResourceGeneralPage.getLeftMenu().moveToGeneralScreen();
- GeneralPageElements.clickCheckoutButton();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating VF with new file"));
- ResourceUIUtils.updateVfWithCsar(filePath, updFileName);
-
- //Validate Input value - 1) empty in case of topology change; 2) user value is kept if no topology change
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
- PropertiesAssignmentPage.clickOnInputTab();
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildInputField(inputName), validationValue);
-
- }
-
-
- @DataProvider(name = "assetFilesProperties", parallel = false)
- public Object[][] createDataProp() {
- return new Object[][]{
- {"editedPropValueToEmpty.csar", "value-prop-vm_type_tag", "updated_by_designer", "updated_by_designer", false}, //no topology change - simple
- {"newPropValueToEmpty.csar", "value-prop-high_availablity", "updated_by_designer", "updated_by_designer", false},
- {"editedPropValueToNew.csar", "value-prop-vm_type_tag", "updated_by_designer", "updated_by_file", false},
- {"virc_fe_be.csar", "value-prop-vm_type_tag", "", "virc_fe_be", true},
- {"editedPropValueToEmptyTopChange.csar", "value-prop-vm_type_tag", "updated_by_designer", "", false}, //topology change - simple
- {"newPropValueToEmptyTopChange.csar", "value-prop-high_availablity", "updated_by_designer", "", false},
- {"editedPropValueToNewTopChange.csar", "value-prop-vm_type_tag", "updated_by_designer", "updated_by_file", false},
- {"virc_fe_be.csar", "value-prop-port_virc_fe_be_data_1_port_mac_requirements.mac_range_plan", "updated_by_designer", "updated_by_designer", false}, //no topology change - complex
- {"virc_fe_be.csar", "value-prop-service_template_filter.count", "12345", "1", false},
- {"virc_fe_be.csar", "value-prop-service_template_filter.substitute_service_template", "", "Nested_virc_fe_beServiceTemplate.yaml", true}};
- }
-
- /**
- * No topology change in updated file - designer changes in properties values are kept after update
- * OrigFile Designer UpdFile Result After Update
- * ---------------------------------------------------------------
- * prop1=value1 prop1=value2 prop1=null prop1=value2
- * prop1=null prop1=value1 prop1=null prop1=value1
- * prop1=value1 prop1=value2 prop1=value3 prop1=value3
- * prop1=value1 prop1=null prop1=value1 prop1=value1
- *
- *
- * Topoplogy change in updated file - designer changes in properties values are not kept after update
- * OrigFile Designer UpdFile Result After Update
- * ---------------------------------------------------------------
- * prop1=value1 prop1=value2 prop1=null prop1=null
- * prop1=null prop1=value1 prop1=null prop1=null
- * prop1=value1 prop1=value2 prop1=value3 prop1=value3
- *
- *
- * No topology change in updated files - complex property value changes
- * OrigFile Designer UpdFile Result After Update
- * ---------------------------------------------------------------
- * prop1=null prop1=value1 prop1=null prop1=value1
- * prop1=value1 prop1=value2 prop1=value1 prop1=value1
- * prop1=value1 prop1=null prop1=value1 prop1=value1
- *
- * @param updFileName - csar for update
- * @param propertyName
- * @param validationValue - expected property value after update
- * @throws Exception
- */
- @Test(dataProvider = "assetFilesProperties")
- public void updatePropertyDefaultValueTest(String updFileName, String propertyName, String updValue, String validationValue, boolean userDeletesValue) throws Exception {
- setLog(updFileName);
- String origTestFile = origFile;
- String componentName = "abstract_virc_fe_be_0";
-// String propertyUpdValue = "updated_by_designer";
-
- //Import csar
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT,
- ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- resourceMetaData.setVersion("0.1");
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, origTestFile, getUser());
-
- //Edit or delete Input value
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
- if (userDeletesValue) {
- PropertiesAssignmentPage.deletePropertyValue(propertyName);
- } else {
- PropertiesAssignmentPage.editPropertyValue(propertyName, updValue);
- }
- PropertiesAssignmentPage.clickOnSaveButton();
-
- //Certify VF via API
- Resource resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resourceMetaData.getName(), "0.1");
- AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- //Update VF
- HomePage.navigateToHomePage();
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(resourceMetaData.getName());
- ResourceGeneralPage.getLeftMenu().moveToGeneralScreen();
- GeneralPageElements.clickCheckoutButton();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating VF with new file"));
- ResourceUIUtils.updateVfWithCsar(filePath, updFileName);
-
- //Validate Input value
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
- PropertiesAssignmentVerificator.validatePropertyValue(propertyName, validationValue);
- }
-
-
- //ChangeVersion tests - validating service property values after changing VFi version on service
- @DataProvider(name = "assetFilesServiceProperties", parallel = false)
- public Object[][] createDataServiceProp() {
- return new Object[][]{
- {"max_instances", "", "111", "111"}, //edit service prop value, update with original empty value, keep user value after update
- {"nfc_naming_code", "virc_fe_be", "updated_by_designer", "virc_fe_be"}}; //edit service prop value, update with original value, set original value after update
- }
-
- @Test(dataProvider = "assetFilesServiceProperties")
- public void changeVfiVersionServicePropertyEditValueTest(String propertyName, String origValue, String updValue, String expectedValue) throws Throwable {
- setLog(propertyName);
- String vnfFile = "vIRC_FE_BE.zip";
- String componentName = "abstract_virc_fe_be_1";
- String inputName = componentName + "_" + propertyName;
-
- //Import VSP, create VF - v0.1
- String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
- getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
- vendorLicenseModel, null);
- resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
- Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
-
- //VF - Declare property as input
- declarePropertyAsInput(propertyName, componentName, resourceReqDetails);
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildInputField(inputName), origValue);
-
- //Check in VF, create Service and add VFi to Service
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- ServiceReqDetails serviceReqDetails = OnboardingUtillViaApis.prepareServiceDetailsBeforeCreate(sdncDesignerDetails);
- getExtendTest().log(Status.INFO, "Create Service: " + serviceReqDetails.getName());
- org.openecomp.sdc.be.model.Service service = AtomicOperationUtils.createCustomService(
- serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
- Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
- ComponentInstance componentInstance = addComponentInstanceToComponentContainer.left().value();
-
- //Find the VF inputs in Service properties, add or edit properties values
- findServiceProperty(inputName, serviceReqDetails);
- PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildSimpleField(inputName), updValue);
- PropertiesAssignmentPage.clickOnSaveButton();
-
- //Checkout and check in VF, change VFi version on Service to 0.2
- AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- AtomicOperationUtils.changeComponentInstanceVersion(service, componentInstance, resource, UserRoleEnum.DESIGNER, true);
-
- //Service - Validate properties values
- viewServiceProperties(serviceReqDetails);
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildSimpleField(inputName), expectedValue);
- }
-
-
- @Test
- public void changeVfiVersionServicePropertyDeleteValueTest() throws Throwable {
- String vnfFile = "vIRC_FE_BE.zip";
- String componentName = "abstract_virc_fe_be_1";
- String propertyName = "min_instances";
- String propertyValue = "0";
- String inputName = componentName + "_" + propertyName;
-
- //Import VSP, create VF - v0.1
- String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
- getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
- vendorLicenseModel, null);
- resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
- Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
-
- //VF - Declare properties as inputs
- declarePropertyAsInput(propertyName, componentName, resourceReqDetails);
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildInputField(inputName), propertyValue);
-
- //Check in VF, create Service and add VFi to Service
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- ServiceReqDetails serviceReqDetails = OnboardingUtillViaApis.prepareServiceDetailsBeforeCreate(sdncDesignerDetails);
- getExtendTest().log(Status.INFO, "Create Service: " + serviceReqDetails.getName());
- org.openecomp.sdc.be.model.Service service = AtomicOperationUtils.createCustomService(
- serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
- Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
- ComponentInstance componentInstance = addComponentInstanceToComponentContainer.left().value();
-
- //Find the VF inputs in Service properties, delete property value
- findServiceProperty(inputName, serviceReqDetails);
- PropertiesAssignmentPage.deletePropertyValue(PropertyNameBuilder.buildSimpleField(inputName));
- PropertiesAssignmentPage.clickOnSaveButton();
-
- //Checkout and check in VF, change VFi version on Service to 0.2
- AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- AtomicOperationUtils.changeComponentInstanceVersion(service, componentInstance, resource, UserRoleEnum.DESIGNER, true);
-
- //Service - Validate properties values
- viewServiceProperties(serviceReqDetails);
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildSimpleField(inputName), propertyValue);
- }
-
- @Test
- public void changeVfiVersionServiceGenericPropertyValueTest() throws Throwable {
- String vnfFile = "vIRC_FE_BE.zip";
- String componentName = "abstract_virc_fe_be_1";
- String propertyName = "nf_type";
- String propertyUpdValue = "added by designer on service";
-
- //Import VSP, create VF - v0.1
- String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
- getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
- vendorLicenseModel, null);
- resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
- Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
-
- //Check in VF, create Service and add VFi to Service
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- ServiceReqDetails serviceReqDetails = OnboardingUtillViaApis.prepareServiceDetailsBeforeCreate(sdncDesignerDetails);
- getExtendTest().log(Status.INFO, "Create Service: " + serviceReqDetails.getName());
- org.openecomp.sdc.be.model.Service service = AtomicOperationUtils.createCustomService(
- serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
- Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
- ComponentInstance componentInstance = addComponentInstanceToComponentContainer.left().value();
-
- //Find the VF inputs in Service properties, add or edit property value
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(serviceReqDetails.getName());
- CompositionPage.moveToPropertiesScreen();
- PropertiesAssignmentPage.findSearchBoxAndClick(propertyName);
- PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildSimpleField(propertyName), propertyUpdValue);
- PropertiesAssignmentPage.clickOnSaveButton();
-
- //Checkout and check in VF, change VFi version on Service to 0.2
- AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- AtomicOperationUtils.changeComponentInstanceVersion(service, componentInstance, resource, UserRoleEnum.DESIGNER, true);
-
- //Service - Validate property value
- viewServiceProperties(serviceReqDetails);
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildSimpleField(propertyName), propertyUpdValue);
- }
-
-
- //ChangeVersion tests - validating service input values after changing VFi version on service
- @Test
- public void changeVfiServiceInputEditValueTest() throws Throwable {
- String vnfFile = "vIRC_FE_BE.zip";
- String componentName = "virc_fe_be_volume_0";
- String propertyName = "disk_bus";
- String propertyValue = "added_by_designer";
- String propertyValueUpd = "updated_by_designer";
- String inputName = componentName + "_" + propertyName;
-
- //Import VSP, create VF - v0.1
- String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
- getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
- vendorLicenseModel, null);
- resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
- Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
-
- //Edit Property Value and declare as input
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- viewVfComponentProperties(componentName, resourceReqDetails);
- editAndDeclareSimpleProperty(propertyName, propertyValue);
- PropertiesAssignmentPage.clickOnInputTab();
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildInputField(inputName), propertyValue);
-
- //Check in VF and add VFi to Service
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- ServiceReqDetails serviceReqDetails = OnboardingUtillViaApis.prepareServiceDetailsBeforeCreate(sdncDesignerDetails);
- getExtendTest().log(Status.INFO, "Create Service: " + serviceReqDetails.getName());
- org.openecomp.sdc.be.model.Service service = AtomicOperationUtils.createCustomService(
- serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
- Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
- ComponentInstance componentInstance = addComponentInstanceToComponentContainer.left().value();
-
- //Find the VF input in Service properties, declare it as service input
- viewServiceProperties(serviceReqDetails);
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildSimpleField(inputName), propertyValue);
- findAndDeclareServiceProperty(inputName);
- PropertiesAssignmentVerificator.validatePropertyValue(
- PropertyNameBuilder.buildServiceDeclaredFieldVfLevel(componentInstance, componentName, propertyName), propertyValue);
-
- //Checkout VF, update input value and check in - v0.2
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- viewVfInputs(resourceReqDetails);
- PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildDeclaredInputField(componentName, propertyName),
- propertyValueUpd);
- PropertiesAssignmentPage.clickOnSaveButton();
- ResourceGeneralPage.clickCheckinButton(resourceReqDetails.getName());
-
- //Change resource version on service
- resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resource.getName(), "0.2");
- AtomicOperationUtils.changeComponentInstanceVersion(service, componentInstance, resource, UserRoleEnum.DESIGNER, true);
-
- //Validate that service contains property with "get_input" value and input with the updated value
- GeneralUIUtils.findComponentAndClick(serviceReqDetails.getName());
- CompositionPage.moveToPropertiesScreen();
- PropertiesAssignmentPage.isPropertyChecked(inputName);
- PropertiesAssignmentVerificator.validatePropertyValue(
- PropertyNameBuilder.buildServicePropertyValue(componentName, propertyName),
- PropertyNameBuilder.buildServiceDeclaredPropertyValue(componentInstance, componentName, propertyName));
- PropertiesAssignmentPage.clickOnInputTab();
- PropertiesAssignmentVerificator.validatePropertyValue(
- PropertyNameBuilder.buildServiceDeclaredFieldVfLevel(componentInstance, componentName, propertyName), propertyValueUpd);
- }
-
- @Test
- public void changeVfiServiceInputEditBooleanTest() throws Throwable {
- String vnfFile = "vIRC_FE_BE.zip";
- String componentName = "virc_fe_be_volume_0";
- String propertyName = "multi_stage_design";
- String origValue = "FALSE";
- String updValue = "TRUE";
-
- //Import VSP, create VF - v0.1
- String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
- getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
- vendorLicenseModel, null);
- resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
- Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
-
- //Check in VF and add VFi to Service
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- ServiceReqDetails serviceReqDetails = OnboardingUtillViaApis.prepareServiceDetailsBeforeCreate(sdncDesignerDetails);
- getExtendTest().log(Status.INFO, "Create Service: " + serviceReqDetails.getName());
- org.openecomp.sdc.be.model.Service service = AtomicOperationUtils.createCustomService(
- serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
- Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
- ComponentInstance componentInstance = addComponentInstanceToComponentContainer.left().value();
-
- //Find the VF input in Service properties, declare it as service input
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(serviceReqDetails.getName());
- CompositionPage.moveToPropertiesScreen();
- PropertiesAssignmentPage.findSearchBoxAndClick(propertyName);
- PropertiesAssignmentPage.selectBooleanPropertyValue(PropertyNameBuilder.buildSimpleField(propertyName), updValue);
- PropertiesAssignmentPage.clickOnSaveButton();
- PropertiesAssignmentPage.clickOnDeclareButton();
- PropertiesAssignmentPage.clickOnInputTab();
- PropertiesAssignmentVerificator.validateBooleanPropertyValue(
- PropertyNameBuilder.buildServiceDeclaredFieldServiceLevel(componentInstance, propertyName),
- updValue);
-
-// //Checkout VF and check in - v0.2
- AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
-
-// //Change resource version on service
- resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resource.getName(), "0.2");
- AtomicOperationUtils.changeComponentInstanceVersion(service, componentInstance, resource, UserRoleEnum.DESIGNER, true);
-
-// //Validate that service contains property with "get_input" value and input with the updated value
- viewServiceProperties(serviceReqDetails);
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildSimpleField(propertyName),
- PropertyNameBuilder.buildServiceDeclaredPropValueServiceLevel(componentInstance, propertyName));
- PropertiesAssignmentPage.isPropertyChecked(propertyName);
- PropertiesAssignmentPage.clickOnInputTab();
- PropertiesAssignmentVerificator.validateBooleanPropertyValue(
- PropertyNameBuilder.buildServiceDeclaredFieldServiceLevel(componentInstance, propertyName),
- origValue);
- }
-
- @Test
- public void changeVfiServiceInputDeleteValueTest() throws Throwable {
- String vnfFile = "vIRC_FE_BE.zip";
- String componentName = "abstract_virc_fe_be_0";
- String propertyName = "vm_type_tag";
- String propertyValue = "updated_by_designer";
- String inputName = componentName + "_" + propertyName;
-
- //Import VSP, create VF - v0.1
- String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
- getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
- vendorLicenseModel, null);
- resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
- Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
-
- //Edit Property Value and declare as input
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- viewVfComponentProperties(componentName, resourceReqDetails);
- editAndDeclareSimpleProperty(propertyName, propertyValue);
- PropertiesAssignmentPage.clickOnInputTab();
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildInputField(inputName), propertyValue);
-
- //Check in VF and add VFi to Service
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- ServiceReqDetails serviceReqDetails = OnboardingUtillViaApis.prepareServiceDetailsBeforeCreate(sdncDesignerDetails);
- getExtendTest().log(Status.INFO, "Create Service: " + serviceReqDetails.getName());
- org.openecomp.sdc.be.model.Service service = AtomicOperationUtils.createCustomService(
- serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
- Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
- ComponentInstance componentInstance = addComponentInstanceToComponentContainer.left().value();
-
- //Find the VF input in Service properties, declare it as service input
- viewServiceProperties(serviceReqDetails);
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildSimpleField(inputName), propertyValue);
- findAndDeclareServiceProperty(inputName);
- PropertiesAssignmentVerificator.validatePropertyValue(
- PropertyNameBuilder.buildServiceDeclaredFieldVfLevel(componentInstance, componentName, propertyName), propertyValue);
-
- //Checkout VF, update input value and check in - v0.2
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- viewVfInputs(resourceReqDetails);
- PropertiesAssignmentPage.deletePropertyValue(PropertyNameBuilder.buildDeclaredInputField(componentName, propertyName));
- PropertiesAssignmentPage.clickOnSaveButton();
- ResourceGeneralPage.clickCheckinButton(resourceReqDetails.getName());
-
- //Change resource version on service
- resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resource.getName(), "0.2");
- AtomicOperationUtils.changeComponentInstanceVersion(service, componentInstance, resource, UserRoleEnum.DESIGNER, true);
-
- //Validate that service contains property with "get_input" value and input with the updated value
- GeneralUIUtils.findComponentAndClick(serviceReqDetails.getName());
- CompositionPage.moveToPropertiesScreen();
- PropertiesAssignmentPage.isPropertyChecked(inputName);
- PropertiesAssignmentVerificator.validatePropertyValue(
- PropertyNameBuilder.buildServicePropertyValue(componentName, propertyName),
- PropertyNameBuilder.buildServiceDeclaredPropertyValue(componentInstance, componentName, propertyName));
- PropertiesAssignmentPage.clickOnInputTab();
- PropertiesAssignmentVerificator.validatePropertyValue(
- PropertyNameBuilder.buildServiceDeclaredFieldVfLevel(componentInstance, componentName, propertyName), propertyValue);
- }
-
- @Test
- public void changeVfiServiceInputAddValueTest() throws Throwable {
- String vnfFile = "vIRC_FE_BE.zip";
- String componentName = "virc_fe_be_volume_0";
- String propertyName = "disk_bus";
- String propertyValue = "updated_by_designer";
- String inputName = componentName + "_" + propertyName;
-
- //Import VSP, create VF - v0.1
- String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
- getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
- vendorLicenseModel, null);
- resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
- Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
-
- //Edit Property Value and declare as input
- declarePropertyAsInput(propertyName, componentName, resourceReqDetails);
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildInputField(inputName), "");
-
- //Check in VF and add VFi to Service
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- ServiceReqDetails serviceReqDetails = OnboardingUtillViaApis.prepareServiceDetailsBeforeCreate(sdncDesignerDetails);
- getExtendTest().log(Status.INFO, "Create Service: " + serviceReqDetails.getName());
- org.openecomp.sdc.be.model.Service service = AtomicOperationUtils.createCustomService(
- serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
- Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
- ComponentInstance componentInstance = addComponentInstanceToComponentContainer.left().value();
-
- //Find the VF input in Service properties, declare it as service input
- viewServiceProperties(serviceReqDetails);
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildSimpleField(inputName), "");
- findAndDeclareServiceProperty(inputName);
- PropertiesAssignmentVerificator.validatePropertyValue(
- PropertyNameBuilder.buildServiceDeclaredFieldVfLevel(componentInstance, componentName, propertyName), "");
-
- //Checkout VF, update input value and check in - v0.2
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- viewVfInputs(resourceReqDetails);
- PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildDeclaredInputField(componentName, propertyName), propertyValue);
- PropertiesAssignmentPage.clickOnSaveButton();
- ResourceGeneralPage.clickCheckinButton(resourceReqDetails.getName());
-
- //Change resource version on service
- resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resource.getName(), "0.2");
- AtomicOperationUtils.changeComponentInstanceVersion(service, componentInstance, resource, UserRoleEnum.DESIGNER, true);
-
- //Validate that service contains property with "get_input" value and input with the updated value
- GeneralUIUtils.findComponentAndClick(serviceReqDetails.getName());
- CompositionPage.moveToPropertiesScreen();
- PropertiesAssignmentPage.isPropertyChecked(inputName);
- PropertiesAssignmentVerificator.validatePropertyValue(
- PropertyNameBuilder.buildServicePropertyValue(componentName, propertyName),
- PropertyNameBuilder.buildServiceDeclaredPropertyValue(componentInstance, componentName, propertyName));
- PropertiesAssignmentPage.clickOnInputTab();
- PropertiesAssignmentVerificator.validatePropertyValue(
- PropertyNameBuilder.buildServiceDeclaredFieldVfLevel(componentInstance, componentName, propertyName), propertyValue);
- }
-
- @Test
- public void changeVfiServiceInputDeleteInputTest() throws Throwable {
- String vnfFile = "vIRC_FE_BE.zip";
- String componentName = "virc_fe_be_volume_0";
- String propertyName = "disk_bus";
- String propertyValue = "added_by_designer";
- String inputName = componentName + "_" + propertyName;
-
- //Import VSP, create VF - v0.1
- String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
- getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
- vendorLicenseModel, null);
- resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
- Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
-
- //Edit Property Value and declare as input
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- viewVfComponentProperties(componentName, resourceReqDetails);
- editAndDeclareSimpleProperty(propertyName, propertyValue);
- PropertiesAssignmentPage.clickOnInputTab();
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildInputField(inputName), propertyValue);
-
- //Check in VF and add VFi to Service
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- ServiceReqDetails serviceReqDetails = OnboardingUtillViaApis.prepareServiceDetailsBeforeCreate(sdncDesignerDetails);
- getExtendTest().log(Status.INFO, "Create Service: " + serviceReqDetails.getName());
- org.openecomp.sdc.be.model.Service service = AtomicOperationUtils.createCustomService(
- serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
- Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
- ComponentInstance componentInstance = addComponentInstanceToComponentContainer.left().value();
-
- //Find the VF input in Service properties, declare it as service input
- viewServiceProperties(serviceReqDetails);
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildSimpleField(inputName), propertyValue);
- findAndDeclareServiceProperty(inputName);
- PropertiesAssignmentVerificator.validatePropertyValue(
- PropertyNameBuilder.buildServiceDeclaredFieldVfLevel(componentInstance, componentName, propertyName), propertyValue);
-
- //Checkout VF, delete input and check in - v0.2
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- viewVfInputs(resourceReqDetails);
- PropertiesAssignmentPage.clickOnDeleteInputButton();
- PropertiesAssignmentPage.clickOnDeleteInputDialogConfirmationButton();
- ResourceGeneralPage.clickCheckinButton(resourceReqDetails.getName());
-
- //Change resource version on service
- resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resource.getName(), "0.2");
- AtomicOperationUtils.changeComponentInstanceVersion(service, componentInstance, resource, UserRoleEnum.DESIGNER, true);
-
- //Validate that service property and input are deleted
- GeneralUIUtils.findComponentAndClick(serviceReqDetails.getName());
- CompositionPage.moveToPropertiesScreen();
- PropertiesAssignmentPage.findProperty(inputName);
- assertTrue(GeneralUIUtils.isElementInvisibleByTestId(PropertyNameBuilder.buildSimpleField(inputName)));
- PropertiesAssignmentPage.clickOnInputTab();
- assertTrue(GeneralUIUtils.isElementInvisibleByTestId(PropertyNameBuilder.buildServiceDeclaredFieldVfLevel(componentInstance, componentName, propertyName)));
- }
-
-
- //ChangeVersion test - validating VF input values after changing VFCi version on VF
- @Test
- public void updateVFCPropertyChangeVFCiVersionTest() throws Throwable {
- ResourceReqDetails atomicResourceMetaData;
- String prop1 = "network_role";
- String propValue1 = "added_value_1";
- String prop2 = "is_default";
- String propValue2 = "TRUE";
- String propDefaultValue2 = "FALSE";
-
- //Import VFC, certify VFC
- String fileName = "importVFC_VFC23.yml";
- atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT,
- ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
- ResourceUIUtils.importVfc(atomicResourceMetaData, filePath, fileName, getUser());
- String vfcName = atomicResourceMetaData.getName();
- ResourceGeneralPage.clickCheckinButton(vfcName);
-
- //Create VF
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(vfMetaData, getUser());
-
- //Add VFCi to VF canvas
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager vfCanvasManager = CanvasManager.getCanvasManager();
- CanvasElement vfcElement = vfCanvasManager.createElementOnCanvas(vfcName);
-
- //VF Properties Assignment - edit properties values and declare as input
- CompositionPage.moveToPropertiesScreen();
- PropertiesAssignmentPage.findSearchBoxAndClick(prop1);
- PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildSimpleField(prop1), propValue1);
- PropertiesAssignmentPage.clickOnSaveButton();
- PropertiesAssignmentPage.clickOnDeclareButton();
- PropertiesAssignmentPage.findSearchBoxAndClick(prop2);
- PropertiesAssignmentPage.selectBooleanPropertyValue(PropertyNameBuilder.buildSimpleField(prop2), propValue2);
- PropertiesAssignmentPage.clickOnSaveButton();
- PropertiesAssignmentPage.clickOnDeclareButton();
-
- //Check out and check in VFC - v0.2
- HomePage.navigateToHomePage();
- GeneralUIUtils.findComponentAndClick(vfcName);
- ResourceGeneralPage.clickCheckoutButton();
- ResourceGeneralPage.clickCheckinButton(vfcName);
-
- //Change VFCi version in VF
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- vfCanvasManager = CanvasManager.getCanvasManager();
- CompositionPage.changeComponentVersion(vfCanvasManager, vfcElement, "0.2");
- VfVerificator.verifyInstanceVersion(vfMetaData, getUser(), atomicResourceMetaData.getName(), "0.2");
-
- Resource resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, vfMetaData.getName(), "0.1");
- List<ComponentInstance> components = resource.getComponentInstances();
- String normalizedName = components.get(0).getNormalizedName();
- CompositionPage.moveToPropertiesScreen();
- PropertiesAssignmentPage.clickOnInputTab();
- //Verify that input value of the declared property that is EMPTY by default hasn't changed
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildDeclaredInputField(normalizedName, prop1), propValue1);
- //Verify that input value of the declared property that is NOT EMPTY by default has been changed
- PropertiesAssignmentVerificator.validateBooleanPropertyValue(PropertyNameBuilder.buildDeclaredInputField(normalizedName, prop2), propDefaultValue2);
-
- //Check out VFC - v0.3, delete a property, check in VFC
- HomePage.navigateToHomePage();
- GeneralUIUtils.findComponentAndClick(vfcName);
- ResourceGeneralPage.clickCheckoutButton();
- ResourceGeneralPage.getLeftMenu().moveToPropertiesScreen();
- PropertiesPage.clickDeletePropertyFromPopup(prop1);
- PropertiesPage.clickDeletePropertyFromPopup(prop2);
- ResourceGeneralPage.clickCheckinButton(vfcName);
-
- //Change VFCi version in VF
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- vfCanvasManager = CanvasManager.getCanvasManager();
- CompositionPage.changeComponentVersion(vfCanvasManager, vfcElement, "0.3");
- VfVerificator.verifyInstanceVersion(vfMetaData, getUser(), atomicResourceMetaData.getName(), "0.3");
-
- //Verify that properties and inputs were removed
- CompositionPage.moveToPropertiesScreen();
- PropertiesAssignmentPage.findProperty(prop1);
- assertTrue(GeneralUIUtils.isElementInvisibleByTestId(PropertyNameBuilder.buildSimpleField(prop1)));
- PropertiesAssignmentPage.findProperty(prop2);
- assertTrue(GeneralUIUtils.isElementInvisibleByTestId(PropertyNameBuilder.buildSimpleField(prop2)));
- PropertiesAssignmentPage.clickOnInputTab();
- PropertiesAssignmentPage.findProperty(normalizedName + "_" + prop1);
- assertTrue(GeneralUIUtils.isElementInvisibleByTestId(PropertyNameBuilder.buildDeclaredInputField(normalizedName, prop1)));
- PropertiesAssignmentPage.findProperty(normalizedName + "_" + prop2);
- assertTrue(GeneralUIUtils.isElementInvisibleByTestId(PropertyNameBuilder.buildDeclaredInputField(normalizedName, prop2)));
- }
-
- //ChangeVersion test - validating HEAT param values after changing VFi version on Service
- @Test
- public void updateHeatParamChangeVfiVersionTest() throws Throwable {
- String vnfFile = "vIRC_FE_BE.zip";
- String artifactName = "base_fe_be";
- String heatParamName = "availability_zone_0";
- String heatParamUpdValue = "Updated_ZoneA";
-
- //Import VSP, create VF - v0.1
- String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
- getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
- vendorLicenseModel, null);
- resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
- Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
-
- //Check in VF and add VFi to Service
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
- ServiceReqDetails serviceReqDetails = OnboardingUtillViaApis.prepareServiceDetailsBeforeCreate(sdncDesignerDetails);
- getExtendTest().log(Status.INFO, "Create Service: " + serviceReqDetails.getName());
- org.openecomp.sdc.be.model.Service service = AtomicOperationUtils.createCustomService(
- serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(service.getName());
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager vfCanvasManager = CanvasManager.getCanvasManager();
- CanvasElement vfElement = vfCanvasManager.createElementOnCanvas(resource.getName());
-
- //Select VFi on canvas, open Deployment Artifacts tab
- vfCanvasManager.clickOnCanvaElement(vfElement);
- CompositionPage.showDeploymentArtifactTab();
- DeploymentArtifactPage.hoverArtifact(artifactName);
- DeploymentArtifactPage.clickEditEnvArtifact(artifactName);
- DeploymentArtifactPage.editHeatParamValue(HeatParamNameBuilder.buildCurrentHeatParamValue(heatParamName), heatParamUpdValue);
- DeploymentArtifactPage.clickSaveEnvParameters();
-
- //Checkout and check in VF - v0.2
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
-
- //Change VFi version on Service canvas - v0.2
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- GeneralUIUtils.findComponentAndClick(service.getName());
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- vfCanvasManager = CanvasManager.getCanvasManager();
- CompositionPage.changeComponentVersion(vfCanvasManager, vfElement, "0.2");
-// VfVerificator.verifyInstanceVersion(service, getUser(), resource.getName(), "0.2");
-
- //Validate that edited heatparam value is kept
- CompositionPage.showDeploymentArtifactTab();
- DeploymentArtifactPage.hoverArtifact(artifactName);
- DeploymentArtifactPage.clickEditEnvArtifact(artifactName);
- PropertiesAssignmentVerificator.validatePropertyValue(HeatParamNameBuilder.buildCurrentHeatParamValue(heatParamName), heatParamUpdValue);
- DeploymentArtifactPage.clickCloseEnvParameters();
-
- //Check out VF, delete heatparam value, check in VF - v0.3
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- GeneralUIUtils.findComponentAndClick(resource.getName());
- ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
- DeploymentArtifactPage.clickEditEnvArtifact(artifactName);
- DeploymentArtifactPage.clickOnDeleteHeatParamValue(heatParamName);
- DeploymentArtifactPage.clickSaveEnvParameters();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
-
- //Change VFi version on Service canvas - v0.3
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- GeneralUIUtils.findComponentAndClick(service.getName());
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- vfCanvasManager = CanvasManager.getCanvasManager();
- CompositionPage.changeComponentVersion(vfCanvasManager, vfElement, "0.3");
-
- //Validate that edited heatparam value is kept, default value is empty
- CompositionPage.showDeploymentArtifactTab();
- DeploymentArtifactPage.hoverArtifact(artifactName);
- DeploymentArtifactPage.clickEditEnvArtifact(artifactName);
- PropertiesAssignmentVerificator.validatePropertyValue(HeatParamNameBuilder.buildCurrentHeatParamValue(heatParamName), heatParamUpdValue);
- PropertiesAssignmentVerificator.validatePropertyValueIsNull(HeatParamNameBuilder.buildDefaultHeatParamValue(heatParamName));
- DeploymentArtifactPage.clickCloseEnvParameters();
- }
-
-
- private void declarePropertyAsInput(String propertyName, String componentName, ResourceReqDetails resourceReqDetails) throws Exception {
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- viewVfComponentProperties(componentName, resourceReqDetails);
- findAndDeclareServiceProperty(propertyName);
- }
-
- private void viewServiceProperties(ServiceReqDetails serviceReqDetails) throws Exception {
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- GeneralUIUtils.findComponentAndClick(serviceReqDetails.getName());
- CompositionPage.moveToPropertiesScreen();
- }
-
- private void findServiceProperty(String inputName, ServiceReqDetails serviceReqDetails) throws Exception {
- viewServiceProperties(serviceReqDetails);
- PropertiesAssignmentPage.findSearchBoxAndClick(inputName);
- }
-
- private void viewVfComponentProperties(String componentName, ResourceReqDetails resourceReqDetails) throws Exception {
- GeneralUIUtils.findComponentAndClick(resourceReqDetails.getName());
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
- }
-
- private void findAndDeclareServiceProperty(String inputName) throws Exception {
- PropertiesAssignmentPage.findSearchBoxAndClick(inputName);
- PropertiesAssignmentPage.clickOnDeclareButton();
- PropertiesAssignmentPage.clickOnInputTab();
- }
-
- private void editAndDeclareSimpleProperty(String propertyName, String propertyValue) throws Exception {
- PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildSimpleField(propertyName), propertyValue);
- PropertiesAssignmentPage.clickOnSaveButton();
- PropertiesAssignmentPage.findSearchBoxAndClick(propertyName);
- PropertiesAssignmentPage.clickOnDeclareButton();
- }
-
- private void viewVfInputs(ResourceReqDetails resourceReqDetails) throws Exception {
- GeneralUIUtils.findComponentAndClick(resourceReqDetails.getName());
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentPage.clickOnInputTab();
- }
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-
-}
-
-
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Service.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Service.java
deleted file mode 100644
index 14cb23b952..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Service.java
+++ /dev/null
@@ -1,784 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.sanity;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.GroupDefinition;
-import org.openecomp.sdc.be.model.LifecycleStateEnum;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactInfo;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.CompositionScreenEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.ServiceMetadataEnum;
-import org.openecomp.sdc.ci.tests.datatypes.LifeCycleStateEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.TopMenuButtonsEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
-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.ServiceCategoriesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.CompositionPage;
-import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.DeploymentPage;
-import org.openecomp.sdc.ci.tests.pages.GeneralPageElements;
-import org.openecomp.sdc.ci.tests.pages.HomePage;
-import org.openecomp.sdc.ci.tests.pages.InputsPage;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.pages.ServiceGeneralPage;
-import org.openecomp.sdc.ci.tests.pages.TesterOperationPage;
-import org.openecomp.sdc.ci.tests.utilities.ArtifactUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.CatalogUIUtilitis;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ServiceUIUtils;
-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.ResourceRestUtils;
-import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
-import org.openecomp.sdc.ci.tests.verificator.DeploymentViewVerificator;
-import org.openecomp.sdc.ci.tests.verificator.ServiceVerificator;
-import org.openecomp.sdc.ci.tests.verificator.VfVerificator;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebElement;
-import org.testng.AssertJUnit;
-import org.testng.TestException;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.awt.*;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.testng.AssertJUnit.assertFalse;
-import static org.testng.AssertJUnit.assertTrue;
-
-public class Service extends SetupCDTest {
-
- private static final String DESCRIPTION = "kuku";
- private static final String ARTIFACT_LABEL = "artifact3";
- private static final String ARTIFACT_LABEL_UPDATE = "artifactUpdate";
- private static final String GET_ARTIFACT_LIST_BY_CLASS_NAME = "i-sdc-designer-sidebar-section-content-item-artifact";
- private static final String HEAT_FILE_YAML_NAME = "Heat-File.yaml";
- private static final String HEAT_FILE_YAML_UPDATE_NAME = "Heat-File-Update.yaml";
- private String filePath;
- private static CanvasElement computeElement;
-
- public static CanvasElement getComputeElement() {
- return computeElement;
- }
-
- @BeforeMethod
- public void beforeTest() {
- filePath = FileHandling.getFilePath("");
- }
-
-
- @Test
- public void createService() throws Exception {
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
- }
-
- @Test
- public void validDefaultContactAndTagAfterCreateService() throws Exception {
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createServiceWithDefaultTagAndUserId(serviceMetadata, getUser());
-
- assertTrue("wrong userId", getUser().getUserId().equals(ResourceGeneralPage.getContactIdText()));
-
- List<String> actualTags = Arrays.asList(ServiceGeneralPage.getTags());
- assertTrue("wrong tags", (actualTags.size() == 1) && actualTags.get(0).equals(serviceMetadata.getName()));
- }
-
- @Test
- public void validateHiddenCategories() throws Exception {
- // Create Service
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
-
- // Get categories list
- List<WebElement> ddOptions = ServiceGeneralPage.getCategories();
-
- for (WebElement opt: ddOptions) {
- assertFalse("Hidden Category visible", ServiceCategoriesEnum.PARTNERSERVICE.equals(opt.getText()));
- }
-
- }
-
- @Test
- public void updateService() throws Exception {
- // Create Service
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
-
- // Update Service
- ServiceGeneralPage.deleteOldTags(serviceMetadata);
- serviceMetadata.setName(ElementFactory.getServicePrefix() + "UpdatedName" + serviceMetadata.getName());
- serviceMetadata.setDescription("updatedDescriptionSanity");
- serviceMetadata.setProjectCode("654321");
- serviceMetadata.setContactId("cs6543");
- serviceMetadata.getTags().addAll(Arrays.asList("updatedTag", "oneMoreUpdatedTag", "lastOne UpdatedTag"));
- ServiceUIUtils.setServiceCategory(serviceMetadata, ServiceCategoriesEnum.VOIP);
- ServiceUIUtils.fillServiceGeneralPage(serviceMetadata);
- GeneralPageElements.clickCreateButton();
-
- ServiceVerificator.verifyServiceUpdatedInUI(serviceMetadata);
- }
-
- @Test
- public void deleteService() throws Exception {
-
- // create service
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
-
- // Delete service
- //GeneralUIUtils.HighlightMyElement(GeneralUIUtils.getWebButton("delete_version"));
- GeneralPageElements.clickTrashButtonAndConfirm();
-
- // Verification
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- CatalogUIUtilitis.catalogSearchBox(serviceMetadata.getName());
- ServiceVerificator.verifyServiceDeletedInUI(serviceMetadata);
- }
-
- @Test
- public void checkoutServiceTest() throws Exception {
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
-
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
-
- ArtifactInfo artifact = new ArtifactInfo(filePath, HEAT_FILE_YAML_NAME, DESCRIPTION, ARTIFACT_LABEL, "OTHER");
- CompositionPage.showDeploymentArtifactTab();
- CompositionPage.clickAddArtifactButton();
- ArtifactUIUtils.fillAndAddNewArtifactParameters(artifact, CompositionPage.artifactPopup());
-
- ResourceGeneralPage.clickCheckinButton(serviceMetadata.getName());
- GeneralUIUtils.findComponentAndClick(serviceMetadata.getName());
- GeneralPageElements.clickCheckoutButton();
-
- serviceMetadata.setVersion("0.2");
- ServiceVerificator.verifyServiceLifecycle(serviceMetadata, getUser(), LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
- VfVerificator.verifyVfLifecycleInUI(LifeCycleStateEnum.CHECKOUT);
- ServiceVerificator.verifyVersionUI(serviceMetadata.getVersion());
-
- ResourceGeneralPage.clickSubmitForTestingButton(serviceMetadata.getName());
-
- reloginWithNewRole(UserRoleEnum.TESTER);
- GeneralUIUtils.findComponentAndClick(serviceMetadata.getName());
- TesterOperationPage.certifyComponent(serviceMetadata.getName());
-
- reloginWithNewRole(UserRoleEnum.DESIGNER);
- GeneralUIUtils.findComponentAndClick(serviceMetadata.getName());
- ResourceGeneralPage.clickCheckoutButton();
-
- serviceMetadata.setVersion("1.1");
- serviceMetadata.setUniqueId(null);
- ServiceVerificator.verifyServiceLifecycle(serviceMetadata, getUser(), LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
- VfVerificator.verifyVfLifecycleInUI(LifeCycleStateEnum.CHECKOUT);
- ServiceVerificator.verifyVersionUI(serviceMetadata.getVersion());
- }
-
- @Test
- public void submitServiceForTestingWithNonCertifiedAsset() throws Exception {
-
- ResourceReqDetails atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
- ResourceUIUtils.createVF(atomicResourceMetaData, getUser());
- //TODO Andrey changed to click on ceckIn button
- ResourceGeneralPage.clickCheckinButton(atomicResourceMetaData.getName());
-
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
- DeploymentArtifactPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
- CompositionPage.searchForElement(atomicResourceMetaData.getName());
- canvasManager.createElementOnCanvas(atomicResourceMetaData.getName());
-
- try {
- CompositionPage.clickSubmitForTestingButton(serviceMetadata.getName());
- assert (false);
- } catch (Exception e) {
- String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
- String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.VALIDATED_RESOURCE_NOT_FOUND.name());
- assertTrue(errorMessage.contains(checkUIResponseOnError));
- } finally {
- ResourceRestUtils.deleteResourceByNameAndVersion(atomicResourceMetaData.getName(), "0.1");
- }
-
- }
-
- @Test
- public void createLinkService() throws Exception {
- String fileName2 = "vSeGW.csar";
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName2, getUser());
- ResourceGeneralPage.clickCheckinButton(resourceMetaData.getName());
-
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
- DeploymentArtifactPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
- CompositionPage.searchForElement(resourceMetaData.getName());
- CanvasElement firstElement = canvasManager.createElementOnCanvas(resourceMetaData.getName());
- CanvasElement secondElement = canvasManager.createElementOnCanvas(resourceMetaData.getName());
- canvasManager.linkElements(firstElement, secondElement);
- }
-
- @Test
- public void addDeploymentArtifactInCompositionScreenTest() throws Exception {
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
-
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- ArtifactInfo artifact = new ArtifactInfo(filePath, HEAT_FILE_YAML_NAME, DESCRIPTION, ARTIFACT_LABEL, "OTHER");
- CompositionPage.showDeploymentArtifactTab();
- CompositionPage.clickAddArtifactButton();
- ArtifactUIUtils.fillAndAddNewArtifactParameters(artifact, CompositionPage.artifactPopup());
-
- List<WebElement> actualArtifactList = GeneralUIUtils.getWebElementsListBy(By.className(GET_ARTIFACT_LIST_BY_CLASS_NAME));
- AssertJUnit.assertEquals(1, actualArtifactList.size());
-
- for (WebElement actualArtifactFileName : CompositionPage.getAllAddedArtifacts()) {
- assertTrue(HEAT_FILE_YAML_NAME.equals(actualArtifactFileName.getText()));
- }
-
- }
-
- @Test
- public void addInformationArtifactInCompositionScreenTest() throws Exception {
- String descriptionText = DESCRIPTION;
- List<String> artifactFileNames = new ArrayList<>();
-
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
-
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- ArtifactInfo artifactInfo = new ArtifactInfo(filePath, HEAT_FILE_YAML_NAME, descriptionText, ARTIFACT_LABEL, "OTHER");
- CompositionPage.showInformationArtifactTab();
- List<WebElement> beforeArtifactList = GeneralUIUtils.getWebElementsListBy(By.className(GET_ARTIFACT_LIST_BY_CLASS_NAME));
- CompositionPage.clickAddArtifactButton();
- ArtifactUIUtils.fillAndAddNewArtifactParameters(artifactInfo, CompositionPage.artifactPopup());
-
- List<WebElement> actualArtifactList = GeneralUIUtils.getWebElementsListBy(By.className(GET_ARTIFACT_LIST_BY_CLASS_NAME));
- assertThat(actualArtifactList).as("Check number of artifacts").hasSize(beforeArtifactList.size() + 1);
- int fileNameCounter = 0;
- String fileName;
- for (DataTestIdEnum.InformationalArtifactsService artifact : DataTestIdEnum.InformationalArtifactsService.values()) {
- fileName = HEAT_FILE_YAML_NAME_PREFIX + fileNameCounter + HEAT_FILE_YAML_NAME_SUFFIX;
- ArtifactUIUtils.fillPlaceHolderInformationalArtifact(artifact,
- FileHandling.getFilePath("uniqueFileNames"), fileName, descriptionText);
- artifactFileNames.add(fileName);
- fileNameCounter++;
- }
- artifactFileNames.add(HEAT_FILE_YAML_NAME);
- int numberOfFiles = CompositionPage.getAllAddedArtifacts().size();
- assertThat(numberOfFiles).as("Check number of artifacts").isEqualTo(beforeArtifactList.size() + 1);
-
- fileNameCounter = 0;
- for (WebElement actualArtifact : CompositionPage.getAllAddedArtifacts()) {
- assertThat(actualArtifact.getText()).isEqualTo(artifactFileNames.get(fileNameCounter));
- fileNameCounter++;
- }
- }
-
- @Test
- public void addAPIArtifactInCompositionScreenTest() throws Exception {
- String fileName = HEAT_FILE_YAML_NAME,
- descriptionText = DESCRIPTION,
- url = "http://kuku.com";
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
-
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- new ArtifactInfo(filePath, fileName, descriptionText, ARTIFACT_LABEL, "OTHER");
- CompositionPage.showAPIArtifactTab();
-
- for (DataTestIdEnum.APIArtifactsService artifact : DataTestIdEnum.APIArtifactsService.values()) {
- ArtifactUIUtils.fillPlaceHolderAPIArtifact(artifact, filePath, fileName, descriptionText, url);
- }
- int numberOfFiles = CompositionPage.getAllAddedArtifacts().size(),
- numberOfPlacehoders = DataTestIdEnum.APIArtifactsService.values().length;
- assertTrue(String.format("Wrong file count, should be %s files", numberOfPlacehoders), numberOfPlacehoders == numberOfFiles);
-
- for (WebElement actualArtifactFileName : CompositionPage.getAllAddedArtifacts()) {
- assertTrue(fileName.equals(actualArtifactFileName.getText()));
- }
- }
-
- @Test
- public void ManagmentWorkflowTest() throws Exception {
- String descriptionText = DESCRIPTION,
- descriptionTextEdit = "kuku2";
-
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
-
- ServiceGeneralPage.getServiceLeftMenu().moveToManagmentWorkflow();
- ServiceGeneralPage.fillAndAddNewWorkflow(descriptionText, descriptionText);
- ServiceVerificator.verifyManagmentWorkflow(descriptionText, descriptionText);
-
- ServiceGeneralPage.clickAddWorkflow();
- ServiceGeneralPage.fillAndAddNewWorkflow(descriptionTextEdit, descriptionTextEdit);
- }
-
- @Test
- public void deleteChangeVersionTest() throws Exception {
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
-
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
-
- ArtifactInfo artifact = new ArtifactInfo(filePath, HEAT_FILE_YAML_NAME, DESCRIPTION, ARTIFACT_LABEL, "OTHER");
- CompositionPage.showDeploymentArtifactTab();
- CompositionPage.clickAddArtifactButton();
- ArtifactUIUtils.fillAndAddNewArtifactParameters(artifact, CompositionPage.artifactPopup());
-
- ResourceGeneralPage.clickCheckinButton(serviceMetadata.getName());
- GeneralUIUtils.findComponentAndClick(serviceMetadata.getName());
- GeneralPageElements.clickCheckoutButton();
-
- changeDeleteAndValidateVersionOnGeneralPage("0.1", "0.2", serviceMetadata.getName());
-
- GeneralPageElements.clickCheckoutButton();
- ResourceGeneralPage.clickSubmitForTestingButton(serviceMetadata.getName());
-
- reloginWithNewRole(UserRoleEnum.TESTER);
- GeneralUIUtils.findComponentAndClick(serviceMetadata.getName());
- TesterOperationPage.certifyComponent(serviceMetadata.getName());
-
- reloginWithNewRole(UserRoleEnum.DESIGNER);
- GeneralUIUtils.findComponentAndClick(serviceMetadata.getName());
- ResourceGeneralPage.clickCheckoutButton();
-
- changeDeleteAndValidateVersionOnGeneralPage("1.0", "1.1", serviceMetadata.getName());
- }
-
- @Test
- public void compositionScreenRightSideButtonsTest() throws Exception {
-
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
-
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
-
- CompositionPage.showInformationTab();
- ServiceVerificator.verifyOpenTabTitle(CompositionScreenEnum.INFORMATION);
-
- //feature removed from UI
-// CompositionPage.showCompositionTab();
-// ServiceVerificator.verifyOpenTabTitle(CompositionScreenEnum.COMPOSITION);
-
- CompositionPage.showDeploymentArtifactTab();
- ServiceVerificator.verifyOpenTabTitle(CompositionScreenEnum.DEPLOYMENT_ARTIFACT_TAB);
-
- CompositionPage.showInputsTab();
- assertTrue(CompositionPage.getOpenTabTitle().size() == 0);
-
- CompositionPage.showAPIArtifactTab();
- ServiceVerificator.verifyOpenTabTitle(CompositionScreenEnum.API);
-
- CompositionPage.showInformationArtifactTab();
- ServiceVerificator.verifyOpenTabTitle(CompositionScreenEnum.INFORMATION_ARTIFACTS);
-
- }
-
- @Test
- public void addDeploymentArtifactToVFInstanceTest() throws Exception {
-
- ResourceReqDetails atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ArtifactInfo artifact = new ArtifactInfo(filePath, HEAT_FILE_YAML_NAME, DESCRIPTION, ARTIFACT_LABEL, ArtifactTypeEnum.SNMP_POLL.getType());
-
- CanvasElement computeElement = createServiceWithRiArtifact(atomicResourceMetaData, serviceMetadata, artifact);
- checkArtifactIfAdded(1, HEAT_FILE_YAML_NAME);
- checkInService(serviceMetadata);
- clickOncanvasElement(computeElement);
- CompositionPage.showDeploymentArtifactTab();
- checkArtifactIfAdded(1, HEAT_FILE_YAML_NAME);
- }
-
- @Test
- public void deleteDeploymentArtifactFromVFInstanceTest() throws Exception {
-
- ResourceReqDetails atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ArtifactInfo artifact = new ArtifactInfo(filePath, HEAT_FILE_YAML_NAME, DESCRIPTION, ARTIFACT_LABEL, ArtifactTypeEnum.SNMP_POLL.getType());
-
- createServiceWithRiArtifact(atomicResourceMetaData, serviceMetadata, artifact);
- checkArtifactIfAdded(1, HEAT_FILE_YAML_NAME);
- List<WebElement> actualArtifactList = GeneralUIUtils.getWebElementsListBy(By.className(GET_ARTIFACT_LIST_BY_CLASS_NAME));
- deleteAndVerifyArtifact(actualArtifactList);
-
- }
-
- @Test
- public void deleteDeploymentArtifactFromVFInstanceNextVersionTest() throws Exception {
-
-// if(true){
-// throw new SkipException("Open bug 342260");
-// }
-
- ResourceReqDetails atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ArtifactInfo artifact = new ArtifactInfo(filePath, HEAT_FILE_YAML_NAME, DESCRIPTION, ARTIFACT_LABEL, ArtifactTypeEnum.SNMP_POLL.getType());
-
- CanvasElement computeElement = createServiceWithRiArtifact(atomicResourceMetaData, serviceMetadata, artifact);
- checkArtifactIfAdded(1, HEAT_FILE_YAML_NAME);
- checkInService(serviceMetadata);
- ResourceGeneralPage.clickCheckoutButton();
- clickOncanvasElement(computeElement);
- CompositionPage.showDeploymentArtifactTab();
- List<WebElement> actualArtifactList = GeneralUIUtils.getWebElementsListBy(By.className(GET_ARTIFACT_LIST_BY_CLASS_NAME));
- deleteAndVerifyArtifact(actualArtifactList);
-// change container version
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.GeneralElementsEnum.VERSION_HEADER.getValue());
- GeneralPageElements.selectVersion("V0.1");
- clickOncanvasElement(computeElement);
- CompositionPage.showDeploymentArtifactTab();
- checkArtifactIfAdded(1, HEAT_FILE_YAML_NAME);
-
- }
-
- // service version V0.1 default artifact, service version V0.2 updated artifact
- @Test
- public void updateDeploymentArtifactOnVFInstanceNextVersionTest() throws Exception {
-
-// if(true){
-// throw new SkipException("Open bug 322930");
-// }
-
- ResourceReqDetails atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ArtifactInfo artifact = new ArtifactInfo(filePath, HEAT_FILE_YAML_NAME, DESCRIPTION, ARTIFACT_LABEL, ArtifactTypeEnum.SNMP_POLL.getType());
- ArtifactInfo artifactUpdate = new ArtifactInfo(filePath, HEAT_FILE_YAML_UPDATE_NAME, DESCRIPTION, ARTIFACT_LABEL_UPDATE, ArtifactTypeEnum.DCAE_INVENTORY_DOC.getType());
-
- CanvasElement computeElement = createServiceWithRiArtifact(atomicResourceMetaData, serviceMetadata, artifact);
- checkArtifactIfAdded(1, HEAT_FILE_YAML_NAME);
- checkInService(serviceMetadata);
- ResourceGeneralPage.clickCheckoutButton();
- clickOncanvasElement(computeElement);
- CompositionPage.showDeploymentArtifactTab();
- List<WebElement> actualArtifactList = GeneralUIUtils.getWebElementsListBy(By.className(GET_ARTIFACT_LIST_BY_CLASS_NAME));
- deleteAndVerifyArtifact(actualArtifactList);
-// upload new artifact
- addDeploymentArtifact(artifactUpdate, CanvasManager.getCanvasManager(), computeElement);
- checkArtifactIfAdded(1, HEAT_FILE_YAML_UPDATE_NAME);
-// change container version
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.GeneralElementsEnum.VERSION_HEADER.getValue());
- GeneralPageElements.selectVersion("V0.1");
- clickOncanvasElement(computeElement);
- CompositionPage.showDeploymentArtifactTab();
- checkArtifactIfAdded(1, HEAT_FILE_YAML_NAME);
-
- }
-
- public void clickOncanvasElement(CanvasElement computeElement) {
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
- canvasManager.clickOnCanvaElement(computeElement);
- }
-
- public void checkInService(ServiceReqDetails serviceMetadata) throws Exception {
- ResourceGeneralPage.clickCheckinButton(serviceMetadata.getName());
- GeneralUIUtils.findComponentAndClick(serviceMetadata.getName());
- DeploymentArtifactPage.getLeftMenu().moveToCompositionScreen();
- }
-
- public static void deleteAndVerifyArtifact(List<WebElement> actualArtifactList) {
- if (actualArtifactList.size() > 0) {
- GeneralUIUtils.hoverOnAreaByTestId(DataTestIdEnum.DeploymentArtifactCompositionRightMenu.ARTIFACT_ITEM.getValue() + ARTIFACT_LABEL);
- SetupCDTest.getExtendTest().log(Status.INFO, "Going to delete " + HEAT_FILE_YAML_NAME + " artifact" + " and check if deleted");
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.DeploymentArtifactCompositionRightMenu.DELETE.getValue() + ARTIFACT_LABEL);
- GeneralPageElements.clickOKButton();
- assertTrue("Artifact does not deleted", !GeneralUIUtils.waitForElementInVisibilityByTestId(By.className(GET_ARTIFACT_LIST_BY_CLASS_NAME)));
- }
- }
-
-
- public void checkArtifactIfAdded(Integer expectedNumOfARtifacts, String expectedArtifactName) {
-
- List<WebElement> actualArtifactList;
- actualArtifactList = GeneralUIUtils.getWebElementsListBy(By.className(GET_ARTIFACT_LIST_BY_CLASS_NAME));
- assertTrue("Expected artifact count is: " + expectedNumOfARtifacts + ", but was " + actualArtifactList.size(), expectedNumOfARtifacts == actualArtifactList.size());
-
- if (expectedNumOfARtifacts != 0) {
- for (WebElement actualArtifactFileName : CompositionPage.getAllAddedArtifacts()) {
- assertTrue("Artifact name does not match, expected " + expectedArtifactName + ", but was " + actualArtifactFileName.getText(), expectedArtifactName.equals(actualArtifactFileName.getText()));
- }
- }
-
- }
-
-
- public CanvasElement createServiceWithRiArtifact(ResourceReqDetails atomicResourceMetaData, ServiceReqDetails serviceMetadata, ArtifactInfo artifact) throws Exception, AWTException {
- ResourceUIUtils.createVF(atomicResourceMetaData, getUser());
- //TODO Andrey should click on certify button
- ResourceGeneralPage.clickCertifyButton(atomicResourceMetaData.getName());
-
- ServiceUIUtils.createService(serviceMetadata);
-
- DeploymentArtifactPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
- CompositionPage.searchForElement(atomicResourceMetaData.getName());
- CanvasElement computeElement = canvasManager.createElementOnCanvas(atomicResourceMetaData.getName());
- addDeploymentArtifact(artifact, canvasManager, computeElement);
-
- return computeElement;
- }
-
-
- public void addDeploymentArtifact(ArtifactInfo artifact, CanvasManager canvasManager, CanvasElement computeElement) throws Exception {
- canvasManager.clickOnCanvaElement(computeElement);
- CompositionPage.showDeploymentArtifactTab();
- CompositionPage.clickAddArtifactButton();
- ArtifactUIUtils.fillAndAddNewArtifactParameters(artifact, CompositionPage.artifactPopup());
- }
-
- @Test
- public void isDisabledAndReadOnlyInCheckin() throws Exception {
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
- GeneralPageElements.clickCheckinButton(serviceMetadata.getName());
- GeneralUIUtils.findComponentAndClick(serviceMetadata.getName());
-
- ServiceMetadataEnum[] fieldsForCheck = {ServiceMetadataEnum.SERVICE_NAME,
- ServiceMetadataEnum.CONTACT_ID,
- ServiceMetadataEnum.DESCRIPTION,
- ServiceMetadataEnum.PROJECT_CODE,
- ServiceMetadataEnum.TAGS};
- for (ServiceMetadataEnum field : fieldsForCheck) {
- assertTrue(GeneralUIUtils.isElementReadOnly(field.getValue()));
- }
-
- assertTrue(GeneralUIUtils.isElementDisabled(ServiceMetadataEnum.CATEGORY.getValue()));
- assertTrue(GeneralUIUtils.isElementDisabled(DataTestIdEnum.LifeCyleChangeButtons.CREATE.getValue()));
- }
-
- // future removed from ui
- @Test(enabled = true)
- public void inputsTest() throws Exception {
- String fileName = "service_input_test_VF2.csar";
-
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName, getUser());
- GeneralPageElements.clickCheckinButton(resourceMetaData.getName());
-
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
-
- String selectedInstanceName = addResourceToServiceInCanvas(resourceMetaData);
-
- GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
- DeploymentArtifactPage.getLeftMenu().moveToInputsScreen();
-
- InputsPage.addInputToService(selectedInstanceName, "volume_id");
- InputsPage.deleteServiceInput(selectedInstanceName, "volume_id");
-
- // Trying to find deleted service input
- try {
- InputsPage.getServiceInput(selectedInstanceName, "volume_id");
- assert (false);
- } catch (TestException e) {
- }
- }
-
- @Test()
- public void deploymentViewServiceTest() throws Exception {
-
- User user = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- String fileName2 = "vSeGWNew.csar";
-
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName2, getUser());
- Resource resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resourceMetaData.getName(), "0.1");
-
- // update group property max_vf_module_instances of VF Module to 100
- List<GroupDefinition> groups = resource.getGroups();
- for (GroupDefinition group : groups) {
- if (group.getType().equals("org.openecomp.groups.VfModule")) {
- for (PropertyDataDefinition property : group.getProperties()) {
- if (property.getName().equals("max_vf_module_instances")) {
-// property.setValue("100");
-// List<PropertyDataDefinition> propertyList = new ArrayList<>();
-// propertyList.add(property);
-// todo pass to method correct object instaed of value for custom json
- AtomicOperationUtils.updateGroupPropertyOnResource("100", resource, group.getUniqueId(), user, true);
- break;
- }
- }
- }
- }
-
- ResourceGeneralPage.clickCheckinButton(resourceMetaData.getName());
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
- addResourceToServiceInCanvas(resourceMetaData);
- GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
- DeploymentArtifactPage.getLeftMenu().moveToDeploymentViewScreen();
- serviceMetadata.setVersion("0.1");
- List<WebElement> instanceRowsFromTable = GeneralUIUtils.getElementsByCSS("div[data-tests-id^='hierarchy-instance'] span[class^='expand-collapse-title-text']");
- for (WebElement instanceRow : instanceRowsFromTable) {
- String instanceRowText = instanceRow.getText();
- List<WebElement> instanceModulesList = DeploymentPage.getInstanceModulesList(instanceRowText);
- for (WebElement instanceModule : instanceModulesList) {
- String instanceModuleText = instanceModule.getText();
- ResourceUIUtils.clickOnElementByText(instanceModuleText, "instance");
- ServiceVerificator.verifyDeploymentPageSubElements(instanceModuleText.split("\\.\\.")[2], new DeploymentViewVerificator(filePath + fileName2));
- ServiceVerificator.verifyDisabledServiceProperties();
- SetupCDTest.getExtendTest().log(Status.INFO, "Sent email to Edith Ronen, waiting for answer");
- String isBaseValue = ServiceVerificator.getVFModulePropertyValue(serviceMetadata, "isBase", instanceModuleText);
- if (isBaseValue.equals("false")) {
- ServiceVerificator.verifyEnabledServiceProperties();
- }
- ResourceUIUtils.clickOnElementByText(instanceModuleText, "instance");
- }
- }
- }
-
- @Test
- public void vfModuleCustomizationUUIDServiceTest() throws Exception {
- String fileName2 = "vSeGW.csar";
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName2, getUser());
- ResourceGeneralPage.clickCheckinButton(resourceMetaData.getName());
-
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
-
- addResourceToServiceInCanvas(resourceMetaData);
-
- serviceMetadata.setVersion("0.1");
- ServiceVerificator.verifyVFModuleCustomizationUUID(serviceMetadata);
- }
-
- @Test
- public void checkoutCertifyRemainSameCustomizationUUIDServiceTest() throws Exception {
- String fileName2 = "vSeGW.csar";
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName2, getUser());
- //TODO Andrey should click on certify button
- ResourceGeneralPage.clickCertifyButton(resourceMetaData.getName());
-
- /*reloginWithNewRole(UserRoleEnum.TESTER);
- GeneralUIUtils.findComponentAndClick(resourceMetaData.getName());
- TesterOperationPage.certifyComponent(resourceMetaData.getName());
-
- reloginWithNewRole(UserRoleEnum.DESIGNER);*/
-
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createService(serviceMetadata);
-
- addResourceToServiceInCanvas(resourceMetaData);
-
- serviceMetadata.setVersion("0.1");
- ServiceVerificator.verifyVFModuleCustomizationUUID(serviceMetadata);
- List<String> allVFModuleCustomizationUUIDs = ServiceVerificator.getAllVFModuleCustomizationUUIDs(serviceMetadata);
-
- ResourceGeneralPage.clickCheckinButton(serviceMetadata.getName());
- GeneralUIUtils.findComponentAndClick(serviceMetadata.getName());
- GeneralPageElements.clickCheckoutButton();
-
- serviceMetadata.setVersion("0.2");
- assertTrue(ServiceVerificator.isEqualCustomizationUUIDsAfterChanges(allVFModuleCustomizationUUIDs, ServiceVerificator.getAllVFModuleCustomizationUUIDs(serviceMetadata)));
-
- ResourceGeneralPage.clickSubmitForTestingButton(serviceMetadata.getName());
-
- reloginWithNewRole(UserRoleEnum.TESTER);
- GeneralUIUtils.findComponentAndClick(serviceMetadata.getName());
- TesterOperationPage.certifyComponent(serviceMetadata.getName());
-
- reloginWithNewRole(UserRoleEnum.DESIGNER);
- GeneralUIUtils.findComponentAndClick(serviceMetadata.getName());
- ResourceGeneralPage.clickCheckoutButton();
-
- serviceMetadata.setVersion("1.1");
- serviceMetadata.setUniqueId(null);
- assertTrue(ServiceVerificator.isEqualCustomizationUUIDsAfterChanges(allVFModuleCustomizationUUIDs, ServiceVerificator.getAllVFModuleCustomizationUUIDs(serviceMetadata)));
- }
-
- @Test
- public void createServiceWithALaCarteInstanTypeAndCheckItsTosca() throws Exception {
- getExtendTest().log(Status.INFO, "Starting the test: createServiceWithALaCarteInstanTypeAndCheckItsTosca.");
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createServiceWithDefaultTagAndUserId(serviceMetadata, getUser());
- getExtendTest().log(Status.INFO, "Done creating service over the UI, "
- + "about to move into Tosca Artifacts section.");
- ResourceGeneralPage.moveToToscaArtifactsSectionAndDownloadTosca();
- getExtendTest().log(Status.INFO, "Downloaded Template YAML File.");
- AssertJUnit.assertTrue(ServiceGeneralPage.parseToscaFileIntoServiceAndValidateProperties(serviceMetadata));
- getExtendTest().log(Status.INFO, "Test is successful.");
- }
-
- @Test
- public void createServiceWithALaCarteInstanTypeAndVerifyChosenValue() throws Exception {
- getExtendTest().log(Status.INFO, "Starting the test: createServiceWithALaCarteInstanTypeAndVerifyChosenValue.");
- ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
- ServiceUIUtils.createServiceWithDefaultTagAndUserId(serviceMetadata, getUser());
- getExtendTest().log(Status.INFO, "Done creating service over the UI, "
- + "about to move into Home page.");
- HomePage.navigateToHomePage();
- GeneralUIUtils.findComponentAndClick(serviceMetadata.getName());
- assertTrue(serviceMetadata.getInstantiationType().equals(ServiceGeneralPage.getInstantiationTypeChosenValue()));
- }
-
-
- public static synchronized String addResourceToServiceInCanvas(ResourceReqDetails resourceMetaData) throws Exception {
- DeploymentArtifactPage.getLeftMenu().moveToCompositionScreen();
- if (computeElement == null) {
- computeElement = createCanvasElement(resourceMetaData);
- }
- CanvasManager.getCanvasManager().clickOnCanvaElement(computeElement);
- return CompositionPage.getSelectedInstanceName();
- }
-
- private static synchronized CanvasElement createCanvasElement(ResourceReqDetails resourceMetaData) throws Exception {
- CompositionPage.searchForElement(resourceMetaData.getName());
- return CanvasManager.getCanvasManager().createElementOnCanvas(resourceMetaData.getName());
- }
-
- public static void changeDeleteAndValidateVersionOnGeneralPage(String previousVersion, String currentVersion, String serviceName) throws Exception {
- GeneralPageElements.selectVersion("V" + previousVersion);
- ServiceVerificator.verifyVersionUI(previousVersion);
- GeneralUIUtils.clickJSOnElementByText("latest version");
- ServiceVerificator.verifyVersionUI(currentVersion);
- GeneralPageElements.clickTrashButtonAndConfirm();
- GeneralUIUtils.findComponentAndClick(serviceName);
- ServiceVerificator.verifyVersionUI(previousVersion);
- }
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ToscaValidationTest.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ToscaValidationTest.java
deleted file mode 100644
index 9eb0a49a64..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ToscaValidationTest.java
+++ /dev/null
@@ -1,945 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.sanity;
-
-import com.aventstack.extentreports.Status;
-import fj.data.Either;
-import org.onap.sdc.tosca.parser.api.ISdcCsarHelper;
-import org.onap.sdc.tosca.parser.impl.SdcToscaParserFactory;
-import org.onap.sdc.toscaparser.api.Group;
-import org.onap.sdc.toscaparser.api.NodeTemplate;
-import org.onap.sdc.toscaparser.api.elements.Metadata;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-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.ComponentInstanceInput;
-import org.openecomp.sdc.be.model.GroupDefinition;
-import org.openecomp.sdc.be.model.GroupInstance;
-import org.openecomp.sdc.be.model.PropertyDefinition;
-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.ci.tests.dataProvider.OnbordingDataProviders;
-import org.openecomp.sdc.ci.tests.datatypes.GroupHeatMetaDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.HeatMetaFirstLevelDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.TypeHeatMetaDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaDefinition;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaGroupPropertyDefinition;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaGroupsTopologyTemplateDefinition;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaInputsTopologyTemplateDefinition;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaServiceGroupsMetadataDefinition;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaTopologyTemplateDefinition;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.VfModuleDefinition;
-import org.openecomp.sdc.ci.tests.tosca.model.ToscaMetadataFieldsPresentationEnum;
-import org.openecomp.sdc.ci.tests.utilities.DownloadManager;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utils.CsarParserUtils;
-import org.openecomp.sdc.ci.tests.utils.ToscaParserUtils;
-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.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.PropertyRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.openecomp.sdc.ci.tests.verificator.ToscaValidation;
-import org.testng.annotations.DataProvider;
-import org.testng.annotations.Test;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
-
-import static org.testng.Assert.assertFalse;
-
-
-public class ToscaValidationTest extends SetupCDTest {
-
- private static final String GENERIC_VF = "Generic_VF";
- private static final String GENERIC_PNF = "Generic_PNF";
- private static final String GENERIC_CR = "Generic_CR";
-
- protected SdcToscaParserFactory factory = SdcToscaParserFactory.getInstance();
- User user = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
-
- @Test(dataProviderClass = OnbordingDataProviders.class, dataProvider = "VNF_List")
- public void toscaFileValidator(String filePath, String vnfFile) throws Exception {
-//--------------------------GENERAL--------------------------------
-/*// for debugging only
- setLog("Test");
- File amdocsCsarFileName = (new File("C:\\Users\\al714h\\Downloads\\d218be69637647b0b693647d84a8c03f.csar"));
- toscaMainAmdocsDefinition = ToscaParserUtils.parseToscaMainYamlToJavaObjectByCsarLocation(amdocsCsarFileName);
- toscaMainVfDefinition = ToscaParserUtils.parseToscaMainYamlToJavaObjectByCsarLocation(new File("C:\\Users\\al714h\\Downloads\\resource-Civfonboarded2016073VmxBv301072E2eE60f5c15-csar.csar"));
- */
- // vnfFile = "vRouter for DHV Test_Version_4.zip";
- setLog(vnfFile);
- List<Boolean> status = new ArrayList<>();
- ISdcCsarHelper fdntCsarHelper;
- File filesFolder = new File(SetupCDTest.getWindowTest().getDownloadDirectory());
-//--------------------------AMDOCS--------------------------------
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, user);//getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- resourceReqDetails = createCustomizedVsp(resourceReqDetails, filePath, vnfFile);
- ToscaDefinition toscaMainAmdocsDefinition = downloadAndGetToscaMainYamlObjectUI(resourceReqDetails, filesFolder);
-//------adding generic inputs to expected object
- toscaMainAmdocsDefinition = addGenericPropertiesToToscaDefinitionObject(toscaMainAmdocsDefinition, GENERIC_VF);
-// copy object
- ToscaDefinition toscaExpectedMainServiceDefinition = new ToscaDefinition(toscaMainAmdocsDefinition);
-// create list of modules from HEAT.meta file
- File latestFileFromDir = FileHandling.getLastModifiedFileNameFromDir();
- List<TypeHeatMetaDefinition> listTypeHeatMetaDefinition = CsarParserUtils.getListTypeHeatMetaDefinition(latestFileFromDir);
-//TODO VfModuleVerificator.verifyGroupMetadata();
-//TODO--------------------------AMDOCS DOWNLOAD VIA APIS--------------------------------
-//--------------------------VF--------------------------------
-// create VF base on VNF imported from previous step - have, resourceReqDetails object include part of resource metadata
- Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- ToscaDefinition toscaMainVfDefinition = downloadAndGetToscaMainYamlObjectApi(resource, filesFolder);
-//--------------------------SERVICE--------------------------------
- ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();//getServiceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
- Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
- ComponentInstance componentInstanceDefinition = addComponentInstanceToComponentContainer.left().value();
-//--------------------------getProperties set values and declare--------------------
- Component componentObject = AtomicOperationUtils.getComponentObject(service, UserRoleEnum.DESIGNER);
- Map<String, List<ComponentInstanceInput>> componentInstancesInputs = componentObject.getComponentInstancesInputs();
- setValuesToPropertiesList(componentInstancesInputs, toscaExpectedMainServiceDefinition);
- PropertyRestUtils.declareProporties(componentObject, componentInstancesInputs, user);
-
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- Map<String, VfModuleDefinition> expectedVfModulesDefinitionObject = createExpectedVfModuleDefinitionObject(resource, service, listTypeHeatMetaDefinition);
-
- File serviceCsarFileName = new File(File.separator + "ServiceCsar_" + ElementFactory.generateUUIDforSufix() + ".csar");
- OnboardingUtillViaApis.downloadToscaCsarToDirectory(service, new File(filesFolder.getPath() + serviceCsarFileName));
- ToscaDefinition toscaMainServiceDefinition = ToscaParserUtils.parseToscaMainYamlToJavaObjectByCsarLocation(new File(filesFolder.getPath() + serviceCsarFileName));
-//--------------------------initialization of Tosca Parser--------------------------------
- fdntCsarHelper = initSdcCsarHelper(serviceCsarFileName, filesFolder);
-////---------------------------TESTS--------------------------------------------------
- validateVfModuleJsonFile(expectedVfModulesDefinitionObject, service, componentInstanceDefinition.getUniqueId(), vnfFile, status);
- validateVfMetadata(toscaMainAmdocsDefinition, toscaMainVfDefinition, resourceReqDetails, resource, vnfFile, status);
- validateResourceNodeTemplateMetadata(toscaMainVfDefinition, resource, vnfFile, status);
- validateServiceMetadata(toscaMainServiceDefinition, serviceReqDetails, service, vnfFile, status);
- validateServiceNodeTemplateMetadata(toscaMainServiceDefinition, componentInstanceDefinition, resourceReqDetails, resource, vnfFile, status);
- validateServiceMetadataUsingParser(fdntCsarHelper, serviceReqDetails, service, vnfFile, status);
- validateServiceNodeTemplateMetadataUsingParser(fdntCsarHelper, resourceReqDetails, resource, componentInstanceDefinition, vnfFile, status);
- validateResourceInputs(toscaMainAmdocsDefinition, toscaMainVfDefinition, vnfFile, status);
- validateServiceInputs(toscaExpectedMainServiceDefinition, toscaMainServiceDefinition, vnfFile, status);
- validateServiceInputsUsingParser(fdntCsarHelper, toscaExpectedMainServiceDefinition, vnfFile, status);
-
- Map<String, ToscaGroupsTopologyTemplateDefinition> expectedToscaServiceGroupsDefinitionObject = createExpectedToscaServiceGroupsDefinitionObject(resource, service, listTypeHeatMetaDefinition);
- validateServiceModuleMetadata(expectedToscaServiceGroupsDefinitionObject, toscaMainServiceDefinition, vnfFile, status);
- validateServiceModuleProperty(expectedToscaServiceGroupsDefinitionObject, toscaMainServiceDefinition, vnfFile, status);
- validateServiceModuleMetadataUsingParser(fdntCsarHelper, expectedToscaServiceGroupsDefinitionObject, vnfFile, status);
- validateServiceModulePropertyUsingParser(fdntCsarHelper, expectedToscaServiceGroupsDefinitionObject, vnfFile, status);
-
- if (status.contains(false)) {
- SetupCDTest.getExtendTest().log(Status.FAIL, "Summary: tosca validation test failed with zip file " + vnfFile);
- assertFalse(true);
- }
- }
-
-
- @DataProvider(name = "toscaValidationTest", parallel = true)
- public static Object[][] dataProviderForSpecificResourceType() {
- return new Object[][]{
- {"networkModel", ResourceTypeEnum.PNF, GENERIC_PNF},
- {"collectorResourceModel", ResourceTypeEnum.CR, GENERIC_CR},
- };
- }
-
- @Test(dataProvider = "toscaValidationTest")
- public void validateSpecificResourceType(String type, ResourceTypeEnum resourceType, String genericPropName) throws Exception {
-//--------------------------GENERAL--------------------------------
- String vnfFile = type;
- setLog(vnfFile);
- List<Boolean> status = new ArrayList<>();
- ISdcCsarHelper fdntCsarHelper;
- ToscaDefinition expectedToscaMainDefinition = new ToscaDefinition();
- File filesFolder = new File(SetupCDTest.getWindowTest().getDownloadDirectory());
-// filesFolder = new File(SetupCDTest.getWindowTest().getDownloadDirectory());
-
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResourceByType(resourceType, user);
- expectedToscaMainDefinition = addGenericPropertiesToToscaDefinitionObject(expectedToscaMainDefinition, genericPropName);
- ToscaDefinition toscaExpectedMainServiceDefinition = new ToscaDefinition(expectedToscaMainDefinition);
-//--------------------------VF--------------------------------
- Resource resource = AtomicOperationUtils.createResourceByResourceDetails(resourceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- ToscaDefinition toscaMainVfDefinition = downloadAndGetToscaMainYamlObjectApi(resource, filesFolder);
-
-//--------------------------SERVICE--------------------------------
- ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();
- Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
-
- Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
- ComponentInstance componentInstanceDefinition = addComponentInstanceToComponentContainer.left().value();
-
-//--------------------------getProperties set values and declare--------------------
-
- Component componentObject = AtomicOperationUtils.getComponentObject(service, UserRoleEnum.DESIGNER);
- Map<String, List<ComponentInstanceInput>> componentInstancesInputs = componentObject.getComponentInstancesInputs();
- setValuesToPropertiesList(componentInstancesInputs, toscaExpectedMainServiceDefinition);
- PropertyRestUtils.declareProporties(componentObject, componentInstancesInputs, user);
-
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- File ServiceCsarFileName = new File(File.separator + "ServiceCsar_" + ElementFactory.generateUUIDforSufix() + ".csar");
- OnboardingUtillViaApis.downloadToscaCsarToDirectory(service, new File(filesFolder.getPath() + ServiceCsarFileName));
- ToscaDefinition toscaMainServiceDefinition = ToscaParserUtils.parseToscaMainYamlToJavaObjectByCsarLocation(new File(filesFolder.getPath() + ServiceCsarFileName));
-
-//--------------------------initialization of Tosca Parser--------------------------------
-
- fdntCsarHelper = initSdcCsarHelper(ServiceCsarFileName, filesFolder);
-
-
-//---------------------------TESTS--------------------------------------------------
- validateVfMetadata(expectedToscaMainDefinition, toscaMainVfDefinition, resourceReqDetails, resource, vnfFile, status);
- validateResourceNodeTemplateMetadata(toscaMainVfDefinition, resource, vnfFile, status);
- validateServiceMetadata(toscaMainServiceDefinition, serviceReqDetails, service, vnfFile, status);
- validateServiceNodeTemplateMetadata(toscaMainServiceDefinition, componentInstanceDefinition, resourceReqDetails, resource, vnfFile, status);
- validateServiceMetadataUsingParser(fdntCsarHelper, serviceReqDetails, service, vnfFile, status);
- validateServiceNodeTemplateMetadataUsingParser(fdntCsarHelper, resourceReqDetails, resource, componentInstanceDefinition, vnfFile, status);
- validateResourceInputs(expectedToscaMainDefinition, toscaMainVfDefinition, vnfFile, status);
- validateServiceInputs(toscaExpectedMainServiceDefinition, toscaMainServiceDefinition, vnfFile, status);
- validateServiceInputsUsingParser(fdntCsarHelper, toscaExpectedMainServiceDefinition, vnfFile, status);
-
- if (status.contains(false)) {
- SetupCDTest.getExtendTest().log(Status.FAIL, "Summary: tosca validation test failed with zip file " + vnfFile);
- assertFalse(true);
- }
- }
-
- /**
- * The method set values to toscaDefinition object service level only, to resource level should put instead of setDefault --> setValue
- * inputs.get(componentInstanceInput.getName()).setValue(randomString);
- *
- * @param componentInstancesInputs list of componentInstancesInputs
- * @param toscaDefinition
- */
- private void setValuesToPropertiesList(Map<String, List<ComponentInstanceInput>> componentInstancesInputs, ToscaDefinition toscaDefinition) {
- for (Map.Entry<String, List<ComponentInstanceInput>> entry : componentInstancesInputs.entrySet()) {
- List<ComponentInstanceInput> value = entry.getValue();
- String[] names = entry.getKey().split("\\.");
- String expectedServiceInputPrefix = null;
- Map<String, ToscaInputsTopologyTemplateDefinition> inputs = toscaDefinition.getTopology_template().getInputs();
- if (names.length > 0) {
- expectedServiceInputPrefix = names[names.length - 1] + "_";
- }
- for (ComponentInstanceInput componentInstanceInput : value) {
-
-
- String type = componentInstanceInput.getType();
- List<String> myList = new ArrayList<>();
- myList.add("cbf8049e-69e8-48c3-a06f-255634391403");
- switch (type) {
- case "string":
- String randomString = getRandomString();
- componentInstanceInput.setValue(randomString);
- inputs.get(componentInstanceInput.getName()).setDefault(randomString);
-
- break;
- case "integer":
- int randomInteger = getRandomInteger();
- componentInstanceInput.setValue(Integer.toString(randomInteger));
- inputs.get(componentInstanceInput.getName()).setDefault(randomInteger);
- break;
- case "float":
- componentInstanceInput.setValue("5.5");
- inputs.get(componentInstanceInput.getName()).setDefault("5.5");
-
- break;
- case "boolean":
- componentInstanceInput.setValue("true");
- inputs.get(componentInstanceInput.getName()).setDefault("true");
- break;
- case "list":
- String myListofStrings = myList.toString();
- componentInstanceInput.setValue(myListofStrings);
- inputs.get(componentInstanceInput.getName()).setDefault(myListofStrings);
- break;
- case "json":
- String myJson = "{\"firstParam\":\"my First Param Value\",\"secondParam\":\"my Second Param Value\",\"numberParam\":666}";
- componentInstanceInput.setValue(myJson);
- inputs.get(componentInstanceInput.getName()).setDefault(myJson);
- break;
- case "comma_delimited_list":
- String commaDelimitedList = "[\"one\", \"two\"]";
- componentInstanceInput.setValue(commaDelimitedList);
- inputs.get(componentInstanceInput.getName()).setDefault(commaDelimitedList);
- break;
- default:
- break;
- }
-
- String expectedServiceInputName = expectedServiceInputPrefix + componentInstanceInput.getName();
- ToscaInputsTopologyTemplateDefinition oldInput = inputs.get(componentInstanceInput.getName());
- inputs.put(expectedServiceInputName, oldInput);
- inputs.remove(componentInstanceInput.getName());
-
- }
-
- }
- }
-
- protected String getRandomString() {
- final int LengthOfRandomString = 18;
- String SALTCHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
- StringBuilder salt = new StringBuilder();
- Random rnd = new Random();
- while (salt.length() < LengthOfRandomString) {
- int index = (int) (rnd.nextFloat() * SALTCHARS.length());
- salt.append(SALTCHARS.charAt(index));
- }
- String strValue = salt.toString();
- return strValue;
-
- }
-
- protected int getRandomInteger() {
- final int low = 10;
- final int high = 100;
- Random r = new Random();
- return r.nextInt(high - low) + low;
- }
-
-
- //--------------------------Metadata verification--------------------------------
-//--------------------------Resource--------------------------------
-
- public List<Boolean> validateVfMetadata(ToscaDefinition toscaMainAmdocsDefinition, ToscaDefinition toscaMainVfDefinition, ResourceReqDetails resourceReqDetails, Resource resource, String vnfFile, List<Boolean> status) throws Exception {
- reportStartTestPrint("validateVfMetadata", vnfFile);
- //add resource metadata to expected object
- toscaMainAmdocsDefinition = addAndGenerateResourceMetadataToExpectedObject(toscaMainAmdocsDefinition, resourceReqDetails, resource);
- Either<Boolean, Map<String, Object>> resourceToscaMetadataValidator = ToscaValidation.resourceToscaMetadataValidator(toscaMainAmdocsDefinition, toscaMainVfDefinition);
- if (resourceToscaMetadataValidator.isRight()) {
- status.add(false);
- }
- return status;
- }
-
- public List<Boolean> validateResourceNodeTemplateMetadata(ToscaDefinition toscaMainVfDefinition, Resource resource, String vnfFile, List<Boolean> status) throws Exception {
- reportStartTestPrint("validateResourceNodeTemplateMetadata", vnfFile);
- Map<String, Map<String, String>> generateReosurceNodeTemplateMetadataToExpectedObject = generateResourceNodeTemplateMetadataToExpectedObject(resource);
- Boolean resourceToscaMetadataValidator = ToscaValidation.resourceToscaNodeTemplateMetadataValidator(generateReosurceNodeTemplateMetadataToExpectedObject, toscaMainVfDefinition);
- if (!resourceToscaMetadataValidator) {
- status.add(false);
- }
- return status;
- }
-
- //--------------------------Service--------------------------------
- public List<Boolean> validateServiceMetadata(ToscaDefinition toscaMainServiceDefinition, ServiceReqDetails serviceReqDetails, Service service, String vnfFile, List<Boolean> status) throws Exception {
- reportStartTestPrint("validateServiceMetadata", vnfFile);
- Map<String, String> generateServiceMetadataToExpectedObject = generateServiceMetadataToExpectedObject(serviceReqDetails, service);
- Either<Boolean, Map<String, Object>> serviceToscaMetadataValidator = ToscaValidation.serviceToscaMetadataValidator(generateServiceMetadataToExpectedObject, toscaMainServiceDefinition);
- if (serviceToscaMetadataValidator.isRight()) {
- status.add(false);
- }
- return status;
- }
-
-
- public List<Boolean> validateServiceNodeTemplateMetadata(ToscaDefinition toscaMainServiceDefinition, ComponentInstance componentInstanceDefinition, ResourceReqDetails resourceReqDetails, Resource resource, String vnfFile, List<Boolean> status) throws Exception {
- reportStartTestPrint("validateServiceNodeTemplateMetadata", vnfFile);
- Map<String, String> generateServiceNodeTemplateMetadataToExpectedObject = generateServiceNodeTemplateMetadataToExpectedObject(resourceReqDetails, resource, componentInstanceDefinition);
- Either<Boolean, Map<String, Object>> serviceToscaMetadataValidator = ToscaValidation.componentToscaNodeTemplateMetadataValidator(generateServiceNodeTemplateMetadataToExpectedObject, toscaMainServiceDefinition, componentInstanceDefinition.getName(), ComponentTypeEnum.SERVICE, componentInstanceDefinition.getName());
- if (serviceToscaMetadataValidator.isRight()) {
- status.add(false);
- }
- return status;
- }
-
- private List<Boolean> validateVfModuleJsonFile(Map<String, VfModuleDefinition> expectedVfModulesDefinitionObject, Service service, String resInstUniqueId, String vnfFile, List<Boolean> status) throws Exception {
- reportStartTestPrint("validateVfModuleJsonFile", vnfFile);
- String artifactUniqueId = null;
- for (ComponentInstance inst : service.getComponentInstances()) {
- if (inst.getUniqueId().equals(resInstUniqueId)) {
- artifactUniqueId = inst.getDeploymentArtifacts().get("vfModulesMetadata").getUniqueId();
- break;
- }
- }
- if (artifactUniqueId == null) {
- SetupCDTest.getExtendTest().log(Status.ERROR, "validateVfModuleJsonFile verification failed, artifact vfModulesMetadata not found");
- status.add(false);
- return status;
- }
- RestResponse restResponse = ArtifactRestUtils.downloadResourceInstanceArtifact(service.getUniqueId(), resInstUniqueId, user, artifactUniqueId);
- String artifactPayload = ArtifactRestUtils.getDecodedArtifactPayloadFromResponse(restResponse);
- Map<String, VfModuleDefinition> actualVfModulesDefinitionObject = ResponseParser.convertVfModuleJsonResponseToJavaObject(artifactPayload);
- Either<Boolean, Map<String, Object>> vfModuleJsonFileValidator = ToscaValidation.vfModuleJsonFileValidator(expectedVfModulesDefinitionObject, actualVfModulesDefinitionObject);
- if (vfModuleJsonFileValidator.isRight()) {
- status.add(false);
- }
- return status;
- }
-
- //--------------------------Service verification against Pavel Parser--------------------------------
- public List<Boolean> validateServiceMetadataUsingParser(ISdcCsarHelper fdntCsarHelper, ServiceReqDetails serviceReqDetails, Service service, String vnfFile, List<Boolean> status) throws Exception {
- if (fdntCsarHelper == null) {
- reportSkipTestPrint("validateServiceMetadataUsingParser", status);
- } else {
- reportStartTestPrint("validateServiceMetadataUsingParser", vnfFile);
- Map<String, String> generateServiceMetadataToExpectedObject = generateServiceMetadataToExpectedObject(serviceReqDetails, service);
- Metadata serviceMetadata = fdntCsarHelper.getServiceMetadata();
- Either<Boolean, Map<String, Object>> serviceToscaMetadataValidatorAgainstParser = ToscaValidation.serviceToscaMetadataValidatorAgainstParser(generateServiceMetadataToExpectedObject, serviceMetadata);
- if (serviceToscaMetadataValidatorAgainstParser.isRight()) {
- status.add(false);
- }
- }
- return status;
- }
-
- public List<Boolean> validateServiceNodeTemplateMetadataUsingParser(ISdcCsarHelper fdntCsarHelper, ResourceReqDetails resourceReqDetails, Resource resource, ComponentInstance componentInstanceDefinition, String vnfFile, List<Boolean> status) throws Exception {
- if (fdntCsarHelper == null) {
- reportSkipTestPrint("validateServiceNodeTemplateMetadataUsingParser", status);
- } else {
- reportStartTestPrint("validateServiceNodeTemplateMetadataUsingParser", vnfFile);
- Map<String, String> generateServiceNodeTemplateMetadataToExpectedObject = generateServiceNodeTemplateMetadataToExpectedObject(resourceReqDetails, resource, componentInstanceDefinition);
- List<NodeTemplate> serviceNodeTemplates = fdntCsarHelper.getServiceNodeTemplates();
- Metadata serviceNodeTemplateMetadata = serviceNodeTemplates.get(0).getMetaData();
- Either<Boolean, Map<String, Object>> serviceNodeTemplateToscaMetadataValidatorAgainstParser = ToscaValidation.serviceToscaMetadataValidatorAgainstParser(generateServiceNodeTemplateMetadataToExpectedObject, serviceNodeTemplateMetadata);
- if (serviceNodeTemplateToscaMetadataValidatorAgainstParser.isRight()) {
- status.add(false);
- }
- }
- return status;
- }
-
- //--------------------------Input verification--------------------------------
-
- //--------------------------Resource--------------------------------
- public List<Boolean> validateResourceInputs(ToscaDefinition toscaMainAmdocsDefinition, ToscaDefinition toscaMainVfDefinition, String vnfFile, List<Boolean> status) throws Exception {
- reportStartTestPrint("validateResourceInputs", vnfFile);
- Map<String, ToscaInputsTopologyTemplateDefinition> expectedInputsMap = toscaMainAmdocsDefinition.getTopology_template().getInputs();
- Map<String, ToscaInputsTopologyTemplateDefinition> actualInputsMap = toscaMainVfDefinition.getTopology_template().getInputs();
- Either<Boolean, Map<String, Object>> toscaInputsValidator = ToscaValidation.toscaInputsValidator(expectedInputsMap, actualInputsMap);
- if (toscaInputsValidator.isRight()) {
- status.add(false);
- }
- return status;
- }
-
- //--------------------------Service--------------------------------
-
- public List<Boolean> validateServiceInputs(ToscaDefinition toscaExpectedMainServiceDefinition, ToscaDefinition toscaMainServiceDefinition, String vnfFile, List<Boolean> status) throws Exception {
- reportStartTestPrint("validateServiceInputs", vnfFile);
- Map<String, ToscaInputsTopologyTemplateDefinition> expectedInputsMap = toscaExpectedMainServiceDefinition.getTopology_template().getInputs();
- Map<String, ToscaInputsTopologyTemplateDefinition> actualInputsMap = toscaMainServiceDefinition.getTopology_template().getInputs();
- Either<Boolean, Map<String, Object>> toscaInputsValidator = ToscaValidation.toscaInputsValidator(expectedInputsMap, actualInputsMap);
- if (toscaInputsValidator.isRight()) {
- status.add(false);
- }
- return status;
- }
-
- public List<Boolean> validateServiceModuleMetadata(Map<String, ToscaGroupsTopologyTemplateDefinition> expectedToscaServiceGroupsDefinitionObject, ToscaDefinition toscaMainServiceDefinition, String vnfFile, List<Boolean> status) {
- reportStartTestPrint("validateServiceModuleMetadata", vnfFile);
-
- Either<Boolean, Map<String, Object>> toscaServiceModuleMetadataValidator = ToscaValidation.serviceToscaGroupMetadataValidator(expectedToscaServiceGroupsDefinitionObject, toscaMainServiceDefinition);
- if (toscaServiceModuleMetadataValidator.isRight()) {
- status.add(false);
- }
- return status;
- }
-
- public List<Boolean> validateServiceModuleProperty(Map<String, ToscaGroupsTopologyTemplateDefinition> expectedToscaServiceGroupsDefinitionObject, ToscaDefinition toscaMainServiceDefinition, String vnfFile, List<Boolean> status) {
- reportStartTestPrint("validateServiceModuleProperty", vnfFile);
-
- Either<Boolean, Map<String, Object>> toscaServiceModulePropertyValidator = ToscaValidation.serviceToscaGroupPropertyValidator(expectedToscaServiceGroupsDefinitionObject, toscaMainServiceDefinition);
- if (toscaServiceModulePropertyValidator.isRight()) {
- status.add(false);
- }
- return status;
- }
-
- //--------------------------Service verification against Pavel Parser--------------------------------
- public List<Boolean> validateServiceInputsUsingParser(ISdcCsarHelper fdntCsarHelper, ToscaDefinition toscaExpectedMainServiceDefinition, String vnfFile, List<Boolean> status) throws Exception {
- if (fdntCsarHelper == null) {
- reportSkipTestPrint("validateServiceInputsUsingParser", status);
- } else {
- reportStartTestPrint("validateServiceInputsUsingParser", vnfFile);
- Map<String, ToscaInputsTopologyTemplateDefinition> expectedInputsMap = toscaExpectedMainServiceDefinition.getTopology_template().getInputs();
- Either<Boolean, Map<String, Object>> toscaInputsValidator = ToscaValidation.toscaInputsValidatorAgainstParser(expectedInputsMap, fdntCsarHelper);
- if (toscaInputsValidator.isRight()) {
- status.add(false);
- }
- }
- return status;
- }
-
- public List<Boolean> validateServiceModuleMetadataUsingParser(ISdcCsarHelper fdntCsarHelper, Map<String, ToscaGroupsTopologyTemplateDefinition> expectedToscaServiceGroupsDefinitionObject, String vnfFile, List<Boolean> status) {
- reportStartTestPrint("validateServiceModuleMetadataUsingParser", vnfFile);
- String customizationUUID = fdntCsarHelper.getServiceNodeTemplates().get(0).getMetaData().getValue("customizationUUID");
- List<Group> actualGroups = fdntCsarHelper.getVfModulesByVf(customizationUUID);
- Either<Boolean, Map<String, Object>> toscaServiceModuleMetadataValidator = ToscaValidation.serviceToscaGroupMetadataValidatorUsingParser(expectedToscaServiceGroupsDefinitionObject, actualGroups);
- if (toscaServiceModuleMetadataValidator.isRight()) {
- status.add(false);
- }
- return status;
- }
-
- public List<Boolean> validateServiceModulePropertyUsingParser(ISdcCsarHelper fdntCsarHelper, Map<String, ToscaGroupsTopologyTemplateDefinition> expectedToscaServiceGroupsDefinitionObject, String vnfFile, List<Boolean> status) {
- reportStartTestPrint("validateServiceModuleMetadataUsingParser", vnfFile);
- String customizationUUID = fdntCsarHelper.getServiceNodeTemplates().get(0).getMetaData().getValue("customizationUUID");
- List<Group> actualGroups = fdntCsarHelper.getVfModulesByVf(customizationUUID);
- Either<Boolean, Map<String, Object>> toscaServiceModuleMetadataValidator = ToscaValidation.serviceToscaGroupPropertyValidatorUsingParser(expectedToscaServiceGroupsDefinitionObject, actualGroups);
- if (toscaServiceModuleMetadataValidator.isRight()) {
- status.add(false);
- }
- return status;
- }
-
- private Map<String, ToscaGroupsTopologyTemplateDefinition> createExpectedToscaServiceGroupsDefinitionObject(Resource resource, Service service, List<TypeHeatMetaDefinition> listTypeHeatMetaDefinition) {
- Map<String, ToscaGroupsTopologyTemplateDefinition> toscaGroupsTopologyTemplateDefinitionMap = new HashMap<>();
-
- for (TypeHeatMetaDefinition moduleType : listTypeHeatMetaDefinition) {
- if (!moduleType.getTypeName().equals("artifacts")) {
- for (GroupHeatMetaDefinition module : moduleType.getGroupHeatMetaDefinition()) {
- ToscaGroupsTopologyTemplateDefinition toscaGroupsTopologyTemplateDefinition = new ToscaGroupsTopologyTemplateDefinition();
- String resourceModuleName = buildResourceModuleName(resource, module.getGroupName());
- ToscaServiceGroupsMetadataDefinition toscaServiceGroupsMetadataDefinition = setGroupMetadataFromResourceObject(resourceModuleName, resource);
- if (!toscaServiceGroupsMetadataDefinition.equals("")) {
- String serviceModuleName = buildServiceModuleName(service.getComponentInstances().get(0).getNormalizedName(), toscaServiceGroupsMetadataDefinition.getVfModuleModelName());
- toscaServiceGroupsMetadataDefinition = setGroupMetadataFromServiceObject(toscaServiceGroupsMetadataDefinition, serviceModuleName, service);
- toscaGroupsTopologyTemplateDefinition.setMetadata(toscaServiceGroupsMetadataDefinition);
- ToscaGroupPropertyDefinition toscaGroupPropertyDefinition = setGroupProperty(module);
- toscaGroupsTopologyTemplateDefinition.setProperties(toscaGroupPropertyDefinition);
- toscaGroupsTopologyTemplateDefinitionMap.put(serviceModuleName, toscaGroupsTopologyTemplateDefinition);
- } else {
- getExtendTest().log(Status.FAIL, "module name [" + module.getGroupName() + "] didn't represent in resource");
- }
- }
- }
- }
- return toscaGroupsTopologyTemplateDefinitionMap;
-
- }
-
-
- private Map<String, VfModuleDefinition> createExpectedVfModuleDefinitionObject(Resource resource, Service service, List<TypeHeatMetaDefinition> listTypeHeatMetaDefinition) {
- Map<String, VfModuleDefinition> toscaGroupsTopologyTemplateDefinitionMap = new HashMap<>();
-
- for (TypeHeatMetaDefinition moduleType : listTypeHeatMetaDefinition) {
- if (!moduleType.getTypeName().equals("artifacts")) {
- for (GroupHeatMetaDefinition module : moduleType.getGroupHeatMetaDefinition()) {
- VfModuleDefinition toscaGroupsTopologyTemplateDefinition = new VfModuleDefinition();
- String resourceModuleName = buildResourceModuleName(resource, module.getGroupName());
- ToscaServiceGroupsMetadataDefinition toscaServiceGroupsMetadataDefinition = setGroupMetadataFromResourceObject(resourceModuleName, resource);
- if (!toscaServiceGroupsMetadataDefinition.equals("")) {
- toscaServiceGroupsMetadataDefinition = setGroupMetadataFromServiceObject(toscaServiceGroupsMetadataDefinition, resourceModuleName, service);
- toscaGroupsTopologyTemplateDefinition.setMetadata(toscaServiceGroupsMetadataDefinition);
- ToscaGroupPropertyDefinition toscaGroupPropertyDefinition = setGroupProperty(module);
- toscaGroupsTopologyTemplateDefinition.setProperties(toscaGroupPropertyDefinition);
- toscaGroupsTopologyTemplateDefinition.setArtifacts(getArtifactsUuidListForRI(module, resource, service));
- toscaGroupsTopologyTemplateDefinitionMap.put(toscaServiceGroupsMetadataDefinition.vfModuleModelName, toscaGroupsTopologyTemplateDefinition);
-
- } else {
- getExtendTest().log(Status.FAIL, "module name [" + module.getGroupName() + "] didn't represent in resource");
- }
- }
- }
- }
- return toscaGroupsTopologyTemplateDefinitionMap;
-
- }
-
- private List<String> getArtifactsUuidListForRI(GroupHeatMetaDefinition module, Resource resource, Service service) {
-//TODO check if each heat include its env file
- List<String> artifactsUuidList = new ArrayList<>();
- ComponentInstance resourceInstance = null;
- for (ComponentInstance componentInstance : service.getComponentInstances()) {
- if (componentInstance.getUniqueId().contains(resource.getUniqueId())) {
- resourceInstance = componentInstance;
- break;
- }
- }
-
- Collection<ArtifactDefinition> artifactsDefinitionValues = resourceInstance.getDeploymentArtifacts().values();
-
- for (HeatMetaFirstLevelDefinition moduleArtifactDefinition : module.getArtifactList()) {
- for (ArtifactDefinition riArtifactDefinition : artifactsDefinitionValues) {
- String heatYamlName = moduleArtifactDefinition.getFileName();
- String heatEnvName = heatYamlName.replaceAll("yaml|yml", "env");
- String riArtifactName = riArtifactDefinition.getArtifactName();
- if (riArtifactName.equals(heatYamlName) || riArtifactName.equals(heatEnvName)) {
- artifactsUuidList.add(riArtifactDefinition.getArtifactUUID());
- }
- }
- }
-
- return artifactsUuidList;
- }
-
- private ToscaGroupPropertyDefinition setGroupProperty(GroupHeatMetaDefinition module) {
- ToscaGroupPropertyDefinition toscaGroupPropertyDefinition = new ToscaGroupPropertyDefinition();
- toscaGroupPropertyDefinition.setVf_module_label(module.getGroupName());
- Boolean isBase = module.getPropertyHeatMetaDefinition().getValue();
- if (isBase) {
- toscaGroupPropertyDefinition.setInitial_count("1");
- toscaGroupPropertyDefinition.setMin_vf_module_instances("1");
- toscaGroupPropertyDefinition.setMax_vf_module_instances("1");
- toscaGroupPropertyDefinition.setVf_module_type("Base");
- } else {
- toscaGroupPropertyDefinition.setInitial_count("0");
- toscaGroupPropertyDefinition.setMin_vf_module_instances("0");
- toscaGroupPropertyDefinition.setMax_vf_module_instances("");
- toscaGroupPropertyDefinition.setVf_module_type("Expansion");
- }
- toscaGroupPropertyDefinition.setAvailability_zone_count("");
- toscaGroupPropertyDefinition.setVfc_list("");
- toscaGroupPropertyDefinition.setVf_module_description("");
- toscaGroupPropertyDefinition.setVolume_group(isVolumeGroup(module));
-
- return toscaGroupPropertyDefinition;
- }
-
- private String isVolumeGroup(GroupHeatMetaDefinition module) {
- String isVolumeGroup = "false";
- for (HeatMetaFirstLevelDefinition artifactList : module.getArtifactList()) {
- if (artifactList.getType().equals(ArtifactTypeEnum.HEAT_VOL.getType())) {
- isVolumeGroup = "true";
- return isVolumeGroup;
- }
- }
- return isVolumeGroup;
- }
-
- private Map<String, ToscaServiceGroupsMetadataDefinition> createExpectedToscaServiceGroupsPropertyDefinitionObject(Resource resource, Service service, List<TypeHeatMetaDefinition> listTypeHeatMetaDefinition) {
-
- Map<String, ToscaServiceGroupsMetadataDefinition> toscaServiceGroupsMetadataDefinitionMap = new HashMap<>();
- for (TypeHeatMetaDefinition moduleType : listTypeHeatMetaDefinition) {
- Map<String, String> groupProperty = new HashMap<>();
-
- ToscaServiceGroupsMetadataDefinition toscaServiceGroupsMetadataDefinition = new ToscaServiceGroupsMetadataDefinition();
- for (GroupHeatMetaDefinition module : moduleType.getGroupHeatMetaDefinition()) {
- String resourceModuleName = buildResourceModuleName(resource, module.getGroupName());
- toscaServiceGroupsMetadataDefinition = setGroupMetadataFromResourceObject(resourceModuleName, resource);
- if (!toscaServiceGroupsMetadataDefinition.equals("")) {
- String serviceModuleName = buildServiceModuleName(service.getComponentInstances().get(0).getNormalizedName(), toscaServiceGroupsMetadataDefinition.getVfModuleModelName());
- toscaServiceGroupsMetadataDefinition = setGroupMetadataFromServiceObject(toscaServiceGroupsMetadataDefinition, serviceModuleName, service);
- toscaServiceGroupsMetadataDefinitionMap.put(serviceModuleName, toscaServiceGroupsMetadataDefinition);
- } else {
- getExtendTest().log(Status.FAIL, "module name [" + module.getGroupName() + "] didn't represent in resource");
- }
- }
- }
- return toscaServiceGroupsMetadataDefinitionMap;
-
- }
-
- private ToscaServiceGroupsMetadataDefinition setGroupMetadataFromServiceObject(ToscaServiceGroupsMetadataDefinition toscaServiceGroupsMetadataDefinition, String serviceModuleName, Service service) {
- for (GroupInstance groupInstance : service.getComponentInstances().get(0).getGroupInstances()) {
- if (groupInstance.getName().contains(serviceModuleName)) {
- toscaServiceGroupsMetadataDefinition.setVfModuleModelCustomizationUUID(groupInstance.getCustomizationUUID());
- return toscaServiceGroupsMetadataDefinition;
- }
- }
- return toscaServiceGroupsMetadataDefinition;
- }
-
- private ToscaServiceGroupsMetadataDefinition setGroupMetadataFromResourceObject(String resourceModuleName, Resource resource) {
- ToscaServiceGroupsMetadataDefinition toscaServiceGroupsMetadataDefinition = new ToscaServiceGroupsMetadataDefinition();
- for (GroupDefinition group : resource.getGroups()) {
- if (group.getName().contains(resourceModuleName)) {
- toscaServiceGroupsMetadataDefinition.setVfModuleModelName(group.getName());
- toscaServiceGroupsMetadataDefinition.setVfModuleModelInvariantUUID(group.getInvariantUUID());
- toscaServiceGroupsMetadataDefinition.setVfModuleModelUUID(group.getGroupUUID());
- toscaServiceGroupsMetadataDefinition.setVfModuleModelVersion(group.getVersion());
- return toscaServiceGroupsMetadataDefinition;
- }
- }
- return toscaServiceGroupsMetadataDefinition;
- }
-
- public static String buildResourceModuleName(Resource resource, String groupName) {
- return resource.getSystemName() + ".." + groupName + ".." + "module-";
- }
-
- public static String buildServiceModuleName(String resourceInstanceNormalizedName, String resourceGroupName) {
- return resourceInstanceNormalizedName + ".." + resourceGroupName;
- }
-
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-
-
- public static ToscaDefinition addGenericInputsToToscaObject(ToscaDefinition toscaDefinition, String genericName) throws Exception {
- Resource genericResource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, genericName, "1.0");
- ToscaTopologyTemplateDefinition topologyTemplate = toscaDefinition.getTopology_template();
- Map<String, ToscaInputsTopologyTemplateDefinition> newInput = new HashMap<>();
- for (PropertyDefinition property : genericResource.getProperties()) {
- ToscaInputsTopologyTemplateDefinition input = new ToscaInputsTopologyTemplateDefinition();
-// input.setConstraints(property.getConstraints());
- input.setDefault(property.getDefaultValue());
- input.setDescription(property.getDescription());
-// input.setEntry_schema(property.getSchema());
- input.setName(property.getName());
-// input.setRequired(property.get);
- input.setStatus(property.getStatus());
- input.setType(property.getType());
- input.setValue(property.getValue());
- newInput.put(property.getName(), input);
- }
-
- topologyTemplate.addInputs(newInput);
- toscaDefinition.setTopology_template(topologyTemplate);
- return toscaDefinition;
- }
-
- public static ToscaDefinition setNameToToscaInput(ToscaDefinition toscaDefinition) {
- Map<String, ToscaInputsTopologyTemplateDefinition> inputs = toscaDefinition.getTopology_template().getInputs();
- for (String name : inputs.keySet()) {
- inputs.get(name).setName(name);
- }
- toscaDefinition.getTopology_template().setInputs(inputs);
- return toscaDefinition;
- }
-
- public static ToscaDefinition addAndGenerateResourceMetadataToExpectedObject(ToscaDefinition toscaDefinition, ResourceReqDetails resourceReqDetails, Component component) {
-
- Map<String, String> metadata = convertResourceMetadataToMap(resourceReqDetails, component);
- toscaDefinition.setMetadata(metadata);
- return toscaDefinition;
- }
-
- public static Map<String, String> convertResourceMetadataToMap(ResourceReqDetails resourceReqDetails, Component component) {
- Map<String, String> metadata = new HashMap<>();
-
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.CATEGORY.value, resourceReqDetails.getCategories().get(0).getName());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.DESCRIPTION.value, resourceReqDetails.getDescription());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.INVARIANT_UUID.value, component.getInvariantUUID());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.TYPE.value, resourceReqDetails.getResourceType());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.UUID.value, component.getUUID());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.NAME.value, component.getName());
-
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.RESOURCE_VENDOR_NAME.value, resourceReqDetails.getVendorName());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.RESOURCE_VENDOR_MODEL_NUMBER.value, resourceReqDetails.getResourceVendorModelNumber());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.RESOURCE_VENDOR_RELEASE.value, resourceReqDetails.getVendorRelease());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.SUBCATEGORY.value, resourceReqDetails.getCategories().get(0).getSubcategories().get(0).getName());
- return metadata;
- }
-
- public static Map<String, String> convertResourceNodeTemplateMetadataToMap(ComponentInstance componentInstance) throws Exception {
-
- Resource resource = AtomicOperationUtils.getResourceObject(componentInstance.getComponentUid());
- Map<String, String> metadata = new HashMap<>();
-
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.CATEGORY.value, resource.getCategories().get(0).getName());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.DESCRIPTION.value, resource.getDescription());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.INVARIANT_UUID.value, resource.getInvariantUUID());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.TYPE.value, resource.getResourceType().toString());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.UUID.value, resource.getUUID());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.NAME.value, resource.getName());
-
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.RESOURCE_VENDOR_NAME.value, resource.getVendorName());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.RESOURCE_VENDOR_MODEL_NUMBER.value, resource.getResourceVendorModelNumber());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.RESOURCE_VENDOR_RELEASE.value, resource.getVendorRelease());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.SUBCATEGORY.value, resource.getCategories().get(0).getSubcategories().get(0).getName());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.CUSTOMIZATION_UUID.value, componentInstance.getCustomizationUUID());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.VERSION.value, componentInstance.getComponentVersion());
-
- return metadata;
- }
-
- public static Map<String, String> generateServiceNodeTemplateMetadataToExpectedObject(ResourceReqDetails resourceReqDetails, Component component, ComponentInstance componentInstanceDefinition) {
-
- Map<String, String> metadata = convertResourceMetadataToMap(resourceReqDetails, component);
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.CUSTOMIZATION_UUID.value, componentInstanceDefinition.getCustomizationUUID());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.VERSION.value, componentInstanceDefinition.getComponentVersion());
-
- return metadata;
- }
-
- public static Map<String, Map<String, String>> generateResourceNodeTemplateMetadataToExpectedObject(Component component) throws Exception {
-
- Map<String, Map<String, String>> resourcesNodeTemplateMetadataMap = new HashMap<>();
- if (component.getComponentInstances() != null && !component.getComponentInstances().isEmpty()) {
- for (ComponentInstance componentInstance : component.getComponentInstances()) {
- Map<String, String> metadata = convertResourceNodeTemplateMetadataToMap(componentInstance);
- resourcesNodeTemplateMetadataMap.put(componentInstance.getName(), metadata);
- }
- }
- return resourcesNodeTemplateMetadataMap;
- }
-
- public static Map<String, String> generateServiceMetadataToExpectedObject(ServiceReqDetails serviceReqDetails, Component component) {
-
- Map<String, String> metadata = new HashMap<>();
-
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.CATEGORY.value, serviceReqDetails.getCategories().get(0).getName());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.DESCRIPTION.value, serviceReqDetails.getDescription());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.INVARIANT_UUID.value, component.getInvariantUUID());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.TYPE.value, "Service");
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.UUID.value, component.getUUID());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.NAME.value, component.getName());
-
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.SERVICE_TYPE.value, serviceReqDetails.getServiceType());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.SERVICE_ROLE.value, serviceReqDetails.getServiceRole());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.NAMING_POLICY.value, serviceReqDetails.getNamingPolicy());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.ECOMP_GENERATED_NAMING.value, serviceReqDetails.getEcompGeneratedNaming().toString());
- metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.SERVICE_ECOMP_NAMING.value, serviceReqDetails.getEcompGeneratedNaming().toString());//equals to ECOMP_GENERATED_NAMING
-
- return metadata;
- }
-
- public static void reportStartTestPrint(String testName, String vnfFile) {
-// reportMessageInColor("info", "blue", "Running test \" + testName + \" with zip file - \" + vnfFile");
- SetupCDTest.getExtendTest().log(Status.INFO, "<html><font color=\"blue\"> Running test " + testName + " with zip file - " + vnfFile + "</font></html>");
- }
-
- public static void reportSkipTestPrint(String testName, List<Boolean> status) {
-// reportMessageInColor("error", "orange", "Skip test \" + testName + \" due to previous tosca parser error");
- SetupCDTest.getExtendTest().log(Status.ERROR, "<html><font color=\"orange\"> Skip test " + testName + " due to previous tosca parser error" + "</font></html>");
- status.add(false);
- }
-
- public static void reportMessageInColor(String status, String color, String message) {
- String printLine = getReportMessageInColor(color, message);
- SetupCDTest.getExtendTest().log(Status.valueOf(status), printLine);
-// SetupCDTest.getExtendTest().log(Status.valueOf(status), getReportMessageInColor(color, message));
- }
-
- /**
- * @param color = red, green, orange, blue ...
- * @param message - message string
- * @return string in desired color
- */
- public static String getReportMessageInColor(String color, String message) {
- String returnValue = ("<html><font color=\\\"+color+\"\">" + message + "</font></html>").toString();
- return returnValue;
- }
-
-/* @Test()
- public void printTest(){
- System.out.println("print");
- reportMessageInColor("ERROR", "green", "green");
- reportMessageInColor("INFO", "orange", "orange");
- reportMessageInColor("INFO", "red", "red");
- }*/
-
-/* @Test
- public void allottedResourceModelTest() throws Exception{
- List<Boolean> status = new ArrayList<>();
-
- List<String> fileNamesFromFolder = OnboardingUtils.getVnfNamesFileListExcludeToscaParserFailure();
- List<String> newRandomFileNamesFromFolder = OnbordingDataProviders.getRandomElements(1, fileNamesFromFolder);
- String vnfFile = newRandomFileNamesFromFolder.get(0);
- setLog(vnfFile);
- String filePath = FileHandling.getVnfRepositoryPath();
- File filesFolder = new File(SetupCDTest.getWindowTest().getDownloadDirectory());
-
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(ResourceCategoryEnum.ALLOTTED_RESOURCE_SERVICE_ADMIN);
- resourceReqDetails = createCustomizedVsp(resourceReqDetails, filePath, vnfFile);
-
- ToscaDefinition toscaMainAmdocsDefinition = downloadAndGetToscaMainYamlObjectUI(resourceReqDetails, filesFolder);
- toscaMainAmdocsDefinition = addGenericPropertiesToToscaDefinitionObject(toscaMainAmdocsDefinition, GENERIC_VF);
-
- Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- ToscaDefinition toscaMainVfDefinition = downloadAndGetToscaMainYamlObjectApi(resource, filesFolder);
-
- status = validateVfMetadata(toscaMainAmdocsDefinition, toscaMainVfDefinition, resourceReqDetails, resource, vnfFile, status);
- status = validateResourceNodeTemplateMetadata(toscaMainVfDefinition, resource, vnfFile, status);
- status = validateResourceInputs(toscaMainAmdocsDefinition, toscaMainVfDefinition, vnfFile, status);
-
- if(status.contains(false)){
- SetupCDTest.getExtendTest().log(Status.FAIL, "Summary: allottedResourceModelTest tosca validation test failed with zip file " + vnfFile);
- Assert.assertFalse(true);
- }
- }*/
-
-
- // help method to toscaValidation tests
- private ISdcCsarHelper initSdcCsarHelper(File serviceCsarFileName, File filesFolder) {
-
- ISdcCsarHelper fdntCsarHelper;
- try {
- SetupCDTest.getExtendTest().log(Status.INFO, "Tosca parser is going to convert service csar file to ISdcCsarHelper object...");
- fdntCsarHelper = factory.getSdcCsarHelper(filesFolder.getPath() + serviceCsarFileName);
- } catch (Exception e) {
- SetupCDTest.getExtendTest().log(Status.ERROR, "Tosca parser FAILED to convert service csar file to ISdcCsarHelper object...");
- SetupCDTest.getExtendTest().log(Status.FAIL, e);
- fdntCsarHelper = null;
- }
- return fdntCsarHelper;
- }
-
-
- /**
- * @param resourceReqDetails to create Vsp
- * @return updated resourceReqDetails after Vsp was created
- */
- private ResourceReqDetails createCustomizedVsp(ResourceReqDetails resourceReqDetails, String filePath, String vnfFile) throws Exception {
- VendorSoftwareProductObject vendorSoftwareProductObject = OnboardingUtillViaApis.createVspViaApis(resourceReqDetails, filePath, vnfFile, user);
- resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
- return resourceReqDetails;
- }
-
- /**
- * @param resourceReqDetails to download csar file via UI
- * @return Tosca definition object from main yaml file
- */
- private ToscaDefinition downloadAndGetToscaMainYamlObjectUI(ResourceReqDetails resourceReqDetails, File filesFolder) throws Exception {
- DownloadManager.downloadCsarByNameFromVSPRepository(resourceReqDetails.getName(), false);
- File amdocsCsarFileName = FileHandling.getLastModifiedFileNameFromDir(filesFolder.getAbsolutePath());
- return ToscaParserUtils.parseToscaMainYamlToJavaObjectByCsarLocation(amdocsCsarFileName);
- }
-
- /**
- * @param toscaMainAmdocsDefinition object to add generic properties
- * @param genericName resource name
- * @return updated toscaMainAmdocsDefinition object
- */
- private ToscaDefinition addGenericPropertiesToToscaDefinitionObject(ToscaDefinition toscaMainAmdocsDefinition, String genericName) throws Exception {
- toscaMainAmdocsDefinition = setNameToToscaInput(toscaMainAmdocsDefinition);
- toscaMainAmdocsDefinition = addGenericInputsToToscaObject(toscaMainAmdocsDefinition, genericName);
- return toscaMainAmdocsDefinition;
- }
-
- /**
- * @param resource to download csar file via API
- * @return Tosca definition object from main yaml file
- */
- private ToscaDefinition downloadAndGetToscaMainYamlObjectApi(Resource resource, File filesFolder) throws Exception {
- File vfCsarFileName = new File(File.separator + "VfCsar_" + ElementFactory.generateUUIDforSufix() + ".csar");
- OnboardingUtillViaApis.downloadToscaCsarToDirectory(resource, new File(filesFolder.getPath() + vfCsarFileName));
- return ToscaParserUtils.parseToscaMainYamlToJavaObjectByCsarLocation(new File(filesFolder.getPath() + vfCsarFileName));
- }
-
-
-}
-
-
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/UpgradeServices.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/UpgradeServices.java
deleted file mode 100644
index d8266f19df..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/UpgradeServices.java
+++ /dev/null
@@ -1,459 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.sanity;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-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.ci.tests.datatypes.CanvasElement;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
-import org.openecomp.sdc.ci.tests.datatypes.ConnectionWizardPopUpObject;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.LifeCycleStateEnum;
-import org.openecomp.sdc.ci.tests.datatypes.PortMirrioringConfigurationObject;
-import org.openecomp.sdc.ci.tests.datatypes.PortMirroringEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.TopMenuButtonsEnum;
-import org.openecomp.sdc.ci.tests.datatypes.VendorLicenseModel;
-import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
-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.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.CompositionPage;
-import org.openecomp.sdc.ci.tests.pages.GeneralPageElements;
-import org.openecomp.sdc.ci.tests.pages.PropertiesAssignmentPage;
-import org.openecomp.sdc.ci.tests.pages.PropertyNameBuilder;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.pages.ServiceGeneralPage;
-import org.openecomp.sdc.ci.tests.pages.TesterOperationPage;
-import org.openecomp.sdc.ci.tests.pages.UpgradeServicesPopup;
-import org.openecomp.sdc.ci.tests.utilities.CatalogUIUtilitis;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.PortMirroringUtils;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-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.FileHandling;
-import org.openecomp.sdc.ci.tests.utils.general.OnboardingUtillViaApis;
-import org.openecomp.sdc.ci.tests.utils.general.VendorLicenseModelRestUtils;
-import org.openecomp.sdc.ci.tests.utils.general.VendorSoftwareProductRestUtils;
-import org.openecomp.sdc.ci.tests.verificator.PropertiesAssignmentVerificator;
-import org.openecomp.sdc.ci.tests.verificator.ServiceVerificator;
-import org.openecomp.sdc.ci.tests.verificator.VfVerificator;
-import org.testng.Assert;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import java.util.Map;
-
-public class UpgradeServices extends SetupCDTest {
-
-
- private static final int CREATIN_UPDATE_BUTTON_TIMEOUT = 10 * 60;
- private User sdncDesignerDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- private String filePath;
-
- @BeforeClass
- public void beforeClass() {
- filePath = org.openecomp.sdc.ci.tests.utilities.FileHandling.getFilePath("");
- }
-
- @Test
- public void upgradeVfOnServiceLevel() throws Throwable {
- String vnfFile = "2016-227_vmme_vmme_30_1610_e2e.zip";
- //1. Import VSP, create VF, certify
- Resource vfResource = createAndCertifyVFfromVSP(vnfFile);
- //2. Create CR, certify
- ResourceReqDetails crMetaData = createCRAndCertify();
- //3. Create PNF, certify
- ResourceReqDetails pnfMetaData = createPnfAndCertify();
-
- //4. Create Service1. Service composition - add 2 VFi
- Service service1 = createService();
- getExtendTest().log(Status.INFO, "Add VFi to service twice");
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- CanvasManager canvasManager1 = createCanvasManager(service1);
- CanvasElement vfElementVmme1 = canvasManager1.createElementOnCanvas(vfResource.getName());
- CanvasElement vfElementVmme11 = canvasManager1.createElementOnCanvas(vfResource.getName());
-
- //5. Add CRi, PNFi and PMC to Service1
- getExtendTest().log(Status.INFO, "Add PMC element to service");
- CompositionPage.searchForElement(PortMirroringEnum.PMC_ELEMENT_IN_PALLETE.getValue());
- CanvasElement pmcElement = canvasManager1.createElementOnCanvas(PortMirroringEnum.PMC_ELEMENT_IN_PALLETE.getValue());
- getExtendTest().log(Status.INFO, "Add CR and PNF elements to service");
- canvasManager1.createElementOnCanvas(crMetaData.getName());
- canvasManager1.createElementOnCanvas(pnfMetaData.getName());
-
- //6. Link between VF and PMC. Give values to capability properties. Certify Service1.
- ConnectionWizardPopUpObject connectionWizardPopUpObject = new ConnectionWizardPopUpObject("", "",
- PortMirroringEnum.PM_REQ_TYPE.getValue(), PortMirroringEnum.PMC_SOURCE_CAP.getValue());
- Map<String, String> capPropValues1 = canvasManager1.linkElementsWithCapPropAssignment(vfElementVmme1,
- pmcElement, connectionWizardPopUpObject); //link elements, assign values to properties and save map of values for later validation
- certifyServiceInUI(service1);
- service1.setVersion("1.0");
- service1 = AtomicOperationUtils.getServiceObjectByNameAndVersion(UserRoleEnum.DESIGNER, service1.getName(), service1.getVersion());
- String vf1CustUuidOrig = AtomicOperationUtils.getServiceComponentInstanceByName(
- service1, vfElementVmme1.getElementNameOnCanvas(), true).getCustomizationUUID();
-
- //7. Create Service2. Service composition - add VFi. Start certifying Service2 ("certification in progress" stage)
- Service service2 = createService();
- getExtendTest().log(Status.INFO, "Add VFi to service");
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- CanvasManager canvasManager2 = createCanvasManager(service2);
- CanvasElement vfElementVmme2 = canvasManager2.createElementOnCanvas(vfResource.getName());
- getExtendTest().log(Status.INFO, "Start service certification");
- AtomicOperationUtils.changeComponentState(service2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.STARTCERTIFICATION, true).getLeft();
- service2 = AtomicOperationUtils.getServiceObject(service2.getUniqueId());
- String vf2CustUuidOrig = AtomicOperationUtils.getServiceComponentInstanceByName(
- service2, vfElementVmme2.getElementNameOnCanvas(), true).getCustomizationUUID();
-
- //8. Create Service3. Service composition - add VFi. Leave service in "checked out" state
- Service service3 = createService();
- getExtendTest().log(Status.INFO, "Add VFi to service");
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- CanvasManager canvasManager3 = createCanvasManager(service3);
- CanvasElement vfElementVmme3 = canvasManager3.createElementOnCanvas(vfResource.getName());
- service3 = AtomicOperationUtils.getServiceObject(service3.getUniqueId()); //updated
- String vf3CustUuidOrig = AtomicOperationUtils.getServiceComponentInstanceByName(
- service3, vfElementVmme3.getElementNameOnCanvas(), true).getCustomizationUUID();
-
- //9. VF - checkout, save, click "certify"
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- GeneralUIUtils.findComponentAndClick(vfResource.getName());
- GeneralPageElements.clickCheckoutButton();
- GeneralPageElements.clickCreateUpdateButton(CREATIN_UPDATE_BUTTON_TIMEOUT);
- GeneralPageElements.clickCertifyButtonNoUpgradePopupDismiss(vfResource.getName());
-
- //10. Validate that Service1 can be upgraded (checked), Service2 and Service3 are locked
- //TODO - add validation in UI
-
- //11. Click Upgrade button
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ModalItems.UPGRADE_SERVICES_OK.getValue());
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ModalItems.UPGRADE_SERVICES_CLOSE.getValue());
-
- //12. Open Service1, verify version (1.1), state(checked in), VFi version (v2.0)
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- GeneralUIUtils.findComponentAndClick(service1.getName());
- ServiceVerificator.verifyVersionUI("1.1");
- ServiceVerificator.verifyServiceLifecycleInUI(LifeCycleStateEnum.CHECKIN);
- ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager4 = CanvasManager.getCanvasManager();
- canvasManager4.clickOnCanvaElement(vfElementVmme1);
- ServiceVerificator.verifyResourceInstanceVersionUI("2.0");
- canvasManager4.clickOnCanvaElement(vfElementVmme11);
- ServiceVerificator.verifyResourceInstanceVersionUI("2.0");
-
- //13. Verify that VFi CustomizationID is different
- service1.setVersion("1.1");
- service1 = AtomicOperationUtils.getServiceObjectByNameAndVersion(UserRoleEnum.DESIGNER, service1.getName(), service1.getVersion()); //updated
- String vf1CustUuidUpd = AtomicOperationUtils.getServiceComponentInstanceByName(
- service1, vfElementVmme1.getElementNameOnCanvas(), true).getCustomizationUUID();
- Assert.assertTrue(!vf1CustUuidOrig.equals(vf1CustUuidUpd));
-
- //14. Verify that capabilities properties assignment is kept
- canvasManager4.openLinkPopupReqsCapsConnection(vfElementVmme1, pmcElement); //open connection wizard
- Map<String, String> capPropValues2 = canvasManager4.connectionWizardCollectCapPropValues(); //collect cap prop values
- Assert.assertTrue(capPropValues1.equals(capPropValues2)); // compare cap prop values before and after changing VF version
- canvasManager4.clickSaveOnLinkPopup();
-
- //15. Open Service2, verify version (0.1), state ("in testing"), VFi version (1.0) and VFi Customization UUID (hasn't changed)
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- GeneralUIUtils.findComponentAndClick(service2.getName());
- ServiceVerificator.verifyVersionUI("0.1");
- ServiceVerificator.verifyServiceLifecycleInUI(LifeCycleStateEnum.IN_TESTING);
- ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager5 = CanvasManager.getCanvasManager();
- canvasManager5.clickOnCanvaElement(vfElementVmme2);
- ServiceVerificator.verifyResourceInstanceVersionUI("1.0");
- service2 = AtomicOperationUtils.getServiceObject(service2.getUniqueId()); //updated
- String vf2CustUuidUpd = AtomicOperationUtils.getServiceComponentInstanceByName(
- service2, vfElementVmme2.getElementNameOnCanvas(), true).getCustomizationUUID();
- Assert.assertTrue(vf2CustUuidOrig.equals(vf2CustUuidUpd));
-
- //16. Open Service3, verify version (0.1), state ("checked out"), VFi version (1.0) and VFi Customization UUID (hasn't changed)
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- GeneralUIUtils.findComponentAndClick(service3.getName());
- ServiceVerificator.verifyVersionUI("0.1");
- ServiceVerificator.verifyServiceLifecycleInUI(LifeCycleStateEnum.CHECKOUT);
- ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager6 = CanvasManager.getCanvasManager();
- canvasManager6.clickOnCanvaElement(vfElementVmme3);
- ServiceVerificator.verifyResourceInstanceVersionUI("1.0");
- service3 = AtomicOperationUtils.getServiceObject(service3.getUniqueId()); //updated
- String vf3CustUuidUpd = AtomicOperationUtils.getServiceComponentInstanceByName(
- service3, vfElementVmme3.getElementNameOnCanvas(), true).getCustomizationUUID();
- Assert.assertTrue(vf3CustUuidOrig.equals(vf3CustUuidUpd));
-
- //17. Open CR, checkout, certify. Verify there is no upgrade popup
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- GeneralUIUtils.findComponentAndClick(crMetaData.getName());
- ResourceGeneralPage.clickCheckoutButton();
- ResourceGeneralPage.clickCertifyButton(crMetaData.getName());
- Assert.assertTrue(!UpgradeServicesPopup.isUpgradePopupShown());
-
- //18. Open PNF, checkout, certify. Verify there is no upgrade popup
- GeneralUIUtils.findComponentAndClick(pnfMetaData.getName());
- ResourceGeneralPage.clickCheckoutButton();
- ResourceGeneralPage.clickCertifyButton(pnfMetaData.getName());
- Assert.assertTrue(!UpgradeServicesPopup.isUpgradePopupShown());
- }
-
- @Test
- public void upgradeAllottedVfOnServiceLevel() throws Throwable {
- String propUUID = "depending_service_uuid";
- String propInvUUID = "depending_service_invariant_uuid";
- String propName = "depending_service_name";
-
- //1. Create Service1, certify
- Service service1 = createService();
- getExtendTest().log(Status.INFO, "Certify Service1");
- AtomicOperationUtils.changeComponentState(service1, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- String serviceName = service1.getName();
- String serviceInvUUID = service1.getInvariantUUID();
- String serviceUUIDv1 = service1.getUUID();
-
- //2. Import AllottedResource yaml, create VFC, certify
- String fileName = "Allottedresource.yml";
- ResourceReqDetails vfcMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT,
- ResourceCategoryEnum.ALLOTTED_RESOURCE, getUser());
- ResourceUIUtils.importVfc(vfcMetaData, filePath, fileName, getUser());
- ResourceGeneralPage.clickCertifyButton(vfcMetaData.getName());
-
- //3. Create VF, add VFCi to canvas
- ResourceReqDetails vfMetaData = createVFviaAPI(ResourceCategoryEnum.ALLOTTED_RESOURCE_TUNNEL_XCONNECT);
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager1 = CanvasManager.getCanvasManager();
- CanvasElement vfcElement1 = canvasManager1.createElementOnCanvas(vfcMetaData.getName());
-
- //4. VF Properties Assignment: edit values of depending service properties, certify VF
- CompositionPage.moveToPropertiesScreen();
- PropertiesAssignmentPage.findSearchBoxAndClick(propName);
- PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildSimpleField(propName), serviceName);
- PropertiesAssignmentPage.clickOnSaveButton();
- PropertiesAssignmentPage.findSearchBoxAndClick(propUUID);
- PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildSimpleField(propUUID), serviceUUIDv1);
- PropertiesAssignmentPage.clickOnSaveButton();
- PropertiesAssignmentPage.findSearchBoxAndClick(propInvUUID);
- PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildSimpleField(propInvUUID), serviceInvUUID);
- PropertiesAssignmentPage.clickOnSaveButton();
- ResourceGeneralPage.clickCertifyButton(vfMetaData.getName());
-
- //5. Create Service2, add VFi to Service2, certify Service2
- Service service2 = createService();
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- CanvasManager canvasManager2 = createCanvasManager(service2);
- CanvasElement vfElement1 = canvasManager2.createElementOnCanvas(vfMetaData.getName());
- getExtendTest().log(Status.INFO, "Certify Service2");
- AtomicOperationUtils.changeComponentState(service2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- //6. Create Service3, add VFi to Service3, leave Service3 in checked-out state
- Service service3 = createService();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- CanvasManager canvasManager3 = createCanvasManager(service3);
- CanvasElement vfElement2 = canvasManager3.createElementOnCanvas(vfMetaData.getName());
-
- //7. Check out and certify Service1 (keep new UUID)
- AtomicOperationUtils.changeComponentState(service1, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- AtomicOperationUtils.changeComponentState(service1, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- service1 = AtomicOperationUtils.getServiceObject(service1.getUniqueId());
- String serviceUUIDv2 = service1.getUUID();
-
- //8. Open Service1 and click “Upgrade Services” button
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- GeneralUIUtils.findComponentAndClick(service1.getName());
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.UPDATE_SERVICES_BUTTON.getValue()).click();
-
- //9. Validate that Service2 can be upgraded (checked), Service3 is locked
- //TODO - add validation in UI
-
- //10. Click Upgrade button
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ModalItems.UPDATE_SERVICES_OK.getValue());
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ModalItems.UPGRADE_SERVICES_CLOSE.getValue());
-
- //11. Open VF, verify that version is 2.0
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
- VfVerificator.verifyVersionUI("2.0");
-
- //12. VF properties assignment - verify that UUID value is updated, other values are the same
- ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildSimpleField(propUUID), serviceUUIDv2);
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildSimpleField(propInvUUID), serviceInvUUID);
- PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildSimpleField(propName), serviceName);
-
- //13. Open Service2, verify version 1.1 and state "in design check in", select VFi, verify version 2.0
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- GeneralUIUtils.findComponentAndClick(service2.getName());
- ServiceVerificator.verifyVersionUI("1.1");
- ServiceVerificator.verifyServiceLifecycleInUI(LifeCycleStateEnum.CHECKIN);
- ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager4 = CanvasManager.getCanvasManager();
- canvasManager4.clickOnCanvaElement(vfElement1);
- ServiceVerificator.verifyResourceInstanceVersionUI("2.0");
-
- //14. Open Service3, select VFi in composition, verify version 1.0
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- GeneralUIUtils.findComponentAndClick(service3.getName());
- ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager5 = CanvasManager.getCanvasManager();
- canvasManager5.clickOnCanvaElement(vfElement2);
- ServiceVerificator.verifyResourceInstanceVersionUI("1.0");
- }
-
- @Test
- public void upgradeServiceProxyOnServiceLevel() throws Throwable {
- //1. Create Port Mirroring Service1, certify
- PortMirrioringConfigurationObject portMirrioringConfigurationObject = PortMirroringUtils.createPortMirriongConfigurationStructure(true);
- Service service1 = portMirrioringConfigurationObject.getService();
- Service serviceSource = portMirrioringConfigurationObject.getServiceContainerVmme_Source();
- CanvasElement pmcElement = portMirrioringConfigurationObject.getPortMirroringConfigurationElement();
- CanvasElement sourceElement = portMirrioringConfigurationObject.getServiceElementVmmeSourceName();
- Map<String, String> capPropValues1 = portMirrioringConfigurationObject.getCapPropValues();
- certifyServiceInUI(service1);
- service1 = AtomicOperationUtils.getServiceObject(service1.getUniqueId());
- String serviceSourceName = portMirrioringConfigurationObject.getServiceElementVmmeSourceName().getElementNameOnCanvas();
- String sourceUuidOrig = AtomicOperationUtils.getServiceComponentInstanceByName(
- service1, serviceSourceName, true).getCustomizationUUID();
-
- //2. Create Service2, add source service to it
- Service service2 = createService();
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- CanvasManager canvasManager1 = createCanvasManager(service2);
- CanvasElement serviceSourceElement = canvasManager1.createElementOnCanvas(serviceSource.getName());
-
- //3. Checkout and certify serviceSource
- AtomicOperationUtils.changeComponentState(serviceSource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
- AtomicOperationUtils.changeComponentState(serviceSource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- serviceSource = AtomicOperationUtils.getServiceObject(serviceSource.getUniqueId());
-
- //4. Open Service2, click Update button
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- GeneralUIUtils.findComponentAndClick(serviceSource.getName());
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.UPDATE_SERVICES_BUTTON.getValue()).click();
-
- //5. Validate that Service1 can be upgraded (checked), Service2 is locked
- //TODO - add validation in UI
-
- //6. Click Upgrade button
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ModalItems.UPDATE_SERVICES_OK.getValue());
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ModalItems.UPGRADE_SERVICES_CLOSE.getValue());
-
- //7. Open Service1, verify version 1.1 and state "in design check in", select VFi, verify version 2.0
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- GeneralUIUtils.findComponentAndClick(service1.getName());
- ServiceVerificator.verifyVersionUI("1.1");
- ServiceVerificator.verifyServiceLifecycleInUI(LifeCycleStateEnum.CHECKIN);
- ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager2 = CanvasManager.getCanvasManager();
- canvasManager2.clickOnCanvaElement(serviceSourceElement);
- ServiceVerificator.verifyResourceInstanceVersionUI("2.0");
-
- //8. Verify that capabilities properties values are kept
- canvasManager2.openLinkPopupReqsCapsConnection(sourceElement, pmcElement); //open connection wizard
- Map<String, String> capPropValues2 = canvasManager2.connectionWizardCollectCapPropValues(); //collect cap prop values
- Assert.assertTrue(capPropValues1.equals(capPropValues2)); // compare cap prop values before and after changing VF version
- canvasManager2.clickSaveOnLinkPopup();
-
- //9. Verify that CustomizationUUID of service source instance is changed
- service1.setVersion("1.1"); //updated
- service1 = AtomicOperationUtils.getServiceObjectByNameAndVersion(UserRoleEnum.DESIGNER, service1.getName(), service1.getVersion());
- String sourceUuidUpd = AtomicOperationUtils.getServiceComponentInstanceByName(
- service1, serviceSourceName, true).getCustomizationUUID();
- Assert.assertTrue(!sourceUuidOrig.equals(sourceUuidUpd));
-
- //10. Open Service3, select VFi in composition, verify version 1.0
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- GeneralUIUtils.findComponentAndClick(service2.getName());
- ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager3 = CanvasManager.getCanvasManager();
- canvasManager3.clickOnCanvaElement(serviceSourceElement);
- ServiceVerificator.verifyResourceInstanceVersionUI("1.0");
- }
-
-
- private CanvasManager createCanvasManager(Service service1) throws Exception {
- GeneralUIUtils.findComponentAndClick(service1.getName());
- ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
- return CanvasManager.getCanvasManager();
- }
-
- private void certifyServiceInUI(Service service1) throws Exception {
- getExtendTest().log(Status.INFO, "Certify Service");
- ServiceGeneralPage.clickSubmitForTestingButton(service1.getName());
- reloginWithNewRole(UserRoleEnum.TESTER);
- GeneralUIUtils.findComponentAndClick(service1.getName());
- TesterOperationPage.certifyComponent(service1.getName());
- reloginWithNewRole(UserRoleEnum.DESIGNER);
- }
-
- private Service createService() throws Exception {
- ServiceReqDetails serviceReqDetails1 = OnboardingUtillViaApis.prepareServiceDetailsBeforeCreate(sdncDesignerDetails);
- getExtendTest().log(Status.INFO, "Create Service " + serviceReqDetails1.getName());
- return AtomicOperationUtils.createCustomService(serviceReqDetails1, UserRoleEnum.DESIGNER, true).left().value();
- }
-
- private ResourceReqDetails createPnfAndCertify() throws Exception {
- ResourceReqDetails pnfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.PNF, getUser());
- ResourceUIUtils.createPNF(pnfMetaData, getUser());
- ResourceGeneralPage.clickCertifyButton(pnfMetaData.getName());
- return pnfMetaData;
- }
-
- private Resource createAndCertifyVFfromVSP(String vnfFile) throws Exception {
- String filePath = FileHandling.getPortMirroringRepositoryPath();
- getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
- vendorLicenseModel, null);
- resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
- Resource vfResource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
- vfResource = (Resource) AtomicOperationUtils.changeComponentState(vfResource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- return vfResource;
- }
-
- private ResourceReqDetails createCRAndCertify() throws Exception {
- ResourceReqDetails crMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.CR, getUser());
- ResourceUIUtils.createCR(crMetaData, getUser());
- ResourceGeneralPage.clickCertifyButton(crMetaData.getName());
- return crMetaData;
- }
-
- private ResourceReqDetails createVFviaAPI(ResourceCategoryEnum resourceCategory) {
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, resourceCategory, getUser());
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating VF %s", vfMetaData.getName()));
- AtomicOperationUtils.createResourceByResourceDetails(vfMetaData, UserRoleEnum.DESIGNER, true).left().value();
- return vfMetaData;
- }
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VFCArtifacts.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VFCArtifacts.java
deleted file mode 100644
index 9ee8c06938..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VFCArtifacts.java
+++ /dev/null
@@ -1,381 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.sanity;
-
-import com.aventstack.extentreports.Status;
-import org.apache.http.HttpStatus;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.HeatMetaFirstLevelDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.VendorLicenseModel;
-import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
-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.http.RestResponse;
-import org.openecomp.sdc.ci.tests.execute.devCI.ArtifactFromCsar;
-import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.HomePage;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.utilities.DownloadManager;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.OnboardingUiUtils;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.RestCDUtils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.general.VendorLicenseModelRestUtils;
-import org.openecomp.sdc.ci.tests.utils.general.VendorSoftwareProductRestUtils;
-import org.openecomp.sdc.ci.tests.verificator.VFCArtifactVerificator;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-import static org.testng.Assert.assertTrue;
-
-public class VFCArtifacts extends SetupCDTest {
-
- private static final String DEPLOYMENT = "Deployment";
- private static final String INFORMATIONAL = "Informational";
- private static final String ARTIFACTS = "artifacts";
- private static final String DEPLOYMENT_ARTIFACTS = "deploymentArtifacts";
- private String filePath;
-
- @BeforeClass
- public void beforeClass() {
- filePath = FileHandling.getFilePath("VFCArtifacts");
- }
-
- @Test
- public void ImportMultiVFCTest_TC1407998() throws Exception {
-
- String csarFile = "Import_Multi_VFC.csar";
-
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- resourceMetaData.setVersion("0.1");
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, csarFile, getUser());
-
- RestResponse getResponse = RestCDUtils.getResource(resourceMetaData, getUser());
- assertTrue(getResponse.getErrorCode().intValue() == HttpStatus.SC_OK);
-
- Map<String, LinkedList<HeatMetaFirstLevelDefinition>> expectedArtifactMap = verifyVfcArtifacts(filePath, csarFile, resourceMetaData, getResponse);
-
- VFCArtifactVerificator.verifyVFCArtifactsNotInVFArtifactList(resourceMetaData, getUser(), getResponse, expectedArtifactMap);
-
-
- }
-
- @Test
- public void updateCsarWithVFCArtifacts_ModifyArtifacts_TC1449482() throws Exception {
-
- String csarFile = "LDSA-ORIG.csar";
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- resourceMetaData.setVersion("0.1");
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, csarFile, getUser());
-
- Map<String, Object> artifactsFromCsar = ArtifactFromCsar.getVFCArtifacts(filePath + csarFile);
- List<String> vfcKeys = artifactsFromCsar.keySet().stream().filter(p -> p.contains("vfc")).collect(Collectors.toList());
- for (String key : vfcKeys) {
- VFCArtifactVerificator.setActualVfcArtifactList(key, resourceMetaData, getUser());
- }
-
- String updatedCsarFile = "LDSA-MODIFY.csar";
- ResourceUIUtils.updateVfWithCsar(filePath, updatedCsarFile);
-
- Map<String, Object> updatedArtifactsFromCsar = ArtifactFromCsar.getVFCArtifacts(filePath + updatedCsarFile);
- List<String> updatedVfcKeys = updatedArtifactsFromCsar.keySet().stream().filter(p -> p.contains("vfc")).collect(Collectors.toList());
- for (String key : updatedVfcKeys) {
- verifyVfcInstanceArtifacts(resourceMetaData, null, updatedArtifactsFromCsar, key);
- VFCArtifactVerificator.verifyVfcArtifactUpdated(key, resourceMetaData, getUser());
- }
- }
-
- @Test
- public void updateCsarWithVFCArtifacts_DeleteAndAddArtifacts_TC1449473() throws Exception {
-
- String csarFile = "LDSA-ORIG.csar";
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- resourceMetaData.setVersion("0.1");
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, csarFile, getUser());
-
- String updatedCsarFile = "LDSA-DELETE-ADD.csar";
- ResourceUIUtils.updateVfWithCsar(filePath, updatedCsarFile);
-
- verifyVfcArtifacts(filePath, updatedCsarFile, resourceMetaData, null);
- }
-
- @Test
- public void updateCsarWithVFCArtifacts_AddFirstVFCIdentifier_TC1425896() throws Exception {
-
- String csarFile = "LDSA-ORIG-OLD_STRUCTURE.csar";
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- resourceMetaData.setVersion("0.1");
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, csarFile, getUser());
-
- VFCArtifactVerificator.verifyNoVfcArtifacts(resourceMetaData, getUser(), null);
-
- ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
- String[] artifactNamesFromFile = ArtifactFromCsar.getArtifactNamesFromCsar(filePath, csarFile);
- String[] artifactsFromFileBeforeUpdate = DeploymentArtifactPage.verifyArtifactsExistInTable(artifactNamesFromFile);
- DeploymentArtifactPage.getLeftMenu().moveToGeneralScreen();
-
- String updatedCsarFile = "LDSA-ADD.csar";
- ResourceUIUtils.updateVfWithCsar(filePath, updatedCsarFile);
-
- verifyVfcArtifacts(filePath, updatedCsarFile, resourceMetaData, null);
-
- ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
- DeploymentArtifactPage.verifyArtifactsExistInTable(artifactsFromFileBeforeUpdate);
- }
-
-
- @Test
- public void updateCsarWithVFCArtifacts_AddAdditionalVFCIdentifier_TC1425898() throws Exception {
-
- String csarFile = "LDSA-SINGLE.csar";
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- resourceMetaData.setVersion("0.1");
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, csarFile, getUser());
-
- Map<String, Object> artifactsFromCsar = ArtifactFromCsar.getVFCArtifacts(filePath + csarFile);
- List<String> vfcKeys = artifactsFromCsar.keySet().stream().filter(p -> p.contains("vfc")).collect(Collectors.toList());
- for (String key : vfcKeys) {
- VFCArtifactVerificator.setActualVfcArtifactList(key, resourceMetaData, getUser());
- }
-
- ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
- String[] artifactNamesFromFile = ArtifactFromCsar.getArtifactNamesFromCsar(filePath, csarFile);
- String[] artifactsFromFileBeforeUpdate = DeploymentArtifactPage.verifyArtifactsExistInTable(artifactNamesFromFile);
- DeploymentArtifactPage.getLeftMenu().moveToGeneralScreen();
-
- String updatedCsarFile = "LDSA-MULTI.csar";
- ResourceUIUtils.updateVfWithCsar(filePath, updatedCsarFile);
-
- Map<String, Object> updatedArtifactsFromCsar = ArtifactFromCsar.getVFCArtifacts(filePath + updatedCsarFile);
- List<String> updatedVfcKeys = updatedArtifactsFromCsar.keySet().stream().filter(p -> p.contains("vfc")).collect(Collectors.toList());
- for (String key : updatedVfcKeys) {
- verifyVfcInstanceArtifacts(resourceMetaData, null, updatedArtifactsFromCsar, key);
- if (vfcKeys.contains(key)) {
- VFCArtifactVerificator.verifyVFCArtifactNotChanged(key, resourceMetaData, getUser());
- }
- }
-
- ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
- DeploymentArtifactPage.verifyArtifactsExistInTable(artifactsFromFileBeforeUpdate);
- }
-
- @Test
- public void updateCsarWithVFCArtifacts_DeleteAll_TC1425581() throws Exception {
-
- String csarFile = "LDSA-ORIG.csar";
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT, ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
- resourceMetaData.setVersion("0.1");
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, csarFile, getUser());
-
- ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
- String[] artifactNamesFromFile = ArtifactFromCsar.getArtifactNamesFromCsar(filePath, csarFile);
- String[] artifactsFromFileBeforeUpdate = DeploymentArtifactPage.verifyArtifactsExistInTable(artifactNamesFromFile);
- DeploymentArtifactPage.getLeftMenu().moveToGeneralScreen();
-
- String updatedCsarFile = "LDSA-DELETE-ALL.csar";
- ResourceUIUtils.updateVfWithCsar(filePath, updatedCsarFile);
-
- VFCArtifactVerificator.verifyNoVfcArtifacts(resourceMetaData, getUser(), null);
-
- ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
- DeploymentArtifactPage.verifyArtifactsExistInTable(artifactsFromFileBeforeUpdate);
- }
-
- @Test
- public void importComplexVFCArtifacts_Onboarding_TC1484153() throws Exception {
-
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
-
- String vnfFile = "2016-043_vsaegw_fdnt_30_1607_e2e.zip";
- String snmpFile = "Fault-alarms-ASDC-vprobes-vLB.zip";
-
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
- VendorSoftwareProductObject createVSP = VendorSoftwareProductRestUtils.createVSP(resourceMetaData, vnfFile, filePath, getUser(),
- vendorLicenseModel);
- String vspName = createVSP.getName();
- resourceMetaData.setName(vspName);
-// VendorSoftwareProductObject resourceMeta = createVSP.right;
- String vspid = createVSP.getVspId();
- VendorSoftwareProductRestUtils.addVFCArtifacts(filePath, snmpFile, null, createVSP, getUser());
- VendorSoftwareProductRestUtils.prepareVspForUse(getUser(), createVSP, true);
-
- String downloadDirectory = getWindowTest().getDownloadDirectory();
- String csarFile = vspid + ".csar";
-
- DownloadManager.downloadCsarByNameFromVSPRepository(vspName, vspid);
- HomePage.showVspRepository();
- OnboardingUiUtils.importVSP(createVSP);
- resourceMetaData.setVersion("0.1");
-
- verifyVfcArtifacts(downloadDirectory, csarFile, resourceMetaData, null);
-
- ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
- DeploymentArtifactPage.verifyArtifactsExistInTable(filePath, vnfFile);
-
- }
-
- @Test
- public void updateComplexVFCArtifacts_AddRemove_Onboarding_TC1484185() throws Exception {
-
- //check of version is 1
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
-
- String vnfFile = "2016-043_vsaegw_fdnt_30_1607_e2e.zip";
- String snmpPollFile = "vprobes-vLB.zip";
- String updatedSnmpPollFile = "vprobes-vLBAgent.zip";
-
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
- VendorSoftwareProductObject createVSP = VendorSoftwareProductRestUtils.createVSP(resourceMetaData, vnfFile, filePath, getUser(),
- vendorLicenseModel);
- String vspName = createVSP.getName();
- resourceMetaData.setName(vspName);
- String vspid = createVSP.getVspId();
- String monitoringComponentId = VendorSoftwareProductRestUtils.addVFCArtifacts(filePath, snmpPollFile, null, createVSP, getUser());
- VendorSoftwareProductRestUtils.prepareVspForUse(getUser(), createVSP, true);
-
- String downloadDirectory = getWindowTest().getDownloadDirectory();
- String csarFile = vspid + ".csar";
-
- DownloadManager.downloadCsarByNameFromVSPRepository(vspName, vspid);
- HomePage.showVspRepository();
- OnboardingUiUtils.importVSP(createVSP);
- ResourceGeneralPage.clickCertifyButton(vspName);
-
- VendorSoftwareProductRestUtils.updateVspWithVfcArtifacts(filePath, updatedSnmpPollFile, null, monitoringComponentId, getUser(), createVSP);
- DownloadManager.downloadCsarByNameFromVSPRepository(vspName, vspid);
- HomePage.showVspRepository();
- OnboardingUiUtils.updateVSP(createVSP);
- resourceMetaData.setVersion("1.1");
-
- ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
- DeploymentArtifactPage.verifyArtifactsExistInTable(filePath, vnfFile);
-
- verifyVfcArtifacts(downloadDirectory, csarFile, resourceMetaData, null);
-
- }
-
- @Test
- public void updateComplexVFCArtifacts_Modify_Onboarding_TC1484195() throws Exception {
-
- //check of version is 2
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
-
- String vnfFile = "2016-043_vsaegw_fdnt_30_1607_e2e.zip";
- String snmpFile = "vprobes-vLB.zip";
- String updatedSnmpFile = "vprobes-vLB-Modified.zip";
-
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
- VendorSoftwareProductObject createVSP = VendorSoftwareProductRestUtils.createVSP(resourceMetaData, vnfFile, filePath, getUser(),
- vendorLicenseModel);
- String vspName = createVSP.getName();
- resourceMetaData.setName(vspName);
- String vspid = createVSP.getVspId();
- String monitoringId = VendorSoftwareProductRestUtils.addVFCArtifacts(filePath, snmpFile, null, createVSP, getUser());
- VendorSoftwareProductRestUtils.prepareVspForUse(getUser(), createVSP, true);
-
- String downloadDirectory = getWindowTest().getDownloadDirectory();
- String csarFile = vspid + ".csar";
-
- DownloadManager.downloadCsarByNameFromVSPRepository(vspName, vspid);
- HomePage.showVspRepository();
- OnboardingUiUtils.importVSP(createVSP);
-
- Map<String, Object> artifactsFromCsar = ArtifactFromCsar.getVFCArtifacts(downloadDirectory + csarFile);
- List<String> vfcKeys = artifactsFromCsar.keySet().stream().filter(p -> p.contains("vfc")).collect(Collectors.toList());
- for (String key : vfcKeys) {
- resourceMetaData.setVersion("0.1");
- VFCArtifactVerificator.setActualVfcArtifactList(key, resourceMetaData, getUser());
- }
-
- ResourceGeneralPage.clickCertifyButton(vspName);
- VendorSoftwareProductRestUtils.updateVspWithVfcArtifacts(filePath, updatedSnmpFile, null, monitoringId, getUser(), createVSP);
- DownloadManager.downloadCsarByNameFromVSPRepository(vspName, vspid);
- HomePage.showVspRepository();
- OnboardingUiUtils.updateVSP(createVSP);
- resourceMetaData.setVersion("1.1");
-
- ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
- DeploymentArtifactPage.verifyArtifactsExistInTable(filePath, vnfFile);
-
- Map<String, Object> artifactsFromCsarAfterUpdate = ArtifactFromCsar.getVFCArtifacts(downloadDirectory + csarFile);
- List<String> vfcKeysAfterUpdate = artifactsFromCsarAfterUpdate.keySet().stream().filter(p -> p.contains("vfc")).collect(Collectors.toList());
- for (String key : vfcKeysAfterUpdate) {
- verifyVfcInstanceArtifacts(resourceMetaData, null, artifactsFromCsarAfterUpdate, key);
- VFCArtifactVerificator.verifyVfcArtifactUpdated(key, resourceMetaData, getUser());
- }
-
- }
-
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-
- private Map<String, LinkedList<HeatMetaFirstLevelDefinition>> verifyVfcArtifacts(String filepath, String csarFile,
- ResourceReqDetails resourceMetaData, RestResponse getResponse) throws Exception {
-
- ExtentTestActions.log(Status.INFO, "Verifying VFC artifacts");
- Map<String, LinkedList<HeatMetaFirstLevelDefinition>> expectedArtifactMap = null;
- ExtentTestActions.log(Status.INFO, "Reading artifacts in CSAR file");
- Map<String, Object> artifactsFromCsar = ArtifactFromCsar.getVFCArtifacts(filepath + csarFile);
- List<String> vfcKeys = artifactsFromCsar.keySet().stream().filter(p -> p.contains("vfc")).collect(Collectors.toList());
- for (String key : vfcKeys) {
- expectedArtifactMap = verifyVfcInstanceArtifacts(resourceMetaData, getResponse, artifactsFromCsar, key);
- }
- return expectedArtifactMap;
- }
-
- private Map<String, LinkedList<HeatMetaFirstLevelDefinition>> verifyVfcInstanceArtifacts(
- ResourceReqDetails resourceMetaData, RestResponse getResponse, Map<String, Object> artifactsFromCsar, String key) {
-
- Map<String, LinkedList<HeatMetaFirstLevelDefinition>> expectedArtifactMap;
- Map<String, LinkedList<HeatMetaFirstLevelDefinition>> vfcDeploymentArtifacts = (Map<String, LinkedList<HeatMetaFirstLevelDefinition>>) artifactsFromCsar.get(key);
- LinkedList<HeatMetaFirstLevelDefinition> deploymentList = vfcDeploymentArtifacts.get(DEPLOYMENT);
- LinkedList<HeatMetaFirstLevelDefinition> informationalList = (LinkedList<HeatMetaFirstLevelDefinition>) vfcDeploymentArtifacts.get(INFORMATIONAL);
-
- expectedArtifactMap = new HashMap<String, LinkedList<HeatMetaFirstLevelDefinition>>();
- if (deploymentList == null) {
- expectedArtifactMap.put(DEPLOYMENT_ARTIFACTS, new LinkedList<HeatMetaFirstLevelDefinition>());
- } else {
- expectedArtifactMap.put(DEPLOYMENT_ARTIFACTS, deploymentList);
- }
- if (informationalList == null) {
- expectedArtifactMap.put(ARTIFACTS, new LinkedList<HeatMetaFirstLevelDefinition>());
- } else {
- expectedArtifactMap.put(ARTIFACTS, informationalList);
- }
-
- VFCArtifactVerificator.verifyVfcArtifacts(resourceMetaData, getUser(), key, expectedArtifactMap, getResponse);
- return expectedArtifactMap;
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Vf.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Vf.java
deleted file mode 100644
index 1bbebd3d66..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Vf.java
+++ /dev/null
@@ -1,526 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.sanity;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.ComponentInstance;
-import org.openecomp.sdc.be.model.LifecycleStateEnum;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactInfo;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.ArtifactPageEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.InformationalArtifactsPlaceholders;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.LeftPanelCanvasItems;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.ResourceMetadataEnum;
-import org.openecomp.sdc.ci.tests.datatypes.LifeCycleStateEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
-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.execute.setup.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.CompositionPage;
-import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.GeneralPageElements;
-import org.openecomp.sdc.ci.tests.pages.InformationalArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.PropertiesPage;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.pages.ToscaArtifactsPage;
-import org.openecomp.sdc.ci.tests.utilities.ArtifactUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.OnboardingUiUtils;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-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.ResourceRestUtils;
-import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
-import org.openecomp.sdc.ci.tests.verificator.ServiceVerificator;
-import org.openecomp.sdc.ci.tests.verificator.VfModuleVerificator;
-import org.openecomp.sdc.ci.tests.verificator.VfVerificator;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebElement;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.AssertJUnit;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import static org.junit.Assert.assertEquals;
-
-public class Vf extends SetupCDTest {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(Vf.class);
-
- private String filePath;
-
- @BeforeClass
- public void beforeClass() {
- filePath = FileHandling.getFilePath("");
- }
-
- @BeforeMethod
- public void beforeTest() {
- System.out.println("File repository is : " + filePath);
- getExtendTest().log(Status.INFO, "File repository is : " + filePath);
- }
-
-
- @Test
- public void vfcLinkedToComputeInVfFlow() throws Exception {
- String fileName = "vFW_VFC2.yml";
- ResourceReqDetails atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
-
- try {
- ResourceUIUtils.importVfc(atomicResourceMetaData, filePath, fileName, getUser());
- ResourceGeneralPage.clickCertifyButton(atomicResourceMetaData.getName());
-
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(vfMetaData, getUser());
-
- DeploymentArtifactPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
- CompositionPage.searchForElement(String.format("%s %s", LeftPanelCanvasItems.COMPUTE.getValue(), "1.0"));
- CanvasElement computeElement = canvasManager.createElementOnCanvas(LeftPanelCanvasItems.COMPUTE);
- CompositionPage.searchForElement(atomicResourceMetaData.getName());
- CanvasElement cpElement = canvasManager.createElementOnCanvas(atomicResourceMetaData.getName());
- AssertJUnit.assertNotNull(cpElement);
- ServiceVerificator.verifyNumOfComponentInstances(vfMetaData, "0.1", 2, getUser());
-
- canvasManager.linkElements(computeElement.getElementNameOnCanvas(), cpElement.getElementNameOnCanvas());
-
- vfMetaData.setVersion("0.1");
- VfVerificator.verifyLinkCreated(vfMetaData, getUser(), 1);
- } finally {
- ResourceRestUtils.deleteResourceByNameAndVersion(atomicResourceMetaData.getName(), "1.0");
- }
-
- }
-
- @Test
- public void addUpdateDeleteDeploymentArtifactToVfTest() throws Exception {
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(vfMetaData, getUser());
-
- ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
-
- List<ArtifactInfo> deploymentArtifactList = new ArrayList<>();
- deploymentArtifactList.add(new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", "OTHER"));
- deploymentArtifactList.add(new ArtifactInfo(filePath, "sample-xml-alldata-1-1.xml", "cuku", "artifact2", "YANG_XML"));
- for (ArtifactInfo deploymentArtifact : deploymentArtifactList) {
- DeploymentArtifactPage.clickAddNewArtifact();
- ArtifactUIUtils.fillAndAddNewArtifactParameters(deploymentArtifact);
- }
- AssertJUnit.assertTrue("artifact table does not contain artifacts uploaded", DeploymentArtifactPage.checkElementsCountInTable(deploymentArtifactList.size()));
-
- String newDescription = "new description";
- DeploymentArtifactPage.clickEditArtifact(deploymentArtifactList.get(0).getArtifactLabel());
- DeploymentArtifactPage.artifactPopup().insertDescription(newDescription);
- DeploymentArtifactPage.artifactPopup().clickDoneButton();
- String actualArtifactDescription = DeploymentArtifactPage.getArtifactDescription(deploymentArtifactList.get(0).getArtifactLabel());
- AssertJUnit.assertTrue("artifact description is not updated", newDescription.equals(actualArtifactDescription));
-
- DeploymentArtifactPage.clickDeleteArtifact(deploymentArtifactList.get(0).getArtifactLabel());
- DeploymentArtifactPage.clickOK();
- AssertJUnit.assertTrue("artifact " + deploymentArtifactList.get(0).getArtifactLabel() + "is not deleted", DeploymentArtifactPage.checkElementsCountInTable(deploymentArtifactList.size() - 1));
-
- AssertJUnit.assertTrue("artifact " + deploymentArtifactList.get(1).getArtifactLabel() + "is not displayed", DeploymentArtifactPage.clickOnArtifactDescription(deploymentArtifactList.get(1).getArtifactLabel()).isDisplayed());
- }
-
-
- @Test
- public void addUpdateDeleteInformationalArtifact() throws Exception {
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(vfMetaData, getUser());
-
- ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen();
-
- ArtifactInfo informationalArtifact = new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", "OTHER");
- InformationalArtifactPage.clickAddNewArtifact();
- ArtifactUIUtils.fillAndAddNewArtifactParameters(informationalArtifact);
-
- AssertJUnit.assertTrue("artifact table does not contain artifacts uploaded", InformationalArtifactPage.checkElementsCountInTable(1));
-
- String newDescription = "new description";
- InformationalArtifactPage.clickEditArtifact(informationalArtifact.getArtifactLabel());
- InformationalArtifactPage.artifactPopup().insertDescription(newDescription);
- InformationalArtifactPage.artifactPopup().clickDoneButton();
- String actualArtifactDescription = InformationalArtifactPage.getArtifactDescription(informationalArtifact.getArtifactLabel());
- AssertJUnit.assertTrue("artifact description is not updated", newDescription.equals(actualArtifactDescription));
-
- InformationalArtifactPage.clickDeleteArtifact(informationalArtifact.getArtifactLabel());
- InformationalArtifactPage.clickOK();
- AssertJUnit.assertTrue("artifact " + informationalArtifact.getArtifactLabel() + "is not deleted", InformationalArtifactPage.checkElementsCountInTable(0));
- }
-
-
- @Test
- public void addPropertiesToVfcInstanceInVfTest() throws Exception {
-
- if (true) {
-// throw new SkipException("Open bug 373762, can't update properties on CP or VFC instance on Composition screen");
- SetupCDTest.getExtendTest().log(Status.INFO, "Open bug 373762, can't update properties on CP or VFC instance on Composition screen");
- }
-
- String fileName = "vFW_VFC.yml";
- ResourceReqDetails atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
-
- try {
- ResourceUIUtils.importVfc(atomicResourceMetaData, filePath, fileName, getUser());
- ResourceGeneralPage.clickCheckinButton(atomicResourceMetaData.getName());
-
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(vfMetaData, getUser());
-
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager vfCanvasManager = CanvasManager.getCanvasManager();
- CompositionPage.searchForElement(atomicResourceMetaData.getName());
- CanvasElement vfcElement = vfCanvasManager.createElementOnCanvas(atomicResourceMetaData.getName());
-
- vfCanvasManager.clickOnCanvaElement(vfcElement);
- CompositionPage.showPropertiesAndAttributesTab();
- List<WebElement> properties = CompositionPage.getProperties();
- String propertyValue = "abc123";
- for (int i = 0; i < 2; i++) {
- WebElement findElement = properties.get(i).findElement(By.className("i-sdc-designer-sidebar-section-content-item-property-and-attribute-label"));
- findElement.click();
- PropertiesPage.getPropertyPopup().insertPropertyDefaultValue(propertyValue);
- PropertiesPage.getPropertyPopup().clickSave();
-
-
- findElement = properties.get(i).findElement(By.className("i-sdc-designer-sidebar-section-content-item-property-value"));
- AssertJUnit.assertTrue(findElement.getText().equals(propertyValue));
- }
- } finally {
- ResourceRestUtils.deleteResourceByNameAndVersion(atomicResourceMetaData.getName(), "0.1");
- }
- }
-
- @Test
- public void changeInstanceVersionTest() throws Exception {
-
- ResourceReqDetails atomicResourceMetaData = null;
- ResourceReqDetails vfMetaData = null;
- CanvasManager vfCanvasManager;
- CanvasElement vfcElement = null;
- String fileName = "vFW_VFC3.yml";
- try {
- atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
- ResourceUIUtils.importVfc(atomicResourceMetaData, filePath, fileName, getUser());
- ResourceGeneralPage.clickCheckinButton(atomicResourceMetaData.getName());
-
- vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(vfMetaData, getUser());
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- vfCanvasManager = CanvasManager.getCanvasManager();
- CompositionPage.searchForElement(atomicResourceMetaData.getName());
- vfcElement = vfCanvasManager.createElementOnCanvas(atomicResourceMetaData.getName());
-
- CompositionPage.clickCertifyButton(vfMetaData.getName());
- assert (false);
- } catch (Exception e) {
- String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
- String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.VALIDATED_RESOURCE_NOT_FOUND.name());
- AssertJUnit.assertTrue(errorMessage.contains(checkUIResponseOnError));
-
-
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- vfCanvasManager = CanvasManager.getCanvasManager();
- CompositionPage.changeComponentVersion(vfCanvasManager, vfcElement, "1.0");
-
- //verfication
- VfVerificator.verifyInstanceVersion(vfMetaData, getUser(), atomicResourceMetaData.getName(), "1.0");
- } finally {
- ResourceRestUtils.deleteResourceByNameAndVersion(atomicResourceMetaData.getName(), "1.0");
- }
-
- }
-
-
- @Test
- public void addAllInformationalArtifactPlaceholdersInVfTest() throws Exception {
-
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
- ResourceUIUtils.createVF(vfMetaData, getUser());
-
- ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen();
-
- for (InformationalArtifactsPlaceholders informArtifact : InformationalArtifactsPlaceholders.values()) {
- ArtifactUIUtils.fillPlaceHolderInformationalArtifact(informArtifact, filePath, "asc_heat 0 2.yaml", informArtifact.getValue());
- }
-
- AssertJUnit.assertTrue(InformationalArtifactPage.checkElementsCountInTable(InformationalArtifactsPlaceholders.values().length));
- }
-
- @Test
- public void verifyToscaArtifactsExist() throws Exception {
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(vfMetaData, getUser());
-
- final int numOfToscaArtifacts = 2;
- ResourceGeneralPage.getLeftMenu().moveToToscaArtifactsScreen();
- AssertJUnit.assertTrue(ToscaArtifactsPage.checkElementsCountInTable(numOfToscaArtifacts));
-
- for (int i = 0; i < numOfToscaArtifacts; i++) {
- String typeFromScreen = ToscaArtifactsPage.getArtifactType(i);
- AssertJUnit.assertTrue(typeFromScreen.equals(ArtifactTypeEnum.TOSCA_CSAR.getType()) || typeFromScreen.equals(ArtifactTypeEnum.TOSCA_TEMPLATE.getType()));
- }
- ToscaArtifactsPage.clickCertifyButton(vfMetaData.getName());
- VfVerificator.verifyToscaArtifactsInfo(vfMetaData, getUser());
- }
-
- @Test
- public void vfCertificationTest() throws Exception {
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(vfMetaData, getUser());
-
- String vfName = vfMetaData.getName();
-
- ResourceGeneralPage.clickCheckinButton(vfName);
- GeneralUIUtils.findComponentAndClick(vfName);
- ResourceGeneralPage.clickCertifyButton(vfName);
-
- vfMetaData.setVersion("1.0");
- VfVerificator.verifyVFLifecycle(vfMetaData, getUser(), LifecycleStateEnum.CERTIFIED);
-
- GeneralUIUtils.findComponentAndClick(vfName);
- VfVerificator.verifyVfLifecycleInUI(LifeCycleStateEnum.CERTIFIED);
- }
-
- @Test
- public void deleteVfCheckedoutTest() throws Exception {
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(vfMetaData, getUser());
-
- GeneralPageElements.clickTrashButtonAndConfirm();
-
- vfMetaData.setVersion("0.1");
- VfVerificator.verifyVfDeleted(vfMetaData, getUser());
- }
-
- @Test
- public void revertVfMetadataTest() throws Exception {
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(vfMetaData, getUser());
-
- ResourceReqDetails vfRevertDetails = new ResourceReqDetails();
- vfRevertDetails.setName("ciUpdatedName");
- vfRevertDetails.setDescription("kuku");
- vfRevertDetails.setCategories(vfMetaData.getCategories());
- vfRevertDetails.setVendorName("updatedVendor");
- vfRevertDetails.setVendorRelease("updatedRelease");
- ResourceUIUtils.fillResourceGeneralInformationPage(vfRevertDetails, getUser(), false);
-
- GeneralPageElements.clickRevertButton();
-
- VfVerificator.verifyVFMetadataInUI(vfMetaData);
-
- }
-
- @Test
- public void addDeploymentArtifactInCompositionScreenTest() throws Exception {
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(vfMetaData, getUser());
-
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
-
- ArtifactInfo artifact = new ArtifactInfo(filePath, "Heat-File.yaml", "kuku", "artifact3", "OTHER");
- CompositionPage.showDeploymentArtifactTab();
- CompositionPage.clickAddArtifactButton();
- ArtifactUIUtils.fillAndAddNewArtifactParameters(artifact, CompositionPage.artifactPopup());
-
- List<WebElement> actualArtifactList = GeneralUIUtils.getWebElementsListBy(By.className("i-sdc-designer-sidebar-section-content-item-artifact"));
- AssertJUnit.assertEquals(1, actualArtifactList.size());
- }
-
- // future removed from ui
-
- @Test
- public void addDeploymentArtifactAndVerifyInCompositionScreen() throws Exception {
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(vfMetaData, getUser());
-
- ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
-
- ArtifactInfo deploymentArtifact = new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", "OTHER");
- DeploymentArtifactPage.clickAddNewArtifact();
- ArtifactUIUtils.fillAndAddNewArtifactParameters(deploymentArtifact);
- AssertJUnit.assertTrue(DeploymentArtifactPage.checkElementsCountInTable(1));
-
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
-
- CompositionPage.showDeploymentArtifactTab();
- List<WebElement> deploymentArtifactsFromScreen = CompositionPage.getDeploymentArtifacts();
- AssertJUnit.assertTrue(1 == deploymentArtifactsFromScreen.size());
-
- String actualArtifactFileName = deploymentArtifactsFromScreen.get(0).getText();
- AssertJUnit.assertTrue("asc_heat-0-2.yaml".equals(actualArtifactFileName));
- }
-
- @Test
- public void checkoutVfTest() throws Exception {
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(vfMetaData, getUser());
-
- ResourceGeneralPage.clickCheckinButton(vfMetaData.getName());
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
- GeneralPageElements.clickCheckoutButton();
-
- vfMetaData.setVersion("0.2");
- VfVerificator.verifyVFLifecycle(vfMetaData, getUser(), LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
- VfVerificator.verifyVfLifecycleInUI(LifeCycleStateEnum.CHECKOUT);
-
- ResourceGeneralPage.clickCertifyButton(vfMetaData.getName());
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
- ResourceGeneralPage.clickCheckoutButton();
-
- vfMetaData.setVersion("1.1");
- vfMetaData.setUniqueId(null);
- VfVerificator.verifyVFLifecycle(vfMetaData, getUser(), LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
- VfVerificator.verifyVfLifecycleInUI(LifeCycleStateEnum.CHECKOUT);
- }
-
- @Test
- public void deleteInstanceFromVfCanvas() throws Exception {
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(vfMetaData, getUser());
-
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager vfCanvasManager = CanvasManager.getCanvasManager();
- CanvasElement computeElement = vfCanvasManager.createElementOnCanvas(LeftPanelCanvasItems.COMPUTE);
- CanvasElement portElement = vfCanvasManager.createElementOnCanvas(LeftPanelCanvasItems.PORT);
-
- vfCanvasManager.clickOnCanvaElement(computeElement);
- vfCanvasManager.deleteElementFromCanvas(computeElement);
-
- VfVerificator.verifyNumOfComponentInstances(vfMetaData, 1, getUser());
- }
-
- @Test
- public void changeInstanceNameInVfTest() throws Exception {
- final ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(vfMetaData, getUser());
- Resource containerObject = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, vfMetaData.getName(), vfMetaData.getVersion());
- Resource computeObject = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, "Compute", "1.0");
- ComponentInstance componentInstanceDetails = AtomicOperationUtils.addComponentInstanceToComponentContainer(computeObject, containerObject, UserRoleEnum.DESIGNER, true).left().value();
- containerObject = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, vfMetaData.getName(), vfMetaData.getVersion());
- String intanceWithUpdatedName = AtomicOperationUtils.updateComponentInstanceName("newName", containerObject, componentInstanceDetails.getName(), getUser(), true).getRight().getName();
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- assertEquals(intanceWithUpdatedName, "newName");
- }
-
- @Test
- public void submitVfForTestingWithNonCertifiedAsset() throws Exception {
- String fileName = "vFW_VFC4.yml";
-
- ResourceReqDetails atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
- ResourceUIUtils.importVfc(atomicResourceMetaData, filePath, fileName, getUser());
- ResourceGeneralPage.clickCheckinButton(atomicResourceMetaData.getName());
-
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(vfMetaData, getUser());
- DeploymentArtifactPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
- CompositionPage.searchForElement(atomicResourceMetaData.getName());
- canvasManager.createElementOnCanvas(atomicResourceMetaData.getName());
-
- try {
- CompositionPage.clickCertifyButton(vfMetaData.getName());
- assert (false);
- } catch (Exception e) {
- String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
- String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.VALIDATED_RESOURCE_NOT_FOUND.name());
- AssertJUnit.assertTrue(errorMessage.contains(checkUIResponseOnError));
- } finally {
- ResourceRestUtils.deleteResourceByNameAndVersion(atomicResourceMetaData.getName(), "0.1");
- }
- }
-
- @Test
- public void isDisabledAndReadOnlyInCheckin() throws Exception {
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(vfMetaData, getUser());
- ResourceGeneralPage.clickCheckinButton(vfMetaData.getName());
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
-
- ResourceMetadataEnum[] fieldsForCheck = {ResourceMetadataEnum.RESOURCE_NAME,
- ResourceMetadataEnum.DESCRIPTION, ResourceMetadataEnum.VENDOR_NAME, ResourceMetadataEnum.VENDOR_RELEASE,
- ResourceMetadataEnum.CONTACT_ID};
-
- for (ResourceMetadataEnum field : fieldsForCheck) {
- AssertJUnit.assertTrue(GeneralUIUtils.isElementReadOnly(field.getValue()));
- }
-
- AssertJUnit.assertTrue(GeneralUIUtils.isElementDisabled(ResourceMetadataEnum.CATEGORY.getValue()));
- AssertJUnit.assertTrue(GeneralUIUtils.isElementDisabled(DataTestIdEnum.LifeCyleChangeButtons.CREATE.getValue()));
- }
-
- @Test
- public void exportToscaWithModulePropertiesVFTest() throws Exception {
- String vnfFile = "1-Vf-zrdm5bpxmc02-092017-(MOBILITY)_v2.0.zip";
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();//getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject vendorSoftwareProductObject = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, FileHandling.getVnfRepositoryPath(), vnfFile, getUser());
- String vspName = vendorSoftwareProductObject.getName();
- ResourceGeneralPage.clickSubmitForTestingButton(vspName);
- Resource resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, vspName, "0.1");
- VfModuleVerificator.validateSpecificModulePropertiesFromRequest(resource);
- }
-
- @Test
- public void canvasTestJS() throws Exception {
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(vfMetaData, getUser());
-
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
- CanvasElement computeElement = canvasManager.createElementOnCanvas(LeftPanelCanvasItems.COMPUTE);
- CanvasElement portElement = canvasManager.createElementOnCanvas(LeftPanelCanvasItems.PORT);
-
- canvasManager.linkElements(computeElement.getElementNameOnCanvas(), portElement.getElementNameOnCanvas());
-
- }
-
- private void takeScreenshot(final String screenshotName, final String errorMsg) {
- try {
- ExtentTestActions.addScreenshot(Status.ERROR, screenshotName, errorMsg);
- } catch (final IOException e) {
- LOGGER.warn("Could not take screenshot", e);
- }
- }
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VfAPI.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VfAPI.java
deleted file mode 100644
index accea723b8..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VfAPI.java
+++ /dev/null
@@ -1,780 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.sanity;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactInfo;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.InformationalArtifactsPlaceholders;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.LeftPanelCanvasItems;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.ResourceMetadataEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.ToscaArtifactsScreenEnum;
-import org.openecomp.sdc.ci.tests.datatypes.LifeCycleStateEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.TopMenuButtonsEnum;
-import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
-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.PropertyTypeEnum;
-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.http.RestResponse;
-import org.openecomp.sdc.ci.tests.execute.setup.AttFtpClient;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.CompositionPage;
-import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.GeneralPageElements;
-import org.openecomp.sdc.ci.tests.pages.HomePage;
-import org.openecomp.sdc.ci.tests.pages.InformationalArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.InputsPage;
-import org.openecomp.sdc.ci.tests.pages.PropertiesPage;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.pages.ToscaArtifactsPage;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaDefinition;
-import org.openecomp.sdc.ci.tests.utilities.ArtifactUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.CatalogUIUtilitis;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.OnboardingUiUtils;
-import org.openecomp.sdc.ci.tests.utilities.PropertiesUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.RestCDUtils;
-import org.openecomp.sdc.ci.tests.utils.ToscaParserUtils;
-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.ResourceRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.openecomp.sdc.ci.tests.verificator.ServiceVerificator;
-import org.openecomp.sdc.ci.tests.verificator.VfModuleVerificator;
-import org.openecomp.sdc.ci.tests.verificator.VfVerificator;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebElement;
-import org.testng.AssertJUnit;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-
-public class VfAPI extends SetupCDTest {
-
- private String filePath;
-
- @BeforeClass
- public void beforeClass() {
- filePath = FileHandling.getFilePath("");
- }
-
- @BeforeMethod
- public void beforeTest() {
- System.out.println("File repository is : " + filePath);
- getExtendTest().log(Status.INFO, "File repository is : " + filePath);
- }
-
- private ResourceReqDetails createVFviaAPI() {
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating VF %s", vfMetaData.getName()));
- AtomicOperationUtils.createResourceByResourceDetails(vfMetaData, UserRoleEnum.DESIGNER, true).left().value();
- return vfMetaData;
- }
-
-
- @Test
- public void updateVF() throws Exception {
-
- // create Resource
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(resourceMetaData, getUser());
-
- // update Resource
- ResourceReqDetails updatedResource = new ResourceReqDetails();
- updatedResource.setName(ElementFactory.getResourcePrefix() + "UpdatedName" + resourceMetaData.getName());
- updatedResource.setDescription("kuku");
- updatedResource.setVendorName("updatedVendor");
- updatedResource.setVendorRelease("updatedRelease");
- updatedResource.setContactId("ab0001");
- updatedResource.setCategories(resourceMetaData.getCategories());
- updatedResource.setVersion("0.1");
- updatedResource.setResourceType(ResourceTypeEnum.VF.getValue());
- List<String> newTags = resourceMetaData.getTags();
- newTags.remove(resourceMetaData.getName());
- newTags.add(updatedResource.getName());
- updatedResource.setTags(newTags);
- ResourceUIUtils.updateResource(updatedResource, getUser());
-
- VfVerificator.verifyVFMetadataInUI(updatedResource);
- VfVerificator.verifyVFUpdated(updatedResource, getUser());
- }
-
-
- @Test
- public void vfcLinkedToComputeInVfFlowApi() throws Exception {
- String fileName = "vFW_VFC2.yml";
- ResourceReqDetails atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
-
- try {
- //Create VFC via API
- Resource vfc = AtomicOperationUtils.importResource(filePath, fileName).left().value();
- atomicResourceMetaData.setName(vfc.getName());
-
- //Certify VFC via API
- vfc = (Resource) AtomicOperationUtils.changeComponentState(vfc, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- //Create VF via API
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- AtomicOperationUtils.createResourceByResourceDetails(vfMetaData, UserRoleEnum.DESIGNER, true).left().value();
-
- //Go to Catalog and find the created VF
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
-
- //Composition - drag the created VFC and another element, link between them
- DeploymentArtifactPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
- CompositionPage.searchForElement(String.format("%s %s", LeftPanelCanvasItems.COMPUTE.getValue(), "1.0"));
- CanvasElement computeElement = canvasManager.createElementOnCanvas(LeftPanelCanvasItems.COMPUTE);
- CompositionPage.searchForElement(atomicResourceMetaData.getName());
- CanvasElement cpElement = canvasManager.createElementOnCanvas(atomicResourceMetaData.getName());
- AssertJUnit.assertNotNull(cpElement);
- ServiceVerificator.verifyNumOfComponentInstances(vfMetaData, "0.1", 2, getUser());
- canvasManager.linkElements(cpElement, computeElement);
-
- vfMetaData.setVersion("0.1");
- VfVerificator.verifyLinkCreated(vfMetaData, getUser(), 1);
- } finally {
- ResourceRestUtils.deleteResourceByNameAndVersion(atomicResourceMetaData.getName(), "1.0");
- }
-
- }
-
-
- @Test
- public void addUpdateDeleteDeploymentArtifactToVfTestApi() throws Exception {
- //Create VF via API
- ResourceReqDetails vfMetaData = createVFviaAPI();
-
- //Go to Catalog and find the created VF
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
-
- ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
-
- List<ArtifactInfo> deploymentArtifactList = new ArrayList<ArtifactInfo>();
- deploymentArtifactList.add(new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", "OTHER"));
- deploymentArtifactList.add(new ArtifactInfo(filePath, "sample-xml-alldata-1-1.xml", "cuku", "artifact2", "YANG_XML"));
- for (ArtifactInfo deploymentArtifact : deploymentArtifactList) {
- DeploymentArtifactPage.clickAddNewArtifact();
- ArtifactUIUtils.fillAndAddNewArtifactParameters(deploymentArtifact);
- }
- AssertJUnit.assertTrue("artifact table does not contain artifacts uploaded", DeploymentArtifactPage.checkElementsCountInTable(deploymentArtifactList.size()));
-
- String newDescription = "new description";
- DeploymentArtifactPage.clickEditArtifact(deploymentArtifactList.get(0).getArtifactLabel());
- DeploymentArtifactPage.artifactPopup().insertDescription(newDescription);
- DeploymentArtifactPage.artifactPopup().clickDoneButton();
- String actualArtifactDescription = DeploymentArtifactPage.getArtifactDescription(deploymentArtifactList.get(0).getArtifactLabel());
- AssertJUnit.assertTrue("artifact description is not updated", newDescription.equals(actualArtifactDescription));
-
- DeploymentArtifactPage.clickDeleteArtifact(deploymentArtifactList.get(0).getArtifactLabel());
- DeploymentArtifactPage.clickOK();
- AssertJUnit.assertTrue("artifact " + deploymentArtifactList.get(0).getArtifactLabel() + "is not deleted", DeploymentArtifactPage.checkElementsCountInTable(deploymentArtifactList.size() - 1));
-
- AssertJUnit.assertTrue("artifact " + deploymentArtifactList.get(1).getArtifactLabel() + "is not displayed", DeploymentArtifactPage.clickOnArtifactDescription(deploymentArtifactList.get(1).getArtifactLabel()).isDisplayed());
- }
-
-
- @Test
- public void addUpdateDeleteInformationalArtifactApi() throws Exception {
- //Create VF via API
- ResourceReqDetails vfMetaData = createVFviaAPI();
-
- //Go to Catalog and find the created VF
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
-
- ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen();
-
- ArtifactInfo informationalArtifact = new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", "OTHER");
- InformationalArtifactPage.clickAddNewArtifact();
- ArtifactUIUtils.fillAndAddNewArtifactParameters(informationalArtifact);
-
- AssertJUnit.assertTrue("artifact table does not contain artifacts uploaded", InformationalArtifactPage.checkElementsCountInTable(1));
-
- String newDescription = "new description";
- InformationalArtifactPage.clickEditArtifact(informationalArtifact.getArtifactLabel());
- InformationalArtifactPage.artifactPopup().insertDescription(newDescription);
- InformationalArtifactPage.artifactPopup().clickDoneButton();
- String actualArtifactDescription = InformationalArtifactPage.getArtifactDescription(informationalArtifact.getArtifactLabel());
- AssertJUnit.assertTrue("artifact description is not updated", newDescription.equals(actualArtifactDescription));
-
- InformationalArtifactPage.clickDeleteArtifact(informationalArtifact.getArtifactLabel());
- InformationalArtifactPage.clickOK();
- AssertJUnit.assertTrue("artifact " + informationalArtifact.getArtifactLabel() + "is not deleted", InformationalArtifactPage.checkElementsCountInTable(0));
- }
-
-
- @Test
- public void addPropertiesToVfcInstanceInVfTestApi() throws Exception {
-
- String fileName = "vFW_VFC.yml";
- ResourceReqDetails atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
-
- try {
- //Create VFC via API
- Resource vfc = AtomicOperationUtils.importResource(filePath, fileName).left().value();
- atomicResourceMetaData.setName(vfc.getName());
-
- //Certify VFC via API
- vfc = (Resource) AtomicOperationUtils.changeComponentState(vfc, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- //Create VF via API
- ResourceReqDetails vfMetaData = createVFviaAPI();
-
- //Go to Catalog and find the created VF
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
-
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager vfCanvasManager = CanvasManager.getCanvasManager();
- CompositionPage.searchForElement(atomicResourceMetaData.getName());
- CanvasElement vfcElement = vfCanvasManager.createElementOnCanvas(atomicResourceMetaData.getName());
-
- vfCanvasManager.clickOnCanvaElement(vfcElement);
- CompositionPage.showPropertiesAndAttributesTab();
- List<WebElement> properties = CompositionPage.getProperties();
- String propertyValue = "abc123";
- for (int i = 0; i < 2; i++) {
- WebElement findElement = properties.get(i).findElement(By.className("i-sdc-designer-sidebar-section-content-item-property-and-attribute-label"));
- findElement.click();
- PropertiesPage.getPropertyPopup().insertPropertyDefaultValue(propertyValue);
- PropertiesPage.getPropertyPopup().clickSave();
-
-
- findElement = properties.get(i).findElement(By.className("i-sdc-designer-sidebar-section-content-item-property-value"));
- AssertJUnit.assertTrue(findElement.getText().equals(propertyValue));
- }
- } finally {
- ResourceRestUtils.deleteResourceByNameAndVersion(atomicResourceMetaData.getName(), "0.1");
- }
- }
-
-/* @Test
- public void changeInstanceVersionTest() throws Exception{
-
- ResourceReqDetails atomicResourceMetaData = null;
- ResourceReqDetails vfMetaData = null;
- CanvasManager vfCanvasManager;
- CanvasElement vfcElement = null;
- String fileName = "vFW_VFC3.yml";
- try{
- atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
- ResourceUIUtils.importVfc(atomicResourceMetaData, filePath, fileName, getUser());
- ResourceGeneralPage.clickSubmitForTestingButton(atomicResourceMetaData.getName());
-
- vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(vfMetaData, getUser());
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- vfCanvasManager = CanvasManager.getCanvasManager();
- CompositionPage.searchForElement(atomicResourceMetaData.getName());
- vfcElement = vfCanvasManager.createElementOnCanvas(atomicResourceMetaData.getName());
-
-
- CompositionPage.clickSubmitForTestingButton(vfMetaData.getName());
- assert(false);
- }
- catch(Exception e){
- String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
- String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.VALIDATED_RESOURCE_NOT_FOUND.name());
- AssertJUnit.assertTrue(errorMessage.contains(checkUIResponseOnError));
-
-
- reloginWithNewRole(UserRoleEnum.TESTER);
- GeneralUIUtils.findComponentAndClick(atomicResourceMetaData.getName());
- TesterOperationPage.certifyComponent(atomicResourceMetaData.getName());
-
- reloginWithNewRole(UserRoleEnum.DESIGNER);
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- vfCanvasManager = CanvasManager.getCanvasManager();
- CompositionPage.changeComponentVersion(vfCanvasManager, vfcElement, "1.0");
-
- //verification
- VfVerificator.verifyInstanceVersion(vfMetaData, getUser(), atomicResourceMetaData.getName(), "1.0");
- }
-
- finally{
- ResourceRestUtils.deleteResourceByNameAndVersion(atomicResourceMetaData.getName(), "1.0");
- }
-
- }*/
-
- // future removed from ui
- @Test(enabled = true)
- public void addUpdateDeleteSimplePropertiesToVfTest() throws Exception {
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(vfMetaData, getUser());
-
- ResourceGeneralPage.getLeftMenu().moveToPropertiesScreen();
- List<PropertyTypeEnum> propertyList = Arrays.asList(PropertyTypeEnum.STRING, PropertyTypeEnum.INTEGER);
- int propertiesCount = PropertiesPage.getElemenetsFromTable().size();
- for (PropertyTypeEnum prop : propertyList) {
- PropertiesUIUtils.addNewProperty(prop);
- }
- AssertJUnit.assertTrue(GeneralUIUtils.checkElementsCountInTable(propertiesCount + propertyList.size(), () -> PropertiesPage.getElemenetsFromTable()));
- VfVerificator.verifyPropertiesInUI(propertyList);
- PropertiesPage.verifyTotalProperitesField(propertiesCount + propertyList.size());
-
-
- PropertyTypeEnum prop = propertyList.get(0);
- prop.setDescription("updatedDescription");
- prop.setValue("value");
- PropertiesUIUtils.updateProperty(prop);
-
- PropertiesPage.clickDeletePropertyArtifact(prop.getName());
- AssertJUnit.assertTrue(GeneralUIUtils.checkElementsCountInTable(propertiesCount + propertyList.size() - 1, () -> PropertiesPage.getElemenetsFromTable()));
- }
-
- // future removed from ui
- @Test(enabled = true)
- public void vfcInstancesInputScreenTest() throws Exception {
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(vfMetaData, getUser());
-
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager vfCanvasManager = CanvasManager.getCanvasManager();
-
- Map<String, String> elementsIntancesMap = new HashMap<String, String>();
- for (LeftPanelCanvasItems element : Arrays.asList(LeftPanelCanvasItems.DATABASE, LeftPanelCanvasItems.BLOCK_STORAGE)) {
- CanvasElement elementOnCanvas = vfCanvasManager.createElementOnCanvas(element);
- vfCanvasManager.clickOnCanvaElement(elementOnCanvas);
- String selectedInstanceName = CompositionPage.getSelectedInstanceName();
- elementsIntancesMap.put(selectedInstanceName, element.getValue());
- }
-
- CompositionPage.moveToInputsScreen();
- int canvasElementsSize = vfCanvasManager.getCanvasElements().size();
- AssertJUnit.assertTrue("Instances count is not as expected: " + canvasElementsSize, InputsPage.checkElementsCountInTable(canvasElementsSize));
-
- for (String element : elementsIntancesMap.keySet()) {
- String resourceName = elementsIntancesMap.get(element);
- ResourceReqDetails resource = new ResourceReqDetails();
- resource.setName(resourceName);
- resource.setVersion("1.0");
- resource.setResourceType(ResourceTypeEnum.VFC.toString());
- RestResponse restResponse = RestCDUtils.getResource(resource, getUser());
- Map<String, String> propertiesNameTypeJson = ResponseParser.getPropertiesNameType(restResponse);
-
- List<WebElement> propertyRowsFromTable = InputsPage.getInstancePropertiesList(element);
- AssertJUnit.assertTrue("Some properties are missing in table. Instance name is : " + element, propertyRowsFromTable.size() == propertiesNameTypeJson.size());
- VfVerificator.verifyVfInputs(element, propertiesNameTypeJson, propertyRowsFromTable);
-
- GeneralUIUtils.clickOnElementByText(element);
- }
-
- }
-
-
- @Test
- public void addAllInformationalArtifactPlaceholdersInVfTestApi() throws Exception {
- //Create VF via API
- ResourceReqDetails vfMetaData = createVFviaAPI();
- //Go to Catalog and find the created VF
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
-
- ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen();
- int fileNameCounter = 0;
- String fileName;
- for (InformationalArtifactsPlaceholders informArtifact : InformationalArtifactsPlaceholders.values()) {
- fileName = HEAT_FILE_YAML_NAME_PREFIX + fileNameCounter + HEAT_FILE_YAML_NAME_SUFFIX;
- ArtifactUIUtils.fillPlaceHolderInformationalArtifact(informArtifact,
- FileHandling.getFilePath("uniqueFileNames"), fileName,
- informArtifact.getValue());
- fileNameCounter++;
- }
- assertThat(InformationalArtifactPage.checkElementsCountInTable(InformationalArtifactsPlaceholders.values().length)).isTrue();
- }
-
- @Test
- public void verifyToscaArtifactsExistApi() throws Exception {
- //Create VF via API
- ResourceReqDetails vfMetaData = createVFviaAPI();
-
- //Go to Catalog and find the created VF
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
-
- final int numOfToscaArtifacts = 2;
- ResourceGeneralPage.getLeftMenu().moveToToscaArtifactsScreen();
- AssertJUnit.assertTrue(ToscaArtifactsPage.checkElementsCountInTable(numOfToscaArtifacts));
-
- for (int i = 0; i < numOfToscaArtifacts; i++) {
- String typeFromScreen = ToscaArtifactsPage.getArtifactType(i);
- AssertJUnit.assertTrue(typeFromScreen.equals(ArtifactTypeEnum.TOSCA_CSAR.getType()) || typeFromScreen.equals(ArtifactTypeEnum.TOSCA_TEMPLATE.getType()));
- }
-
- //TODO Andrey should click on certify button
- ToscaArtifactsPage.clickCertifyButton(vfMetaData.getName());
- vfMetaData.setVersion("1.0");
- VfVerificator.verifyToscaArtifactsInfo(vfMetaData, getUser());
- }
-
- @Test(enabled = true)
- public void testDownload() throws Exception {
-// ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
-// ResourceUIUtils.createResource(vfMetaData, getUser());
-//
-// final int numOfToscaArtifacts = 2;
-// ResourceGeneralPage.getLeftMenu().moveToToscaArtifactsScreen();
-// assertTrue(ToscaArtifactsPage.checkElementsCountInTable(numOfToscaArtifacts));
-// GeneralUIUtils.clickOnElementByTestId("download-Tosca Model");
-// System.out.println("download me");
-
- AttFtpClient attFtpClient = AttFtpClient.getFtpClient();
-
- File retrieveLastModifiedFileFromFTP = attFtpClient.retrieveLastModifiedFileFromFTP();
- attFtpClient.deleteFilesFromFTPserver();
- }
-
- @Test
- public void vfCertificationTestApi() throws Exception {
- //Create VF via API
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- Resource vf = AtomicOperationUtils.createResourceByResourceDetails(vfMetaData, UserRoleEnum.DESIGNER, true).left().value();
-
- //Certify VF via API
- vf = (Resource) AtomicOperationUtils.changeComponentState(vf, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
-
- //Go to Catalog and find the created VF
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
-
- VfVerificator.verifyVfLifecycleInUI(LifeCycleStateEnum.CERTIFIED);
- }
-
- @Test
- public void deleteVfCheckedoutTestApi() throws Exception {
- //Create VF via API
- ResourceReqDetails vfMetaData = createVFviaAPI();
-
- //Go to Catalog and find the created VF
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
-
- GeneralPageElements.clickTrashButtonAndConfirm();
-
- vfMetaData.setVersion("0.1");
- VfVerificator.verifyVfDeleted(vfMetaData, getUser());
- }
-
- @Test
- public void revertVfMetadataTestApi() throws Exception {
- //Create VF via API
- ResourceReqDetails vfMetaData = createVFviaAPI();
-
- //Go to Catalog and find the created VF
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
-
- ResourceReqDetails vfRevertDetails = new ResourceReqDetails();
- vfRevertDetails.setName("ciUpdatedName");
- vfRevertDetails.setDescription("kuku");
- vfRevertDetails.setCategories(vfMetaData.getCategories());
- vfRevertDetails.setVendorName("updatedVendor");
- vfRevertDetails.setVendorRelease("updatedRelease");
- ResourceUIUtils.fillResourceGeneralInformationPage(vfRevertDetails, getUser(), false);
-
- GeneralPageElements.clickRevertButton();
-
- VfVerificator.verifyVFMetadataInUI(vfMetaData);
-
- }
-
- @Test
- public void addDeploymentArtifactInCompositionScreenTestApi() throws Exception {
- //Create VF via API
- ResourceReqDetails vfMetaData = createVFviaAPI();
-
- //Go to Catalog and find the created VF
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
-
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
-
- ArtifactInfo artifact = new ArtifactInfo(filePath, "Heat-File.yaml", "kuku", "artifact3", "OTHER");
- CompositionPage.showDeploymentArtifactTab();
- CompositionPage.clickAddArtifactButton();
- ArtifactUIUtils.fillAndAddNewArtifactParameters(artifact, CompositionPage.artifactPopup());
-
- List<WebElement> actualArtifactList = GeneralUIUtils.getWebElementsListBy(By.className("i-sdc-designer-sidebar-section-content-item-artifact"));
- AssertJUnit.assertEquals(1, actualArtifactList.size());
- }
-
- // future removed from ui
- @Test(enabled = true)
- public void addPropertyInCompositionScreenTest() throws Exception {
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(vfMetaData, getUser());
-
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
-
- CompositionPage.showPropertiesAndAttributesTab();
- List<PropertyTypeEnum> propertyList = Arrays.asList(PropertyTypeEnum.STRING, PropertyTypeEnum.INTEGER);
- int propertiesCount = CompositionPage.getProperties().size();
- for (PropertyTypeEnum prop : propertyList) {
- PropertiesUIUtils.addNewProperty(prop);
- }
- AssertJUnit.assertTrue(GeneralUIUtils.checkElementsCountInTable(propertiesCount + propertyList.size(), () -> CompositionPage.getProperties()));
- }
-
- @Test
- public void addDeploymentArtifactAndVerifyInCompositionScreenApi() throws Exception {
- //Create VF via API
- ResourceReqDetails vfMetaData = createVFviaAPI();
-
- //Go to Catalog and find the created VF
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
-
- ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
-
- ArtifactInfo deploymentArtifact = new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", "OTHER");
- DeploymentArtifactPage.clickAddNewArtifact();
- ArtifactUIUtils.fillAndAddNewArtifactParameters(deploymentArtifact);
- AssertJUnit.assertTrue(DeploymentArtifactPage.checkElementsCountInTable(1));
-
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
-
- CompositionPage.showDeploymentArtifactTab();
- List<WebElement> deploymentArtifactsFromScreen = CompositionPage.getDeploymentArtifacts();
- AssertJUnit.assertTrue(1 == deploymentArtifactsFromScreen.size());
-
- String actualArtifactFileName = deploymentArtifactsFromScreen.get(0).getText();
- AssertJUnit.assertTrue("asc_heat-0-2.yaml".equals(actualArtifactFileName));
- }
-
- /*@Test
- public void checkoutVfTest() throws Exception{
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.createVF(vfMetaData, getUser());
-
- ResourceGeneralPage.clickCheckinButton(vfMetaData.getName());
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
- GeneralPageElements.clickCheckoutButton();
-
- vfMetaData.setVersion("0.2");
- VfVerificator.verifyVFLifecycle(vfMetaData, getUser(), LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
- VfVerificator.verifyVfLifecycleInUI(LifeCycleStateEnum.CHECKOUT);
-
- ResourceGeneralPage.clickSubmitForTestingButton(vfMetaData.getName());
-
- reloginWithNewRole(UserRoleEnum.TESTER);
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
- TesterOperationPage.certifyComponent(vfMetaData.getName());
-
- reloginWithNewRole(UserRoleEnum.DESIGNER);
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
- ResourceGeneralPage.clickCheckoutButton();
-
- vfMetaData.setVersion("1.1");
- vfMetaData.setUniqueId(null);
- VfVerificator.verifyVFLifecycle(vfMetaData, getUser(), LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
- VfVerificator.verifyVfLifecycleInUI(LifeCycleStateEnum.CHECKOUT);
- }*/
-
- @Test
- public void deleteInstanceFromVfCanvasApi() throws Exception {
- //Create VF via API
- ResourceReqDetails vfMetaData = createVFviaAPI();
-
- //Go to Catalog and find the created VF
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
-
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager vfCanvasManager = CanvasManager.getCanvasManager();
- CanvasElement computeElement = vfCanvasManager.createElementOnCanvas(LeftPanelCanvasItems.COMPUTE);
- vfCanvasManager.createElementOnCanvas(LeftPanelCanvasItems.PORT);
-
- vfCanvasManager.clickOnCanvaElement(computeElement);
- vfCanvasManager.deleteElementFromCanvas(computeElement);
-
- VfVerificator.verifyNumOfComponentInstances(vfMetaData, 1, getUser());
- }
-
- @Test
- public void changeInstanceNameInVfTestApi() throws Exception {
- //Create VF via API
- ResourceReqDetails vfMetaData = createVFviaAPI();
-
- //Go to Catalog and find the created VF
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
-
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager vfCanvasManager = CanvasManager.getCanvasManager();
- CanvasElement computeElement = vfCanvasManager.createElementOnCanvas(LeftPanelCanvasItems.COMPUTE);
-
- String updatedInstanceName = "updatedName";
- vfCanvasManager.updateElementNameInCanvas(computeElement, updatedInstanceName);
-
- String actualSelectedInstanceName = CompositionPage.getSelectedInstanceName();
- AssertJUnit.assertTrue(updatedInstanceName.equals(actualSelectedInstanceName));
- }
-
-
- /*@Test
- public void submitVfForTestingWithNonCertifiedAssetApi() throws Exception{
- String fileName = "vFW_VFC4.yml";
- ResourceReqDetails atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
-
- //Create VFC via API
- Resource vfc = AtomicOperationUtils.importResource(filePath, fileName).left().value();
- atomicResourceMetaData.setName(vfc.getName());
-
- //Submit VFC for testing via API
- vfc = (Resource) AtomicOperationUtils.changeComponentState(vfc, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFICATIONREQUEST, true).getLeft();
-
- //Create VF via API
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- AtomicOperationUtils.createResourceByResourceDetails(vfMetaData, UserRoleEnum.DESIGNER, true).left().value();
-
- //Go to Catalog and find the created VF
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
-
- DeploymentArtifactPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
- CompositionPage.searchForElement(atomicResourceMetaData.getName());
- canvasManager.createElementOnCanvas(atomicResourceMetaData.getName());
-
- try{
- //TODO Andrey should click on certify button
- CompositionPage.clickCertifyButton(vfMetaData.getName());
- assert(false);
- }
- catch(Exception e){
- String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
- String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.VALIDATED_RESOURCE_NOT_FOUND.name());
- AssertJUnit.assertTrue(errorMessage.contains(checkUIResponseOnError));
- }
- finally{
- ResourceRestUtils.deleteResourceByNameAndVersion(atomicResourceMetaData.getName(), "0.1");
- }
- }*/
-
- @Test
- public void isDisabledAndReadOnlyInCheckinApi() throws Exception {
- //Create VF via API
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- Resource vf = AtomicOperationUtils.createResourceByResourceDetails(vfMetaData, UserRoleEnum.DESIGNER, true).left().value();
-
- //Check in VF via API
- vf = (Resource) AtomicOperationUtils.changeComponentState(vf, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
-
- //Go to Catalog and find the created VF
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
-
- ResourceMetadataEnum[] fieldsForCheck = {ResourceMetadataEnum.RESOURCE_NAME,
- ResourceMetadataEnum.DESCRIPTION, ResourceMetadataEnum.VENDOR_NAME, ResourceMetadataEnum.VENDOR_RELEASE,
- ResourceMetadataEnum.CONTACT_ID};
-
- for (ResourceMetadataEnum field : fieldsForCheck) {
- AssertJUnit.assertTrue(GeneralUIUtils.isElementReadOnly(field.getValue()));
- }
-
- AssertJUnit.assertTrue(GeneralUIUtils.isElementDisabled(ResourceMetadataEnum.CATEGORY.getValue()));
- AssertJUnit.assertTrue(GeneralUIUtils.isElementDisabled(DataTestIdEnum.LifeCyleChangeButtons.CREATE.getValue()));
- }
-
- @Test
- public void displayHomeAfterNavigationToOnboardingTest() throws Exception {
- //Production bug scenario: "Home" - Click on any VF/ Service - Copy the URL - Go to “ONBOARD” - Paste the URL - Review the breadcrumbs
- // Expected: "Home" Actual: "Onboarding"
-
- //Create VF via API
- ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- Resource vf = AtomicOperationUtils.createResourceByResourceDetails(vfMetaData, UserRoleEnum.DESIGNER, true).left().value();
-
- //Check in VF via API
- vf = (Resource) AtomicOperationUtils.changeComponentState(vf, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
-
- //Find the created VF on Home page
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- HomePage.navigateToHomePage();
- GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
-
- //Copy current URL, navigate to OB screen and paste URL
- String url = GeneralUIUtils.copyCurrentURL();
- CompositionPage.moveToOnboardScreen();
- GeneralUIUtils.navigateToURL(url);
- GeneralUIUtils.ultimateWait();
-
- //Validate that main menu button is Home and not Onboarding
- String id = DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue();
- WebElement button = GeneralUIUtils.getWebElementByTestID(id);
- AssertJUnit.assertTrue(button.getAttribute("text").trim().equals("HOME"));
- }
-
- @Test
- public void exportToscaWithModulePropertiesVFTest() throws Exception {
- String vnfFile = "1-Vf-zrdm5bpxmc02-092017-(MOBILITY)_v2.0.zip";
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject vsp = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, FileHandling.getVnfRepositoryPath(), vnfFile, getUser());
- String vspName = vsp.getName();
- ResourceGeneralPage.clickCertifyButton(vspName);
- Resource resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, vspName, "1.0");
- VfModuleVerificator.validateSpecificModulePropertiesFromRequest(resource);
- }
-
- @Test
- public void exportToscaWithModulePropertiesTemplateCheckVFTest() throws Exception {
- String vnfFile = "1-Vf-zrdm5bpxmc02-092017-(MOBILITY)_v2.0.zip";
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- OnboardingUiUtils.onboardAndValidate(resourceReqDetails, FileHandling.getVnfRepositoryPath(), vnfFile, getUser());
- ResourceGeneralPage.getLeftMenu().moveToToscaArtifactsScreen();
- GeneralUIUtils.clickOnElementByTestId(ToscaArtifactsScreenEnum.TOSCA_MODEL.getValue());
- File latestFilefromDir = FileHandling.getLastModifiedFileNameFromDir();
- ToscaDefinition toscaDefinition = ToscaParserUtils.parseToscaMainYamlToJavaObjectByCsarLocation(latestFilefromDir);
- VfModuleVerificator.validateSpecificModulePropertiesFromFile(toscaDefinition);
- }
-
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VfArtifacts.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VfArtifacts.java
deleted file mode 100644
index 0e3780a259..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VfArtifacts.java
+++ /dev/null
@@ -1,407 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.sanity;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.be.datatypes.elements.HeatParameterDataDefinition;
-import org.openecomp.sdc.be.model.ArtifactDefinition;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.ci.tests.businesslogic.ArtifactBusinessLogic;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.CompositionScreenEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.StepsEnum;
-import org.openecomp.sdc.ci.tests.datatypes.HeatWithParametersDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.CompositionPage;
-import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.utilities.ArtifactUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.HomeUtils;
-import org.openecomp.sdc.ci.tests.utilities.OnboardingUiUtils;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openqa.selenium.WebElement;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.DataProvider;
-import org.testng.annotations.Test;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import static org.testng.AssertJUnit.assertTrue;
-
-public class VfArtifacts extends SetupCDTest {
-
- public static final String VSAEGW_FDNT_30_1607_E2E_ZIP = "2016-043_vsaegw_fdnt_30_1607_e2e.zip";
- public static final String VFW_FCGI_30_1607_E2E_ZIP = "2016-044_vfw_fcgi_30_1607_e2e.zip";
- public static final String FDNT_UPDATE_HEAT_PARAMS_ZIP = "FDNT_UpdateHeatParams.zip";
- public static final String FDNT_WITHOUT_ENV_FILES_ZIP = "FDNT_WithoutEnvFiles.zip";
- public static final String VLANDSLIDE_LDSA_30_1607_E2E_ZIP = "2016-014_vlandslide_ldsa_30_1607_e2e.zip";
- public static final String VJSA_VJSA_30_1610_E2E_ZIP = "2016-209_vjsa_vjsa_30_1610_e2e.zip";
- public static final String VLB_LMSP_30_1607_E2E_ZIP = "2016-045_vlb_lmsp_30_1607_e2e.zip";
- public static final String MOBT_MOBT_30_1607_E2E_ZIP = "2016-109_mobt_mobt_30_1607_e2e.zip";
- public static final String MOBT_MOBT_30_1607_E2E_DIFFERENT_PARAMS_ZIP = "2016-109_mobt_mobt_30_1607_e2e_DifferentParams.zip";
- public static final String VMSP_PXMC_30_1607_E2E_ZIP = "2016-042_vmsp_pxmc_30_1607_e2e.zip";
- public static final String VFW_FNAT_30_1607_E2E_ZIP = "2016-044_vfw_fnat_30_1607_e2e.zip";
- public static final String VLANDSLIDE_LDST_30_1607_E2E_ZIP = "2016-014_vlandslide_ldst_30_1607_e2e.zip";
- public static final String VIXIA_IXLA_30_1607_E2E_ZIP = "2016-017_vixia_ixla_30_1607_e2e.zip";
- private String filePath;
- private String vnfsRepositoryPath;
- private String createdEnvFilePath;
- private static final String PARAMETERS = "parameters";
-
- @BeforeMethod
- public void beforeTest() throws FileNotFoundException {
- filePath = getWindowTest().getDownloadDirectory();
- vnfsRepositoryPath = FileHandling.getFilePath("VfArtifacts");
- Config config = Utils.getConfig();
- createdEnvFilePath = config.getWindowsDownloadDirectory();
- }
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-
-
- @DataProvider(name = "heatEnvAndVersion", parallel = false)
-// parameters: VSP, updatedVsp, expectedHeatVersion, expectedHeatEnvVersion
- public Object[][] provideData() {
-
- return new Object[][]{
- {VSAEGW_FDNT_30_1607_E2E_ZIP, FDNT_UPDATE_HEAT_PARAMS_ZIP, "2", "2"}, // expected heat version 2 and heatEnv 2
- {VSAEGW_FDNT_30_1607_E2E_ZIP, FDNT_WITHOUT_ENV_FILES_ZIP, "1", "2"}, // expected heat version 1 and heatEnv 2
- {VLANDSLIDE_LDSA_30_1607_E2E_ZIP, VJSA_VJSA_30_1610_E2E_ZIP, "1", "1"}, // expected heat version 1 and heatEnv 1
- {VLB_LMSP_30_1607_E2E_ZIP, VLB_LMSP_30_1607_E2E_ZIP, "1", "2"}, // expected heat version 1 and heatEnv 2(DE270634)
- {MOBT_MOBT_30_1607_E2E_ZIP, MOBT_MOBT_30_1607_E2E_DIFFERENT_PARAMS_ZIP, "2", "2"} // expected heat version 2 and heatEnv 2
- };
- }
-
- // update first env file and verify parameters value
- @Test
- public void uploadUpdatedHeatEnv() throws Exception {
-
- String vnfFile = VFW_FNAT_30_1607_E2E_ZIP;
- File updateEnvFile = null;
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject vsp = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, vnfsRepositoryPath, vnfFile, getUser());
- String vspName = vsp.getName();
- Resource resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, vspName, "0.1");
- Map<String, ArtifactDefinition> deploymentArtifacts = resource.getDeploymentArtifacts();
- List<HeatWithParametersDefinition> envFilesList = ArtifactBusinessLogic.extractHeatWithParametersDefinition(deploymentArtifacts);
-// create env file and update it
- if (envFilesList.size() > 0) {
-// select index of env file to be updated
- HeatWithParametersDefinition selectedEnvFileToUpdate = envFilesList.get(0);
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ArtifactPageEnum.EDIT_ARTIFACT.getValue() + selectedEnvFileToUpdate.getHeatEnvLabel());
- updateEnvFile = ArtifactUIUtils.uploadCreatedUpdateParametersEnvFile(selectedEnvFileToUpdate, createdEnvFilePath);
- ArtifactUIUtils.verifyUpdatedEnvParameters(selectedEnvFileToUpdate, updateEnvFile);
- } else {
- SetupCDTest.getExtendTest().log(Status.INFO, "Resource does not contain HEAT files");
- }
- }
-
- // update all env files and verify parameters value in Deployment Artifact View
- @Test
- public void uploadUpdatedAllHeatEnv() throws Exception {
-
- String vnfFile = VFW_FNAT_30_1607_E2E_ZIP;
- File updateEnvFile = null;
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject vsp = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, vnfsRepositoryPath, vnfFile, getUser());
- String vspName = vsp.getName();
- Resource resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, vspName, "0.1");
- Map<String, ArtifactDefinition> deploymentArtifacts = resource.getDeploymentArtifacts();
- List<HeatWithParametersDefinition> envFilesList = ArtifactBusinessLogic.extractHeatWithParametersDefinition(deploymentArtifacts);
- if (envFilesList.size() > 0) {
- for (HeatWithParametersDefinition selectedEnvFileToUpdate : envFilesList) {
- // create env file and update it
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ArtifactPageEnum.EDIT_ARTIFACT.getValue() + selectedEnvFileToUpdate.getHeatEnvLabel());
- updateEnvFile = ArtifactUIUtils.uploadCreatedUpdateParametersEnvFile(selectedEnvFileToUpdate, createdEnvFilePath);
- ArtifactUIUtils.verifyUpdatedEnvParameters(selectedEnvFileToUpdate, updateEnvFile);
- }
- } else {
- SetupCDTest.getExtendTest().log(Status.INFO, "Resource does not contain HEAT files");
- }
- }
-
- // update all env files and verify parameters value in Composition
- @Test
- public void uploadUpdatedAllHeatEnvComposition() throws Exception {
-
- String vnfFile = VLANDSLIDE_LDST_30_1607_E2E_ZIP;
- File updateEnvFile = null;
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject vsp = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, vnfsRepositoryPath, vnfFile, getUser());
- String vspName = vsp.getName();
- Resource resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, vspName, "0.1");
- Map<String, ArtifactDefinition> deploymentArtifacts = resource.getDeploymentArtifacts();
- List<HeatWithParametersDefinition> envFilesList = ArtifactBusinessLogic.extractHeatWithParametersDefinition(deploymentArtifacts);
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.StepsEnum.COMPOSITION.getValue());
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.CompositionScreenEnum.DEPLOYMENT_ARTIFACT_TAB.getValue());
- if (envFilesList.size() > 0) {
- for (HeatWithParametersDefinition selectedEnvFileToUpdate : envFilesList) {
- // create env file and update it
- String dataTestId = DataTestIdEnum.DeploymentArtifactCompositionRightMenu.ARTIFACT_ITEM.getValue() + selectedEnvFileToUpdate.getHeatArtifactDisplayName();
- GeneralUIUtils.hoverOnAreaByTestId(dataTestId);
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ArtifactPageEnum.EDIT_ARTIFACT.getValue() + selectedEnvFileToUpdate.getHeatArtifactDisplayName());
- updateEnvFile = ArtifactUIUtils.uploadCreatedUpdateParametersEnvFile(selectedEnvFileToUpdate, createdEnvFilePath);
- ArtifactUIUtils.verifyUpdatedEnvParameters(selectedEnvFileToUpdate, updateEnvFile, dataTestId);
- }
- } else {
- SetupCDTest.getExtendTest().log(Status.INFO, "Resource does not contain HEAT files");
- }
- }
-
- // expected heat version 1 and heatEnv 0
- @Test
- // Download ENV file from VF level Update VSP.
- public void downloadEnvFromVFLevelUpdateVSP() throws Throwable {
- String vnfFile = VSAEGW_FDNT_30_1607_E2E_ZIP;
- String updatedVnfFile = VLANDSLIDE_LDSA_30_1607_E2E_ZIP;
- String downloadDirPath = SetupCDTest.getConfig().getWindowsDownloadDirectory();
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject CreatedVsp = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, vnfsRepositoryPath, vnfFile, getUser());
- String vspName = CreatedVsp.getName();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- OnboardingUiUtils.updateVnfAndValidate(vnfsRepositoryPath, CreatedVsp, updatedVnfFile, getUser());
- //get updated vsp env files
- Map<String, File> currentZipEnvfiles = ArtifactBusinessLogic.createEnvFilesListFromCsar(vspName, downloadDirPath);
- GeneralUIUtils.findComponentAndClick(vspName);
- ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
- List<String> deploymentArtifcatsList = DeploymentArtifactPage.getDeploymentArtifactsNamesWorkSpace();
-
- for (int i = 0; i < deploymentArtifcatsList.size(); i++) {
- if (DeploymentArtifactPage.getArtifactType(deploymentArtifcatsList.get(i)).equalsIgnoreCase(ArtifactTypeEnum.HEAT.getType())) {
- DeploymentArtifactPage.clickDownloadEnvArtifact(deploymentArtifcatsList.get(i));
- GeneralUIUtils.ultimateWait();
- File latestFilefromDir = FileHandling.getLastModifiedFileNameFromDir(downloadDirPath);
- ArtifactUIUtils.compareYamlFilesByPattern(latestFilefromDir, currentZipEnvfiles.get(deploymentArtifcatsList.get(i)), PARAMETERS);
- }
- }
- }
-
- @Test
- // Download ENV file from VF level Work-Space.
- public void downloadEnvFromVFLevelWorkSpace() throws Exception {
- String vnfFile = VSAEGW_FDNT_30_1607_E2E_ZIP;
- String downloadDirPath = SetupCDTest.getConfig().getWindowsDownloadDirectory();
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject vsp = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, vnfsRepositoryPath, vnfFile, getUser());
- Map<String, File> currentZipEnvfiles = ArtifactBusinessLogic.createEnvFilesListFromCsar(vsp.getName(), downloadDirPath);
- GeneralUIUtils.findComponentAndClick(vsp.getName());
- ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
- List<String> deploymentArtifcatsList = DeploymentArtifactPage.getDeploymentArtifactsNamesWorkSpace();
-
- for (int i = 0; i < deploymentArtifcatsList.size(); i++) {
-
- if (DeploymentArtifactPage.getArtifactType(deploymentArtifcatsList.get(i)).equalsIgnoreCase(ArtifactTypeEnum.HEAT.getType())) {
- DeploymentArtifactPage.clickDownloadEnvArtifact(deploymentArtifcatsList.get(i));
- GeneralUIUtils.ultimateWait();
- File latestFilefromDir = FileHandling.getLastModifiedFileNameFromDir(downloadDirPath);
- ArtifactUIUtils.compareYamlFilesByPattern(latestFilefromDir, currentZipEnvfiles.get(deploymentArtifcatsList.get(i)), PARAMETERS);
- }
- }
- }
-
- @Test
- // Download ENV file from VF level Composition.
- public void downloadEnvVFLevelComposition() throws Exception {
-
- String downloadDirPath = SetupCDTest.getConfig().getWindowsDownloadDirectory();
- String vnfFile = VSAEGW_FDNT_30_1607_E2E_ZIP;
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject vsp = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, vnfsRepositoryPath, vnfFile, getUser());
- Map<String, File> currentZipEnvfiles = ArtifactBusinessLogic.createEnvFilesListFromCsar(vsp.getName(), downloadDirPath);
- GeneralUIUtils.findComponentAndClick(vsp.getName());
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CompositionPage.clickOnTabTestID(CompositionScreenEnum.DEPLOYMENT_ARTIFACT_TAB);
- List<WebElement> deploymentArtifcatsList = CompositionPage.getCompositionEnvArtifacts();
-
- for (int i = 0; i < deploymentArtifcatsList.size(); i++) {
- String fileName = GeneralUIUtils.getDataTestIdAttributeValue(deploymentArtifcatsList.get(i)).replace(DataTestIdEnum.DeploymentArtifactCompositionRightMenu.ARTIFACT_ENV.getValue(), "");
- if (GeneralUIUtils.isElementVisibleByTestId(GeneralUIUtils.getDataTestIdAttributeValue(deploymentArtifcatsList.get(i)))) {
- CompositionPage.clickDownloadEnvArtifactComposition(fileName).click();
- GeneralUIUtils.ultimateWait();
- File latestFilefromDir = FileHandling.getLastModifiedFileNameFromDir(downloadDirPath);
- ArtifactUIUtils.compareYamlFilesByPattern(latestFilefromDir, currentZipEnvfiles.get(fileName), PARAMETERS);
- }
- }
- }
-
- @Test
- // Download ENV file from VF level Update parameters in UI.
- public void downloadEnvVFLevelUpdateParameters() throws Exception {
-
- String vnfFile = VFW_FCGI_30_1607_E2E_ZIP;
- String downloadDirPath = SetupCDTest.getConfig().getWindowsDownloadDirectory();
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject vendorSoftwareProductObject = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, vnfsRepositoryPath, vnfFile, getUser());
- Resource resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, vendorSoftwareProductObject.getName(), "0.1");
- Map<String, ArtifactDefinition> deploymentArtifacts = resource.getDeploymentArtifacts();
- List<HeatWithParametersDefinition> envFilesList = ArtifactBusinessLogic.extractHeatWithParametersDefinition(deploymentArtifacts);
-
- for (int i = 0; i < envFilesList.size(); i++) {
- String artifactName = envFilesList.get(i).getHeatArtifactDisplayName();
- if (envFilesList.get(i).getHeatArtifactType().equalsIgnoreCase(ArtifactTypeEnum.HEAT.getType())) {
- ExtentTestActions.log(Status.INFO, String.format("Opening the edit/view artifact parameters form of %s resource...", vnfFile));
- DeploymentArtifactPage.clickEditEnvArtifact(envFilesList.get(i).getHeatArtifactDisplayName());
-
- ExtentTestActions.log(Status.INFO, String.format("Going To locating all artifact parameters from UI of %s artifact...", artifactName));
- Map<?, ?> dataToWriteInUI = ArtifactUIUtils.getDataToWriteInUI(envFilesList.get(i).getHeatParameterDefinition());
- Map<?, ?> data = dataToWriteInUI;
- ExtentTestActions.log(Status.INFO, String.format("Success to locate all artifact parameters from UI of %s artifact...", artifactName));
-
- List<HeatParameterDataDefinition> listToSearchEnvParametersInUI = envFilesList.get(i).getHeatParameterDefinition();
- fillHeatEnvParametersInUi(data, listToSearchEnvParametersInUI);
-
- DeploymentArtifactPage.clickSaveEnvParameters();
- GeneralUIUtils.waitForLoader();
- ExtentTestActions.log(Status.INFO, String.format("Going to get the %s updated resource ...", vendorSoftwareProductObject.getName()));
- resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, vendorSoftwareProductObject.getName(), "0.1");
- deploymentArtifacts = resource.getDeploymentArtifacts();
- Map<String, List<HeatWithParametersDefinition>> envFilesListupdated = new HashMap<>();
- ExtentTestActions.log(Status.INFO, String.format("Mapping the %s artifact parameters ...", artifactName));
- envFilesListupdated.put(artifactName, ArtifactBusinessLogic.extractHeatWithParametersDefinition(deploymentArtifacts));
- List<HeatWithParametersDefinition> heatEnvUpdatedParameters = envFilesListupdated.get(artifactName);
- DeploymentArtifactPage.clickDownloadEnvArtifact(artifactName);
-
- Map<String, Object> mapExpectedProperties = new HashMap<>();
- for (HeatParameterDataDefinition param : heatEnvUpdatedParameters.get(i).getHeatParameterDefinition()) {
- mapExpectedProperties.put(param.getName(), ArtifactUIUtils.getValue(param));
- }
- ArtifactUIUtils.compareYamlParametersByPattern(mapExpectedProperties, FileHandling.getLastModifiedFileNameFromDir(downloadDirPath), PARAMETERS);
- }
- }
- }
-
-
- @Test
- public void checkDefaultCreatedEnvArtifacts() throws Exception {
- String vnfFile = VIXIA_IXLA_30_1607_E2E_ZIP;
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject vsp = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, vnfsRepositoryPath, vnfFile, getUser());
- String vspName = vsp.getName();
- Map<String, File> generatedEnvFileList = ArtifactBusinessLogic.createEnvFilesListFromCsar(vspName, filePath);
- HomeUtils.findComponentAndClick(vspName);
- GeneralUIUtils.moveToStep(StepsEnum.DEPLOYMENT_ARTIFACT);
- for (Entry<String, File> envFileEntry : generatedEnvFileList.entrySet()) {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ArtifactPageEnum.DOWNLOAD_ARTIFACT_ENV.getValue() + envFileEntry.getKey());
- ArtifactUIUtils.compareYamlFilesByPattern(envFileEntry.getValue(), FileHandling.getLastModifiedFileNameFromDir(), PARAMETERS);
-// if(true){
-//// throw new SkipException("Test skipped, new artifact version design should be developed");
-// SetupCDTest.getExtendTest().log(Status.INFO, "Test skipped, new artifact version design should be developed");
-// }
-// ArtifactUIUtils.validateArtifactVersionByTypeAndLabel(envFileEntry.getKey(), "1", ArtifactTypeEnum.HEAT_ENV);
-// ArtifactUIUtils.validateArtifactVersionByTypeAndLabel(envFileEntry.getKey(), "1", ArtifactTypeEnum.HEAT);
- }
- }
-
- // -------------------------------------------------------------------------------
- @Test(dataProvider = "heatEnvAndVersion")
- public void checkDefaultCreatedEnvArtifactsAfterVspUpdate(String vnfFile, String updatedVnfFile, String expectedHeatVersion, String expectedHeatEnvVersion) throws Throwable {
- String stringForLog = String.format("%s:%s:%s:%s", vnfFile, updatedVnfFile, expectedHeatVersion, expectedHeatEnvVersion);
- setLog(stringForLog);
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject vsp = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, vnfsRepositoryPath, vnfFile, getUser());
- String vspName = vsp.getName();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- OnboardingUiUtils.updateVnfAndValidate(vnfsRepositoryPath, vsp, updatedVnfFile, getUser());
- Map<String, File> generatedUpdatedEnvFileList = ArtifactBusinessLogic.createEnvFilesListFromCsar(vspName, filePath);
- HomeUtils.findComponentAndClick(vspName);
- GeneralUIUtils.moveToStep(StepsEnum.DEPLOYMENT_ARTIFACT);
- for (Entry<String, File> envFileEntry : generatedUpdatedEnvFileList.entrySet()) {
-// TODO test will pass on case all objects on deployment view are visible
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ArtifactPageEnum.DOWNLOAD_ARTIFACT_ENV.getValue() + envFileEntry.getKey());
- ArtifactUIUtils.compareYamlFilesByPattern(envFileEntry.getValue(), FileHandling.getLastModifiedFileNameFromDir(), PARAMETERS);
-// ArtifactUIUtils.validateArtifactVersionByTypeAndLabel(envFileEntry.getKey(), expectedHeatEnvVersion, ArtifactTypeEnum.HEAT_ENV);
-// ArtifactUIUtils.validateArtifactVersionByTypeAndLabel(envFileEntry.getKey(), expectedHeatVersion, ArtifactTypeEnum.HEAT);
- }
- if (true) {
-// throw new SkipException("Test skipped, new artifact version design should be developed");
- ExtentTestActions.log(Status.INFO, "Test skipped, new artifact version design should be developed");
- }
- }
-
- // expected heat version 1 and heatEnv 3
- @Test
- public void checkDefaultCreatedEnvArtifactsVspUpdatedWithSameVspTwice() throws Throwable {
- String vnfFile = VFW_FCGI_30_1607_E2E_ZIP;
- String updatedVnfFile = VFW_FCGI_30_1607_E2E_ZIP;
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
- VendorSoftwareProductObject vsp = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, vnfsRepositoryPath, vnfFile, getUser());
- String vspName = vsp.getName();
-
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- OnboardingUiUtils.updateVnfAndValidate(vnfsRepositoryPath, vsp, updatedVnfFile, getUser());
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- OnboardingUiUtils.updateVnfAndValidate(vnfsRepositoryPath, vsp, updatedVnfFile, getUser());
- // Artifact validation commented until new artifact version design should be developed
- Map<String, File> generatedUpdatedSecondTimeEnvFileList = ArtifactBusinessLogic.createEnvFilesListFromCsar(vspName, filePath);
- HomeUtils.findComponentAndClick(vspName);
- GeneralUIUtils.moveToStep(StepsEnum.DEPLOYMENT_ARTIFACT);
- for (Entry<String, File> envFileEntry : generatedUpdatedSecondTimeEnvFileList.entrySet()) {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ArtifactPageEnum.DOWNLOAD_ARTIFACT_ENV.getValue() + envFileEntry.getKey());
- ArtifactUIUtils.compareYamlFilesByPattern(envFileEntry.getValue(), FileHandling.getLastModifiedFileNameFromDir(), PARAMETERS);
- if (true) {
-// throw new SkipException("Test skipped, new artifact version design should be developed");
- ExtentTestActions.log(Status.INFO, "Test skipped, new artifact version design should be developed");
- }
-// ArtifactUIUtils.validateArtifactVersionByTypeAndLabel(envFileEntry.getKey(), "3", ArtifactTypeEnum.HEAT_ENV);
-// ArtifactUIUtils.validateArtifactVersionByTypeAndLabel(envFileEntry.getKey(), "1", ArtifactTypeEnum.HEAT);
- }
- }
-
-
- public void downloadFile(Entry<String, File> envFileEntry) {
- int fileCountBefore = FileHandling.getFileCountFromDefaulDownloadDirectory();
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ArtifactPageEnum.DOWNLOAD_ARTIFACT_ENV.getValue() + envFileEntry.getKey());
- int fileCountAfter = FileHandling.getFileCountFromDefaulDownloadDirectory();
- assertTrue("Downloaded file is missing", (fileCountAfter - fileCountBefore) == 1);
- }
-
- public static void fillHeatEnvParametersInUi(Map<?, ?> data, List<HeatParameterDataDefinition> listToSearchEnvParametersInUI) {
- ExtentTestActions.log(Status.INFO, String.format("Going to search parameters in UI and insert new current value to each parameter in UI..."));
-
- for (HeatParameterDataDefinition paramDefinition : listToSearchEnvParametersInUI) {
- DeploymentArtifactPage.searchBoxEnv(paramDefinition.getName());
- WebElement currenValueField = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.EnvParameterView.ENV_CURRENT_VALUE.getValue() + paramDefinition.getName());
- currenValueField.clear();
- currenValueField.sendKeys(data.get(paramDefinition.getName()).toString());
- GeneralUIUtils.ultimateWait();
- DeploymentArtifactPage.clearSearchBoxEnv();
- }
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VfDeploymentInformationalArtifacts.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VfDeploymentInformationalArtifacts.java
deleted file mode 100644
index 4523571085..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VfDeploymentInformationalArtifacts.java
+++ /dev/null
@@ -1,641 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.sanity;
-
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactInfo;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.Dashboard;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.CompositionPage;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.utilities.ArtifactUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
-import org.openecomp.sdc.common.api.ArtifactTypeEnum;
-import org.openqa.selenium.WebElement;
-import org.testng.annotations.Test;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-
-public class VfDeploymentInformationalArtifacts extends SetupCDTest {
-
-
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // START US824719
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
- // US824719 - Import VSP - VF informational artifacts
- // TC1434241 - Import VF Artifacts - Deployment Artifacts - One Artifact, One Type
- @Test
- public void importVfArtifactsDeploymentArtifactsOneArtifactOneType() throws Exception {
- String fileName = "TC1434241.csar";
- String folder = "US825779";
-
- List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
- deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
- deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
- deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
-
- importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
- }
-
- // US824719 - Import VSP - VF informational artifacts
- // TC1434245 - Import VF Artifacts - Deployment Artifacts - Multiple Artifacts, Multiple Types
- @Test
- public void importVfArtifactsDeploymentArtifactsMultipleArtifactsMultipleTypes() throws Exception {
- String fileName = "TC1434245.csar";
- String folder = "US825779";
-
- List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
- deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
- deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname2.yaml", null, "heatartifactname2", ArtifactTypeEnum.HEAT.getType(), "1"));
-
- deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName1.yaml", null, "HeatVolArtifactName1", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
- deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName2.yaml", null, "HeatVolArtifactName2", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
- deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName3.yaml", null, "HeatVolArtifactName3", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
-
- deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
- deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
-
- importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
- }
-
- // US824719 - Import VSP - VF informational artifacts
- // TC1434247 - Import VF Artifacts - Informational Artifacts - One Artifact, One Type
- @Test
- public void importVfArtifactsInformationalArtifactsOneArtifactOneType() throws Exception {
- String fileName = "TC1434247.csar";
- String folder = "US825779";
-
- List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
- deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
- deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
-
- List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
- informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
-
- importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
- }
-
- // US824719 - Import VSP - VF informational artifacts
- // TC1434248 - Import VF Artifacts - Informational Artifacts - Multiple Artifacts, Multiple Types
- @Test
- public void importVfArtifactsInformationalArtifactsMultipleArtifactsMultipleTypes() throws Exception {
- String fileName = "TC1434248.csar";
- String folder = "US825779";
-
- List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
- deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
- deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
-
- List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
- informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
- informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact1.yml", null, "GuideInfoArtifact1", ArtifactTypeEnum.GUIDE.getType(), "1"));
- informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact2.yml", null, "GuideInfoArtifact2", ArtifactTypeEnum.GUIDE.getType(), "1"));
-
- importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
- }
-
- // US824719 - Import VSP - VF informational artifacts
- // TC1434249 - Import VF Artifacts - Deployment and Informational Artifacts - Multiple Artifacts, Multiple Types
- @Test
- public void importVfArtifactsDeploymentAndInformationalArtifactsMultipleArtifactsMultipleTypes() throws Exception {
- String fileName = "TC1434249.csar";
- String folder = "US825779";
-
- List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
- deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
- deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname2.yaml", null, "heatartifactname2", ArtifactTypeEnum.HEAT.getType(), "1"));
- deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName1.yaml", null, "HeatVolArtifactName1", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
- deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName2.yaml", null, "HeatVolArtifactName2", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
- deploymentArtifacts.add(new ArtifactInfo(null, "HeatVolArtifactName3.yaml", null, "HeatVolArtifactName3", ArtifactTypeEnum.HEAT_VOL.getType(), "1"));
- deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
- deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
-
- List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
- informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
- informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact1.yml", null, "GuideInfoArtifact1", ArtifactTypeEnum.GUIDE.getType(), "1"));
- informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact2.yml", null, "GuideInfoArtifact2", ArtifactTypeEnum.GUIDE.getType(), "1"));
-
- importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
- }
-
- // TODO: there is defect in flow: "Updated button enabled for artifact in invalid type folder"
- // TODO: re-check it after defect fix
- // US824719 - Import VSP - VF informational artifacts
- // TC1438310 - Import VF Artifacts - Deployment Artifacts - Artifact Type Invalid
- @Test
- public void importVFArtifactsDeploymentArtifactsArtifactTypeInvalid() throws Exception {
- String fileName = "DeploymentArtifactWithInvalidType.csar";
- String folder = "US825779";
-
- List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
- deploymentArtifacts.add(new ArtifactInfo(null, "ArtifactName.yaml", null, "ArtifactName", ArtifactTypeEnum.OTHER.getType(), "1"));
- deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
- deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
-
- importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
- }
-
- // US824719 - Import VSP - VF informational artifacts
- // TC1438311 - Import VF Artifacts - Informational Artifacts - Artifact Type Invalid
- @Test
- public void importVfArtifactsInformationalArtifactsArtifactTypeInvalid() throws Exception {
- String fileName = "InformationArtifactWithInvalidType.csar";
- String folder = "US825779";
-
- List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
- deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
- deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
-
- List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
- informationalArtifacts.add(new ArtifactInfo(null, "ArtifactName.yaml", null, "ArtifactName", ArtifactTypeEnum.OTHER.getType(), "1"));
-
- importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
- }
-
- // US824719 - Import VSP - VF informational artifacts
- // TC1438231 - Import VF Artifacts - Deployment Artifacts - Artifact Name To Long
- @Test
- public void importVfArtifactsDeploymentArtifactsArtifactNameToLong() throws Exception {
- String folder = "US825779";
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
-
- String fileName = "DeploymentArtifactWithLongName.csar";
-
- importVfFromCsar(resourceMetaData, folder, fileName, getUser());
-
- String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
- String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
- assertThat(errorMessage).contains(checkUIResponseOnError);
- }
-
- // US824719 - Import VSP - VF informational artifacts
- // TC1438232 - Import VF Artifacts - Informational Artifacts - Artifact Name To Long
- // TODO: make informational artifact name longer then 255
- // TODO: windows/linux not allowed it
- @Test(enabled = true)
- public void importVfArtifactsInformationalArtifactsArtifactNameToLong() throws Exception {
- String folder = "US825779";
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
-
- String fileName = "InformationArtifactWithLongName.csar";
-
- importVfFromCsar(resourceMetaData, folder, fileName, getUser());
-
- String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
- String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
- assertThat(errorMessage).contains(checkUIResponseOnError);
- }
-
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // END US824719
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // START US825779
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
- // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
- // TC1443954 - Update With Multiple Changes In Deployment And Informational Artifacts
- @Test
- public void updateWithMultipleChangesInDeploymentAndInformationalArtifacts() throws Exception {
- String folder = "US825779";
- String fileName = "ImportTC1443954.csar";
-
- ArtifactInfo deploymentHeat1 = new ArtifactInfo(null, "heatartifactname1.yaml", null, "heatartifactname1", ArtifactTypeEnum.HEAT.getType(), "1");
- ArtifactInfo deploymentHeat2 = new ArtifactInfo(null, "heatartifactname2.yaml", null, "heatartifactname2", ArtifactTypeEnum.HEAT.getType(), "1");
- ArtifactInfo deploymentHeat3 = new ArtifactInfo(null, "heatartifactname3.yaml", null, "heatartifactname3", ArtifactTypeEnum.HEAT.getType(), "1");
-
- ArtifactInfo deploymentHeatVol1 = new ArtifactInfo(null, "HeatVolArtifactName1.yaml", null, "HeatVolArtifactName1", ArtifactTypeEnum.HEAT_VOL.getType(), "1");
- ArtifactInfo deploymentHeatVol2 = new ArtifactInfo(null, "HeatVolArtifactName2.yaml", null, "HeatVolArtifactName2", ArtifactTypeEnum.HEAT_VOL.getType(), "1");
-
- List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
- deploymentArtifacts.add(deploymentHeat1);
- deploymentArtifacts.add(deploymentHeat2);
- deploymentArtifacts.add(deploymentHeat3);
- deploymentArtifacts.add(deploymentHeatVol1);
- deploymentArtifacts.add(deploymentHeatVol2);
-
- ArtifactInfo infoGuide1 = new ArtifactInfo(null, "GuideInfoArtifact1.yml", null, "GuideInfoArtifact1", ArtifactTypeEnum.GUIDE.getType(), "1");
- ArtifactInfo infoGuide2 = new ArtifactInfo(null, "GuideInfoArtifact2.yml", null, "GuideInfoArtifact2", ArtifactTypeEnum.GUIDE.getType(), "1");
-
- ArtifactInfo infoOther1 = new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1");
- ArtifactInfo infoOther2 = new ArtifactInfo(null, "artifactname2.txt", null, "artifactname2", ArtifactTypeEnum.OTHER.getType(), "1");
- ArtifactInfo infoOther3 = new ArtifactInfo(null, "artifactname3.txt", null, "artifactname3", ArtifactTypeEnum.OTHER.getType(), "1");
-
- List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
- informationalArtifacts.add(infoGuide1);
- informationalArtifacts.add(infoGuide2);
- informationalArtifacts.add(infoOther1);
- informationalArtifacts.add(infoOther2);
- informationalArtifacts.add(infoOther3);
-
- importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
-
- GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
-
- fileName = "UpdateTC1443954.csar";
-
- List<ArtifactInfo> informationalArtifactsNotExist = new ArrayList<ArtifactInfo>();
- List<ArtifactInfo> deploymentArtifactsNotExist = new ArrayList<ArtifactInfo>();
-
- // Changes in deployment artifacts
- deploymentArtifactsNotExist.add(deploymentHeat1);
- deploymentArtifactsNotExist.add(deploymentHeat2);
- deploymentArtifacts.remove(deploymentHeat1);
- deploymentArtifacts.remove(deploymentHeat2);
- deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname4.yaml", null, "heatartifactname4", ArtifactTypeEnum.HEAT.getType(), "1"));
- deploymentArtifacts.add(new ArtifactInfo(null, "heatartifactname5.yaml", null, "heatartifactname5", ArtifactTypeEnum.HEAT.getType(), "1"));
- deploymentHeatVol1.setArtifactVersion("2");
- deploymentHeatVol2.setArtifactVersion("2");
-
- // Changes in informational artifacts
- infoGuide1.setArtifactVersion("2");
- infoOther1.setArtifactVersion("2");
- informationalArtifactsNotExist.add(infoGuide2);
- informationalArtifactsNotExist.add(infoOther2);
- informationalArtifacts.remove(infoGuide2);
- informationalArtifacts.remove(infoOther2);
- informationalArtifacts.add(new ArtifactInfo(null, "GuideInfoArtifact3.yml", null, "GuideInfoArtifact3", ArtifactTypeEnum.GUIDE.getType(), "1"));
- informationalArtifacts.add(new ArtifactInfo(null, "artifactname4.txt", null, "artifactname4", ArtifactTypeEnum.OTHER.getType(), "1"));
-
- updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, deploymentArtifacts, informationalArtifacts, deploymentArtifactsNotExist, informationalArtifactsNotExist);
- }
-
-
- // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
- // TC1444206 - Update With Existed Deployment Artifact By Artifact With Different Type
- @Test
- public void updateWithExistedDeploymentArtifactByArtifactWithDifferentType() throws Exception {
- String folder = "US825779";
- String fileName = "ImportTC1444206.csar";
- List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
- deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
- deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
- deploymentArtifacts.add(new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
-
- importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
-
- GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
-
- fileName = "UpdateTC1444206.csar";
- String filePath = FileHandling.getFilePath(folder);
-
- ResourceUIUtils.updateVfWithCsar(filePath, fileName);
-
- String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
- String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.ARTIFACT_EXIST.name());
- assertThat(errorMessage).contains(checkUIResponseOnError);
- }
-
- // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
- // TC1444207 - Update With Existed Informational Artifact By Artifact With Different Type
- @Test
- public void updateWithExistedInformationalArtifactByArtifactWithDifferentType() throws Exception {
- String folder = "US825779";
- String fileName = "ImportTC1444207.csar";
-
- List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
- deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
- deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
-
- List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
- informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
-
- importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, informationalArtifacts);
-
- GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
-
- fileName = "UpdateTC1444207.csar";
- String filePath = FileHandling.getFilePath(folder);
-
- ResourceUIUtils.updateVfWithCsar(filePath, fileName);
-
- String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
- String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.ARTIFACT_EXIST.name());
- assertThat(errorMessage).contains(checkUIResponseOnError);
- }
-
-
- // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
- // TC1444208 - Update With Existed Informational Artifact By Deployment Artifact With Different Type
- @Test
- public void updateWithExistedInformationalArtifactByDeploymentArtifactWithDifferentType() throws Exception {
- String folder = "US825779";
- String fileName = "ImportTC1444208.csar";
-
- List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
- deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
- deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
- deploymentArtifacts.add(new ArtifactInfo(null, "artifactname1.yaml", null, "artifactname1", ArtifactTypeEnum.HEAT.getType(), "1"));
-
- importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
-
- GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
-
- fileName = "UpdateTC1444208.csar";
- String filePath = FileHandling.getFilePath(folder);
-
- ResourceUIUtils.updateVfWithCsar(filePath, fileName);
-
- String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
- String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.ARTIFACT_EXIST.name());
- assertThat(errorMessage).contains(checkUIResponseOnError);
- }
-
- // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
- // TC1444520 - Update Deployment Artifact With Name To Long
- @Test
- public void updateDeploymentArtifactWithNameToLong() throws Exception {
- String folder = "US825779";
-
- String fileName = "ImportTC1444520.csar";
-
- importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, null, null);
-
- GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
-
- fileName = "UpdateTC1444520.csar";
- String filePath = FileHandling.getFilePath(folder);
-
- ResourceUIUtils.updateVfWithCsar(filePath, fileName);
-
- String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
- String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
- assertThat(errorMessage).contains(checkUIResponseOnError);
- }
-
- // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
- // TC1444521 - Update Informational Artifact With Name To Long
- @Test
- public void updateInformationalArtifactWithNameToLong() throws Exception {
-
- String folder = "US825779";
- String fileName = "ImportTC1444521.csar";
-
- importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, null, null);
-
- GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
-
- fileName = "UpdateTC1444521.csar";
- String filePath = FileHandling.getFilePath(folder);
-
- ResourceUIUtils.updateVfWithCsar(filePath, fileName);
-
- String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
- String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.EXCEEDS_LIMIT.name());
- assertThat(errorMessage).contains(checkUIResponseOnError);
- }
-
- // US825779 - Story: [BE] Import VSP - VF informational artifacts - Update
- // TC1444531 - Update Informational Artifact With Invalid Type
- @Test
- public void updateInformationalArtifactWithInvalidType() throws Exception {
- String folder = "US825779";
- String fileName = "ImportTC1444531.csar";
-
- importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, null, null);
-
- GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1");
-
- fileName = "UpdateTC1444531.csar";
-
- List<ArtifactInfo> informationalArtifacts = new ArrayList<ArtifactInfo>();
- informationalArtifacts.add(new ArtifactInfo(null, "artifactname1.xml", null, "artifactname1", ArtifactTypeEnum.OTHER.getType(), "1"));
-
- updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, fileName, null, informationalArtifacts, null, null);
- }
-
-
- @Test
- public void importValidInformationalArtifactInInvalidFolerTest_TC1438313() throws Exception {
- String fileName = "ValidArtifactNameInInvalidFolder.csar";
- String folder = "US824719";
-
- List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
- deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "1"));
- deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
-
- importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(fileName, folder, deploymentArtifacts, null);
- }
-
- @Test
- public void updateValidInformationalArtifactInInvalidFolerTest_TC1444533() throws Exception {
- String fileName = "ImportTC1444533.csar";
- String folder = "US824719";
- String filePath = FileHandling.getFilePath(folder);
-
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName, getUser());
-
- String updatedCsarFileName = "UpdateTC1444533.csar";
-
- List<ArtifactInfo> deploymentArtifacts = new ArrayList<ArtifactInfo>();
- deploymentArtifacts.add(new ArtifactInfo(null, "base_ldsa.yaml", null, "base_ldsa", ArtifactTypeEnum.HEAT.getType(), "2"));
- deploymentArtifacts.add(new ArtifactInfo(null, "module_1_ldsa.yaml", null, "module_1_ldsa", ArtifactTypeEnum.HEAT.getType(), "4"));
-
- updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(folder, updatedCsarFileName, deploymentArtifacts, null, null, null);
- }
-
-
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // END US825779
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-
- public void updateVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(String folder, String fileName,
- List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> informationalArtifacts,
- List<ArtifactInfo> deploymentArtifactsNotExist, List<ArtifactInfo> informationalArtifactsNotExist) throws Exception {
- String filePath = FileHandling.getFilePath(folder);
- ResourceUIUtils.updateVfWithCsar(filePath, fileName);
-
- validateDeploymentArtifactPage(deploymentArtifacts, null);
- validateInformationalArtifactPage(informationalArtifacts, null);
-
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
-
- validateDeploymentArtifactInComposition(deploymentArtifacts, null);
- validateInformationalArtifactInComposition(informationalArtifacts, null);
-
- }
-
-
- public void importVfFromCsar(ResourceReqDetails resourceMetaData, String folder, String fileName, User user) {
- String filePath = FileHandling.getFilePath(folder);
- GeneralUIUtils.hoverOnAreaByTestId(Dashboard.IMPORT_AREA.getValue());
- // Insert file to the browse dialog
- WebElement browseWebElement = GeneralUIUtils.getInputElement(DataTestIdEnum.Dashboard.IMPORT_VF_FILE.getValue());
- browseWebElement.sendKeys(filePath + fileName);
-
- // Fill the general page fields.
- GeneralUIUtils.waitForLoader();
- ResourceUIUtils.fillResourceGeneralInformationPage(resourceMetaData, getUser(), true);
- GeneralUIUtils.clickOnAreaJS(DataTestIdEnum.GeneralElementsEnum.CREATE_BUTTON.getValue());
- }
-
-
- public void importVfAndValidateInformationalDeploymentArtifactPagesOnPagesAndComposition(String fileName, String folder, List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> informationalArtifacts) throws Exception {
- String filePath = FileHandling.getFilePath(folder);
- ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
- ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, fileName, getUser());
-
- validateDeploymentArtifactPage(deploymentArtifacts, null);
- validateInformationalArtifactPage(informationalArtifacts, null);
-
- ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
-
- validateDeploymentArtifactInComposition(deploymentArtifacts, null);
- validateInformationalArtifactInComposition(informationalArtifacts, null);
- }
-
- public void validateInformationalArtifactInComposition(List<ArtifactInfo> informationalArtifacts, List<ArtifactInfo> informationalArtifactsNotExist) throws Exception {
- CompositionPage.showInformationArtifactTab();
- // Composition informational
- if (informationalArtifacts != null && informationalArtifacts.size() > 0) {
- validateEachArtifactOnCompositionRightMenuInformationPage(informationalArtifacts);
- }
- if (informationalArtifactsNotExist != null && informationalArtifactsNotExist.size() > 0) {
- validateEachArtifactNotExistOnCompositionRightMenuInformationPage(informationalArtifactsNotExist);
- }
- }
-
- public void validateDeploymentArtifactInComposition(List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> deploymentArtifactsNotExist) throws Exception {
- CompositionPage.showDeploymentArtifactTab();
- // Composition deployment
- if (deploymentArtifacts != null && deploymentArtifacts.size() > 0) {
- validateEachArtifactOnCompositionRightMenuDeploymentPage(deploymentArtifacts);
- }
- if (deploymentArtifactsNotExist != null && deploymentArtifactsNotExist.size() > 0) {
- validateEachArtifactNotExistOnCompositionRightMenuDeploymentPage(deploymentArtifactsNotExist);
- }
- }
-
- public void validateInformationalArtifactPage(List<ArtifactInfo> informationalArtifacts, List<ArtifactInfo> informationalArtifactsNotExist) {
- ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen();
- // Informational page
- if (informationalArtifacts != null && informationalArtifacts.size() > 0) {
- validateEachArtifactInformationPage(informationalArtifacts);
- }
- if (informationalArtifactsNotExist != null && informationalArtifactsNotExist.size() > 0) {
- validateEachArtifactNotExistInformationPage(informationalArtifactsNotExist);
- }
- }
-
- public void validateDeploymentArtifactPage(List<ArtifactInfo> deploymentArtifacts, List<ArtifactInfo> deploymentArtifactsNotExist) {
- ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
- // Deployment page
- if (deploymentArtifacts != null && deploymentArtifacts.size() > 0) {
- validateEachArtifactOnDeploymentPage(deploymentArtifacts);
- }
- if (deploymentArtifactsNotExist != null && deploymentArtifactsNotExist.size() > 0) {
- validateEachArtifactNotExistOnDeploymentPage(deploymentArtifactsNotExist);
- }
- }
-
- // TODO: add validation that if not editable / deleteable then button should not appear
- public void validateEachArtifactOnDeploymentPage(List<ArtifactInfo> artifactInfoList) {
- for (ArtifactInfo artifact : artifactInfoList) {
- String type = artifact.getArtifactType();
- String label = artifact.getArtifactLabel();
- String version = artifact.getArtifactVersion();
-
- if (type.equals(ArtifactTypeEnum.HEAT.getType()) || type.equals(ArtifactTypeEnum.HEAT_VOL.getType()) || type.equals(ArtifactTypeEnum.HEAT_NET.getType())) {
- ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(label, null, version, type, true, false, false, true);
- } else {
- ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(label, null, version, type, true, true, true, false);
- }
- }
- }
-
- public void validateEachArtifactNotExistOnDeploymentPage(List<ArtifactInfo> artifactInfoList) {
- for (ArtifactInfo artifact : artifactInfoList) {
- ArtifactUIUtils.validateNotExistArtifactOnDeploymentInformationPage(artifact.getArtifactLabel());
- }
- }
-
- public void validateEachArtifactInformationPage(List<ArtifactInfo> artifactInfoList) {
- for (ArtifactInfo artifact : artifactInfoList) {
- ArtifactUIUtils.validateExistArtifactOnDeploymentInformationPage(artifact.getArtifactLabel(), null, artifact.getArtifactVersion(), artifact.getArtifactType(), true, true, true, false);
- }
- }
-
- public void validateEachArtifactNotExistInformationPage(List<ArtifactInfo> artifactInfoList) {
- for (ArtifactInfo artifact : artifactInfoList) {
- ArtifactUIUtils.validateNotExistArtifactOnDeploymentInformationPage(artifact.getArtifactLabel());
- }
- }
-
- public void validateEachArtifactOnCompositionRightMenuDeploymentPage(List<ArtifactInfo> artifactInfoList) {
- for (ArtifactInfo artifact : artifactInfoList) {
-
- String type = artifact.getArtifactType();
- String label = artifact.getArtifactLabel();
- String filename = artifact.getFilename();
-
- if (type.equals(ArtifactTypeEnum.HEAT.getType()) || type.equals(ArtifactTypeEnum.HEAT_VOL.getType()) || type.equals(ArtifactTypeEnum.HEAT_NET.getType())) {
- ArtifactUIUtils.validateExistArtifactOnCompositionRightMenuDeploymentInformationPage(filename, label, false, true, true, false);
- } else {
- ArtifactUIUtils.validateExistArtifactOnCompositionRightMenuDeploymentInformationPage(filename, label, true, false, true, true);
- }
- }
- }
-
- public void validateEachArtifactNotExistOnCompositionRightMenuDeploymentPage(List<ArtifactInfo> artifactInfoList) {
- for (ArtifactInfo artifact : artifactInfoList) {
- ArtifactUIUtils.validateNotExistArtifactOnCompositionRightMenuDeploymentInformationPage(artifact.getArtifactLabel());
- }
- }
-
- // TODO: there is defect in this flow
- // TODO: change isEditable to false when defect fix
- public void validateEachArtifactOnCompositionRightMenuInformationPage(List<ArtifactInfo> artifactInfoList) {
- for (ArtifactInfo artifact : artifactInfoList) {
- ArtifactUIUtils.validateExistArtifactOnCompositionRightMenuDeploymentInformationPage(artifact.getFilename(), artifact.getArtifactLabel(), true, false, true, true);
- }
- }
-
- public void validateEachArtifactNotExistOnCompositionRightMenuInformationPage(List<ArtifactInfo> artifactInfoList) {
- for (ArtifactInfo artifact : artifactInfoList) {
- ArtifactUIUtils.validateNotExistArtifactOnCompositionRightMenuDeploymentInformationPage(artifact.getArtifactLabel());
- }
- }
-
-
- @Override
- protected UserRoleEnum getRole() {
- return UserRoleEnum.DESIGNER;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ArtifactsCorrelationManager.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ArtifactsCorrelationManager.java
deleted file mode 100644
index ce46d5b833..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ArtifactsCorrelationManager.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.setup;
-
-import org.openecomp.sdc.ci.tests.datatypes.HeatMetaFirstLevelDefinition;
-
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.Map.Entry;
-import java.util.Set;
-
-public class ArtifactsCorrelationManager {
-
- private static HashMap<String, LinkedList<HeatMetaFirstLevelDefinition>> vNFArtifactsCorrelationMap = new HashMap<String, LinkedList<HeatMetaFirstLevelDefinition>>();
- private static HashMap<String, Entry<String, LinkedList<HeatMetaFirstLevelDefinition>>> serviceVNFCorrelationMap = new HashMap<String, Entry<String, LinkedList<HeatMetaFirstLevelDefinition>>>();
-
- public static void addVNFartifactDetails(String vspName,
- LinkedList<HeatMetaFirstLevelDefinition> deploymentArtifacts) {
-
- vNFArtifactsCorrelationMap.put(vspName, deploymentArtifacts);
-
-
- }
-
- public static Entry<String, LinkedList<HeatMetaFirstLevelDefinition>> getVNFartifactDetails(String vnfName) {
-
-
- Set<Entry<String, LinkedList<HeatMetaFirstLevelDefinition>>> entrySet = vNFArtifactsCorrelationMap.entrySet();
- for (Entry<String, LinkedList<HeatMetaFirstLevelDefinition>> entry : entrySet) {
- String key = entry.getKey();
- if (key.equals(vnfName)) {
- return entry;
- }
-
- }
- return null;
-
- }
-
-
- public static void addVNFtoServiceArtifactCorrelation(String service, String vnfName) {
-
- serviceVNFCorrelationMap.put(service, getVNFartifactDetails(vnfName));
-
- }
-
- public static Set<Entry<String, Entry<String, LinkedList<HeatMetaFirstLevelDefinition>>>> getServiceArtifactCorrelationMap(String service) {
-
- return serviceVNFCorrelationMap.entrySet();
-
- }
-
-}
-
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/AttFtpClient.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/AttFtpClient.java
deleted file mode 100644
index 37e8855800..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/AttFtpClient.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.setup;
-
-import org.apache.commons.net.ftp.FTPClient;
-import org.apache.commons.net.ftp.FTPFile;
-import org.apache.commons.net.ftp.FTPReply;
-
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.List;
-import java.util.stream.Collectors;
-
-public class AttFtpClient {
-
- private static final AttFtpClient FTP_CLIENT = new AttFtpClient();
-
- public static AttFtpClient getFtpClient() {
- return FTP_CLIENT;
- }
-
- private FTPClient apacheFtpClient;
-
- private AttFtpClient() {
- apacheFtpClient = new FTPClient();
- }
-
-
- public void init(String server, int port, String user, String pass) {
-
- try {
- apacheFtpClient.connect(server, port);
- showServerReply(apacheFtpClient);
-
-
- int replyCode = apacheFtpClient.getReplyCode();
- if (!FTPReply.isPositiveCompletion(replyCode)) {
- System.out.println("Connect failed");
- return;
- }
-
- boolean success = apacheFtpClient.login(user, pass);
- showServerReply(apacheFtpClient);
-
- if (!success) {
- System.out.println("Could not login to the server");
- return;
- }
- } catch (IOException ex) {
- System.out.println("Oops! Something wrong happened");
- ex.printStackTrace();
- }
- }
-
- public File retrieveLastModifiedFileFromFTP() throws IOException {
- FTPFile[] files1 = retrieveListOfFile();
-
- // sort list by TimeStamp
- List<FTPFile> sorted = Arrays.asList(files1).stream()
- .sorted(Comparator.comparing(FTPFile::getTimestamp)).collect(Collectors.toList());
- printFileDetailsList(sorted);
-
- // retrieve file from FTP
- FTPFile ftpFile = sorted.get(sorted.size() - 1);
-
- return retrieveFileFromFTP(ftpFile);
-
- }
-
- public FTPFile[] retrieveListOfFile() throws IOException {
- // Lists files and directories
- FTPFile[] files = apacheFtpClient.listFiles("");
-
- printNames(files);
- return files;
- }
-
- public File retrieveFileFromFTP(FTPFile ftpFile) throws IOException {
-
- File downloadFile1 = new File("tmp");
- OutputStream outputStream1 = new BufferedOutputStream(new FileOutputStream(downloadFile1));
- boolean success = apacheFtpClient.retrieveFile(ftpFile.getName(), outputStream1);
- outputStream1.close();
-
- if (success) {
- System.out.println("File #1 has been downloaded successfully.");
- }
-
-
- return downloadFile1;
-
- }
-
- public void deleteFilesFromFTPserver() throws IOException {
- FTPFile[] files = retrieveListOfFile();
- deleteFiles(files);
- }
-
- public void terminateClient() throws IOException {
-
- String status = apacheFtpClient.getStatus();
-
- // logs out and disconnects from server
- try {
- if (apacheFtpClient.isConnected()) {
- apacheFtpClient.logout();
- apacheFtpClient.disconnect();
- }
- } catch (IOException ex) {
- ex.printStackTrace();
- }
- }
-
- private void printFileDetailsList(List<FTPFile> list) {
- DateFormat dateFormater = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-
- for (FTPFile ftpFile : list) {
-
- String details = ftpFile.getName();
- if (ftpFile.isDirectory()) {
- details = "[" + details + "]";
- }
- details += "\t\t" + ftpFile.getSize();
- details += "\t\t" + dateFormater.format(ftpFile.getTimestamp().getTime());
-
- System.out.println(details);
- }
- }
-
- private void printNames(FTPFile[] files) {
- if (files != null && files.length > 0) {
- for (FTPFile aFile : files) {
- System.out.println(aFile);
- }
- }
- }
-
- private void showServerReply(FTPClient ftpClient) {
- String[] replies = ftpClient.getReplyStrings();
- if (replies != null && replies.length > 0) {
- for (String aReply : replies) {
- System.out.println("SERVER: " + aReply);
- }
- }
- }
-
- public class LastModifiedComparator implements Comparator<FTPFile> {
-
- public int compare(FTPFile f1, FTPFile f2) {
- return f1.getTimestamp().compareTo(f2.getTimestamp());
- }
- }
-
- public FTPFile getMaxLastModified(FTPFile[] ftpFiles) {
- return Collections.max(Arrays.asList(ftpFiles), new LastModifiedComparator());
- }
-
- public static void displayFiles(File[] files) {
- for (File file : files) {
- System.out.printf("File: %-20s Last Modified:" + new Date(file.lastModified()) + "\n", file.getName());
- }
- }
-
- public void deleteFiles(FTPFile[] files) {
-
- for (FTPFile file : files) {
-
- boolean deleted = false;
- try {
- deleted = apacheFtpClient.deleteFile(file.getName());
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- if (deleted) {
- System.out.println("The file was deleted successfully.");
- } else {
- System.out.println("Could not delete the  file, it may not exist.");
- }
- }
-
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/DriverFactory.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/DriverFactory.java
deleted file mode 100644
index 8cfe5bdba0..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/DriverFactory.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.setup;
-
-
-import org.apache.commons.io.FileUtils;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.firefox.FirefoxProfile;
-import org.testng.annotations.AfterSuite;
-import org.testng.annotations.BeforeSuite;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FilenameFilter;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-
-
-public class DriverFactory {
-
- private static ThreadLocal<WebDriverThread> driverThread;
- private static List<WebDriverThread> webDriverThreadPool = Collections.synchronizedList(new ArrayList<WebDriverThread>());
- private static Config config;
-
- public DriverFactory() {
- try {
- config = Utils.getConfig();
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- }
- }
-
- @BeforeSuite(alwaysRun = true)
- public static void instantiateDriverObject() {
-
- // Selenium 3.4.0 change, location of gecko driver, set system property
-// System.setProperty("webdriver.gecko.driver","C:\\Gekko18\\geckodriver-v0.18.0-win64\\geckodriver.exe"); //change for 3.4.0, gecko driver location
- // End of Selenium 3.4.0 change
-
- File basePath = new File(FileHandling.getBasePath());
- File[] listFiles = basePath.listFiles(new FilenameFilter() {
-
- @Override
- public boolean accept(File basePath, String name) {
- return name.startsWith(WebDriverThread.AUTOMATION_DOWNLOAD_DIR);
- }
- });
- Arrays.asList(listFiles).forEach(e -> FileHandling.deleteDirectory(e.getAbsolutePath()));
-
-
- driverThread = new ThreadLocal<WebDriverThread>() {
- @Override
- protected WebDriverThread initialValue() {
- WebDriverThread webDriverThread = new WebDriverThread(config);
- webDriverThreadPool.add(webDriverThread);
- return webDriverThread;
- }
- };
- }
-
- public static WebDriver getDriver() {
- return driverThread.get().getDriver();
- }
-
- public static FirefoxProfile getDriverFirefoxProfile() throws Exception {
- return driverThread.get().getFirefoxProfile();
- }
-
- @AfterSuite(alwaysRun = true)
- public static void quitDriverAfterSuite() throws Exception {
- for (WebDriverThread webDriverThread : webDriverThreadPool) {
- if (webDriverThread.getDriver() != null) {
- webDriverThread.quitDriver();
- }
- }
-
- MobProxy.removeAllProxyServers();
-
- deleteDownloadDirs();
- }
-
- private static void deleteDownloadDirs() throws IOException {
- //System.gc();
- HashMap<Long, WindowTest> windowMap = WindowTestManager.getWholeMap();
- for (WindowTest win : windowMap.values()) {
- String downloadDirectory = win.getDownloadDirectory();
- FileUtils.deleteDirectory(new File(downloadDirectory));
- }
- }
-
- public static void quitDriver() throws Exception {
- driverThread.get().quitDriver();
- driverThread.remove();
- WindowTestManager.removeWindowTest();
- MobProxy.removePoxyServer();
- }
-
- public static Config getConfig() {
- return config;
- }
-
- public static void setConfig(Config config) {
- DriverFactory.config = config;
- }
-
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentManager.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentManager.java
deleted file mode 100644
index 6bd2e4b870..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentManager.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.setup;
-
-import com.aventstack.extentreports.ExtentReports;
-import com.aventstack.extentreports.reporter.ExtentHtmlReporter;
-import com.aventstack.extentreports.reporter.ExtentXReporter;
-import com.aventstack.extentreports.reporter.configuration.Protocol;
-import com.aventstack.extentreports.reporter.configuration.Theme;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.RestCDUtils;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.ci.tests.utils.rest.AutomationUtils;
-import org.testng.ITestContext;
-
-import java.io.File;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.GregorianCalendar;
-
-public class ExtentManager {
-
- private static final String VERSIONS_INFO_FILE_NAME = "versions.info";
- private static ExtentReports extent;
- private static ExtentHtmlReporter htmlReporter;
- private static ExtentXReporter extentxReporter;
-
- public enum suiteNameXml {
-
- TESTNG_FAILED_XML_NAME("testng-failed.xml");
-
- suiteNameXml(String value) {
- this.value = value;
- }
-
- private String value;
-
- public String getValue() {
- return value;
- }
-
- }
-
- private static synchronized ExtentReports setReporter(String filePath, String htmlFile, Boolean isAppend) throws Exception {
- String dbIp = DriverFactory.getConfig().getReportDBhost();
- int dbPort = DriverFactory.getConfig().getReportDBport();
-
- if (extent == null) {
- extentxReporter = new ExtentXReporter(dbIp, dbPort);
- extent = new ExtentReports();
- initAndSetExtentHtmlReporter(filePath, htmlFile, isAppend);
- if (extentxReporter.config().getReportObjectId() != null) {
- setExtentXReporter(isAppend);
- } else {
- extentxReporter.stop();
- }
- }
- return extent;
- }
-
- private static synchronized void setExtentXReporter(Boolean isAppend) {
- extentxReporter.setAppendExisting(isAppend);
- extent.attachReporter(extentxReporter);
- }
-
- private static synchronized void initAndSetExtentHtmlReporter(String filePath, String htmlFile, Boolean isAppend) throws Exception {
- htmlReporter = new ExtentHtmlReporter(filePath + htmlFile);
- setConfiguration(htmlReporter);
- htmlReporter.setAppendExisting(isAppend);
- extent.attachReporter(htmlReporter);
- }
-
- static synchronized ExtentReports getReporter() {
- return extent;
- }
-
- static void initReporter(String filepath, String htmlFile, ITestContext context) throws Exception {
-
- String onboardVersion = AutomationUtils.getOnboardVersion();
- String osVersion = AutomationUtils.getOSVersion();
- Config config = Utils.getConfig();
- String envData = config.getUrl();
- String suiteName = getSuiteName(context);
- String reportStartDate = null;
- if (suiteName.equals(suiteNameXml.TESTNG_FAILED_XML_NAME.getValue())) {
- if (config.getUseBrowserMobProxy()) {
- setTrafficCaptue(config);
- }
- setReporter(filepath, htmlFile, true);
- String suiteNameFromVersionInfoFile = FileHandling.getKeyByValueFromPropertyFormatFile(filepath + VERSIONS_INFO_FILE_NAME, "suiteName");
- reporterDataDefinition(onboardVersion, osVersion, envData, suiteNameFromVersionInfoFile);
- } else {
- FileHandling.deleteDirectory(SetupCDTest.getReportFolder());
- FileHandling.createDirectory(filepath);
- setReporter(filepath, htmlFile, false);
- Calendar calendar = new GregorianCalendar();
- SimpleDateFormat formatter = new SimpleDateFormat("MMM dd, yyyy hh:mm:ss a");
- reportStartDate = formatter.format(calendar.getTime());
- reporterDataDefinition(onboardVersion, osVersion, envData, suiteName);
- AutomationUtils.createVersionsInfoFile(filepath + VERSIONS_INFO_FILE_NAME, onboardVersion, osVersion, envData, suiteName, reportStartDate);
- }
-
- }
-
- private static void reporterDataDefinition(String onboardVersion, String osVersion, String envData, String suiteNameFromVersionInfoFile) throws Exception {
- extent.setSystemInfo("Onboard Version", onboardVersion);
- extent.setSystemInfo("OS Version", osVersion);
- extent.setSystemInfo("Host Name Address", RestCDUtils.getExecutionHostAddress());
- extent.setSystemInfo("ExecutedOn", envData);
- extent.setSystemInfo("SuiteName", suiteNameFromVersionInfoFile);
- }
-
- static String getSuiteName(ITestContext context) {
- String suitePath = context.getSuite().getXmlSuite().getFileName();
- if (suitePath != null) {
- File file = new File(suitePath);
- String suiteName = file.getName();
- return suiteName;
- }
- return null;
- }
-
- private static synchronized ExtentHtmlReporter setConfiguration(ExtentHtmlReporter htmlReporter) throws Exception {
-
- htmlReporter.config().setTheme(Theme.STANDARD);
- htmlReporter.config().setEncoding("UTF-8");
- htmlReporter.config().setProtocol(Protocol.HTTPS);
- htmlReporter.config().setDocumentTitle("SDC Automation Report");
- htmlReporter.config().setChartVisibilityOnOpen(true);
- htmlReporter.config().setReportName("SDC Automation Report");
- htmlReporter.config().setChartVisibilityOnOpen(false);
- htmlReporter.setStartTime(null);
- return htmlReporter;
- }
-
- public static void closeReporter() {
- extent.flush();
- }
-
- private static void setTrafficCaptue(Config config) {
- boolean mobProxyStatus = config.getUseBrowserMobProxy();
- if (mobProxyStatus) {
- config.setCaptureTraffic(true);
- }
- }
-}
-
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentTestActions.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentTestActions.java
deleted file mode 100644
index d05d3c5498..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentTestActions.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.setup;
-
-import com.aventstack.extentreports.ExtentTest;
-import com.aventstack.extentreports.MediaEntityBuilder;
-import com.aventstack.extentreports.Status;
-import com.aventstack.extentreports.markuputils.ExtentColor;
-import com.aventstack.extentreports.markuputils.Markup;
-import com.aventstack.extentreports.markuputils.MarkupHelper;
-import org.openecomp.sdc.ci.tests.api.SomeInterface;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Optional;
-import java.util.UUID;
-
-public final class ExtentTestActions {
-
- private static final SomeInterface testManager = ExtentTestManager.getInstance();
- private static final Logger LOGGER = LoggerFactory.getLogger(ExtentTestActions.class);
-
- private ExtentTestActions() {
-
- }
-
- public static void log(Status logStatus, Markup mark) {
- ExtentTest test = testManager.getTest();
- test.log(logStatus, mark);
- }
-
- public static void log(Status logStatus, String message) {
- ExtentTest test = testManager.getTest();
- test.log(logStatus, message);
- }
-
- public static void log(Status logStatus, String message, String duration) {
- log(logStatus, message + addDurationTag(duration));
- }
-
- public static void log(Status logStatus, Throwable throwabel) {
- ExtentTest test = testManager.getTest();
- test.log(logStatus, throwabel);
- }
-
- static void addTag(Status logStatus, String message) {
- Markup m = null;
- switch (logStatus) {
- case PASS:
- m = MarkupHelper.createLabel(message, ExtentColor.GREEN);
- break;
- case FAIL:
- m = MarkupHelper.createLabel(message, ExtentColor.RED);
- break;
- case SKIP:
- m = MarkupHelper.createLabel(message, ExtentColor.BLUE);
- break;
- case FATAL:
- m = MarkupHelper.createLabel(message, ExtentColor.BROWN);
- break;
- default:
- break;
- }
-
- if (m != null) {
- log(logStatus, m);
- }
- }
-
- public static Optional<String> takeScreenshot(final Status logStatus, final String screenshotName,
- final String message) {
- try {
- return Optional.of(addScreenshot(logStatus, screenshotName, message));
- } catch (final IOException e) {
- LOGGER.warn("Could not take screenshot", e);
- }
-
- return Optional.empty();
- }
-
- public static String addScreenshot(final Status logStatus, String screenshotName,
- final String message) throws IOException {
- final String[] splitUuid = UUID.randomUUID().toString().split("-");
- screenshotName = screenshotName + "-" + splitUuid[splitUuid.length - 1];
- final File imageFile = GeneralUIUtils.takeScreenshot(screenshotName, SetupCDTest.getScreenshotFolder());
- final String imageFilePath = new File(SetupCDTest.getReportFolder()).toURI().relativize(imageFile.toURI())
- .getPath();
- testManager.getTest()
- .log(logStatus, message, MediaEntityBuilder.createScreenCaptureFromPath(imageFilePath).build());
- return imageFilePath;
- }
-
- private static String addDurationTag(String duration) {
- return "<td width=\"80px\">" + duration + "</td>";
- }
-
- private static String addLinkTag(String fileName, String pathToFile) {
- return String.format("<a download=\"%s\" href=\"%s\">HAR file</a>", fileName, pathToFile);
- }
-
- static void addFileToReportAsLink(File harFile, String pathToFileFromReportDirectory, String message) {
- log(Status.INFO, message, addLinkTag(harFile.getName(), pathToFileFromReportDirectory));
- }
-
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentTestManager.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentTestManager.java
deleted file mode 100644
index 669cbe17ef..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ExtentTestManager.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.setup;
-
-import com.aventstack.extentreports.ExtentReports;
-import com.aventstack.extentreports.ExtentTest;
-import org.openecomp.sdc.ci.tests.api.SomeInterface;
-
-import java.util.HashMap;
-
-public class ExtentTestManager implements SomeInterface {
-
- private final HashMap<Long, ExtentTest> extentTestByThreadIdMap = new HashMap<>();
- private final ExtentReports extent = ExtentManager.getReporter();
- private static final ExtentTestManager INSTANCE = new ExtentTestManager();
-
- private ExtentTestManager() {
-
- }
-
- public static ExtentTestManager getInstance() {
- return INSTANCE;
- }
-
- @Override
- public synchronized ExtentTest getTest() {
- return extentTestByThreadIdMap.get(Thread.currentThread().getId());
- }
-
- public synchronized void endTest() {
- extent.flush();
- }
-
- public synchronized ExtentTest startTest(final String testName) {
- return startTest(testName, "");
- }
-
- public synchronized ExtentTest startTest(final String testName, final String desc) {
- final ExtentTest test = extent.createTest(testName, desc);
- extentTestByThreadIdMap.put(Thread.currentThread().getId(), test);
-
- return test;
- }
-
- public synchronized <T> void assignCategory(Class<T> clazz) {
- String[] parts = clazz.getName().split("\\.");
- String lastOne1 = parts[parts.length - 1];
- String lastOne2 = parts[parts.length - 2];
- extentTestByThreadIdMap.get(Thread.currentThread().getId()).assignCategory(lastOne2 + "-" + lastOne1);
- }
-}
-
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/MobProxy.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/MobProxy.java
deleted file mode 100644
index 70a1dd6f81..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/MobProxy.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.setup;
-
-import ch.qos.logback.classic.Level;
-import ch.qos.logback.classic.Logger;
-import ch.qos.logback.classic.LoggerContext;
-import com.github.markusbernhardt.proxy.ProxySearch;
-import com.github.markusbernhardt.proxy.ProxySearch.Strategy;
-import com.github.markusbernhardt.proxy.util.PlatformUtil;
-import com.github.markusbernhardt.proxy.util.PlatformUtil.Platform;
-import net.lightbody.bmp.BrowserMobProxyServer;
-import org.apache.http.HttpStatus;
-import org.slf4j.LoggerFactory;
-
-import java.net.InetSocketAddress;
-import java.net.Proxy;
-import java.net.ProxySelector;
-import java.net.SocketAddress;
-import java.net.URI;
-import java.util.HashMap;
-import java.util.List;
-
-public class MobProxy {
-
- private static HashMap<Long, BrowserMobProxyServer> mobProxyServerMap = new HashMap<Long, BrowserMobProxyServer>();
- private static InetSocketAddress localProxyAddress = getProxy();
-
- public static InetSocketAddress getProxy() {
- setLogger();
-
- ProxySearch proxySearch = new ProxySearch();
- if (PlatformUtil.getCurrentPlattform() == Platform.WIN) {
- proxySearch.addStrategy(Strategy.IE);
- proxySearch.addStrategy(Strategy.FIREFOX);
- proxySearch.addStrategy(Strategy.JAVA);
- } else if (PlatformUtil.getCurrentPlattform() == Platform.LINUX) {
- proxySearch.addStrategy(Strategy.GNOME);
- proxySearch.addStrategy(Strategy.KDE);
- proxySearch.addStrategy(Strategy.FIREFOX);
- proxySearch.addStrategy(Strategy.ENV_VAR);
- return null;
- } else {
- proxySearch.addStrategy(Strategy.OS_DEFAULT);
- }
- ProxySelector proxySelector = proxySearch.getProxySelector();
-
- ProxySelector.setDefault(proxySelector);
- URI home = URI.create("http://www.google.com");
- System.out.println("ProxySelector: " + proxySelector);
- System.out.println("URI: " + home);
- List<Proxy> proxyList = proxySelector.select(home);
- String host = null;
- String port = null;
- if (proxyList != null && !proxyList.isEmpty()) {
- for (Proxy proxy : proxyList) {
- System.out.println(proxy);
- SocketAddress address = proxy.address();
- if (address instanceof InetSocketAddress) {
- host = ((InetSocketAddress) address).getHostName();
- port = Integer.toString(((InetSocketAddress) address).getPort());
- System.setProperty("http.proxyHost", host);
- System.setProperty("http.proxyPort", port);
- }
- }
- }
- InetSocketAddress address = new InetSocketAddress(host, Integer.parseInt(port));
- return address;
- }
-
- // set logger for all classes connected to MobProxy
- public static void setLogger() {
- LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
- for (Logger logger : lc.getLoggerList()) {
- logger.setLevel(Level.INFO);
- }
- }
-
- public static synchronized void setProxyServer() {
- BrowserMobProxyServer server = new BrowserMobProxyServer();
- server.setTrustAllServers(true);
- if (localProxyAddress != null) {
- server.setChainedProxy(localProxyAddress);
- server.start();
- } else {
- server.start();
- // filter firefox requests to mozilla when system proxy is absent
- server.blacklistRequests(".*mozilla.*", HttpStatus.SC_OK);
- }
- addProxyServerToPull(Thread.currentThread().getId(), server);
- }
-
- public static synchronized BrowserMobProxyServer getPoxyServer() {
- return mobProxyServerMap.get(Thread.currentThread().getId());
- }
-
- public static void addProxyServerToPull(Long threadId, BrowserMobProxyServer server) {
- mobProxyServerMap.put(threadId, server);
- }
-
- public static synchronized void removePoxyServer() {
- if (getPoxyServer() != null) {
- getPoxyServer().stop();
- mobProxyServerMap.remove(Thread.currentThread().getId());
- }
- }
-
- public static void removeAllProxyServers() {
- for (Long threadNumber : mobProxyServerMap.keySet()) {
- mobProxyServerMap.get(threadNumber).stop();
- }
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/OnboardCSVReport.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/OnboardCSVReport.java
deleted file mode 100644
index c748a6bccf..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/OnboardCSVReport.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.setup;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.PrintWriter;
-
-public class OnboardCSVReport {
-
- private StringBuilder sb;
- private PrintWriter pw;
-
- public OnboardCSVReport(String filepath, String filename) {
- sb = new StringBuilder();
- try {
- File csvFile = new File(filepath + filename);
- pw = new PrintWriter(csvFile);
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- }
-
- }
-
- public StringBuilder appendStringToFile(String content) {
- return sb.append(content + ",");
- }
-
- public void openNewRow() {
- sb.append("\n");
- }
-
- public void writeRow(String... content) {
- for (String str : content) {
- appendStringToFile(str);
- }
- openNewRow();
- }
-
- public void closeFile() {
- pw.write(sb.toString());
- pw.close();
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ReportAfterTestManager.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ReportAfterTestManager.java
deleted file mode 100644
index e35ba05004..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/ReportAfterTestManager.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.setup;
-
-import com.aventstack.extentreports.Status;
-import org.apache.commons.lang3.StringUtils;
-import org.openecomp.sdc.ci.tests.execute.setup.ExtentManager.suiteNameXml;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.ITestContext;
-import org.testng.ITestResult;
-
-import java.io.IOException;
-
-import static org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions.addScreenshot;
-import static org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions.addTag;
-import static org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions.log;
-
-public class ReportAfterTestManager {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(ReportAfterTestManager.class);
- private static String testName;
- private static Throwable throwable;
- private static String exceptionMsgFormat = "%s - The following exception occurred:";
-
- private ReportAfterTestManager() {
-
- }
-
- public static void report(final ITestResult result, final ITestContext context) {
- testName = result.getName();
- throwable = result.getThrowable();
-
- final String suiteName = ExtentManager.getSuiteName(context);
-
- switch (result.getStatus()) {
- case ITestResult.SUCCESS:
- logSuccessAfterTest();
- break;
-
- case ITestResult.FAILURE:
- logFailure(suiteName);
- break;
-
- case ITestResult.SKIP:
- logSkipAfterTest();
- break;
-
- default:
- break;
- }
-
- }
-
- private static void logSuccessAfterTest() {
- addTag(Status.PASS, "Success");
- takeScreenshot(Status.PASS);
- }
-
- private static void logFailAfterTest() {
- addTag(Status.FAIL, "Failure");
- log(Status.ERROR, String.format(exceptionMsgFormat, Status.ERROR));
- log(Status.ERROR, throwable);
- takeScreenshot(Status.FAIL);
- }
-
- private static void logSkipAfterTest() {
- addTag(Status.SKIP, "Skipped");
- log(Status.SKIP, String.format(exceptionMsgFormat, Status.SKIP));
- log(Status.SKIP, throwable);
- takeScreenshot(Status.SKIP);
- }
-
- private static void logFatalAfterTest() {
- addTag(Status.FATAL, "Fatal");
- log(Status.FATAL, String.format(exceptionMsgFormat, Status.FATAL));
- log(Status.FATAL, throwable);
- takeScreenshot(Status.FATAL);
- }
-
- private static void takeScreenshot(final Status status) {
- String adjustedTestName = testName;
- String infoFromDataProvider = WindowTestManager.getWindowMap().getAddedValueFromDataProvider();
- if (StringUtils.isNotEmpty(infoFromDataProvider)) {
- infoFromDataProvider = infoFromDataProvider.replace(":", "-");
- adjustedTestName = String.format("%s | %s", testName, infoFromDataProvider);
- }
- try {
- addScreenshot(status, adjustedTestName, "Finished the test with the following screenshot:");
- } catch (final IOException e) {
- final String warnMsg = "Could not take screenshot of the final screen";
- LOGGER.warn(warnMsg, e);
- log(Status.WARNING, String.format("%s: %s", warnMsg, e.getMessage()));
- }
- }
-
- private static void logFailure(final String suiteName) {
- if (suiteNameXml.TESTNG_FAILED_XML_NAME.getValue().equals(suiteName)) {
- logFatalAfterTest();
- } else {
- logFailAfterTest();
- }
- }
-
-}
-
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/Retry.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/Retry.java
deleted file mode 100644
index b28f64e887..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/Retry.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.setup;
-
-import org.testng.IRetryAnalyzer;
-import org.testng.ITestResult;
-
-public class Retry implements IRetryAnalyzer {
- private int retryCount = 0;
- private int maxRetryCount = 1;
-
- public boolean retry(ITestResult result) {
-
- if (retryCount < maxRetryCount) {
- retryCount++;
- return true;
- }
- return false;
- }
-
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/SetupCDTest.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/SetupCDTest.java
deleted file mode 100644
index a700a0d4b6..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/SetupCDTest.java
+++ /dev/null
@@ -1,527 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.setup;
-
-import ch.qos.logback.classic.Level;
-import ch.qos.logback.classic.LoggerContext;
-import com.aventstack.extentreports.ExtentTest;
-import com.aventstack.extentreports.Status;
-import net.lightbody.bmp.core.har.Har;
-import org.json.simple.JSONObject;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.config.UserCredentialsFromFile;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.UserCredentials;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.execute.sanity.OnboardingFlowsUi;
-import org.openecomp.sdc.ci.tests.execute.setup.ExtentManager.suiteNameXml;
-import org.openecomp.sdc.ci.tests.pages.HomePage;
-import org.openecomp.sdc.ci.tests.run.StartTest;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.RestCDUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.AutomationUtils;
-import org.openqa.selenium.By;
-import org.openqa.selenium.JavascriptExecutor;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.support.ui.ExpectedConditions;
-import org.openqa.selenium.support.ui.WebDriverWait;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.Assert;
-import org.testng.ITestContext;
-import org.testng.ITestResult;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.AfterSuite;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.BeforeSuite;
-import org.testng.annotations.Optional;
-import org.testng.annotations.Parameters;
-import org.testng.annotations.Test;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.UUID;
-
-public abstract class SetupCDTest extends DriverFactory {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(SetupCDTest.class);
-
- private static final String RE_RUN = "<html><font color=\"red\">ReRun - </font></html>";
- private static final String WEB_SEAL_PASSWORD = "123123a";
- protected static final String HEAT_FILE_YAML_NAME_PREFIX = "Heat-File";
- protected static final String HEAT_FILE_YAML_NAME_SUFFIX = ".yaml";
- private static final int BASIC_SLEEP_DURATION = 1000;
-
- /**************** CONSTANTS ****************/
- private static final String CREDENTIALS_FILE = "credentials.yaml";
-
- private static final String REPORT_FILE_NAME = "SDC_UI_Extent_Report.html";
- private static final String REPORT_FOLDER = "." + File.separator + "ExtentReport" + File.separator;
- private static final String SCREENSHOT_FOLDER = REPORT_FOLDER + "screenshots" + File.separator;
- private static final String HAR_FILES_FOLDER_NAME = "har_files";
- private static final String HAR_FILES_FOLDER = REPORT_FOLDER + HAR_FILES_FOLDER_NAME + File.separator;
-
- private static final String SHORT_CSV_REPORT_FILE_NAME = "ShortReport.csv";
-
- private static final int NUM_OF_ATTEMPTS_TO_REFTRESH = 2;
-
- /**************** PRIVATES ****************/
- private static String url;
-
- private static boolean uiSimulator;
- private static boolean localEnv = true;
- private static OnboardCSVReport csvReport;
- private final UserCredentialsFromFile credentialsIns = UserCredentialsFromFile.getInstance();
- private static ITestContext myContext;
-
- public SetupCDTest() {
- LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
- lc.getLogger("org.apache").setLevel(Level.INFO);
- }
-
- public static ExtentTest getExtendTest() {
- return ExtentTestManager.getInstance().getTest();
- }
-
- public static WindowTest getWindowTest() {
- return WindowTestManager.getWindowMap();
- }
-
- private OnboardCSVReport getCsvReport() {
- return csvReport;
- }
-
- public static String getReportFolder() {
- return REPORT_FOLDER;
- }
-
- public static String getScreenshotFolder() {
- return SCREENSHOT_FOLDER;
- }
-
- private static String getHarFilesFolder() {
- return HAR_FILES_FOLDER;
- }
-
-
- protected abstract UserRoleEnum getRole();
-
- /**************** BEFORE ****************/
-
- @BeforeSuite(alwaysRun = true)
- public void setupBeforeSuite(ITestContext context) throws Exception {
- RestCDUtils.deleteOnDemand();
- myContext = context;
- setErrorConfigurationFile();
- setUrl();
- ExtentManager.initReporter(getReportFolder(), REPORT_FILE_NAME, context);
- csvReport = new OnboardCSVReport(getReportFolder(), SHORT_CSV_REPORT_FILE_NAME);
- }
-
- private static void setErrorConfigurationFile() {
- if (!System.getProperty("os.name").contains("Windows")) {
- String errorConfigurationFilename = getConfig().getErrorConfigurationFile();
- errorConfigurationFilename = errorConfigurationFilename.substring(errorConfigurationFilename.lastIndexOf("/") + 1, errorConfigurationFilename.length());
- getConfig().setErrorConfigurationFile(FileHandling.getBasePath() + File.separator + "conf" + File.separator + errorConfigurationFilename);
- if (new File(getConfig().getErrorConfigurationFile()).exists()) {
- System.out.println("Found error-configuration.yaml in : " + getConfig().getErrorConfigurationFile());
- }
- }
- }
-
- @BeforeMethod(alwaysRun = true)
- public void setBrowserBeforeTest(java.lang.reflect.Method method, ITestContext context) throws Exception {
-
- boolean emptyDataProvider = method.getAnnotation(Test.class).dataProvider().isEmpty();
- String className = method.getDeclaringClass().getName();
- if (emptyDataProvider && !className.contains("ToscaValidationTest")) {
- System.out.println("ExtentReport instance started from BeforeMethod...");
- String suiteName = ExtentManager.getSuiteName(context);
- if (suiteName.equals(suiteNameXml.TESTNG_FAILED_XML_NAME.getValue())) {
- ExtentTestManager.getInstance().startTest(RE_RUN + method.getName());
- } else {
- ExtentTestManager.getInstance().startTest(method.getName());
- }
-
- ExtentTestManager.getInstance().assignCategory(this.getClass());
- setBrowserBeforeTest(getRole());
- } else {
- System.out.println("ExtentReport instance started from Test...");
- }
-
- getConfig().setWindowsDownloadDirectory(getWindowTest().getDownloadDirectory());
-
- if (getConfig().getCaptureTraffic()) {
- try {
- MobProxy.getPoxyServer().newHar(method.getName() + ".har");
- } catch (Throwable e) {
- e.printStackTrace();
- }
- }
- }
-
- /**************** AFTER ****************/
- @AfterMethod(alwaysRun = true)
- public void quitAfterTest(final ITestResult result, final ITestContext context) throws Exception {
- try {
- ReportAfterTestManager.report(result, context);
- GeneralUIUtils.closeErrorMessage();
- } finally {
- try {
- if (getConfig().getCaptureTraffic()) {
- addTrafficFileToReport(result);
- }
-
- if (result.getInstanceName().equals(OnboardingFlowsUi.class.getName()) && result.getStatus() == ITestResult.FAILURE) {
- final String msg = "Onboarding test failed, closing browser";
- LOGGER.info(msg);
- getExtendTest().log(Status.INFO, msg);
- quitDriver();
- } else if (!getUser().getRole().toLowerCase().equals(UserRoleEnum.ADMIN.name().toLowerCase())) {
- boolean navigateToHomePageSuccess = HomePage.navigateToHomePage();
- if (!navigateToHomePageSuccess) {
- final String msg = "Navigating to homepage failed, reopening driver";
- LOGGER.info(msg);
- getExtendTest().log(Status.INFO, msg);
- quitDriver();
- }
- }
-
- } catch (final Exception e) {
- LOGGER.error("An unexpected error has occurred", e);
- getExtendTest().log(Status.ERROR, "Exception:" + e.toString());
- }
-
-
- ExtentTestManager.getInstance().endTest();
- final String suiteName = ExtentManager.getSuiteName(context);
-// write result to csv file
- if ((!suiteNameXml.TESTNG_FAILED_XML_NAME.getValue().equals(suiteName)) && (result.getStatus() == ITestResult.SKIP)) {
- addResultToCSV(result, context);
- }
- if (suiteNameXml.TESTNG_FAILED_XML_NAME.getValue().equals(suiteName) && !(result.getStatus() == ITestResult.SUCCESS)) {
- addResultToCSV(result, context);
- }
- FileHandling.cleanCurrentDownloadDir();
- }
-
- }
-
- private void addResultToCSV(ITestResult result, ITestContext context) {
- ExtentTest test = getExtendTest();
- com.aventstack.extentreports.model.Test model = test.getModel();
- String name = model.getName();
- String status = model.getStatus().toString();
- getCsvReport().writeRow(result.getInstanceName(), name.replace(RE_RUN, ""), status);
- }
-
- private void generateReport4Jenkins(ITestContext context) {
- final String suiteName = ExtentManager.getSuiteName(context);
- final JSONObject obj = new JSONObject();
- final String success = Integer.toString(context.getPassedTests().size());
- final String failed = Integer.toString(context.getFailedTests().size());
- final String total = Integer.toString(context.getFailedTests().size() + context.getPassedTests().size());
- obj.put("projectName", "SDC-ONAP-UI-Automation-" + suiteName);
- obj.put("projectVersion", AutomationUtils.getOSVersion());
- obj.put("platform", "Linux");
- obj.put("total", total);
- obj.put("success", success);
- obj.put("failed", failed);
-
- try (FileWriter file = new FileWriter(getReportFolder() + "jenkinsResults.json")) {
- file.write(obj.toJSONString());
- file.flush();
- } catch (final IOException e) {
- LOGGER.debug("An error has occurred while writing 'jenkinsResults.json' file", e);
- }
-
- LOGGER.debug(obj.toJSONString());
- }
-
-
- @Parameters({"eraseAfterTests"})
- @AfterSuite(alwaysRun = true)
- public void afterSuite2(@Optional("true") String eraseAfterTestsReadValue) throws Exception {
-
- csvReport.closeFile();
- generateReport4Jenkins(myContext);
-
- if (Boolean.parseBoolean(eraseAfterTestsReadValue)) {
- RestCDUtils.deleteOnDemand();
- } else {
- System.out.println("Resources will not be deleted according to suite configuration ...");
- }
-
- if (getConfig().getUseBrowserMobProxy()) {
- MobProxy.getPoxyServer().stop();
- }
- }
-
- private static String setUrl() {
- url = getConfig().getUrl();
- uiSimulator = getConfig().isUiSimulator();
- if (url == null) {
- String message = "no URL found";
- System.out.println(message);
- Assert.fail(message);
- } else if (!url.contains("localhost") && !url.contains("192.168.33.10") && !url.contains("127.0.0.1") && !url.contains("192.168.50.5") && !uiSimulator) {
- localEnv = false;
- }
- return url;
- }
-
-
- private static void navigateToUrl(final String url) {
- try {
- LOGGER.info("Deleting cookies");
- deleteCookies();
- LOGGER.info("Navigating to URL : " + url);
- getDriver().navigate().to(url);
- GeneralUIUtils.waitForLoader();
- LOGGER.info("Zooming out");
- GeneralUIUtils.windowZoomOutUltimate();
- } catch (Exception e) {
- final String errorMsg = String.format("Could not navigate to '%s'", url);
- LOGGER.error(errorMsg, e);
- getExtendTest().log(Status.ERROR, errorMsg);
- Assert.fail(errorMsg);
- }
- }
-
- private static void deleteCookies() throws Exception {
- getDriver().manage().deleteAllCookies();
- Thread.sleep(BASIC_SLEEP_DURATION);
-
- int attempts = 0;
- final int max_attempts = 3;
-
- while (!getDriver().manage().getCookies().isEmpty() && attempts < max_attempts) {
- getExtendTest().log(Status.INFO, "Trying to delete cookies one more time - " + (attempts + 1) + "/" + max_attempts + "attempts");
- String deleteCookiesJS = "document.cookie.split(';').forEach(function(c) { document.cookie = c.replace(/^ +/, '').replace(/=.*/, '=;expires=' + new Date().toUTCString() + ';path=/'); });";
- ((JavascriptExecutor) getDriver()).executeScript(deleteCookiesJS);
- attempts++;
-
- if (attempts == max_attempts) {
- String msg = "Did not delete cookies, can't login as user " + WindowTestManager.getWindowMap().getUser().getRole();
- System.out.println(msg);
- getExtendTest().log(Status.ERROR, msg);
- Assert.fail(msg);
- }
- }
- }
-
- private void loginToSystem(UserRoleEnum role) throws Exception {
- final int gettingWebElementTimeOut = 30;
- UserCredentials credentials = new UserCredentials(role.getUserId(), role.getPassword(), role.getFirstName(), role.getLastName(), role.name());
- if (localEnv) {
- loginToSimulator(role);
- } else {
- sendUserAndPasswordKeys(credentials);
- WebElement submitButton = GeneralUIUtils.getWebElementBy(By.name("btnSubmit"), gettingWebElementTimeOut);
- submitButton.click();
- WebElement buttonOK = GeneralUIUtils.getWebElementBy(By.name("successOK"), gettingWebElementTimeOut);
- Assert.assertTrue(buttonOK.isDisplayed(), "OK button is not displayed.");
- buttonOK.click();
- }
- GeneralUIUtils.ultimateWait();
- getWindowTest().setUser(credentials);
- }
-
- private void goToHomePage(UserRoleEnum role) throws Exception {
- final int gettingButtonTimeOut = 10;
- try {
- getWindowTest().setRefreshAttempts(getWindowTest().getRefreshAttempts() == 0 ? NUM_OF_ATTEMPTS_TO_REFTRESH : getWindowTest().getRefreshAttempts());
- if (!role.equals(UserRoleEnum.ADMIN)) {
-
- WebElement closeButton = GeneralUIUtils.getClickableButtonBy(By.className("sdc-welcome-close"), gettingButtonTimeOut);
- if (closeButton != null) {
- closeButton.click();
- }
-
- if (!GeneralUIUtils.isElementVisibleByTestId(DataTestIdEnum.MainMenuButtons.HOME_BUTTON.getValue())) {
- restartBrowser(role);
- }
- }
- } catch (Exception e) {
- restartBrowser(role);
- }
- }
-
- private void restartBrowser(UserRoleEnum role) throws Exception {
- getWindowTest().setRefreshAttempts(getWindowTest().getRefreshAttempts() - 1);
- if (getWindowTest().getRefreshAttempts() <= 0) {
- System.out.println("ERR : Something is wrong with browser!");
- Assert.fail("ERR : Something is wrong with browser!");
- }
- System.out.println("Trying again...");
- getExtendTest().log(Status.INFO, "Trying again...");
- getExtendTest().log(Status.INFO, String.format("%s attempt(s) left", getWindowTest().getRefreshAttempts()));
- System.out.println(String.format("%s attempt(s) left", getWindowTest().getRefreshAttempts()));
-
- reloginWithNewRole(role);
- }
-
- private void loginToSimulator(UserRoleEnum role) {
- final int gettingWebElementTimeOut = 30;
- WebDriver driver = GeneralUIUtils.getDriver();
- WebDriverWait wait = new WebDriverWait(driver, gettingWebElementTimeOut);
-
- wait.until(ExpectedConditions.visibilityOf(driver.findElement(By.xpath("//*[@method='" + "post" + "']"))));
-
- WebElement userIdTextbox = GeneralUIUtils.getWebElementBy(By.name("userId"));
- userIdTextbox.sendKeys(role.getUserId());
- WebElement passwordTextbox = GeneralUIUtils.getWebElementBy(By.name("password"));
- passwordTextbox.sendKeys(WEB_SEAL_PASSWORD);
-
- wait.until(ExpectedConditions.elementToBeClickable(driver.findElement(By.xpath("//*[@value='" + "Login" + "']")))).click();
- }
-
- private void sendUserAndPasswordKeys(UserCredentials userId) {
- System.out.println("Login as user : " + userId.getUserId());
- WebElement userNameTextbox = GeneralUIUtils.getWebElementBy(By.name("userid"));
- userNameTextbox.sendKeys(userId.getUserId());
- WebElement passwordTextbox = GeneralUIUtils.getWebElementBy(By.name("password"));
- passwordTextbox.sendKeys(userId.getPassword());
- }
-
- private void loginWithUser(final UserRoleEnum role) {
- try {
- final String msg = String
- .format("Login as user '%s', role '%s'", role.getUserId(), role.getUserRole());
- getExtendTest().log(Status.INFO, msg);
- LOGGER.info(msg);
- loginToSystem(role);
- LOGGER.debug("Going to home page");
- goToHomePage(role);
- } catch (final Exception e) {
- throw new RuntimeException(e);
- } finally {
- getWindowTest().setPreviousRole(getWindowTest().getUser().getRole());
- }
- }
-
- private void setUser(UserRoleEnum role) {
- User user = new User();
- user.setUserId(role.getUserId());
- user.setFirstName(role.getFirstName());
- user.setRole(role.name());
- user.setLastName(role.getLastName());
-
- getWindowTest().setUser(user);
- }
-
- public User getUser() {
- return getWindowTest().getUser();
- }
-
- private void setBrowserBeforeTest(final UserRoleEnum role) {
- LOGGER.info(String.format("Setup before test for role '%s'", role.name()));
- if (!getWindowTest().getPreviousRole().equalsIgnoreCase(role.name())) {
- LOGGER.info(String.format("Logging in with new role '%s'. Previous role was: '%s'.", role.name(),
- getWindowTest().getPreviousRole()));
- navigateAndLogin(role);
- }
- }
-
- private void navigateAndLogin(final UserRoleEnum role) {
- getWindowTest().setRefreshAttempts(getWindowTest().getRefreshAttempts());
- setUser(role);
- navigateToUrl(url);
- loginWithUser(role);
- GeneralUIUtils.ultimateWait();
- }
-
- public User getUser(UserRoleEnum role) {
- User user = new User();
- user.setUserId(role.getUserId());
- user.setFirstName(role.getFirstName());
- user.setLastName(role.getLastName());
- user.setRole(role.name());
- return user;
- }
-
- protected void reloginWithNewRole(final UserRoleEnum role) {
- navigateAndLogin(role);
- }
-
- private void addTrafficFileToReport(ITestResult result) {
- try {
- // Get the HAR data
- Har har = MobProxy.getPoxyServer().getHar();
- String shortUUID = UUID.randomUUID().toString().split("-")[0];
- File harFile = new File(getHarFilesFolder() + result.getName() + shortUUID + ".har");
- new File(getHarFilesFolder()).mkdirs();
-
- har.writeTo(harFile);
-
- String pathToFileFromReportDirectory = HAR_FILES_FOLDER_NAME + File.separator + harFile.getName();
- ExtentTestActions.addFileToReportAsLink(harFile, pathToFileFromReportDirectory, "File with captured traffic");
- } catch (IOException ioe) {
- ioe.printStackTrace();
- }
- }
-
- /*
- * * Start section of test in ExtentReport with DataProvider parameters,
- * should be started from test method, see example in onboardVNFTest
- */
- public void setLog(String fromDataProvider) {
-
- String suiteName = ExtentManager.getSuiteName(myContext);
- if (suiteNameXml.TESTNG_FAILED_XML_NAME.getValue().equals(suiteName)) {
- ExtentTestManager.getInstance().startTest(RE_RUN + Thread.currentThread().getStackTrace()[2].getMethodName() + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + fromDataProvider);
- } else {
- ExtentTestManager.getInstance().startTest(Thread.currentThread().getStackTrace()[2].getMethodName() + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + fromDataProvider);
- }
-
-
- getWindowTest().setAddedValueFromDataProvider(fromDataProvider);
- ExtentTestManager.getInstance().assignCategory(this.getClass());
- setBrowserBeforeTest(getRole());
- }
-
-
- /**************** MAIN ****************/
- public static void main(String[] args) {
- System.out.println("---------------------");
- System.out.println("running test from CLI");
- System.out.println("---------------------");
-
- String attsdcFilePath = FileHandling.getBasePath() + File.separator + "conf" + File.separator + "attsdc.yaml";
- System.setProperty("config.resource", attsdcFilePath);
- System.out.println("attsdc.yaml file path is : " + attsdcFilePath);
-
- String filepath = FileHandling.getBasePath() + File.separator + "Files" + File.separator;
- System.setProperty("filePath", filepath);
- System.out.println("filePath is : " + System.getProperty("filePath"));
-
- Object[] testSuitsList = FileHandling.filterFileNamesFromFolder(FileHandling.getBasePath() + File.separator + "testSuites", ".xml");
- if (testSuitsList != null) {
- System.out.println(String.format("Found %s testSuite(s)", testSuitsList.length));
- args = Arrays.copyOf(testSuitsList, testSuitsList.length, String[].class);
- StartTest.main(args);
- }
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/TestFtp.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/TestFtp.java
deleted file mode 100644
index bb48cbddb8..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/TestFtp.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.setup;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-
-public class TestFtp {
-
- public static void main(String[] args) throws IOException {
- AttFtpClient instance = AttFtpClient.getFtpClient();
-
- String server = "localhost";
- final int port = 2121;
- String user = "admin";
- String pass = "admin";
- AttFtpClient.getFtpClient().init(server, port, user, pass);
-
- try {
- AttFtpClient.getFtpClient().retrieveListOfFile();
-
- File retrieveLastModifiedFileFromFTP = instance.retrieveLastModifiedFileFromFTP();
- String content = new String(Files.readAllBytes(Paths.get(retrieveLastModifiedFileFromFTP.getPath())), StandardCharsets.UTF_8);
-// instance.deleteFilesFromFTPserver();
- System.out.println(content);
- readFile(retrieveLastModifiedFileFromFTP);
-
- } finally {
- instance.terminateClient();
- }
-
-
- }
-
- private static void readFile(File retrieveLastModifiedFileFromFTP) {
-
- StringBuilder sb = new StringBuilder();
- BufferedReader br = null;
- FileReader fileReader = null;
- try {
- fileReader = new FileReader(retrieveLastModifiedFileFromFTP.getPath());
- br = new BufferedReader(fileReader);
- String line;
- while ((line = br.readLine()) != null) {
- if (sb.length() > 0) {
- sb.append("\n");
- }
- sb.append(line);
- }
- } catch (IOException e) {
- System.out.println(e);
- } finally {
- try {
- if (br != null) {
- br.close();
- }
- if (fileReader != null) {
- fileReader.close();
- }
- } catch (IOException ex) {
- System.out.println(ex);
- }
- }
- String contents = sb.toString();
- System.out.println(contents);
-
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/WebDriverThread.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/WebDriverThread.java
deleted file mode 100644
index 6118fa2fee..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/WebDriverThread.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.setup;
-
-import net.lightbody.bmp.BrowserMobProxyServer;
-import net.lightbody.bmp.client.ClientUtil;
-import net.lightbody.bmp.proxy.CaptureType;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.exception.WebDriverThreadRuntimeException;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openqa.selenium.Platform;
-import org.openqa.selenium.UnexpectedAlertBehaviour;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.firefox.FirefoxDriver;
-import org.openqa.selenium.firefox.FirefoxProfile;
-import org.openqa.selenium.remote.CapabilityType;
-import org.openqa.selenium.remote.DesiredCapabilities;
-import org.openqa.selenium.remote.LocalFileDetector;
-import org.openqa.selenium.remote.RemoteWebDriver;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.UUID;
-
-public class WebDriverThread {
-
- private final static Logger LOGGER = LoggerFactory.getLogger(SetupCDTest.class);
-
- static final String AUTOMATION_DOWNLOAD_DIR = "automationDownloadDir";
- private WebDriver webdriver;
- private FirefoxProfile firefoxProfile;
- private static final String SELENIUM_NODE_URL = "http://%s:%s/wd/hub";
-
- WebDriverThread(Config config) {
- initDriver(config);
- webdriver.manage().window().maximize();
- }
-
- public WebDriver getDriver() {
- return webdriver;
- }
-
- void quitDriver() {
- if (webdriver != null) {
- webdriver.quit();
- webdriver = null;
- }
- }
-
-
- private void initDriver(final Config config) {
- if (config.isRemoteTesting()) {
- LOGGER.info("Opening REMOTE browser");
- final String remoteEnvIP = config.getRemoteTestingMachineIP();
- final String remoteEnvPort = config.getRemoteTestingMachinePort();
-
- final DesiredCapabilities cap = DesiredCapabilities.firefox();
- cap.setPlatform(Platform.ANY);
- cap.setBrowserName("firefox");
-
- final String remoteUrlString = String.format(SELENIUM_NODE_URL, remoteEnvIP, remoteEnvPort);
- final URL remoteUrl;
- try {
- remoteUrl = new URL(remoteUrlString);
- } catch (MalformedURLException e) {
- throw new WebDriverThreadRuntimeException(String.format("Malformed URL '%s'", remoteUrlString), e);
- }
- final RemoteWebDriver remoteWebDriver = new RemoteWebDriver(remoteUrl, cap);
- remoteWebDriver.setFileDetector(new LocalFileDetector());
- webdriver = remoteWebDriver;
- } else {
- if (config.getUseBrowserMobProxy()) {
- setWebDriverWithMobProxy();
- return;
- }
-
- LOGGER.info("Opening LOCAL browser");
-
- final DesiredCapabilities cap = DesiredCapabilities.firefox();
- cap.setBrowserName("firefox");
- cap.setCapability(FirefoxDriver.PROFILE, initFirefoxProfile());
- //unexpected model dialog fix.
- cap.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR, UnexpectedAlertBehaviour.ACCEPT);
-
- firefoxProfile.setPreference("network.proxy.type", 2);
- firefoxProfile.setPreference("network.proxy.autoconfig_url", "http://autoproxy.sbc.com/autoproxy.cgi");
- firefoxProfile.setPreference("network.proxy.no_proxies_on", "localhost");
-
- webdriver = new FirefoxDriver(cap);
- }
- }
-
- private FirefoxProfile initFirefoxProfile() {
- firefoxProfile = new FirefoxProfile();
- firefoxProfile.setPreference("browser.download.folderList", 2);
- firefoxProfile.setPreference("browser.download.manager.showWhenStarting", false);
- firefoxProfile.setPreference("browser.download.dir", getDownloadDirectory());
- firefoxProfile.setPreference("browser.helperApps.neverAsk.saveToDisk", "application/octet-stream, application/xml, text/plain, text/xml, image/jpeg");
- return firefoxProfile;
- }
-
- private String getDownloadDirectory() {
- String downloadDirectory = FileHandling.getBasePath() + File.separator + AUTOMATION_DOWNLOAD_DIR + UUID.randomUUID().toString().split("-")[0] + File.separator;
- File dir = new File(downloadDirectory);
- if (!dir.exists()) {
- dir.mkdirs();
- }
- return dir.getAbsolutePath();
- }
-
- FirefoxProfile getFirefoxProfile() {
- return firefoxProfile;
- }
-
- private void setWebDriverWithMobProxy() {
- WebDriver driver = null;
- MobProxy.setProxyServer();
- BrowserMobProxyServer proxyServer = MobProxy.getPoxyServer();
-
- firefoxProfile = new FirefoxProfile();
- firefoxProfile.setPreference("browser.download.folderList", 2);
- firefoxProfile.setPreference("browser.download.manager.showWhenStarting", false);
- firefoxProfile.setPreference("browser.download.dir", getDownloadDirectory());
- firefoxProfile.setPreference("browser.helperApps.neverAsk.saveToDisk", "application/octet-stream, application/xml, text/plain, text/xml, image/jpeg");
- firefoxProfile.setAcceptUntrustedCertificates(true);
- firefoxProfile.setAssumeUntrustedCertificateIssuer(true);
-
- DesiredCapabilities capabilities = new DesiredCapabilities();
-
- capabilities.setCapability(FirefoxDriver.PROFILE, firefoxProfile);
- capabilities.setCapability(CapabilityType.PROXY, ClientUtil.createSeleniumProxy(proxyServer));
- capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
-
- webdriver = new FirefoxDriver(capabilities);
- proxyServer.enableHarCaptureTypes(CaptureType.REQUEST_CONTENT, CaptureType.RESPONSE_CONTENT, CaptureType.REQUEST_COOKIES, CaptureType.REQUEST_BINARY_CONTENT,
- CaptureType.REQUEST_HEADERS, CaptureType.RESPONSE_COOKIES, CaptureType.RESPONSE_HEADERS, CaptureType.RESPONSE_BINARY_CONTENT);
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/WindowTest.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/WindowTest.java
deleted file mode 100644
index 1de4b4c799..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/WindowTest.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.setup;
-
-import org.openecomp.sdc.be.model.User;
-
-import java.io.File;
-
-public class WindowTest {
-
- public WindowTest() {
- refreshAttempts = 0;
- previousRole = "";
- addedValueFromDataProvider = null;
- try {
- downloadDirectory = DriverFactory.getDriverFirefoxProfile().getStringPreference("browser.download.dir", null) + File.separator;
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- private int refreshAttempts;
- private String previousRole;
- private User user;
- private String addedValueFromDataProvider;
- private String downloadDirectory;
-
- public int getRefreshAttempts() {
- return refreshAttempts;
- }
-
- public void setRefreshAttempts(int refreshAttempts) {
- this.refreshAttempts = refreshAttempts;
- }
-
- public String getPreviousRole() {
- return previousRole;
- }
-
- public void setPreviousRole(String previousRole) {
- this.previousRole = previousRole;
- }
-
- public User getUser() {
- return user;
- }
-
- public void setUser(User user) {
- this.user = user;
- }
-
- public synchronized String getAddedValueFromDataProvider() {
- return addedValueFromDataProvider;
- }
-
- public synchronized void setAddedValueFromDataProvider(String addedValueFromDataProvider) {
- this.addedValueFromDataProvider = addedValueFromDataProvider;
- }
-
- public String getDownloadDirectory() {
- return downloadDirectory;
- }
-
- public void setDownloadDirectory(String downloadDirectory) {
- this.downloadDirectory = downloadDirectory;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/WindowTestManager.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/WindowTestManager.java
deleted file mode 100644
index ad67fab8e8..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/WindowTestManager.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.execute.setup;
-
-import java.util.HashMap;
-
-public class WindowTestManager {
-
- private static HashMap<Long, WindowTest> windowMap = new HashMap<Long, WindowTest>();
-
- public static synchronized WindowTest getWindowMap() {
- Long currentThreadId = Thread.currentThread().getId();
- boolean containsKey = windowMap.containsKey(currentThreadId);
- if (!containsKey) {
- setWindowMap(currentThreadId);
- }
- return windowMap.get(currentThreadId);
- }
-
- private static synchronized void setWindowMap(Long currentThreadId) {
- WindowTestManager.windowMap.put(currentThreadId, new WindowTest());
- }
-
- public static synchronized void removeWindowTest() {
- windowMap.remove(Thread.currentThread().getId());
- }
-
- public static synchronized HashMap<Long, WindowTest> getWholeMap() {
- return windowMap;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/flow/AbstractUiTestFlow.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/flow/AbstractUiTestFlow.java
deleted file mode 100644
index ed4d456937..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/flow/AbstractUiTestFlow.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.flow;
-
-import com.aventstack.extentreports.ExtentTest;
-import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestManager;
-import org.openecomp.sdc.ci.tests.flow.exception.MissingParameterRuntimeException;
-import org.openecomp.sdc.ci.tests.pages.PageObject;
-import org.openqa.selenium.WebDriver;
-
-public abstract class AbstractUiTestFlow implements UiTestFlow {
-
- protected final WebDriver webDriver;
- protected final ExtentTest extendTest = ExtentTestManager.getInstance().getTest();
-
- public AbstractUiTestFlow(final WebDriver webDriver) {
- this.webDriver = webDriver;
- }
-
- public <T extends PageObject> T findParameter(final PageObject[] pageObjects,
- final Class<T> expectedParameterType) {
- for (final PageObject uiTestFlow : pageObjects) {
- if(expectedParameterType.isInstance(uiTestFlow)) {
- return (T) uiTestFlow;
- }
- }
-
- throw new MissingParameterRuntimeException(expectedParameterType.getName());
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/flow/CheckSoftwareVersionPropertyFlow.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/flow/CheckSoftwareVersionPropertyFlow.java
deleted file mode 100644
index c91f89370d..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/flow/CheckSoftwareVersionPropertyFlow.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.flow;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.ci.tests.pages.PageObject;
-import org.openecomp.sdc.ci.tests.pages.ResourceLeftSideMenu;
-import org.openecomp.sdc.ci.tests.pages.ResourcePropertiesAssignmentPage;
-import org.openqa.selenium.WebDriver;
-
-import java.util.List;
-import java.util.Optional;
-
-import static org.hamcrest.Matchers.containsInAnyOrder;
-import static org.hamcrest.Matchers.hasSize;
-import static org.junit.Assert.assertThat;
-
-/**
- * UI Flow for checking the software version property in a resource
- */
-public class CheckSoftwareVersionPropertyFlow extends AbstractUiTestFlow {
-
- private final List<String> expectedSoftwareVersionList;
-
- public CheckSoftwareVersionPropertyFlow(final WebDriver webDriver, final List<String> expectedSoftwareVersionList) {
- super(webDriver);
- this.expectedSoftwareVersionList = expectedSoftwareVersionList;
- }
-
- @Override
- public Optional<PageObject> run(final PageObject... pageObjects) {
- final ResourceLeftSideMenu resourceLeftSideMenu = new ResourceLeftSideMenu(webDriver);
- resourceLeftSideMenu.isLoaded();
-
- final ResourcePropertiesAssignmentPage resourcePropertiesAssignmentPage = accessPropertiesAssignmentPage();
-
- checkSoftwareVersionProperty(resourcePropertiesAssignmentPage);
- return Optional.empty();
- }
-
- /**
- * Checks if the software_version property values are as expected by the {@link #expectedSoftwareVersionList}.
- *
- * @param resourcePropertiesAssignmentPage the resource properties assignment page
- */
- private void checkSoftwareVersionProperty(final ResourcePropertiesAssignmentPage resourcePropertiesAssignmentPage) {
- extendTest.log(Status.INFO,
- String.format("Checking the presence of software versions '%s' in 'software_versions' property",
- getSoftwareVersionListAsString())
- );
- final List<String> actualSoftwareVersionList = resourcePropertiesAssignmentPage.getSoftwareVersionProperty();
- assertThat("Software Version should have the expected size", actualSoftwareVersionList,
- hasSize(expectedSoftwareVersionList.size()));
- assertThat("Software Version should be as expected", actualSoftwareVersionList,
- containsInAnyOrder(expectedSoftwareVersionList.toArray(new String[0])));
- }
-
- /**
- * Accesses the properties assignment page by clicking in the resource left side menu.
- *
- * @return the resulting resource properties assignment page
- */
- private ResourcePropertiesAssignmentPage accessPropertiesAssignmentPage() {
- final ResourceLeftSideMenu resourceLeftSideMenu = new ResourceLeftSideMenu(webDriver);
- resourceLeftSideMenu.isLoaded();
-
- extendTest.log(Status.INFO,
- String.format("Accessing the Properties Assignment page to check the software versions '%s'",
- getSoftwareVersionListAsString())
- );
- final ResourcePropertiesAssignmentPage resourcePropertiesAssignmentPage =
- resourceLeftSideMenu.clickOnPropertiesAssignmentMenuItem();
- resourcePropertiesAssignmentPage.isLoaded();
- return resourcePropertiesAssignmentPage;
- }
-
- /**
- * Converts the {@link #expectedSoftwareVersionList} in a comma + space separated string.
- *
- * @return the software version list as a comma + space separated string
- */
- private String getSoftwareVersionListAsString() {
- return String.join(", ", expectedSoftwareVersionList);
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/flow/CreateResourceFlow.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/flow/CreateResourceFlow.java
deleted file mode 100644
index 65d55993f0..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/flow/CreateResourceFlow.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.flow;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.pages.PageObject;
-import org.openecomp.sdc.ci.tests.pages.ResourceCreatePage;
-import org.openqa.selenium.WebDriver;
-
-import java.util.Optional;
-
-/**
- * UI Flow for Resource creation
- */
-public class CreateResourceFlow extends AbstractUiTestFlow {
-
- private final String resourceName;
-
- public CreateResourceFlow(final WebDriver webDriver, final String resourceName) {
- super(webDriver);
- this.resourceName = resourceName;
- }
-
- @Override
- public Optional<PageObject> run(final PageObject... pageObjects) {
- final ResourceCreatePage resourceCreatePage = findParameter(pageObjects, ResourceCreatePage.class);
- extendTest.log(Status.INFO, String.format("Creating the Resource '%s'", resourceName));
- resourceCreatePage.createResource();
- ExtentTestActions.takeScreenshot(Status.INFO, "resource-created",
- String.format("Resource '%s' was created", resourceName));
- return Optional.empty();
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/flow/CreateVspFlow.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/flow/CreateVspFlow.java
deleted file mode 100644
index b5af962243..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/flow/CreateVspFlow.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.flow;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.pages.OnboardHomePage;
-import org.openecomp.sdc.ci.tests.pages.PageObject;
-import org.openecomp.sdc.ci.tests.pages.SoftwareProductOnboarding;
-import org.openecomp.sdc.ci.tests.pages.TopNavComponent;
-import org.openecomp.sdc.ci.tests.pages.VspCreationModal;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openqa.selenium.WebDriver;
-
-import java.util.Optional;
-
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
-
-/**
- * UI Flow for VSP creation
- */
-public class CreateVspFlow extends AbstractUiTestFlow {
-
- private final String resourceName;
- private final String packageFile;
- private final String rootFolder;
-
- public CreateVspFlow(final WebDriver webDriver, final String resourceName, final String packageFile,
- final String rootFolder) {
- super(webDriver);
- this.resourceName = resourceName;
- this.packageFile = packageFile;
- this.rootFolder = rootFolder;
- }
-
- @Override
- public Optional<PageObject> run(final PageObject... pageObjects) {
- final TopNavComponent topNavComponent = findParameter(pageObjects, TopNavComponent.class);
- extendTest.log(Status.INFO, "Accessing the Onboard Home Page");
- topNavComponent.isLoaded();
- final OnboardHomePage onboardHomePage = goToOnboardHomePage(topNavComponent);
- final SoftwareProductOnboarding softwareProductOnboarding = createNewVsp(onboardHomePage);
- uploadPackage(softwareProductOnboarding);
- submitVsp(softwareProductOnboarding);
- goToHomePage(topNavComponent);
- return Optional.empty();
- }
-
- /**
- * Goes to the onboard home page by clicking in the onboard tab in the top nav component.
- *
- * @param topNavComponent the top nav component
- * @return the onboard home page
- */
- private OnboardHomePage goToOnboardHomePage(final TopNavComponent topNavComponent) {
- final OnboardHomePage onboardHomePage = topNavComponent.clickOnOnboard();
- onboardHomePage.isLoaded();
- ExtentTestActions.takeScreenshot(Status.INFO, "onboard-homepage", "Onboard homepage is loaded");
- return onboardHomePage;
- }
-
- /**
- * Creates a new VSP in the onboard home page.
- *
- * @param onboardHomePage the onboard home page representation
- * @return the software product onboarding page
- */
- private SoftwareProductOnboarding createNewVsp(final OnboardHomePage onboardHomePage) {
- extendTest.log(Status.INFO, "Creating a new VSP");
- final VspCreationModal vspCreationModal = onboardHomePage.clickOnCreateNewVsp();
- vspCreationModal.isLoaded();
- vspCreationModal.fillCreationForm(resourceName);
- ExtentTestActions.takeScreenshot(Status.INFO, "vsp-creation-form",
- "Creating VSP with given information");
- final SoftwareProductOnboarding softwareProductOnboarding = vspCreationModal.clickOnCreate();
- softwareProductOnboarding.isLoaded();
- extendTest.log(Status.INFO, String.format("VSP '%s' created", resourceName));
- final String actualResourceName = softwareProductOnboarding.getResourceName();
- assertThat(String.format("Should be in the Software Product '%s' page", resourceName),
- actualResourceName, is(resourceName));
- return softwareProductOnboarding;
- }
-
- /**
- * Uploads a package in the software product onboarding page.
- *
- * @param softwareProductOnboarding the software product onboarding page
- */
- private void uploadPackage(final SoftwareProductOnboarding softwareProductOnboarding) {
- extendTest.log(Status.INFO,
- String.format("Uploading package '%s' to VSP '%s'", packageFile, resourceName)
- );
- softwareProductOnboarding.uploadFile(rootFolder + packageFile);
- softwareProductOnboarding.attachmentScreenIsLoaded();
- extendTest.log(Status.INFO,
- String.format("Package '%s' was uploaded to VSP '%s'.", packageFile, resourceName)
- );
- }
-
- /**
- * Submits the VSP through the software product onboarding page.
- *
- * @param softwareProductOnboarding the software product onboarding page
- */
- private void submitVsp(final SoftwareProductOnboarding softwareProductOnboarding) {
- extendTest.log(Status.INFO, "Submitting the first VSP version.");
- softwareProductOnboarding.submit();
- ExtentTestActions.takeScreenshot(Status.INFO, "vsp-submitted", "The first VSP version was submitted");
- }
-
- /**
- * Go to the system home page through the top nav menu.
- *
- * @param topNavComponent the top nav component
- */
- private void goToHomePage(final TopNavComponent topNavComponent) {
- extendTest.log(Status.INFO, "Accessing the Home page to import the created VSP");
- topNavComponent.isLoaded();
- topNavComponent.clickOnHome();
- GeneralUIUtils.ultimateWait();
- topNavComponent.isLoaded();
- ExtentTestActions.takeScreenshot(Status.INFO, "home-is-loaded", "The Home page is loaded.");
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/flow/ImportVspFlow.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/flow/ImportVspFlow.java
deleted file mode 100644
index 5d05479b41..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/flow/ImportVspFlow.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.flow;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.pages.PageObject;
-import org.openecomp.sdc.ci.tests.pages.ResourceCreatePage;
-import org.openecomp.sdc.ci.tests.pages.TopNavComponent;
-import org.openecomp.sdc.ci.tests.pages.VspRepositoryModalComponent;
-import org.openqa.selenium.WebDriver;
-
-import java.util.Optional;
-
-/**
- * UI Flow for importing a VSP
- */
-public class ImportVspFlow extends AbstractUiTestFlow {
-
- private final String resourceName;
-
- public ImportVspFlow(final WebDriver webDriver, final String resourceName) {
- super(webDriver);
- this.resourceName = resourceName;
- }
-
- @Override
- public Optional<PageObject> run(final PageObject... pageObjects) {
- final VspRepositoryModalComponent vspRepositoryModalComponent = openVspRepository();
- searchForVsp(vspRepositoryModalComponent);
- return Optional.of(importVsp(vspRepositoryModalComponent));
- }
-
- /**
- * Opens the VSP repository modal by clicking in its icon from the top nav menu.
- *
- * @return the VSP repository modal
- */
- private VspRepositoryModalComponent openVspRepository() {
- extendTest.log(Status.INFO, "Opening the VSP repository");
- final TopNavComponent topNavComponent = new TopNavComponent(webDriver);
- topNavComponent.isLoaded();
- final VspRepositoryModalComponent vspRepositoryModalComponent = topNavComponent.clickOnRepositoryIcon();
- vspRepositoryModalComponent.isLoaded();
- return vspRepositoryModalComponent;
- }
-
- /**
- * Searches for a VSP in the repository modal.
- *
- * @param vspRepositoryModalComponent the repository modal component
- */
- private void searchForVsp(final VspRepositoryModalComponent vspRepositoryModalComponent) {
- extendTest.log(Status.INFO, String.format("Searching for VSP '%s' in the repository", resourceName));
- vspRepositoryModalComponent.searchForVSP(resourceName);
- ExtentTestActions.takeScreenshot(Status.INFO, "vsp-found-repository",
- String.format("Searching for VSP '%s' found in the repository", resourceName));
- }
-
- /**
- * Imports the first VSP in the repository list.
- *
- * @param vspRepositoryModalComponent the repository modal component that contains the VSP list
- * @return the resource creation page that the import action redirects
- */
- private ResourceCreatePage importVsp(final VspRepositoryModalComponent vspRepositoryModalComponent) {
- extendTest.log(Status.INFO, String.format("Importing VSP '%s'", resourceName));
- final ResourceCreatePage resourceCreatePage = vspRepositoryModalComponent.clickOnImportVsp(1);
- resourceCreatePage.isLoaded();
- ExtentTestActions.takeScreenshot(Status.INFO, "vsp-imported",
- String.format("VSP '%s' was imported", resourceName));
- return resourceCreatePage;
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/flow/UiTestFlow.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/flow/UiTestFlow.java
deleted file mode 100644
index c323479833..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/flow/UiTestFlow.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.flow;
-
-import org.openecomp.sdc.ci.tests.pages.PageObject;
-
-import java.util.Optional;
-
-/**
- * Represents a UI test flow
- */
-@FunctionalInterface
-public interface UiTestFlow {
-
- /**
- * Runs the flow
- * @param pageObjects any required page object for the flow
- * @return an optional page object representing the page that the flow has ended
- */
- Optional<PageObject> run(final PageObject... pageObjects);
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/flow/exception/MissingParameterRuntimeException.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/flow/exception/MissingParameterRuntimeException.java
deleted file mode 100644
index 92dc870580..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/flow/exception/MissingParameterRuntimeException.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.flow.exception;
-
-@SuppressWarnings("serial")
-public class MissingParameterRuntimeException extends UiTestFlowRuntimeException {
-
- public MissingParameterRuntimeException(final String parameterName) {
- super(String.format("Missing parameter expected %s", parameterName));
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/flow/exception/UiTestFlowRuntimeException.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/flow/exception/UiTestFlowRuntimeException.java
deleted file mode 100644
index a535077757..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/flow/exception/UiTestFlowRuntimeException.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.flow.exception;
-
-@SuppressWarnings("serial")
-public class UiTestFlowRuntimeException extends RuntimeException {
-
- public UiTestFlowRuntimeException(final String s) {
- super(s);
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/AbstractPageObject.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/AbstractPageObject.java
deleted file mode 100644
index c9b4f4994d..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/AbstractPageObject.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.support.ui.ExpectedConditions;
-import org.openqa.selenium.support.ui.WebDriverWait;
-
-import java.util.List;
-
-/**
- * Base UI test object that represents a page or component in a html page
- */
-public abstract class AbstractPageObject implements PageObject {
-
- protected final WebDriver webDriver;
- protected int timeoutInSeconds;
-
- public AbstractPageObject(final WebDriver webDriver) {
- this.webDriver = webDriver;
- timeoutInSeconds = 10;
- }
-
- /**
- * Sets the default timeout for Page Object actions.
- */
- public void setTimeout(final int timeoutInSeconds) {
- this.timeoutInSeconds = timeoutInSeconds;
- }
-
- /**
- * Creates a WebDriverWait instance with the default timeout.
- *
- * @return a new WebDriverWait instance
- */
- protected WebDriverWait getWait() {
- return new WebDriverWait(webDriver, timeoutInSeconds);
- }
-
- /**
- * Creates a WebDriverWait instance with the provided timeout.
- *
- * @param timeoutInSeconds the wait timeout in seconds
- * @return a new WebDriverWait instance
- */
- protected WebDriverWait getWait(final int timeoutInSeconds) {
- return new WebDriverWait(webDriver, timeoutInSeconds);
- }
-
- /**
- * Find an element based on the provided locator.
- *
- * @param locator the By locator
- * @return the WebElement if found, otherwise throws an exception
- */
- protected WebElement findElement(final By locator) {
- return webDriver.findElement(locator);
- }
-
- /**
- * Find elements based on the provided locator.
- *
- * @param locator the By locator
- * @return the list of WebElement if any found, otherwise throws an exception
- */
- protected List<WebElement> findElements(final By locator) {
- return webDriver.findElements(locator);
- }
-
- /**
- * Find an element inside the provided element using the provided xpath.
- *
- * @param element the parent element
- * @param xpath the xpath expression to search for the internal element
- * @return the WebElement if found, otherwise throws an exception
- */
- protected WebElement findSubElement(final WebElement element, final String xpath) {
- return findSubElement(element, By.xpath(xpath));
- }
-
- /**
- * Find an element inside the provided element using the provided By locator.
- *
- * @param element the parent element
- * @param locator the By locator to search for the internal element
- * @return the WebElement if found, otherwise throws an exception
- */
- protected WebElement findSubElement(final WebElement element, final By locator) {
- return element.findElement(locator);
- }
-
- /**
- * Find elements inside the provided element using the provided By locator.
- *
- * @param element the parent element
- * @param locator the By locator to search for the internal element
- * @return the list of WebElement if any found, otherwise throws an exception
- */
- protected List<WebElement> findSubElements(final WebElement element, final By locator) {
- return element.findElements(locator);
- }
-
- /**
- * Waits for element visibility with the default timeout.
- *
- * @param xpath the xpath expression to search for the element
- * @return the WebElement if visible before timeout, otherwise throws an exception
- */
- protected WebElement waitForElementVisibility(final String xpath) {
- return waitForElementVisibility(By.xpath(xpath));
- }
-
- /**
- * Waits for element visibility with the default timeout.
- *
- * @param locator the By locator to search for the element
- * @return the WebElement if visible before timeout, otherwise throws an exception
- */
- protected WebElement waitForElementVisibility(final By locator) {
- return getWait(timeoutInSeconds)
- .until(ExpectedConditions.visibilityOfElementLocated(locator));
- }
-
- /**
- * Waits for element visibility with the provided timeout.
- *
- * @param locator the By locator to search for the element
- * @param timeoutInSeconds the wait timeout in seconds
- * @return the WebElement if visible before timeout, otherwise throws an exception
- */
- protected WebElement waitForElementVisibility(final By locator, final int timeoutInSeconds) {
- return getWait(timeoutInSeconds)
- .until(ExpectedConditions.visibilityOfElementLocated(locator));
- }
-
- /**
- * Waits for element invisibility with the default timeout.
- *
- * @param locator the By locator to search for the element
- * @return the WebElement if invisible before timeout, false otherwise
- */
- protected Boolean waitForElementInvisibility(final By locator) {
- return getWait(timeoutInSeconds)
- .until(ExpectedConditions.invisibilityOfElementLocated(locator));
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/AdminGeneralPage.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/AdminGeneralPage.java
deleted file mode 100644
index bfb096f5c5..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/AdminGeneralPage.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.UserManagementTab;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openqa.selenium.WebElement;
-
-import java.util.List;
-
-public class AdminGeneralPage extends GeneralPageElements {
-
- private static UserManagementTab userManagementTab = new UserManagementTab();
-
- public static UserManagementTab getUserManagementTab() {
- return userManagementTab;
- }
-
- public static void selectCategoryManagmetTab() throws Exception {
-
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.AdminPageTabs.CATEGORY_MANAGEMENT.getValue());
- }
-
- public static void selectUserManagmetTab() throws Exception {
-
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.AdminPageTabs.USER_MANAGEMENT.getValue());
- }
-
- public static List<WebElement> getServiceCategoriesList() throws Exception {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.CategoryManagement.SERVICE_CATEGORY_HEADER.getValue());
- GeneralUIUtils.waitForLoader();
- return GeneralUIUtils.getWebElementsListByTestID(DataTestIdEnum.CategoryManagement.SERVICE_CATEGORY_LIST.getValue());
- }
-
- public static List<WebElement> getResourceCategoriesList() throws Exception {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.CategoryManagement.RESOURCE_CATEGORY_HEADER.getValue());
- GeneralUIUtils.waitForLoader();
- return GeneralUIUtils.getWebElementsListByTestID(DataTestIdEnum.CategoryManagement.RESOURCE_CATEGORY_LIST.getValue());
- }
-
- public static void createNewServiceCategory(String name) throws Exception {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.CategoryManagement.SERVICE_CATEGORY_HEADER.getValue());
- SetupCDTest.getExtendTest().log(Status.INFO, "Creating service...");
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.CategoryManagement.NEW_CATEGORY_BUTTON.getValue());
- GeneralUIUtils.waitForLoader();
- defineNewResourceCategoryName(name);
- GeneralPageElements.clickOKButton();
- GeneralUIUtils.waitForLoader();
- }
-
- public static void selectElementFromList(List<WebElement> list, String elementToSelect) throws Exception {
-
- for (WebElement webElement : list) {
- if (webElement.getText().toLowerCase().equals(elementToSelect.toLowerCase())) {
- webElement.click();
- }
- }
-
- }
-
-
- public static void addSubCategoryToResource(List<WebElement> resourceList, String parentResource, String subCategoryName) throws Exception {
-
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.CategoryManagement.RESOURCE_CATEGORY_HEADER.getValue());
- selectElementFromList(resourceList, parentResource);
- SetupCDTest.getExtendTest().log(Status.INFO, "Creating...");
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.CategoryManagement.NEW_SUB_CATEGORY_BUTTON.getValue());
- GeneralUIUtils.waitForLoader();
- defineNewResourceCategoryName(subCategoryName);
- GeneralPageElements.clickOKButton();
- GeneralUIUtils.waitForLoader();
-
-
- }
-
- public static void createNewResourceCategory(String name) throws Exception {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.CategoryManagement.RESOURCE_CATEGORY_HEADER.getValue());
- SetupCDTest.getExtendTest().log(Status.INFO, "Creating...");
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.CategoryManagement.NEW_CATEGORY_BUTTON.getValue());
- GeneralUIUtils.waitForLoader();
- defineNewResourceCategoryName(name);
- GeneralPageElements.clickOKButton();
- GeneralUIUtils.waitForLoader();
-
- }
-
- public void insertPropertyDefaultValue(String value) {
- WebElement propertyValue = GeneralUIUtils
- .getWebElementByTestID(DataTestIdEnum.PropertiesPopupEnum.PROPERTY_VALUE.getValue());
- propertyValue.clear();
- propertyValue.sendKeys(value);
- }
-
- private static void defineNewResourceCategoryName(String name) {
- WebElement categoryNameTextbox = getCategoryName();
- categoryNameTextbox.clear();
- categoryNameTextbox.sendKeys(name);
- }
-
- private static WebElement getCategoryName() {
- return GeneralUIUtils.getWebElementByClassName(DataTestIdEnum.CategoryManagement.NEW_CATEGORY_NAME.getValue());
- }
-
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ComponentLeftMenu.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ComponentLeftMenu.java
deleted file mode 100644
index 672b8e05b0..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ComponentLeftMenu.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-public interface ComponentLeftMenu {
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/CompositionPage.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/CompositionPage.java
deleted file mode 100644
index 2311bd9bc6..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/CompositionPage.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.LeftPanelCanvasItems;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.interactions.Actions;
-import org.openqa.selenium.support.ui.Select;
-import org.testng.AssertJUnit;
-
-import java.util.List;
-
-public class CompositionPage extends GeneralPageElements {
-
- private CompositionPage() {
- super();
- }
-
- public static UploadArtifactPopup artifactPopup() {
- return new UploadArtifactPopup(true);
- }
-
- public static void searchForElement(String elementName) {
- SetupCDTest.getExtendTest().log(Status.INFO, "Searching for " + elementName + " in the left panel");
- WebElement searchField = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.CompositionScreenEnum.SEARCH_ASSET.getValue());
- searchField.clear();
- searchField.sendKeys(elementName);
- GeneralUIUtils.ultimateWait();
- }
-
- public static void showDeploymentArtifactTab() throws Exception {
- clickOnTabTestID(DataTestIdEnum.CompositionScreenEnum.DEPLOYMENT_ARTIFACT_TAB);
- }
-
- public static void showInformationsTab() throws Exception {
- clickOnTabTestID(DataTestIdEnum.CompositionScreenEnum.INFORMATION_TAB);
- }
-
- public static void showPropertiesAndAttributesTab() throws Exception {
- clickOnTabTestID(DataTestIdEnum.CompositionScreenEnum.PROPERTIES_AND_ATTRIBUTES_TAB);
- }
-
- public static List<WebElement> getProperties() {
- return PropertiesPage.getElemenetsFromTable();
- }
-
- public static List<WebElement> getDeploymentArtifacts() {
- return getAllAddedArtifacts();
- }
-
- public static List<WebElement> getAllAddedArtifacts() {
- String dataTestsId = DataTestIdEnum.CompositionScreenEnum.ARTIFACTS_LIST.getValue();
- return GeneralUIUtils.getWebElementsListBy(By.xpath("//*[contains(@data-tests-id,'" + dataTestsId + "')]"));
- }
-
- public static void moveToInputsScreen() throws Exception {
- openPagesMenu(2);
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.CompositionScreenEnum.MENU_INPUTS.getValue());
- //GeneralUIUtils.ultimateWait();
- }
-
- public static void moveToPropertiesScreen() throws Exception {
- openPagesMenu(2);
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.CompositionScreenEnum.MENU_PROPERTIES_ASSIGNMENT.getValue());
- //GeneralUIUtils.ultimateWait();
- }
-
- public static void moveToOnboardScreen() throws Exception {
- openPagesMenu(0);
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.CompositionScreenEnum.MENU_ONBOARD.getValue());
- //GeneralUIUtils.ultimateWait();
- }
-
- public static void moveToHomeScreen() throws Exception {
- openPagesMenu(0);
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.CompositionScreenEnum.MENU_HOME.getValue());
- //GeneralUIUtils.ultimateWait();
- }
-
- private static void openPagesMenu(int counter) {
- Actions actions = new Actions(GeneralUIUtils.getDriver());
- List<WebElement> triangleList = GeneralUIUtils.getWebElementsListByClassName(DataTestIdEnum.CompositionScreenEnum.MENU_TRIANGLE_DROPDOWN.getValue());
- WebElement pagesMenu = triangleList.get(counter);
- actions.moveToElement(pagesMenu).perform();
- }
-
- public static void changeComponentVersion(CanvasManager canvasManager, CanvasElement element, String version) {
- changeComponentVersion(canvasManager, element, version, false);
- }
-
- public static void changeComponentVersion(CanvasManager canvasManager, CanvasElement element, String version, boolean isValidate) {
- try {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Changing component version to %s", version));
- canvasManager.clickOnCanvaElement(element);
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.CompositionScreenEnum.CHANGE_VERSION.getValue());
- //GeneralUIUtils.ultimateWait();
- Select selectlist = new Select(GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.CompositionScreenEnum.CHANGE_VERSION.getValue()));
- while (selectlist.getOptions().size() == 0) {
- selectlist = new Select(GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.CompositionScreenEnum.CHANGE_VERSION.getValue()));
- }
- GeneralUIUtils.ultimateWait();
- selectlist.selectByValue(version);
- GeneralUIUtils.ultimateWait();
- GeneralUIUtils.clickSomewhereOnPage();
-
- // Validate Selection
- if (isValidate) {
- GeneralUIUtils.ultimateWait();
- canvasManager.clickOnCanvaElement(element);
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Validating component version changed to %s", version));
- String actualSelectedValue = GeneralUIUtils.getWebElementBy(By.xpath(String.format("//select[@data-tests-id='%s']//option[@selected='selected']", DataTestIdEnum.CompositionScreenEnum.CHANGE_VERSION.getValue()))).getText();
- AssertJUnit.assertTrue(actualSelectedValue.equals(version));
- }
- } catch (Exception e) {
- throw e;
- }
- }
-
- public static void clickAddArtifactButton() throws Exception {
- clickOnTabTestID(DataTestIdEnum.CompositionScreenEnum.ADD_ARTIFACT);
- GeneralUIUtils.getWebElementByClassName("sdc-add-artifact");
- }
-
- public static String getSelectedInstanceName() {
- return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.CompositionRightPanel.COMPONENT_TITLE.getValue()).getText();
- }
-
- public static void showInformationArtifactTab() throws Exception {
- clickOnTab(DataTestIdEnum.CompositionScreenEnum.INFORMATION_ARTIFACTS);
- }
-
- public static void showAPIArtifactTab() throws Exception {
- clickOnTab(DataTestIdEnum.CompositionScreenEnum.API);
- }
-
- public static void showInformationTab() throws Exception {
- clickOnTab(DataTestIdEnum.CompositionScreenEnum.INFORMATION);
- }
-
- public static void showCompositionTab() throws Exception {
- clickOnTab(DataTestIdEnum.CompositionScreenEnum.COMPOSITION);
- }
-
- public static void showInputsTab() throws Exception {
- clickOnTab(DataTestIdEnum.CompositionScreenEnum.INPUTS);
- }
-
- public static void showRequirementsAndCapabilitiesTab() throws Exception {
- clickOnTab(DataTestIdEnum.CompositionScreenEnum.REQUIREMENTS_AND_CAPABILITIES);
- }
-
- public static List<WebElement> getOpenTabTitle() throws Exception {
- return GeneralUIUtils.getElementsByCSS("expand-collapse ng-transclude");
- }
-
- public static void clickOnTab(DataTestIdEnum.CompositionScreenEnum tabSelector) throws Exception {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on %s", tabSelector.name()));
- GeneralUIUtils.getElementsByCSS(tabSelector.getValue()).get(0).click();
- GeneralUIUtils.ultimateWait();
- }
-
- public static void clickOnTabTestID(DataTestIdEnum.CompositionScreenEnum tabSelector) throws Exception {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on %s", tabSelector.name()));
- GeneralUIUtils.getWebElementByTestID(tabSelector.getValue()).click();
- GeneralUIUtils.ultimateWait();
- }
-
- public static CanvasElement addElementToCanvasScreen(LeftPanelCanvasItems elementName, CanvasManager vfCanvasManager) throws Exception {
- CompositionPage.searchForElement(elementName.name());
- return vfCanvasManager.createElementOnCanvas(elementName);
- }
-
- public static CanvasElement addElementToCanvasScreen(String elementName, CanvasManager vfCanvasManager) throws Exception {
- CompositionPage.searchForElement(elementName);
- return vfCanvasManager.createElementOnCanvas(elementName);
- }
-
- public static List<WebElement> getCompositionDeplymentArtifacts() {
- return GeneralUIUtils.getWebElementsListByContainTestID(DataTestIdEnum.DeploymentArtifactCompositionRightMenu.ARTIFACT_DISPLAY_NAME.getValue());
- }
-
- public static WebElement getCustomizationUUID() throws Exception {
- return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.CompositionScreenEnum.CUSTOMIZATION_UUID.getValue());
- }
-
-
- public static List<WebElement> getCompositionEnvArtifacts() {
- return GeneralUIUtils.getWebElementsListByContainTestID(DataTestIdEnum.DeploymentArtifactCompositionRightMenu.ARTIFACT_ENV.getValue());
- }
-
- public static WebElement clickDownloadEnvArtifactComposition(String fileName) {
- GeneralUIUtils.hoverOnAreaByTestId(DataTestIdEnum.DeploymentArtifactCompositionRightMenu.ARTIFACT_ENV.getValue() + fileName);
- return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.DOWNLOAD_ARTIFACT_ENV.getValue() + fileName);
- }
-
- public static void setSingleProperty(String propertyDataTestID, String propertyValue) {
- WebElement findElement = GeneralUIUtils.getWebElementByTestID(propertyDataTestID);
- findElement.click();
- PropertiesPage.getPropertyPopup().insertPropertyDefaultValue(propertyValue);
- PropertiesPage.getPropertyPopup().clickSave();
- GeneralUIUtils.ultimateWait();
- findElement = GeneralUIUtils.getWebElementByTestID("value_" + propertyDataTestID);
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Validating property %s is set", propertyValue));
- AssertJUnit.assertTrue(findElement.getText().equals(propertyValue));
- GeneralUIUtils.ultimateWait();
- }
-
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/DeploymentArtifactPage.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/DeploymentArtifactPage.java
deleted file mode 100644
index bc0165bb5f..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/DeploymentArtifactPage.java
+++ /dev/null
@@ -1,312 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import com.aventstack.extentreports.Status;
-import org.apache.commons.lang.WordUtils;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactInfo;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebElement;
-import org.testng.collections.Lists;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
-
-public class DeploymentArtifactPage extends GeneralPageElements {
-
- protected DeploymentArtifactPage() {
- super();
- }
-
- public static ResourceLeftMenu getLeftPanel() {
- return new ResourceLeftMenu();
- }
-
- public static UploadArtifactPopup artifactPopup() {
- return new UploadArtifactPopup();
- }
-
- protected static void addNewArtifact(ArtifactGroupTypeEnum artifactGroupType) {
- switch (artifactGroupType) {
- case DEPLOYMENT:
- GeneralUIUtils.getInputElement(DataTestIdEnum.ArtifactPageEnum.ADD_DEPLOYMENT_ARTIFACT.getValue()).click();
- break;
- case INFORMATIONAL:
- GeneralUIUtils.getInputElement(DataTestIdEnum.ArtifactPageEnum.ADD_INFORMATIONAL_ARTIFACT.getValue()).click();
- break;
- default:
- break;
- }
- }
-
- public static void clickAddNewArtifact() {
- addNewArtifact(ArtifactGroupTypeEnum.DEPLOYMENT);
- }
-
- public static void clickAddAnotherArtifact() {
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.ADD_ANOTHER_ARTIFACT.getValue()).click();
- }
-
- public static void clickEditArtifact(String artifactLabel) {
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.EDIT_ARTIFACT.getValue() + artifactLabel).click();
- }
-
- public static void clickEditEnvArtifact(String artifactLabel) {
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.EDIT_PARAMETERS_OF_ARTIFACT.getValue() + artifactLabel).click();
- }
-
- public static void hoverArtifact(String artifactLabel) {
- GeneralUIUtils.hoverOnAreaByTestId(DataTestIdEnum.DeploymentArtifactCompositionRightMenu.ARTIFACT_NAME.getValue() + artifactLabel);
- }
-
- public static void clickDeleteArtifact(String artifactLabel) {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Deleting %s Artefact ", artifactLabel));
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.DELETE_ARTIFACT.getValue() + artifactLabel).click();
- }
-
- public static WebElement clickDownloadArtifact(String artifactLabel) {
- WebElement downloadButton = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.DOWNLOAD_ARTIFACT.getValue() + artifactLabel);
-
- return downloadButton;
- }
-
- public static void clickDownloadEnvArtifact(String envFileNameToDownload) {
- ExtentTestActions.log(Status.INFO, String.format("Downloading the updated %s artifact for validate parameters with the response after the update...", envFileNameToDownload));
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ArtifactPageEnum.DOWNLOAD_ARTIFACT_ENV.getValue() + envFileNameToDownload);
- ExtentTestActions.log(Status.INFO, String.format("%s Envartifact was downloaded successfully!", envFileNameToDownload));
- }
-
- public static void clickSaveEnvParameters() {
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPopup.SAVE.getValue()).click();
- GeneralUIUtils.ultimateWait();
- }
-
- public static void clickCloseEnvParameters() {
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPopup.CANCEL_BUTTON.getValue()).click();
- GeneralUIUtils.ultimateWait();
- }
-
- public static WebElement getAddOtherArtifactButton() {
- return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.ADD_ANOTHER_ARTIFACT.getValue());
- }
-
- public static void clickOK() {
- SetupCDTest.getExtendTest().log(Status.INFO, "Artifact Page, Clicking OK");
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.OK.getValue()).click();
- GeneralUIUtils.getWebElementBy(By.className("flex-container"));
- GeneralUIUtils.waitForAngular();
- }
-
- public static String getArtifactDescription(String artifactLabel) throws Exception {
- clickOnArtifactDescription(artifactLabel); // open artifact
- WebElement artifactDescriptionElement = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.GET_DEPLOYMENT_ARTIFACT_DESCRIPTION.getValue());
- String artifactDesc = artifactDescriptionElement.getAttribute("value");
- closeArtifactDescription(artifactLabel); // close artifact
- return artifactDesc;
- }
-
- public static void closeArtifactDescription(String artifactLabel) {
- GeneralUIUtils.clickOnElementByTestId("popover-x-button");
- }
-
- public static WebElement clickOnArtifactDescription(String artifactLabel) throws Exception {
- try {
- WebElement artifact = GeneralUIUtils.getWebElementByTestID("descriptionIcon_" + artifactLabel);
- artifact.click();
- GeneralUIUtils.waitForLoader();
- return artifact;
- } catch (Exception e) {
- throw new Exception("Artifact " + artifactLabel + "is not found");
- }
- }
-
- public static boolean checkElementsCountInTable(int expectedElementsCount) {
- return GeneralPageElements.checkElementsCountInTable(expectedElementsCount + 1);
- }
-
- public static String[] verifyArtifactsExistInTable(String filepath, String vnfFile) throws Exception {
- String[] artifactNamesFromZipFile = FileHandling.getArtifactsFromZip(filepath, vnfFile);
- return verifyArtifactsExistInTable(artifactNamesFromZipFile);
- }
-
- public static String[] verifyArtifactsExistInTable(String[] artifactNamesFromZipFile) throws Exception {
- if (artifactNamesFromZipFile != null) {
- checkArtifactsDisplayed(artifactNamesFromZipFile);
- checkEnvArtifactsDisplayed();
- }
-
- return artifactNamesFromZipFile;
- }
-
- public static void checkArtifactsDisplayed(String[] artifactsFromZipFile) throws Exception {
- SetupCDTest.getExtendTest().log(Status.INFO, "Verifying the artifacts in the table");
- List<String> artifactList = Lists.newArrayList(artifactsFromZipFile).stream().filter(p -> !p.contains(".env")).map(p -> getVisualArtifactName(p)).collect(Collectors.toList());
- try {
- List<WebElement> rows = GeneralUIUtils.getWebElementsListByContainsClassName("datatable-body-row");
- for (WebElement r : rows) {
- String artifactDisplayed = r.getAttribute("textContent").trim();
- if (artifactList.contains(artifactDisplayed)) {
- artifactList.remove(artifactDisplayed);
- } else if (artifactDisplayed.toLowerCase().contains("license")) {
- artifactList.add(artifactDisplayed);
- }
- }
- checkLicenseArtifactsDisplayed(artifactList);
- } catch (Exception e) {
- throw new Exception("Table problem");
- }
-
-
- if (!artifactList.isEmpty()) {
- throw new Exception(String.format("missing the following artifact(s) : %s", artifactList.toString()));
- }
- }
-
- public static void checkEnvArtifactsDisplayed() throws Exception {
- List<WebElement> envRows;
- List<WebElement> heatRows;
- List<WebElement> heatNetRows;
- List<WebElement> heatVolRows;
- int envArtifactsSize = 0;
-
- SetupCDTest.getExtendTest().log(Status.INFO, "Verifying the HEAT_ENV artifacts in the table");
-
- try {
- envRows = GeneralUIUtils.getElementsByCSS("div div[data-tests-id='HEAT_ENV']");
-
- heatRows = GeneralUIUtils.getElementsByCSS("div div[tooltip-content='HEAT']");
- heatNetRows = GeneralUIUtils.getElementsByCSS("div div[tooltip-content='HEAT_NET']");
- heatVolRows = GeneralUIUtils.getElementsByCSS("div div[tooltip-content='HEAT_VOL']");
-
- envArtifactsSize = heatRows.size() + heatNetRows.size() + heatVolRows.size();
- } catch (Exception e) {
- throw new Exception("Table problem");
- }
-
- if (envArtifactsSize != envRows.size()) {
- throw new Exception(String.format("some env artifacts are missing... there is %s instead of %s", envRows.size(), envArtifactsSize));
- }
-
- }
-
- public static void checkLicenseArtifactsDisplayed(List<String> rowsFromTable) throws Exception {
- SetupCDTest.getExtendTest().log(Status.INFO, "Verifying the license artifacts in the table");
- String vfLicense = getPreparedLicense(ArtifactTypeEnum.VF_LICENSE.getType());
- String[] split = vfLicense.split(" ");
- vfLicense = vfLicense.replaceAll(split[0], split[0].toUpperCase());
- if (rowsFromTable.contains(vfLicense)) {
- rowsFromTable.remove(vfLicense);
- }
-
- String vendorLicense = getPreparedLicense(ArtifactTypeEnum.VENDOR_LICENSE.getType());
- if (rowsFromTable.contains(vendorLicense)) {
- rowsFromTable.remove(vendorLicense);
- }
-
- }
-
- public static String getPreparedLicense(String license) {
- return WordUtils.capitalizeFully(license.replaceAll("_", " "));
- }
-
-
- private static String getVisualArtifactName(String artifactName) {
- if (artifactName.contains(".")) {
- return artifactName.substring(0, artifactName.lastIndexOf("."));
- }
- return artifactName;
- }
-
- public static void updateDescription(String newDescription, ArtifactInfo artefact) throws Exception {
- UploadArtifactPopup artifactPopup = new UploadArtifactPopup(true);
- DeploymentArtifactPage.clickEditArtifact(artefact.getArtifactLabel());
- artifactPopup.insertDescription(newDescription);
- artifactPopup.clickDoneButton();
- }
-
- public static List<String> getDeploymentArtifactsNamesWorkSpace() {
- return GeneralUIUtils.getWebElementListText(GeneralUIUtils.getWebElementsListByContainTestID(DataTestIdEnum.ArtifactPageEnum.ARTIFACT_NAME.getValue()));
- }
-
- //Get Artifact Type by Artifact Name.
- public static String getArtifactType(String artifactName) {
- return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.TYPE.getValue() + artifactName).getText();
- }
-
- public static List<String> getHeatParametersInUI(String dataTestId) {
- List<WebElement> elements;
- List<String> Names = new ArrayList<>();
- elements = GeneralUIUtils.getWebElementsListByContainTestID(dataTestId);
- for (WebElement webElement : elements) {
- String attributevalue = webElement.getAttribute("data-tests-id");
- Names.add(attributevalue.replace("heatParameterName_", ""));
- }
- return Names;
- }
-
- public static void searchBoxEnv(String parameterName) {
- GeneralUIUtils.getWebElementByContainsClassName("w-sdc-env-search-input").sendKeys(parameterName);
- }
-
- public static void clearSearchBoxEnv() {
- GeneralUIUtils.getWebElementByContainsClassName("w-sdc-env-search-input").clear();
- }
-
- public static void editHeatParamValue(String paramName, String value) throws Exception {
- SetupCDTest.getExtendTest().log(Status.INFO, "Searching for " + paramName + " parameter on Heat Params modal screen");
- WebElement valueTextbox = GeneralUIUtils.getWebElementByTestID(paramName);
-
- clickOnHeatParam(paramName);
- valueTextbox.clear();
- SetupCDTest.getExtendTest().log(Status.INFO, "Editing " + paramName + " value on Heat Params modal screen");
- valueTextbox.sendKeys(value);
- GeneralUIUtils.ultimateWait();
-
- }
-
- public static void clickOnDeleteHeatParamValue(String paramName) throws Exception {
- SetupCDTest.getExtendTest().log(Status.INFO, "Searching for " + paramName + " parameter on Properties screen");
- String value = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.EnvParameterView.ENV_CURRENT_VALUE.getValue() + paramName).getAttribute("value");
- if (value != null) {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ArtifactPageEnum.DELETE_PARAMETER_OF_ARTIFACT.getValue() + paramName);
- GeneralUIUtils.ultimateWait();
- SetupCDTest.getExtendTest().log(Status.INFO, "Value of " + paramName + " is deleted");
- }
- SetupCDTest.getExtendTest().log(Status.INFO, "Value of " + paramName + " is empty and cannot be deleted");
- }
-
- public static void clickOnHeatParam(String paramName) throws Exception {
-
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on the %s component in Properties", paramName));
- GeneralUIUtils.clickOnElementByTestId(paramName);
- GeneralUIUtils.ultimateWait();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.LIFECYCLE_STATE.getValue());
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/DeploymentPage.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/DeploymentPage.java
deleted file mode 100644
index dd3fdec6bc..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/DeploymentPage.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.DeploymentScreen;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebElement;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class DeploymentPage {
-
- public DeploymentPage() {
- super();
- }
-
- public static List<WebElement> getGroupMembersList(String instanceName) {
- List<WebElement> propertyRows = null;
- clickOnModuleName(instanceName);
- propertyRows = getVisibleMembers();
- return propertyRows;
- }
-
- public static void clickOnModuleName(String instanceName) {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on %s", instanceName));
- GeneralUIUtils.clickOnElementByText(instanceName);
- GeneralUIUtils.ultimateWait();
- }
-
- public static List<WebElement> getVisibleMembers() {
- List<WebElement> instancesFromTable = GeneralUIUtils.getDriver().findElements(By.cssSelector("div[class^='hierarchy-module-member-list']"));
- for (WebElement instance : instancesFromTable) {
- Object parentAttributes = GeneralUIUtils.getAllElementAttributes(instance);
- if (!parentAttributes.toString().contains("hidden")) {
- return instance.findElements(By.cssSelector("div[class^='expand-collapse-sub-title']"));
- }
- }
- return null;
- }
-
- public static void clickOnProperties() throws Exception {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Properties button"));
- GeneralUIUtils.clickOnElementByCSS(DataTestIdEnum.DeploymentScreen.BUTTON_PROPERTIES.getValue());
- GeneralUIUtils.ultimateWait();
- }
-
- public static void clickOnArtifacts() throws Exception {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Artifacts button"));
- GeneralUIUtils.clickOnElementByCSS(DataTestIdEnum.DeploymentScreen.BUTTON_ARTIFACTS.getValue());
- GeneralUIUtils.ultimateWait();
- }
-
- public static void clickOnSaveButton() {
- clickInDeployment(DataTestIdEnum.DeploymentScreen.SAVE);
- GeneralUIUtils.waitForElementInVisibilityByTestId(By.className("popover-inner"));
- }
-
- public static void clickOnCancelButton() {
- clickInDeployment(DataTestIdEnum.DeploymentScreen.CANCEL);
- GeneralUIUtils.waitForElementInVisibilityByTestId(By.className("popover-inner"));
- }
-
- public static void clickOnXIcon() {
- clickInDeployment(DataTestIdEnum.DeploymentScreen.X_BUTTON);
- GeneralUIUtils.waitForElementInVisibilityByTestId(By.className("popover-inner"));
- }
-
- public static void clickOnEditIcon() {
- clickInDeployment(DataTestIdEnum.DeploymentScreen.PENCIL_ICON);
- }
-
- public static void clickOnProperty(WebElement property) {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on %s propertie ...", property.getText()));
- property.click();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.PropertiesPageEnum.POPUP_FORM.getValue());
- }
-
- private static void clickInDeployment(DataTestIdEnum.DeploymentScreen element) {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on %s ...", element.getValue()));
- GeneralUIUtils.clickOnElementByTestId(element.getValue());
- //GeneralUIUtils.ultimateWait();
- }
-
- public static List<WebElement> getPropertyNames() throws Exception {
- clickOnProperties();
- return GeneralUIUtils.getElementsByCSS(DataTestIdEnum.DeploymentScreen.PROPERTY_NAMES.getValue());
- }
-
- public static List<WebElement> getArtifactNames() throws Exception {
- clickOnArtifacts();
- return GeneralUIUtils.getInputElements(DataTestIdEnum.DeploymentScreen.ARTIFACT_NAME.getValue());
- }
-
- public static String updateModuleName(String currentModuleName, String newModuleName) throws Exception {
- GeneralUIUtils.ultimateWait();
- ResourceUIUtils.clickOnElementByText(currentModuleName, null);
- GeneralUIUtils.ultimateWait();
- clickOnEditIcon();
- WebElement moduleNameField = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.DeploymentScreen.NAME_INPUT.getValue());
- String oldModuleName = moduleNameField.getAttribute("value");
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating %s module name ...", currentModuleName));
- moduleNameField.clear();
- GeneralUIUtils.ultimateWait();
- moduleNameField.sendKeys(newModuleName);
- GeneralUIUtils.ultimateWait();
- clickOnSaveButton();
- String newReconstructedModuleName = reconstructModuleName(currentModuleName.split("\\.\\."), newModuleName);
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Name of element instance changed from %s to %s", currentModuleName, newReconstructedModuleName));
- return oldModuleName;
- }
-
- public static String reconstructModuleName(String[] splittedName, String middleName) {
- int i = 0;
- StringBuilder builder = new StringBuilder();
- for (String s : splittedName) {
- if (i == 1) {
- builder.append(middleName);
- } else {
- builder.append(s);
- }
- if (i < 2) {
- builder.append("..");
- }
- i++;
- }
- return builder.toString();
- }
-
- public static List<WebElement> getVisibleModulesService() {
- List<WebElement> instancesFromTable = GeneralUIUtils.getDriver().findElements(By.cssSelector("div[class^='hierarchy-modules-list']"));
- for (WebElement instance : instancesFromTable) {
- Object parentAttributes = GeneralUIUtils.getAllElementAttributes(instance);
- if (!parentAttributes.toString().contains("hidden")) {
- return instance.findElements(By.cssSelector("span[class^='expand-collapse-title-text']"));
- }
- }
- return null;
- }
-
- public static List<WebElement> getInstanceModulesList(String instanceName) {
- List<WebElement> propertyRows = null;
- ResourceUIUtils.clickOnElementByText(instanceName, null);
- GeneralUIUtils.ultimateWait();
- propertyRows = getVisibleModulesService();
- return propertyRows;
- }
-
- public static String getGroupVersion() throws Exception {
- return GeneralUIUtils.getElementsByCSS("div[data-tests-id='selected-module-version']").get(0).getText();
- }
-
- public static String getModuleID() throws Exception {
- return GeneralUIUtils.getElementsByCSS("div[data-tests-id='selected-module-group-uuid'] span[class^='small-font']").get(0).getText();
- }
-
- public static Map<String, HashMap<String, String>> collectMetaDataFromUI() throws Exception {
- ResourceGeneralPage.getLeftMenu().moveToDeploymentViewScreen();
- Map<String, HashMap<String, String>> deploymentViewMetaData = new HashMap<String, HashMap<String, String>>();
- List<WebElement> moduleRowsFromTable = GeneralUIUtils.getElementsByCSS("span[class^='expand-collapse-title-text']");
- for (WebElement moduleRow : moduleRowsFromTable) {
- HashMap<String, String> tempGroupMap = new HashMap<String, String>();
- String moduleRowText = moduleRow.getText();
- GeneralUIUtils.clickOnElementByText(moduleRowText);
- tempGroupMap.put("moduleID", getModuleID());
- tempGroupMap.put("version", DeploymentPage.getGroupVersion().split(":")[1].trim());
- deploymentViewMetaData.put(moduleRowText.split("\\.\\.")[1], tempGroupMap);
- GeneralUIUtils.clickOnElementByText(moduleRowText);
- }
- return deploymentViewMetaData;
- }
-
- public static void updateAndCancel(String newModuleName, DataTestIdEnum.DeploymentScreen buttonToClick) {
- WebElement moduleNameField = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.DeploymentScreen.NAME_INPUT.getValue());
- String oldModuleName = moduleNameField.getAttribute("value");
- moduleNameField.clear();
- GeneralUIUtils.ultimateWait();
- moduleNameField.sendKeys(newModuleName);
- GeneralUIUtils.ultimateWait();
- if (buttonToClick.equals(DataTestIdEnum.DeploymentScreen.X_BUTTON)) {
- clickOnXIcon();
- } else {
- clickOnCancelButton();
- }
- }
-
- public static String getPropertyValueFromPropertiesList(String property) throws InterruptedException {
- List<WebElement> propertyDataElements = GeneralUIUtils.getElementsByCSS("div[class^='list-item property-data']");
- for (WebElement propertyDataElement : propertyDataElements) {
- WebElement propertyNameElement = GeneralUIUtils.getElementfromElementByCSS(propertyDataElement, DeploymentScreen.PROPERTY_NAMES.getValue());
- if (propertyNameElement.getText().equals(property)) {
- WebElement propertyValueElement = GeneralUIUtils.getElementfromElementByCSS(propertyDataElement, String.format("div[data-tests-id='%s']", DeploymentScreen.PROPERTY_SCHEMA_TYPE.getValue()));
- return propertyValueElement.getText().trim().split(":")[1].trim();
- }
- }
- return null;
- }
-
- public static List<WebElement> getPropertyErrorValidationMessdge() throws Exception {
- List<WebElement> propertyErrorElements = GeneralUIUtils.getElementsByCSS("div[class='input-error'] span[class='ng-scope']");
- return propertyErrorElements;
- }
-
- public static boolean isPropertySaveButtonDisabled() {
- WebElement saveButtonElement = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.PropertiesPopupEnum.SAVE.getValue());
- return GeneralUIUtils.isElementDisabled(saveButtonElement);
- }
-
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/GeneralPageElements.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/GeneralPageElements.java
deleted file mode 100644
index 0342661232..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/GeneralPageElements.java
+++ /dev/null
@@ -1,271 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.TopMenuButtonsEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.utilities.CatalogUIUtilitis;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebDriverException;
-import org.openqa.selenium.WebElement;
-
-import java.util.List;
-import java.util.function.Supplier;
-
-public class GeneralPageElements {
-
- private static final int WAIT_FOR_ELEMENT_TIME_OUT = 60;
- private static final int WAIT_FOR_ELEMENT_TIME_OUT_DIVIDER = 10;
-
- protected GeneralPageElements() {
-
- }
-
- public static ResourceLeftMenu getLeftMenu() {
- return new ResourceLeftMenu();
- }
-
- public static void clickOKButton() {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on the OK button");
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ModalItems.OK.getValue());
- }
-
- public static void clickCreateButton() {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on the CREATE/UPDATE button.");
- GeneralUIUtils.clickOnAreaJS(DataTestIdEnum.GeneralElementsEnum.CREATE_BUTTON.getValue());
- GeneralUIUtils.ultimateWait();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.CHECKIN_BUTTON.getValue());
- ExtentTestActions.log(Status.INFO, "Succeeded.");
- }
-
- public static void clickCreateButton(int timeout) {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on the CREATE/UPDATE button");
- GeneralUIUtils.clickOnAreaJS(DataTestIdEnum.GeneralElementsEnum.CREATE_BUTTON.getValue(), timeout);
- GeneralUIUtils.ultimateWait();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.CHECKIN_BUTTON.getValue());
- }
-
- public static void clickCreateUpdateButton(int timeout) {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on the CREATE/UPDATE button");
- GeneralUIUtils.clickOnAreaJS(DataTestIdEnum.GeneralElementsEnum.CREATE_BUTTON.getValue(), timeout);
- GeneralUIUtils.ultimateWait();
- }
-
- public static void clickUpdateButton() {
- clickCreateButton();
- }
-
- public static void clickCheckinButton(String componentName) {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on the CHECKIN button");
- GeneralUIUtils.ultimateWait();
- GeneralUIUtils.clickOnAreaJS(DataTestIdEnum.GeneralElementsEnum.CHECKIN_BUTTON.getValue());
- GeneralUIUtils.ultimateWait();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ModalItems.ACCEPT_TESTING_MESSAGE.getValue()).sendKeys("Checkin " + componentName);
- clickOKButton();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtons.SEARCH_BOX.getValue());
- GeneralUIUtils.ultimateWait();
- }
-
- public static void clickSubmitForTestingButton(String componentName) {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on the submitting for testing button");
- GeneralUIUtils.clickOnAreaJS(DataTestIdEnum.GeneralElementsEnum.SUBMIT_FOR_TESTING_BUTTON.getValue());
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ModalItems.SUMBIT_FOR_TESTING_MESSAGE.getValue()).sendKeys("Submit for testing " + componentName);
- GeneralUIUtils.ultimateWait();
- clickOKButton();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtons.SEARCH_BOX.getValue(), WAIT_FOR_ELEMENT_TIME_OUT);
- GeneralUIUtils.ultimateWait();
- }
-
- public static void clickSubmitForTestingButtonErrorCase(String componentName) throws Exception {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on the submitting for testing button");
- GeneralUIUtils.clickOnAreaJS(DataTestIdEnum.GeneralElementsEnum.SUBMIT_FOR_TESTING_BUTTON.getValue());
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ModalItems.SUMBIT_FOR_TESTING_MESSAGE.getValue()).sendKeys("Submit for testing " + componentName);
- GeneralUIUtils.ultimateWait();
- clickOKButton();
- clickOKButton();
- }
-
- public static void restoreComponentFromArchivedCatalog(String componentName) throws Exception {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue());
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.CatalogSwitchButtons.CATALOG_SWITCH_BUTTON.getValue());
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.CatalogSwitchButtons.CATALOG_ARCHIVE.getValue());
- GeneralUIUtils.findComponentAndClick(componentName);
- clickRestoreButton(componentName);
- }
-
- public static void restoreComponentFromElementPage(String componentName) throws Exception {
- clickRestoreButton(componentName);
- }
-
- private static void clickRestoreButton(String componentName) {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Going to restore component: %s", componentName));
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.GeneralElementsEnum.RESTORE_BUTTON.getValue());
- }
-
- public static void clickArchivedButtonFromCatalog(String componentName) throws Exception {
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(componentName);
- clickArchiveButton(componentName);
- }
-
- public static void archiveComponentFromElementPage(String componentName) throws Exception {
- clickArchiveButton(componentName);
- }
-
- private static void clickArchiveButton(String componentName) {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Going to archive component: %s", componentName));
- GeneralUIUtils.hoverOnAreaByTestId(DataTestIdEnum.GeneralElementsEnum.ARCHIVE_BUTTON.getValue());
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.GeneralElementsEnum.ARCHIVE_BUTTON.getValue());
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Component %s archived successfully", componentName));
- }
-
- //TODO should implement real code
- public static void clickCertifyButton(String componentName) throws Exception {
- try {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on certify button");
- GeneralUIUtils.clickOnAreaJS(DataTestIdEnum.LifeCyleChangeButtons.CERTIFY.getValue());
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.DistributionChangeButtons.APPROVE_MESSAGE.getValue())
- .sendKeys("resource " + componentName + " certified successfully");
- clickOKButton();
- GeneralUIUtils.ultimateWait();
- HomePage.navigateToHomePage();
- GeneralUIUtils.ultimateWait();
- HomePage.navigateToHomePage();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtons.SEARCH_BOX.getValue(), GeneralUIUtils.getTimeOut() / WAIT_FOR_ELEMENT_TIME_OUT_DIVIDER);
- GeneralUIUtils.ultimateWait();
- } catch (Exception e) {
- throw new Exception("Certification of " + componentName + " failed");
- }
- }
-
- public static void clickCertifyButtonNoUpgradePopupDismiss(String componentName) throws Exception {
- try {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on certify button");
- GeneralUIUtils.clickOnAreaJS(DataTestIdEnum.LifeCyleChangeButtons.CERTIFY.getValue());
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.DistributionChangeButtons.APPROVE_MESSAGE.getValue())
- .sendKeys("resource " + componentName + " certified successfully");
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ModalItems.OK.getValue()).click();
- } catch (Exception e) {
- throw new Exception("Certification of " + componentName + " failed");
- }
- }
-
- public static void clickCertifyButtonNoUpgradePopupDismissErrorCase(String componentName) throws Exception {
- try {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on certify button");
- GeneralUIUtils.clickOnAreaJS(DataTestIdEnum.LifeCyleChangeButtons.CERTIFY.getValue());
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.DistributionChangeButtons.APPROVE_MESSAGE.getValue())
- .sendKeys("resource " + componentName + " certified successfully");
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ModalItems.OK.getValue()).click();
- clickOKButton();
- } catch (Exception e) {
- throw new Exception("Certification of " + componentName + " failed");
- }
- }
-
- public static void clickUpgradeServicesCloseButton() {
- WebElement closeButton = null;
- try {
- closeButton = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ModalItems.UPGRADE_SERVICES_CANCEL.getValue(), GeneralUIUtils.getTimeOut() / WAIT_FOR_ELEMENT_TIME_OUT_DIVIDER);
- UpgradeServicesPopup.setUpgradePopupShown(true);
- SetupCDTest.getExtendTest().log(Status.INFO, "Closing Update Services popup with X button ...");
- closeButton.click();
- } catch (WebDriverException e) {
- // regular flow
- UpgradeServicesPopup.setUpgradePopupShown(false);
- SetupCDTest.getExtendTest().log(Status.INFO, "Update Services popup is not shown, continuing ...");
- }
- }
-
- public static void clickCheckoutButton() throws Exception {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on CHECKOUT button ...");
- GeneralUIUtils.clickOnAreaJS(DataTestIdEnum.GeneralElementsEnum.CHECKOUT_BUTTON.getValue());
- GeneralUIUtils.ultimateWait();
- }
-
-
- public static void clickDeleteVersionButton() throws Exception {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on DELETE VERSION button ...");
- GeneralUIUtils.ultimateWait();
- GeneralUIUtils.clickOnAreaJS(DataTestIdEnum.GeneralElementsEnum.DELETE_VERSION_BUTTON.getValue());
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.GeneralElementsEnum.OK.getValue());
- }
-
- public static void clickRevertButton() throws Exception {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on REVERT button ...");
- GeneralUIUtils.clickOnAreaJS(DataTestIdEnum.GeneralElementsEnum.REVERT_BUTTON.getValue());
- }
-
- public static String getLifeCycleState() {
- return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.LIFECYCLE_STATE.getValue()).getText();
- }
-
- public static String getWebElementTextByTestId(String dataTestIdEnumValue) {
- return GeneralUIUtils.getWebElementByTestID(dataTestIdEnumValue).getText();
- }
-
- public static void selectVersion(String version) {
- GeneralUIUtils.getSelectList(version, DataTestIdEnum.GeneralElementsEnum.VERSION_HEADER.getValue());
- GeneralUIUtils.ultimateWait();
- }
-
- public static List<WebElement> getElementsFromTable() {
- GeneralUIUtils.ultimateWait();
- return GeneralUIUtils.getElementsByLocator(By.className("datatable-body"));
- }
-
- public static boolean checkElementsCountInTable(int expectedElementsCount) {
- return checkElementsCountInTable(expectedElementsCount, () -> getElementsFromTable());
- }
-
-
- public static void clickTrashButtonAndConfirm() throws InterruptedException {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on TRASH button ...");
- GeneralUIUtils.clickOnAreaJS(DataTestIdEnum.GeneralElementsEnum.DELETE_VERSION_BUTTON.getValue());
- clickOKButton();
- }
-
- public static void clickBrowseButton() throws InterruptedException {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Browse button ...");
- GeneralUIUtils.clickOnAreaJS(DataTestIdEnum.ModalItems.BROWSE_BUTTON.getValue());
- }
-
- public static boolean checkElementsCountInTable(int expectedElementsCount, Supplier<List<WebElement>> func) {
- SetupCDTest.getExtendTest().log(Status.INFO, "Checking the number of elements in the table; should be " + (expectedElementsCount - 1));
- GeneralUIUtils.ultimateWait();
- return true;
- }
-
- public static void clickDeleteFile() throws Exception {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on delete file X-button ...");
- GeneralUIUtils.clickOnAreaJS(GeneralUIUtils.getWebElementBy(By.cssSelector("div[class='i-sdc-form-file-upload-x-btn']")));
- GeneralUIUtils.ultimateWait();
- }
-
- public static void clickOnHomeButton() {
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/GovernorOperationPage.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/GovernorOperationPage.java
deleted file mode 100644
index d4c0c9054b..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/GovernorOperationPage.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-
-public class GovernorOperationPage {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(GovernorOperationPage.class);
-
- private GovernorOperationPage() {
- super();
- }
-
- public static void approveService(final String serviceName) {
- SetupCDTest.getExtendTest()
- .log(Status.INFO, String.format("Approving the distribution of the service '%s'", serviceName));
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.DistributionChangeButtons.APPROVE.getValue()).click();
- GeneralUIUtils.waitForLoader();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.DistributionChangeButtons.APPROVE_MESSAGE.getValue())
- .sendKeys("service " + serviceName + " tested successfully");
- GeneralPageElements.clickOKButton();
- final String distributionApprovedMsg = String.format("The distribution of the service '%s' was approved", serviceName);
- try {
- ExtentTestActions
- .addScreenshot(Status.INFO,
- String.format("governor-distribution-approved-%s", serviceName),
- distributionApprovedMsg
- );
- } catch (final IOException e) {
- LOGGER.error("Could not take screenshot of governor distribution approval", e);
- SetupCDTest.getExtendTest().log(Status.INFO, distributionApprovedMsg);
- }
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtons.SEARCH_BOX.getValue());
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/HeatParamNameBuilder.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/HeatParamNameBuilder.java
deleted file mode 100644
index a54dc434da..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/HeatParamNameBuilder.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-
-public class HeatParamNameBuilder {
- private static final String CURRENT_VAL = DataTestIdEnum.EnvParameterView.ENV_CURRENT_VALUE.getValue();
- private static final String DEFAULT_VAL = DataTestIdEnum.EnvParameterView.ENV_DEFAULT_VALUE.getValue();
-
- private HeatParamNameBuilder() {}
-
- public static String buildCurrentHeatParamValue(String paramName) {
- return new StringBuilder().append(CURRENT_VAL).append(paramName).toString();
- }
-
- public static String buildDefaultHeatParamValue(String paramName) {
- return new StringBuilder().append(DEFAULT_VAL).append(paramName).toString();
- }
-
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/HomePage.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/HomePage.java
deleted file mode 100644
index a0747fce0b..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/HomePage.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.exception.HomePageRuntimeException;
-import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.utilities.DownloadManager;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.support.ui.ExpectedConditions;
-import org.openqa.selenium.support.ui.WebDriverWait;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.File;
-import java.io.IOException;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.List;
-import java.util.UUID;
-
-import static org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest.getExtendTest;
-import static org.openecomp.sdc.ci.tests.pages.HomePage.PageElement.REPOSITORY_ICON;
-
-public class HomePage {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(HomePage.class);
-
- private static final int WAIT_FOR_ELEMENT_TIME_OUT = 30;
- private static final int WAIT_FOR_LOADER_TIME_OUT = 600;
-
- private HomePage() {
-
- }
-
- public static void showVspRepository() {
- GeneralUIUtils.waitForElementInVisibilityBy(By.className("ui-notification"), WAIT_FOR_ELEMENT_TIME_OUT);
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.MainMenuButtons.REPOSITORY_ICON.getValue());
- }
-
- public static boolean searchForVSP(String vspName) {
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ImportVfRepository.SEARCH.getValue()).clear();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ImportVfRepository.SEARCH.getValue()).sendKeys(vspName);
- GeneralUIUtils.ultimateWait();
- return true;
- }
-
- public static void importVSP(String vspName) {
- HomePage.showVspRepository();
- boolean vspFound = HomePage.searchForVSP(vspName);
- if (vspFound) {
- List<WebElement> elementsFromTable = GeneralPageElements.getElementsFromTable();
- WebDriverWait wait = new WebDriverWait(GeneralUIUtils.getDriver(), WAIT_FOR_ELEMENT_TIME_OUT);
- WebElement findElement = wait.until(ExpectedConditions.visibilityOf(elementsFromTable.get(1)));
- findElement.click();
- GeneralUIUtils.waitForLoader();
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ImportVfRepository.IMPORT_VSP.getValue());
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.GeneralElementsEnum.CREATE_BUTTON.getValue());
- GeneralUIUtils.waitForLoader(WAIT_FOR_LOADER_TIME_OUT);
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.CHECKIN_BUTTON.getValue());
- }
- }
-
- public static boolean navigateToHomePage() {
- try {
- LOGGER.debug("Searching for repository icon");
- final WebElement repositoryIcon = GeneralUIUtils.getInputElement(REPOSITORY_ICON.getTestId());
- if (repositoryIcon != null) {
- return true;
- }
- GeneralUIUtils.ultimateWait();
- final List<WebElement> homeButtons = GeneralUIUtils
- .getElementsByLocator(By.xpath("//a[contains(.,'HOME')]"));
- if (!homeButtons.isEmpty()) {
- homeButtons.stream().filter(WebElement::isDisplayed).findFirst().ifPresent(webElement -> {
- webElement.click();
- LOGGER.debug("Clicked on home button");
- });
- }
-
- GeneralUIUtils.closeErrorMessage();
- WebElement homeButton = GeneralUIUtils
- .getInputElement(DataTestIdEnum.MainMenuButtons.HOME_BUTTON.getValue());
- return homeButton != null && homeButton.isDisplayed();
-
- } catch (final Exception e) {
- final String msg = "Could not click on home button";
- getExtendTest()
- .log(Status.WARNING, msg);
- LOGGER.warn(msg, e);
- return false;
- }
- }
-
- public static File downloadVspCsarToDefaultDirectory(String vspName) throws Exception {
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
- DownloadManager.downloadCsarByNameFromVSPRepository(vspName, "");
- return FileHandling.getLastModifiedFileNameFromDir();
- }
-
- public static void findComponentAndClick(final String resourceName) {
- findComponent(resourceName);
- clickComponent(resourceName);
- }
-
- public static void findComponent(final String resourceName) {
- LOGGER.debug("Searching for component '{}'", resourceName);
- getExtendTest().log(Status.INFO, "Searching for " + resourceName + " in home tab");
- clearSearchResults(getSearchInput());
- searchForComponent(resourceName);
- }
-
- private static WebElement getSearchInput() {
- WebElement searchTextbox;
- try {
- searchTextbox = TopSearchComponent.getComponentInput();
- LOGGER.debug("Search textbox '{}' selected", TopSearchComponent.SEARCH_INPUT_TEST_ID);
- } catch (final Exception e) {
- final String errorMsg = "Top Search bar was not visible";
- getExtendTest().log(Status.ERROR, errorMsg);
- throw new HomePageRuntimeException(errorMsg, e);
- }
- return searchTextbox;
- }
-
- private static void clearSearchResults(final WebElement searchTextbox) {
- try {
- LOGGER.debug("Clearing search results before searching");
- TopSearchComponent.replaceSearchValue(searchTextbox, UUID.randomUUID().toString());
- MainRightContainer.isEmptyResult();
- } catch (final Exception e) {
- final String errorMsg = "Could not clean up the search result";
- getExtendTest().log(Status.ERROR, errorMsg);
- throw new HomePageRuntimeException(errorMsg, e);
- }
- }
-
- private static void searchForComponent(final String resourceName) {
- try {
- LOGGER.debug("Searching for '{}'", resourceName);
- TopSearchComponent.replaceSearchValue(resourceName);
- MainRightContainer.isResultVisible(resourceName);
- } catch (final Exception e) {
- final String errorMsg = String.format("Could not find the component '%s' after search", resourceName);
- getExtendTest().log(Status.ERROR, errorMsg);
- throw new HomePageRuntimeException(errorMsg, e);
- }
- }
-
- public static void clickComponent(final String resourceName) {
- LOGGER.debug("Clicking on the component " + resourceName);
- try {
- getExtendTest()
- .log(Status.INFO, String.format("Clicking on the '%s' component from home tab", resourceName));
- GeneralUIUtils.clickOnElementByTestId(resourceName);
- } catch (final Exception e) {
- final String errorMsg = String.format("Could not click on home tab component '%s' ", resourceName);
- getExtendTest().log(Status.ERROR, e.getMessage());
- throw new HomePageRuntimeException(errorMsg, e);
- }
- final String datetimeString =
- new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss.SSS").format(Calendar.getInstance().getTime());
- try {
- ExtentTestActions
- .addScreenshot(Status.INFO,
- String.format("after-click-resource-%s-%s", resourceName, datetimeString),
- String.format("Clicked on resource '%s'", resourceName)
- );
- } catch (final IOException e) {
- LOGGER.warn("Could take screenshot after resource {} click", resourceName, e);
- }
- try {
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.LIFECYCLE_STATE.getValue());
- } catch (final Exception e) {
- final String errorMsg = String.format("Expecting to be inside component '%s' screen", resourceName);
- getExtendTest().log(Status.ERROR, e.getMessage());
- throw new HomePageRuntimeException(errorMsg, e);
- }
- }
-
- public static void waitForElement(PageElement homePageElement) {
- final String cssClass = homePageElement.getCssClass();
- LOGGER.debug("Waiting for{} visibility", cssClass);
- GeneralUIUtils.getWebElementByClassName(cssClass);
- LOGGER.debug("{} is visible", cssClass);
- }
-
- public enum PageElement {
- COMPONENT_PANEL("w-sdc-main-right-container", null),
- REPOSITORY_ICON(null, "repository-icon");
-
- private final String cssClass;
- private final String testId;
-
- PageElement(String cssClass, String testId) {
- this.cssClass = cssClass;
- this.testId = testId;
- }
-
- public String getCssClass() {
- return cssClass;
- }
-
- public String getTestId() {
- return testId;
- }
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/IconPage.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/IconPage.java
deleted file mode 100644
index 82200e0e54..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/IconPage.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-
-public class IconPage extends GeneralPageElements {
-
- private IconPage() {
- super();
- }
-
- public static void clickOnIcon(ResourceCategoryEnum iconName) {
- GeneralUIUtils.getWebElementByTestID(iconStringBuilder(iconName) + DataTestIdEnum.ServiceMetadataEnum.ICON.getValue())
- .click();
- }
-
- private static String iconStringBuilder(ResourceCategoryEnum icon) {
- String iconName = icon.getSubCategory();
- String[] splitedIconName = iconName.split(" ");
- splitedIconName[0] = splitedIconName[0].toLowerCase();
-
- StringBuilder sb = new StringBuilder();
- for (String word : splitedIconName) {
- sb.append(word);
- }
-
- return sb.toString();
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/InformationalArtifactPage.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/InformationalArtifactPage.java
deleted file mode 100644
index 8dcc8908aa..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/InformationalArtifactPage.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
-import org.openqa.selenium.WebElement;
-
-import java.util.List;
-
-public class InformationalArtifactPage extends DeploymentArtifactPage {
-
- private InformationalArtifactPage() {
- super();
- }
-
- public static void clickAddNewArtifact() {
- addNewArtifact(ArtifactGroupTypeEnum.INFORMATIONAL);
- }
-
- public static String getArtifactDescription(String artifactLabel) throws Exception {
- InformationalArtifactPage.clickOnArtifact(artifactLabel);
- String artifactDesc = GeneralUIUtils.getWebElementByTestID(
- artifactLabel + DataTestIdEnum.ArtifactPageEnum.GET_INFORMATIONAL_ARTIFACT_DESCRIPTION.getValue())
- .getText();
- InformationalArtifactPage.clickOnArtifact(artifactLabel); // close artifact
- return artifactDesc;
- }
-
- public static List<WebElement> getElemenetsFromTable() {
- return GeneralUIUtils.getWebElementsListByTestID("InformationalArtifactRow");
- }
-
- public static WebElement clickOnArtifact(String artifactLabel) throws Exception {
- try {
- WebElement artifact = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.ARTIFACT_NAME.getValue() + artifactLabel);
- artifact.click();
- GeneralUIUtils.waitForLoader();
- return artifact;
- } catch (Exception e) {
- throw new Exception("Artifact " + artifactLabel + "is not found");
- }
- }
-
-
- public static void clickDeleteArtifact(String artifactLabel) {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Deleting %s Artefact ", artifactLabel));
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPageEnum.DELETE_ARTIFACT.getValue() + artifactLabel).click();
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/InputsPage.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/InputsPage.java
deleted file mode 100644
index ee8d77e309..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/InputsPage.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.InputsScreenService;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebElement;
-import org.testng.TestException;
-
-import java.util.List;
-import java.util.stream.Collectors;
-
-public class InputsPage extends GeneralPageElements {
-
- private InputsPage() {
- super();
- }
-
- public static List<WebElement> getInstancePropertiesList(String instanceName) {
- List<WebElement> propertyRows = null;
- GeneralUIUtils.clickOnElementByText(instanceName);
- GeneralUIUtils.ultimateWait();
- propertyRows = getVisibleProperites();
- return propertyRows;
- }
-
- static List<WebElement> getVisibleProperites() {
- List<WebElement> instancesFromTable = GeneralUIUtils.getDriver().findElements(By.cssSelector("div[class^='vf-instance-list']"));
- for (WebElement instance : instancesFromTable) {
- Object parentAttributes = GeneralUIUtils.getAllElementAttributes(instance);
- if (!parentAttributes.toString().contains("hidden")) {
- return instance.findElements(By.className("property-row"));
- }
- }
- return null;
- }
-
- public static void addInputToService(String VFInstanceName, String propertyName) throws Exception {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Adding property %s from VF instance %s to Service", propertyName, VFInstanceName));
- List<WebElement> instaceInputs = getInstanceInputsList(VFInstanceName);
- for (WebElement instancInput : instaceInputs) {
- String actualPropertyName = instancInput.findElement(By.className("title-text")).getText();
- if (actualPropertyName.equals(propertyName) && clickOnVFInputCheckbox(instancInput)) {
- clickOnAddInputButton();
- }
- }
- }
-
- public static List<WebElement> getInstanceInputsList(String instanceName) {
- List<WebElement> inputRows = null;
- GeneralUIUtils.clickOnElementByText(instanceName);
- GeneralUIUtils.ultimateWait();
- inputRows = getVisibleInputs(inputRows);
- return inputRows;
- }
-
- public static List<WebElement> getVisibleInputs(List<WebElement> inputRows) {
- List<WebElement> instancesFromTable = GeneralUIUtils.getDriver().findElements(By.cssSelector("div[class^='vf-instance-list']"));
- for (WebElement instance : instancesFromTable) {
- Object parentAttributes = GeneralUIUtils.getAllElementAttributes(instance);
- if (!parentAttributes.toString().contains("hidden")) {
- inputRows = instance.findElements(By.className("input-row"));
- break;
- }
- }
- return inputRows;
- }
-
- public static void clickOnAddInputButton() {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Add Input aka Greater than symbol button"));
- GeneralUIUtils.clickOnElementByTestId(InputsScreenService.ADD_SELECTED_INPUTS_BTN.getValue());
- //GeneralUIUtils.ultimateWait();
- }
-
- public static boolean clickOnVFInputCheckbox(WebElement instancInput) {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on VF instance input checkbox"));
- instancInput.findElement(By.className("tlv-checkbox-label")).click();
- GeneralUIUtils.ultimateWait();
- return instancInput.findElement(By.className("tlv-checkbox-i")).getAttribute("class").contains("ng-not-empty");
- }
-
- public static WebElement getServiceInput(String VFInstanceName, String propertyName) throws Exception {
- String expectedInputName = String.format("%s_%s", VFInstanceName.replace(" ", "").toLowerCase(), propertyName);
- List<WebElement> inputsFromTable = GeneralUIUtils.getElementsByCSS(InputsScreenService.SERVICE_INPUT_ROW.getValue());
- for (WebElement inputFromTable : inputsFromTable) {
- String actualInputName = inputFromTable.findElement(By.className("title-text")).getText();
- if (actualInputName.equals(expectedInputName)) {
- return inputFromTable;
- }
- }
- throw new TestException(String.format("%s input don't exist", expectedInputName));
- }
-
- public static void deleteServiceInput(String VFInstanceName, String propertyName) throws Exception {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Deleting property %s in VF instance %s ", propertyName, VFInstanceName));
- WebElement serviceInput = getServiceInput(VFInstanceName, propertyName);
- serviceInput.findElement(By.cssSelector(InputsScreenService.DELETE_INPUT_BTN.getValue())).click();
- GeneralUIUtils.ultimateWait();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on OK button "));
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.GeneralElementsEnum.OK.getValue());
- //GeneralUIUtils.ultimateWait();
- }
-
- public static List<String> getVFCInstancesNamesFromTable() throws Exception {
- WebElement inputsTable = getInputsTable("VFC ");
- return inputsTable.findElements(By.cssSelector("span[class^='title-text']")).stream().
- map(e -> e.getText()).
- collect(Collectors.toList());
- }
-
- public static WebElement getInputsTable(String tableName) throws Exception {
- List<WebElement> tableElements = GeneralUIUtils.getElementsByCSS("div.table");
- for (WebElement tableElement : tableElements) {
- String tableTitle = GeneralUIUtils.getElementfromElementByCSS(tableElement, "div.table-header").getText();
- if (tableTitle.contains(tableName)) {
- return tableElement;
- }
- }
- throw new TestException(String.format("Can't find %s table", tableName));
- }
-
- public static void clickOnProperty(String propertyName) {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on property %s ", propertyName));
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.InputsScreenService.RESOURCE_INSTANCE_PROPERTY_NAME.getValue() + propertyName);
- //GeneralUIUtils.ultimateWait();
- }
-
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/MainRightContainer.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/MainRightContainer.java
deleted file mode 100644
index 1bbda648b5..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/MainRightContainer.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-
-/**
- * Represents the "w-sdc-main-right-container" panel that shows the list of resources/components.
- */
-public class MainRightContainer {
-
- public static final String CSS_CLASS = "w-sdc-main-right-container";
-
- private MainRightContainer() {
-
- }
-
- /**
- * Checks if the resource is visible in the panel/container.
- *
- * @param resourceName the resource name to search in the panel/container
- * @return {@code true} if the resource is visible, {@code false} otherwise.
- */
- public static boolean isResultVisible(final String resourceName) {
- return GeneralUIUtils.isElementVisibleByTestId(resourceName);
- }
-
- /**
- * Checks if the panel/container is showing no resources.
- *
- * @return {@code true} if the panel/container is empty, {@code false} otherwise.
- */
- public static boolean isEmptyResult() {
- return GeneralUIUtils.isElementInvisibleByTestId("dashboard-Elements");
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/OnboardHeaderComponent.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/OnboardHeaderComponent.java
deleted file mode 100644
index f5801ad70f..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/OnboardHeaderComponent.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.support.ui.ExpectedConditions;
-
-import static org.openecomp.sdc.ci.tests.pages.OnboardHeaderComponent.XpathSelector.MAIN_DIV;
-import static org.openecomp.sdc.ci.tests.pages.OnboardHeaderComponent.XpathSelector.ONBOARD_TAB_DIV;
-import static org.openecomp.sdc.ci.tests.pages.OnboardHeaderComponent.XpathSelector.WORKSPACE_TAB_DIV;
-
-/**
- * Handles the Onboard Header Component UI test actions
- */
-public class OnboardHeaderComponent extends AbstractPageObject {
-
- private WebElement wrappingElement;
-
- public OnboardHeaderComponent(final WebDriver webDriver) {
- super(webDriver);
- }
-
- @Override
- public void isLoaded() {
- wrappingElement = getWait()
- .until(ExpectedConditions.visibilityOfElementLocated(By.xpath(MAIN_DIV.getXpath())));
- getWait()
- .until(ExpectedConditions.visibilityOfElementLocated(By.xpath(WORKSPACE_TAB_DIV.getXpath())));
- getWait()
- .until(ExpectedConditions.visibilityOfElementLocated(By.xpath(ONBOARD_TAB_DIV.getXpath())));
- }
-
- /**
- * Clicks on the workspace tab.
- */
- public void clickOnWorkspaceTab() {
- wrappingElement.findElement(By.xpath(WORKSPACE_TAB_DIV.getXpath()));
- }
-
- /**
- * Clicks on the workspace tab.
- */
- public void clickOnOnboardTab() {
- wrappingElement.findElement(By.xpath(ONBOARD_TAB_DIV.getXpath()));
- }
-
- /**
- * Enum that contains identifiers and xpath expressions to elements related to the enclosing page object.
- */
- public enum XpathSelector {
- MAIN_DIV("onboard-header", "//div[contains(@class, '%s')]"),
- WORKSPACE_TAB_DIV("onboard-workspace-tab", "//div[@data-test-id='%s']"),
- ONBOARD_TAB_DIV("onboard-onboard-tab", "//div[@data-test-id='%s']");
-
- private final String id;
- private final String xpathFormat;
-
- XpathSelector(final String id, final String xpathFormat) {
- this.id = id;
- this.xpathFormat = xpathFormat;
- }
-
- public String getId() {
- return id;
- }
-
- public String getXpath() {
- return String.format(xpathFormat, id);
- }
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/OnboardHomePage.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/OnboardHomePage.java
deleted file mode 100644
index 3acb34b6c6..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/OnboardHomePage.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.support.ui.ExpectedConditions;
-
-import static org.openecomp.sdc.ci.tests.pages.OnboardHomePage.XpathSelector.ADD_NEW_VLM_BTN;
-import static org.openecomp.sdc.ci.tests.pages.OnboardHomePage.XpathSelector.ADD_NEW_VSP_BTN;
-
-/**
- * Handles the Onboard Home Page UI test actions
- */
-public class OnboardHomePage extends AbstractPageObject {
-
- private final OnboardHeaderComponent onboardHeaderComponent;
- private WebElement createNewVspBtn;
-
- public OnboardHomePage(final WebDriver webDriver,
- final OnboardHeaderComponent onboardHeaderComponent) {
- super(webDriver);
- this.onboardHeaderComponent = onboardHeaderComponent;
- }
-
- @Override
- public void isLoaded() {
- onboardHeaderComponent.isLoaded();
- createNewVspBtn = getWait()
- .until(ExpectedConditions.visibilityOfElementLocated(By.xpath(ADD_NEW_VSP_BTN.getXpath())));
- getWait()
- .until(ExpectedConditions.visibilityOfElementLocated(By.xpath(ADD_NEW_VLM_BTN.getXpath())));
- }
-
- /**
- * Clicks on the button create new vsp.
- *
- * @return returns the next vsp creation page object
- */
- public VspCreationModal clickOnCreateNewVsp() {
- createNewVspBtn.click();
- return new VspCreationModal(webDriver);
- }
-
- /**
- * Enum that contains identifiers and xpath expressions to elements related to the enclosing page object.
- */
- public enum XpathSelector {
- ADD_NEW_VSP_BTN("catalog-add-new-vsp", "//div[@data-test-id='%s']"),
- ADD_NEW_VLM_BTN("catalog-add-new-vlm", "//div[@data-test-id='%s']");
-
- private final String id;
- private final String xpathFormat;
-
- XpathSelector(final String id, final String xpathFormat) {
- this.id = id;
- this.xpathFormat = xpathFormat;
- }
-
- public String getId() {
- return id;
- }
-
- public String getXpath() {
- return String.format(xpathFormat, id);
- }
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/OpsOperationPage.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/OpsOperationPage.java
deleted file mode 100644
index 630ffe419e..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/OpsOperationPage.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.StepsEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.support.ui.ExpectedConditions;
-import org.openqa.selenium.support.ui.WebDriverWait;
-
-import java.util.List;
-
-public class OpsOperationPage {
-
- private static final int WEB_DRIVER_TIME_OUT = 90;
- private static final int MAX_WAITING_PERIOD_MS = 5 * 60 * 1000;
- private static final int NAP_PERIOD = 10000;
- private static final int MAX_WAITING_PERIOF_DIVIDER = 1000;
-
- private OpsOperationPage() {
- super();
- }
-
- public static void distributeService() {
- SetupCDTest.getExtendTest().log(Status.INFO, "Distributing");
- clickOnButton(DataTestIdEnum.DistributionChangeButtons.DISTRIBUTE);
- GeneralUIUtils.waitForLoader();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.DistributionChangeButtons.MONITOR.getValue());
- }
-
- public static void displayMonitor() {
- GeneralUIUtils.moveToStep(StepsEnum.MONITOR);
- }
-
- public static void reDistributeService() {
- SetupCDTest.getExtendTest().log(Status.INFO, "Redistributing...");
- clickOnButton(DataTestIdEnum.DistributionChangeButtons.RE_DISTRIBUTE);
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.DistributionChangeButtons.MONITOR.getValue());
- }
-
- private static void clickOnButton(DataTestIdEnum.DistributionChangeButtons button) {
- GeneralUIUtils.getWebElementByTestID(button.getValue()).click();
- GeneralUIUtils.waitForLoader();
- }
-
- public static List<WebElement> getRowsFromMonitorTable() {
- SetupCDTest.getExtendTest().log(Status.INFO, "Counting the rows from the distribution table");
- GeneralPageElements.checkElementsCountInTable(1, () -> GeneralUIUtils.getWebElementsListByTestID("ditributionTable"));
- List<WebElement> distributionRecords = GeneralUIUtils.getWebElementsListByTestID("ditributionTable");
- List<WebElement> findElements = distributionRecords.get(0).findElements(By.className("w-sdc-distribute-parent-block"));
- return findElements;
- }
-
- public static void showDistributionStatus(int rowIndex) {
- GeneralUIUtils.getWebElementByTestID("ShowRecordButton_" + String.valueOf(rowIndex)).click();
- GeneralUIUtils.waitForLoader();
- }
-
- public static String getTotalArtifactsSum(int rowIndex) {
- return GeneralUIUtils.getWebElementByTestID("totalArtifacts_" + String.valueOf(rowIndex)).getText();
- }
-
- public static String getNotifiedArtifactsSum(int rowIndex) {
- return GeneralUIUtils.getWebElementByTestID("notified_" + String.valueOf(rowIndex)).getText();
- }
-
- public static String getDownloadedArtifactsSum(int rowIndex) {
- return GeneralUIUtils.getWebElementByTestID("downloaded_" + String.valueOf(rowIndex)).getText();
- }
-
- public static String getDeployedArtifactsSum(int rowIndex) {
- return GeneralUIUtils.getWebElementByTestID("deployed_" + String.valueOf(rowIndex)).getText();
- }
-
- public static String getNotNotifiedArtifactsSum(int rowIndex) {
- return GeneralUIUtils.getWebElementByTestID("NotNotified_" + String.valueOf(rowIndex)).getText();
- }
-
- public static String getErrorsSum(int rowIndex) {
- return GeneralUIUtils.getWebElementByTestID("errors_" + String.valueOf(rowIndex)).getText();
- }
-
- public static void clickRefreshTableButton(int rowIndex) {
- GeneralUIUtils.getWebElementByTestID("refreshButton").click();
- // wait until total artifacts field disappear
- WebDriverWait wait = new WebDriverWait(GeneralUIUtils.getDriver(), WEB_DRIVER_TIME_OUT);
- wait.until(ExpectedConditions.invisibilityOfElementLocated(By.xpath("//*[@data-tests-id='" + "totalArtifacts_" + String.valueOf(rowIndex) + "']")));
- }
-
- public static void waitUntilArtifactsDistributed(int rowIndex) throws Exception {
- waitUntilArtifactsDistributed("0", 0);
- }
-
- public static void waitUntilArtifactsDistributed(String expectedArtifactsSum, int rowIndex) throws Exception {
- SetupCDTest.getExtendTest().log(Status.INFO, "Waiting until all artifacts are distributed");
- boolean isKeepWaiting = true;
- int maxWaitingPeriodMS = MAX_WAITING_PERIOD_MS;
- int sumWaitingTime = 0;
- int napPeriod = NAP_PERIOD;
- while (isKeepWaiting) {
- showDistributionStatus(rowIndex);
- String actualTotalArtifactsSize = getTotalArtifactsSum(rowIndex);
- String actualNotifiedArtifactsSize = getNotifiedArtifactsSum(rowIndex);
- String actualDownloadedArtifactsSize = getDownloadedArtifactsSum(rowIndex);
- String actualDeployedArtifactsSize = getDeployedArtifactsSum(rowIndex);
- String actualNotNotifedArtifactsSize = getNotNotifiedArtifactsSum(rowIndex);
- isKeepWaiting = !actualTotalArtifactsSize.equals(actualDownloadedArtifactsSize)
- || !actualTotalArtifactsSize.equals(actualNotifiedArtifactsSize)
- || !actualTotalArtifactsSize.equals(actualDeployedArtifactsSize)
- || actualTotalArtifactsSize.equals("0") || actualDownloadedArtifactsSize.equals("0")
- || actualNotifiedArtifactsSize.equals("0") || actualDeployedArtifactsSize.equals("0");
-
- if (isKeepWaiting) {
-
- if (Integer.parseInt(actualNotNotifedArtifactsSize) > 1) {
- SetupCDTest.getExtendTest().log(Status.INFO, "Some artifacts are not notified");
- isKeepWaiting = false;
- throw new Exception("Some artifacts are not notified...");
- }
-
- GeneralUIUtils.sleep(napPeriod);
- sumWaitingTime += napPeriod;
-
- if (sumWaitingTime > maxWaitingPeriodMS) {
- SetupCDTest.getExtendTest().log(Status.INFO, "Not all artifacts are displayed");
- isKeepWaiting = false;
- throw new Exception(String.format("Not all artifacts are displayed withing %s seconds",
- String.valueOf(maxWaitingPeriodMS / MAX_WAITING_PERIOF_DIVIDER)));
- }
-
- clickRefreshTableButton(rowIndex);
- }
- }
-
- SetupCDTest.getExtendTest().log(Status.INFO, "All artifacts were successfully distributed");
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/PageObject.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/PageObject.java
deleted file mode 100644
index 63b3b530e0..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/PageObject.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-/**
- * Represents represents a page or component in a html page
- */
-@FunctionalInterface
-public interface PageObject {
-
- /**
- * Checks if the Page Object is loaded on the browser. Any problem during the checking should throw
- * a custom RuntimeException.
- */
- void isLoaded();
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ProductGeneralPage.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ProductGeneralPage.java
deleted file mode 100644
index c1f12427cd..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ProductGeneralPage.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ProductReqDetails;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebElement;
-
-import java.util.ArrayList;
-
-/**
- * @author al714h
- */
-
-public class ProductGeneralPage extends ResourceGeneralPage {
-
- private ProductGeneralPage() {
- super();
- }
-
- public static ProductLeftMenu getProductLeftMenu() {
- return new ProductLeftMenu();
- }
-
- public static void defineName(String productName) {
- WebElement productNameTextbox = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ProductMetadataEnum.PRODUCT_NAME.getValue());
- productNameTextbox.clear();
- productNameTextbox.sendKeys(productName);
- }
-
- public static void defineFullName(String productFullName) {
- WebElement productFullNameTextbox = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ProductMetadataEnum.FULL_NAME.getValue());
- productFullNameTextbox.clear();
- productFullNameTextbox.sendKeys(productFullName);
- }
-
- public static void defineProjectCode(String pmat) {
- WebElement pmattTextbox = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ProductMetadataEnum.PROJECT_CODE.getValue());
- pmattTextbox.clear();
- pmattTextbox.sendKeys(pmat);
- }
-
- public static String getPmattText() {
- return getPmattField().getAttribute("value");
- }
-
- public static String[] getTags() {
- return ResourceGeneralPage.getElementsFromTagsTable().stream().map(WebElement::getText).toArray(String[]::new);
- }
-
- private static WebElement getPmattField() {
- return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ProductMetadataEnum.PROJECT_CODE.getValue());
- }
-
- public static void deleteOldTags(ProductReqDetails product) {
- // Delete tag elements
- int i = GeneralUIUtils.getWebElementsListByTestID("i-sdc-tag-delete").size();
- while (i > 0) {
- GeneralUIUtils.getWebElementByTestID("i-sdc-tag-delete").click();
- i--;
- }
-
- product.setTags(new ArrayList<String>());
- }
-
- public static void clickAddWorkflow() {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Adding workflow..."));
- GeneralUIUtils.clickOnElementByText("Add Workflow");
- }
-
- public static void fillAndAddNewWorkflow(String name, String description) throws InterruptedException {
- GeneralUIUtils.ultimateWait();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Filling name field with %s", name));
- insertText(name, "label + input");
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Filling description filed with %s", name));
- insertText(description, "label + textarea");
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking save button "));
- clickSave();
- }
-
- public static void insertText(String artifactDescriptoin, String element) throws InterruptedException {
- GeneralUIUtils.getElementsByCSS("div[class='modal-content']");
- WebElement artifactDescriptionTextbox = GeneralUIUtils.getWebElementBy(By.cssSelector(element));
- artifactDescriptionTextbox.clear();
- artifactDescriptionTextbox.sendKeys(artifactDescriptoin);
- GeneralUIUtils.ultimateWait();
- }
-
- public static void clickSave() {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on Save button"));
- GeneralUIUtils.clickOnElementByText("Save");
- GeneralUIUtils.ultimateWait();
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ProductLeftMenu.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ProductLeftMenu.java
deleted file mode 100644
index 9e761e8058..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ProductLeftMenu.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.StepsEnum;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-
-/**
- * @author al714h
- */
-
-public class ProductLeftMenu implements ComponentLeftMenu {
-
- public void moveToGeneralScreen() throws Exception {
- GeneralUIUtils.moveToStep(StepsEnum.GENERAL);
- }
-
- public void moveToIconScreen() throws Exception {
- GeneralUIUtils.moveToStep(StepsEnum.ICON);
- }
-
- public void moveToCompositionScreen() throws Exception {
- GeneralUIUtils.moveToStep(StepsEnum.COMPOSITION);
- }
-
- public void moveToHierarchyScreen() {
- GeneralUIUtils.moveToStep(StepsEnum.HIERARCHY);
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/PropertiesAssignmentPage.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/PropertiesAssignmentPage.java
deleted file mode 100644
index 629753f077..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/PropertiesAssignmentPage.java
+++ /dev/null
@@ -1,317 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.PropertiesAssignmentScreen;
-import org.openecomp.sdc.ci.tests.exception.PropertiesAssignmentPageException;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openqa.selenium.Keys;
-import org.openqa.selenium.NoSuchElementException;
-import org.openqa.selenium.WebElement;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class PropertiesAssignmentPage {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(PropertiesAssignmentPage.class);
-
- private PropertiesAssignmentPage() {
-
- }
-
- public static void clickOnInputTab() {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Input Tab");
- GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.INPUTS_TAB.getValue());
- }
-
- public static void clickOnPropertiesTab() {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Properties Tab");
- GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.PROPERTIES_TAB.getValue());
- }
-
- public static void clickOnCompositionRightTab() {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Composition Right Tab");
- GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.COMPOSITION_TAB.getValue());
- }
-
- public static void clickOnPropertyStructureRightTab() {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Property Structure Right Tab");
- GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.PROPERTY_STRUCTURE_TAB.getValue());
- }
-
- public static void clickOnDeclareButton() {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Declare Button");
- GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.DECLARE_BUTTON.getValue());
- }
-
- public static void clickOnSaveButton() {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Save Button");
- GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.SAVE_BUTTON.getValue());
- }
-
- public static void clickOnDiscardButton() {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Discard Button");
- GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.DISCARD_BUTTON.getValue());
- }
-
- public static void clickOnDialogSaveButton() {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Save Button in Dialog Popup");
- GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.SAVE_DIALOG_SAVE.getValue());
- }
-
- public static void clickOnDialogDiscardButton() {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Discard Button in Dialog Popup");
- GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.SAVE_DIALOG_DISCARD.getValue());
- }
-
- public static void clickOnDialogCancelButton() {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Cancel Button in Dialog Popup");
- GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.SAVE_DIALOG_CANCEL.getValue());
- }
-
- public static void clickOnEditButton(String propertyName) {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Edit button ");
- GeneralUIUtils.clickOnElementByTestId(PropertyNameBuilder.buildPopupField(propertyName));
- }
-
- public static void clickOnSetButton() {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Set button in a property popup ");
- GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.FILTER_SET_BUTTON.getValue());
- }
-
- public static void clickOnExpandButton(String propertyName, int index) {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Expand Complex Property Button");
- GeneralUIUtils.clickOnElementByTestId(PropertyNameBuilder.buildIExpandButton(propertyName, index));
- }
-
- public static void findSearchBoxAndClick(final String resourceName) throws PropertiesAssignmentPageException {
- SetupCDTest.getExtendTest().log(Status.INFO, "Searching for " + resourceName + " in Properties");
- try {
- final WebElement searchTextbox = GeneralUIUtils
- .getWebElementByTestID(DataTestIdEnum.PropertiesAssignmentScreen.SEARCH_BOX.getValue());
- searchTextbox.clear();
- searchTextbox.sendKeys(resourceName);
- GeneralUIUtils.ultimateWait();
- } catch (final Exception e) {
- final String errorMsg = String.format("Could not interact with search bar, test id '%s'",
- PropertiesAssignmentScreen.SEARCH_BOX.getValue());
- LOGGER.error(errorMsg, e);
- SetupCDTest.getExtendTest().log(Status.ERROR, errorMsg);
- throw new PropertiesAssignmentPageException(errorMsg, e);
- }
-
- try {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on the %s component in Properties", resourceName));
- GeneralUIUtils.clickOnElementByInputTestIdWithoutWait(resourceName);
- GeneralUIUtils.ultimateWait();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.LIFECYCLE_STATE.getValue());
- } catch (final Exception e) {
- final String errorMsg = String.format("Could not click on component named '%s'", resourceName);
- LOGGER.error(errorMsg, e);
- SetupCDTest.getExtendTest().log(Status.ERROR, errorMsg);
- throw new PropertiesAssignmentPageException(errorMsg, e);
- }
- }
-
- private static void clickOnProperty(String propertyName) {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on the %s component in Properties", propertyName));
- GeneralUIUtils.clickOnElementByTestId(propertyName);
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.LIFECYCLE_STATE.getValue());
- }
-
- public static void clickOnAddValueToList(String propertyName) throws Exception {
- try {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on the Add To List button of %s component in Properties", propertyName));
- GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.ADD_TO_LIST_BUTTON.getValue() + propertyName);
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.LIFECYCLE_STATE.getValue());
- } catch (Exception e) {
- SetupCDTest.getExtendTest().log(Status.INFO, "Can't click on Add To List button of component named " + propertyName);
- e.printStackTrace();
- }
- }
-
- public static void clickODeleteValueFromList(String propertyName, int index) throws Exception {
- try {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on the Delete From List button of %s component in Properties", propertyName));
- GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.DELETE_FROM_LIST_BUTTON.getValue() + propertyName + "." + index);
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.LIFECYCLE_STATE.getValue());
- } catch (Exception e) {
- SetupCDTest.getExtendTest().log(Status.INFO, "Can't click on Delete From List button of component named " + propertyName);
- e.printStackTrace();
- }
- }
-
- public static void clickOnDeleteInputButton() {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Delete Input Button");
- GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.INPUT_DELETE_BUTTON.getValue());
- }
-
- public static void clickOnDeleteInputDialogConfirmationButton() {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Delete Input Dialog Confirmation Button");
- GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.INPUT_DELETE_DIALOG_DELETE.getValue());
- }
-
- public static void clickOnComponentInComposition(final String resourceName) throws Exception {
- SetupCDTest.getExtendTest()
- .log(Status.INFO, String.format("Clicking on the %s component on Properties screen", resourceName));
- try {
- GeneralUIUtils.clickOnElementByTestId(resourceName);
- } catch (final Exception e) {
- SetupCDTest.getExtendTest().log(Status.INFO, "Can't click on component named " + resourceName);
- throw e;
- }
- }
-
- public static void findInput(String componentName, String resourceName) throws Exception {
- SetupCDTest.getExtendTest().log(Status.INFO, "Searching for " + componentName + "_" + resourceName + " on Inputs screen");
- WebElement searchTextbox = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.PropertiesAssignmentScreen.SEARCH_BOX.getValue());
- String searchPattern = componentName + "_" + resourceName;
-
- searchTextbox.clear();
- searchTextbox.sendKeys(searchPattern);
- GeneralUIUtils.ultimateWait();
- }
-
- public static void findProperty(String resourceName) throws Exception {
- SetupCDTest.getExtendTest().log(Status.INFO, "Searching for " + resourceName + " property on Properties screen");
- WebElement searchTextbox = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.PropertiesAssignmentScreen.SEARCH_BOX.getValue());
-
- searchTextbox.clear();
- searchTextbox.sendKeys(resourceName);
- GeneralUIUtils.ultimateWait();
- }
-
- public static void editPropertyValue(String resourceName, String value) throws Exception {
- SetupCDTest.getExtendTest().log(Status.INFO, "Searching for " + resourceName + " property on Properties screen");
- WebElement valueTextbox = GeneralUIUtils.getWebElementByTestID(resourceName);
-
- clickOnProperty(resourceName);
- valueTextbox.clear();
- SetupCDTest.getExtendTest().log(Status.INFO, "Editing " + resourceName + " property on Properties screen");
- valueTextbox.sendKeys(value);
- GeneralUIUtils.ultimateWait();
-
- }
-
- public static void deletePropertyValue(String resourceName) throws Exception {
- SetupCDTest.getExtendTest().log(Status.INFO, "Searching for " + resourceName + " property on Properties screen");
- WebElement valueTextbox = GeneralUIUtils.getWebElementByTestID(resourceName);
-
- clickOnProperty(resourceName);
- SetupCDTest.getExtendTest().log(Status.INFO, "Deleting " + resourceName + " property on Properties screen");
- valueTextbox.sendKeys(Keys.chord(Keys.CONTROL, "a"));
- valueTextbox.sendKeys(Keys.BACK_SPACE);
- GeneralUIUtils.ultimateWait();
-
- }
-
-
- public static Boolean isPropertyChecked(String resourceName) {
-// TODO add better implementation for css string
- GeneralUIUtils.ultimateWait();
- Boolean isDisabled = GeneralUIUtils.checkForDisabledAttributeInHiddenElement("checkbox[data-tests-id='" + resourceName + "'] input");
- SetupCDTest.getExtendTest().log(Status.INFO, "Is property checkbox disabled? " + isDisabled);
- return isDisabled;
- }
-
- public static boolean isButtonDisabled(String dataTestId) {
- return GeneralUIUtils.checkForDisabledAttribute(dataTestId);
- }
-
- public static String selectBooleanPropertyValue(String propertyName, String propertyValue) {
- SetupCDTest.getExtendTest().log(Status.INFO, "Searching for " + propertyName + " property on Properties screen");
- String actualPropertyValue = null;
- try {
- actualPropertyValue = GeneralUIUtils.getSelectedElementFromDropDown(propertyName).getText();
- } catch (NoSuchElementException e) {
- SetupCDTest.getExtendTest().log(Status.INFO, "#selectBooleanPropertyValue - Failed to get selected boolean property value ");
- SetupCDTest.getExtendTest().log(Status.INFO, e);
- }
- try {
- GeneralUIUtils.getSelectList(propertyValue, propertyName);
- } catch (NoSuchElementException e) {
- e.printStackTrace();
- }
- return actualPropertyValue;
- }
-
-
- //Filter Actions
- public static void clickOnFilterButton() {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Filter button ");
- GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.FILTER_BUTTON.getValue());
- }
-
- public static void clickOnFilterAllCheckbox() {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Filter All Checkbox ");
- GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.FILTER_CHECKBOX_ALL.getValue());
- }
-
- public static void clickOnFilterCPCheckbox() {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Filter CP Checkbox ");
- GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.FILTER_CHECKBOX_CP.getValue());
- }
-
- public static void clickOnFilterVfcCheckbox() {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Filter VFC Checkbox ");
- GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.FILTER_CHECKBOX_VFC.getValue());
- }
-
- public static void clickOnFilterVlCheckbox() {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Filter VL Checkbox ");
- GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.FILTER_CHECKBOX_VL.getValue());
- }
-
- public static void clickOnFilterApplyButton() {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Filter Apply Button");
- GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.FILTER_APPLY_BUTTON.getValue());
- }
-
- public static void clickOnFilterCloseButton() {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Filter Close Button");
- GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.FILTER_CLOSE_BUTTON.getValue());
- }
-
- public static void clickOnFilterClearAllButton() {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Filter Clear All Button");
- GeneralUIUtils.clickOnElementByTestId(PropertiesAssignmentScreen.CLEAR_FILTER_BUTTON.getValue());
- }
-
- public static void findFilterBoxAndClick(String resourceName) throws Exception {
- SetupCDTest.getExtendTest().log(Status.INFO, "Searching for " + resourceName + " property in Properties table");
- WebElement searchTextbox = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.PropertiesAssignmentScreen.FILTER_BOX.getValue());
- try {
- searchTextbox.clear();
- searchTextbox.sendKeys(resourceName);
- GeneralUIUtils.ultimateWait();
- } catch (Exception e) {
- SetupCDTest.getExtendTest().log(Status.INFO, "Can't interact with search bar");
- e.printStackTrace();
- }
-
- }
-
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/PropertiesPage.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/PropertiesPage.java
deleted file mode 100644
index 8ff4570da4..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/PropertiesPage.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebElement;
-
-import java.util.List;
-
-public class PropertiesPage extends GeneralPageElements {
-
- private static final int WAIT_FOR_ELEMENT_TIME_OUT = 10;
-
- private PropertiesPage() {
- super();
- }
-
- public static List<WebElement> getElemenetsFromTable() {
- return GeneralUIUtils.getInputElements(DataTestIdEnum.PropertiesPageEnum.PROPERTY_ROW.getValue());
- }
-
- public static void clickAddPropertyArtifact() {
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.PropertiesPageEnum.ADD_NEW_PROPERTY.getValue()).click();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.PropertiesPageEnum.POPUP_FORM.getValue());
- }
-
- public static void clickEditPropertyArtifact(String propertyName) {
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.PropertiesPageEnum.EDIT_PROPERTY.getValue() + propertyName).click();
- }
-
- public static void clickDeletePropertyArtifact(String propertyName) {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Delete property %s", propertyName));
- GeneralUIUtils.hoverOnAreaByTestId(DataTestIdEnum.PropertiesPageEnum.PROPERTY_NAME.getValue() + propertyName);
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.PropertiesPageEnum.DELETE_PROPERTY.getValue() + propertyName);
- GeneralPageElements.clickOKButton();
- GeneralUIUtils.waitForElementInVisibilityBy(By.className("w-sdc-modal-confirmation"), WAIT_FOR_ELEMENT_TIME_OUT);
- }
-
- public static void clickDeletePropertyFromPopup(String propertyName) {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Delete property %s", propertyName));
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.PropertiesPageEnum.PROPERTY_NAME.getValue() + propertyName);
- GeneralUIUtils.clickOnAreaJS(DataTestIdEnum.PropertiesPageEnum.DELETE_PROPERTY_POPUP.getValue());
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ModalItems.OK.getValue());
- }
-
- public static void clickOnProperty(String propertyName) {
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.PropertiesPageEnum.PROPERTY_NAME.getValue() + propertyName).click();
- }
-
- public static PropertyPopup getPropertyPopup() {
- return new PropertyPopup();
- }
-
- public static boolean verifyTotalProperitesField(int count) {
- String totalPropertiesCount = GeneralUIUtils.getWebElementBy(By.id("properties-count")).getText();
- return ("Total Properties: " + count).equals(totalPropertiesCount);
- }
-
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/PropertyNameBuilder.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/PropertyNameBuilder.java
deleted file mode 100644
index aa0b463374..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/PropertyNameBuilder.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import org.openecomp.sdc.be.model.ComponentInstance;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-
-public class PropertyNameBuilder {
- private static final String PREFIX_VAL = DataTestIdEnum.PropertiesAssignmentScreen.PROPERTY_VALUE_FIELD_PREFIX.getValue();
- private static final String PREFIX_KEY = DataTestIdEnum.PropertiesAssignmentScreen.PROPERTY_KEY_FIELD_PREFIX.getValue();
- private static final String PREFIX_EXPAND = DataTestIdEnum.PropertiesAssignmentScreen.EXPAND_BUTTON.getValue();
- private static final String PREFIX_INPUT_VAL = DataTestIdEnum.PropertiesAssignmentScreen.INPUT_VALUE_FIELD_PREFIX.getValue();
- private static final String POPUP_VAL = DataTestIdEnum.PropertiesAssignmentScreen.POPUP_VALUE_FIELD_PREFIX.getValue();
-
- private PropertyNameBuilder() {
-
- }
-
- //VF/Service simple property value field
- public static String buildSimpleField(String propertyName) {
- return new StringBuilder().append(PREFIX_VAL).append(propertyName).toString();
- }
-
- public static String buildPopupField(String propertyName) {
- return new StringBuilder().append(POPUP_VAL).append(propertyName).toString();
- }
-
- public static String buildIndexedField(String propertyName, int index) {
- return new StringBuilder().append(PREFIX_VAL).append(propertyName).append(".").append(index).toString();
- }
-
- public static String buildIndexedKeyField(String propertyName, int index) {
- return new StringBuilder().append(PREFIX_KEY).append(propertyName).append(".").append(index).toString();
- }
-
- public static String buildIComplexField(String propertyName, String nestedProperty) {
- return new StringBuilder().append(PREFIX_VAL).append(propertyName).append(".").append(nestedProperty).toString();
- }
-
- public static String buildIComplexListField(String propertyName, String nestedProperty, int index) {
- return new StringBuilder().append(PREFIX_VAL).append(propertyName).append(".").append(index).append(".").append(nestedProperty).toString();
- }
-
- public static String buildIExpandButton(String propertyName, int index) {
- return new StringBuilder().append(PREFIX_EXPAND).append(propertyName).append(".").append(index).toString();
- }
-
-
- //VF input value field
- public static String buildDeclaredInputField(String componentName, String propertyName) {
- return new StringBuilder().append(PREFIX_INPUT_VAL).append(componentName).append("_").append(propertyName).toString();
- }
-
- public static String buildInputField(String propertyName) {
- return new StringBuilder().append(PREFIX_INPUT_VAL).append(propertyName).toString();
- }
-
- //Service Property value field - declared from VF
- public static String buildServicePropertyValue(String componentName, String propertyName) {
- return new StringBuilder().append(PREFIX_VAL).append(componentName).append("_").append(propertyName).toString();
- }
-
- //Service Input Name
- public static String buildServiceInputNameServiceLevel(ComponentInstance componentInstance, String propertyName) {
- return new StringBuilder().append(componentInstance.getNormalizedName())
- .append("_").append(propertyName).toString();
- }
-
- public static String buildServiceInputNameVfLevel(ComponentInstance componentInstance, String componentName, String propertyName) {
- return new StringBuilder().append(componentInstance.getNormalizedName())
- .append("_").append(componentName).append("_").append(propertyName).toString();
- }
-
-
- //Service Input Value
- public static String buildVfDeclaredPropValue(String componentName, String propertyName) {
- String inputName = componentName + "_" + propertyName;
- return new StringBuilder().append("{\"get_input\":\"").append(inputName).append("\"}").toString();
- }
-
- public static String buildServiceDeclaredPropertyValue(ComponentInstance componentInstance, String componentName, String propertyName) {
- String inputName = buildServiceInputNameVfLevel(componentInstance, componentName, propertyName);
- return new StringBuilder().append("{\"get_input\":\"").append(inputName).append("\"}").toString();
- }
-
- public static String buildServiceDeclaredPropValueServiceLevel(ComponentInstance componentInstance, String propertyName) {
- String inputName = buildServiceInputNameServiceLevel(componentInstance, propertyName);
- return new StringBuilder().append("{\"get_input\":\"").append(inputName).append("\"}").toString();
- }
-
- //Service Input value field
- public static String buildServiceDeclaredFieldServiceLevel(ComponentInstance componentInstance, String propertyName) {
- String inputName = buildServiceInputNameServiceLevel(componentInstance, propertyName);
- return new StringBuilder().append(PREFIX_INPUT_VAL).append(inputName).toString();
- }
-
- public static String buildServiceDeclaredFieldVfLevel(ComponentInstance componentInstance, String componentName, String propertyName) {
- String inputName = buildServiceInputNameVfLevel(componentInstance, componentName, propertyName);
- return new StringBuilder().append(PREFIX_INPUT_VAL).append(inputName).toString();
- }
-
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/PropertyPopup.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/PropertyPopup.java
deleted file mode 100644
index df1dc9ec80..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/PropertyPopup.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openqa.selenium.By;
-import org.openqa.selenium.NoSuchElementException;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.support.ui.Select;
-
-public class PropertyPopup {
-
-
- private static final int WAIT_FOR_ELEMENT_TIME_OUT = 60;
-
- private boolean getPopupForm() {
- return GeneralUIUtils.waitForElementInVisibilityByTestId(DataTestIdEnum.PropertiesPageEnum.POPUP_FORM.getValue(), WAIT_FOR_ELEMENT_TIME_OUT);
- }
-
- public void insertPropertyName(String name) {
- WebElement propertyNameField = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.PropertiesPopupEnum.PROPERTY_NAME.getValue());
- propertyNameField.clear();
- propertyNameField.sendKeys(name);
- }
-
- public void insertPropertyDefaultValue(String value) {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Inserting to property default value: %s ", value));
- WebElement selectedType = new Select(GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.PropertiesPopupEnum.PROPERTY_TYPE.getValue())).getFirstSelectedOption();
- if (selectedType.getText().equals("boolean")) {
- GeneralUIUtils.getSelectList(value, DataTestIdEnum.PropertiesPopupEnum.PROPERTY_BOOLEAN_VALUE.getValue());
- } else {
- WebElement propertyValue = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.PropertiesPopupEnum.PROPERTY_VALUE.getValue());
- propertyValue.clear();
- propertyValue.sendKeys(value);
- }
-
- GeneralUIUtils.ultimateWait();
- }
-
- public void insertPropertyDescription(String description) {
- WebElement propertyDescription = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.PropertiesPopupEnum.PROPERTY_DESCRIPTION.getValue());
- propertyDescription.clear();
- propertyDescription.sendKeys(description);
- }
-
- public void selectPropertyType(String propertyType) {
- boolean isEntrySchemaDisplayed;
- try {
- GeneralUIUtils.getSelectList(propertyType, DataTestIdEnum.PropertiesPopupEnum.PROPERTY_TYPE.getValue());
- isEntrySchemaDisplayed = GeneralUIUtils.getDriver().findElement(By.xpath(DataTestIdEnum.PropertiesPopupEnum.ENTRY_SCHEMA.getValue())).isDisplayed();
- if (isEntrySchemaDisplayed) {
- PropertiesPage.getPropertyPopup().selectEntrySchema(propertyType);
- }
- } catch (NoSuchElementException e) {
-
- }
- }
-
- public void selectEntrySchema(String propertyType) {
- GeneralUIUtils.getSelectList(propertyType, DataTestIdEnum.PropertiesPopupEnum.ENTRY_SCHEMA.getValue());
- }
-
- public void clickAdd() {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.PropertiesPopupEnum.ADD.getValue());
- //GeneralUIUtils.ultimateWait();
- }
-
- public void clickSave() {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.PropertiesPopupEnum.SAVE.getValue());
- getPopupForm();
- }
-
- public void clickCancel() {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.PropertiesPopupEnum.CANCEL.getValue());
- //GeneralUIUtils.ultimateWait();
- }
-
- public void clickDone() {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.PropertiesPopupEnum.DONE.getValue());
- //GeneralUIUtils.ultimateWait();
- }
-
- public void selectPropertyRadioButton(String propertyName) {
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.PropertiesPopupEnum.PROPERTY_RADIO_BUTTON_CONTAINER.getValue() + propertyName).findElement(By.className(DataTestIdEnum.PropertiesPopupEnum.RADIO_BUTTON_CLASS.getValue())).click();
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ResourceCreatePage.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ResourceCreatePage.java
deleted file mode 100644
index 26b3d6f0c6..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ResourceCreatePage.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import org.openecomp.sdc.ci.tests.datatypes.LifeCycleStateEnum;
-import org.openecomp.sdc.ci.tests.utilities.LoaderHelper;
-import org.openecomp.sdc.ci.tests.utilities.NotificationHelper;
-import org.openecomp.sdc.ci.tests.utilities.NotificationHelper.NotificationType;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.support.ui.ExpectedConditions;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static org.hamcrest.Matchers.equalToIgnoringCase;
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
-import static org.openecomp.sdc.ci.tests.pages.ResourceCreatePage.XpathSelector.FORM_LIFE_CYCLE_STATE;
-
-/**
- * Handles the Resource Create Page UI actions
- */
-public class ResourceCreatePage extends AbstractPageObject {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(ResourceCreatePage.class);
- private final LoaderHelper loaderHelper;
- private final NotificationHelper notificationHelper;
- private WebElement createBtn;
-
- public ResourceCreatePage(final WebDriver webDriver, final LoaderHelper loaderHelper,
- final NotificationHelper notificationHelper) {
- super(webDriver);
- this.loaderHelper = loaderHelper;
- this.notificationHelper = notificationHelper;
- timeoutInSeconds = 5;
- }
-
- @Override
- public void isLoaded() {
- LOGGER.debug("Waiting for element visibility with xpath '{}'", FORM_LIFE_CYCLE_STATE.getXpath());
- final WebElement lifeCycleState = waitForElementVisibility(FORM_LIFE_CYCLE_STATE.getXpath());
- assertThat("Life cycle state should be as expected",
- lifeCycleState.getText(), is(equalToIgnoringCase(LifeCycleStateEnum.IN_DESIGN.getValue())));
- createBtn = getWait()
- .until(ExpectedConditions.elementToBeClickable(By.xpath(XpathSelector.CREATE_BTN.getXpath())));
- }
-
- /**
- * Creates the resource and wait for success notification.
- */
- public void createResource() {
- createBtn.click();
- loaderHelper.waitForLoader(60);
- notificationHelper.waitForNotification(NotificationType.SUCCESS, 60);
- }
-
- /**
- * Enum that contains identifiers and xpath expressions to elements related to the enclosing page object.
- */
- public enum XpathSelector {
- CREATE_BTN("create/save", "//button[@data-tests-id='%s']"),
- FORM_LIFE_CYCLE_STATE("formlifecyclestate", "//span[@data-tests-id='%s']");
-
- private final String id;
- private final String xpathFormat;
-
- XpathSelector(final String id, final String xpathFormat) {
- this.id = id;
- this.xpathFormat = xpathFormat;
- }
-
- public String getId() {
- return id;
- }
-
- public String getXpath() {
- return String.format(xpathFormat, id);
- }
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ResourceGeneralPage.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ResourceGeneralPage.java
deleted file mode 100644
index a7d0fe6477..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ResourceGeneralPage.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import org.openecomp.sdc.ci.tests.datatypes.ComponentReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openqa.selenium.Keys;
-import org.openqa.selenium.WebElement;
-
-import java.util.ArrayList;
-import java.util.List;
-
-
-public class ResourceGeneralPage extends GeneralPageElements {
-
- private static final int SLEEP_DURATION = 500;
-
- protected ResourceGeneralPage() {
- super();
- }
-
- public static WebElement getNameField() {
- return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ResourceMetadataEnum.RESOURCE_NAME.getValue());
- }
-
- public static WebElement getDescriptionField() {
- return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ServiceMetadataEnum.DESCRIPTION.getValue());
- }
-
- public static String getCategoryDataTestsIdAttribute() {
- return DataTestIdEnum.ResourceMetadataEnum.CATEGORY.getValue();
- }
-
- public static WebElement getVendorNameField() {
- return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ResourceMetadataEnum.VENDOR_NAME.getValue());
- }
-
- public static WebElement getVendorReleaseField() {
- return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ResourceMetadataEnum.VENDOR_RELEASE.getValue());
- }
-
- public static WebElement getTagsField() {
- return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ResourceMetadataEnum.TAGS.getValue());
- }
-
- public static WebElement getContactIdField() {
- return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ResourceMetadataEnum.CONTACT_ID.getValue());
- }
-
- /***************************************************************/
-
- public static String getNameText() {
- return getNameField().getAttribute("value");
- }
-
- public static void defineName(String resourceName) {
- WebElement resourceNameTextbox = getNameField();
- resourceNameTextbox.clear();
- resourceNameTextbox.sendKeys(resourceName);
- }
-
- public static void defineNameWithPaste() {
- defineTextBoxWithPaste(getNameField());
- }
-
- public static String getDescriptionText() {
- return getDescriptionField().getAttribute("value");
- }
-
- public static void defineDescription(String description) {
- WebElement descriptionTextbox = getDescriptionField();
- descriptionTextbox.clear();
- descriptionTextbox.sendKeys(description);
- }
-
- public static void defineDescriptionWithPaste() {
- defineTextBoxWithPaste(getDescriptionField());
- }
-
- public static String getVendorNameText() {
- return getVendorNameField().getAttribute("value");
- }
-
- public static void defineVendorName(String vendorName) {
- WebElement vendorNameTextbox = getVendorNameField();
- vendorNameTextbox.clear();
- vendorNameTextbox.sendKeys(vendorName);
- }
-
- public static void defineVendorNameWithPaste() {
- defineTextBoxWithPaste(getVendorNameField());
- }
-
- public static String getVendorReleaseText() {
- return getVendorReleaseField().getAttribute("value");
- }
-
- public static void defineVendorRelease(String vendorRelease) {
- WebElement vendorReleaseTextbox = getVendorReleaseField();
- vendorReleaseTextbox.clear();
- vendorReleaseTextbox.sendKeys(vendorRelease);
- }
-
- public static void defineVendorReleaseWithPaste() {
- defineTextBoxWithPaste(getVendorReleaseField());
- }
-
- public static void defineTag(String resourceTags) {
- WebElement tagTextbox = getTagsField();
- tagTextbox.clear();
- tagTextbox.sendKeys(resourceTags);
- tagTextbox.sendKeys(Keys.ENTER);
- }
-
- public static void defineTagsList(ComponentReqDetails component, String[] tags) {
- List<String> taglist = new ArrayList<String>();
- WebElement resourceTagsTextbox = getTagsField();
- for (String tag : tags) {
- resourceTagsTextbox.clear();
- resourceTagsTextbox.sendKeys(tag);
- GeneralUIUtils.sleep(SLEEP_DURATION);
- resourceTagsTextbox.sendKeys(Keys.ENTER);
- taglist.add(tag);
- }
- component.getTags().addAll(taglist);
- }
-
- public static void defineTagsListWithPaste() {
- List<String> taglist = new ArrayList<String>();
- WebElement resourceTagsTextbox = getTagsField();
- defineTextBoxWithPaste(resourceTagsTextbox);
- resourceTagsTextbox.sendKeys(Keys.ENTER);
- }
-
- public static void defineCategory(String category) {
- GeneralUIUtils.getSelectList(category, getCategoryDataTestsIdAttribute());
- }
-
- public static String getContactIdText() {
- return getContactIdField().getAttribute("value");
- }
-
- public static void defineContactId(String userId) {
- WebElement contactIdTextbox = getContactIdField();
- contactIdTextbox.clear();
- contactIdTextbox.sendKeys(userId);
- GeneralUIUtils.waitForLoader();
- }
-
- public static List<WebElement> getElementsFromTagsTable() {
- return GeneralUIUtils.getWebElementsListByTestID(DataTestIdEnum.ResourceMetadataEnum.TAGS_TABLE.getValue());
- }
-
- public static void defineTextBoxWithPaste(WebElement textBox) {
- textBox.clear();
- textBox.sendKeys(Keys.CONTROL + "v");
- GeneralUIUtils.ultimateWait();
- }
-
- public static void moveToToscaArtifactsSectionAndDownloadTosca() {
- getLeftMenu().moveToToscaArtifactsScreen();
- ToscaArtifactsPage.downloadCsar();
- }
-
- public static String getVersionUI() {
- String actualVersion = GeneralUIUtils.getSelectedElementFromDropDown(DataTestIdEnum.GeneralElementsEnum.VERSION_HEADER.getValue()).getText().replace("V", "");
- return actualVersion;
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ResourceLeftMenu.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ResourceLeftMenu.java
deleted file mode 100644
index 02c077a599..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ResourceLeftMenu.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.StepsEnum;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-
-public class ResourceLeftMenu implements ComponentLeftMenu {
-
- public void moveToGeneralScreen() {
- GeneralUIUtils.moveToStep(StepsEnum.GENERAL);
- }
-
- public void moveToIconScreen() {
- GeneralUIUtils.moveToStep(StepsEnum.ICON);
- }
-
- public void moveToDeploymentArtifactScreen() {
- GeneralUIUtils.moveToStep(StepsEnum.DEPLOYMENT_ARTIFACT);
- }
-
- public void moveToInformationalArtifactScreen() {
- GeneralUIUtils.moveToStep(StepsEnum.INFORMATION_ARTIFACT);
- }
-
- public void moveToPropertiesScreen() {
- GeneralUIUtils.moveToStep(StepsEnum.PROPERTIES);
- }
-
- public void moveToCompositionScreen() {
- GeneralUIUtils.moveToStep(StepsEnum.COMPOSITION);
- }
-
- public void moveToActivityLogScreen() {
- GeneralUIUtils.moveToStep(StepsEnum.ACTIVITY_LOG);
- }
-
- public void moveToDeploymentViewScreen() {
- GeneralUIUtils.moveToStep(StepsEnum.DEPLOYMENT_VIEW);
- }
-
- public void moveToToscaArtifactsScreen() {
- GeneralUIUtils.moveToStep(StepsEnum.TOSCA_ARTIFACTS);
- }
-
- public void moveToInputsScreen() {
- GeneralUIUtils.moveToStep(StepsEnum.INPUTS);
- }
-
- public void moveToPropertiesAssignmentScreen() {
- GeneralUIUtils.moveToStep(StepsEnum.PROPERTIES_ASSIGNMENT);
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ResourceLeftSideMenu.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ResourceLeftSideMenu.java
deleted file mode 100644
index ab080fe046..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ResourceLeftSideMenu.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.support.ui.ExpectedConditions;
-
-import static org.openecomp.sdc.ci.tests.pages.ResourceLeftSideMenu.XpathSelector.MAIN_DIV;
-import static org.openecomp.sdc.ci.tests.pages.ResourceLeftSideMenu.XpathSelector.PROPERTIES_ASSIGNMENT_MENU;
-
-/**
- * Handles the Resource Page Left Side Menu UI actions
- */
-public class ResourceLeftSideMenu extends AbstractPageObject {
-
- private WebElement wrappingElement;
-
- public ResourceLeftSideMenu(final WebDriver webDriver) {
- super(webDriver);
- timeoutInSeconds = 5;
- }
-
- @Override
- public void isLoaded() {
- wrappingElement = getWrappingElement();
- }
-
- /**
- * Gets the enclosing element of the menu.
- *
- * @return the enclosing element
- */
- public WebElement getWrappingElement() {
- return getWait()
- .until(ExpectedConditions.visibilityOfElementLocated(By.className(MAIN_DIV.getId())));
- }
-
- /**
- * Clicks on the properties assignment menu item.
- *
- * @return the next page object
- */
- public ResourcePropertiesAssignmentPage clickOnPropertiesAssignmentMenuItem() {
- wrappingElement.findElement(By.xpath(PROPERTIES_ASSIGNMENT_MENU.getXpath())).click();
- return new ResourcePropertiesAssignmentPage(webDriver);
- }
-
- /**
- * Enum that contains identifiers and xpath expressions to elements related to the enclosing page object.
- */
- public enum XpathSelector {
- MAIN_DIV("w-sdc-left-sidebar", "//div[@class='%s']"),
- PROPERTIES_ASSIGNMENT_MENU("Properties AssignmentLeftSideMenu", "//*[@data-tests-id='%s']");
-
- private final String id;
- private final String xpathFormat;
-
- XpathSelector(final String id, final String xpathFormat) {
- this.id = id;
- this.xpathFormat = xpathFormat;
- }
-
- public String getId() {
- return id;
- }
-
- public String getXpath() {
- return String.format(xpathFormat, id);
- }
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ResourcePropertiesAssignmentPage.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ResourcePropertiesAssignmentPage.java
deleted file mode 100644
index 4cbac6ec92..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ResourcePropertiesAssignmentPage.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.support.ui.ExpectedConditions;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import static org.openecomp.sdc.ci.tests.pages.ResourcePropertiesAssignmentPage.XpathSelector.MAIN_DIV;
-import static org.openecomp.sdc.ci.tests.pages.ResourcePropertiesAssignmentPage.XpathSelector.NO_DATA_MESSAGE;
-import static org.openecomp.sdc.ci.tests.pages.ResourcePropertiesAssignmentPage.XpathSelector.PROPERTIES_TABLE;
-import static org.openecomp.sdc.ci.tests.pages.ResourcePropertiesAssignmentPage.XpathSelector.SOFTWARE_VERSION_INPUT;
-import static org.openecomp.sdc.ci.tests.pages.ResourcePropertiesAssignmentPage.XpathSelector.SOFTWARE_VERSION_PROPERTY_CHECKBOX;
-import static org.openecomp.sdc.ci.tests.pages.ResourcePropertiesAssignmentPage.XpathSelector.TITLE_DIV;
-
-/**
- * Handles the Resource Properties Assignment Page UI actions
- */
-public class ResourcePropertiesAssignmentPage extends AbstractPageObject {
-
- private WebElement wrappingElement;
-
- public ResourcePropertiesAssignmentPage(final WebDriver webDriver) {
- super(webDriver);
- }
-
- @Override
- public void isLoaded() {
- wrappingElement = getWait(5)
- .until(ExpectedConditions.visibilityOfElementLocated(By.xpath(MAIN_DIV.getXpath())));
- getWait(5)
- .until(ExpectedConditions.visibilityOfElementLocated(By.xpath(TITLE_DIV.getXpath())));
- }
-
- /**
- * Gets the software_version property values.
- *
- * @return the list of software versions found
- */
- public List<String> getSoftwareVersionProperty() {
- waitPropertiesToLoad();
- final By swVersionCheckboxLocator = By.xpath(SOFTWARE_VERSION_PROPERTY_CHECKBOX.getXpath());
- getWait(5).until(ExpectedConditions.visibilityOfElementLocated(swVersionCheckboxLocator));
-
- final List<String> softwareVersionList = new ArrayList<>();
- final List<WebElement> elements = wrappingElement.findElements(By.xpath(SOFTWARE_VERSION_INPUT.getXpath()));
- for (final WebElement element : elements) {
- softwareVersionList.add(element.getAttribute("value"));
- }
-
- return softwareVersionList;
- }
-
- /**
- * Waits for the properties loading.
- */
- private void waitPropertiesToLoad() {
- getWait(5)
- .until(ExpectedConditions.visibilityOfElementLocated(By.xpath(PROPERTIES_TABLE.getXpath())));
- getWait(5)
- .until(ExpectedConditions.invisibilityOfElementLocated(By.xpath(NO_DATA_MESSAGE.getXpath())));
- }
-
- /**
- * Enum that contains identifiers and xpath expressions to elements related to the enclosing page object.
- */
- public enum XpathSelector {
- MAIN_DIV("w-sdc-main-right-container", "//div[@class='%s']"),
- TITLE_DIV("tab-title", "//div[contains(@class,'%s') and contains(text(), 'Properties Assignment')]"),
- PROPERTIES_TABLE("properties-table", "//div[contains(@class,'%s')]"),
- NO_DATA_MESSAGE("no-data", "//div[contains(@class,'%s') and text()='No data to display']"),
- SOFTWARE_VERSION_PROPERTY_CHECKBOX("software_versions", "//checkbox[@data-tests-id='%s']"),
- SOFTWARE_VERSION_INPUT("value-prop-software_versions.", "//input[starts-with(@data-tests-id,'%s')]");
-
- private final String id;
- private final String xpathFormat;
-
- XpathSelector(final String id, final String xpathFormat) {
- this.id = id;
- this.xpathFormat = xpathFormat;
- }
-
- public String getId() {
- return id;
- }
-
- public String getXpath() {
- return String.format(xpathFormat, id);
- }
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ServiceGeneralPage.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ServiceGeneralPage.java
deleted file mode 100644
index 2642fd1ec2..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ServiceGeneralPage.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import com.aventstack.extentreports.Status;
-import fj.data.Either;
-import org.openecomp.sdc.be.model.Service;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.ServiceMetadataEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaDefinition;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utils.ToscaParserUtils;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
-import org.openecomp.sdc.ci.tests.verificator.ToscaValidation;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebElement;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-public class ServiceGeneralPage extends ResourceGeneralPage {
-
- public static ServiceLeftMenu getServiceLeftMenu() {
- return new ServiceLeftMenu();
- }
-
- public static void defineName(String serviceName) {
- WebElement serviceNameTextbox = GeneralUIUtils
- .getWebElementByTestID(DataTestIdEnum.ServiceMetadataEnum.SERVICE_NAME.getValue());
- serviceNameTextbox.clear();
- serviceNameTextbox.sendKeys(serviceName);
- }
-
-
- public static void defineServiceFunction(String serviceFunction) {
- WebElement serviceFunctionTextbox = GeneralUIUtils
- .getWebElementByTestID(DataTestIdEnum.ServiceMetadataEnum.SERVICE_FUNCTION.getValue());
- serviceFunctionTextbox.clear();
- serviceFunctionTextbox.sendKeys(serviceFunction);
- }
-
- public static void defineProjectCode(String pmat) {
- WebElement projectCodeTextbox = GeneralUIUtils
- .getWebElementByTestID(DataTestIdEnum.ServiceMetadataEnum.PROJECT_CODE.getValue());
- projectCodeTextbox.clear();
- projectCodeTextbox.sendKeys(pmat);
- }
- public static void defineNamingPolicy(String namingPolicyText) {
- WebElement namingPolicyTextbox = GeneralUIUtils
- .getWebElementByTestID(DataTestIdEnum.ServiceMetadataEnum.NAMING_POLICY.getValue());
- namingPolicyTextbox.clear();
- namingPolicyTextbox.sendKeys(namingPolicyText);
- }
-
- public static String getServiceFunctionText(){
- return getServiceFunctionField().getAttribute("value");
- }
-
- public static String getNamingPolicyText(){
- return getNamingPolicyField().getAttribute("value");
- }
-
- private static WebElement getNamingPolicyField() {
- return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ServiceMetadataEnum.NAMING_POLICY.getValue());
- }
-
-
- public static String getProjectCodeText() {
- return getProjectCodeField().getAttribute("value");
- }
-
- public static String[] getTags() {
- return ResourceGeneralPage.getElementsFromTagsTable().stream().map(WebElement::getText).toArray(String[]::new);
- }
- private static WebElement getServiceFunctionField() {
- return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ServiceMetadataEnum.SERVICE_FUNCTION.getValue());
- }
-
- private static WebElement getProjectCodeField() {
- return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ServiceMetadataEnum.PROJECT_CODE.getValue());
- }
-
- public static void deleteOldTags(ServiceReqDetails service) {
- // Delete tag elements
- int i = GeneralUIUtils.getWebElementsListByTestID("i-sdc-tag-delete").size();
- while (i > 0) {
- GeneralUIUtils.getWebElementByTestID("i-sdc-tag-delete").click();
- i--;
- }
-
- service.setTags(new ArrayList<String>());
- }
-
- public static String getCategoryText() {
- return GeneralUIUtils.getSelectedElementFromDropDown(getCategoryDataTestsIdAttribute()).getText();
- }
-
- public static List<WebElement> getCategories() {
- return GeneralUIUtils.getElementFromDropDown(getCategoryDataTestsIdAttribute()).getOptions();
- }
-
- public static String getInstantiationTypeChosenValue() {
- return GeneralUIUtils.getSelectedElementFromDropDown(getInstantiationTypeIdAttribute()).getText();
- }
-
- private static String getInstantiationTypeIdAttribute() {
- return ServiceMetadataEnum.INSTANTIATION_TYPE.getValue();
- }
-
- public static void clickAddWorkflow() {
- SetupCDTest.getExtendTest().log(Status.INFO, "Adding workflow...");
- GeneralUIUtils.clickOnElementByText("Add Workflow");
- }
-
- public static void fillAndAddNewWorkflow(String name, String description) throws InterruptedException {
- GeneralUIUtils.ultimateWait();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Filling name field with %s", name));
- insertText(name, "label + input");
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Filling description filed with %s", name));
- insertText(description, "label + textarea");
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking save button ");
- clickSave();
- }
-
- public static void insertText(String artifactDescriptoin, String element) throws InterruptedException {
- GeneralUIUtils.getElementsByCSS("div[class='modal-content']");
- WebElement artifactDescriptionTextbox = GeneralUIUtils.getWebElementBy(By.cssSelector(element));
- artifactDescriptionTextbox.clear();
- artifactDescriptionTextbox.sendKeys(artifactDescriptoin);
- GeneralUIUtils.ultimateWait();
- }
-
- public static void clickSave() {
- SetupCDTest.getExtendTest().log(Status.INFO, "Clicking on Save button");
- GeneralUIUtils.clickOnElementByXpath("//*[@data-test-id='form-submit-button']");
- GeneralUIUtils.ultimateWait();
- }
-
- public static void defineInstantiationType(String instantiationType) {
- GeneralUIUtils.getSelectList(instantiationType, DataTestIdEnum.ServiceMetadataEnum.INSTANTIATION_TYPE.getValue());
- }
-
- public Service prepareServiceObject(ServiceReqDetails serviceMetadata) throws Exception {
- return AtomicOperationUtils.getServiceObjectByNameAndVersion(UserRoleEnum.DESIGNER, serviceMetadata.getName(), "0.1");
- }
-
- public static boolean parseToscaFileIntoServiceAndValidateProperties(ServiceReqDetails serviceMetadata) throws Exception {
- ServiceGeneralPage serviceGeneralPageObject = new ServiceGeneralPage();
- Service service = serviceGeneralPageObject.prepareServiceObject(serviceMetadata);
- Map<String, String> expectedMetadataMap = Utils.generateServiceMetadataToExpectedObject(serviceMetadata, service);
- File latestFilefromDir = FileHandling.getLastModifiedFileNameFromDir();
- ToscaDefinition toscaServiceDefinition = ToscaParserUtils.parseToscaMainYamlToJavaObjectByCsarLocation(latestFilefromDir);
- Either<Boolean, Map<String, Object>> serviceToscaMetadataValidator = ToscaValidation.serviceToscaMetadataValidator(expectedMetadataMap, toscaServiceDefinition);
- return serviceToscaMetadataValidator.isRight();
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ServiceLeftMenu.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ServiceLeftMenu.java
deleted file mode 100644
index 04324e15ca..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ServiceLeftMenu.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.StepsEnum;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-
-public class ServiceLeftMenu implements ComponentLeftMenu {
-
- public void moveToManagmentWorkflow() throws Exception {
- GeneralUIUtils.moveToStep(StepsEnum.MANAGEMENT_WORKFLOW);
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/SoftwareProductOnboarding.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/SoftwareProductOnboarding.java
deleted file mode 100644
index 10f493e9c6..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/SoftwareProductOnboarding.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
-import static org.openecomp.sdc.ci.tests.pages.SoftwareProductOnboarding.XpathSelector.ATTACHMENT_VIEW;
-import static org.openecomp.sdc.ci.tests.pages.SoftwareProductOnboarding.XpathSelector.BNT_SUBMIT;
-import static org.openecomp.sdc.ci.tests.pages.SoftwareProductOnboarding.XpathSelector.FILE_INPUT;
-import static org.openecomp.sdc.ci.tests.pages.SoftwareProductOnboarding.XpathSelector.NAV_BAR_GROUP_ITEM_ATTACHMENT;
-import static org.openecomp.sdc.ci.tests.pages.SoftwareProductOnboarding.XpathSelector.NAV_BAR_GROUP_NAME_XPATH;
-import static org.openecomp.sdc.ci.tests.pages.SoftwareProductOnboarding.XpathSelector.ONBOARDING_LOADER_DIV;
-import static org.openecomp.sdc.ci.tests.pages.SoftwareProductOnboarding.XpathSelector.PAGE_MAIN_DIV;
-import static org.openecomp.sdc.ci.tests.pages.SoftwareProductOnboarding.XpathSelector.SELECTED_NAV_BAR_GROUP_ITEM;
-
-public class SoftwareProductOnboarding extends AbstractPageObject {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(SoftwareProductOnboarding.class);
- private static final String DIV_CLASS_XPATH_FORMAT = "//div[@class='%s']";
- private static final String DIV_DATA_TEST_ID_XPATH_FORMAT = "//div[@data-test-id='%s']";
- private final VspCommitModal vspCommitModal;
- private WebElement wrappingElement;
-
- public SoftwareProductOnboarding(final WebDriver webDriver,
- final VspCommitModal vspCommitModal) {
- super(webDriver);
- this.vspCommitModal = vspCommitModal;
- timeoutInSeconds = 5;
- }
-
- @Override
- public void isLoaded() {
- wrappingElement = getWrappingElement();
- }
-
- public String getResourceName() {
- return wrappingElement.findElement(By.xpath(NAV_BAR_GROUP_NAME_XPATH.getXpath())).getText();
- }
-
- public void uploadFile(final String resourceFilePath) {
- LOGGER.debug("Uploading file '{}'", resourceFilePath);
- setInputValue(FILE_INPUT, resourceFilePath);
- }
-
- public void attachmentScreenIsLoaded() {
- final String attachmentViewXpath = String.format("%s%s", PAGE_MAIN_DIV.getXpath(), ATTACHMENT_VIEW.getXpath());
- waitForElementVisibility(By.xpath(attachmentViewXpath));
- waitForElementInvisibility(By.xpath(ONBOARDING_LOADER_DIV.getXpath()));
- final WebElement selectedNavBarGroupItem =
- findSubElement(wrappingElement, SELECTED_NAV_BAR_GROUP_ITEM.getXpath());
- final String selectedNavBarGroupItemTestId = selectedNavBarGroupItem.getAttribute("data-test-id");
- assertThat("Attachment menu should be selected", selectedNavBarGroupItemTestId,
- is(NAV_BAR_GROUP_ITEM_ATTACHMENT.getId()));
- }
-
- public void submit() {
- findSubElement(wrappingElement, BNT_SUBMIT.getXpath()).click();
- vspCommitModal.isLoaded();
- vspCommitModal.fillCommentWithDefaulMessage();
- vspCommitModal.submit();
- }
-
- public WebElement getWrappingElement() {
- LOGGER.debug("Finding element with xpath '{}'", PAGE_MAIN_DIV.getXpath());
- return waitForElementVisibility(PAGE_MAIN_DIV.getXpath());
-
- }
-
- public void setInputValue(final XpathSelector inputTestId, final String value) {
- findSubElement(wrappingElement, inputTestId.getXpath()).sendKeys(value);
- }
-
- /**
- * Enum that contains identifiers and xpath expressions to elements related to the enclosing page object.
- */
- public enum XpathSelector {
- PAGE_MAIN_DIV("software-product-view", DIV_CLASS_XPATH_FORMAT),
- UPLOAD_CSAR("upload-btn", "//input[@data-test-id='%s']"),
- FILE_INPUT("fileInput", "//input[@name='%s']"),
- NAV_BAR_GROUP_ITEM_ATTACHMENT("navbar-group-item-SOFTWARE_PRODUCT_ATTACHMENTS", DIV_DATA_TEST_ID_XPATH_FORMAT),
- BNT_SUBMIT("vc-submit-btn", DIV_DATA_TEST_ID_XPATH_FORMAT),
- NAV_BAR_GROUP_NAME_XPATH("navbar-group-name", DIV_DATA_TEST_ID_XPATH_FORMAT),
- SELECTED_NAV_BAR_GROUP_ITEM("navigation-group-item-name selected", DIV_CLASS_XPATH_FORMAT),
- ONBOARDING_LOADER_DIV("onboarding-loader-backdrop", DIV_CLASS_XPATH_FORMAT),
- ATTACHMENT_VIEW("vsp-attachments-view", DIV_CLASS_XPATH_FORMAT);
-
- private final String id;
- private final String xpathFormat;
-
- XpathSelector(final String id, final String xpathFormat) {
- this.id = id;
- this.xpathFormat = xpathFormat;
- }
-
- public String getId() {
- return id;
- }
-
- public String getXpath() {
- return String.format(xpathFormat, id);
- }
-
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/TesterOperationPage.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/TesterOperationPage.java
deleted file mode 100644
index 08a797e675..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/TesterOperationPage.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-
-public class TesterOperationPage {
-
- private TesterOperationPage() {
-
- }
-
- public static void certifyComponent(String componentName) throws Exception {
- clickStartTestingButton();
- clickAcceptCertificationButton(componentName);
- }
-
- public static void clickAcceptCertificationButton(String componentName) throws Exception {
- ExtentTestActions.log(Status.INFO, "Accepting certification of " + componentName);
- String actionDuration = GeneralUIUtils.getActionDuration(() ->
- {
- try {
- clickAcceptCertificationButtonWithoutDuration(componentName);
- } catch (Exception e) {
- e.printStackTrace();
- }
- });
- ExtentTestActions.log(Status.INFO, componentName + " is certified", actionDuration);
-
- }
-
- public static void clickStartTestingButton() throws Exception {
- ExtentTestActions.log(Status.INFO, "Starting to test");
- String actionDuration = GeneralUIUtils.getActionDuration(() -> {
- try {
- clickStartTestingButtonWithoutDuration();
- } catch (Exception e) {
- e.printStackTrace();
- }
- });
- ExtentTestActions.log(Status.INFO, "Ready for certification", actionDuration);
- }
-
-
- private static void clickAcceptCertificationButtonWithoutDuration(String componentName) throws Exception {
- try {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.LifeCyleChangeButtons.ACCEPT.getValue());
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ModalItems.ACCEPT_TESTING_MESSAGE.getValue()).sendKeys(componentName + " tested successfuly");
- GeneralPageElements.clickOKButton();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtons.SEARCH_BOX.getValue());
- } catch (Exception e) {
- throw new Exception("Accepting certification of " + componentName + " failed");
- }
- }
-
- private static void clickStartTestingButtonWithoutDuration() throws Exception {
- try {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.LifeCyleChangeButtons.START_TESTING.getValue());
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.LifeCyleChangeButtons.ACCEPT.getValue());
- } catch (Exception e) {
- throw new Exception("Start testing failed");
- }
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/TopNavComponent.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/TopNavComponent.java
deleted file mode 100644
index e1ca924184..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/TopNavComponent.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import org.openecomp.sdc.ci.tests.execute.setup.DriverFactory;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.interactions.Actions;
-import org.openqa.selenium.support.ui.ExpectedConditions;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.List;
-
-import static org.openecomp.sdc.ci.tests.pages.TopNavComponent.XpathSelector.ARROW_DROPDOWN;
-import static org.openecomp.sdc.ci.tests.pages.TopNavComponent.XpathSelector.MAIN_MENU_ONBOARD_BTN;
-import static org.openecomp.sdc.ci.tests.pages.TopNavComponent.XpathSelector.NAV;
-import static org.openecomp.sdc.ci.tests.pages.TopNavComponent.XpathSelector.REPOSITORY_ICON;
-import static org.openecomp.sdc.ci.tests.pages.TopNavComponent.XpathSelector.SUB_MENU_BUTTON_HOME;
-
-/**
- * Handles the Top Navigation Component UI actions
- */
-public class TopNavComponent extends AbstractPageObject {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(TopNavComponent.class);
-
- private WebElement wrappingElement;
- private By navLocator = By.xpath(NAV.getXpath());
-
- public TopNavComponent(final WebDriver webDriver) {
- super(webDriver);
- timeoutInSeconds = 5;
- }
-
- @Override
- public void isLoaded() {
- wrappingElement = getWrappingElement();
- }
-
- /**
- * Gets the enclosing element of the component.
- *
- * @return the enclosing element
- */
- public WebElement getWrappingElement() {
- LOGGER.debug("Finding element with xpath '{}'", NAV.getXpath());
- return waitForElementVisibility(navLocator);
- }
-
- /**
- * Clicks on home link inside the first breadcrumb arrow.
- */
- public void clickOnHome() {
- hoverToBreadcrumbArrow(0);
- final By homeButtonLocator = By.xpath(SUB_MENU_BUTTON_HOME.getXpath());
- getWait().until(ExpectedConditions.visibilityOfElementLocated(homeButtonLocator));
- getWait().until(ExpectedConditions.elementToBeClickable(homeButtonLocator)).click();
- getWait()
- .until(ExpectedConditions.visibilityOfElementLocated(By.xpath(REPOSITORY_ICON.getXpath())));
- }
-
- /**
- * Clicks on the VSP repository icon.
- *
- * @return the next page object
- */
- public VspRepositoryModalComponent clickOnRepositoryIcon() {
- wrappingElement.findElement(By.xpath(REPOSITORY_ICON.getXpath())).click();
-
- return new VspRepositoryModalComponent(webDriver);
- }
-
- /**
- * Clicks on the Onboard button.
- *
- * @return the next page object
- */
- public OnboardHomePage clickOnOnboard() {
- wrappingElement.findElement(By.xpath(MAIN_MENU_ONBOARD_BTN.getXpath())).click();
- return new OnboardHomePage(DriverFactory.getDriver(), new OnboardHeaderComponent(DriverFactory.getDriver()));
- }
-
- /**
- * Hover to a breadcrumb arrow of the given position.
- *
- * @param arrowPosition the position of the arrow from left to right
- * @return the hovered breadcrumb arrow element
- */
- public WebElement hoverToBreadcrumbArrow(final int arrowPosition) {
- final Actions actions = new Actions(GeneralUIUtils.getDriver());
- final List<WebElement> arrowElementList = getWait()
- .until(
- ExpectedConditions.visibilityOfAllElementsLocatedBy(By.xpath(ARROW_DROPDOWN.getXpath())));
- final WebElement selectedArrowElement = arrowElementList.get(arrowPosition);
- actions.moveToElement(selectedArrowElement).perform();
- return selectedArrowElement;
- }
-
- /**
- * Enum that contains identifiers and xpath expressions to elements related to the enclosing page object.
- */
- public enum XpathSelector {
- NAV("top-nav", "//nav[@class='%s']"),
- SUB_MENU_BUTTON_HOME("sub-menu-button-home", "//*[@data-tests-id='%s']"),
- ARROW_DROPDOWN("triangle-dropdown", "//li[contains(@class, '%s')]"),
- MAIN_MENU_ONBOARD_BTN("main-menu-button-onboard", "//a[@data-tests-id='%s']"),
- REPOSITORY_ICON("repository-icon", "//*[@data-tests-id='%s']");
-
- private final String id;
- private final String xpathFormat;
-
- XpathSelector(final String id, final String xpathFormat) {
- this.id = id;
- this.xpathFormat = xpathFormat;
- }
-
- public String getId() {
- return id;
- }
-
- public String getXpath() {
- return String.format(xpathFormat, id);
- }
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/TopSearchComponent.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/TopSearchComponent.java
deleted file mode 100644
index a919bb0246..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/TopSearchComponent.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openqa.selenium.Keys;
-import org.openqa.selenium.WebElement;
-
-/**
- * Represents the "top-search" search component in the main upper toolbar.
- */
-public class TopSearchComponent {
-
- public static final String CSS_CLASS = "top-search";
- public static final String SEARCH_INPUT_TEST_ID = "main-menu-input-search";
-
- private TopSearchComponent() {
-
- }
-
- /**
- * Gets the search component input, waiting for it's visibility.
- *
- * @return search component input with test id {@link #SEARCH_INPUT_TEST_ID}
- */
- public static WebElement getComponentInput() {
- return GeneralUIUtils.getWebElementByTestID(SEARCH_INPUT_TEST_ID);
- }
-
- /**
- * Replaces the current search input value by the given value. This prevents to trigger the search twice by cleaning
- * the input (triggers the search) and then pasting the value (triggers the search again).
- *
- * @param value the value to search
- */
- public static void replaceSearchValue(final String value) {
- replaceSearchValue(getComponentInput(), value);
- }
-
- /**
- * Replaces the current search input value by selecting it with Ctrl+A shortcut and pasting the given value. This
- * prevents to trigger the search twice by cleaning the input (triggers the search) and then pasting the value
- * (triggers the search again).
- *
- * @param searchTextInput input web element
- * @param value the value to search
- */
- public static void replaceSearchValue(final WebElement searchTextInput, final String value) {
- searchTextInput.sendKeys(Keys.chord(Keys.CONTROL, "a"), value);
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ToscaArtifactsPage.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ToscaArtifactsPage.java
deleted file mode 100644
index d93c4633ab..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/ToscaArtifactsPage.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openqa.selenium.WebElement;
-
-public class ToscaArtifactsPage extends DeploymentArtifactPage {
-
- private ToscaArtifactsPage() {
-
- }
-
- public static String getArtifactName(int row) {
- return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ToscaArtifactsScreenEnum.ARTIFACT_NAME.getValue() + row).getText();
- }
-
- public static String getArtifactType(int row) {
- return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ToscaArtifactsScreenEnum.ARTIFACT_TYPE.getValue() + row).getText();
- }
-
- public static String getArtifactVersion(int row) {
- return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ToscaArtifactsScreenEnum.ARTIFACT_VERSION.getValue() + row).getText();
- }
-
- public static WebElement getArtifactDetails(int row) {
- return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ToscaArtifactsScreenEnum.ARTIFACT_DETAILS.getValue() + row);
- }
-
- public static void downloadCsar() {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ToscaArtifactsScreenEnum.DOWNLOAD_CSAR.getValue());
- //GeneralUIUtils.ultimateWait();
- }
-
- public static void downloadTemplate() {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ToscaArtifactsScreenEnum.TOSCA_TEMPLATE.getValue());
- //GeneralUIUtils.ultimateWait();
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/UpgradeServicesPopup.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/UpgradeServicesPopup.java
deleted file mode 100644
index 81ae4b5145..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/UpgradeServicesPopup.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-public class UpgradeServicesPopup {
-
- private UpgradeServicesPopup() {
-
- }
-
- private static boolean isUpgradePopupShown;
-
- public static boolean isUpgradePopupShown() {
- return isUpgradePopupShown;
- }
-
- static void setUpgradePopupShown(boolean upgradePopupShown) {
- isUpgradePopupShown = upgradePopupShown;
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/UploadArtifactPopup.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/UploadArtifactPopup.java
deleted file mode 100644
index 586f02c0f9..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/UploadArtifactPopup.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.support.ui.Select;
-
-import java.io.File;
-
-public class UploadArtifactPopup {
-
- private static final int WAITING_FOR_ELEMENT_TIME_OUT = 10;
- private boolean isCompositionPage;
-
- public UploadArtifactPopup(boolean isCompositionPage) {
- super();
- this.isCompositionPage = isCompositionPage;
- }
-
- public UploadArtifactPopup() {
- super();
- }
-
- private WebElement getArtifactDescriptionWebElement() {
- return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPopup.ARTIFACT_DESCRIPTION.getValue());
- }
-
- public void loadFile(String path, String filename) {
- final WebElement browseWebElement = GeneralUIUtils.getInputElement(DataTestIdEnum.ArtifactPopup.BROWSE.getValue());
- browseWebElement.sendKeys(path + File.separator + filename);
- GeneralUIUtils.ultimateWait();
- }
-
- public void loadUndefinedFile(String path, String filename) {
- final WebElement browseWebElement = GeneralUIUtils.getInputElement(DataTestIdEnum.ArtifactPopup.FILE_UNDEFINED.getValue());
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Uploading file: %s", path + File.separator + filename));
- browseWebElement.sendKeys(path + File.separator + filename);
- GeneralUIUtils.ultimateWait();
- }
-
-
- public void insertDescription(String artifactDescriptoin) {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Changing artifact description to: %s", artifactDescriptoin));
- WebElement artifactDescriptionTextbox = getArtifactDescriptionWebElement();
- artifactDescriptionTextbox.clear();
- artifactDescriptionTextbox.sendKeys(artifactDescriptoin);
-
- GeneralUIUtils.ultimateWait();
- }
-
- public Select defineArtifactLabel(String requiredArtifactLabel) {
- Select selectList = null;
- WebElement artifactLabelWebElement;
-
- artifactLabelWebElement = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPopup.ARTIFACT_LABEL.getValue());
-
-
- artifactLabelWebElement.clear();
- artifactLabelWebElement.sendKeys(requiredArtifactLabel);
- return selectList;
- }
-
- public void selectArtifactType(String artifactType) {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ArtifactPopup.ARTIFACT_TYPE_ICON.getValue());
- GeneralUIUtils.clickOnElementByTestId(artifactType);
- }
-
- public void clickDoneButton() throws Exception {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ArtifactPopup.DONE_BUTTON.getValue());
- GeneralUIUtils.waitForLoader();
- GeneralUIUtils.waitForElementInVisibilityBy(By.className("sdc-add-artifact"), WAITING_FOR_ELEMENT_TIME_OUT);
- }
-
- public void clickUpgradeArtifactsButton() throws Exception {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ModalItems.UPGRADE_ARTIFACT_BUTTON.getValue());
- GeneralUIUtils.waitForLoader();
- GeneralUIUtils.waitForElementInVisibilityBy(By.className("sdc-add-artifact"), WAITING_FOR_ELEMENT_TIME_OUT);
- }
-
- public void clickCancelButton() throws Exception {
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPopup.CANCEL_BUTTON.getValue()).click();
- GeneralUIUtils.waitForLoader();
- GeneralUIUtils.waitForElementInVisibilityByTestId("sdc-add-artifact");
- }
-
-// public void clickUpdateButton() throws Exception {
-// clickAddButton();
-// GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ArtifactPopup.UPDATE_BUTTON.getValue()).click();
-// GeneralUIUtils.waitForLoader();
-// GeneralUIUtils.waitForElementInVisibilityByTestId(By.className("sdc-add-artifact"), 50);
-// }
-
- public void insertURL(String artifactDescriptoin) throws Exception {
- WebElement artifactDescriptionTextbox = getArtifactURLWebElement();
- artifactDescriptionTextbox.clear();
- artifactDescriptionTextbox.sendKeys(artifactDescriptoin);
- }
-
- public WebElement getArtifactURLWebElement() {
- return GeneralUIUtils.getWebElementBy(By.cssSelector((DataTestIdEnum.ArtifactPopup.URL.getValue())));
- }
-
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/VspCommitModal.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/VspCommitModal.java
deleted file mode 100644
index 27b0070f7c..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/VspCommitModal.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.support.ui.ExpectedConditions;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static org.openecomp.sdc.ci.tests.pages.VspCommitModal.XpathSelector.COMMIT_AND_SUBMIT_BTN;
-import static org.openecomp.sdc.ci.tests.pages.VspCommitModal.XpathSelector.COMMIT_COMMENT_TXT;
-import static org.openecomp.sdc.ci.tests.pages.VspCommitModal.XpathSelector.MODAL_CANCEL_BTN;
-import static org.openecomp.sdc.ci.tests.pages.VspCommitModal.XpathSelector.MODAL_DIV;
-import static org.openecomp.sdc.ci.tests.pages.VspCommitModal.XpathSelector.SUCCESS_MODAL_DIV;
-
-/**
- * Handles the VSP Commit Modal UI actions
- */
-public class VspCommitModal extends AbstractPageObject {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(VspCommitModal.class);
-
- private WebElement wrappingElement;
-
- public VspCommitModal(final WebDriver webDriver) {
- super(webDriver);
- }
-
- public void isLoaded() {
- LOGGER.debug("Finding element with xpath '{}'", MODAL_DIV.getXpath());
- wrappingElement = waitForElementVisibility(MODAL_DIV.getXpath());
- }
-
- /**
- * Fills the comment text area with a default message.
- */
- public void fillCommentWithDefaulMessage() {
- final WebElement commentTxt = wrappingElement.findElement(By.xpath(COMMIT_COMMENT_TXT.getXpath()));
- commentTxt.sendKeys("First VSP version");
- }
-
- /**
- * Clicks on the modal submit and confirms success.
- */
- public void submit() {
- final WebElement commitAndSubmitBtn = wrappingElement.findElement(By.xpath(COMMIT_AND_SUBMIT_BTN.getXpath()));
- commitAndSubmitBtn.click();
- GeneralUIUtils.ultimateWait();
- confirmSuccess();
- }
-
- /**
- * Confirms the success of the modal submission.
- */
- private void confirmSuccess() {
- final WebElement successModal = getWait()
- .until(ExpectedConditions.visibilityOfElementLocated(By.xpath(SUCCESS_MODAL_DIV.getXpath())));
- successModal.findElement(By.xpath(MODAL_CANCEL_BTN.getXpath())).click();
- }
-
- /**
- * Enum that contains identifiers and xpath expressions to elements related to the enclosing page object.
- */
- public enum XpathSelector {
- MODAL_DIV("sdc-modal-type-custom", "//div[contains(@class, '%s')]"),
- COMMIT_AND_SUBMIT_BTN("form-submit-button", "//button[@data-test-id='%s']"),
- COMMIT_COMMENT_TXT("commit-comment-text", "//textarea[@data-test-id='%s']"),
- SUCCESS_MODAL_DIV("sdc-modal-type-info", "//div[contains(@class, '%s')]"),
- MODAL_CANCEL_BTN("sdc-modal-cancel-button", "//button[@data-test-id='%s']");
-
- private final String id;
- private final String xpath;
-
- XpathSelector(final String id, final String xpath) {
- this.id = id;
- this.xpath = xpath;
- }
-
- public String getId() {
- return id;
- }
-
- public String getXpath() {
- return String.format(xpath, id);
- }
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/VspCreationModal.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/VspCreationModal.java
deleted file mode 100644
index c4540c748d..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/VspCreationModal.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.support.ui.Select;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static org.openecomp.sdc.ci.tests.pages.VspCreationModal.XpathSelector.METHOD_RADIO;
-import static org.openecomp.sdc.ci.tests.pages.VspCreationModal.XpathSelector.MODAL_XPATH;
-
-/**
- * Handles the VSP Creation Modal UI actions
- */
-public class VspCreationModal extends AbstractPageObject {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(VspCreationModal.class);
-
- private WebElement wrappingElement;
-
- public VspCreationModal(final WebDriver webDriver) {
- super(webDriver);
- timeoutInSeconds = 5;
- }
-
- @Override
- public void isLoaded() {
- LOGGER.debug("Finding element with xpath '{}'", MODAL_XPATH.getXpath());
- wrappingElement = waitForElementVisibility(MODAL_XPATH.getXpath());
- }
-
- /**
- * Fills the creation form for the given vsp name.
- *
- * @param vspName the name of the Vendor Software Product
- */
- public void fillCreationForm(final String vspName) {
- fillName(vspName);
- selectVendorFirstVendor();
- selectCategory("resourceNewCategory.network l4+.common network resources");
- fillDescription(vspName);
- selectNetworkPackageOnboardingProcedure();
- }
-
- /**
- * Clicks on the create button.
- *
- * @return the next page object
- */
- public SoftwareProductOnboarding clickOnCreate() {
- clickElement(XpathSelector.CREATE_BTN);
- return new SoftwareProductOnboarding(webDriver, new VspCommitModal(webDriver));
- }
-
- /**
- * Fills the VSP name.
- *
- * @param vspName the VSP name
- */
- public void fillName(final String vspName) {
- setInputValue(XpathSelector.NAME_TXT, vspName);
- }
-
- /**
- * Fills the VSP description.
- *
- * @param description the VSP description
- */
- public void fillDescription(final String description) {
- setInputValue(XpathSelector.DESCRIPTION_TXT, description);
- }
-
- /**
- * Selects the first vendor in the vendor list.
- */
- public void selectVendorFirstVendor() {
- setSelectIndex(XpathSelector.VENDOR_SELECT, 1);
- }
-
- /**
- * Selects a category in the category list based on the option value.
- *
- * @param categoryOptionValue the option value
- */
- public void selectCategory(final String categoryOptionValue) {
- setSelectValue(XpathSelector.CATEGORY_SELECT, categoryOptionValue);
- }
-
- /**
- * Selects the network package onboarding procedure option.
- */
- public void selectNetworkPackageOnboardingProcedure() {
- wrappingElement.findElement(By.xpath(METHOD_RADIO.getXpath())).click();
- }
-
- private void setInputValue(final XpathSelector inputTestId, final String value) {
- findSubElement(wrappingElement, By.xpath(inputTestId.getXpath())).sendKeys(value);
- }
-
- private void setSelectIndex(final XpathSelector inputTestId, final int index) {
- new Select(findSubElement(wrappingElement, By.xpath(inputTestId.getXpath()))).selectByIndex(index);
- }
-
- private void setSelectValue(final XpathSelector inputTestId, final String value) {
- new Select(findSubElement(wrappingElement, By.xpath(inputTestId.getXpath()))).selectByValue(value);
- }
-
- private void clickElement(final XpathSelector elementTestId) {
- wrappingElement.findElement(By.xpath(elementTestId.getXpath())).click();
- }
-
- /**
- * Enum that contains identifiers and xpath expressions to elements related to the enclosing page object.
- */
- public enum XpathSelector {
- MODAL_XPATH("software-product-creation-page", "//div[@class='%s']"),
- NAME_TXT("new-vsp-name", "//input[@data-test-id='%s']"),
- VENDOR_SELECT("new-vsp-vendor", "//select[@data-test-id='%s']"),
- CATEGORY_SELECT("new-vsp-category", "//select[@data-test-id='%s']"),
- DESCRIPTION_TXT("new-vsp-description", "//textarea[@data-test-id='%s']"),
- METHOD_RADIO("new-vsp-creation-procedure-heat", "//input[@data-test-id='%s']/parent::label"),
- CREATE_BTN("form-submit-button", "//*[@data-test-id='%s']");
-
- private final String id;
- private final String xpathFormat;
-
- XpathSelector(final String id, final String xpathFormat) {
- this.id = id;
- this.xpathFormat = xpathFormat;
- }
-
- public String getId() {
- return id;
- }
-
- public String getXpath() {
- return String.format(xpathFormat, id);
- }
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/VspRepositoryModalComponent.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/VspRepositoryModalComponent.java
deleted file mode 100644
index e6bc40f450..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/VspRepositoryModalComponent.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.LoaderHelper;
-import org.openecomp.sdc.ci.tests.utilities.NotificationHelper;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.List;
-
-import static org.hamcrest.Matchers.empty;
-import static org.hamcrest.core.Is.is;
-import static org.hamcrest.core.IsNot.not;
-import static org.junit.Assert.assertThat;
-import static org.openecomp.sdc.ci.tests.pages.VspRepositoryModalComponent.XpathSelector.IMPORT_VSP_BTN;
-import static org.openecomp.sdc.ci.tests.pages.VspRepositoryModalComponent.XpathSelector.MODAL_DIV;
-import static org.openecomp.sdc.ci.tests.pages.VspRepositoryModalComponent.XpathSelector.RESULTS_CONTAINER_DIV;
-import static org.openecomp.sdc.ci.tests.pages.VspRepositoryModalComponent.XpathSelector.SEARCH_TXT;
-
-/**
- * Handles the VSP Repository Modal UI actions
- */
-public class VspRepositoryModalComponent extends AbstractPageObject {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(VspRepositoryModalComponent.class);
-
- private WebElement wrappingElement;
-
- public VspRepositoryModalComponent(final WebDriver webDriver) {
- super(webDriver);
- timeoutInSeconds = 5;
- }
-
- @Override
- public void isLoaded() {
- wrappingElement = getWrappingElement();
- GeneralUIUtils.ultimateWait();
- final List<WebElement> vspResultList = wrappingElement
- .findElements(By.className(RESULTS_CONTAINER_DIV.getId()));
- assertThat("VSP Repository should contain at least one result", vspResultList, is(not(empty())));
- }
-
- /**
- * Clicks on the Import Vsp button of the given repository item position in the list.
- *
- * @param listPosition the position of the element in the VSP list, starting from 1
- * @return the next page object
- */
- public ResourceCreatePage clickOnImportVsp(final int listPosition) {
- final List<WebElement> vspResultList =
- findSubElements(wrappingElement, By.className(RESULTS_CONTAINER_DIV.getId()));
- vspResultList.get(listPosition).click();
- GeneralUIUtils.clickOnElementByTestId(IMPORT_VSP_BTN.getId());
- return new ResourceCreatePage(webDriver, new LoaderHelper(), new NotificationHelper());
- }
-
- /**
- * Searches for a VSP in the repository list.
- *
- * @param vspName the VSP name to search
- */
- public void searchForVSP(final String vspName) {
- final WebElement searchTxtElement = findSubElement(wrappingElement, By.xpath(SEARCH_TXT.getXpath()));
- searchTxtElement.sendKeys(vspName);
- GeneralUIUtils.ultimateWait();
- }
-
- /**
- * Gets the enclosing element of the modal.
- *
- * @return the enclosing element
- */
- public WebElement getWrappingElement() {
- LOGGER.debug("Finding element with xpath '{}'", MODAL_DIV.getXpath());
- return waitForElementVisibility(MODAL_DIV.getXpath());
- }
-
- /**
- * Enum that contains identifiers and xpath expressions to elements related to the enclosing page object.
- */
- public enum XpathSelector {
- MODAL_DIV("importVspTable", "//*[@data-tests-id='%s']"),
- SEARCH_TXT("onboarding-search-input", "//input[@data-tests-id='%s']"),
- IMPORT_VSP_BTN("import-csar", "//*[@data-tests-id='%s']"),
- RESULTS_CONTAINER_DIV("datatable-body-cell-label", "//datatable-body[contains(@class,'%s']");
-
- private final String id;
- private final String xpathFormat;
-
- XpathSelector(final String id, final String xpathFormat) {
- this.id = id;
- this.xpathFormat = xpathFormat;
- }
-
- public String getId() {
- return id;
- }
-
- public String getXpath() {
- return String.format(xpathFormat, id);
- }
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/VspValidationPage.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/VspValidationPage.java
deleted file mode 100644
index 9fa278b1e0..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/VspValidationPage.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/**
- * Copyright (c) 2019 Vodafone Group
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import com.aventstack.extentreports.Status;
-import org.apache.commons.collections.CollectionUtils;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebElement;
-import org.testng.Assert;
-
-import java.io.File;
-import java.util.List;
-
-public class VspValidationPage extends GeneralPageElements {
-
- private VspValidationPage() {
- super();
- }
-
- public static void navigateToVspValidationPageUsingNavbar() throws Exception {
- clickOnElementUsingTestId(DataTestIdEnum.VspValidationPage.VSP_VALIDATION_PAGE_NAVBAR);
- }
-
- public static void navigateToVspValidationPageUsingBreadcrumbs() throws Exception {
- clickOnElementUsingTestId(DataTestIdEnum.VspValidationPage.VSP_VALIDATION_PAGE_BREADCRUMBS);
- }
-
- public static void clickOnNextButton() throws Exception {
- clickOnElementUsingTestId(DataTestIdEnum.VspValidationPage.VSP_VALIDATION_PAGE_PROCEED_TO_INPUTS_BUTTON);
- }
-
- public static void clickOnBackButton() throws Exception {
- clickOnElementUsingTestId(DataTestIdEnum.VspValidationPage.VSP_VALIDATION_PAGE_PROCEED_TO_SETUP_BUTTON);
- }
-
- public static void clickOnSubmitButton() throws Exception {
- clickOnElementUsingTestId(DataTestIdEnum.VspValidationPage.VSP_VALIDATION_PAGE_PROCEED_TO_RESULTS_BUTTON);
- }
-
- public static void loadVSPFile(String path, String filename) {
- List<WebElement> checkboxes =
- GeneralUIUtils.findElementsByXpath("//div[@class='validation-input-wrapper']//input");
- boolean hasValue = CollectionUtils.isNotEmpty(checkboxes);
- if (hasValue) {
- WebElement browseWebElement = checkboxes.get(0);
- browseWebElement.sendKeys(path + File.separator + filename);
- GeneralUIUtils.ultimateWait();
- } else {
- Assert.fail("Did not find File input field in the page for loading VSP test file");
- }
-
- }
- public static boolean checkNextButtonDisabled() throws Exception {
- return GeneralUIUtils.isElementDisabled(DataTestIdEnum.VspValidationPage.VSP_VALIDATION_PAGE_PROCEED_TO_INPUTS_BUTTON.getValue());
- }
-
- public static void clickCertificationQueryAll() throws Exception {
- List<WebElement> checkboxes = GeneralUIUtils.findElementsByXpath("//div[@data-test-id='vsp-validation-certifications-query-checkbox-tree']//label//span[@class='rct-checkbox']");
- if (!checkboxes.isEmpty()) {
- checkboxes.get(0).click();
- } else {
- Assert.fail("Did not find certification test checkbox in the page");
- }
- }
-
- public static void clickComplianceChecksAll() throws Exception {
- List<WebElement> vnfComplianceCheckboxes = GeneralUIUtils.findElementsByXpath("//div[@data-test-id='vsp-validation-compliance-checks-checkbox-tree']//span[@class='rct-text' and .//label//text()='vnf-compliance']//button");
- if (!vnfComplianceCheckboxes.isEmpty()) {
- vnfComplianceCheckboxes.get(vnfComplianceCheckboxes.size() - 1).click();
- } else {
- Assert.fail("Did not find vnf-compliance test checkbox in the page");
- }
- List<WebElement> checkboxes = GeneralUIUtils.findElementsByXpath("//div[@data-test-id='vsp-validation-compliance-checks-checkbox-tree']//label//span[@class='rct-title' and text()='csar-validate']");
- if (!checkboxes.isEmpty()) {
- checkboxes.get(checkboxes.size() - 1).click();
- } else {
- Assert.fail("Did not find csar-validate test Checkbox in the page");
- }
- }
-
- public static boolean checkCertificationQueryExists() throws Exception {
- WebElement parentDiv = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.VspValidationPage.VSP_VALIDATION_PAGE_CERTIFICATION_CHECKBOX_TREE.getValue());
- List<WebElement> checkboxTreeDivs = getChildElements(parentDiv);
- List<WebElement> orderedList = getChildElements(checkboxTreeDivs.get(0));
- return (!orderedList.isEmpty());
- }
-
- public static boolean checkComplianceCheckExists() throws Exception {
- WebElement parentDiv = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.VspValidationPage.VSP_VALIDATION_PAGE_COMPLIANCE_CHECKBOX_TREE.getValue());
- List<WebElement> checkboxTreeDivs = getChildElements(parentDiv);
- List<WebElement> orderedList = getChildElements(checkboxTreeDivs.get(0));
- return (!orderedList.isEmpty());
- }
-
- public static boolean checkSelectedComplianceCheckExists() throws Exception {
- WebElement selectedTests = GeneralUIUtils.findElementsByXpath("//div[contains(text(),'Selected Compliance Tests')]/..//select[@class='validation-setup-selected-tests']").get(0);
- List<WebElement> options = getChildElements(selectedTests);
- return (!options.isEmpty());
- }
-
- public static boolean checkSelectedCertificationQueryExists() throws Exception {
- WebElement selectedTests = GeneralUIUtils.findElementsByXpath("//div[contains(text(),'Selected Certifications Query')]/..//select[@class='validation-setup-selected-tests']").get(0);
- List<WebElement> options = getChildElements(selectedTests);
- return (!options.isEmpty());
- }
-
- public static void clickOnElementUsingTestId(DataTestIdEnum.VspValidationPage elementTestId) throws Exception {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on %s", elementTestId.name()));
- GeneralUIUtils.getWebElementByTestID(elementTestId.getValue()).click();
- GeneralUIUtils.ultimateWait();
- }
-
- private static List<WebElement> getChildElements(WebElement webElement) throws Exception {
- return webElement.findElements(By.xpath(".//*"));
- }
-
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/VspValidationResultsPage.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/VspValidationResultsPage.java
deleted file mode 100644
index 9972121a9f..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/VspValidationResultsPage.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * Copyright (c) 2019 Vodafone Group
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openecomp.sdc.ci.tests.pages;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openqa.selenium.WebElement;
-
-import java.util.List;
-
-public class VspValidationResultsPage extends GeneralPageElements {
-
- private VspValidationResultsPage() {
- super();
- }
-
- public static void navigateToVspValidationResultsPageUsingNavbar() throws Exception {
- clickOnElementUsingTestId(DataTestIdEnum.VspValidationResultsPage.VSP_VALIDATION_RESULTS_PAGE_NAVBAR);
- }
-
- public static void navigateToVspValidationResultsPageUsingBreadcrumbs() throws Exception {
- clickOnElementUsingTestId(DataTestIdEnum.VspValidationResultsPage.VSP_VALIDATION_RESULTS_PAGE_BREADCRUMBS);
- }
-
- public static boolean checkResultsExist() throws Exception {
- List<WebElement> results = GeneralUIUtils.findElementsByXpath("//h4[contains(text(),'No Validation Checks Performed')]");
- return results.size() == 0;
- }
-
- public static void clickOnElementUsingTestId(DataTestIdEnum.VspValidationResultsPage elementTestId) throws Exception {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on %s", elementTestId.name()));
- GeneralUIUtils.getWebElementByTestID(elementTestId.getValue()).click();
- GeneralUIUtils.ultimateWait();
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/AdditionalConditions.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/AdditionalConditions.java
deleted file mode 100644
index bd6cd9fcf1..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/AdditionalConditions.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utilities;
-
-import com.paulhammant.ngwebdriver.NgWebDriver;
-import org.openqa.selenium.JavascriptExecutor;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.support.ui.ExpectedCondition;
-
-public class AdditionalConditions {
-
- private AdditionalConditions() {
-
- }
-
- public static ExpectedCondition<Boolean> jQueryAJAXCallsHaveCompleted() {
- return new ExpectedCondition<Boolean>() {
- @Override
- public Boolean apply(WebDriver driver) {
- return (Boolean) ((JavascriptExecutor) driver).
- executeScript("return (window.jQuery!= null) && (jQuery.active === 0);");
- }
- };
- }
-
- public static ExpectedCondition<Boolean> angularHasFinishedProcessing() {
- return new ExpectedCondition<Boolean>() {
- @Override
- public Boolean apply(WebDriver driver) {
- new NgWebDriver((JavascriptExecutor) driver).waitForAngularRequestsToFinish();
- return true;
- }
- };
- }
-
- public static ExpectedCondition<Boolean> pageLoadWait() {
- return new ExpectedCondition<Boolean>() {
- @Override
- public Boolean apply(WebDriver driver) {
- String scriptJS = "try {\n"
- + " if (document.readyState !== 'complete') {\r\n"
- + " return false; // Page not loaded yet\r\n"
- + " }\r\n"
- + " if (window.jQuery) {\r\n"
- + " if (window.jQuery.active) {\r\n"
- + " return false;\r\n"
- + " } else if (window.jQuery.ajax && window.jQuery.ajax.active) {\r\n"
- + " return false;\r\n"
- + " }\r\n"
- + " }\r\n"
- + " if (window.angular) {\r\n"
- + " if (!window.qa) {\r\n"
- + " // Used to track the render cycle finish after loading is complete\r\n"
- + " window.qa = {\r\n"
- + " doneRendering: false\r\n"
- + " };\r\n"
- + " }\r\n"
- + " // Get the angular injector for this app (change element if necessary)\r\n"
- + " var injector = window.angular.element('body').injector();\r\n"
- + " // Store providers to use for these checks\r\n"
- + " var $rootScope = injector.get('$rootScope');\r\n"
- + " var $http = injector.get('$http');\r\n"
- + " var $timeout = injector.get('$timeout');\r\n"
- + " // Check if digest\r\n"
- + " if ($rootScope.$$phase === '$apply' || $rootScope.$$phase === '$digest' || $http.pendingRequests.length !== 0) {\r\n"
- + " window.qa.doneRendering = false;\r\n"
- + " return false; // Angular digesting or loading data\r\n"
- + " }\r\n"
- + " if (!window.qa.doneRendering) {\r\n"
- + " // Set timeout to mark angular rendering as finished\r\n"
- + " $timeout(function() {\r\n"
- + " window.qa.doneRendering = true;\r\n"
- + " }, 0);\r\n"
- + " return false;\r\n"
- + " }\r\n"
- + " }\r\n"
- + " return true;\r\n"
- + "} catch (ex) {\r\n"
- + " return false;\r\n"
- + "}";
- return Boolean.valueOf(((JavascriptExecutor) driver).executeScript(scriptJS).toString());
- }
- };
- }
-
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/AdminWorkspaceUIUtilies.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/AdminWorkspaceUIUtilies.java
deleted file mode 100644
index 100982faee..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/AdminWorkspaceUIUtilies.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utilities;
-
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.pages.AdminGeneralPage;
-
-public class AdminWorkspaceUIUtilies {
-
- private AdminWorkspaceUIUtilies() {
-
- }
-
- public static void createNewUser(String userId, UserRoleEnum userRole) {
- AdminGeneralPage.getUserManagementTab().setNewUserBox(userId);
- AdminGeneralPage.getUserManagementTab().selectUserRole(userRole);
- AdminGeneralPage.getUserManagementTab().clickCreateButton();
- }
-
- public static void updateUserRole(int rowIndx, UserRoleEnum userRole) {
- AdminGeneralPage.getUserManagementTab().updateUser(rowIndx);
- AdminGeneralPage.getUserManagementTab().updateUserRole(userRole, rowIndx);
- AdminGeneralPage.getUserManagementTab().saveAfterUpdateUser(rowIndx);
- }
-
- public static void deleteFirstRow() {
- AdminGeneralPage.getUserManagementTab().deleteUser(0);
- }
-
- public static void searchForUser(String searchString) {
- AdminGeneralPage.getUserManagementTab().searchUser(searchString);
- }
-
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/ArtifactUIUtils.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/ArtifactUIUtils.java
deleted file mode 100644
index d85e17fa3f..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/ArtifactUIUtils.java
+++ /dev/null
@@ -1,370 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utilities;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.be.datatypes.elements.HeatParameterDataDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.ArtifactInfo;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.HeatWithParametersDefinition;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.CompositionPage;
-import org.openecomp.sdc.ci.tests.pages.InformationalArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.UploadArtifactPopup;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebElement;
-import org.testng.Assert;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import static org.junit.Assert.assertTrue;
-
-public final class ArtifactUIUtils {
-
- private static final String PARAMETERS = "parameters";
- private static final String DATA_TESTS_ID = "//*[@data-tests-id='";
-
- private ArtifactUIUtils() {
- }
-
- public static void fillAndAddNewArtifactParameters(ArtifactInfo artifactInfo) throws Exception {
- UploadArtifactPopup artifactPopup = new UploadArtifactPopup();
- fillAndAddNewArtifactParameters(artifactInfo, artifactPopup);
- }
-
- public static void fillAndAddNewArtifactParameters(ArtifactInfo artifactInfo, UploadArtifactPopup artifactPopup) throws Exception {
- artifactPopup.defineArtifactLabel(artifactInfo.getArtifactLabel());
- artifactPopup.selectArtifactType(artifactInfo.getArtifactType());
- artifactPopup.insertDescription(artifactInfo.getDescription());
- artifactPopup.loadUndefinedFile(artifactInfo.getFilepath(), artifactInfo.getFilename());
- artifactPopup.clickUpgradeArtifactsButton();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("A new artifact of type %s was added", artifactInfo.getArtifactType()));
- }
-
- public static void fillAndAddNewEnvArtifactParameters(ArtifactInfo artifactInfo, UploadArtifactPopup artifactPopup) throws Exception {
- artifactPopup.insertDescription(artifactInfo.getDescription());
- artifactPopup.loadFile(artifactInfo.getFilepath(), artifactInfo.getFilename());
- artifactPopup.clickDoneButton();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("ENV parameters %s artifact updated ", artifactInfo.getArtifactType()));
- }
-
- public static void fillPlaceHolderInformationalArtifact(DataTestIdEnum.InformationalArtifactsPlaceholders artifactLabel, String filepath, String filename, String description) throws Exception {
- GeneralUIUtils.clickOnElementByTestId(artifactLabel.getValue());
- InformationalArtifactPage.artifactPopup().loadFile(filepath, filename);
- InformationalArtifactPage.artifactPopup().insertDescription(description);
- InformationalArtifactPage.artifactPopup().clickDoneButton();
- }
-
- public static void fillPlaceHolderInformationalArtifact(DataTestIdEnum.InformationalArtifactsService artifactLabel,
- String filepath, String filename, String description) throws Exception {
- GeneralUIUtils.clickOnElementByTestId(artifactLabel.getValue());
- UploadArtifactPopup artifactPopup = new UploadArtifactPopup(true);
- artifactPopup.loadFile(filepath, filename);
- artifactPopup.insertDescription(description);
- artifactPopup.clickDoneButton();
- }
-
- public static void fillPlaceHolderAPIArtifact(DataTestIdEnum.APIArtifactsService artifactLabel,
- String filepath, String filename, String description, String url) throws Exception {
- GeneralUIUtils.clickOnElementByTestId(artifactLabel.getValue());
- UploadArtifactPopup artifactPopup = new UploadArtifactPopup(true);
- artifactPopup.loadFile(filepath, filename);
- artifactPopup.insertURL(url);
- artifactPopup.insertDescription(description);
- artifactPopup.clickDoneButton();
- }
-
- public static void validateArtifactNameVersionType(String artifactLabel, String artifactVersion, String artifactType) {
- if (!GeneralUIUtils.getDriver().findElement(By.xpath(DATA_TESTS_ID + DataTestIdEnum.ArtifactPageEnum.ARTIFACT_NAME.getValue() + artifactLabel + "']")).getAttribute("textContent").trim().equals(artifactLabel)) {
- SetupCDTest.getExtendTest().log(Status.WARNING, "Artifact label not equal - this warning represent defect.");
- }
- if (artifactVersion != null) {
- if (!GeneralUIUtils.getDriver().findElement(By.xpath(DATA_TESTS_ID + DataTestIdEnum.ArtifactPageEnum.VERSION.getValue() + artifactLabel + "']")).getAttribute("textContent").trim().equals(artifactVersion)) {
- SetupCDTest.getExtendTest().log(Status.WARNING, "Artifact version not equal - this warning represent defect.");
- }
- }
- if (artifactType != null) {
- if (!GeneralUIUtils.getDriver().findElement(By.xpath(DATA_TESTS_ID + DataTestIdEnum.ArtifactPageEnum.TYPE.getValue() + artifactLabel + "']")).getAttribute("textContent").trim().equals(artifactType)) {
- SetupCDTest.getExtendTest().log(Status.WARNING, "Artifact type not equal - this warning represent defect.");
- }
- }
- }
-
- public static void validateExistArtifactOnDeploymentInformationPage(String expectedArtifactLabel, String artifactUUID, String artifactVersion, String artifactType, boolean isDownloadable, boolean isEditable, boolean isDeletable, boolean isArtifactParametersEditable) {
-
- String dataTestId = DataTestIdEnum.ArtifactPageEnum.ARTIFACT_NAME.getValue() + expectedArtifactLabel;
-
- List<WebElement> artifactElements = GeneralUIUtils.getWebElementsListByContainTestID(dataTestId);
- Assert.assertEquals(artifactElements.size(), 1, "There are more then one artifact named " + expectedArtifactLabel);
-
- WebElement artifact = artifactElements.get(0);
- String actualArtifactLabel = GeneralUIUtils.getTextContentAttributeValue(artifact).trim();
- Assert.assertEquals(actualArtifactLabel, expectedArtifactLabel);
-
- if (artifactUUID != null) {
- WebElement uuid = GeneralUIUtils.getInputElement(DataTestIdEnum.ArtifactPageEnum.UUID.getValue() + expectedArtifactLabel);
- Assert.assertEquals(GeneralUIUtils.getTextContentAttributeValue(uuid).trim(), artifactUUID, "Artifact uuid not equal.");
- }
- if (artifactVersion != null) {
- WebElement version = GeneralUIUtils.getInputElement(DataTestIdEnum.ArtifactPageEnum.VERSION.getValue() + expectedArtifactLabel);
- Assert.assertEquals(GeneralUIUtils.getTextContentAttributeValue(version).trim(), artifactVersion, "Artifact version not equal.");
- }
- if (artifactType != null) {
- WebElement type = GeneralUIUtils.getInputElement(DataTestIdEnum.ArtifactPageEnum.TYPE.getValue() + expectedArtifactLabel);
- Assert.assertEquals(GeneralUIUtils.getTextContentAttributeValue(type).trim(), artifactType, "Artifact type not equal.");
- }
- if (isArtifactParametersEditable) {
- Assert.assertNotNull(GeneralUIUtils.getInputElement(DataTestIdEnum.ArtifactPageEnum.EDIT_PARAMETERS_OF_ARTIFACT.getValue() + expectedArtifactLabel), "Expect that parameters edit button enabled.");
- } else {
- Assert.assertNull(GeneralUIUtils.getInputElement(DataTestIdEnum.ArtifactPageEnum.EDIT_PARAMETERS_OF_ARTIFACT.getValue() + expectedArtifactLabel), "Expect that parameters edit button disabled.");
- }
- if (isDownloadable) {
- Assert.assertNotNull(GeneralUIUtils.getInputElement(DataTestIdEnum.ArtifactPageEnum.DOWNLOAD_ARTIFACT.getValue() + expectedArtifactLabel), "Expect that download button enabled.");
- } else {
- Assert.assertNull(GeneralUIUtils.getInputElement(DataTestIdEnum.ArtifactPageEnum.DOWNLOAD_ARTIFACT.getValue() + expectedArtifactLabel), "Expect that download button disabled.");
- }
- if (isEditable) {
- Assert.assertNotNull(GeneralUIUtils.getInputElement(DataTestIdEnum.ArtifactPageEnum.EDIT_ARTIFACT.getValue() + expectedArtifactLabel), "Expect that edit button enabled.");
- } else {
- Assert.assertNull(GeneralUIUtils.getInputElement(DataTestIdEnum.ArtifactPageEnum.EDIT_ARTIFACT.getValue() + expectedArtifactLabel), "Expect that edit button disabled.");
- }
- if (isDeletable) {
- Assert.assertNotNull(GeneralUIUtils.getInputElement(DataTestIdEnum.ArtifactPageEnum.DELETE_ARTIFACT.getValue() + expectedArtifactLabel), "Expect that delete button enabled.");
- } else {
- Assert.assertNull(GeneralUIUtils.getInputElement(DataTestIdEnum.ArtifactPageEnum.DELETE_ARTIFACT.getValue() + expectedArtifactLabel), "Expect that delete button disabled.");
- }
- }
-
- public static void validateNotExistArtifactOnDeploymentInformationPage(String artifactLabel) {
- Assert.assertEquals(GeneralUIUtils.isWebElementExistByTestId(DataTestIdEnum.ArtifactPageEnum.ARTIFACT_NAME.getValue() + artifactLabel), false);
- }
-
- public static void validateExistArtifactOnCompositionRightMenuDeploymentInformationPage(String fileName, String artifactDisplayedName,
- boolean isUpdateable, boolean isParametersEditable, boolean isDownloadable, boolean isDeleteable) {
- Assert.assertEquals(GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.DeploymentArtifactCompositionRightMenu.ARTIFACT_NAME.getValue() + artifactDisplayedName).getText(), fileName);
- Assert.assertEquals(GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.DeploymentArtifactCompositionRightMenu.ARTIFACT_DISPLAY_NAME.getValue() + artifactDisplayedName).getText(), artifactDisplayedName);
-
- GeneralUIUtils.hoverOnAreaByTestId(DataTestIdEnum.DeploymentArtifactCompositionRightMenu.ARTIFACT_DISPLAY_NAME.getValue() + artifactDisplayedName);
-
- if (isParametersEditable) {
- Assert.assertEquals(GeneralUIUtils.isWebElementExistByTestId(DataTestIdEnum.DeploymentArtifactCompositionRightMenu.EDIT_PARAMETERS_OF_ARTIFACT.getValue() + artifactDisplayedName), true, "Expect that parameters edit button enabled.");
- } else {
- Assert.assertEquals(GeneralUIUtils.isWebElementExistByTestId(DataTestIdEnum.DeploymentArtifactCompositionRightMenu.EDIT_PARAMETERS_OF_ARTIFACT.getValue() + artifactDisplayedName), false, "Expect that parameters edit button disabled.");
- }
- if (isDownloadable) {
- Assert.assertEquals(GeneralUIUtils.isWebElementExistByTestId(DataTestIdEnum.DeploymentArtifactCompositionRightMenu.DOWNLOAD.getValue() + artifactDisplayedName), true, "Expect that download button enabled.");
- } else {
- Assert.assertEquals(GeneralUIUtils.isWebElementExistByTestId(DataTestIdEnum.DeploymentArtifactCompositionRightMenu.DOWNLOAD.getValue() + artifactDisplayedName), false, "Expect that download button disabled.");
- }
- if (isDeleteable) {
- Assert.assertEquals(GeneralUIUtils.isWebElementExistByTestId(DataTestIdEnum.DeploymentArtifactCompositionRightMenu.DELETE.getValue() + artifactDisplayedName), true, "Expect that delete button enabled.");
- } else {
- Assert.assertEquals(GeneralUIUtils.isWebElementExistByTestId(DataTestIdEnum.DeploymentArtifactCompositionRightMenu.DELETE.getValue() + artifactDisplayedName), false, "Expect that delete button disabled.");
- }
- if (isUpdateable) {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.DeploymentArtifactCompositionRightMenu.ARTIFACT_DISPLAY_NAME.getValue() + artifactDisplayedName);
- Assert.assertEquals(GeneralUIUtils.isWebElementExistByTestId(DataTestIdEnum.ArtifactPopup.MODAL_WINDOW.getValue()), true, "Expect that edit button enabled.");
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ArtifactPopup.DONE_BUTTON.getValue());
- GeneralUIUtils.waitForElementInVisibilityByTestId(DataTestIdEnum.ArtifactPopup.DONE_BUTTON.getValue());
- } else {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.DeploymentArtifactCompositionRightMenu.ARTIFACT_DISPLAY_NAME.getValue() + artifactDisplayedName);
- Assert.assertEquals(GeneralUIUtils.isWebElementExistByTestId(DataTestIdEnum.ArtifactPopup.MODAL_WINDOW.getValue()), false, "Expect that edit button disabled.");
- }
-
- }
-
- public static void validateNotExistArtifactOnCompositionRightMenuDeploymentInformationPage(String artifactDisplayedName) {
- Assert.assertEquals(GeneralUIUtils.isWebElementExistByTestId(DataTestIdEnum.DeploymentArtifactCompositionRightMenu.ARTIFACT_NAME.getValue() + artifactDisplayedName), false);
- }
-
- public static File verifyUpdatedEnvParameters(HeatWithParametersDefinition pairToUpdate, File updateEnvFile, String dataTestId) throws Exception {
- GeneralUIUtils.hoverOnAreaByTestId(dataTestId);
- return verifyUpdatedEnvParameters(pairToUpdate, updateEnvFile);
- }
-
- public static File verifyUpdatedEnvParameters(HeatWithParametersDefinition pairToUpdate, File updateEnvFile) throws Exception {
-
- String heatDisplayName = pairToUpdate.getHeatArtifactDisplayName();
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ArtifactPageEnum.DOWNLOAD_ARTIFACT_ENV.getValue() + heatDisplayName);
- File latestFilefromDir = FileHandling.getLastModifiedFileNameFromDir();
-
- String pattern = PARAMETERS;
- Map<String, Object> mapUpdetedEnvFile = FileHandling.parseYamlFileToMapByPattern(updateEnvFile, pattern);
- Map<String, Object> mapDownloadedEnvFile = FileHandling.parseYamlFileToMapByPattern(latestFilefromDir, pattern);
-
- SetupCDTest.getExtendTest().log(Status.INFO, "Going to check, that ENV file was updated ...");
- assertTrue("File" + latestFilefromDir.getName() + " contains different parameters number from expected file", mapDownloadedEnvFile.size() == mapUpdetedEnvFile.size());
- assertTrue("Updated file contains not updated parameters value", mapDownloadedEnvFile.entrySet().containsAll(mapUpdetedEnvFile.entrySet()));
- return latestFilefromDir;
- }
-
- /**
- * compare heat env files by pattern ("parameters")
- *
- * @param expectedFile
- * @param actualFile
- * @param pattern
- * @throws Exception
- */
- public static void compareYamlFilesByPattern(File expectedFile, File actualFile, String pattern) throws Exception {
-
- Map<String, Object> mapExpectedFile = FileHandling.parseYamlFileToMapByPattern(expectedFile, pattern);
- Map<String, Object> mapActualFile = FileHandling.parseYamlFileToMapByPattern(actualFile, pattern);
- SetupCDTest.getExtendTest().log(Status.INFO, "Going to compare file " + expectedFile.getName());
- assertTrue("File " + actualFile.getName() + " contains different parameters number from expected file", mapActualFile.size() == mapExpectedFile.size());
- assertTrue("File " + actualFile.getName() + " does not contains all expected parameters", mapActualFile.entrySet().containsAll(mapExpectedFile.entrySet()));
- }
-
- public static void compareYamlParametersByPattern(Map<String, Object> mapExpectedProperties, File actualFileProperties, String pattern) throws Exception {
-
- Map<String, Object> mapActualFileProerties = FileHandling.parseYamlFileToMapByPattern(actualFileProperties, pattern);
- SetupCDTest.getExtendTest().log(Status.INFO, "Going to compare files ...");
- assertTrue("Actual file contains different parameters number from expected file", mapActualFileProerties.size() == mapExpectedProperties.size());
- Map<String, Object> newMap = new HashMap<>(mapActualFileProerties);
- assertTrue("Actual file does not contains all expected parameters", newMap.entrySet().containsAll(mapExpectedProperties.entrySet()));
- }
-
-
- public static File uploadCreatedUpdateParametersEnvFile(HeatWithParametersDefinition heatEnvDetails, String directoryPath) throws Exception {
- //created env file to upload
- File pathToEnvParametersFile = prepareEnvParametersFile(heatEnvDetails, directoryPath);
- ArtifactInfo heatEnvArtifactInfo = new ArtifactInfo(directoryPath, heatEnvDetails.getHeatEnvLabel() + ".env", "heatEnvDesc", heatEnvDetails.getHeatEnvLabel(), heatEnvDetails.getHeatEnvArtifactType());
- ArtifactUIUtils.fillAndAddNewEnvArtifactParameters(heatEnvArtifactInfo, CompositionPage.artifactPopup());
- return pathToEnvParametersFile;
- }
-
- public static File prepareEnvParametersFile(HeatWithParametersDefinition heatEnvDetails, String directoryPath) throws IOException {
- File pathToEnvParametersFile = FileHandling.createEmptyFile(directoryPath + heatEnvDetails.getHeatEnvLabel() + ".env");
- //fill file
- FileHandling.writeToFile(pathToEnvParametersFile, "parameters:", 0);
- for (HeatParameterDataDefinition paramDefinition : heatEnvDetails.getHeatParameterDefinition()) {
- Object data = getDataToWrite(paramDefinition);
- FileHandling.writeToFile(pathToEnvParametersFile, data, 2);
- }
-
- return pathToEnvParametersFile;
- }
-
- public static Object getDataToWrite(HeatParameterDataDefinition paramDefinition) {
- final int testNumberParameter = 666;
- Object data = "";
- switch (paramDefinition.getType()) {
- case "string":
- String text = "\"string\"";
- data = getFormatedData(paramDefinition.getName(), text);
- break;
- case "number":
- data = getFormatedData(paramDefinition.getName(), testNumberParameter);
- break;
- case "json":
- String jsonText = "{\"param1\":\"param1\", \"param2\":2}";
- data = getFormatedData(paramDefinition.getName(), jsonText);
- break;
- case "boolean":
- if (paramDefinition.getCurrentValue().equals("true")) {
- data = getFormatedData(paramDefinition.getName(), false);
- } else {
- data = getFormatedData(paramDefinition.getName(), true);
- }
- break;
- case "comma_delimited_list":
- String commaDelimitedListText = "127.0.0.10, 127.0.0.15, 127.0.0.20";
- data = getFormatedData(paramDefinition.getName(), commaDelimitedListText);
- break;
- default:
- break;
- }
- return data;
- }
-
-
- public static Map<String, Object> getDataToWriteInUI(List<HeatParameterDataDefinition> paramDefinitionFromGetResourceResponse) {
- final int testNumberParameter = 666;
- Map<String, Object> newValuesToUpdateInUI = new HashMap<>();
- for (HeatParameterDataDefinition param : paramDefinitionFromGetResourceResponse) {
- switch (param.getType()) {
-
- case "string":
- String text = "string";
- newValuesToUpdateInUI.put(param.getName(), text);
- break;
- case "number":
- newValuesToUpdateInUI.put(param.getName(), testNumberParameter);
- break;
- case "json":
- String jsonText = "{\"param1\":\"param1\", \"param2\":2}";
- newValuesToUpdateInUI.put(param.getName(), jsonText);
- break;
- case "boolean":
- if (param.getCurrentValue().equals(true)) {
- newValuesToUpdateInUI.put(param.getName(), false);
- } else {
- newValuesToUpdateInUI.put(param.getName(), true);
- }
- break;
- case "comma_delimited_list":
- String commaDelimitedListText = "127.0.0.10, 127.0.0.15, 127.0.0.20";
- newValuesToUpdateInUI.put(param.getName(), commaDelimitedListText);
- break;
- default:
- break;
-
- }
-
- }
- return newValuesToUpdateInUI;
- }
-
- public static Object getValue(HeatParameterDataDefinition param) {
- String type = param.getType();
- Object result = null;
- switch (type) {
- case "string":
- result = param.getCurrentValue();
- break;
- case "number":
- result = new Integer(param.getCurrentValue());
- break;
- case "json":
- result = param.getCurrentValue();
- break;
- case "boolean":
- result = new Boolean(param.getCurrentValue());
- break;
- case "comma_delimited_list":
- result = param.getCurrentValue();
- break;
- default:
- break;
- }
- return result;
- }
-
- public static Object getFormatedData(String name, Object text) {
- return name + ": " + text;
- }
-
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/CatalogUIUtilitis.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/CatalogUIUtilitis.java
deleted file mode 100644
index cdbb2f4bd2..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/CatalogUIUtilitis.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utilities;
-
-import com.aventstack.extentreports.Status;
-import org.codehaus.jettison.json.JSONArray;
-import org.codehaus.jettison.json.JSONException;
-import org.openecomp.sdc.ci.tests.datatypes.CheckBoxStatusEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.TopMenuButtonsEnum;
-import org.openecomp.sdc.ci.tests.datatypes.TypesEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.utils.rest.CatalogRestUtils;
-import org.openqa.selenium.WebElement;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-public class CatalogUIUtilitis {
-
- private CatalogUIUtilitis() {
-
- }
-
- public static void clickTopMenuButton(TopMenuButtonsEnum button) {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on %s button ...", button.name()));
- switch (button) {
- case CATALOG:
- GeneralUIUtils.getWebElementByTestID(button.getButton()).click();
- break;
- case HOME:
- GeneralUIUtils.getWebElementByTestID(button.getButton()).click();
- break;
- case ON_BOARDING:
- GeneralUIUtils.getWebElementByTestID(button.getButton()).click();
- break;
- default:
- break;
- }
- GeneralUIUtils.ultimateWait();
- }
-
- public static String catalogFilterTypeChecBox(TypesEnum enumtype) throws Exception {
- String Type = enumtype.toString().toLowerCase();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on %s ...", Type));
- GeneralUIUtils.getWebElementByTestID(enumtype.getValue()).click();
- return Type;
- }
-
- public static List<String> catalogFilterStatusChecBox(CheckBoxStatusEnum statusEnum) {
- List<String> status = null;
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on %s status", statusEnum.name()));
- switch (statusEnum) {
- case IN_DESIGN:
- status = Arrays.asList("NOT_CERTIFIED_CHECKIN", "NOT_CERTIFIED_CHECKOUT");
- GeneralUIUtils.getWebElementByTestID(statusEnum.getValue()).click();
- break;
- case READY_FOR_TESTING:
- status = Arrays.asList("READY_FOR_CERTIFICATION");
- GeneralUIUtils.getWebElementByTestID(statusEnum.getValue()).click();
- break;
- case IN_TESTING:
- status = Arrays.asList("CERTIFICATION_IN_PROGRESS");
- GeneralUIUtils.getWebElementByTestID(statusEnum.getValue()).click();
- break;
- case CERTIFIED:
- case DISTRIBUTED:
- status = Arrays.asList("CERTIFIED");
- GeneralUIUtils.getWebElementByTestID(statusEnum.getValue()).click();
- break;
- default:
- break;
- }
- return status;
- }
-
- // Get all Categories uniqueID .//The parent categories.
- public static List<String> getCategories() throws IOException, JSONException {
- List<String> allCategoriesList = new ArrayList<>();
- RestResponse allcategoriesJson = CatalogRestUtils.getAllCategoriesTowardsCatalogBe();
- JSONArray categories = new JSONArray(allcategoriesJson.getResponse());
- for (int i = 0; i < categories.length(); i++) {
- String categoryname = (String) categories.getJSONObject(i).get("name");
- allCategoriesList.add(categoryname);
- }
- return allCategoriesList;
- }
-
- public static WebElement clickOnUpperCategoryCheckbox() /*throws InterruptedException*/ {
- WebElement categoryCheckbox = getCategoryCheckbox();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on %s category ...", categoryCheckbox.getText()));
- categoryCheckbox.click();
- GeneralUIUtils.ultimateWait();
- return categoryCheckbox;
- }
-
- public static WebElement getCategoryCheckbox() {
- List<WebElement> categoryCheckboxes = GeneralUIUtils.getElementsByCSS("span[data-tests-id*='category']"); // get all categories and subcategories
- return categoryCheckboxes.get(0);
- }
-
- public static void clickOnLeftPanelElement(DataTestIdEnum.CatalogPageLeftPanelFilterTitle leftPanelElement) throws InterruptedException {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on %s", leftPanelElement.name()));
- GeneralUIUtils.getElementsByCSS(leftPanelElement.getValue()).forEach(WebElement::click);
- }
-
- public static WebElement catalogSearchBox(String searchText) {
- WebElement searchBox = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtons.SEARCH_BOX.getValue());
- searchBox.clear();
- searchBox.sendKeys(searchText);
- return searchBox;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/DownloadManager.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/DownloadManager.java
deleted file mode 100644
index 88efa26681..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/DownloadManager.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utilities;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.GeneralPageElements;
-import org.openecomp.sdc.ci.tests.pages.HomePage;
-import org.openqa.selenium.WebElement;
-
-import java.util.List;
-
-public class DownloadManager {
-
- private DownloadManager() {
-
- }
-
- /**
- * this method download csar file from VSP repository to default browser download directory
- *
- * @param vspName
- * @throws Exception
- */
- public static void downloadCsarByNameFromVSPRepository(String vspName, Boolean isDelete) throws Exception {
-
- if (isDelete) {
- FileHandling.cleanCurrentDownloadDir();
- }
- HomePage.showVspRepository();
- boolean vspFound = HomePage.searchForVSP(vspName);
- if (vspFound) {
- ExtentTestActions.log(Status.INFO, String.format("Going to downloading VSP %s", vspName));
- final List<WebElement> elementsFromTable = GeneralPageElements.getElementsFromTable();
- elementsFromTable.get(0).click();
- GeneralUIUtils.waitForLoader();
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ImportVfRepository.DOWNLOAD_CSAR.getValue());
- ExtentTestActions.log(Status.INFO, "Succeeded to downloaded CSAR file named " + vspName + " into folder " + SetupCDTest.getWindowTest().getDownloadDirectory());
- GeneralUIUtils.getElementsByCSS("div[class^='w-sdc-modal-close']").forEach(e -> e.click());
- GeneralUIUtils.ultimateWait();
- }
- }
-
-
- public static void downloadCsarByNameFromVSPRepository(String vspName, String vspId) throws Exception {
- downloadCsarByNameFromVSPRepository(vspName, true);
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/FileHandling.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/FileHandling.java
deleted file mode 100644
index f8cc628d58..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/FileHandling.java
+++ /dev/null
@@ -1,571 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utilities;
-
-import com.aventstack.extentreports.Status;
-import com.clearspring.analytics.util.Pair;
-import org.apache.commons.io.FileUtils;
-import org.openecomp.sdc.be.model.DataTypeDefinition;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.utils.general.OnboardingUtils;
-import org.openecomp.sdc.common.util.GeneralUtility;
-import org.yaml.snakeyaml.Yaml;
-
-import java.io.BufferedOutputStream;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.FileWriter;
-import java.io.FilenameFilter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipException;
-import java.util.zip.ZipFile;
-import java.util.zip.ZipInputStream;
-
-import static org.testng.AssertJUnit.assertTrue;
-
-public class FileHandling {
-
- // ------------------yaml parser methods----------------------------
- public static Map<?, ?> parseYamlFile(String filePath) throws Exception {
- Yaml yaml = new Yaml();
- File file = new File(filePath);
- InputStream inputStream = new FileInputStream(file);
- Map<?, ?> map = new HashMap<>();
- map = (Map<?, ?>) yaml.load(inputStream);
- return map;
- }
-
- /**
- * The method return map fetched objects by pattern from yaml file
- *
- * @param yamlFile
- * @param pattern
- * @return
- * @throws Exception
- */
- public static Map<String, Object> parseYamlFileToMapByPattern(File yamlFile, String pattern) throws Exception {
- Map<?, ?> yamlFileToMap = FileHandling.parseYamlFile(yamlFile.toString());
- Map<String, Object> objectMap = getObjectMapByPattern(yamlFileToMap, pattern);
- return objectMap;
- }
-
- @SuppressWarnings("unchecked")
- public static Map<String, Object> getObjectMapByPattern(Map<?, ?> parseUpdetedEnvFile, String pattern) {
- Map<String, Object> objectMap = null;
-
- Object objectUpdetedEnvFile = parseUpdetedEnvFile.get(pattern);
- if (objectUpdetedEnvFile instanceof HashMap) {
- objectMap = (Map<String, Object>) objectUpdetedEnvFile;
- }
- return objectMap;
- }
-
-
- public static Map<String, DataTypeDefinition> parseDataTypesYaml(String filePath) throws Exception {
- @SuppressWarnings("unchecked")
- Map<String, DataTypeDefinition> dataTypesMap = (Map<String, DataTypeDefinition>) parseYamlFile(filePath);
- return dataTypesMap;
- }
-// -------------------------------------------------------------------------------------------------
-
-
- /**
- * @param folder, folder name under "Files" folder
- * @return path to given folder from perspective of working directory or sdc-vnfs repository
- */
- public static String getFilePath(String folder) {
- String filepath = System.getProperty("filePath");
- boolean isFilePathEmptyOrNull = (filepath == null || filepath.isEmpty());
-
- // return folder from perspective of sdc-vnfs repository
- if (isFilePathEmptyOrNull && (System.getProperty("os.name").contains("Windows") || System.getProperty("os.name").contains("Mac"))) {
- return FileHandling.getResourcesFilesPath() + folder + File.separator;
- }
-
- // return folder from perspective of working directory ( in general for nightly run from Linux, should already contain "Files" directory )
- return FileHandling.getBasePath() + "Files" + File.separator + folder + File.separator;
- }
-
- public static String getBasePath() {
- return System.getProperty("user.dir") + File.separator;
- }
-
- public static String getSdcVnfsPath() {
- String vnfsPath = System.getProperty("vnfs.path");
- if (vnfsPath != null && !vnfsPath.isEmpty()) {
- return vnfsPath;
- }
- return getBasePath() + Paths.get("..", "..", "sdc-vnfs").toString();
- }
-
- public static String getDriversPath() {
- return getBasePath() + "src" + File.separator + "main" + File.separator + "resources"
- + File.separator + "ci" + File.separator + "drivers" + File.separator;
- }
-
- public static String getResourcesFilesPath() {
-// return getBasePath() + "src" + File.separator + "main" + File.separator + "resources"
-// + File.separator + "Files" + File.separator;
-
- return getSdcVnfsPath() + File.separator + "ui-tests" + File.separator + "Files" + File.separator;
- }
-
- public static String getResourcesEnvFilesPath() {
- return getBasePath() + File.separator + "src" + File.separator + "main" + File.separator + "resources"
- + File.separator + "Files" + File.separator + "ResourcesEnvFiles" + File.separator;
- }
-
- public static String getCiFilesPath() {
- return getBasePath() + "src" + File.separator + "main" + File.separator + "resources"
- + File.separator + "ci";
- }
-
- public static String getConfFilesPath() {
- return getCiFilesPath() + File.separator + "conf" + File.separator;
- }
-
- public static String getTestSuitesFilesPath() {
- return getCiFilesPath() + File.separator + "testSuites" + File.separator;
- }
-
- public static String getVnfRepositoryPath() {
- return getFilePath("VNFs");
- }
-
- public static String getUpdateVSPVnfRepositoryPath() {
- return getFilePath("UpdateVSP");
- }
-
- public static File getConfigFile(String configFileName) throws Exception {
- File configFile = new File(FileHandling.getBasePath() + File.separator + "conf" + File.separator + configFileName);
- if (!configFile.exists()) {
- configFile = new File(FileHandling.getConfFilesPath() + configFileName);
- }
- return configFile;
- }
-
- public static Object[] filterFileNamesFromFolder(String filepath, String extension) {
- try {
- File dir = new File(filepath);
- List<String> filenames = new ArrayList<String>();
-
- FilenameFilter extensionFilter = new FilenameFilter() {
- public boolean accept(File dir, String name) {
- return name.endsWith(extension);
- }
- };
-
- if (dir.isDirectory()) {
- for (File file : dir.listFiles(extensionFilter)) {
- filenames.add(file.getName());
- }
- return filenames.toArray();
- }
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- return null;
- }
-
- public static List<String> filterFileNamesListFromFolder(String filepath, String extension) {
- try {
- File dir = new File(filepath);
- List<String> filenames = new ArrayList<String>();
-
- FilenameFilter extensionFilter = new FilenameFilter() {
- public boolean accept(File dir, String name) {
- return name.endsWith(extension);
- }
- };
-
- if (dir.isDirectory()) {
- for (File file : dir.listFiles(extensionFilter)) {
- filenames.add(file.getName());
- }
-
- filenames.removeAll(OnboardingUtils.excludeXnfList);
-
- return filenames;
- }
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- return null;
- }
-
- public static String[] getArtifactsFromZip(String filepath, String zipFilename) {
- try {
- ZipFile zipFile = new ZipFile(filepath + File.separator + zipFilename);
- Enumeration<? extends ZipEntry> entries = zipFile.entries();
-
- List<String> artifactNames = new ArrayList<String>();
-
- while (entries.hasMoreElements()) {
- ZipEntry nextElement = entries.nextElement();
- if (!nextElement.isDirectory()) {
- if (!nextElement.getName().equals("MANIFEST.json")) {
- String name = nextElement.getName();
- artifactNames.add(name);
- }
- }
- }
- zipFile.close();
- // convert list to array
- return artifactNames.toArray(new String[0]);
- } catch (ZipException zipEx) {
- System.err.println("Error in zip file named : " + zipFilename);
- zipEx.printStackTrace();
- } catch (IOException e) {
- System.err.println("Unhandled exception : ");
- e.printStackTrace();
- }
-
- return null;
-
- }
-
-// public static Object[] getZipFileNamesFromFolder(String filePath) {
-// return filterFileNamesFromFolder(filePath, ".zip");
-// }
-
- public static List<String> getZipFileNamesFromFolder(String filepath) {
- return filterFileNamesListFromFolder(filepath, ".zip");
- }
-
- public static int countFilesInZipFile(String[] artifactsArr, String reqExtension) {
- int fileCounter = 0;
- for (String artifact : artifactsArr) {
- String extensionFile = artifact.substring(artifact.lastIndexOf(".") + 1, artifact.length());
- if (extensionFile.equals(reqExtension)) {
- fileCounter++;
- }
- }
- return fileCounter;
- }
-
-
- /**
- * @return last modified file name from default directory
- * @throws Exception
- */
- public static synchronized File getLastModifiedFileNameFromDir() throws Exception {
- return getLastModifiedFileNameFromDir(SetupCDTest.getWindowTest().getDownloadDirectory());
- }
-
- /**
- * @param dirPath
- * @return last modified file name from dirPath directory
- */
- public static synchronized File getLastModifiedFileNameFromDir(String dirPath) {
- File dir = new File(dirPath);
- File[] files = dir.listFiles();
- if (files == null) {
- assertTrue("File not found under directory " + dirPath, false);
- return null;
- }
-
- File lastModifiedFile = files[0];
- for (int i = 1; i < files.length; i++) {
- if (files[i].isDirectory()) {
- continue;
- }
- if (lastModifiedFile.lastModified() < files[i].lastModified()) {
- lastModifiedFile = files[i];
- }
- }
- return lastModifiedFile;
- }
-
- public static void deleteDirectory(String directoryPath) {
- File dir = new File(directoryPath);
- if (dir.exists()) {
- try {
- FileUtils.cleanDirectory(dir);
- } catch (IllegalArgumentException e) {
- System.out.println("Failed to clean " + dir);
- } catch (IOException e) {
- System.out.println("Failed to clean " + dir);
- }
- }
- }
-
- public static void createDirectory(String directoryPath) {
- File directory = new File(String.valueOf(directoryPath));
- if (!directory.exists()) {
- directory.mkdir();
- }
- }
-
-
- /**
- * The method append data to existing file, if file not exists - create it
- *
- * @param pathToFile
- * @param text
- * @param leftSpaceCount
- * @throws IOException
- */
- public static synchronized void writeToFile(File pathToFile, Object text, Integer leftSpaceCount) throws IOException {
-
- BufferedWriter bw = null;
- FileWriter fw = null;
- if (!pathToFile.exists()) {
- createEmptyFile(pathToFile);
- }
- try {
- fw = new FileWriter(pathToFile, true);
- bw = new BufferedWriter(fw);
- StringBuilder sb = new StringBuilder();
- if (leftSpaceCount > 0) {
- for (int i = 0; i < leftSpaceCount; i++) {
- sb.append(" ");
- }
- }
- bw.write(sb.toString() + text);
- bw.newLine();
- bw.close();
- fw.close();
- } catch (Exception e) {
- SetupCDTest.getExtendTest().log(Status.INFO, "Unable to write to flie " + pathToFile);
- }
- }
-
- public static synchronized void writeToFile(File pathToFile, Map<String, Pair<String, Object>> dataMap, Integer leftSpaceCount) throws IOException {
-
- BufferedWriter bw = null;
- FileWriter fw = null;
- try {
- if (!pathToFile.exists()) {
- createEmptyFile(pathToFile);
- }
- fw = new FileWriter(pathToFile, true);
- bw = new BufferedWriter(fw);
- StringBuilder sb = new StringBuilder();
- if (leftSpaceCount > 0) {
- for (int i = 0; i < leftSpaceCount; i++) {
- sb.append(" ");
- }
- }
- for (Map.Entry<String, Pair<String, Object>> entry : dataMap.entrySet()) {
- Object record = ArtifactUIUtils.getFormatedData(entry.getKey(), entry.getValue().right);
- bw.write(sb.toString() + record);
- bw.newLine();
- }
- bw.close();
- fw.close();
- } catch (Exception e) {
- SetupCDTest.getExtendTest().log(Status.INFO, "Unable to write to flie " + pathToFile);
- }
- }
-
- public static void deleteLastDowloadedFiles(List<File> files) throws IOException {
- for (File file : files) {
- File fileToDelete = new File(Config.instance().getWindowsDownloadDirectory() + file.getName());
- fileToDelete.delete();
- }
- }
-
- public static void cleanCurrentDownloadDir() throws IOException {
- try {
- ExtentTestActions.log(Status.INFO, "Cleaning directory " + SetupCDTest.getWindowTest().getDownloadDirectory());
- System.gc();
- FileUtils.cleanDirectory(new File(SetupCDTest.getWindowTest().getDownloadDirectory()));
- } catch (Exception e) {
-
- }
- }
-
- public static boolean isFileDownloaded(String downloadPath, String fileName) {
- File dir = new File(downloadPath);
- File[] dir_contents = dir.listFiles();
- return Arrays.stream(dir_contents).anyMatch(file -> file.getName().equals(fileName));
- }
-
- public static String getMD5OfFile(File file) throws IOException {
- String content = FileUtils.readFileToString(file);
- String md5 = GeneralUtility.calculateMD5Base64EncodedByString(content);
- return md5;
- }
-
- public static File createEmptyFile(String fileToCreate) {
- File file = new File(fileToCreate);
- try {
- if (file.exists()) {
- deleteFile(file);
- }
- file.createNewFile();
- SetupCDTest.getExtendTest().log(Status.INFO, "Create file " + fileToCreate);
- } catch (IOException e) {
- SetupCDTest.getExtendTest().log(Status.INFO, "Failed to create file " + fileToCreate);
- e.printStackTrace();
- }
- return file;
- }
-
- public static File createEmptyFile(File fileToCreate) {
- try {
- if (fileToCreate.exists()) {
- deleteFile(fileToCreate);
- }
- fileToCreate.createNewFile();
- SetupCDTest.getExtendTest().log(Status.INFO, "Create file " + fileToCreate);
- } catch (IOException e) {
- SetupCDTest.getExtendTest().log(Status.INFO, "Failed to create file " + fileToCreate);
- e.printStackTrace();
- }
- return fileToCreate;
- }
-
- public static void deleteFile(File file) {
-
- try {
- if (file.exists()) {
- file.deleteOnExit();
- SetupCDTest.getExtendTest().log(Status.INFO, "File " + file.getName() + "has been deleted");
- } else {
- SetupCDTest.getExtendTest().log(Status.INFO, "Failed to delete file " + file.getName());
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- }
-
-
- /**
- * get file list from directory by extension array
- *
- * @param directory
- * @param okFileExtensions
- * @return
- */
- public static List<File> getHeatAndHeatEnvArtifactsFromZip(File directory, String[] okFileExtensions) {
-
- List<File> fileList = new ArrayList<>();
- File[] files = directory.listFiles();
-
- for (String extension : okFileExtensions) {
- for (File file : files) {
- if (file.getName().toLowerCase().endsWith(extension)) {
- fileList.add(file);
- }
- }
- }
- return fileList;
- }
-
- private static final int BUFFER_SIZE = 4096;
-
- public static void unzip(String zipFilePath, String destDirectory) throws IOException {
- File destDir = new File(destDirectory);
- if (!destDir.exists()) {
- destDir.mkdir();
- }
- ZipInputStream zipIn = new ZipInputStream(new FileInputStream(zipFilePath));
- ZipEntry entry = zipIn.getNextEntry();
-// iterates over entries in the zip file
- while (entry != null) {
- String entryName;
- if (System.getProperty("os.name").contains("Windows")) {
- entryName = entry.getName().replace("/", "\\" + File.separator);
- } else {
- entryName = entry.getName();
- }
- String filePath = destDirectory + entryName;
- String currPath = destDirectory;
- String[] dirs = entryName.split("\\" + File.separator);
- String currToken;
- for (int i = 0; i < dirs.length; ++i) {
- currToken = dirs[i];
- if (!entry.isDirectory() && i == dirs.length - 1) {
- extractFile(zipIn, filePath);
- } else {
- if (currPath.endsWith(File.separator)) {
- currPath = currPath + currToken;
- } else {
- currPath = currPath + File.separator + currToken;
- }
-// if the entry is a directory, make the directory
- File dir = new File(currPath);
- dir.mkdir();
- }
- }
- zipIn.closeEntry();
- entry = zipIn.getNextEntry();
- }
- zipIn.close();
- }
-
- private static void extractFile(ZipInputStream zipIn, String filePath) throws IOException {
- BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(filePath));
- byte[] bytesIn = new byte[BUFFER_SIZE];
- int read = 0;
- while ((read = zipIn.read(bytesIn)) != -1) {
- bos.write(bytesIn, 0, read);
- }
- bos.close();
- }
-
- public static int getFileCountFromDefaulDownloadDirectory() {
- return new File(SetupCDTest.getWindowTest().getDownloadDirectory()).listFiles().length;
- }
-
-
- public static String getKeyByValueFromPropertyFormatFile(String fullPath, String key) {
- Properties prop = new Properties();
- InputStream input = null;
- String value = null;
- try {
- input = new FileInputStream(fullPath);
- prop.load(input);
- value = (prop.getProperty(key));
-
- } catch (IOException ex) {
- ex.printStackTrace();
- } finally {
- if (input != null) {
- try {
- input.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
-
- return value.replaceAll("\"", "");
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/GeneralUIUtils.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/GeneralUIUtils.java
deleted file mode 100644
index bb36ea88f6..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/GeneralUIUtils.java
+++ /dev/null
@@ -1,759 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utilities;
-
-import static org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest.getExtendTest;
-import static org.testng.AssertJUnit.assertTrue;
-
-import com.aventstack.extentreports.Status;
-import java.awt.Toolkit;
-import java.awt.datatransfer.Clipboard;
-import java.awt.datatransfer.StringSelection;
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.UUID;
-import java.util.concurrent.TimeUnit;
-import java.util.function.Supplier;
-import org.apache.commons.io.FileUtils;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.exception.GeneralUiRuntimeException;
-import org.openecomp.sdc.ci.tests.execute.setup.DriverFactory;
-import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.pages.HomePage;
-import org.openecomp.sdc.ci.tests.utils.Utils;
-import org.openqa.selenium.By;
-import org.openqa.selenium.JavascriptExecutor;
-import org.openqa.selenium.Keys;
-import org.openqa.selenium.NoSuchElementException;
-import org.openqa.selenium.OutputType;
-import org.openqa.selenium.TakesScreenshot;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.firefox.FirefoxDriver;
-import org.openqa.selenium.interactions.Actions;
-import org.openqa.selenium.support.ui.ExpectedConditions;
-import org.openqa.selenium.support.ui.Select;
-import org.openqa.selenium.support.ui.WebDriverWait;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-public final class GeneralUIUtils {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(GeneralUIUtils.class);
-
- private static final String TEST_ID_XPATH = "//*[@data-test-id='%1$s' or @data-tests-id='%1$s']";
- private static final String TEST_ID_CHILD_XPATH = "//*[@data-tests-id='%s']//*";
- private static final String TEST_ID_ATTRIBUTE_NAME = "data-tests-id";
- private static final String COLOR_YELLOW_BORDER_4PX_SOLID_YELLOW = "color: yellow; border: 4px solid yellow;";
-
- private static final int TIME_OUT = (int) (60 * 1.5);
- private static final int WEB_DRIVER_WAIT_TIME_OUT = 10;
- private static final int SLEEP_DURATION = 1000;
- private static final int MAX_WAITING_PERIOD = 10 * 1000;
- private static final int NAP_PERIOD = 100;
- private static final int DURATION_FORMATIN = 60;
-
- private GeneralUIUtils () {
-
- }
-
- public static int getTimeOut() {
- return TIME_OUT;
- }
-
- public static WebDriver getDriver() {
- return DriverFactory.getDriver();
- }
-
- public static List<WebElement> getElementsByLocator(By by) {
- return getDriver().findElements(by);
- }
-
- public static File takeScreenshot(String screenshotFilename, String dir, String testName) throws IOException {
- if (screenshotFilename == null) {
- if (testName != null) {
- screenshotFilename = testName;
- } else {
- screenshotFilename = UUID.randomUUID().toString();
- }
- }
- try {
- File scrFile = ((TakesScreenshot) getDriver()).getScreenshotAs(OutputType.FILE);
- File filePath = new File(String.format("%s/%s.png", dir, screenshotFilename));
- new File(dir).mkdirs();
- FileUtils.copyFile(scrFile, filePath);
- return filePath;
- } catch (IOException e1) {
- e1.printStackTrace();
- }
- return null;
- }
-
- public static File takeScreenshot(String screenshotFilename, String dir) throws IOException {
- return takeScreenshot(screenshotFilename, dir, null);
- }
-
- public static WebElement getWebElementByTestID(String dataTestId) {
- return getWebElementByTestID(dataTestId, TIME_OUT);
- }
-
- public static WebElement getWebElementByTestID(final String dataTestId, final int timeout) {
- try {
- final WebDriverWait wait = new WebDriverWait(getDriver(), timeout);
- return wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(String.format(TEST_ID_XPATH, dataTestId))));
- }
- catch (final Exception e) {
- LOGGER
- .debug(String.format("Element with attribute %s=%s not found", TEST_ID_ATTRIBUTE_NAME, dataTestId), e);
- }
- return null;
- }
-
- public static boolean isWebElementExistByTestId(String dataTestId) {
- return getDriver().findElements(By.xpath(String.format(TEST_ID_XPATH, dataTestId))).size() != 0;
- }
-
- public static boolean isWebElementExistByClass(String className) {
- return getDriver().findElements(By.className(className)).size() != 0;
- }
-
- public static WebElement getInputElement(String dataTestId) {
- try {
- ultimateWait();
- return getDriver().findElement(By.xpath(String.format(TEST_ID_XPATH, dataTestId)));
- } catch (Exception e) {
- return null;
- }
- }
-
- public static List<WebElement> getInputElements(String dataTestId) {
- ultimateWait();
- return getDriver().findElements(By.xpath(String.format(TEST_ID_XPATH, dataTestId)));
-
- }
-
- public static WebElement getWebElementBy(By by) {
- return getWebElementBy(by, TIME_OUT);
- }
-
- public static WebElement getWebElementBy(By by, int timeOut) {
- WebDriverWait wait = new WebDriverWait(getDriver(), timeOut);
- return wait.until(ExpectedConditions.visibilityOfElementLocated(by));
- }
-
- public static WebElement getWebElementByPresence(By by, int timeOut) {
- WebDriverWait wait = new WebDriverWait(getDriver(), timeOut);
- return wait.until(ExpectedConditions.presenceOfElementLocated(by));
- }
-
- public static List<String> getWebElementListText(List<WebElement> elements) {
- List<String> Text = new ArrayList<>();
- for (WebElement webElement : elements) {
- Text.add(webElement.getText());
- }
- return Text;
- }
-
- public static List<WebElement> getWebElementsListBy(By by) {
- return getWebElementsListBy(by, TIME_OUT);
- }
-
- public static List<WebElement> getWebElementsListBy(By by, int timeOut) {
- WebDriverWait wait = new WebDriverWait(getDriver(), timeOut);
- return wait.until(ExpectedConditions.visibilityOfAllElementsLocatedBy(by));
- }
-
- public static List<WebElement> getWebElementsListByContainTestID(final String dataTestId) {
- try {
- final WebDriverWait wait = new WebDriverWait(getDriver(), WEB_DRIVER_WAIT_TIME_OUT);
- final String xpath = String.format("//*[contains(@%s, '%s')]", TEST_ID_ATTRIBUTE_NAME, dataTestId);
- return wait.until(ExpectedConditions.presenceOfAllElementsLocatedBy(By.xpath(xpath)));
- } catch (final Exception e) {
- final String message = String.format("Could not find element containing the attribute '%s' as '%s'",
- TEST_ID_ATTRIBUTE_NAME, dataTestId);
- LOGGER.debug(message, e);
- return Collections.emptyList();
- }
- }
-
- public static List<WebElement> getWebElementsListByContainsClassName(final String containedText) {
- final WebDriverWait wait = new WebDriverWait(getDriver(), TIME_OUT);
- return wait.until(ExpectedConditions.
- presenceOfAllElementsLocatedBy(By.xpath(String.format("//*[contains(@class, '%s')]", containedText))));
- }
-
- public static WebElement getWebElementByContainsClassName(final String containedText) {
- return getWebElementBy(By.xpath(String.format("//*[contains(@class, '%s')]", containedText)));
- }
-
- public static WebElement getWebElementByClassName(String className) {
- WebDriverWait wait = new WebDriverWait(getDriver(), TIME_OUT);
- return wait.until(ExpectedConditions.visibilityOfElementLocated(By.className(className)));
- }
-
- public static List<WebElement> getWebElementsListByTestID(String dataTestId) {
- WebDriverWait wait = new WebDriverWait(getDriver(), TIME_OUT);
- return wait.until(ExpectedConditions.visibilityOfAllElementsLocatedBy(By.xpath(String.format(TEST_ID_XPATH, dataTestId))));
- }
-
- public static List<WebElement> getWebElementsListByClassName(String className) {
- WebDriverWait wait = new WebDriverWait(getDriver(), TIME_OUT);
- return wait.until(ExpectedConditions.visibilityOfAllElementsLocatedBy(By.className(className)));
- }
-
-
- public static Boolean isElementInvisibleByTestId(String dataTestId) {
- WebDriverWait wait = new WebDriverWait(getDriver(), TIME_OUT);
- return wait.until(
- ExpectedConditions.invisibilityOfElementLocated(By.xpath(String.format(TEST_ID_XPATH, dataTestId))));
- }
-
- public static Boolean isElementVisibleByTestId(String dataTestId) {
- try {
- WebDriverWait wait = new WebDriverWait(getDriver(), TIME_OUT);
- return wait.until(ExpectedConditions.visibilityOfElementLocated((By.xpath(String.format(TEST_ID_XPATH, dataTestId))))).isDisplayed();
- } catch (Exception e) {
- return false;
- }
- }
-
- public static void clickOnElementByTestId(String dataTestId) {
- try {
- clickOnElementByTestIdWithoutWait(dataTestId);
- ultimateWait();
- }catch (Exception e) {
- LOGGER.debug("", e);
- }
- }
-
- public static void clickOnElementByTestIdWithoutWait(final String dataTestId) {
- try {
- final WebDriverWait wait = new WebDriverWait(getDriver(), TIME_OUT);
- wait.until(ExpectedConditions
- .elementToBeClickable(By.xpath(String.format(TEST_ID_XPATH, dataTestId)))).click();
- final String message =
- String.format("Click on element with attribute '%s' value '%s'", TEST_ID_XPATH, dataTestId);
- getExtendTest().log(Status.INFO, message);
- } catch (final Exception e) {
- ExtentTestActions.log(Status.FAIL, dataTestId + " element isn't clickable");
- ExtentTestActions.log(Status.FAIL, e);
- }
- }
-
- public static void clickOnElementByInputTestIdWithoutWait(final String dataTestId) {
- final WebDriverWait wait = new WebDriverWait(getDriver(), TIME_OUT);
- final String xPath = String.format(TEST_ID_CHILD_XPATH, dataTestId);
- wait.until(ExpectedConditions.elementToBeClickable(By.xpath(xPath))).click();
- }
-
- public static void clickOnElementByTestId(String dataTestId, int customTimeout) {
- WebDriverWait wait = new WebDriverWait(getDriver(), customTimeout);
- wait.until(ExpectedConditions.elementToBeClickable(By.xpath(String.format(TEST_ID_XPATH, dataTestId)))).click();
- }
-
- public static WebElement waitForElementVisibilityByTestId(String dataTestId) {
- WebDriverWait wait = new WebDriverWait(getDriver(), TIME_OUT);
- return wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(String.format(TEST_ID_XPATH, dataTestId))));
- }
-
- public static Boolean waitForElementInVisibilityByTestId(String dataTestId) {
- return waitForElementInVisibilityByTestId(dataTestId, TIME_OUT);
- }
-
- public static Boolean waitForElementInVisibilityByTestId(String dataTestId, int timeOut) {
- WebDriverWait wait = new WebDriverWait(getDriver(), timeOut);
- boolean displayed = getDriver().findElements(By.xpath(String.format(TEST_ID_XPATH, dataTestId))).isEmpty();
- if (!displayed) {
- return wait.until(ExpectedConditions.invisibilityOfElementLocated(By.xpath(String.format(TEST_ID_XPATH, dataTestId))));
- }
- return false;
- }
-
- public static Boolean waitForElementInVisibilityByTestId(By by) {
- return waitForElementInVisibilityBy(by, TIME_OUT);
- }
-
-
- public static Boolean waitForElementInVisibilityBy(By by, int timeOut) {
- WebDriverWait wait = new WebDriverWait(getDriver(), timeOut);
- boolean displayed = getDriver().findElements(by).isEmpty();
- if (!displayed) {
- Boolean until = wait.until(ExpectedConditions.invisibilityOfElementLocated(by));
- sleep(SLEEP_DURATION);
- return until;
- }
- return false;
- }
-
-
- public static void setWebElementByTestId(String elemetID, String value) {
- WebElement resourceDescriptionTextbox = GeneralUIUtils.getWebElementByTestID(elemetID);
- resourceDescriptionTextbox.clear();
- resourceDescriptionTextbox.sendKeys(value);
-
- }
-
- public static WebElement hoverOnAreaByTestId(String areaId) {
- Actions actions = new Actions(getDriver());
- WebElement area = getWebElementByTestID(areaId);
- actions.moveToElement(area).perform();
- ultimateWait();
- return area;
- }
-
- public static WebElement hoverOnAreaByClassName(String className) {
- Actions actions = new Actions(getDriver());
- WebElement area = getWebElementByClassName(className);
- actions.moveToElement(area).perform();
- GeneralUIUtils.ultimateWait();
- return area;
- }
-
- public static void waitForLoader() {
- waitForLoader(TIME_OUT);
- }
-
- public static void waitForLoader(int timeOut) {
- final String loaderClass = "tlv-loader";
- final int sleepDuration = 500;
- sleep(sleepDuration);
- LOGGER.debug("Waiting {}s for '.{}'", timeOut, loaderClass);
- waitForElementInVisibilityBy(By.className(loaderClass), timeOut);
- }
-
- public static void findComponentAndClick(final String resourceName) {
- HomePage.findComponentAndClick(resourceName);
- }
-
- public static void windowZoomOut() {
- final int zoomOutFactor = 3;
- for (int i = 0; i < zoomOutFactor; i++) {
- if (getDriver() instanceof FirefoxDriver) {
- getDriver().findElement(By.tagName("html")).sendKeys(Keys.chord(Keys.CONTROL, Keys.SUBTRACT));
- }
- }
- }
-
- public static void resetZoom() {
- getDriver().findElement(By.tagName("html")).sendKeys(Keys.chord(Keys.CONTROL, "0"));
- }
-
- public static void windowZoomOutUltimate() {
- resetZoom();
- windowZoomOut();
- }
-
- public static void sleep(int duration) {
- try {
- Thread.sleep(duration);
- } catch (final InterruptedException e) {
- Thread.currentThread().interrupt();
- throw new GeneralUiRuntimeException("The thread was interrupted during a sleep", e);
- }
- }
-
- public static void moveToStep(final DataTestIdEnum.StepsEnum stepName) {
- getExtendTest().log(Status.INFO, String.format("Going to %s page ", stepName.toString()));
- moveToStep(stepName.getValue());
- }
-
- public static void moveToStep(final String dataTestId) {
- clickOnElementByTestId(dataTestId);
- }
-
-
- public static Select getSelectList(String item, String datatestsid) {
- Select selectList = new Select(getWebElementByTestID(datatestsid));
- if (item != null) {
- selectList.selectByVisibleText(item);
- }
- return selectList;
- }
-
- public static List<WebElement> getElementsByCSS(String cssString) /*throws InterruptedException*/ {
- GeneralUIUtils.waitForLoader();
- return getDriver().findElements(By.cssSelector(cssString));
- }
-
- public static WebElement getElementfromElementByCSS(WebElement parentElement, String cssString) {
- GeneralUIUtils.waitForLoader();
- return parentElement.findElement(By.cssSelector(cssString));
- }
-
- private static WebElement highlightMyElement(WebElement element) {
- JavascriptExecutor javascript = (JavascriptExecutor) getDriver();
- javascript.executeScript("arguments[0].setAttribute('style', arguments[1]);", element, COLOR_YELLOW_BORDER_4PX_SOLID_YELLOW);
- return element;
- }
-
- public static WebElement getSelectedElementFromDropDown(String dataTestId) {
- GeneralUIUtils.ultimateWait();
- return new Select(getDriver().findElement(By.xpath(String.format(TEST_ID_XPATH, dataTestId)))).getFirstSelectedOption();
- }
-
- public static Select getElementFromDropDown(String dataTestId) {
- GeneralUIUtils.ultimateWait();
- return new Select(getDriver().findElement(By.xpath(String.format(TEST_ID_XPATH, dataTestId))));
- }
-
- public static boolean checkElementsCountInTable(int expectedElementsCount, Supplier<List<WebElement>> func) {
- int maxWaitingPeriodMS = MAX_WAITING_PERIOD;
- int napPeriodMS = NAP_PERIOD;
- int sumOfWaiting = 0;
- List<WebElement> elements;
- boolean isKeepWaiting = false;
- while (!isKeepWaiting) {
- elements = func.get();
- isKeepWaiting = (expectedElementsCount == elements.size());
- sleep(napPeriodMS);
- sumOfWaiting += napPeriodMS;
- if (sumOfWaiting > maxWaitingPeriodMS) {
- return false;
- }
- }
- return true;
- }
-
- public static String getActionDuration(Runnable func) {
- long startTime = System.nanoTime();
- func.run();
- long estimateTime = System.nanoTime();
- long duration = TimeUnit.NANOSECONDS.toSeconds(estimateTime - startTime);
- return String.format("%02d:%02d", duration / DURATION_FORMATIN, duration % DURATION_FORMATIN);
- }
-
- public static WebElement clickOnAreaJS(String areaId) {
- return clickOnAreaJS(areaId, TIME_OUT);
- }
-
-
- public static WebElement clickOnAreaJS(String areaId, int timeout) {
- try {
- ultimateWait();
- WebElement area = getWebElementByTestID(areaId);
- JavascriptExecutor javascript = (JavascriptExecutor) getDriver();
- Object executeScript = javascript.executeScript("arguments[0].click();", area, COLOR_YELLOW_BORDER_4PX_SOLID_YELLOW);
- waitForLoader(timeout);
- ultimateWait();
- return area;
- } catch (Exception e) {
- e.printStackTrace();
- }
- return null;
- }
-
-
- public static WebElement clickOnAreaJS(WebElement areaId) throws InterruptedException {
- JavascriptExecutor javascript = (JavascriptExecutor) getDriver();
- javascript.executeScript("arguments[0].click();", areaId, COLOR_YELLOW_BORDER_4PX_SOLID_YELLOW);
- return areaId;
- }
-
-
- public static void clickSomewhereOnPage() {
- getDriver().findElement(By.cssSelector(".asdc-app-title")).click();
- }
-
- public static void clickOnElementByText(String textInElement) {
- WebDriverWait wait = new WebDriverWait(getDriver(), TIME_OUT);
- highlightMyElement(wait.until(
- ExpectedConditions.elementToBeClickable(findByText(textInElement)))).click();
- }
-
- public static void clickOnElementByText(String textInElement, int customTimeout) {
- WebDriverWait wait = new WebDriverWait(getDriver(), customTimeout);
- highlightMyElement(wait.until(
- ExpectedConditions.elementToBeClickable(findByText(textInElement)))).click();
- }
-
- public static void clickJSOnElementByText(String textInElement) throws Exception {
- WebDriverWait wait = new WebDriverWait(getDriver(), TIME_OUT);
- clickOnAreaJS(wait.until(
- ExpectedConditions.elementToBeClickable(findByText(textInElement))));
- }
-
- public static void waitForAngular() {
- LOGGER.debug("Waiting for angular");
- final int webDriverWaitingTime = 90;
- WebDriverWait wait = new WebDriverWait(getDriver(), webDriverWaitingTime, NAP_PERIOD);
- wait.until(AdditionalConditions.pageLoadWait());
- wait.until(AdditionalConditions.angularHasFinishedProcessing());
- LOGGER.debug("Waiting for angular finished");
- }
-
- public static Object getAllElementAttributes(WebElement element) {
- return ((JavascriptExecutor) getDriver()).executeScript("var s = []; var attrs = arguments[0].attributes; for (var l = 0; l < attrs.length; ++l) { var a = attrs[l]; s.push(a.name + ':' + a.value); } ; return s;", element);
- }
-
- public static boolean isElementReadOnly(WebElement element) {
- try {
- highlightMyElement(element).clear();
- return false;
- } catch (Exception e) {
- return true;
- }
- }
-
- public static boolean isElementReadOnly(String dataTestId) {
- return isElementReadOnly(
- waitForElementVisibilityByTestId(dataTestId));
- }
-
- public static boolean isElementDisabled(WebElement element) {
- return highlightMyElement(element).getAttribute("class").contains("view-mode")
- || element.getAttribute("class").contains("disabled") || element.getAttribute("disabled") != null;
- }
-
- public static boolean isElementDisabled(String dataTestId) {
- return isElementDisabled(
- waitForElementVisibilityByTestId(dataTestId));
- }
-
- public static void ultimateWait() {
- long startTime = System.nanoTime();
-
- GeneralUIUtils.waitForLoader();
- GeneralUIUtils.waitForBackLoader();
- GeneralUIUtils.waitForAngular();
-
- long estimateTime = System.nanoTime();
- long duration = TimeUnit.NANOSECONDS.toSeconds(estimateTime - startTime);
- if (duration > TIME_OUT) {
- getExtendTest().log(Status.WARNING, String.format("Delays on page, %d seconds", duration));
- }
- }
-
- public static WebElement unhideElement(WebElement element, String attributeValue) {
- String js = "arguments[0].setAttribute('class','" + attributeValue + "');";
- ((JavascriptExecutor) getDriver()).executeScript(js, element);
- return element;
- }
-
- public static WebElement findByText(String textInElement) {
- return getDriver().findElement(searchByTextContaining(textInElement));
- }
-
- public static By searchByTextContaining(String textInElement) {
- return By.xpath("//*[contains(text(),'" + textInElement + "')]");
- }
-
- public static WebElement getClickableButtonBy(By by, int timout) {
- try {
- WebDriverWait wait = new WebDriverWait(getDriver(), timout);
- return wait.until(ExpectedConditions.elementToBeClickable(by));
- } catch (Exception e) {
- return null;
- }
- }
-
-
- public static WebElement getButtonWithText(String textInButton) {
- try {
- return getDriver().findElement(By.xpath("//button[contains(text(),'" + textInButton + "')]"));
- } catch (Exception e) {
- return null;
- }
- }
-
- public static void closeErrorMessage() {
- WebElement okWebElement = getButtonWithText("OK");
- if (okWebElement != null) {
- okWebElement.click();
- ultimateWait();
- }
- }
-
- public static WebElement getElementByCSS(String cssString) throws InterruptedException {
- ultimateWait();
- return getDriver().findElement(By.cssSelector(cssString));
- }
-
- public static String getDataTestIdAttributeValue(WebElement element) {
- return element.getAttribute(TEST_ID_ATTRIBUTE_NAME);
- }
-
- public static String getTextContentAttributeValue(WebElement element) {
- return element.getAttribute("textContent");
- }
-
- public static void clickOnElementByCSS(String cssString) throws Exception {
- WebDriverWait wait = new WebDriverWait(getDriver(), TIME_OUT);
- wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector(cssString))).click();
- ultimateWait();
- }
-
- public static boolean checkForDisabledAttribute(String dataTestId) {
- Object elementAttributes = getAllElementAttributes(waitForElementVisibilityByTestId(dataTestId));
- return elementAttributes.toString().contains("disabled");
- }
-
- public static void dragAndDropElementByY(WebElement area, int yOffset) {
- final int dragAndDropTimeout = 10;
- Actions actions = new Actions(getDriver());
- actions.dragAndDropBy(area, dragAndDropTimeout, yOffset).perform();
- ultimateWait();
- }
-
- public static void waitForBackLoader() {
- waitForBackLoader(TIME_OUT);
- }
-
- public static void waitForBackLoader(int timeOut) {
- sleep(NAP_PERIOD);
- final String backLoaderClass = "tlv-loader-back";
- LOGGER.debug("Waiting {}s for '.{}'", timeOut, backLoaderClass);
- waitForElementInVisibilityBy(By.className(backLoaderClass), timeOut);
- }
-
- public static void addStringtoClipboard(String text) {
- StringSelection selection = new StringSelection(text);
- Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
- clipboard.setContents(selection, selection);
- }
-
- public static boolean checkForDisabledAttributeInHiddenElement(String cssString) {
- final int numberOfDisableElements = 3;
- boolean isDisabled = false;
- for (int i = 0; i < numberOfDisableElements; i++) {
- Object elementAttributes = getAllElementAttributes(getWebElementByPresence(By.cssSelector(cssString), TIME_OUT));
- isDisabled = elementAttributes.toString().contains("disabled");
- if (isDisabled) {
- break;
- }
- ultimateWait();
- }
- return isDisabled;
- }
-
- public static void selectByValueTextContained(String dataTestsId, String value) {
-
- List<WebElement> options = GeneralUIUtils.getWebElementsListBy(By.xpath(String.format("//select[@data-tests-id='%1$s' or @data-test-id='%1$s']//option[contains(@value,'%2$s')]", dataTestsId, value)));
-
- boolean matched = false;
- for (WebElement option : options) {
- option.click();
- matched = true;
- }
-
- if (!matched) {
- throw new NoSuchElementException("Cannot locate option with value: " + value);
- }
-
- ultimateWait();
- }
-
- public static void setTextInElementByXpath(String xPath, String text) {
- WebElement webElement = GeneralUIUtils.getWebElementBy(By.xpath(xPath));
- webElement.clear();
- webElement.click();
- webElement.sendKeys(text);
- ultimateWait();
- }
-
-
- public static void clickOnElementByXpath(String xPath) {
- WebElement webElement = GeneralUIUtils.getWebElementBy(By.xpath(xPath));
- webElement.click();
- ultimateWait();
- }
-
- public static String getTextValueFromWebElementByXpath(String xpath) {
- WebElement webElement = getWebElementBy(By.xpath(xpath));
- return webElement.getAttribute("value");
- }
-
- public static List<WebElement> findElementsByXpath(String xPath) {
- return getDriver().findElements(By.xpath(xPath));
- }
-
- public static void clickOnBrowserBackButton() throws Exception {
- getExtendTest().log(Status.INFO, "Going to press on back browser button.");
- getDriver().navigate().back();
- ultimateWait();
- }
-
- public static String copyCurrentURL() throws Exception {
- getExtendTest().log(Status.INFO, "Copying current URL");
- return getDriver().getCurrentUrl();
- }
-
- public static void navigateToURL(String url) throws Exception {
- getExtendTest().log(Status.INFO, "Navigating to URL " + url);
- getDriver().navigate().to(url);
- }
-
- public static void refreshWebpage() throws Exception {
- getExtendTest().log(Status.INFO, "Refreshing Webpage");
- getDriver().navigate().refresh();
- ultimateWait();
- }
-
- public static Object getElementPositionOnCanvas(String elementName) {
- String scriptJS = "var cy = window.jQuery('.sdc-composition-graph-wrapper').cytoscape('get');\n"
- + "var n = cy.nodes('[name=\"" + elementName + "\"]');\n"
- + "var nPos = n.renderedPosition();\n"
- + "return JSON.stringify({\n"
- + "\tx: nPos.x,\n"
- + "\ty: nPos.y\n"
- + "})";
- return ((JavascriptExecutor) getDriver()).executeScript(scriptJS);
- }
-
- public static Object getElementGreenDotPositionOnCanvas(String elementName) {
- String scriptJS = "var cy = window.jQuery('.sdc-composition-graph-wrapper').cytoscape('get');\n"
- + "var cyZoom = cy.zoom();\n"
- + "var n = cy.nodes('[name=\"" + elementName + "\"]');\n"
- + "var nPos = n.renderedPosition();\n"
- + "var nData = n.data();\n"
- + "var nImgSize = nData.imgWidth;\n"
- + "var shiftSize = (nImgSize-18)*cyZoom/2;\n"
- + "return JSON.stringify({\n"
- + "\tx: nPos.x + shiftSize,\n"
- + "\ty: nPos.y - shiftSize\n"
- + "});";
- return ((JavascriptExecutor) getDriver()).executeScript(scriptJS);
- }
-
- public static Long getAndValidateActionDuration(Runnable action, int regularTestRunTime) {
- Long actualTestRunTime = null;
- try {
- actualTestRunTime = Utils.getActionDuration(() -> {
- try {
- action.run();
- } catch (Throwable throwable) {
- throwable.printStackTrace();
- }
- });
- } catch (Exception e) {
- e.printStackTrace();
- }
- final double factor = 1.5;
-
- assertTrue("Expected test run time should be less than " + regularTestRunTime * factor + ", "
- + "actual time is " + actualTestRunTime, regularTestRunTime * factor > actualTestRunTime);
- //SetupCDTest.getExtendTest().log(Status.INFO, "Actual catalog loading time is " + actualTestRunTime + " seconds");
- return actualTestRunTime;
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/HomeUtils.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/HomeUtils.java
deleted file mode 100644
index 61a5e7b542..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/HomeUtils.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utilities;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.ci.tests.datatypes.CreateAndImportButtonsEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.testng.Assert;
-
-import java.util.List;
-
-public final class HomeUtils {
-
- public static WebElement createAndImportButtons(CreateAndImportButtonsEnum type, WebDriver driver)
- throws InterruptedException {
- switch (type) {
- case IMPORT_CP:
- case IMPORT_VFC:
- case IMPORT_VL:
- case IMPORT_VF:
- GeneralUIUtils.hoverOnAreaByTestId(DataTestIdEnum.Dashboard.IMPORT_AREA.getValue());
- return GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.Dashboard.IMPORT_VFC.getValue());
- case CREATE_SERVICE:
- GeneralUIUtils.hoverOnAreaByTestId(DataTestIdEnum.Dashboard.ADD_AREA.getValue());
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.Dashboard.BUTTON_ADD_SERVICE.getValue()).click();
- break;
-
- case CREATE_PRODUCT:
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.Dashboard.BUTTON_ADD_SERVICE.getValue()).click();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.Dashboard.BUTTON_ADD_SERVICE.getValue()).click();
- break;
-
- default:
- GeneralUIUtils.hoverOnAreaByTestId(DataTestIdEnum.Dashboard.ADD_AREA.getValue());
- driver.findElement(By.xpath("//*[@data-tests-id='createResourceButton']")).click();
- break;
- }
- return null;
-
- }
-
- public static void findComponentAndClick(String componentName) throws Exception {
- SetupCDTest.getExtendTest().log(Status.INFO, "finding component " + componentName);
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtons.SEARCH_BOX.getValue()).sendKeys(componentName);
- WebElement foundComp = null;
- try {
- foundComp = GeneralUIUtils.getWebElementByTestID(componentName);
- foundComp.click();
- GeneralUIUtils.waitForLoader();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.LIFECYCLE_STATE.getValue());
- } catch (Exception e) {
- String msg = String.format("DID NOT FIND A COMPONENT NAMED %s", componentName);
- SetupCDTest.getExtendTest().log(Status.FAIL, msg);
- System.out.println(msg);
- Assert.fail(msg);
- }
- }
-
- public static void findComponentAndClickByVersion(String componentName, String version) throws Exception {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("finding component %s v%s", componentName, version));
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtons.SEARCH_BOX.getValue()).sendKeys(componentName);
- List<WebElement> foundComp = null;
- try {
- foundComp = GeneralUIUtils.getWebElementsListByTestID(componentName + "Version");
-
- for (WebElement webElement : foundComp) {
- if (webElement.getText().contains(version)) {
- webElement.click();
- GeneralUIUtils.ultimateWait();
- break;
- }
- }
- } catch (Exception e) {
- String msg = String.format("DID NOT FIND A COMPONENT NAMED %s", componentName);
- SetupCDTest.getExtendTest().log(Status.FAIL, msg);
- System.out.println(msg);
- Assert.fail(msg);
- }
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/LoaderHelper.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/LoaderHelper.java
deleted file mode 100644
index 494c20a172..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/LoaderHelper.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utilities;
-
-import org.openecomp.sdc.ci.tests.execute.setup.DriverFactory;
-import org.openqa.selenium.By;
-import org.openqa.selenium.support.ui.ExpectedConditions;
-import org.openqa.selenium.support.ui.WebDriverWait;
-
-public class LoaderHelper {
-
- private final By locator = By.className("tlv-loader");
-
- public void waitForLoader(final int timeout) {
- waitForLoaderVisibility(5);
- waitForLoaderInvisibility(timeout);
- }
-
- private void waitForLoaderVisibility(final int timeout) {
- getWait(timeout)
- .until(ExpectedConditions.visibilityOfElementLocated(locator));
- }
-
- private void waitForLoaderInvisibility(int timeout) {
- getWait(timeout).until(ExpectedConditions.invisibilityOfElementLocated(locator));
- }
-
- private WebDriverWait getWait(final int timeout) {
- return new WebDriverWait(DriverFactory.getDriver(), timeout);
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/NotificationHelper.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/NotificationHelper.java
deleted file mode 100644
index 6366447e70..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/NotificationHelper.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utilities;
-
-import org.openecomp.sdc.ci.tests.execute.setup.DriverFactory;
-import org.openqa.selenium.By;
-import org.openqa.selenium.support.ui.ExpectedConditions;
-import org.openqa.selenium.support.ui.WebDriverWait;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static org.openecomp.sdc.ci.tests.utilities.NotificationHelper.XpathSelector.MAIN_CONTAINER_DIV;
-import static org.openecomp.sdc.ci.tests.utilities.NotificationHelper.XpathSelector.MESSAGE_CONTENT_DIV;
-import static org.openecomp.sdc.ci.tests.utilities.NotificationHelper.XpathSelector.MESSAGE_SUCCESS_DIV;
-
-public class NotificationHelper {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(NotificationHelper.class);
-
- public void waitForNotification(final NotificationType notificationType, final int timeout) {
- final By messageLocator = getMessageLocator(notificationType);
- waitForVisibility(messageLocator, timeout);
- waitForInvisibility(messageLocator, timeout);
- }
-
- private By getMessageLocator(final NotificationType notificationType) {
- return By.xpath(getMessageXpath(notificationType));
- }
-
- private String getMessageXpath(final NotificationType notificationType) {
- if (notificationType == NotificationType.SUCCESS) {
- return String.format("%s%s%s", MAIN_CONTAINER_DIV.getXpath(), MESSAGE_CONTENT_DIV.getXpath(), MESSAGE_SUCCESS_DIV.getXpath());
- }
-
- LOGGER.warn("Xpath for NotificationType {} not yet implemented. Returning empty Xpath.", notificationType);
- return "";
- }
-
- private void waitForVisibility(By messageLocator, final int timeout) {
- getWait(timeout)
- .until(ExpectedConditions.visibilityOfElementLocated(messageLocator));
- }
-
- private void waitForInvisibility(By messageLocator, int timeout) {
- getWait(timeout)
- .until(ExpectedConditions.invisibilityOfElementLocated(messageLocator));
- }
-
- private WebDriverWait getWait(final int timeout) {
- return new WebDriverWait(DriverFactory.getDriver(), timeout);
- }
-
- public enum XpathSelector {
- MAIN_CONTAINER_DIV("notification-container", "//div[@class='%s']"),
- MESSAGE_CONTENT_DIV("msg-content", "//div[@class='%s']"),
- MESSAGE_SUCCESS_DIV("message", "//div[contains(@class, '%s') and contains(text(),'successfully')]");
-
- private final String id;
- private final String xpath;
-
- XpathSelector(String id, String xpath) {
- this.id = id;
- this.xpath = xpath;
- }
-
- public String getId() {
- return id;
- }
-
- public String getXpath() {
- return String.format(xpath, id);
- }
- }
-
- public enum NotificationType {
- SUCCESS;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/OnboardingUiUtils.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/OnboardingUiUtils.java
deleted file mode 100644
index 020c41607a..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/OnboardingUiUtils.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utilities;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.HeatMetaFirstLevelDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.LifeCycleStateEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.VendorLicenseModel;
-import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
-import org.openecomp.sdc.ci.tests.execute.devCI.ArtifactFromCsar;
-import org.openecomp.sdc.ci.tests.execute.setup.ArtifactsCorrelationManager;
-import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
-import org.openecomp.sdc.ci.tests.pages.GeneralPageElements;
-import org.openecomp.sdc.ci.tests.pages.HomePage;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.utils.general.OnboardingUtils;
-import org.openecomp.sdc.ci.tests.utils.general.VendorLicenseModelRestUtils;
-import org.openecomp.sdc.ci.tests.utils.general.VendorSoftwareProductRestUtils;
-import org.openecomp.sdc.ci.tests.verificator.VfVerificator;
-import org.openqa.selenium.WebElement;
-import org.testng.Assert;
-
-import java.io.File;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-
-public class OnboardingUiUtils {
-
- private static final int WAITING_FOR_LOADER_TIME_OUT = 60 * 10;
-
- private static void importUpdateVSP(VendorSoftwareProductObject vsp, boolean isUpdate, boolean restore) throws Exception {
- String vspName = vsp.getName();
- boolean vspFound = HomePage.searchForVSP(vspName);
-
- if (vspFound) {
- List<WebElement> elementsFromTable = GeneralPageElements.getElementsFromTable();
- elementsFromTable.get(0).click();
- elementsFromTable.get(0).click();
- GeneralUIUtils.waitForLoader();
-
- if (isUpdate) {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ImportVfRepository.UPDATE_VSP.getValue());
- } else {
- GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ImportVfRepository.IMPORT_VSP.getValue());
- }
- if (restore) {
- GeneralPageElements.restoreComponentFromElementPage(vspName);
- }
- doCheckOut();
- //Metadata verification
- onboardedVnfMetadataVerification(vsp, isUpdate);
- String duration = GeneralUIUtils.getActionDuration(OnboardingUiUtils::waitUntilVnfCreated);
- ExtentTestActions.log(Status.INFO, "Succeeded in importing/updating " + vspName, duration);
- } else {
- Assert.fail("Did not find VSP named " + vspName);
- }
- }
-
- private static void onboardedVnfMetadataVerification(VendorSoftwareProductObject vsp, boolean isUpdate) {
- if (isUpdate) {
- VfVerificator.verifyOnboardedVnfMetadataAfterUpdateVNF(vsp.getName(), vsp);
- } else {
- VfVerificator.verifyOnboardedVnfMetadata(vsp.getName(), vsp);
- }
- }
-
- public static boolean getVspValidationCongiguration() throws Exception {
- return Boolean.parseBoolean(OnboardingUtils.getVspValidationConfiguration());
- }
-
- public static boolean putVspValidationCongiguration(boolean value) throws Exception {
- return Boolean.parseBoolean(OnboardingUtils.putVspValidationConfiguration(value));
- }
-
- public static void doCheckOut() {
- String lifeCycleState = ResourceGeneralPage.getLifeCycleState();
- boolean needCheckout = lifeCycleState.equals(LifeCycleStateEnum.CHECKIN.getValue()) || lifeCycleState.equals(LifeCycleStateEnum.CERTIFIED.getValue());
- if (needCheckout) {
- try {
- ResourceGeneralPage.clickCheckoutButton();
- Assert.assertTrue(ResourceGeneralPage.getLifeCycleState().equals(LifeCycleStateEnum.CHECKOUT.getValue()), "Did not succeed to checkout");
- } catch (Exception e) {
- ExtentTestActions.log(Status.ERROR, "Did not succeed to checkout");
- e.printStackTrace();
- }
- GeneralUIUtils.waitForLoader();
- }
- }
-
- private static void waitUntilVnfCreated() {
- ExtentTestActions.log(Status.INFO, "Clicking create/update VNF");
- GeneralUIUtils.ultimateWait();
- GeneralUIUtils.clickOnAreaJS(DataTestIdEnum.GeneralElementsEnum.CREATE_BUTTON.getValue());
- GeneralUIUtils.waitForLoader(WAITING_FOR_LOADER_TIME_OUT);
- GeneralUIUtils.ultimateWait();
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.CHECKIN_BUTTON.getValue());
- }
-
- public static void updateVSP(VendorSoftwareProductObject vsp, boolean restore) throws Exception {
- ExtentTestActions.log(Status.INFO, "Updating VSP " + vsp.getName());
- importUpdateVSP(vsp, true, restore);
- }
-
- public static void updateVSP(VendorSoftwareProductObject vsp) throws Exception {
- ExtentTestActions.log(Status.INFO, "Updating VSP " + vsp.getName());
- importUpdateVSP(vsp, true, false);
- }
-
- public static void importVSP(VendorSoftwareProductObject vsp) throws Exception {
- ExtentTestActions.log(Status.INFO, "Importing VSP " + vsp.getName());
- importUpdateVSP(vsp, false, false);
- }
-
- public static void updateVnfAndValidate(String filePath, VendorSoftwareProductObject vsp, String updatedVnfFile, User user) throws Exception {
- ExtentTestActions.log(Status.INFO, String.format("Going to update the VNF with %s......", updatedVnfFile));
- System.out.println(String.format("Going to update the VNF with %s......", updatedVnfFile));
-
- VendorSoftwareProductRestUtils.updateVendorSoftwareProductToNextVersion(vsp, user, filePath, updatedVnfFile);
- HomePage.showVspRepository();
- updateVSP(vsp);
- ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
- DeploymentArtifactPage.verifyArtifactsExistInTable(filePath, updatedVnfFile);
- }
-
- public static VendorSoftwareProductObject createVSP(ResourceReqDetails resourceReqDetails, String vnfFile, String filepath, User user) throws Exception {
- ExtentTestActions.log(Status.INFO, String.format("Creating VSP from package '%s'", vnfFile));
- final VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(user);
- return VendorSoftwareProductRestUtils.createVSP(resourceReqDetails, vnfFile, filepath, user, vendorLicenseModel);
- }
-
-
- public static VendorSoftwareProductObject onboardAndValidate(ResourceReqDetails resourceReqDetails, String filepath, String vnfFile, User user) throws Exception {
- ExtentTestActions.log(Status.INFO, String.format("Going to onboard the VNF %s", vnfFile));
- System.out.println(String.format("Going to onboard the VNF %s", vnfFile));
-
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(user);
- VendorSoftwareProductObject createVendorSoftwareProduct = VendorSoftwareProductRestUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile, filepath, user,
- vendorLicenseModel);
- String vspName = createVendorSoftwareProduct.getName();
-
- DownloadManager.downloadCsarByNameFromVSPRepository(vspName, createVendorSoftwareProduct.getVspId());
- File latestFilefromDir = FileHandling.getLastModifiedFileNameFromDir();
-
- ExtentTestActions.log(Status.INFO, String.format("Going to import %s", vnfFile.substring(0, vnfFile.indexOf("."))));
- importVSP(createVendorSoftwareProduct);
-
- ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
-
- // Verify deployment artifacts
- Map<String, Object> combinedMap = ArtifactFromCsar.combineHeatArtifacstWithFolderArtifacsToMap(latestFilefromDir.getAbsolutePath());
-
- LinkedList<HeatMetaFirstLevelDefinition> deploymentArtifacts = ((LinkedList<HeatMetaFirstLevelDefinition>) combinedMap.get("Deployment"));
- ArtifactsCorrelationManager.addVNFartifactDetails(vspName, deploymentArtifacts);
-
- List<String> heatEnvFilesFromCSAR = deploymentArtifacts.stream().filter(e -> e.getType().equals("HEAT_ENV")).
- map(e -> e.getFileName()).
- collect(Collectors.toList());
-
- validateDeploymentArtifactsVersion(deploymentArtifacts, heatEnvFilesFromCSAR);
-
-// DeploymentArtifactPage.verifyArtifactsExistInTable(filepath, vnfFile);
- return createVendorSoftwareProduct;
- }
-
- public static void validateDeploymentArtifactsVersion(LinkedList<HeatMetaFirstLevelDefinition> deploymentArtifacts,
- List<String> heatEnvFilesFromCSAR) {
- String artifactVersion;
- String artifactName;
-
- for (HeatMetaFirstLevelDefinition deploymentArtifact : deploymentArtifacts) {
- artifactVersion = "1";
-
- if (deploymentArtifact.getType().equals("HEAT_ENV")) {
- continue;
- } else if (deploymentArtifact.getFileName().contains(".")) {
- artifactName = deploymentArtifact.getFileName().trim().substring(0, deploymentArtifact.getFileName().lastIndexOf("."));
- } else {
- artifactName = deploymentArtifact.getFileName().trim();
- }
-
- ArtifactUIUtils.validateArtifactNameVersionType(artifactName, artifactVersion, deploymentArtifact.getType());
- }
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/PortMirroringUtils.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/PortMirroringUtils.java
deleted file mode 100644
index 062d11eb9f..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/PortMirroringUtils.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utilities;
-
-import com.aventstack.extentreports.Status;
-import fj.data.Either;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.Component;
-import org.openecomp.sdc.be.model.ComponentInstance;
-import org.openecomp.sdc.be.model.InputDefinition;
-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.ci.tests.datatypes.CanvasElement;
-import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
-import org.openecomp.sdc.ci.tests.datatypes.ConnectionWizardPopUpObject;
-import org.openecomp.sdc.ci.tests.datatypes.PortMirrioringConfigurationObject;
-import org.openecomp.sdc.ci.tests.datatypes.PortMirroringEnum;
-import org.openecomp.sdc.ci.tests.datatypes.PropertyObject;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceContainer;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.TopMenuButtonsEnum;
-import org.openecomp.sdc.ci.tests.datatypes.VendorLicenseModel;
-import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
-import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
-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.http.RestResponse;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.CompositionPage;
-import org.openecomp.sdc.ci.tests.pages.ServiceGeneralPage;
-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.FileHandling;
-import org.openecomp.sdc.ci.tests.utils.general.OnboardingUtillViaApis;
-import org.openecomp.sdc.ci.tests.utils.general.VendorLicenseModelRestUtils;
-import org.openecomp.sdc.ci.tests.utils.general.VendorSoftwareProductRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.PropertyRestUtils;
-
-import java.util.List;
-import java.util.Map;
-
-public class PortMirroringUtils {
-
-
- private static final int WAITING_FOR_LOADER_TIME_OUT = 2000;
-
- private PortMirroringUtils() {
-
- }
-
- public static ServiceContainer createServiceFromHeatFile(String filePath, String vnfFile) throws Throwable {
-//1. Import VSP v1.0
- User sdncDesignerDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
- VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(sdncDesignerDetails1);
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating Vendor Software License (VLM): %s v1.0", vendorLicenseModel
- .getVendorLicenseName()));
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating Vendor Software Product (VSP): %s v1.0 from heat file: %s ", resourceReqDetails.getName(), vnfFile));
- VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails1,
- vendorLicenseModel);
-// VendorSoftwareProductObject vendorSoftwareProductObject = OnboardViaApis.fillVendorSoftwareProductObjectWithMetaData(vnfFile, createVendorSoftwareProduct);
-//2. Create VF, certify - v1.0 is created
- resourceReqDetails = org.openecomp.sdc.ci.tests.utils.general.OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
- Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating Virtual Function (VF): %s v1.0", resourceReqDetails.getName()));
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Certify the VF"));
-//3. Create Service add to it the certified VF and certify the Service v1.0
- ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();
- Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating Service: %s v1.0", serviceReqDetails.getName()));
- Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
- ComponentInstance componentInstance = addComponentInstanceToComponentContainer.left().value();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Adding VF instance to Service"));
- service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Certify the Service"));
-
- return new ServiceContainer(service, resource, vendorSoftwareProductObject, vendorLicenseModel);
- }
-
- public static Resource generatePNFAndUpdateInput(String resourceName, String vendorModelNumber, User user) throws Exception {
- Resource resource = getresourcebytype(ResourceTypeEnum.PNF, resourceName, vendorModelNumber);
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating pnf %s and certify it", resource.getName()));
- Component componentObject = AtomicOperationUtils.getComponentObject(resource, UserRoleEnum.DESIGNER);
- updateResourceInputViaAPI(user, componentObject, "physicalProbe", "nf_role");
- resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
- return resource;
- }
-
- private static void updateResourceInputViaAPI(User user, Component componentObject, String defaultValue, String inputName) throws Exception {
- List<InputDefinition> componentInputs = componentObject.getInputs();
- PropertyObject propertyObject = new PropertyObject(defaultValue, inputName, componentInputs.get(1).getParentUniqueId(), componentInputs.get(1).getUniqueId());
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Update input %s to %s", "nf_role", "physicalProbe"));
- PropertyRestUtils.updateInput(componentObject, propertyObject, user);
- }
-
- public static Resource getresourcebytype(ResourceTypeEnum resourceTypeEnum, String resourceName, String vendorModelNumber) {
- ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResourceByType(resourceTypeEnum, resourceName, ResourceCategoryEnum.NETWORK_L2_3_INFRASTRUCTURE, resourceName, vendorModelNumber);
- return AtomicOperationUtils.createResourceByResourceDetails(resourceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
- }
-
- public static String createproxyinstanceservicename(String serviceName, String instanceId) {
- String serviceProxyInstanceName = String.format("%s_proxy %s", serviceName, instanceId);
- return serviceProxyInstanceName;
- }
-
- public static PortMirrioringConfigurationObject createPortMirriongConfigurationStructure(boolean isCapPropAssign) throws Throwable {
-
- //Using API onboard and certify 2 zip files Source: vmmme and Collector: Vprobe
- String filePath = FileHandling.getPortMirroringRepositoryPath();
- ServiceContainer serviceContainerVmme_Source = PortMirroringUtils.createServiceFromHeatFile(filePath, PortMirroringEnum.VMME_ZIP.getValue());
- ServiceContainer serviceContainerVprobe_Collector = PortMirroringUtils.createServiceFromHeatFile(filePath, PortMirroringEnum.VPROBE_ZIP.getValue());
-
- // create service
- ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();
- //ServiceUIUtils.createService(serviceMetadata, getUser());
-
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating container %s: ", serviceReqDetails.getName()));
- Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
-
- String vmmeSourceName = serviceContainerVmme_Source.getService().getName();
- String vprobeSourceName = serviceContainerVprobe_Collector.getService().getName();
-
- CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
- GeneralUIUtils.findComponentAndClick(service.getName());
-
- ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
- CanvasManager canvasManager = CanvasManager.getCanvasManager();
-
- CanvasElement serviceElementVmmeSourceName = canvasManager.createElementOnCanvas(vmmeSourceName);
-
- CanvasElement serviceElementVprobeCollector = canvasManager.createElementOnCanvas(vprobeSourceName);
-
- CompositionPage.searchForElement(PortMirroringEnum.PMC_ELEMENT_IN_PALLETE.getValue());
- CanvasElement portMirroringConfigurationElement = canvasManager.createElementOnCanvas(PortMirroringEnum.PMC_ELEMENT_IN_PALLETE.getValue());
-
- ConnectionWizardPopUpObject connectionWizardPopUpObjectVMME = new ConnectionWizardPopUpObject("", "",
- PortMirroringEnum.PM_REQ_TYPE.getValue(), PortMirroringEnum.PMC_SOURCE_CAP.getValue());
- ConnectionWizardPopUpObject connectionWizardPopUpObjectVProbe = new ConnectionWizardPopUpObject("", "",
- PortMirroringEnum.PM_REQ_TYPE.getValue(), PortMirroringEnum.PMC_COLLECTOR_CAP.getValue());
- Map<String, String> capPropValues1 = null;
-
- if (isCapPropAssign) {
- capPropValues1 = canvasManager.linkElementsWithCapPropAssignment(serviceElementVmmeSourceName, portMirroringConfigurationElement, connectionWizardPopUpObjectVMME);
- GeneralUIUtils.waitForLoader(WAITING_FOR_LOADER_TIME_OUT);
- canvasManager.linkElementsWithCapPropAssignment(serviceElementVprobeCollector, portMirroringConfigurationElement, connectionWizardPopUpObjectVProbe);
- } else {
- canvasManager.linkElementsAndSelectCapReqTypeAndCapReqName(serviceElementVmmeSourceName, portMirroringConfigurationElement, connectionWizardPopUpObjectVMME);
- canvasManager.linkElementsAndSelectCapReqTypeAndCapReqName(serviceElementVprobeCollector, portMirroringConfigurationElement, connectionWizardPopUpObjectVProbe);
- }
-
-
- PortMirrioringConfigurationObject portMirrioringConfigurationObject = new PortMirrioringConfigurationObject(serviceReqDetails, vmmeSourceName,
- vprobeSourceName, canvasManager, serviceElementVmmeSourceName, serviceElementVprobeCollector, service,
- portMirroringConfigurationElement, serviceContainerVmme_Source.getService(), serviceContainerVprobe_Collector.getService());
-
- if (capPropValues1 != null) {
- portMirrioringConfigurationObject.setCapPropValues(capPropValues1);
- }
-
- return portMirrioringConfigurationObject;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/ProductUIUtils.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/ProductUIUtils.java
deleted file mode 100644
index 33c6317590..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/ProductUIUtils.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utilities;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ProductReqDetails;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.GeneralPageElements;
-import org.openecomp.sdc.ci.tests.pages.ProductGeneralPage;
-import org.openqa.selenium.Keys;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-
-import java.util.List;
-
-/**
- * @author al714h
- */
-
-public class ProductUIUtils {
-
- protected static WebDriver driver;
-
- private ProductUIUtils() {
- super();
- }
-
- private static void fillProductGeneralPage(ProductReqDetails product, User user) throws Exception {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Fill in metadata values in general page.. "));
- ProductGeneralPage.defineName(product.getName());
- ProductGeneralPage.defineFullName(product.getFullName());
- ProductGeneralPage.defineDescription(product.getDescription());
- ProductGeneralPage.defineProjectCode(product.getProjectCode());
- defineTagsList2(product.getTags());
- ProductGeneralPage.defineContactId(product.getContactId());
- GeneralUIUtils.clickSomewhereOnPage();
- }
-
- public static void createProduct(ProductReqDetails product, User user) throws Exception {
- clikAddProduct();
- fillProductGeneralPage(product, user);
- GeneralPageElements.clickCreateButton();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Product %s created", product.getName()));
- }
-
- private static void defineTagsList2(List<String> productTags) {
- WebElement productTagsTextbox = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ProductMetadataEnum.TAGS.getValue());
- for (String tag : productTags) {
- productTagsTextbox.clear();
- productTagsTextbox.sendKeys(tag);
- GeneralUIUtils.waitForAngular();
- productTagsTextbox.sendKeys(Keys.ENTER);
- }
- }
-
- private static void clikAddProduct() {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking Add Product button"));
- try {
- GeneralUIUtils.hoverOnAreaByTestId(DataTestIdEnum.Dashboard.ADD_AREA.getValue());
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.Dashboard.BUTTON_ADD_PRODUCT.getValue()).click();
- GeneralUIUtils.ultimateWait();
- } catch (Exception e) {
- SetupCDTest.getExtendTest().log(Status.WARNING, String.format("Exception on catched on Add Product button, retrying ..."));
- GeneralUIUtils.hoverOnAreaByClassName("w-sdc-dashboard-card-new");
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.Dashboard.BUTTON_ADD_PRODUCT.getValue()).click();
- GeneralUIUtils.ultimateWait();
- }
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/PropertiesUIUtils.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/PropertiesUIUtils.java
deleted file mode 100644
index 609b18eaeb..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/PropertiesUIUtils.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utilities;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.ci.tests.datatypes.enums.PropertyTypeEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.PropertiesPage;
-import org.openqa.selenium.WebElement;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class PropertiesUIUtils {
-
- private static final int SLEEP_TIME = 2000;
-
- public static Map<String, String> addProperties(String name, String itemType, String defaultValue,
- String description, String schemaType) throws Exception {
- Map<String, String> propertyvalues = new HashMap<String, String>();
- GeneralUIUtils.getSelectList(itemType, "propertyType");
- ResourceUIUtils.definePropertyName(name);
- if (itemType == "boolean") {
- ResourceUIUtils.defineBoolenDefaultValue(defaultValue);
- GeneralUIUtils.setWebElementByTestId("description", "description");
- Thread.sleep(SLEEP_TIME);
- GeneralUIUtils.getWebElementByTestID("Add").click();
- } else if (itemType == "list" || itemType == "map") {
- GeneralUIUtils.getSelectList(schemaType, "schemaType");
- }
- if (!(itemType == "boolean")) {
- ResourceUIUtils.defineDefaultValueByType(defaultValue);
- GeneralUIUtils.setWebElementByTestId("description", "des");
- GeneralUIUtils.getWebElementByTestID("Add").click();
- Thread.sleep(SLEEP_TIME);
- }
- propertyvalues.put("type", itemType);
- propertyvalues.put("defaultValue", defaultValue);
- propertyvalues.put("description", description);
- propertyvalues.put("name", name);
-
- return propertyvalues;
- }
-
- public static void vlidateProperties(Map<String, String> propertyValues) throws InterruptedException {
- WebElement name = GeneralUIUtils.getWebElementByTestID(propertyValues.get("name"));
- name.getText().equalsIgnoreCase(propertyValues.get("name"));
- WebElement defaultValue = GeneralUIUtils.getWebElementByTestID(propertyValues.get("name"));
- defaultValue.getText().equalsIgnoreCase(propertyValues.get("defaultValue"));
- WebElement type = GeneralUIUtils.getWebElementByTestID(propertyValues.get("type"));
- type.getText().equalsIgnoreCase(propertyValues.get("type"));
- }
-
- public static void addNewProperty(PropertyTypeEnum property) {
- GeneralUIUtils.ultimateWait();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Adding new %s property", property.name()));
- PropertiesPage.clickAddPropertyArtifact();
- PropertiesPage.getPropertyPopup().insertPropertyName(property.getName());
- PropertiesPage.getPropertyPopup().selectPropertyType(property.getType());
- PropertiesPage.getPropertyPopup().insertPropertyDescription(property.getDescription());
- PropertiesPage.getPropertyPopup().insertPropertyDefaultValue(property.getValue());
- PropertiesPage.getPropertyPopup().clickSave();
- }
-
- public static void updateProperty(PropertyTypeEnum property) {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating property: %s", property.name()));
- PropertiesPage.clickOnProperty(property.getName());
- PropertiesPage.getPropertyPopup().insertPropertyDescription(property.getUpdateDescription());
- PropertiesPage.getPropertyPopup().insertPropertyDefaultValue(property.getUpdateValue());
- PropertiesPage.getPropertyPopup().clickSave();
- }
-
- public static void changePropertyDefaultValueInComposition(String propertyName, String defaultValue) {
- GeneralUIUtils.clickOnElementByTestId(propertyName);
- PropertiesPage.getPropertyPopup().insertPropertyDefaultValue(defaultValue);
- PropertiesPage.getPropertyPopup().clickSave();
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/ResourceUIUtils.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/ResourceUIUtils.java
deleted file mode 100644
index 76c1a4c572..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/ResourceUIUtils.java
+++ /dev/null
@@ -1,396 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utilities;
-
-import com.aventstack.extentreports.Status;
-import org.apache.commons.lang3.tuple.ImmutablePair;
-import org.json.simple.JSONArray;
-import org.json.simple.JSONObject;
-import org.json.simple.JSONValue;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.datatypes.CreateAndImportButtonsEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.Dashboard;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.StepsEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.GeneralPageElements;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openqa.selenium.By;
-import org.openqa.selenium.ElementNotVisibleException;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.support.ui.ExpectedConditions;
-import org.openqa.selenium.support.ui.Select;
-import org.openqa.selenium.support.ui.WebDriverWait;
-
-import java.io.File;
-import java.util.List;
-import java.util.Random;
-
-public final class ResourceUIUtils {
- public static final String RESOURCE_NAME_PREFIX = "ResourceCDTest-";
- protected static final boolean IS_BEFORE_TEST = true;
- public static final String INITIAL_VERSION = "0.1";
- public static final String ICON_RESOURCE_NAME = "call_controll";
- protected static final String UPDATED_RESOURCE_ICON_NAME = "objectStorage";
- private static final int BASIC_TIMEOUT = 10 * 60;
-
- private ResourceUIUtils() {
- }
-
- private static WebDriver driver = GeneralUIUtils.getDriver();
-
- // click and upload tosca file //**to be changed.
- public static void importFileWithSendKey(String filePath, String fileName, CreateAndImportButtonsEnum type)
- throws Exception {
- WebElement importButton = HomeUtils.createAndImportButtons(type, driver).findElement(By.tagName("input"));
- importButton.sendKeys(filePath + fileName);
- }
-
- public static String defineUserId(String userId) {
- //
- WebElement resourceUserIdTextbox = ResourceGeneralPage.getContactIdField();
- resourceUserIdTextbox.clear();
- resourceUserIdTextbox.sendKeys(userId);
- return userId;
- }
-
- static String definePropertyName(String name) {
-
- WebElement nameProperty = GeneralUIUtils.getDriver().findElement(By.name("propertyName"));
- nameProperty.sendKeys(name);
- return name;
- }
-
- public static void selectRandomResourceIcon() throws Exception {
- final int webDriverWaitingTimeout = 4;
- GeneralUIUtils.moveToStep(StepsEnum.ICON);
- WebDriverWait wait = new WebDriverWait(GeneralUIUtils.getDriver(), webDriverWaitingTimeout);
- wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[contains(@data-tests-id, 'iconBox')]")));
- List<WebElement> iconElement = GeneralUIUtils.getDriver()
- .findElements(By.xpath("//*[contains(@data-tests-id, 'iconBox')]"));
- iconElement.get(0).click();
- }
-
- static void defineDefaultValueByType(String value) {
-
- WebElement valueString = GeneralUIUtils.getDriver().findElement(By.name("value"));
- valueString.clear();
- valueString.sendKeys(value);
- }
-
- static void defineBoolenDefaultValue(String value) {
-
- WebElement elementBoolean = GeneralUIUtils.getDriver().findElement(By.name("value"));
- Select se = new Select(elementBoolean);
- se.selectByValue(value);
- }
-
- public static void fillResourceGeneralInformationPage(ResourceReqDetails resource, User user, boolean isNewResource) {
- try {
- ResourceGeneralPage.defineName(resource.getName());
- ResourceGeneralPage.defineDescription(resource.getDescription());
- ResourceGeneralPage.defineCategory(resource.getCategories().get(0).getSubcategories().get(0).getName());
- ResourceGeneralPage.defineVendorName(resource.getVendorName());
- ResourceGeneralPage.defineVendorRelease(resource.getVendorRelease());
- if (isNewResource) {
- ResourceGeneralPage.defineTagsList(resource, new String[]{"This-is-tag", "another-tag", "Test-automation-tag"});
- } else {
- ResourceGeneralPage.defineTagsList(resource, new String[]{"one-more-tag"});
- }
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- public static void fillMaxValueResourceGeneralInformationPage(ResourceReqDetails resource) {
- final int stringPatternLength = 5000;
- String stringPattern = "ABCDabcd123456";
- GeneralUIUtils.addStringtoClipboard(buildStringFromPattern(stringPattern, stringPatternLength));
- ResourceGeneralPage.defineNameWithPaste();
- ResourceGeneralPage.defineDescriptionWithPaste();
- ResourceGeneralPage.defineVendorNameWithPaste();
- ResourceGeneralPage.defineVendorReleaseWithPaste();
- ResourceGeneralPage.defineTagsListWithPaste();
- GeneralUIUtils.waitForAngular();
- }
-
- public static String buildStringFromPattern(String stringPattern, int stringLength) {
- char[] chars = stringPattern.toCharArray();
- StringBuilder sb = new StringBuilder();
- Random random = new Random();
- for (int i = 0; i < stringLength; i++) {
- char c = chars[random.nextInt(chars.length)];
- sb.append(c);
- }
- return sb.toString();
- }
-
- /**
- * @deprecated Use {@link #createVF(ResourceReqDetails, User)} instead
- */
- public static void createResource(ResourceReqDetails resource, User user) throws Exception {
- createVF(resource, user);
- }
-
- public static void createVF(ResourceReqDetails resource, User user) {
- ExtentTestActions.log(Status.INFO, "Going to create a new VF.");
- createResource(resource, user, DataTestIdEnum.Dashboard.BUTTON_ADD_VF);
- }
-
- private static void createResource(ResourceReqDetails resource, User user, DataTestIdEnum.Dashboard button) {
- WebElement addVFButton;
- try {
- GeneralUIUtils.ultimateWait();
- try {
- GeneralUIUtils.hoverOnAreaByClassName("w-sdc-dashboard-card-new");
- addVFButton = GeneralUIUtils.getWebElementByTestID(button.getValue());
- } catch (Exception e) {
- File imageFilePath = GeneralUIUtils.takeScreenshot(null, SetupCDTest.getScreenshotFolder(), "Warning_" + resource.getName());
- final String absolutePath = new File(SetupCDTest.getReportFolder()).toURI().relativize(imageFilePath.toURI()).getPath();
- SetupCDTest.getExtendTest().log(Status.WARNING, "Add button is not visible after hover on import area of Home page, moving on ..." + SetupCDTest.getExtendTest().addScreenCaptureFromPath(absolutePath));
- showButtonsADD();
- addVFButton = GeneralUIUtils.getWebElementByTestID(button.getValue());
- }
- addVFButton.click();
- GeneralUIUtils.ultimateWait();
- } catch (Exception e) {
- SetupCDTest.getExtendTest().log(Status.WARNING, String.format("Exeption catched on ADD button, retrying ... "));
- GeneralUIUtils.hoverOnAreaByClassName("w-sdc-dashboard-card-new");
- GeneralUIUtils.ultimateWait();
- GeneralUIUtils.getWebElementByTestID(button.getValue()).click();
- GeneralUIUtils.ultimateWait();
- }
- fillResourceGeneralInformationPage(resource, user, true);
- resource.setVersion("0.1");
- GeneralPageElements.clickCreateButton();
- }
-
- public static void updateResource(ResourceReqDetails resource, User user) {
- ResourceGeneralPage.defineContactId(resource.getContactId());
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating General screen fields ..."));
- fillResourceGeneralInformationPage(resource, user, false);
- ResourceGeneralPage.clickUpdateButton();
- }
-
- /**
- * Click on HTML element.
- *
- * @param dataTestId
- * @throws Exception
- */
- public static void getWebElementByTestID(String dataTestId) throws Exception {
- final int webDriverWaitingTimeout = 20;
- WebDriverWait wait = new WebDriverWait(GeneralUIUtils.getDriver(), webDriverWaitingTimeout);
- WebElement element = wait
- .until(ExpectedConditions.elementToBeClickable(By.xpath("//*[@data-tests-id='" + dataTestId + "']")));
- element.click();
- // wait.until(ExpectedConditions.elemetto)
- // WebElement serviceButton =
- // GeneralUIUtils.getDriver().findElement(By.xpath("//*[@data-tests-id='"
- // + dataTestId + "']"));
- // serviceButton.
- // serviceButton.click();
- }
-
- /**
- * Import VFC
- *
- * @param user
- * @param filePath
- * @param fileName
- * @return
- * @throws Exception
- */
-
- public static void importVfc(ResourceReqDetails resourceMetaData, String filePath, String fileName, User user)
- throws Exception {
- GeneralUIUtils.ultimateWait();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating new VFC resource ", resourceMetaData.getName()));
- GeneralUIUtils.hoverOnAreaByTestId(Dashboard.IMPORT_AREA.getValue());
- GeneralUIUtils.ultimateWait();
- // Insert file to the browse dialog
- WebElement buttonVFC = GeneralUIUtils.findByText("Import VFC");
- WebElement fileInputElement = GeneralUIUtils.getInputElement(DataTestIdEnum.Dashboard.IMPORT_VFC_FILE.getValue());
- if (!buttonVFC.isDisplayed()) {
- File imageFilePath = GeneralUIUtils.takeScreenshot(null, SetupCDTest.getScreenshotFolder(), "Warning_" + resourceMetaData.getName());
- final String absolutePath = new File(SetupCDTest.getReportFolder()).toURI().relativize(imageFilePath.toURI()).getPath();
- SetupCDTest.getExtendTest().log(Status.WARNING, "VFC button not visible after hover on import area of Home page, moving on ..." + SetupCDTest.getExtendTest().addScreenCaptureFromPath(absolutePath));
- }
- try {
- fileInputElement.sendKeys(filePath + fileName);
- } catch (ElementNotVisibleException e) {
- SetupCDTest.getExtendTest().log(Status.WARNING, String.format("Exeption catched on file input, converting VFC file input to visible"));
- showButtons();
- fileInputElement.sendKeys(filePath + fileName);
- }
- // Fill the general page fields.
- GeneralUIUtils.ultimateWait();
- fillResourceGeneralInformationPage(resourceMetaData, user, true);
- GeneralPageElements.clickCreateButton();
- }
-
- public static void importVfcNoCreate(ResourceReqDetails resourceMetaData, String filePath, String fileName, User user)
- throws Exception {
- GeneralUIUtils.hoverOnAreaByTestId(Dashboard.IMPORT_AREA.getValue());
- // Insert file to the browse dialog
- WebElement buttonVFC = GeneralUIUtils.findByText("Import VFC");
- WebElement fileInputElement = GeneralUIUtils.getInputElement(DataTestIdEnum.Dashboard.IMPORT_VFC_FILE.getValue());
- if (!buttonVFC.isDisplayed()) {
- File imageFilePath = GeneralUIUtils.takeScreenshot(null, SetupCDTest.getScreenshotFolder(), "Warning_" + resourceMetaData.getName());
- final String absolutePath = new File(SetupCDTest.getReportFolder()).toURI().relativize(imageFilePath.toURI()).getPath();
- SetupCDTest.getExtendTest().log(Status.WARNING, "VFC button not visible after hover on import area of Home page, moving on ..." + SetupCDTest.getExtendTest().addScreenCaptureFromPath(absolutePath));
- }
- try {
- fileInputElement.sendKeys(filePath + fileName);
- } catch (ElementNotVisibleException e) {
- SetupCDTest.getExtendTest().log(Status.WARNING, String.format("Exeption catched on file input, converting VFC file input to visible"));
- showButtons();
- fileInputElement.sendKeys(filePath + fileName);
- }
- // Fill the general page fields.
- GeneralUIUtils.waitForLoader();
- fillResourceGeneralInformationPage(resourceMetaData, user, true);
- }
-
-
- public static void importVfFromCsar(ResourceReqDetails resourceMetaData, String filePath, String fileName, User user)
- throws Exception {
- GeneralUIUtils.ultimateWait();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating new VF asset resource %s", resourceMetaData.getName()));
- GeneralUIUtils.hoverOnAreaByTestId(Dashboard.IMPORT_AREA.getValue());
- GeneralUIUtils.ultimateWait();
- // Insert file to the browse dialog
- WebElement buttonDCAE = GeneralUIUtils.findByText("Import DCAE asset");
- WebElement fileInputElement = GeneralUIUtils.getInputElement(DataTestIdEnum.Dashboard.IMPORT_VF_FILE.getValue());
- if (!buttonDCAE.isDisplayed()) {
- File imageFilePath = GeneralUIUtils.takeScreenshot(null, SetupCDTest.getScreenshotFolder(), "Warning_" + resourceMetaData.getName());
- final String absolutePath = new File(SetupCDTest.getReportFolder()).toURI().relativize(imageFilePath.toURI()).getPath();
- SetupCDTest.getExtendTest().log(Status.WARNING, "DCAE button not visible after hover on import area of Home page, moving on ..." + SetupCDTest.getExtendTest().addScreenCaptureFromPath(absolutePath));
- }
- try {
- fileInputElement.sendKeys(filePath + fileName);
- } catch (ElementNotVisibleException e) {
- SetupCDTest.getExtendTest().log(Status.WARNING, String.format("Exeption catched on file input, converting DCAE file input to visible"));
- showButtons();
- fileInputElement.sendKeys(filePath + fileName);
- }
- // Fill the general page fields.
- GeneralUIUtils.ultimateWait();
- fillResourceGeneralInformationPage(resourceMetaData, user, true);
- GeneralPageElements.clickCreateButton(BASIC_TIMEOUT);
- //GeneralUIUtils.ultimateWait(); "don't change import of csar can take longer then 3 minutes"
- GeneralUIUtils.waitForLoader(BASIC_TIMEOUT);
- }
-
- public static void importVfFromCsarNoCreate(ResourceReqDetails resourceMetaData, String filePath, String fileName, User user)
- throws Exception {
- GeneralUIUtils.ultimateWait();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating new VF asset resource %s, Create button will not be clicked", resourceMetaData.getName()));
- GeneralUIUtils.hoverOnAreaByTestId(Dashboard.IMPORT_AREA.getValue());
- GeneralUIUtils.ultimateWait();
- // Insert file to the browse dialog
- WebElement buttonDCAE = GeneralUIUtils.findByText("Import DCAE asset");
- WebElement fileInputElement = GeneralUIUtils.getInputElement(DataTestIdEnum.Dashboard.IMPORT_VF_FILE.getValue());
- if (!buttonDCAE.isDisplayed()) {
- File imageFilePath = GeneralUIUtils.takeScreenshot(null, SetupCDTest.getScreenshotFolder(), "Warning_" + resourceMetaData.getName());
- final String absolutePath = new File(SetupCDTest.getReportFolder()).toURI().relativize(imageFilePath.toURI()).getPath();
- SetupCDTest.getExtendTest().log(Status.WARNING, "DCAE button not visible after hover on import area of Home page, moving on ..." + SetupCDTest.getExtendTest().addScreenCaptureFromPath(absolutePath));
- }
- try {
- fileInputElement.sendKeys(filePath + fileName);
- } catch (ElementNotVisibleException e) {
- SetupCDTest.getExtendTest().log(Status.WARNING, String.format("Exeption catched on file input, converting DCAE file input to visible"));
- showButtons();
- fileInputElement.sendKeys(filePath + fileName);
- }
- // Fill the general page fields.
- GeneralUIUtils.ultimateWait();
- fillResourceGeneralInformationPage(resourceMetaData, user, true);
- GeneralUIUtils.waitForLoader(BASIC_TIMEOUT);
- }
-
- public static void updateVfWithCsar(String filePath, String fileName) {
- ExtentTestActions.log(Status.INFO, "Updating VF with updated CSAR file named " + fileName);
- WebElement browseWebElement = GeneralUIUtils.getInputElement(DataTestIdEnum.GeneralElementsEnum.UPLOAD_FILE_INPUT.getValue());
- browseWebElement.sendKeys(filePath + fileName);
- GeneralUIUtils.ultimateWait();
- GeneralPageElements.clickUpdateButton();
- GeneralUIUtils.waitForLoader();
- ExtentTestActions.log(Status.INFO, "VF is updated.");
- }
-
- private static void showButtons() {
- String parentElementClassAttribute = "sdc-dashboard-import-element-container";
- WebElement fileInputElementWithVisible = GeneralUIUtils.getDriver().findElement(By.className(parentElementClassAttribute));
- GeneralUIUtils.unhideElement(fileInputElementWithVisible, parentElementClassAttribute);
- GeneralUIUtils.ultimateWait();
- SetupCDTest.getExtendTest().log(Status.WARNING, String.format("Input buttons now visible..."));
- }
-
- private static void showButtonsADD() {
- try {
- GeneralUIUtils.ultimateWait();
- String parentElementClassAttribute = "sdc-dashboard-create-element-container";
- WebElement fileInputElementWithVisible = GeneralUIUtils.getDriver().findElement(By.className(parentElementClassAttribute));
- GeneralUIUtils.unhideElement(fileInputElementWithVisible, parentElementClassAttribute);
- GeneralUIUtils.ultimateWait();
- } catch (Exception e) {
- GeneralUIUtils.ultimateWait();
- String parentElementClassAttribute = "sdc-dashboard-create-element-container";
- WebElement fileInputElementWithVisible = GeneralUIUtils.getDriver().findElement(By.className(parentElementClassAttribute));
- GeneralUIUtils.unhideElement(fileInputElementWithVisible, parentElementClassAttribute);
- GeneralUIUtils.ultimateWait();
- }
- SetupCDTest.getExtendTest().log(Status.WARNING, String.format("Input buttons now visible..."));
- }
-
- public static void clickOnElementByText(String textToClick, String customizationFoLog) {
- String customizationFoLogLocal = customizationFoLog != null ? customizationFoLog : "";
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on %s %s", textToClick, customizationFoLogLocal));
- GeneralUIUtils.clickOnElementByText(textToClick);
- }
-
- public static void createPNF(ResourceReqDetails resource, User user) throws Exception {
- ExtentTestActions.log(Status.INFO, "Going to create a new PNF");
- createResource(resource, user, DataTestIdEnum.Dashboard.BUTTON_ADD_PNF);
- }
-
- public static void createCR(ResourceReqDetails resource, User user) throws Exception {
- ExtentTestActions.log(Status.INFO, "Going to create a new CR");
- createResource(resource, user, DataTestIdEnum.Dashboard.BUTTON_ADD_CR);
- }
-
- public static ImmutablePair<String, String> getFirstRIPos(ResourceReqDetails createResourceInUI, User user) {
- String responseAfterDrag = RestCDUtils.getResource(createResourceInUI, user).getResponse();
- JSONObject jsonResource = (JSONObject) JSONValue.parse(responseAfterDrag);
- String xPosPostDrag = (String) ((JSONObject) ((JSONArray) jsonResource.get("componentInstances")).get(0))
- .get("posX");
- String yPosPostDrag = (String) ((JSONObject) ((JSONArray) jsonResource.get("componentInstances")).get(0))
- .get("posY");
- return new ImmutablePair<String, String>(xPosPostDrag, yPosPostDrag);
-
- }
-
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/RestCDUtils.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/RestCDUtils.java
deleted file mode 100644
index d5441b5476..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/RestCDUtils.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utilities;
-
-import com.aventstack.extentreports.Status;
-import org.apache.http.HttpStatus;
-import org.codehaus.jettison.json.JSONObject;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.model.Component;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.be.model.category.CategoryDefinition;
-import org.openecomp.sdc.ci.tests.config.Config;
-import org.openecomp.sdc.ci.tests.datatypes.ComponentReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.execute.setup.DriverFactory;
-import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
-import org.openecomp.sdc.ci.tests.utils.rest.CatalogRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.CategoryRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.UserRestUtils;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-public class RestCDUtils {
-
- private static final int SLEEP_DURATION = 1000;
-
- private static void setResourceUniqueIdAndUUID(ComponentReqDetails element, RestResponse getResourceResponse) {
- element.setUniqueId(ResponseParser.getUniqueIdFromResponse(getResourceResponse));
- element.setUUID(ResponseParser.getUuidFromResponse(getResourceResponse));
- }
-
- public static RestResponse getResource(ResourceReqDetails resource, User user) {
- final String getResourceMsg = "Trying to get resource named " + resource.getName() + " with version " + resource.getVersion();
- final String succeedGetResourceMsg = "Succeeded to get resource named " + resource.getName() + " with version " + resource.getVersion();
- final String failedGetResourceMsg = "Failed to get resource named " + resource.getName() + " with version " + resource.getVersion();
- try {
- ExtentTestActions.log(Status.INFO, getResourceMsg);
- System.out.println(getResourceMsg);
- GeneralUIUtils.sleep(SLEEP_DURATION);
- RestResponse getResourceResponse = null;
- String resourceUniqueId = resource.getUniqueId();
- if (resourceUniqueId != null) {
- getResourceResponse = ResourceRestUtils.getResource(resourceUniqueId);
- if (getResourceResponse.getErrorCode().intValue() == HttpStatus.SC_OK) {
- ExtentTestActions.log(Status.INFO, succeedGetResourceMsg);
- System.out.println(succeedGetResourceMsg);
- }
- return getResourceResponse;
- }
- JSONObject getResourceJSONObject = null;
- getResourceResponse = ResourceRestUtils.getResourceByNameAndVersion(user.getUserId(), resource.getName(), resource.getVersion());
- if (getResourceResponse.getErrorCode().intValue() == HttpStatus.SC_OK) {
- setResourceUniqueIdAndUUID(resource, getResourceResponse);
- ExtentTestActions.log(Status.INFO, succeedGetResourceMsg);
- System.out.println(succeedGetResourceMsg);
- return getResourceResponse;
- }
- ExtentTestActions.log(Status.INFO, failedGetResourceMsg);
- return getResourceResponse;
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- public static RestResponse getService(ServiceReqDetails service, User user) {
- final int threadSleepTime = 3500;
- try {
- Thread.sleep(threadSleepTime);
- RestResponse getServiceResponse = ServiceRestUtils.getServiceByNameAndVersion(user, service.getName(),
- service.getVersion());
- if (getServiceResponse.getErrorCode().intValue() == HttpStatus.SC_OK) {
- setResourceUniqueIdAndUUID(service, getServiceResponse);
- }
- return getServiceResponse;
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
-
- }
-
- public static String getExecutionHostAddress() {
-
- String computerName = null;
- try {
- computerName = InetAddress.getLocalHost().getHostAddress().replaceAll("\\.", "&middot;");
- System.out.println(computerName);
- if (computerName.contains(".")) {
- computerName = computerName.substring(0, computerName.indexOf(".")).toUpperCase();
- }
- } catch (UnknownHostException e) {
- System.out.println("Uknown hostAddress");
- }
- return computerName != null ? computerName : "Uknown hostAddress";
- }
-
- public static Map<String, List<Component>> getCatalogAsMap() throws IOException {
- User defaultAdminUser = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- RestResponse catalog = CatalogRestUtils.getCatalog(defaultAdminUser.getUserId());
- return ResponseParser.convertCatalogResponseToJavaObject(catalog.getResponse());
- }
-
- public static Map<String, List<CategoryDefinition>> getCategories() throws Exception {
-
- User defaultAdminUser = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
-
- Map<String, List<CategoryDefinition>> map = new HashMap<>();
-
-
- RestResponse allResourceCategories = CategoryRestUtils.getAllCategories(defaultAdminUser, ComponentTypeEnum.RESOURCE_PARAM_NAME);
- RestResponse allServiceCategories = CategoryRestUtils.getAllCategories(defaultAdminUser, ComponentTypeEnum.SERVICE_PARAM_NAME);
-
- List<CategoryDefinition> parsedResourceCategories = ResponseParser.parseCategories(allResourceCategories);
- List<CategoryDefinition> parsedServiceCategories = ResponseParser.parseCategories(allServiceCategories);
-
- map.put(ComponentTypeEnum.RESOURCE_PARAM_NAME, parsedResourceCategories);
- map.put(ComponentTypeEnum.SERVICE_PARAM_NAME, parsedServiceCategories);
-
- return map;
- }
-
-
- public static void deleteCreatedComponents(Map<String, List<Component>> map) throws IOException {
-
- System.out.println("going to delete all created components...");
-
- User defaultAdminUser = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
- final String userId = defaultAdminUser.getUserId();
-
-
- List<Component> resourcesArrayList = map.get("resources");
- List<String> collect = resourcesArrayList.stream().filter(s -> s.getName().startsWith(ElementFactory.getResourcePrefix())).
- map(e -> e.getUniqueId()).
- collect(Collectors.toList());
- for (String uId : collect) {
- ResourceRestUtils.markResourceToDelete(uId, userId);
-
- }
- ResourceRestUtils.deleteMarkedResources(userId);
-
- resourcesArrayList = map.get("services");
- collect = resourcesArrayList.stream().
- filter(e -> e != null).
- filter(e -> e.getName() != null).
- filter(s -> s.getName().startsWith(ElementFactory.getServicePrefix())).
- filter(e -> e.getUniqueId() != null).
- map(e -> e.getUniqueId()).
- collect(Collectors.toList());
- for (String uId : collect) {
- ServiceRestUtils.markServiceToDelete(uId, userId);
- }
- ServiceRestUtils.deleteMarkedServices(userId);
-
- }
-
- public static String getUserRole(User reqUser, User user) {
- try {
- RestResponse getUserRoleResp = UserRestUtils.getUserRole(reqUser, user);
- JSONObject jObject = new JSONObject(getUserRoleResp.getResponse());
- return jObject.getString("role");
- } catch (Exception e) {
- return null;
- }
- }
-
- public static RestResponse getUser(User reqUser, User user) {
- try {
- return UserRestUtils.getUser(reqUser, user);
- } catch (Exception e) {
- return null;
- }
- }
-
- /*************************************/
-
- public static void deleteOnDemand() throws IOException {
- Config config = DriverFactory.getConfig();
- if (!config.getSystemUnderDebug()) {
- deleteCreatedComponents(getCatalogAsMap());
- } else {
- System.out.println("According to configuration components will not be deleted, in case to unable option to delete, please change systemUnderDebug parameter value to false ...");
- }
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/ServiceUIUtils.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/ServiceUIUtils.java
deleted file mode 100644
index 41a540ce7b..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/ServiceUIUtils.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.utilities;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.be.model.category.CategoryDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.GeneralPageElements;
-import org.openecomp.sdc.ci.tests.pages.ServiceGeneralPage;
-import org.openqa.selenium.Keys;
-import org.openqa.selenium.WebElement;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class ServiceUIUtils {
-
- private ServiceUIUtils() {
-
- }
-
- private static void defineTagsList2(List<String> serviceTags) {
- WebElement serviceTagsTextbox = GeneralUIUtils.getWebElementByTestID("i-sdc-tag-input");
- for (String tag : serviceTags) {
- serviceTagsTextbox.clear();
- serviceTagsTextbox.sendKeys(tag);
- GeneralUIUtils.waitForAngular();
- serviceTagsTextbox.sendKeys(Keys.ENTER);
- }
- }
-
- public static void fillServiceGeneralPage(final ServiceReqDetails service) {
- SetupCDTest.getExtendTest().log(Status.INFO, "Fill in metadata values in general page");
- ServiceGeneralPage.defineName(service.getName());
- ServiceGeneralPage.defineDescription(service.getDescription());
- ServiceGeneralPage.defineCategory(service.getCategories().get(0).getName());
- ServiceGeneralPage.defineServiceFunction(service.getServiceFunction());
- ServiceGeneralPage.defineNamingPolicy(service.getNamingPolicy());
- defineTagsList2(service.getTags());
- ServiceGeneralPage.defineContactId(service.getContactId());
- GeneralUIUtils.clickSomewhereOnPage();
- }
-
- public static void createService(ServiceReqDetails service) {
- clickAddService();
- fillServiceGeneralPage(service);
- GeneralPageElements.clickCreateButton();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("The service %s was created", service.getName()));
- }
-
- public static void setServiceCategory(ServiceReqDetails service, ServiceCategoriesEnum category) {
- CategoryDefinition categoryDefinition = new CategoryDefinition();
- categoryDefinition.setName(category.getValue());
- List<CategoryDefinition> categories = new ArrayList<>();
- categories.add(categoryDefinition);
- service.setCategories(categories);
- }
-
- public static void createServiceWithDefaultTagAndUserId(ServiceReqDetails service, User user) {
- clickAddService();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Defining General Page fields"));
- ServiceGeneralPage.defineName(service.getName());
- ServiceGeneralPage.defineDescription(service.getDescription());
- ServiceGeneralPage.defineCategory(service.getCategories().get(0).getName());
- ServiceGeneralPage.defineProjectCode(service.getProjectCode());
- ServiceGeneralPage.defineInstantiationType(service.getInstantiationType());
- GeneralUIUtils.ultimateWait();
- GeneralPageElements.clickCreateButton();
- SetupCDTest.getExtendTest().log(Status.INFO, "Done creating service over the UI, "
- + "about to move into Tosca Artifacts section.");
- }
-
- public static void clickAddService() {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking the Add Service button"));
- try {
- GeneralUIUtils.hoverOnAreaByTestId(DataTestIdEnum.Dashboard.ADD_AREA.getValue());
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.Dashboard.BUTTON_ADD_SERVICE.getValue()).click();
- GeneralUIUtils.ultimateWait();
- } catch (Exception e) {
- SetupCDTest.getExtendTest().log(Status.WARNING, String.format("Exception on catched on Add Service button, retrying ..."));
- GeneralUIUtils.hoverOnAreaByClassName("w-sdc-dashboard-card-new");
- GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.Dashboard.BUTTON_ADD_SERVICE.getValue()).click();
- GeneralUIUtils.ultimateWait();
- }
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/CatalogVerificator.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/CatalogVerificator.java
deleted file mode 100644
index 470f2966b3..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/CatalogVerificator.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.verificator;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.Component;
-import org.openecomp.sdc.be.model.DistributionStatusEnum;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.model.Service;
-import org.openecomp.sdc.ci.tests.datatypes.LifeCycleStateEnum;
-import org.openecomp.sdc.ci.tests.datatypes.TypesEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.RestCDUtils;
-import org.testng.Assert;
-import org.testng.TestNGException;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-public class CatalogVerificator {
-
- private CatalogVerificator() {
-
- }
-
- public static int getResourceNumber(ResourceTypeEnum resourceType, Map<String, List<Component>> catalogAsMap) throws Exception {
- List<Component> resourcesArrayList = catalogAsMap.get("resources");
- return resourcesArrayList.stream().
- filter(s -> ((Resource) s).getResourceType().equals(resourceType)).
- collect(Collectors.toList()).size();
- }
-
- public static int getTypeNumber(TypesEnum enumtype) throws Exception {
- Map<String, List<Component>> catalogAsMap = RestCDUtils.getCatalogAsMap();
- switch (enumtype) {
- case RESOURCE:
- return catalogAsMap.get("resources").size();
- case SERVICE:
- return catalogAsMap.get("services").size();
- case PRODUCT:
- return catalogAsMap.get("products").size();
- default:
- return getResourceNumber(ResourceTypeEnum.valueOf(enumtype.name()), catalogAsMap);
- }
- }
-
- public static void validateType(TypesEnum enumtype) throws Exception {
- int numberOfElementsFromBE = getTypeNumber(enumtype);
- int numberOfElementsFromUI = getNumberOfElementsFromCatalogHeader();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Validating number of %s elements, should be %s ...", enumtype.name(), numberOfElementsFromBE));
- Assert.assertEquals(numberOfElementsFromBE, numberOfElementsFromUI, String.format("Expected : %s, Actual: %s", numberOfElementsFromBE, numberOfElementsFromUI));
- }
-
- public static int getStatusNumber(List<LifeCycleStateEnum> status) throws Exception {
- Map<String, List<Component>> catalogAsMap = RestCDUtils.getCatalogAsMap();
- return catalogAsMap.entrySet().stream().
- map(s -> s.getValue()).
- flatMap(List::stream).
- filter(s -> (s != null && status.contains(mapBeLifecycleToUIStatus(s)))).
- collect(Collectors.toList()).size();
- }
-
- public static void validateStatus(List<LifeCycleStateEnum> status, String checkboxName) throws Exception {
- int numberOfElementsFromBE = getStatusNumber(status);
- int numberOfElementsFromUI = getNumberOfElementsFromCatalogHeader();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Validating number of %s elements , should be %s ...", checkboxName, numberOfElementsFromBE));
- Assert.assertEquals(numberOfElementsFromBE, numberOfElementsFromUI, String.format("Expected : %s, Actual: %s", numberOfElementsFromBE, numberOfElementsFromUI));
- }
-
- public static int getCategoryNumber(String categoryName) throws Exception {
- Map<String, List<Component>> catalogAsMap = RestCDUtils.getCatalogAsMap();
- List<Component> serviceAndResourceList = new ArrayList<>();
- serviceAndResourceList.addAll(catalogAsMap.get("resources"));
- serviceAndResourceList.addAll(catalogAsMap.get("services"));
- List<Component> list = new ArrayList<>();
- if (!serviceAndResourceList.isEmpty()) {
- for (Component s : serviceAndResourceList) {
- if (s.getCategories().get(0).getName().equals(categoryName)) {
- list.add(s);
- }
- }
- }
- return list.size();
- }
-
- public static void validateCategory(String categoryName) throws Exception {
- //int numberOfElementsFromBE = getCategoryNumber(categoryName);
- int numberOfElementsFromUI = getNumberOfElementsFromCatalogHeader();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Validating number of %s category elements , should be %s ...", categoryName, "more or equal to 0 elements "));
- Assert.assertTrue(numberOfElementsFromUI >= 0, String.format("Expected : %s, Actual: %s", "more or equal to 0 elements ", numberOfElementsFromUI));
- }
-
- public static int getSubCategoryNumber(String categoryName, String subCategoryName) throws Exception {
- Map<String, List<Component>> catalogAsMap = RestCDUtils.getCatalogAsMap();
- List<Component> resourcesArrayList = catalogAsMap.get("resources");
- List<Component> list = new ArrayList<>();
- if (!resourcesArrayList.isEmpty()) {
- for (Component s : resourcesArrayList) {
- if (s.getCategories().get(0).getName().equalsIgnoreCase(categoryName)
- && s.getCategories().get(0).getSubcategories().get(0).getName().equalsIgnoreCase(subCategoryName)) {
- list.add(s);
- }
- }
- }
- return list.size();
- }
-
- public static void validateSubCategory(String categoryName, String subCategoryName) throws Exception {
- //int numberOfElementsFromBE = getSubCategoryNumber(categoryName, subCategoryName);
-
- int numberOfElementsFromUI = getNumberOfElementsFromCatalogHeader();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Validating number of %s/%s subcategory elements , should be %s ...", categoryName, subCategoryName, "more then 0 elements "));
- Assert.assertTrue(numberOfElementsFromUI > 0, String.format("Expected : %s, Actual: %s", "more then 0 elements ", numberOfElementsFromUI));
- }
-
- public static int getNumberOfElementsFromCatalogHeader() {
- String elementsAsString = GeneralUIUtils.getWebElementByClassName("w-sdc-dashboard-catalog-items-header").getText();
- String numberOfElementsAsString = elementsAsString.split(" ")[0];
- if (numberOfElementsAsString.equals("No")) {
- return 0;
- } else {
- return Integer.parseInt(numberOfElementsAsString);
- }
- }
-
- private static LifeCycleStateEnum mapBeLifecycleToUIStatus(Component component) {
- boolean isServiceAndDistributed = component.getComponentType().equals(ComponentTypeEnum.SERVICE)
- && ((Service) component).getDistributionStatus().equals(DistributionStatusEnum.DISTRIBUTED);
- switch (component.getLifecycleState()) {
- case CERTIFIED:
- if (isServiceAndDistributed) {
- return LifeCycleStateEnum.DISTRIBUTED;
- } else {
- return LifeCycleStateEnum.CERTIFIED;
- }
- case NOT_CERTIFIED_CHECKIN:
- return LifeCycleStateEnum.CHECKIN; //to IN DESIGN
- case NOT_CERTIFIED_CHECKOUT:
- return LifeCycleStateEnum.CHECKOUT; //to IN DESIGN
- default:
- throw new TestNGException("Missing enum value in enum converter");
- }
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/CustomizationUUIDVerificator.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/CustomizationUUIDVerificator.java
deleted file mode 100644
index 74cf0a5210..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/CustomizationUUIDVerificator.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.verificator;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import static org.testng.AssertJUnit.assertTrue;
-
-public class CustomizationUUIDVerificator {
-
- public static void validateCustomizationUUIDuniqueness(List customizationUUIDs) {
- boolean hasNoDuplicates = CustomizationUUIDVerificator.containsUnique(customizationUUIDs);
- assertTrue("There are duplicate customizationUUIDs in list", hasNoDuplicates);
- }
-
- private static <T> boolean containsUnique(List<T> list) {
- Set<T> set = new HashSet<>();
-
- for (T t : list) {
- if (!set.add(t)) {
- return false;
- }
- }
-
- return true;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/DeploymentViewVerificator.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/DeploymentViewVerificator.java
deleted file mode 100644
index 1eff6284b3..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/DeploymentViewVerificator.java
+++ /dev/null
@@ -1,346 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.verificator;
-
-import com.aventstack.extentreports.Status;
-import org.apache.commons.io.FileUtils;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.HeatMetaFirstLevelDefinition;
-import org.openecomp.sdc.ci.tests.execute.devCI.ArtifactFromCsar;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.DeploymentPage;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaDefinition;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaGroupsTopologyTemplateDefinition;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utils.ToscaParserUtils;
-import org.openqa.selenium.WebElement;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertTrue;
-
-public class DeploymentViewVerificator {
-
- //GroupPropertyEnum.getGroupPropertyNames();
- private static List<String> currentPropertiesForUI = Arrays.asList("isBase",
- "vf_module_label",
- "vf_module_description",
- "min_vf_module_instances",
- "max_vf_module_instances",
- "initial_count",
- "vf_module_type", //works as isBase property, value can be Base/Expantion
- "volume_group",
- "vfc_list",
- "availability_zone_count");
-
- //GroupPropertyEnum.getGroupPropertyNamesWithoutIsbase();
- private static List<String> currentPropertiesWithoutIsBaseForFile = Arrays.asList("vf_module_label",
- "vf_module_description",
- "min_vf_module_instances",
- "max_vf_module_instances",
- "initial_count",
- "vf_module_type", //works as isBase property, value can be Base/Expantion
- "volume_group",
- "vfc_list",
- "availability_zone_count");
-
- public static List<String> getCurrentProperties() {
- return currentPropertiesForUI;
- }
-
- static List<String> getCurrentPropertiesWithoutIsBase() {
- return currentPropertiesWithoutIsBaseForFile;
- }
-
-
- private static final String PART_TO_REPLACE = "_group";
-
- private static Map<String, HashMap<String, List<String>>> deploymentViewData = new HashMap<String, HashMap<String, List<String>>>() {
- {
- HashMap<String, List<String>> segw_heat_c3_base, segw_heat_c3_VMs1;
-
- segw_heat_c3_base = new HashMap<String, List<String>>();
- segw_heat_c3_base.put("members", Arrays.asList("segw_internet_security_group", "segw_security_group", "int_layer2vlan_net"));
- segw_heat_c3_base.put("artifacts", Arrays.asList("segw_heat_c3_base.yml", "segw_heat_c3_base.env"));
- segw_heat_c3_base.put("properties", currentPropertiesForUI);
- put("segw_heat_c3_base", segw_heat_c3_base);
- segw_heat_c3_VMs1 = new HashMap<String, List<String>>();
- segw_heat_c3_VMs1.put("members", Arrays.asList("segw_oam_protected_0_port",
- "fw_oam_int_layer2vlan_1_port",
- "segw_0", "segw_internet_1_port",
- "segw_layer2vlan_2_port",
- "fw_gn_0", "fw_gn_hsl_direct_3_port",
- "fw_oam_oam_mgmt_0_port",
- "fw_oam_hsl_direct_3_port",
- "fw_gn_oam_mgmt_0_port",
- "fw_oam_oam_direct_2_port",
- "fw_gn_gn_direct_2_port",
- "fw_oam_0",
- "fw_gn_int_layer2vlan_1_port"));
- segw_heat_c3_VMs1.put("artifacts", Arrays.asList("segw_heat_c3_VMs1.yml", "segw_heat_c3_VMs1.env"));
- segw_heat_c3_VMs1.put("properties", currentPropertiesForUI);
- put("segw_heat_c3_VMs1", segw_heat_c3_VMs1);
- }
- };
-
- private static Map<String, HashMap<String, List<String>>> deploymentViewDataMixedArtifacts = new HashMap<String, HashMap<String, List<String>>>() {
- {
- HashMap<String, List<String>> module_1_ldsa, module_2_ldsa, base_ldsa;
-
- module_1_ldsa = new HashMap<String, List<String>>();
- module_1_ldsa.put("members", Stream.of("ltm_oam_protected_0_port", "ltm_dmz_direct_0_port", "ltm_server_0").collect(Collectors.toList()));
- module_1_ldsa.put("artifacts", Stream.of("module_1_ldsa.yaml", "module_1_ldsa.env", "base_ldsa.33.yaml", "module_1_ldsa.11.yaml").collect(Collectors.toList()));
- module_1_ldsa.put("properties", currentPropertiesForUI);
- put("module_1_ldsa", module_1_ldsa);
- module_2_ldsa = new HashMap<String, List<String>>();
- module_2_ldsa.put("members", Stream.of("ltm_server_0").collect(Collectors.toList()));
- module_2_ldsa.put("artifacts", Stream.of("module_2_ldsa.yaml", "module_2_ldsa.env", "base_ldsa.3.yaml", "module_2_ldsa.22.yaml").collect(Collectors.toList()));
- module_2_ldsa.put("properties", currentPropertiesForUI);
- put("module_2_ldsa", module_2_ldsa);
- base_ldsa = new HashMap<String, List<String>>();
- base_ldsa.put("members", Stream.of("ldsa_sec_grp_1").collect(Collectors.toList()));
- base_ldsa.put("artifacts", Stream.of("base_ldsa.yaml", "module_2_ldsa.2.yaml", "module_1_ldsa.1.yaml").collect(Collectors.toList()));
- base_ldsa.put("properties", currentPropertiesForUI);
- put("base_ldsa", base_ldsa);
- }
- };
-
-
- private Map<String, HashMap<String, List<String>>> deploymentViewDataFromFile;
-
- public DeploymentViewVerificator(String pathToCsar) throws Exception {
- deploymentViewDataFromFile = buildDeploymentViewDataFromCSAR(pathToCsar);
- }
-
- public DeploymentViewVerificator() throws Exception {
- deploymentViewDataFromFile = deploymentViewDataMixedArtifacts;
- }
-
-
- public void verifyDeploymentPageSubElements(String moduleName) throws Exception {
- HashMap<String, List<String>> moduleProperties = getDeploymentViewData().get(moduleName);
-
- // add env placeholder to deployment view data
- if (!moduleProperties.get("artifacts").contains(moduleName + ".env")) {
- moduleProperties.get("artifacts").add(moduleName + ".env");
- }
-
- List<WebElement> members, artifacts, properties;
- members = DeploymentPage.getGroupMembersList(moduleName);
- artifacts = DeploymentPage.getArtifactNames();
- properties = DeploymentPage.getPropertyNames();
-
- File imageFilePath = GeneralUIUtils.takeScreenshot(moduleName + UUID.randomUUID(), SetupCDTest.getScreenshotFolder(), null);
- final String absolutePath = new File(SetupCDTest.getReportFolder()).toURI().relativize(imageFilePath.toURI()).getPath();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Validating group %s, should be %s members, %s artifacts " + SetupCDTest.getExtendTest().addScreenCaptureFromPath(absolutePath),
- moduleName, moduleProperties.get("members").size(), moduleProperties.get("artifacts").size()));
-
- assertTrue(moduleProperties.get("artifacts").size() == artifacts.size(), "Artifacts amount not as expected, expected " + moduleProperties.get("artifacts").size());
- assertTrue(moduleProperties.get("artifacts").containsAll(artifacts.stream().
- map(e -> e.getAttribute("textContent")).
- collect(Collectors.toList())));
- assertTrue(moduleProperties.get("members").size() == members.size(), "Members amount not as expected, expected " + moduleProperties.get("members").size());
- assertTrue(moduleProperties.get("members").containsAll(members.stream().
- map(e -> e.getAttribute("textContent")).
- collect(Collectors.toList())));
- assertTrue(moduleProperties.get("properties").size() == properties.size(), "Properties amount not as expected, expected " + moduleProperties.get("properties").size());
- assertTrue(moduleProperties.get("properties").containsAll(properties.stream().
- map(e -> e.getAttribute("textContent")).
- collect(Collectors.toList())));
- DeploymentPage.clickOnProperties();
- DeploymentPage.clickOnArtifacts();
- }
-
- public void verifyDeploymentPageModules(List<WebElement> modules) {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Validating VF groups , should be %s groups ", getDeploymentViewData().size()));
- assertFalse(modules.isEmpty(), "No modules found");
- assertTrue(modules.size() == getDeploymentViewData().size(), "Modules amount not as expected, expected " + getDeploymentViewData().size());
- for (WebElement module : modules) {
- assertTrue(getDeploymentViewData().containsKey(module.getText().split("\\.\\.")[1]));
- }
- }
-
- public static void verifyComponentNameChanged(String oldName, String newName) {
- final int clickingElementTimeout = 10;
- try {
- GeneralUIUtils.clickOnElementByText(oldName, clickingElementTimeout);
- assertTrue(false, "Element name don't changed");
- } catch (Exception e) {
- GeneralUIUtils.clickOnElementByText(newName);
- }
- }
-
- public Map<String, HashMap<String, List<String>>> getDeploymentViewData() {
- return getDeploymentViewDataFromFile();
- }
-
- public static Map<String, HashMap<String, List<String>>> buildDeploymentViewDataFromCSAR(String pathToCSAR) throws Exception {
- ToscaDefinition toscaDefinition = ToscaParserUtils.parseToscaMainYamlToJavaObjectByCsarLocation(new File(pathToCSAR));
- Map<String, HashMap<String, List<String>>> deploymentViewDataFromFile = new HashMap<String, HashMap<String, List<String>>>();
- Map<String, ToscaGroupsTopologyTemplateDefinition> groups = toscaDefinition.getTopology_template().getGroups();
- List<String> keyList = groups.keySet().stream().collect(Collectors.toList());
- HashMap<String, List<String>> groupsToArtifacts = getDeploymentArtifactsMappedToGroupsFromCSAR(pathToCSAR);
- for (String groupKey : keyList) {
- HashMap<String, List<String>> tempGroupMap = new HashMap<String, List<String>>();
- tempGroupMap.put("artifacts", groupsToArtifacts.get(convertAmdocsCsarGroupNameToSdcCsarGroupName(groupKey)));
- if (groups.get(groupKey).getMembers() == null) {
- tempGroupMap.put("members", Arrays.asList());
- } else {
- tempGroupMap.put("members", groups.get(groupKey).getMembers());
- }
- tempGroupMap.put("properties", currentPropertiesForUI);
- deploymentViewDataFromFile.put(convertAmdocsCsarGroupNameToSdcCsarGroupName(groupKey), tempGroupMap);
- }
- return deploymentViewDataFromFile;
- }
-
- public static HashMap<String, List<String>> getDeploymentArtifactsMappedToGroupsFromCSAR(String pathToFile) throws Exception {
- Map<String, Object> combinedMap = ArtifactFromCsar.combineHeatArtifacstWithFolderArtifacsToMap(pathToFile);
- LinkedList<HeatMetaFirstLevelDefinition> deploymentArtifacts = ((LinkedList<HeatMetaFirstLevelDefinition>) combinedMap.get("Deployment"));
-
- HashMap<String, List<String>> tempGroupMap = new HashMap<String, List<String>>();
- for (HeatMetaFirstLevelDefinition deploymentArtifact : deploymentArtifacts) {
- String groupName = deploymentArtifact.getFileName().trim().substring(0, deploymentArtifact.getFileName().indexOf("."));
- if (deploymentArtifact.getType().equals("HEAT") || deploymentArtifact.getType().equals("HEAT_NET") || deploymentArtifact.getType().equals("HEAT_VOL")) {
- List<String> list = new ArrayList<>();
- list.add(deploymentArtifact.getFileName().trim());
- tempGroupMap.put(groupName, list);
- } else {
- // update current key
- List<String> list = tempGroupMap.get(groupName);
- list.add(deploymentArtifact.getFileName().trim());
- tempGroupMap.put(groupName, list);
- }
- }
- return tempGroupMap;
- }
-
-
- public static void cleanFolders(String outputFolder) throws IOException {
- System.gc();
- FileUtils.cleanDirectory(new File(outputFolder));
- FileUtils.deleteDirectory(new File(outputFolder));
- }
-
- public static String unzipCsarFile(String pathToCsar) {
- File csarFile = new File(pathToCsar);
-
-
- File dir = new File(csarFile.getParent() + File.separator + "output" + UUID.randomUUID() + File.separator + UUID.randomUUID());
- if (!dir.exists()) {
- dir.mkdirs();
- }
-
- String outputFolder = dir.getPath();
- ArtifactFromCsar.unZip(pathToCsar, outputFolder);
- return outputFolder;
- }
-
- public static void validateEditPopoverFields(String expectedVNFName, String expectedHeatName, String expectedModuleName) {
- String VNFname = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.DeploymentScreen.RESOURCE_NAME_ON_POPOVER.getValue()).getText();
- String heatName = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.DeploymentScreen.NAME_INPUT.getValue()).getAttribute("value");
- String moduleName = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.DeploymentScreen.MODULE_NAME_ON_POPOVER.getValue()).getText();
- assertTrue(expectedVNFName.equals(VNFname), String.format("VNF name Expected: %s, Actual: %s ", expectedVNFName, VNFname));
- assertTrue(expectedHeatName.equals(heatName), String.format("HEAT name Expected: %s, Actual: %s ", expectedHeatName, heatName));
- assertTrue(expectedModuleName.equals(moduleName), String.format("Module name Expected: %s, Actual: %s ", expectedModuleName, moduleName));
- }
-
- public static void validateEditPopoverButtons(String newName, String invalidModuleName, String validModueName) {
- DeploymentPage.updateAndCancel(newName, DataTestIdEnum.DeploymentScreen.X_BUTTON);
- verifyComponentNameChanged(invalidModuleName, validModueName);
- DeploymentPage.clickOnEditIcon();
- DeploymentPage.updateAndCancel(newName, DataTestIdEnum.DeploymentScreen.CANCEL);
- verifyComponentNameChanged(invalidModuleName, validModueName);
- }
-
- public static void validateEditPopover() throws Exception {
- String moduleRowText = GeneralUIUtils.getElementsByCSS(DataTestIdEnum.DeploymentScreen.MODULES.getValue()).get(0).getText();
- DeploymentPage.clickOnModuleName(moduleRowText);
- DeploymentPage.clickOnEditIcon();
- String[] splitedModuleName = moduleRowText.split("\\.\\.");
-
- validateEditPopoverFields(splitedModuleName[0], splitedModuleName[1], splitedModuleName[2]);
-
- String newName = "kuku";
- String newModuleName = DeploymentPage.reconstructModuleName(splitedModuleName, newName);
- validateEditPopoverButtons(newName, newModuleName, moduleRowText);
- }
-
- private Map<String, HashMap<String, List<String>>> getDeploymentViewDataFromFile() {
- return deploymentViewDataFromFile;
- }
-
- public static void validateModuleNameUpadate() throws Exception {
- List<WebElement> moduleRowsFromTable = GeneralUIUtils.getElementsByCSS(DataTestIdEnum.DeploymentScreen.MODULES.getValue());
- int i = 0;
- for (WebElement moduleRow : moduleRowsFromTable) {
- String moduleRowText = moduleRow.getText();
- String updatedName = "updatedName" + i;
- DeploymentPage.updateModuleName(moduleRowText, updatedName);
- String updatedModuleName = DeploymentPage.reconstructModuleName(moduleRowText.split("\\.\\."), updatedName);
- verifyComponentNameChanged(moduleRowText, updatedModuleName);
- // Close module
- GeneralUIUtils.clickOnElementByText(updatedModuleName);
- i++;
- }
- }
-
- public static void regularDepoymentScreenVerificator(Map<String, HashMap<String, String>> metaDataFromUI, DeploymentViewVerificator verificator) throws Exception, InterruptedException {
- ResourceGeneralPage.getLeftMenu().moveToDeploymentViewScreen();
- List<WebElement> moduleRowsFromTable = GeneralUIUtils.getElementsByCSS(DataTestIdEnum.DeploymentScreen.MODULES.getValue());
- verificator.verifyDeploymentPageModules(moduleRowsFromTable);
- for (WebElement moduleRow : moduleRowsFromTable) {
- String moduleRowText = moduleRow.getText();
- String middleName = moduleRowText.split("\\.\\.")[1];
- verificator.verifyDeploymentPageSubElements(middleName);
- if (metaDataFromUI != null) {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Validating %s group version, should be %s ", moduleRowText, metaDataFromUI.get(moduleRowText.split("\\.\\.")[1])));
- String groupVersion = DeploymentPage.getGroupVersion().split(":")[1].trim();
- String increasedVersion = String.valueOf(Integer.parseInt(metaDataFromUI.get(middleName).get("version")) + 1);
- assertTrue(groupVersion.equals(increasedVersion));
- if (metaDataFromUI.get(middleName).get("moduleID") != "primary") {
- String moduleID = DeploymentPage.getModuleID();
- assertFalse(moduleID.equals(metaDataFromUI.get(middleName).get("moduleID")));
- }
- }
- // Close module
- GeneralUIUtils.clickOnElementByText(moduleRowText);
- }
- }
-
- public static String convertAmdocsCsarGroupNameToSdcCsarGroupName(String originalString) {
- return originalString.replace(PART_TO_REPLACE, "");
- }
-
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/ErrorMessageUIVerificator.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/ErrorMessageUIVerificator.java
deleted file mode 100644
index 0c834415e1..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/ErrorMessageUIVerificator.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.verificator;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.ci.tests.datatypes.ErrorMessageProperties;
-import org.openecomp.sdc.ci.tests.datatypes.enums.ErrorInfo;
-import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
-import org.testng.Assert;
-
-public class ErrorMessageUIVerificator {
-
- private static ErrorMessageProperties getErrorByType(ActionStatus errorType) {
- try {
- ErrorInfo errorInfo = ErrorValidationUtils.parseErrorConfigYaml(errorType.name());
- String messageId = errorInfo.getMessageId();
- String code = errorInfo.getCode().toString();
-
- return new ErrorMessageProperties(messageId, code);
- } catch (Exception e) {
- return null;
- }
- }
-
- public static void validateErrorMessage(ActionStatus errorMessage) {
- String errorMessageBox = null;
- try {
- //errorMessageBox = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText();
- errorMessageBox = GeneralUIUtils.getWebElementByClassName("error-message-component").getText();
- } catch (Exception e) {
- ExtentTestActions.log(Status.INFO, "Did not find an error message popup.");
- Assert.fail("Did not find an error message popup.");
- }
-
- ExtentTestActions.log(Status.INFO, "An error message raised, validating its content.");
- ErrorMessageProperties expectedResponseError = getErrorByType(errorMessage);
- Assert.assertTrue(errorMessageBox.contains(expectedResponseError.getCode()), "Error message code is not " + expectedResponseError.getCode());
- Assert.assertTrue(errorMessageBox.contains(expectedResponseError.getMessageId()), "Error message ID is not " + expectedResponseError.getMessageId());
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/PortMirroringVerificator.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/PortMirroringVerificator.java
deleted file mode 100644
index 2c980b7df2..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/PortMirroringVerificator.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.verificator;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.PortMirroringEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.PortMirroringUtils;
-import org.openqa.selenium.By;
-
-import java.awt.datatransfer.UnsupportedFlavorException;
-import java.io.IOException;
-
-import static org.testng.Assert.assertTrue;
-
-public class PortMirroringVerificator {
-
- private PortMirroringVerificator() {
- }
-
- public static void checkProxyServiceName(String serviceName, String instanceId) {
- String serviceActualName = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.CompositionRightPanel.COMPONENT_TITLE.getValue()).getText();
- String serviceExpectedName = PortMirroringUtils.createproxyinstanceservicename(serviceName, instanceId);
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Verifying the instance name is %s", serviceExpectedName));
- assertTrue(serviceActualName.equalsIgnoreCase(serviceExpectedName));
- }
-
- public static void checkProxyServiceType() {
- String serviceActualName = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.CompositionRightPanelGeneralInfo.TYPE.getValue()).getText();
- SetupCDTest.getExtendTest().log(Status.INFO, "Verifying the instance type is Service Proxy");
- assertTrue(serviceActualName.equalsIgnoreCase(PortMirroringEnum.SERVICE_PROXY_TYPE.getValue()));
- }
-
- public static void validatingProxyServiceNameAndType(String serviceName, String instanceId) {
- checkProxyServiceName(serviceName, instanceId);
- checkProxyServiceType();
- }
-
- public static void validateGeneralInfo() {
- String type = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.CompositionRightPanelGeneralInfo.TYPE.getValue()).getText();
- String resourceType = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.CompositionRightPanelGeneralInfo.RESOURCE_TYPE.getValue()).getText();
- String category = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.CompositionRightPanelGeneralInfo.CATEGORY.getValue()).getText();
- String subCategory = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.CompositionRightPanelGeneralInfo.SUB_CATEGORY.getValue()).getText();
-
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Verifying the type equals %s", PortMirroringEnum.TYPE.getValue()));
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Verifying the resource type equals %s", PortMirroringEnum.RESOURCE_TYPE.getValue()));
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Verifying the category equals %s", PortMirroringEnum.CATEGORY.getValue()));
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Verifying the sub category equals %s", PortMirroringEnum.SUB_CATEGORY.getValue()));
-
- assertTrue(type.equalsIgnoreCase(PortMirroringEnum.TYPE.getValue()));
- assertTrue(resourceType.equalsIgnoreCase(PortMirroringEnum.RESOURCE_TYPE.getValue()));
- assertTrue(category.equalsIgnoreCase(PortMirroringEnum.CATEGORY.getValue()));
- assertTrue(subCategory.equalsIgnoreCase(PortMirroringEnum.SUB_CATEGORY.getValue()));
- }
-
- public static void validateReqsAndCapsTabExist() {
- SetupCDTest.getExtendTest().log(Status.INFO, "Verifying tab reqs and caps exist for PMC element");
- GeneralUIUtils.getWebElementBy(By.xpath(DataTestIdEnum.CompositionRightPanel.REQS_AND_CAPS_TAB_XPATH.getValue())).click();
- }
-
- public static void validateElementName(String expectedName) {
- String serviceActualName = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.CompositionRightPanel.COMPONENT_TITLE.getValue()).getText();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Verifying the instance name is %s", expectedName));
- assertTrue(serviceActualName.equalsIgnoreCase(expectedName));
- }
-
- public static void validateLinkProperties() throws IOException, UnsupportedFlavorException {
- SetupCDTest.getExtendTest().log(Status.INFO, "Validate Link properties values");
- String actualNetworkRole = GeneralUIUtils.getTextValueFromWebElementByXpath(PortMirroringEnum.NETWORK_ROLE_XPATH.getValue());
- String actualNfcType = GeneralUIUtils.getTextValueFromWebElementByXpath(PortMirroringEnum.NFC_TYPE_XPATH.getValue());
- String actualPpsCapacity = GeneralUIUtils.getTextValueFromWebElementByXpath(PortMirroringEnum.PPS_CAPACITY_XPATH.getValue());
- String actualNfType = GeneralUIUtils.getTextValueFromWebElementByXpath(PortMirroringEnum.NF_TYPE_XPATH.getValue());
-
- assertTrue(actualNetworkRole.equalsIgnoreCase(PortMirroringEnum.NETWORK_ROLE_VALUE.getValue()));
- assertTrue(actualNfcType.equalsIgnoreCase(PortMirroringEnum.NFC_TYPE_VALUE.getValue()));
- assertTrue(actualPpsCapacity.equalsIgnoreCase(PortMirroringEnum.PPS_CAPACITY_VALUE.getValue()));
- assertTrue(actualNfType.equalsIgnoreCase(PortMirroringEnum.NF_TYPE_VALUE.getValue()));
- }
-
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/PropertiesAssignmentVerificator.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/PropertiesAssignmentVerificator.java
deleted file mode 100644
index 789976c362..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/PropertiesAssignmentVerificator.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.verificator;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-
-import static org.testng.Assert.assertNull;
-import static org.testng.Assert.assertTrue;
-
-public class PropertiesAssignmentVerificator {
-
- private PropertiesAssignmentVerificator() {
- }
-
- public static void validateFilteredPropertiesCount(int propertiesCount, String propertyLocation) {
- int actualPropertiesCount = GeneralUIUtils.getWebElementsListByContainsClassName(propertyLocation).size();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Validating. Expected properties count: %s , Actual: %s", propertiesCount, actualPropertiesCount));
- String errMsg = String.format("Properties amount not as expected, expected: %s ,Actual: %s", propertiesCount, actualPropertiesCount);
- assertTrue(actualPropertiesCount == propertiesCount, errMsg);
- }
-
- public static void validatePropertyValue(String expectedPropertyName, String expectedPropertyValue) {
- String actualPropertyValue = GeneralUIUtils.getWebElementByTestID(expectedPropertyName).getAttribute("value");
- assertTrue(expectedPropertyValue.equals(actualPropertyValue), String.format("Validating the value of property/input %s. Expected: %s, Actual: %s ", expectedPropertyName, expectedPropertyValue, actualPropertyValue));
- }
-
- public static void validatePropertyValueIsNull(String expectedPropertyName) {
- String actualPropertyValue = GeneralUIUtils.getWebElementByTestID(expectedPropertyName).getAttribute("value");
- assertNull(actualPropertyValue, String.format("Validating the value of property/input %s. Expected: empty, Actual: %s ", expectedPropertyName, actualPropertyValue));
- }
-
- public static void validateListPropertyValue(DataTestIdEnum.PropertiesAssignmentScreen prefix, String expectedPropertyName, String expectedPropertyValue, int index) {
- String listElement = prefix.getValue() + expectedPropertyName + "." + String.valueOf(index);
- String actualPropertyValue = GeneralUIUtils.getWebElementByTestID(listElement).getAttribute("value");
- assertTrue(expectedPropertyValue.equals(actualPropertyValue), String.format("Validating the %s list element value of property %s. Expected: %s, Actual: %s ", index, expectedPropertyName, expectedPropertyValue, actualPropertyValue));
- }
-
- public static void validateBooleanPropertyValue(String expectedPropertyName, String expectedPropertyValue) {
- String actualPropertyValue = GeneralUIUtils.getSelectedElementFromDropDown(expectedPropertyName).getText();
- assertTrue(expectedPropertyValue.equals(actualPropertyValue), String.format("Validating the value of property %s. Expected: %s, Actual: %s ", expectedPropertyName, expectedPropertyValue, actualPropertyValue));
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/PropertyVerificator.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/PropertyVerificator.java
deleted file mode 100644
index ceca7aebb5..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/PropertyVerificator.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.verificator;
-
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.enums.PropertyTypeEnum;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-
-import static org.testng.Assert.assertTrue;
-
-public class PropertyVerificator {
-
-
- private PropertyVerificator() {
- }
-
- public static void validateEditVFCPropertiesPopoverFields(PropertyTypeEnum propertyType) {
- String propertyValue = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.PropertiesPopupEnum.PROPERTY_VALUE.getValue()).getAttribute("value");
- String propertyDescription = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.PropertiesPopupEnum.PROPERTY_DESCRIPTION.getValue()).getAttribute("value");
- assertTrue(propertyType.getUpdateValue().equals(propertyValue), String.format("Property Value of type %s. Expected: %s, Actual: %s ", propertyType.getType().toString(), propertyType.getUpdateValue(), propertyValue));
- assertTrue(propertyType.getUpdateDescription().equals(propertyDescription), String.format("Property Description of type %s. Expected: %s, Actual: %s ", propertyType.getType().toString(), propertyType.getUpdateDescription(), propertyDescription));
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/ServiceVerificator.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/ServiceVerificator.java
deleted file mode 100644
index 1e6a0c37df..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/ServiceVerificator.java
+++ /dev/null
@@ -1,360 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.verificator;
-
-import com.aventstack.extentreports.Status;
-import org.json.simple.JSONArray;
-import org.json.simple.JSONObject;
-import org.json.simple.JSONValue;
-import org.openecomp.sdc.be.model.GroupInstance;
-import org.openecomp.sdc.be.model.GroupInstanceProperty;
-import org.openecomp.sdc.be.model.LifecycleStateEnum;
-import org.openecomp.sdc.be.model.Service;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.datatypes.ComponentReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum.PropertiesPopupEnum;
-import org.openecomp.sdc.ci.tests.datatypes.LifeCycleStateEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.CompositionPage;
-import org.openecomp.sdc.ci.tests.pages.DeploymentPage;
-import org.openecomp.sdc.ci.tests.pages.PropertyPopup;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.pages.ServiceGeneralPage;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.RestCDUtils;
-import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.support.ui.Select;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Random;
-import java.util.function.Predicate;
-import java.util.stream.Collectors;
-
-import static org.testng.Assert.assertTrue;
-
-public class ServiceVerificator {
-
- private static final int SLEEP_TIME = 1000;
- private static final int ARTIFACT_SECTION_OFFSET = 700;
-
- private ServiceVerificator() {
- }
-
- public static void verifyNumOfComponentInstances(ComponentReqDetails component, String version, int numOfVFC,
- User user) {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Verifing the number of components on the canvas; should be %s", numOfVFC));
- String responseAfterDrag = null;
- component.setVersion(version);
- if (component instanceof ServiceReqDetails) {
- responseAfterDrag = RestCDUtils.getService((ServiceReqDetails) component, user).getResponse();
- } else if (component instanceof ResourceReqDetails) {
- responseAfterDrag = RestCDUtils.getResource((ResourceReqDetails) component, user).getResponse();
- }
- int size = 0;
- JSONObject jsonResource = (JSONObject) JSONValue.parse(responseAfterDrag);
- if(jsonResource.get("componentInstances")!= null){
- size = ((JSONArray) jsonResource.get("componentInstances")).size();
- assertTrue(size == numOfVFC, "Expected number of componenet instances is " + numOfVFC + ", but actual is " + size);
- ExtentTestActions.log(Status.INFO, "The number of components on the canvas was verified.");
- }else{
- assertTrue(false, "Expected number of componenet instances is " + numOfVFC + ", but actual is " + size);
- }
- }
-
- public static void verifyServiceUpdatedInUI(ServiceReqDetails service) {
- assertTrue(service.getName().equals(ResourceGeneralPage.getNameText()));
- assertTrue(service.getDescription().equals(ResourceGeneralPage.getDescriptionText()));
- assertTrue(service.getCategory().equals(ServiceGeneralPage.getCategoryText()));
- assertTrue(service.getServiceFunction().equals(ServiceGeneralPage.getServiceFunctionText()));
- assertTrue(service.getNamingPolicy().equals(ServiceGeneralPage.getNamingPolicyText()));
- for(String tag: ServiceGeneralPage.getTags()){
- assertTrue(service.getTags().contains(tag));
- }
- assertTrue(service.getContactId().equals(ResourceGeneralPage.getContactIdText()));
- }
-
- public static void verifyServiceDeletedInUI(ServiceReqDetails service) throws InterruptedException {
- Thread.sleep(1000);
- List<WebElement> cardElements = GeneralUIUtils.getElementsByCSS(DataTestIdEnum.DashboardCardEnum.DASHBOARD_CARD.getValue());
- if (!(cardElements.isEmpty())){
- for (WebElement cardElement: cardElements){
- WebElement componentName = GeneralUIUtils.getElementfromElementByCSS(cardElement,
- DataTestIdEnum.DashboardCardEnum.INFO_NAME.getValue());
- WebElement componentType = GeneralUIUtils.getElementfromElementByCSS(cardElement,
- DataTestIdEnum.DashboardCardEnum.ASSET_TYPE_CSS.getValue());
-
- String componentNameStr = componentName.getAttribute("textContent").trim(),
- componentTypeStr = componentType.getAttribute("class");
-
- if (componentTypeStr.equals("S")) {
- assertTrue(!(componentNameStr.equals(service.getName())), "Deleted service was found !!!");
- }
- }
- }
- }
-
- public static void verifyServiceLifecycle(ServiceReqDetails service, User user, LifecycleStateEnum expectedLifecycleState) {
- String responseAfterDrag = RestCDUtils.getService(service, user).getResponse();
- JSONObject jsonResource = (JSONObject) JSONValue.parse(responseAfterDrag);
- String actualLifecycleState = jsonResource.get("lifecycleState").toString();
- assertTrue(expectedLifecycleState.name().equals(actualLifecycleState), "actual: " + actualLifecycleState + "-- expected: " + expectedLifecycleState);
- }
-
- public static void verifyServiceLifecycleInUI(LifeCycleStateEnum lifecycleState) {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Verfiying that service state is %s", lifecycleState.getValue()));
- GeneralUIUtils.ultimateWait();
- assertTrue(ResourceGeneralPage.getLifeCycleState().equals(lifecycleState.getValue()));
- }
-
- public static void verifyLinkCreated(ServiceReqDetails createServiceInUI, User user, int expectedRelationsSize) {
- String responseAfterDrag = RestCDUtils.getService(createServiceInUI, user).getResponse();
- JSONObject jsonResource = (JSONObject) JSONValue.parse(responseAfterDrag);
- assertTrue(((JSONArray) jsonResource.get("componentInstancesRelations")).size() == expectedRelationsSize);
-
- }
-
- public static void verifyManagmentWorkflow(String expectedName, String expectedDescription) {
- String actualName = GeneralUIUtils.getWebElementBy(By.cssSelector("div[class='text name']")).getText();
- String actualDescription = GeneralUIUtils.getWebElementBy(By.cssSelector("div[class='text description']")).getText();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Verifing name ( should be %s ) and description ( should be %s ) ", expectedName, expectedDescription));
- assertTrue(actualName.equals(expectedName) && actualDescription.equals(expectedDescription));
- }
-
- public static void verifyVersionUI(String expected) {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Verifying that version is %s", expected));
- String actualVersion = GeneralUIUtils.getSelectedElementFromDropDown(DataTestIdEnum.
- GeneralElementsEnum.VERSION_HEADER.getValue()).getText().replace("V", "");
- assertTrue(actualVersion.equals(expected), String.format("Expected version: %s, Actual version: %s", expected, actualVersion));
- }
-
- public static void verifyResourceInstanceVersionUI(String expected) {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Verifying that instance version is %s", expected));
- List<WebElement> selectedVersion = GeneralUIUtils.
- findElementsByXpath("//option[contains(@class,\"select-instance-version\") and contains (@selected, \"selected\")]");
- String actual = selectedVersion.get(0).getText();
- assertTrue(expected.equals(actual), String.format("Expected version: %s, Actual version: %s", expected, actual));
- }
-
- public static void verifyOpenTabTitle(DataTestIdEnum.CompositionScreenEnum currentTab) throws Exception {
- List<String> expectedTitles = new ArrayList<String>();
- for (String expectedTitle : currentTab.getTitle()) {
- expectedTitles.add(expectedTitle.toLowerCase());
- }
- for (WebElement actualTitle : CompositionPage.getOpenTabTitle()) {
- int indexOfTitle = expectedTitles.indexOf(actualTitle.getText().trim().toLowerCase());
- assertTrue(indexOfTitle >= 0, "Wrong title");
- expectedTitles.remove(indexOfTitle);
- }
- assertTrue(expectedTitles.size() == 0, "Missing titles in " + currentTab.getValue());
- }
-
- public static void verifyDeploymentPageSubElements(String moduleName, DeploymentViewVerificator verificatorObj) throws Exception {
-
- HashMap<String, List<String>> moduleProperties = verificatorObj.getDeploymentViewData().get(moduleName);
-
- ServiceVerificator.moveMetadataPropertiesArtifactSection(-ARTIFACT_SECTION_OFFSET);
-
- List<WebElement> artifacts, properties;
- artifacts = DeploymentPage.getArtifactNames();
- properties = DeploymentPage.getPropertyNames();
- assertTrue(moduleProperties.get("artifacts").size() == artifacts.size(), "Artifacts amount not as expected, expected " + moduleProperties.get("artifacts").size());
- assertTrue(moduleProperties.get("artifacts").containsAll(artifacts.stream().
- map(e -> e.getAttribute("textContent")).
- collect(Collectors.toList())));
- assertTrue(moduleProperties.get("properties").size() == properties.size(), "Properties amount not as expected, expected " + moduleProperties.get("properties").size());
- assertTrue(moduleProperties.get("properties").containsAll(properties.stream().
- map(e -> e.getAttribute("textContent")).
- collect(Collectors.toList())));
-
- DeploymentPage.clickOnProperties();
- DeploymentPage.clickOnArtifacts();
- ServiceVerificator.moveMetadataPropertiesArtifactSection(ARTIFACT_SECTION_OFFSET);
- }
-
- public static void verifyVFModuleCustomizationUUID(ServiceReqDetails service) throws Exception {
- final int UUIDMinimalLength = 35;
- Predicate<String> componentInstancePredicate = e -> e.length() > UUIDMinimalLength;
- List<String> customizationUUIDList = getAllVFModuleCustomizationUUIDs(service);
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Validating vfModuleCustomizationUUID uniqness ... "));
- assertTrue(customizationUUIDList.stream().allMatch(componentInstancePredicate), "vfModuleCustomizationUUID is less then 35 chars");
- CustomizationUUIDVerificator.validateCustomizationUUIDuniqueness(customizationUUIDList);
- }
-
- public static List<String> getAllVFModuleCustomizationUUIDs(ServiceReqDetails service) throws Exception {
- Service serviceObj = AtomicOperationUtils.getServiceObjectByNameAndVersion(UserRoleEnum.DESIGNER, service.getName(), service.getVersion());
- List<String> customizationUUIDList = serviceObj.getComponentInstances().get(0).getGroupInstances().stream().
- map(e -> e.getCustomizationUUID()).
- collect(Collectors.toList());
-
- return customizationUUIDList;
- }
-
- public static String getVFModulePropertyValue(ServiceReqDetails service, String propertyName, String moduleName) throws Exception {
- Service serviceObj = AtomicOperationUtils.getServiceObjectByNameAndVersion(UserRoleEnum.DESIGNER, service.getName(), service.getVersion());
- List<GroupInstance> groupInstances = serviceObj.getComponentInstances().get(0).getGroupInstances();
- List<GroupInstanceProperty> groupInstancesProperties = groupInstances.stream().
- filter(e -> e.getName().equals(moduleName)).
- findFirst().
- get().
- convertToGroupInstancesProperties();
- String propertyValue = groupInstancesProperties.stream().
- filter(e -> e.getName().equals(propertyName)).
- findFirst().
- get().
- getValue();
- return propertyValue;
- }
-
- public static boolean isEqualCustomizationUUIDsAfterChanges(List<String> listBefore, List<String> listAfter) {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Validating if vfModuleCustomizationUUID changed after certification ... "));
- return (listBefore.size() == listAfter.size()) && (listBefore.containsAll(listAfter));
- }
-
- public static void verifyDisabledServiceProperties() throws Exception {
- List<String> propertiesForCheck = Arrays.asList("isBase", "vf_module_type", "vf_module_label", "vf_module_description");
- List<PropertiesPopupEnum> popupElementsForCheck = Arrays.asList(PropertiesPopupEnum.PROPERTY_NAME,
- PropertiesPopupEnum.PROPERTY_DESCRIPTION,
- PropertiesPopupEnum.PROPERTY_TYPE,
- PropertiesPopupEnum.PROPERTY_VALUE);
- ServiceVerificator.moveMetadataPropertiesArtifactSection(-ARTIFACT_SECTION_OFFSET);
- List<WebElement> properties = DeploymentPage.getPropertyNames();
-
- for (WebElement property : properties) {
- if (propertiesForCheck.contains(property.getAttribute("textContent"))) {
- DeploymentPage.clickOnProperty(property);
- Select propertTypeElement = new Select(GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.PropertiesPopupEnum.PROPERTY_TYPE.getValue()));
- boolean isTypeBoolean = propertTypeElement.getFirstSelectedOption().getText().contains("boolean");
- for (PropertiesPopupEnum popupElement : popupElementsForCheck) {
- if (isTypeBoolean && popupElement == PropertiesPopupEnum.PROPERTY_VALUE) {
- assertTrue(GeneralUIUtils.checkForDisabledAttribute(DataTestIdEnum.PropertiesPopupEnum.PROPERTY_BOOLEAN_VALUE.getValue()), String.format("Element %s not disabled ", property.getText()));
- } else {
- assertTrue(GeneralUIUtils.checkForDisabledAttribute(popupElement.getValue()), String.format("Element %s not disabled ", property.getText()));
- }
- }
- new PropertyPopup().clickCancel();
- }
- }
-
- DeploymentPage.clickOnProperties();
- ServiceVerificator.moveMetadataPropertiesArtifactSection(ARTIFACT_SECTION_OFFSET);
- }
-
- public static void verifyEnabledServiceProperties() throws Exception {
- List<String> propertiesForCheck = Arrays.asList("initial_count", "max_vf_module_instances", "min_vf_module_instances");
-
- ServiceVerificator.moveMetadataPropertiesArtifactSection(-ARTIFACT_SECTION_OFFSET);
- List<WebElement> properties = DeploymentPage.getPropertyNames();
-
- ServiceVerificator.positiveFlow(propertiesForCheck, properties);
- ServiceVerificator.negativeFlow(propertiesForCheck, properties);
-
- DeploymentPage.clickOnProperties();
- ServiceVerificator.moveMetadataPropertiesArtifactSection(ARTIFACT_SECTION_OFFSET);
- }
-
- public static void positiveFlow(List<String> propertiesForCheck, List<WebElement> properties)
- throws InterruptedException {
- final int randomInteger = 100;
- int baseNumber = new Random().nextInt(randomInteger) + 2;
- for (WebElement property : properties) {
- String propertyName = property.getAttribute("textContent");
- if (propertiesForCheck.contains(propertyName)) {
- DeploymentPage.clickOnProperty(property);
- int actualNumber = 0;
- if (propertyName.equals("initial_count")) {
- actualNumber = baseNumber;
- } else if (propertyName.equals("max_vf_module_instances")) {
- actualNumber = baseNumber + 1;
- } else if (propertyName.equals("min_vf_module_instances")) {
- actualNumber = baseNumber - 1;
- }
-
- new PropertyPopup().insertPropertyDefaultValue(String.valueOf(actualNumber));
- new PropertyPopup().clickSave();
- assertTrue(DeploymentPage.getPropertyValueFromPropertiesList(propertyName).equals(String.valueOf(actualNumber)));
- }
- }
- }
-
- public static void negativeFlow(List<String> propertiesForCheck, List<WebElement> properties)
- throws Exception {
- int currentMaxValue = Integer.valueOf(DeploymentPage.getPropertyValueFromPropertiesList("max_vf_module_instances"));
- int currentMinValue = Integer.valueOf(DeploymentPage.getPropertyValueFromPropertiesList("min_vf_module_instances"));
- int currentInitialValue = Integer.valueOf(DeploymentPage.getPropertyValueFromPropertiesList("initial_count"));
- PropertyPopup propertyPopupObj = new PropertyPopup();
-
- for (WebElement property : properties) {
- String propertyName = property.getAttribute("textContent");
- if (propertiesForCheck.contains(propertyName)) {
- DeploymentPage.clickOnProperty(property);
- if (propertyName.equals("initial_count")) {
-
- propertyPopupObj.insertPropertyDefaultValue(String.valueOf(currentMaxValue + 1));
- ServiceVerificator.verifyErrorPresentAndSaveDisabled();
- propertyPopupObj.insertPropertyDefaultValue(String.valueOf(currentMinValue - 1));
- ServiceVerificator.verifyErrorPresentAndSaveDisabled();
- propertyPopupObj.insertPropertyDefaultValue(String.valueOf(0));
- ServiceVerificator.verifyErrorPresentAndSaveDisabled();
-
- } else if (propertyName.equals("max_vf_module_instances")) {
-
- propertyPopupObj.insertPropertyDefaultValue(String.valueOf(currentInitialValue - 1));
- ServiceVerificator.verifyErrorPresentAndSaveDisabled();
- propertyPopupObj.insertPropertyDefaultValue(String.valueOf(currentMinValue - 1));
- ServiceVerificator.verifyErrorPresentAndSaveDisabled();
- propertyPopupObj.insertPropertyDefaultValue(String.valueOf(0));
- verifyErrorPresentAndSaveDisabled();
-
- } else if (propertyName.equals("min_vf_module_instances")) {
-
- propertyPopupObj.insertPropertyDefaultValue(String.valueOf(currentInitialValue + 1));
- ServiceVerificator.verifyErrorPresentAndSaveDisabled();
- propertyPopupObj.insertPropertyDefaultValue(String.valueOf(currentMaxValue + 1));
- ServiceVerificator.verifyErrorPresentAndSaveDisabled();
- }
-
- new PropertyPopup().clickCancel();
- }
- }
- }
-
- public static void verifyErrorPresentAndSaveDisabled() throws Exception {
- assertTrue(DeploymentPage.isPropertySaveButtonDisabled(), "Property Save button enabled, should be disabled");
- assertTrue(DeploymentPage.getPropertyErrorValidationMessdge().size() == 1, "Error msg missing for input");
- }
-
- public static void moveMetadataPropertiesArtifactSection(int offset) throws InterruptedException {
- WebElement dragLineElement = GeneralUIUtils.getElementByCSS("div.rg-top");
- GeneralUIUtils.dragAndDropElementByY(dragLineElement, offset);
- }
-
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/ToscaValidation.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/ToscaValidation.java
deleted file mode 100644
index f6262d5131..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/ToscaValidation.java
+++ /dev/null
@@ -1,605 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.verificator;
-
-import com.aventstack.extentreports.Status;
-import fj.data.Either;
-import org.onap.sdc.tosca.parser.api.ISdcCsarHelper;
-import org.onap.sdc.toscaparser.api.Group;
-import org.onap.sdc.toscaparser.api.Property;
-import org.onap.sdc.toscaparser.api.elements.Metadata;
-import org.onap.sdc.toscaparser.api.parameters.Input;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaDefinition;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaGroupPropertyDefinition;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaGroupsTopologyTemplateDefinition;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaInputsTopologyTemplateDefinition;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaServiceGroupsMetadataDefinition;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.VfModuleDefinition;
-
-import java.lang.reflect.Field;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-public class ToscaValidation {
-
-
- private ToscaValidation() {
- }
-
- /**
- * @param expectedToscaDefinition - expected toscaDefinition object
- * @param actualToscaDefinition - actual toscaDefinition object
- * @return true if all validation success else return error map
- */
- public static Either<Boolean, Map<String, Object>> resourceToscaMetadataValidator(ToscaDefinition expectedToscaDefinition, ToscaDefinition actualToscaDefinition) {
-
- SetupCDTest.getExtendTest().log(Status.INFO, "Going to validate resource TOSCA metadata...");
- Map<String, String> expectedMetadata = expectedToscaDefinition.getMetadata();
- Map<String, String> actualMetadata = actualToscaDefinition.getMetadata();
- Either<Boolean, Map<String, Object>> resourceToscaMetadataValidator = compareStringMapData(expectedMetadata, actualMetadata);
- if (resourceToscaMetadataValidator.isLeft()) {
- SetupCDTest.getExtendTest().log(Status.INFO, "Resource TOSCA metadata verification success");
- } else {
- SetupCDTest.getExtendTest().log(Status.ERROR, "Resource TOSCA metadata verification failed" + resourceToscaMetadataValidator.right().value());
- }
- return resourceToscaMetadataValidator;
- }
-
- public static Boolean resourceToscaNodeTemplateMetadataValidator(Map<String, Map<String, String>> expectedMetadata, ToscaDefinition actualToscaDefinition) {
- boolean isTestFailed = true;
- for (String nodeTemplateName : expectedMetadata.keySet()) {
- Either<Boolean, Map<String, Object>> serviceToscaMetadataValidator = componentToscaNodeTemplateMetadataValidator(expectedMetadata.get(nodeTemplateName), actualToscaDefinition, nodeTemplateName, ComponentTypeEnum.RESOURCE, nodeTemplateName);
- if (!serviceToscaMetadataValidator.left().value()) {
- isTestFailed = false;
- }
- }
- return isTestFailed;
- }
-
- public static Either<Boolean, Map<String, Object>> vfModuleJsonFileValidator(Map<String, VfModuleDefinition> expectedVfModulesDefinitionObject, Map<String, VfModuleDefinition> actualVfModulesDefinitionObject) {
- SetupCDTest.getExtendTest().log(Status.INFO, "Going to validate vf module json file...");
- Either<Boolean, Map<String, Object>> vfModuleFileValidator = compareObjectMapData(expectedVfModulesDefinitionObject, actualVfModulesDefinitionObject);
- if (vfModuleFileValidator.isLeft()) {
- SetupCDTest.getExtendTest().log(Status.INFO, "Vf module json file verification success");
- } else {
- SetupCDTest.getExtendTest().log(Status.ERROR, "Vf module json file verification failed" + vfModuleFileValidator.right().value().toString());
- }
- return vfModuleFileValidator;
- }
-
- public static Either<Boolean, Map<String, Object>> serviceToscaMetadataValidator(Map<String, String> expectedMetadata, ToscaDefinition actualToscaDefinition) {
-
- SetupCDTest.getExtendTest().log(Status.INFO, "Going to validate service TOSCA metadata...");
- Map<String, String> actualMetadata = actualToscaDefinition.getMetadata();
- Either<Boolean, Map<String, Object>> serviceToscaMetadataValidator = compareStringMapData(expectedMetadata, actualMetadata);
- if (serviceToscaMetadataValidator.isLeft()) {
- SetupCDTest.getExtendTest().log(Status.INFO, "Service TOSCA metadata verification success");
- } else {
- SetupCDTest.getExtendTest().log(Status.ERROR, "Service TOSCA metadata verification failed" + serviceToscaMetadataValidator.right().value().toString());
- }
- return serviceToscaMetadataValidator;
- }
-
- public static Either<Boolean, Map<String, Object>> serviceToscaGroupMetadataValidator(Map<String, ToscaGroupsTopologyTemplateDefinition> expectedServiceGroup, ToscaDefinition actualToscaDefinition) {
-
- SetupCDTest.getExtendTest().log(Status.INFO, "Going to validate service TOSCA group metadata...");
- Map<String, ToscaGroupsTopologyTemplateDefinition> actualServiceGroups = actualToscaDefinition.getTopology_template().getGroups();
- Either<Boolean, Map<String, Object>> serviceToscaGroupMetadataValidator = compareServiceGroupMetadata(expectedServiceGroup, actualServiceGroups);
- if (serviceToscaGroupMetadataValidator.isLeft()) {
- SetupCDTest.getExtendTest().log(Status.INFO, "Service TOSCA group metadata verification success");
- } else {
- SetupCDTest.getExtendTest().log(Status.ERROR, "Service TOSCA group metadata verification failed" + serviceToscaGroupMetadataValidator.right().value().toString());
- }
- return serviceToscaGroupMetadataValidator;
- }
-
- private static Either<Boolean, Map<String, Object>> compareServiceGroupMetadata(Map<String, ToscaGroupsTopologyTemplateDefinition> expectedServiceGroup, Map<String, ToscaGroupsTopologyTemplateDefinition> actualServiceGroups) {
-
- Map<String, Object> errorMap = new HashMap<>();
- for (String groupName : expectedServiceGroup.keySet()) {
- if (actualServiceGroups.get(groupName) == null) {
- errorMap.put("group/module [" + groupName + "]", " does not exist in TOSCA main yaml");
- } else {
- compareServiceGroupData(expectedServiceGroup.get(groupName), actualServiceGroups.get(groupName), groupName, errorMap);
- }
- }
- if (!errorMap.isEmpty()) {
- return Either.right(errorMap);
- }
- return Either.left(true);
- }
-
- private static Either<Boolean, Map<String, Object>> compareServiceGroupData(ToscaServiceGroupsMetadataDefinition expectedServiceGroupMetadata, ToscaServiceGroupsMetadataDefinition actualServiceGroupMetadata, String groupName, Map<String, Object> errorMap) {
-
- Field[] declaredFields = expectedServiceGroupMetadata.getClass().getSuperclass().getFields();
- for (Field field : declaredFields) {
- if (!field.getName().equals("serialVersionUID")) {
- try {
- String expectedValue = (String) field.get(expectedServiceGroupMetadata);
- String actualValue = (String) field.get(actualServiceGroupMetadata);
- comparingServiceGroupMetadata(groupName, errorMap, field, expectedValue, actualValue);
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- }
- }
- }
-
- if (!errorMap.isEmpty()) {
- return Either.right(errorMap);
- }
- return Either.left(true);
- }
-
-
- // ###########################UsingParser############################
- public static Either<Boolean, Map<String, Object>> serviceToscaGroupMetadataValidatorUsingParser(Map<String, ToscaGroupsTopologyTemplateDefinition> expectedServiceGroup, List<Group> actualServiceGroups) {
-
- SetupCDTest.getExtendTest().log(Status.INFO, "Going to validate service TOSCA group metadata...");
- Either<Boolean, Map<String, Object>> serviceToscaGroupMetadataValidator = compareServiceGroupMetadataUsingParser(expectedServiceGroup, actualServiceGroups);
- if (serviceToscaGroupMetadataValidator.isLeft()) {
- SetupCDTest.getExtendTest().log(Status.INFO, "Service TOSCA group metadata verification vs. tosca parser success");
- } else {
- SetupCDTest.getExtendTest().log(Status.ERROR, "Service TOSCA group metadata verification vs. tosca parser failed" + serviceToscaGroupMetadataValidator.right().value().toString());
- }
- return serviceToscaGroupMetadataValidator;
- }
-
- private static Either<Boolean, Map<String, Object>> compareServiceGroupMetadataUsingParser(Map<String, ToscaGroupsTopologyTemplateDefinition> expectedServiceGroup, List<Group> actualServiceGroups) {
-
- Map<String, Object> errorMap = new HashMap<>();
- for (String groupName : expectedServiceGroup.keySet()) {
- Group actualGroup = getServiceToscaParserGroupFromObject(groupName, actualServiceGroups);
- if (actualGroup == null) {
- errorMap.put("group/module [" + groupName + "]", " does not exist in TOSCA main yaml");
- } else {
- compareServiceGroupDataUsingParser(expectedServiceGroup.get(groupName), actualGroup.getMetadata(), groupName, errorMap);
- }
- }
- if (!errorMap.isEmpty()) {
- return Either.right(errorMap);
- }
- return Either.left(true);
- }
-
- private static Group getServiceToscaParserGroupFromObject(String groupName, List<Group> actualServiceGroups) {
- for (Group group : actualServiceGroups) {
- if (group.getName().equals(groupName)) {
- return group;
- }
- }
- return null;
- }
-
- private static Either<Boolean, Map<String, Object>> compareServiceGroupDataUsingParser(ToscaServiceGroupsMetadataDefinition expectedServiceGroupMetadata, Metadata actualServiceGroupMetadata, String groupName, Map<String, Object> errorMap) {
-
- Field[] declaredFields = expectedServiceGroupMetadata.getClass().getSuperclass().getFields();
- for (Field field : declaredFields) {
- if (!field.getName().equals("serialVersionUID")) {
- try {
- String expectedValue = (String) field.get(expectedServiceGroupMetadata);
- String actualValue = actualServiceGroupMetadata.getValue(field.getName());
- comparingServiceGroupMetadata(groupName, errorMap, field, expectedValue, actualValue);
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- }
- }
- }
-
- if (!errorMap.isEmpty()) {
- return Either.right(errorMap);
- }
- return Either.left(true);
- }
-
- private static void comparingServiceGroupMetadata(String groupName, Map<String, Object> errorMap, Field field, String expectedValue, String actualValue) {
- if (expectedValue != null && !expectedValue.trim().equals("")) {
- if (actualValue != null) {
- Boolean result = compareStringValue(expectedValue, actualValue);
- if (!result) {
- errorMap.put("Data field [" + field.getName() + "] in group service metadata [" + groupName + "]", "expected: " + expectedValue + ", actual: " + actualValue);
- }
- } else {
- errorMap.put("Data field [" + field.getName() + "] in group service metadata [" + groupName + "]", " does not exist in actual object");
- System.out.println("Data field [" + field.getName() + "] in group service metadata [" + groupName + "] does not exist in actual object");
- }
- }
- }
-
-//############################################################################################
-
-
- // ###########################Property UsingParser############################
- public static Either<Boolean, Map<String, Object>> serviceToscaGroupPropertyValidatorUsingParser(Map<String, ToscaGroupsTopologyTemplateDefinition> expectedServiceGroup, List<Group> actualServiceGroups) {
-
- SetupCDTest.getExtendTest().log(Status.INFO, "Going to validate service TOSCA group property...");
- Either<Boolean, Map<String, Object>> serviceToscaGroupMetadataValidator = compareServiceGroupPropertyUsingParser(expectedServiceGroup, actualServiceGroups);
- if (serviceToscaGroupMetadataValidator.isLeft()) {
- SetupCDTest.getExtendTest().log(Status.INFO, "Service TOSCA group property verification vs. tosca parser success");
- } else {
- SetupCDTest.getExtendTest().log(Status.ERROR, "Service TOSCA group property verification vs. tosca parser failed" + serviceToscaGroupMetadataValidator.right().value().toString());
- }
- return serviceToscaGroupMetadataValidator;
- }
-
- private static Either<Boolean, Map<String, Object>> compareServiceGroupPropertyUsingParser(Map<String, ToscaGroupsTopologyTemplateDefinition> expectedServiceGroup, List<Group> actualServiceGroups) {
-
- Map<String, Object> errorMap = new HashMap<>();
- for (String groupName : expectedServiceGroup.keySet()) {
- Group actualGroup = getServiceToscaParserGroupFromObject(groupName, actualServiceGroups);
- if (actualGroup == null) {
- errorMap.put("group/module [" + groupName + "]", " does not exist in TOSCA main yaml");
- } else {
- compareServiceGroupPropertyUsingParser(expectedServiceGroup.get(groupName).getProperties(), actualGroup.getProperties(), groupName, errorMap);
- }
- }
- if (!errorMap.isEmpty()) {
- return Either.right(errorMap);
- }
- return Either.left(true);
- }
-
- private static Either<Boolean, Map<String, Object>> compareServiceGroupPropertyUsingParser(ToscaGroupPropertyDefinition expectedServiceGroupProperty, LinkedHashMap<String, Property> actualServiceGroupProperty, String groupName, Map<String, Object> errorMap) {
-
- Field[] declaredFields = expectedServiceGroupProperty.getClass().getDeclaredFields();
- for (Field field : declaredFields) {
- if (!field.getName().equals("serialVersionUID")) {
- try {
- String expectedValue = null;
- String actualValue = null;
- if (field.get(expectedServiceGroupProperty) != null) {
- expectedValue = field.get(expectedServiceGroupProperty).toString();
- }
- if (actualServiceGroupProperty.get(field.getName()) != null && actualServiceGroupProperty.get(field.getName()).getValue() != null) {
- actualValue = actualServiceGroupProperty.get(field.getName()).getValue().toString();
- }
- comparingServiceGroupProperty(groupName, errorMap, field, expectedValue, actualValue);
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- }
- }
- }
-
- if (!errorMap.isEmpty()) {
- return Either.right(errorMap);
- }
- return Either.left(true);
- }
-
-//############################################################################################
-
-
- //?-------
- public static Either<Boolean, Map<String, Object>> serviceToscaGroupPropertyValidator(Map<String, ToscaGroupsTopologyTemplateDefinition> expectedServiceGroup, ToscaDefinition actualToscaDefinition) {
-
- SetupCDTest.getExtendTest().log(Status.INFO, "Going to validate service TOSCA group property...");
- Map<String, ToscaGroupsTopologyTemplateDefinition> actualServiceGroups = actualToscaDefinition.getTopology_template().getGroups();
- Either<Boolean, Map<String, Object>> serviceToscaGroupPropertyValidator = compareServiceGroupProperty(expectedServiceGroup, actualServiceGroups);
- if (serviceToscaGroupPropertyValidator.isLeft()) {
- SetupCDTest.getExtendTest().log(Status.INFO, "Service TOSCA group property verification success");
- } else {
- SetupCDTest.getExtendTest().log(Status.ERROR, "Service TOSCA group property verification failed" + serviceToscaGroupPropertyValidator.right().value().toString());
- }
- return serviceToscaGroupPropertyValidator;
- }
-
- private static Either<Boolean, Map<String, Object>> compareServiceGroupProperty(Map<String, ToscaGroupsTopologyTemplateDefinition> expectedServiceGroup, Map<String, ToscaGroupsTopologyTemplateDefinition> actualServiceGroups) {
-
- Map<String, Object> errorMap = new HashMap<>();
- for (String groupName : expectedServiceGroup.keySet()) {
- if (actualServiceGroups.get(groupName) == null) {
- errorMap.put("group/module [" + groupName + "]", " does not exist in TOSCA main yaml");
- } else {
- compareServiceGroupProperty(expectedServiceGroup.get(groupName).getProperties(), actualServiceGroups.get(groupName).getProperties(), groupName, errorMap);
- }
- }
- if (!errorMap.isEmpty()) {
- return Either.right(errorMap);
- }
- return Either.left(true);
- }
-
- private static Either<Boolean, Map<String, Object>> compareServiceGroupProperty(ToscaGroupPropertyDefinition expectedServiceGroupProperty, ToscaGroupPropertyDefinition actualServiceGroupProperty, String groupName, Map<String, Object> errorMap) {
-
- Field[] declaredFields = expectedServiceGroupProperty.getClass().getDeclaredFields();
- for (Field field : declaredFields) {
- if (!field.getName().equals("serialVersionUID")) {
- try {
- String expectedValue = null;
- String actualValue = null;
- if (field.get(expectedServiceGroupProperty) != null) {
- expectedValue = field.get(expectedServiceGroupProperty).toString();
- }
- if (field.get(actualServiceGroupProperty) != null) {
- actualValue = field.get(actualServiceGroupProperty).toString();
- }
- comparingServiceGroupProperty(groupName, errorMap, field, expectedValue, actualValue);
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- }
- }
- }
-
- if (!errorMap.isEmpty()) {
- return Either.right(errorMap);
- }
- return Either.left(true);
- }
-
- private static void comparingServiceGroupProperty(String groupName, Map<String, Object> errorMap, Field field, String expectedValue, String actualValue) {
- if (expectedValue != null && !expectedValue.trim().equals("")) {
- if (actualValue != null) {
- Boolean result = compareStringValue(expectedValue, actualValue);
- if (!result) {
- errorMap.put("Data field [" + field.getName() + "] in group service property [" + groupName + "]", "expected: " + expectedValue + ", actual: " + actualValue);
- }
- } else {
- errorMap.put("Data field [" + field.getName() + "] in group service property [" + groupName + "]", " does not exist in actual object");
- System.out.println("Data field [" + field.getName() + "] in group service property [" + groupName + "] does not exist in actual object");
- }
- }
- }
-
-
- // ----------------------------------
- public static Either<Boolean, Map<String, Object>> componentToscaNodeTemplateMetadataValidator(Map<String, String> expectedMetadata, ToscaDefinition actualToscaDefinition, String nodeTemplateName, ComponentTypeEnum componentType, String componentName) {
-
- SetupCDTest.getExtendTest().log(Status.INFO, "Going to validate " + componentName + " " + componentType.getValue() + " node template TOSCA metadata...");
- Map<String, String> actualMetadata = actualToscaDefinition.getTopology_template().getNode_templates().get(nodeTemplateName).getMetadata();
- Either<Boolean, Map<String, Object>> componentToscaMetadataValidator = compareStringMapData(expectedMetadata, actualMetadata);
- if (componentToscaMetadataValidator.isLeft()) {
- SetupCDTest.getExtendTest().log(Status.INFO, " " + componentName + " " + componentType.getValue() + "TOSCA node template metadata verification success");
- } else {
- SetupCDTest.getExtendTest().log(Status.ERROR, " " + componentName + " " + componentType.getValue() + "TOSCA node template metadata verification failed" + componentToscaMetadataValidator.right().value().toString());
- }
- return componentToscaMetadataValidator;
- }
-
- public static Either<Boolean, Map<String, Object>> serviceToscaMetadataValidatorAgainstParser(Map<String, String> expectedMetadata, Metadata actualMetadata) {
-
- SetupCDTest.getExtendTest().log(Status.INFO, "Going to validate service TOSCA metadata...");
-
- Either<Boolean, Map<String, Object>> serviceToscaMetadataValidator = compareMetadataUsingToscaParser(expectedMetadata, actualMetadata);
- if (serviceToscaMetadataValidator.isLeft()) {
- SetupCDTest.getExtendTest().log(Status.INFO, "Service TOSCA metadata verification vs. tosca parser success");
- } else {
- SetupCDTest.getExtendTest().log(Status.ERROR, "Service TOSCA metadata verification vs. tosca parser failed" + serviceToscaMetadataValidator.right().value().toString());
- }
- return serviceToscaMetadataValidator;
- }
-
-
- private static Either<Boolean, Map<String, Object>> compareStringMapData(Map<String, String> expectedMetadata, Map<String, String> actualMetadata) {
- Either.left(false);
- Map<String, Object> errorMap = new HashMap<>();
- for (String key : expectedMetadata.keySet()) {
- boolean isError = compareStringValue(expectedMetadata.get(key), actualMetadata.get(key));
- if (!isError) {
- errorMap.put("Data key[" + key + "]", "expected: " + expectedMetadata.get(key) + ", actual: " + actualMetadata.get(key));
- }
- }
- if (!errorMap.isEmpty()) {
- return Either.right(errorMap);
- }
- return Either.left(true);
- }
-
-
- private static Either<Boolean, Map<String, Object>> compareObjectMapData(Map<String, VfModuleDefinition> expectedObject, Map<String, VfModuleDefinition> actualObject) {
- Map<String, Object> errorMap = new HashMap<>();
- for (String key : expectedObject.keySet()) {
- boolean isError = compareObjectValue(expectedObject.get(key), actualObject.get(key));
- if (!isError) {
- errorMap.put("Data key[" + key + "]", "expected: " + expectedObject.get(key) + ", actual: " + actualObject.get(key));
- }
- }
- if (!errorMap.isEmpty()) {
- return Either.right(errorMap);
- }
- return Either.left(true);
- }
-
- private static boolean compareObjectValue(VfModuleDefinition expected, VfModuleDefinition actual) {
- return expected.equals(actual);
- }
-
- private static Either<Boolean, Map<String, Object>> compareMetadataUsingToscaParser(Map<String, String> expectedMetadata, Metadata actualMetadata) {
- Map<String, Object> errorMap = new HashMap<>();
- for (String key : expectedMetadata.keySet()) {
- boolean isError = compareStringValue(expectedMetadata.get(key), actualMetadata.getValue(key));
- if (!isError) {
- errorMap.put("Data key[" + key + "]", "expected: " + expectedMetadata.get(key) + ", actual: " + actualMetadata.getValue(key));
- }
- }
- if (!errorMap.isEmpty()) {
- return Either.right(errorMap);
- }
- return Either.left(true);
- }
-
- private static boolean compareStringValue(String expected, String actual) {
- return expected.equals(actual);
- }
-
- public static Either<Boolean, Map<String, Object>> toscaInputsValidator(Map<String, ToscaInputsTopologyTemplateDefinition> expectedInputs, Map<String, ToscaInputsTopologyTemplateDefinition> actualInputs) {
-
- SetupCDTest.getExtendTest().log(Status.INFO, "Going to validate TOSCA inputs...");
- Either<Boolean, Map<String, Object>> toscaInputsValidator = compareInputs(expectedInputs, actualInputs);
- if (toscaInputsValidator.isLeft()) {
- SetupCDTest.getExtendTest().log(Status.INFO, "TOSCA inputs verification success");
- } else {
- SetupCDTest.getExtendTest().log(Status.ERROR, "TOSCA inputs verification failed" + toscaInputsValidator.right().value().toString());
- }
-
- if (toscaInputsValidator.right() != null && !toscaInputsValidator.right().equals("")) {
- return toscaInputsValidator;
- }
- return Either.left(true);
- }
-
- private static Either<Boolean, Map<String, Object>> compareInputs(Map<String, ToscaInputsTopologyTemplateDefinition> expectedInputs, Map<String, ToscaInputsTopologyTemplateDefinition> actualInputs) {
-
- Map<String, Object> errorMap = new HashMap<>();
-
- for (String inputName : expectedInputs.keySet()) {
- if (actualInputs.get(inputName) == null) {
- errorMap.put("input [" + inputName + "]", " does not exist in TOSCA main yaml");
- } else {
- compareInputData(expectedInputs.get(inputName), actualInputs.get(inputName), errorMap);
- }
- }
- if (!errorMap.isEmpty()) {
- return Either.right(errorMap);
- }
- return Either.left(true);
- }
-
- private static Either<Boolean, Map<String, Object>> compareInputData(ToscaInputsTopologyTemplateDefinition expectedInputDefinition, ToscaInputsTopologyTemplateDefinition actualInputDefinition, Map<String, Object> errorMap) {
-
- Field[] declaredFields = expectedInputDefinition.getClass().getDeclaredFields();
- for (Field field : declaredFields) {
- try {
- Object expectedValue = field.get(expectedInputDefinition);
- Object actualValue = field.get(actualInputDefinition);
-// verification exclude fields as (immutable, hidden, constraints, entry_schema) according Renana
- if (expectedValue != null && !expectedValue.toString().trim().equals("") && field.getName() != "name" && field.getName() != "immutable" && field.getName() != "hidden" && field.getName() != "constraints" && field.getName() != "entry_schema" && field.getName() != "required") {
- if (actualValue != null) {
- compareInputValue(expectedInputDefinition, errorMap, field, expectedValue, actualValue);
- } else {
- errorMap.put("Data field [" + field.getName() + "] in input [" + expectedInputDefinition.getName() + "]", " does not exist in actual object");
- System.out.println("Data field [" + field.getName() + "] in input [" + expectedInputDefinition.getName() + "] does not exist in actual object");
- }
- }
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- }
- }
-
- if (!errorMap.isEmpty()) {
- return Either.right(errorMap);
- }
- return Either.left(true);
- }
-
- private static void compareInputValue(ToscaInputsTopologyTemplateDefinition expectedInputDefinition, Map<String, Object> errorMap, Field field, Object expectedValue, Object actualValue) {
- if (field.getName().equals("value") || field.getName().equals("Default")) {
- switch (expectedInputDefinition.getType()) {
- case "string":
- if (!expectedValue.toString().replace("\n", " ").replaceAll("( +)", " ").equals(actualValue.toString().replace("\n", " ").replaceAll("( +)", " "))) {
- errorMap.put("Data field [" + field.getName() + "] in input [" + expectedInputDefinition.getName() + "]", "expected: " + expectedValue + ", actual: " + actualValue);
- System.out.println("Data field [" + field.getName() + "] in input [" + expectedInputDefinition.getName() + "]: expected: " + expectedValue + ", actual: " + actualValue);
- }
- break;
- case "float":
- float newExpectedValue = convertObjectToFloat(expectedValue);
- float newActualValue = convertObjectToFloat(actualValue);
- if (newExpectedValue != newActualValue) {
- errorMap.put("Data field [" + field.getName() + "] in input [" + expectedInputDefinition.getName() + "]", "expected: " + newExpectedValue + ", actual: " + newActualValue);
- System.out.println("Data field [" + field.getName() + "] in input [" + expectedInputDefinition.getName() + "]: expected: " + newExpectedValue + ", actual: " + newActualValue);
- }
- break;
- case "boolean":
- if (!expectedValue.toString().equalsIgnoreCase(actualValue.toString())) {
- errorMap.put("Data field [" + field.getName() + "] in input [" + expectedInputDefinition.getName() + "]", "expected: " + expectedValue + ", actual: " + actualValue);
- System.out.println("Data field [" + field.getName() + "] in input [" + expectedInputDefinition.getName() + "]: expected: " + expectedValue + ", actual: " + actualValue);
- }
- break;
- case "list":
- expectedInputDefinition.getEntry_schema().get("type");
- break;
- case "map":
-
- break;
- default:
- break;
- }
-
-
- } else {
- if (!expectedValue.equals(actualValue)) {
- errorMap.put("Data field [" + field.getName() + "] in input [" + expectedInputDefinition.getName() + "]", "expected: " + expectedValue + ", actual: " + actualValue);
- System.out.println("Data field [" + field.getName() + "] in input [" + expectedInputDefinition.getName() + "]: expected: " + expectedValue + ", actual: " + actualValue);
- }
- }
-
- }
-
-
- private static float convertObjectToFloat(Object object) {
-
- float floatValue = 0;
-
- if (object instanceof Integer) {
- floatValue = ((Integer) object).floatValue();
- }
- if (object instanceof Double) {
- floatValue = ((Double) object).floatValue();
- }
- if (object instanceof Float) {
- floatValue = ((Float) object).floatValue();
- }
- if (object instanceof String) {
- floatValue = Float.parseFloat(object.toString());
- }
-
- if (object instanceof Long) {
- floatValue = ((Long) object).floatValue();
- }
- return floatValue;
- }
-
- public static Either<Boolean, Map<String, Object>> toscaInputsValidatorAgainstParser(Map<String, ToscaInputsTopologyTemplateDefinition> expectedInputsMap, ISdcCsarHelper fdntCsarHelper) {
- SetupCDTest.getExtendTest().log(Status.INFO, "Going to convert tosca parser inputs output to ToscaInputsTopologyTemplateDefinition object...");
- if (!fdntCsarHelper.getServiceInputs().isEmpty()) {
- if (expectedInputsMap != null && !expectedInputsMap.isEmpty()) {
- return Either.left(true);
- } else {
- Map<String, Object> errorMap = new HashMap<>();
- errorMap.put("Inputs", " do not exist on actual service");
- SetupCDTest.getExtendTest().log(Status.INFO, "Inputs do not exist on actual service csar");
- return Either.right(errorMap);
- }
- }
- Map<String, ToscaInputsTopologyTemplateDefinition> actualInputsMap = convertInputsParserOutputToMap(fdntCsarHelper);
- return toscaInputsValidator(expectedInputsMap, actualInputsMap);
- }
-
- /**
- * @param fdntCsarHelper convert list of inputs return from tosca parser to map of ToscaInputsTopologyTemplateDefinition
- * @return field.get(actualServiceGroupProperty)
- */
- private static Map<String, ToscaInputsTopologyTemplateDefinition> convertInputsParserOutputToMap(ISdcCsarHelper fdntCsarHelper) {
- Map<String, ToscaInputsTopologyTemplateDefinition> actualInputsMap = new HashMap<>();
- List<Input> serviceInputs = fdntCsarHelper.getServiceInputs();
- for (Input input : serviceInputs) {
- ToscaInputsTopologyTemplateDefinition actualInputDefinition = new ToscaInputsTopologyTemplateDefinition();
- actualInputDefinition.setDefault(input.getDefault());
- actualInputDefinition.setType(input.getType());
- actualInputDefinition.setDescription(input.getDescription());
- actualInputsMap.put(input.getName(), actualInputDefinition);
- }
- return actualInputsMap;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/UserManagementVerificator.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/UserManagementVerificator.java
deleted file mode 100644
index 533899eed1..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/UserManagementVerificator.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.verificator;
-
-import com.aventstack.extentreports.Status;
-import org.apache.commons.lang3.text.WordUtils;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.pages.AdminGeneralPage;
-import org.openecomp.sdc.ci.tests.utilities.RestCDUtils;
-import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
-import org.openqa.selenium.WebElement;
-import org.testng.Assert;
-
-import java.util.Arrays;
-import java.util.List;
-
-public class UserManagementVerificator {
-
- private UserManagementVerificator() {
- }
-
- public static void validateUserCreated(String userId, UserRoleEnum role) {
-
- ExtentTestActions.log(Status.INFO, "Validating that a new user is created and displayed in the first row in the table.");
-
- final int firstRow = 0;
-
- WebElement actualFirstName = AdminGeneralPage.getUserManagementTab().getFirstName(firstRow);
- WebElement actualLastName = AdminGeneralPage.getUserManagementTab().getLastName(firstRow);
- WebElement actualUserId = AdminGeneralPage.getUserManagementTab().getUserId(firstRow);
- WebElement actualEmail = AdminGeneralPage.getUserManagementTab().getEmail(firstRow);
- WebElement actualRole = AdminGeneralPage.getUserManagementTab().getRole(firstRow);
- WebElement actualLastActive = AdminGeneralPage.getUserManagementTab().getLastActive(firstRow);
-
-
- String actualFirstNameText = actualFirstName.getText();
- String actualLastNameText = actualLastName.getText();
- String actualUserIdText = actualUserId.getText();
- String actualEmailText = actualEmail.getText();
- String actualRoleText = actualRole.getText();
- String actualLastActiveText = actualLastActive.getText();
-
- Assert.assertTrue(actualFirstNameText.equals("---"), "Actual first name is not '---'.");
- Assert.assertTrue(actualLastNameText.equals("---"), "Actual last name is not '---'.");
- Assert.assertTrue(actualUserIdText.equals(userId), "Actual user id is not " + userId);
- Assert.assertTrue(actualEmailText.equals("---"), "Actual email is not '---'.");
- Assert.assertTrue(actualRoleText.equals(WordUtils.capitalize(role.name().toLowerCase())), "Actual role is not " + role.name());
- Assert.assertTrue(actualLastActiveText.equals("Waiting"), "Actual role is not 'Waiting'.");
- }
-
-
- public static void validateUserRoleUpdated(int rowIndx, UserRoleEnum updatedRole) {
- ExtentTestActions.log(Status.INFO, "Validating role is updated to " + updatedRole.name() + " in UI.");
- WebElement actualRole = AdminGeneralPage.getUserManagementTab().getRole(rowIndx);
- String actualRoleText = actualRole.getText();
- Assert.assertTrue(actualRoleText.equals(WordUtils.capitalize(updatedRole.name().toLowerCase())), "Actual role is not " + updatedRole.name());
- }
-
- public static void validateUserRoleUpdatedViaRest(User reqUser, User user, UserRoleEnum expectedUserRole) {
- try {
- ExtentTestActions.log(Status.INFO, "Validating role is updated to " + expectedUserRole.name() + " in BE.");
- String actualUserRole = RestCDUtils.getUserRole(reqUser, user);
- Assert.assertTrue(expectedUserRole.name().toLowerCase().equals(actualUserRole.toLowerCase()), "User role is not updated.");
- } catch (Exception e) {
- Assert.fail("The actual user role is null");
- }
- }
-
- public static void validateUserNotFoundViaRest(User reqUser, User user) {
- try {
- ExtentTestActions.log(Status.INFO, "Validating user " + reqUser.getUserId() + " is not found in BE.");
- RestResponse getUserResp = RestCDUtils.getUser(reqUser, user);
- ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.USER_INACTIVE.name(), Arrays.asList(reqUser.getUserId()), getUserResp.getResponse());
- } catch (Exception e) {
- Assert.fail("The response message does not describe the user is not found.");
- }
- }
-
- public static void validateUserIdNotFound(String userId) {
- ExtentTestActions.log(Status.INFO, "Validating that user " + userId + " is not found.");
- AdminGeneralPage.getUserManagementTab().searchUser(userId);
- List<WebElement> rows = AdminGeneralPage.getUserManagementTab().getAllRowsDisplayed();
- Assert.assertEquals(rows.size(), 0, String.format("There are %s rows instead of none.", rows.size()));
- }
-
- public static void validateOnlySingleRowDisplayed() {
- ExtentTestActions.log(Status.INFO, "Validating that only a single row is displayed in table.");
- List<WebElement> rows = AdminGeneralPage.getUserManagementTab().getAllRowsDisplayed();
- Assert.assertEquals(rows.size(), 1, String.format("There are %s rows instead of %s.", rows.size(), 1));
- }
-
- public static void validateRowDisplayedCorrectly(User user, int rowindex) {
- String role = user.getRole();
- String userId = user.getUserId();
- String firstName = user.getFirstName();
- String lastName = user.getLastName();
- String email = user.getEmail();
-
- ExtentTestActions.log(Status.INFO, "Validating that the row is properly displayed.");
-
- WebElement actualFirstName = AdminGeneralPage.getUserManagementTab().getFirstName(rowindex);
- WebElement actualLastName = AdminGeneralPage.getUserManagementTab().getLastName(rowindex);
- WebElement actualUserId = AdminGeneralPage.getUserManagementTab().getUserId(rowindex);
- WebElement actualEmail = AdminGeneralPage.getUserManagementTab().getEmail(rowindex);
- WebElement actualRole = AdminGeneralPage.getUserManagementTab().getRole(rowindex);
-
-
- String actualFirstNameText = actualFirstName.getText();
- String actualLastNameText = actualLastName.getText();
- String actualUserIdText = actualUserId.getText();
- String actualEmailText = actualEmail.getText();
- String actualRoleText = actualRole.getText();
-
- Assert.assertTrue(actualFirstNameText.equals(firstName), "Actual first name is not " + firstName);
- Assert.assertTrue(actualLastNameText.equals(lastName), "Actual last name is not " + lastName);
- Assert.assertTrue(actualUserIdText.equals(userId), "Actual user id is not " + userId);
- Assert.assertTrue(actualEmailText.contains(email), "Actual email does not contain " + email);
- Assert.assertTrue(actualRoleText.equals(WordUtils.capitalize(role.toLowerCase())), "Actual role is not " + role);
- }
-
- public static void validateFirstRowDisplayedCorrectly(User user) {
- validateRowDisplayedCorrectly(user, 0);
- }
-
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/VFCArtifactVerificator.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/VFCArtifactVerificator.java
deleted file mode 100644
index c87e5b792a..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/VFCArtifactVerificator.java
+++ /dev/null
@@ -1,347 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.verificator;
-
-import com.aventstack.extentreports.Status;
-import org.apache.http.HttpStatus;
-import org.json.simple.JSONArray;
-import org.json.simple.JSONObject;
-import org.json.simple.JSONValue;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.ci.tests.datatypes.HeatMetaFirstLevelDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.VFCArtifact;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.utilities.RestCDUtils;
-import org.testng.Assert;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-import static org.testng.Assert.assertTrue;
-
-public class VFCArtifactVerificator {
-
- private VFCArtifactVerificator() {
- }
-
- private static final String ARTIFACTS = "artifacts";
- private static final String DEPLOYMENT_ARTIFACTS = "deploymentArtifacts";
- private static List<VFCArtifact> vfcArtifactList = new ArrayList<VFCArtifact>();
- private static JSONObject jsonResource;
-
- public static void verifyVFCArtifactsNotInVFArtifactList(ResourceReqDetails resource, User user, RestResponse optionalGetResponse, Map<String, LinkedList<HeatMetaFirstLevelDefinition>> expectedArtifactMap) {
- ExtentTestActions.log(Status.INFO, "Verifying that VFC artifacts are not as part of VF artifacts.");
- LinkedList<HeatMetaFirstLevelDefinition> expectedDeploymentArtifacts = expectedArtifactMap.get(DEPLOYMENT_ARTIFACTS);
- LinkedList<HeatMetaFirstLevelDefinition> expectedInformationalArtifacts = expectedArtifactMap.get(ARTIFACTS);
-
- Map<String, Object> vfDepArtifacts = getVFDeploymentArtifacts(resource, user, optionalGetResponse);
- for (Object artifact : vfDepArtifacts.values()) {
- JSONObject acArtifact = ((JSONObject) JSONValue.parse(artifact.toString()));
- String acArtifactName = acArtifact.get("artifactName").toString();
-
- for (HeatMetaFirstLevelDefinition exDepArtifact : expectedDeploymentArtifacts) {
- assertTrue(!exDepArtifact.getType().equals(acArtifactName));
- }
- }
-
- Map<String, Object> vfInfoArtifacts = getVFInforamtionalArtifacts(resource, user, optionalGetResponse);
- for (Object artifact : vfInfoArtifacts.values()) {
- JSONObject acArtifact = ((JSONObject) JSONValue.parse(artifact.toString()));
- if (acArtifact.containsKey("artifactName")) {
- String acArtifactName = acArtifact.get("artifactName").toString();
-
- for (HeatMetaFirstLevelDefinition exInfoArtifact : expectedInformationalArtifacts) {
- assertTrue(!exInfoArtifact.getType().equals(acArtifactName));
- }
- }
-
-
- }
-
-
- }
-
- public static void verifyVfcArtifactUpdated(String instanceName, ResourceReqDetails resource, User user) {
- ExtentTestActions.log(Status.INFO, "Verifying VFC artifacts are updated.");
- List<VFCArtifact> vfcArtifactsBeforeUpdate = getVfcArtifactList();
-
- setVfcArtifactList(new ArrayList<VFCArtifact>());
- setActualVfcArtifactList(instanceName, resource, user);
-
- for (VFCArtifact artifact : vfcArtifactsBeforeUpdate) {
- String artifactnameBeforeUpdate = artifact.getArtifactname();
- for (VFCArtifact newArtifact : vfcArtifactList) {
- String artifactnameAfterUpdate = newArtifact.getArtifactname();
- if (artifactnameBeforeUpdate.equals(artifactnameAfterUpdate)) {
- String artifactUUIDAfterUpdate = newArtifact.getArtifactUUID();
- assertTrue(!artifactUUIDAfterUpdate.equals(artifact.getArtifactUUID()));
-
- int artifactVersionAfterUpdate = Integer.parseInt(newArtifact.getArtifactVersion());
- int artifactVersionBeforeUpdate = Integer.parseInt(artifact.getArtifactVersion());
- assertTrue(artifactVersionAfterUpdate == artifactVersionBeforeUpdate + 1);
-
-
- vfcArtifactList.remove(newArtifact);
-
- ExtentTestActions.log(Status.INFO, "VFC artifacts are updated and verified.");
-
- break;
- }
- }
- }
-
-
- assertTrue(vfcArtifactList.size() == 0);
-
- }
-
- public static void verifyVFCArtifactNotChanged(String instanceName, ResourceReqDetails resource, User user) {
- ExtentTestActions.log(Status.INFO, "Verifying VFC artifacts are not chaned after update.");
- List<VFCArtifact> vfcArtifactsBeforeUpdate = getVfcArtifactList();
-
- setVfcArtifactList(new ArrayList<VFCArtifact>());
- setActualVfcArtifactList(instanceName, resource, user);
-
- for (VFCArtifact artifact : vfcArtifactsBeforeUpdate) {
- String artifactnameBeforeUpdate = artifact.getArtifactname();
- for (VFCArtifact newArtifact : vfcArtifactList) {
- String artifactnameAfterUpdate = newArtifact.getArtifactname();
- if (artifactnameBeforeUpdate.equals(artifactnameAfterUpdate)) {
- String artifactUUIDAfterUpdate = newArtifact.getArtifactUUID();
- assertTrue(artifactUUIDAfterUpdate.equals(artifact.getArtifactUUID()));
-
- int artifactVersionAfterUpdate = Integer.parseInt(newArtifact.getArtifactVersion());
- int artifactVersionBeforeUpdate = Integer.parseInt(artifact.getArtifactVersion());
- assertTrue(artifactVersionAfterUpdate == artifactVersionBeforeUpdate);
-
- vfcArtifactList.remove(newArtifact);
- break;
- }
- }
- }
-
-
- assertTrue(vfcArtifactList.size() == 0);
-
- }
-
- public static void verifyNoVfcArtifacts(ResourceReqDetails resource, User user, RestResponse optionalGetResponse) {
- ExtentTestActions.log(Status.INFO, "Verifying that there are no VFC artifacts at all.");
- JSONArray jArr = getVFInstances(resource, user, optionalGetResponse);
- for (Object instanceObj : jArr) {
- JSONObject instance = (JSONObject) JSONValue.parse(instanceObj.toString());
- List<String> actualDeploymentArtifacts = getActualVfcInstanceArtifactsFromJson(DEPLOYMENT_ARTIFACTS, instance);
-
- assertTrue(actualDeploymentArtifacts == null || actualDeploymentArtifacts.size() == 0);
- }
- }
-
- public static void verifyVfcArtifacts(ResourceReqDetails resource, User user, String instanceName, Map<String, LinkedList<HeatMetaFirstLevelDefinition>> expectedArtifactMap,
- RestResponse optionalGetResponse) {
- ExtentTestActions.log(Status.INFO, "Verifying VFC artifacts for instance named " + instanceName);
-
- String exCompName = instanceName.split(".vfc.")[1].toLowerCase();
- String exName = instanceName.split(".heat.")[1].toLowerCase();
-
- JSONArray jArr = getVFInstances(resource, user, optionalGetResponse);
- int jArrSize = jArr.size();
-
- for (Object instanceObj : jArr) {
- JSONObject instance = (JSONObject) JSONValue.parse(instanceObj.toString());
- String componentName = instance.get("componentName").toString().toLowerCase();
- String name = instance.get("name").toString().toLowerCase();
-
- if (componentName.contains(exCompName) || name.toLowerCase().equals(exName)) {
-
- List<String> actualDeploymentArtifacts = getActualVfcInstanceArtifactsFromJson(DEPLOYMENT_ARTIFACTS, instance);
- LinkedList<HeatMetaFirstLevelDefinition> expectedDeploymentArtifacts = expectedArtifactMap.get(DEPLOYMENT_ARTIFACTS);
- checkVFCArtifactsExist(expectedDeploymentArtifacts, actualDeploymentArtifacts);
-
-
- List<String> actualInformationalArtifacts = getActualVfcInstanceArtifactsFromJson(ARTIFACTS, instance);
- LinkedList<HeatMetaFirstLevelDefinition> expectedInformationalArtifacts = expectedArtifactMap.get(ARTIFACTS);
- checkVFCArtifactsExist(expectedInformationalArtifacts, actualInformationalArtifacts);
-
- jArr.remove(instanceObj);
-
- ExtentTestActions.log(Status.INFO, "VFC artifacts for instance named " + instanceName + "are verified.");
-
- break;
- }
- }
-
- assertTrue(jArr.size() == jArrSize - 1, "Instance " + instanceName + " was not found and tested");
-
- }
-
-
- private static JSONArray getVFInstances(ResourceReqDetails resource, User user, RestResponse response) {
-
- jsonResource = getVFAsJsonObject(resource, user, response);
- JSONArray jArr = (JSONArray) jsonResource.get("componentInstances");
- return jArr;
- }
-
- private static Map<String, Object> getVFDeploymentArtifacts(ResourceReqDetails resource, User user, RestResponse response) {
-
- jsonResource = getVFAsJsonObject(resource, user, response);
- Map<String, Object> jArr = (Map<String, Object>) jsonResource.get(DEPLOYMENT_ARTIFACTS);
- return jArr;
- }
-
- private static Map<String, Object> getVFInforamtionalArtifacts(ResourceReqDetails resource, User user, RestResponse response) {
-
- jsonResource = getVFAsJsonObject(resource, user, response);
- Map<String, Object> jArr = (Map<String, Object>) jsonResource.get(ARTIFACTS);
- return jArr;
- }
-
- private static JSONObject getVFAsJsonObject(ResourceReqDetails resource, User user, RestResponse response) {
- if (response == null) {
- resource.setUniqueId(null);
- response = RestCDUtils.getResource(resource, user);
- assertTrue(response.getErrorCode().intValue() == HttpStatus.SC_OK);
- getVFAsJsonObject(resource, user, response);
- }
-
- String responseAfterDrag = response.getResponse();
- jsonResource = (JSONObject) JSONValue.parse(responseAfterDrag);
- return jsonResource;
- }
-
-
- private static List<String> getActualVfcInstanceArtifactsFromJson(String artifactKind, JSONObject instanceFromJson) {
- Object actualtObject = instanceFromJson.get(artifactKind);
- if (actualtObject != null) {
- JSONObject actualJsonObject = (JSONObject) JSONValue.parse(actualtObject.toString());
- List<String> actualArtifacts = (List<String>) actualJsonObject.keySet().stream().map(e -> actualJsonObject.get(e).toString()).collect(Collectors.toList());
- return actualArtifacts;
- }
- return null;
- }
-
- private static void checkVFCArtifactsExist(LinkedList<HeatMetaFirstLevelDefinition> expectedArtifacts, List<String> actualArtifacts) {
- if (expectedArtifacts == null) {
- return;
- }
-
- if (expectedArtifacts.size() != actualArtifacts.size()) {
- ExtentTestActions.log(Status.FAIL, "Expected and actual VFC artifacts lists size are not the same. Expected size: " + expectedArtifacts.size() + " , actual size: " + actualArtifacts.size());
- Assert.fail("Expected and actual VFC artifacts lists size are not the same. Expected size: " + expectedArtifacts.size() + " , actual size: " + actualArtifacts.size());
- }
-
- List<String> types = new ArrayList<String>();
- List<String> fileNames = new ArrayList<String>();
- for (HeatMetaFirstLevelDefinition exArtifact : expectedArtifacts) {
-
- fileNames.add(exArtifact.getFileName());
- types.add(exArtifact.getType());
-
- }
-
- for (int i = 0; i < actualArtifacts.size(); i++) {
- String actualArtifactsString = actualArtifacts.get(i);
- JSONObject acArtifact = ((JSONObject) JSONValue.parse(actualArtifactsString));
-
- String acArtifactFileName = acArtifact.get("artifactName").toString();
- String acArtifactType = acArtifact.get("artifactType").toString();
-
- assertTrue(types.contains(acArtifactType), "List does not contain " + acArtifactType);
- assertTrue(fileNames.contains(acArtifactFileName), "List does not contain " + acArtifactFileName);
-
- types.remove(acArtifactType);
- fileNames.remove(acArtifactFileName);
-
- }
-
- assertTrue(types.size() == 0);
- assertTrue(fileNames.size() == 0);
-
- }
-
- public static List<VFCArtifact> getVfcArtifactList() {
- return vfcArtifactList;
- }
-
-
- public static void setVfcArtifactList(List<VFCArtifact> vfcArtifactList) {
- VFCArtifactVerificator.vfcArtifactList = vfcArtifactList;
- }
-
- public static void setActualVfcArtifactList(String instanceName, ResourceReqDetails resource, User user) {
- String exCompName = instanceName.split(".vfc.")[1].toLowerCase();
- String exName = instanceName.split(".heat.")[1].toLowerCase();
-
- JSONArray jArr = getVFInstances(resource, user, null);
-
- for (Object instanceObj : jArr) {
- JSONObject instance = (JSONObject) JSONValue.parse(instanceObj.toString());
- String componentName = instance.get("componentName").toString().toLowerCase();
- String name = instance.get("name").toString().toLowerCase();
-
- if (componentName.contains(exCompName) || name.toLowerCase().equals(exName)) {
- List<String> actualDeploymentArtifacts = getActualVfcInstanceArtifactsFromJson(DEPLOYMENT_ARTIFACTS, instance);
- List<String> actualInformationalArtifacts = getActualVfcInstanceArtifactsFromJson(ARTIFACTS, instance);
-
- if (actualDeploymentArtifacts != null) {
- for (int i = 0; i < actualDeploymentArtifacts.size(); i++) {
- String actualArtifactsString = actualDeploymentArtifacts.get(i);
- JSONObject acArtifact = ((JSONObject) JSONValue.parse(actualArtifactsString));
-
- if (acArtifact.containsKey("artifactName")) {
- String acArtifactType = acArtifact.get("artifactName").toString();
- String acArtifactFileName = acArtifact.get("artifactType").toString();
- String acArtifactUUID = acArtifact.get("artifactUUID").toString();
- String acArtifactVersion = acArtifact.get("artifactVersion").toString();
-
- vfcArtifactList.add(new VFCArtifact(acArtifactType, acArtifactFileName, acArtifactUUID, acArtifactVersion));
- }
- }
- }
- if (actualInformationalArtifacts != null) {
- for (int i = 0; i < actualInformationalArtifacts.size(); i++) {
- String actualArtifactsString = actualInformationalArtifacts.get(i);
- JSONObject acArtifact = ((JSONObject) JSONValue.parse(actualArtifactsString));
-
- if (acArtifact.containsKey("artifactName")) {
- String acArtifactType = acArtifact.get("artifactName").toString();
- String acArtifactFileName = acArtifact.get("artifactType").toString();
- String acArtifactUUID = acArtifact.get("artifactUUID").toString();
- String acArtifactVersion = acArtifact.get("artifactVersion").toString();
- vfcArtifactList.add(new VFCArtifact(acArtifactType, acArtifactFileName, acArtifactUUID, acArtifactVersion));
- }
-
-
- }
- }
- }
- }
- }
-
-}
-
-
-
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/VFCverificator.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/VFCverificator.java
deleted file mode 100644
index 3c3cb8c5f4..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/VFCverificator.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.verificator;
-
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-
-import static org.testng.AssertJUnit.assertFalse;
-
-
-public class VFCverificator {
-
- private VFCverificator() {
- }
-
- public static void verifyVFCUpdatedInUI(ResourceReqDetails vf) {
- assertFalse(vf.getName().equals(ResourceGeneralPage.getNameText()));
- assertFalse(vf.getDescription().equals(ResourceGeneralPage.getDescriptionText()));
- assertFalse(vf.getVendorName().equals(ResourceGeneralPage.getVendorNameText()));
- assertFalse(vf.getVendorRelease().equals(ResourceGeneralPage.getVendorReleaseText()));
- }
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/VfModuleVerificator.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/VfModuleVerificator.java
deleted file mode 100644
index 8133c36790..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/VfModuleVerificator.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.verificator;
-
-import com.aventstack.extentreports.Status;
-import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
-import org.openecomp.sdc.be.model.ComponentInstance;
-import org.openecomp.sdc.be.model.GroupInstance;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.model.Service;
-import org.openecomp.sdc.ci.tests.datatypes.TypeHeatMetaDefinition;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaDefinition;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaGroupsTopologyTemplateDefinition;
-import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaServiceGroupsMetadataDefinition;
-
-import java.io.File;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertNotNull;
-import static org.testng.AssertJUnit.assertTrue;
-
-public class VfModuleVerificator {
-
- private VfModuleVerificator() {
- }
-
- private static final List<String> PROPERTY_TYPES = DeploymentViewVerificator.getCurrentPropertiesWithoutIsBase(); //{"vf_module_label", "min_vf_module_instances", "max_vf_module_instances", "initial_count"};
- private static final String VF_MODULE_TYPE = "org.openecomp.groups.VfModule";
-
- /**
- * compare number of groups from HEAT.meta file vs TOSCA yaml groups generated by ASDC
- *
- * @param listTypeHeatMetaDefinition - java object created from HEAT.meta file
- * @param toscaDefinition - java object created from TOSCA yaml
- */
- public static void compareNumberOfVfModules(List<TypeHeatMetaDefinition> listTypeHeatMetaDefinition, ToscaDefinition toscaDefinition) {
-
- int heatMetaGroupCount = 0;
- int toscaDefinitionGroupCount = 0;
- for (TypeHeatMetaDefinition typeHeatMetaDefinition : listTypeHeatMetaDefinition) {
- if (!typeHeatMetaDefinition.getTypeName().equals("artifacts")) {
- heatMetaGroupCount = typeHeatMetaDefinition.getGroupHeatMetaDefinition().size();
- }
- }
- toscaDefinitionGroupCount = toscaDefinition.getTopology_template().getGroups().size();
- assertEquals("Expected num of groups in HEAT.meta file is " + heatMetaGroupCount + ", but was in TOSCA yaml file " + toscaDefinitionGroupCount, heatMetaGroupCount, toscaDefinitionGroupCount);
- }
-
- /**
- * check group structure and "metadata" parameters vs data on the service object
- *
- * @param toscaDefinition
- */
- public static void verifyGroupMetadata(ToscaDefinition toscaDefinition, Service service) {
-
- Map<String, ToscaGroupsTopologyTemplateDefinition> groups = toscaDefinition.getTopology_template().getGroups();
- for (Map.Entry<String, ToscaGroupsTopologyTemplateDefinition> groupTopologyTemplateDefinition : groups.entrySet()) {
- String key = groupTopologyTemplateDefinition.getKey();
- GroupInstance groupInstanceObject = getGroupInstanceByKey(key, service);
- ToscaServiceGroupsMetadataDefinition metadata = groupTopologyTemplateDefinition.getValue();
- assertNotNull("groupInstanceObject is null", groupInstanceObject);
- assertTrue("expected vfModuleModelName " + groupInstanceObject.getGroupName() + ", actual " + metadata.getVfModuleModelName(), groupInstanceObject.getGroupName().equals(metadata.getVfModuleModelName()));
- assertTrue("expected vfModuleModelInvariantUUID " + groupInstanceObject.getInvariantUUID() + ", actual " + metadata.getVfModuleModelInvariantUUID(), groupInstanceObject.getInvariantUUID().equals(metadata.getVfModuleModelInvariantUUID()));
- assertTrue("expected vfModuleModelCustomizationUUID " + groupInstanceObject.getCustomizationUUID() + ", actual " + metadata.getVfModuleModelCustomizationUUID(), groupInstanceObject.getCustomizationUUID().equals(metadata.getVfModuleModelCustomizationUUID()));
- assertTrue("expected vfModuleModelUUID " + groupInstanceObject.getGroupUUID() + ", actual " + metadata.getVfModuleModelUUID(), groupInstanceObject.getGroupUUID().equals(metadata.getVfModuleModelUUID()));
- assertTrue("expected vfModuleModelVersion " + groupInstanceObject.getVersion() + ", actual " + metadata.getVfModuleModelVersion(), groupInstanceObject.getVersion().equals(metadata.getVfModuleModelVersion()));
- }
- }
-
-
- /**
- * @param key
- * @param service
- * @return
- */
- public static GroupInstance getGroupInstanceByKey(String key, Service service) {
- for (ComponentInstance componentInstance : service.getComponentInstances()) {
- for (GroupInstance groupInstance : componentInstance.getGroupInstances()) {
- if (key.equals(groupInstance.getName())) {
- return groupInstance;
- }
- }
- }
- return null;
- }
-
- public static void validateSpecificModulePropertiesFromRequest(Resource resource) {
- List<List<PropertyDataDefinition>> allProperties = resource.getGroups().stream().
- filter(e -> e.getType().equals(VF_MODULE_TYPE)).
- map(e -> e.getProperties()).
- collect(Collectors.toList());
- for (String propertyType : PROPERTY_TYPES) {
- int numberOfTypes = getPropertyType(allProperties, propertyType).size();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Validating VF property %s exist, Expected: %s, Actual: %s ", propertyType, allProperties.size(), numberOfTypes));
- assertTrue(numberOfTypes == allProperties.size());
- }
- }
-
- public static List<PropertyDataDefinition> getPropertyType(List<List<PropertyDataDefinition>> allProperties, String propertyType) {
- return allProperties.stream().
- flatMap(List::stream).
- filter(e -> e.getName().equals(propertyType)).
- collect(Collectors.toList());
- }
-
- public static void validateSpecificModulePropertiesFromFile(ToscaDefinition toscaDefinition) {
- List<ToscaGroupsTopologyTemplateDefinition> vfModules = toscaDefinition.
- getTopology_template().getGroups().values().stream().
- filter(e -> e.getType().equals(VF_MODULE_TYPE)).
- collect(Collectors.toList());
- for (String propertyType : PROPERTY_TYPES) {
- int numberOfTypes = (int) vfModules.stream().
- // Get all declared fields from class ToscaGroupPropertyDefinition, collect them to List and check that current property exist and declared class
- filter(e -> Arrays.asList(e.getProperties().getClass().getDeclaredFields()).stream().
- map(p -> p.getName()).
- collect(Collectors.toList()).
- contains(propertyType)
- ).
- collect(Collectors.toList()).
- size();
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Validating VF property %s exist, Expected: %s, Actual: %s ", propertyType, vfModules.size(), numberOfTypes));
- assertTrue(numberOfTypes == vfModules.size());
- }
- }
-
- public static String getTemplateFilenname(String pathToCsar) {
- File csarFile = new File(pathToCsar);
- String templateFileName = csarFile.getName().replaceAll("-csar.csar", "-template.yml");
- return templateFileName;
- }
-
-}
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/VfVerificator.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/VfVerificator.java
deleted file mode 100644
index db8d1b27e3..0000000000
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/VfVerificator.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.ci.tests.verificator;
-
-
-import com.aventstack.extentreports.Status;
-import org.apache.commons.lang3.tuple.ImmutablePair;
-import org.apache.http.HttpStatus;
-import org.json.simple.JSONArray;
-import org.json.simple.JSONObject;
-import org.json.simple.JSONValue;
-import org.openecomp.sdc.be.model.LifecycleStateEnum;
-import org.openecomp.sdc.be.model.Resource;
-import org.openecomp.sdc.be.model.User;
-import org.openecomp.sdc.be.model.category.CategoryDefinition;
-import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
-import org.openecomp.sdc.ci.tests.datatypes.LifeCycleStateEnum;
-import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
-import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
-import org.openecomp.sdc.ci.tests.datatypes.enums.PropertyTypeEnum;
-import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
-import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
-import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
-import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
-import org.openecomp.sdc.ci.tests.utilities.FileHandling;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
-import org.openecomp.sdc.ci.tests.utilities.RestCDUtils;
-import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebElement;
-import org.testng.Assert;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertTrue;
-
-public final class VfVerificator {
-
- private VfVerificator() {
- }
-
- public static void verifyNumOfComponentInstances(ResourceReqDetails createResourceInUI, int numOfVFC, User user) {
- ServiceVerificator.verifyNumOfComponentInstances(createResourceInUI, createResourceInUI.getVersion(), numOfVFC, user);
- }
-
- public static void verifyRILocationChanged(ResourceReqDetails createResourceInUI,
- ImmutablePair<String, String> prevRIPos, User user) {
-
- ImmutablePair<String, String> currRIPos = ResourceUIUtils.getFirstRIPos(createResourceInUI, user);
- assertTrue(!prevRIPos.left.equals(currRIPos.left) || !prevRIPos.right.equals(currRIPos.right));
- }
-
- public static void verifyLinkCreated(ResourceReqDetails createResourceInUI, User user, int expectedRelationsSize) {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Verifying that a link was created on canvas"));
- String responseAfterDrag = RestCDUtils.getResource(createResourceInUI, user).getResponse();
- JSONObject jsonResource = (JSONObject) JSONValue.parse(responseAfterDrag);
- assertTrue(((JSONArray) jsonResource.get("componentInstancesRelations")).size() == expectedRelationsSize);
- ExtentTestActions.log(Status.INFO, "The link was verified.");
-
- }
-
- public static void verifyVFMetadataInUI(ResourceReqDetails vf) {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Verifying fields on General screen through UI ..."));
- assertTrue(vf.getName().equals(ResourceGeneralPage.getNameText()));
- assertTrue(vf.getDescription().equals(ResourceGeneralPage.getDescriptionText()));
- assertTrue(vf.getCategories().get(0).getSubcategories().get(0).getName().equals(GeneralUIUtils.getSelectedElementFromDropDown(ResourceGeneralPage.getCategoryDataTestsIdAttribute()).getText()));
- assertTrue(vf.getVendorName().equals(ResourceGeneralPage.getVendorNameText()));
- assertTrue(vf.getVendorRelease().equals(ResourceGeneralPage.getVendorReleaseText()));
- assertTrue(vf.getContactId().equals(ResourceGeneralPage.getContactIdText()));
- List<WebElement> tagsList = ResourceGeneralPage.getElementsFromTagsTable();
- assertTrue(vf.getTags().size() == tagsList.size());
- for (int i = 0; i < vf.getTags().size(); i++) {
- assertTrue(vf.getTags().contains(tagsList.get(i).getText()));
- }
- assertTrue(vf.getContactId().equals(ResourceGeneralPage.getContactIdText()));
- }
-
- public static void verifyVFUpdated(ResourceReqDetails vf, User user) {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Verifying fields on General screen through Backend ..."));
- String response = RestCDUtils.getResource(vf, user).getResponse();
- Resource resource = ResponseParser.convertResourceResponseToJavaObject(response);
- assertTrue(vf.getName().equals(resource.getName()));
- assertTrue(vf.getDescription().equals(resource.getDescription()));
- assertTrue(vf.getVendorName().equals(resource.getVendorName()));
- assertTrue(vf.getVendorRelease().equals(resource.getVendorRelease()));
- assertTrue(vf.getContactId().equals(resource.getContactId()));
-
- assertTrue(vf.getCategories().size() == (resource.getCategories().size()));
- for (int i = 0; i < vf.getCategories().size(); i++) {
- CategoryDefinition expectedCategoryDefinition = vf.getCategories().get(i);
- CategoryDefinition actualCategoryDefinition = resource.getCategories().get(i);
- assertTrue(expectedCategoryDefinition.getName().equals(actualCategoryDefinition.getName()));
- assertTrue(expectedCategoryDefinition.getSubcategories().get(i).getName().equals(actualCategoryDefinition.getSubcategories().get(i).getName()));
- }
-
- assertTrue(vf.getTags().size() == (resource.getTags().size()));
- for (int i = 0; i < vf.getTags().size(); i++) {
- List<String> expectedTags = vf.getTags();
- List<String> actualTags = resource.getTags();
-
- assertTrue(actualTags.contains(expectedTags.get(i)));
-
- }
- }
-
- public static void verifyVFLifecycle(ResourceReqDetails vf, User user, LifecycleStateEnum expectedLifecycleState) {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Verfiying that object %s state is %s", vf.getName(), expectedLifecycleState));
- String responseAfterDrag = RestCDUtils.getResource(vf, user).getResponse();
- JSONObject jsonResource = (JSONObject) JSONValue.parse(responseAfterDrag);
- String actualLifecycleState = jsonResource.get("lifecycleState").toString();
- assertTrue(expectedLifecycleState.name().equals(actualLifecycleState), "actual: " + actualLifecycleState + "-- expected: " + expectedLifecycleState);
- }
-
- public static void verifyVfLifecycleInUI(LifeCycleStateEnum lifecycleState) {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Verfiying that object state is %s", lifecycleState.getValue()));
- GeneralUIUtils.ultimateWait();
- assertTrue(ResourceGeneralPage.getLifeCycleState().equals(lifecycleState.getValue()));
- }
-
- public static void verifyVersionUI(String expected) {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Verifying that version is %s", expected));
- String actualVersion = GeneralUIUtils.getSelectedElementFromDropDown(DataTestIdEnum.
- GeneralElementsEnum.VERSION_HEADER.getValue()).getText().replace("V", "");
- assertTrue(actualVersion.equals(expected), String.format("Expected version: %s, Actual version: %s", expected, actualVersion));
- }
-
- public static void verifyInstanceVersion(ResourceReqDetails vf, User user, String instanceName, String instanceVersion) {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Verfiying that instance %s version is %s", instanceName, instanceVersion));
- String responseAfterDrag = RestCDUtils.getResource(vf, user).getResponse();
- JSONObject jsonResource = (JSONObject) JSONValue.parse(responseAfterDrag);
- JSONArray jsonArrayResource = (JSONArray) jsonResource.get("componentInstances");
- for (int i = 0; i < jsonArrayResource.size(); i++) {
- Object object = jsonArrayResource.get(i);
- try {
- JSONObject jRes = (JSONObject) JSONValue.parse(object.toString());
- String componentName = jRes.get("componentName").toString();
- if (componentName.equals(instanceName)) {
- String componentVersion = jRes.get("componentVersion").toString();
- assertTrue(componentVersion.equals(instanceVersion));
- }
- } catch (Exception e) {
- System.out.println("Can't test object in componentInstances array");
- Assert.fail("Can't test object in componentInstances array");
- }
- }
- }
-
- public static void verifyVfDeleted(ResourceReqDetails vf, User user) {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Validating resource %s was deleted", vf.getName()));
- RestResponse response = RestCDUtils.getResource(vf, user);
- assertTrue(response.getErrorCode().intValue() == HttpStatus.SC_NOT_FOUND);
- }
-
- public static void verifyPropertiesInUI(List<PropertyTypeEnum> propertyList) {
-
- for (PropertyTypeEnum prop : propertyList) {
- String propName = prop.getName();
-
- String actualName = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.PropertiesPageEnum.PROPERTY_NAME.getValue() + propName).getText();
- String actualType = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.PropertiesPageEnum.PROPERTY_TYPE.getValue() + propName).getText();
- String actualDesciprtion = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.PropertiesPageEnum.PROPERTY_DESCRIPTION.getValue() + propName).getText();
-
- assertTrue(propName.equals(actualName), String.format("Property name is not correct. expected:%s ; actual %s", propName, actualName));
- assertTrue(prop.getType().equals(actualType), String.format("Property type is not correct. expected:%s ; actual %s", prop.getType(), actualType));
- assertTrue(prop.getDescription().equals(actualDesciprtion), String.format("Property description is not correct. expected:%s ; actual %s", prop.getDescription(), actualDesciprtion));
-
- if (prop.getSchemaDefinition() != null) {
- String actualSchema = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.PropertiesPageEnum.ENTRY_SCHEMA.getValue() + propName).getText();
- assertTrue(prop.getSchemaDefinition().equals(actualSchema), String.format("Property schema is not correct. expected:%s ; actual %s", prop.getSchemaDefinition(), actualSchema));
- }
- }
- }
-
- public static void verifyToscaArtifactsInfo(ResourceReqDetails vf, User user) {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Validating Tosca Aritfact Info of resource %s", vf.getName()));
- String responseAfterDrag = RestCDUtils.getResource(vf, user).getResponse();
- JSONObject jsonResource = (JSONObject) JSONValue.parse(responseAfterDrag);
- JSONObject toscaArtifacts = (JSONObject) jsonResource.get("toscaArtifacts");
-
- assertEquals(2, toscaArtifacts.size());
- for (Object artifactObj : toscaArtifacts.keySet()) {
- JSONObject artifact = (JSONObject) JSONValue.parse(toscaArtifacts.get(artifactObj).toString());
- assertFalse(artifact.get("artifactUUID").toString().isEmpty(), "artifactUUID field is empty");
- assertFalse(artifact.get("artifactChecksum").toString().isEmpty(), "artifactChecksum filed is empty");
- assertFalse(artifact.get("payloadUpdateDate").toString().isEmpty(), "payloadUpdateDate field is empty");
- assertFalse(artifact.get("artifactVersion").toString().equals("0"), "artifactVersion field is 0");
- }
- }
-
- public static void verifyVfInputs(String instanceName, Map<String, String> instancePropertiesMapFromJson, List<WebElement> propertyRowsFromTable) {
-
- for (int i = 0; i < propertyRowsFromTable.size(); i++) {
- WebElement row = propertyRowsFromTable.get(i);
- String propertyNameFromTable = row.findElement(By.xpath(".//*[@data-tests-id='" + "propertyName']")).getText();
- String propertyTypeFromTable = row.findElement(By.xpath(".//*[@data-tests-id='" + "propertyType']")).getText();
- String instanceNameFromTable = row.findElement(By.xpath(".//*[@data-tests-id='" + "instanceName']")).getText();
- String propertySchemaFromTable = row.findElement(By.xpath(".//*[@data-tests-id='" + "propertySchema']")).getText();
-
- assertTrue(instancePropertiesMapFromJson.containsKey(propertyNameFromTable), "No property named : " + propertyNameFromTable + "for instance " + instanceName);
- String expectedType = instancePropertiesMapFromJson.get(propertyNameFromTable);
- assertTrue(expectedType.equals(propertyTypeFromTable.toLowerCase()), propertyNameFromTable + "type is incorrect");
- assertTrue(instanceName.equals(instanceNameFromTable), "Instance name of property named " + propertyNameFromTable + "is incorrect");
- }
- }
-
- public static void verifyOnboardedVnfMetadata(String vspName, VendorSoftwareProductObject vspMetadata) {
- SetupCDTest.getExtendTest().log(Status.INFO, "Verifying metadata");
-
- assertTrue(vspName.equals(ResourceGeneralPage.getNameText()), "VSP name is not valid.");
- List<WebElement> tagsList = ResourceGeneralPage.getElementsFromTagsTable();
- assertTrue(tagsList.size() == 1, "VSP tags size is not equal to 1.");
- assertTrue(vspName.equals(tagsList.get(0).getText()), "VSP tag is not its name.");
-
- verifyMetadataIndifferentToFlow(vspMetadata);
- }
-
- public static void verifyOnboardedVnfMetadataAfterUpdateVNF(String vspName, VendorSoftwareProductObject vspMetadata) {
- SetupCDTest.getExtendTest().log(Status.INFO, "Verifying metadata after update VNF");
-
- // VF name should be updated only only if VF not certified
- if (Double.parseDouble(ResourceGeneralPage.getVersionUI()) < 1.0) {
- assertTrue(vspName.equals(ResourceGeneralPage.getNameText()), "VSP name is not valid.");
- List<WebElement> tagsList = ResourceGeneralPage.getElementsFromTagsTable();
- assertTrue(tagsList.size() == 1, "VSP tags size is not equal to 1.");
- assertTrue(vspName.equals(tagsList.get(0).getText()), "VSP tag is not its name.");
- }
-
- verifyMetadataIndifferentToFlow(vspMetadata);
- }
-
- public static void verifyMetadataIndifferentToFlow(VendorSoftwareProductObject vspMetadata) {
- assertTrue(vspMetadata.getDescription().equals(ResourceGeneralPage.getDescriptionText()), "VSP description is not valid.");
-
- String[] splitedSubCategorey = vspMetadata.getSubCategory().split("\\.");
- String expectedSubCategory = splitedSubCategorey[splitedSubCategorey.length - 1];
- String actualSubCategory = GeneralUIUtils.getSelectedElementFromDropDown(ResourceGeneralPage.getCategoryDataTestsIdAttribute()).getText().trim().toLowerCase();
-
- assertTrue(expectedSubCategory.equals(actualSubCategory), "VSP category is not valid.");
- assertTrue(vspMetadata.getVendorName().equals(ResourceGeneralPage.getVendorNameText()), "VSP vendor name is not valid.");
- assertTrue("1.0".equals(ResourceGeneralPage.getVendorReleaseText()), "VSP version is not valid.");
- assertTrue(vspMetadata.getAttContact().equals(ResourceGeneralPage.getContactIdText()), "VSP attContact is not valid.");
- }
-
- public static void verifyIsElementDisabled(String elementLocator, String elementName) {
- SetupCDTest.getExtendTest().log(Status.INFO, String.format("Checking if %s is disabled", elementName));
- assertTrue(GeneralUIUtils.isElementReadOnly(elementLocator));
- }
-
- public static void verifyFilesChecksum(File actual, File expected) {
- try {
- String actualMd5OfFile = FileHandling.getMD5OfFile(actual);
- String expectedMd5OfFile = FileHandling.getMD5OfFile(expected);
- Assert.assertEquals(expectedMd5OfFile, actualMd5OfFile, "File does not exist");
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- }
-
-}
diff --git a/ui-ci/src/main/resources/Downloads/CP_WAN.yml b/ui-ci/src/main/resources/Downloads/CP_WAN.yml
deleted file mode 100644
index eeabbb8490..0000000000
--- a/ui-ci/src/main/resources/Downloads/CP_WAN.yml
+++ /dev/null
@@ -1,23 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-
-node_types:
- org.openecomp.resource.cp.WANTedy: derived_from: org.openecomp.resource.cp.CPTedy
- properties:
- type:
- type: string
- required: false
- requirements:
- - virtualLink_in:
- capability: tosca.capabilities.network.Linkable relationship: tosca.relationships.network.LinksTo
- - virtualLink_out:
- capability: tosca.capabilities.network.Linkable relationship: tosca.relationships.network.LinksTo
- - virtualLink_in1:
- capability: tosca.capabilities.network.Linkable relationship: tosca.relationships.network.LinksTo
- - virtualLink_out1:
- capability: tosca.capabilities.network.Linkable relationship: tosca.relationships.network.LinksTo
- - virtualLink_in2:
- capability: tosca.capabilities.network.Linkable relationship: tosca.relationships.network.LinksTo
- - virtualLink_out2:
- capability: tosca.capabilities.network.Linkable relationship: tosca.relationships.network.LinksTo
- - virtualbinding:
- capability: tosca.capabilities.network.Bindable relationship: tosca.relationships.network.BindsTo \ No newline at end of file
diff --git a/ui-ci/src/main/resources/Downloads/Fortigate02_vFW_VFC.yml b/ui-ci/src/main/resources/Downloads/Fortigate02_vFW_VFC.yml
deleted file mode 100644
index a24d004929..0000000000
--- a/ui-ci/src/main/resources/Downloads/Fortigate02_vFW_VFC.yml
+++ /dev/null
@@ -1,63 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0_0
-
-node_types:
-
- org.openecomp.resource.vfc.vFW.Fortigate02Tedy:
- derived_from: org.openecomp.resource.vfc.vFWTedy
-
- properties:
- att-part-number:
- type: string
- default: "ATT-FortiGate-VM02"
- vendor-name:
- type: string
- default: “FORTINET”
- vendor-model:
- type: string
- default: "VM02"
- vendor-model-description:
- type: string
- vcpu-default:
- type: integer
- default: 2
- vcpu-min:
- type: integer
- default: 1
- vcpu-max:
- type: integer
- default: 2
- vmemory-default:
- default: 4
- type: integer
- vmemory-units:
- type: string
- default: "GB"
- vmemory-min:
- type: integer
- default: 1
- vmemory-max:
- type: integer
- default: 4
- vdisk-default:
- type: integer
- default: 20
- vdisk-units:
- type: string
- default: "GB"
- vdisk-min:
- type: integer
- default: 2
- vdisk-max:
- type: integer
- default: 20
- vnf-type:
- type: string
- default: “Advanced FW”
- software-version:
- type: string
- default: “5.2.4”
- software-file-name:
- type: string
- vnf-feature:
- type: string
- default: “IPS, AntiVirus, URL Filter, APPID” \ No newline at end of file
diff --git a/ui-ci/src/main/resources/META-INF/aop-ajc.xml b/ui-ci/src/main/resources/META-INF/aop-ajc.xml
deleted file mode 100644
index 8587abb2e1..0000000000
--- a/ui-ci/src/main/resources/META-INF/aop-ajc.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<aspectj>
-
-<aspects>
-<aspect name="com.att.automation.common.report_portal_integration.aspects.StepAspects"/>
-<aspect name="com.att.automation.common.report_portal_integration.aspects.WebDriverAspects"/>
-<aspect name="com.att.automation.common.report_portal_integration.aspects.AssertAspects"/>
-<aspect name="com.att.automation.common.report_portal_integration.aspects.ReportPortalAspects"/>
-</aspects>
-<weaver options="-Xset:weaveJavaxPackages=true -warn:none -Xlint:ignore">
-<include within="org.openecomp.sdc.ci.tests..*"/>
-<include within="com.att.automation..*"/>
-<include within="com.epam..*"/>
-<include within="org.testng.TestNG"/>
-</weaver>
-</aspectj> \ No newline at end of file
diff --git a/ui-ci/src/main/resources/ci/conf/attsdc-packages.yaml b/ui-ci/src/main/resources/ci/conf/attsdc-packages.yaml
deleted file mode 100644
index dcb78eefc1..0000000000
--- a/ui-ci/src/main/resources/ci/conf/attsdc-packages.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-packages:
- - org.openecomp.sdc.ci.tests.execute.resourceui \ No newline at end of file
diff --git a/ui-ci/src/main/resources/ci/conf/attsdc.yaml b/ui-ci/src/main/resources/ci/conf/attsdc.yaml
deleted file mode 100644
index e7dfa39570..0000000000
--- a/ui-ci/src/main/resources/ci/conf/attsdc.yaml
+++ /dev/null
@@ -1,69 +0,0 @@
-outputFolder: target
-reportName: index.html
-catalogBeHost: localhost
-esHost: eshost
-disributionClientHost: disClient
-catalogFePort: 8181
-catalogBePort: 8284
-disributionClientPort: 8181
-esPort: 9200
-neoHost: neoHost
-neoPort: 7474
-neoDBusername: neo4j
-neoDBpassword: 123456
-url: http://localhost:8285/sdc1
-#url: https://www.e-access.att.com/QA-AUTOMATE1/sdc1/portal
-#url: https://www.e-access.att.com/AA-IFT-testing/sdc1/portal
-#url: https://www.e-access.att.com/QA-SCRUM1/sdc1/portal
-remoteTestingMachineIP: 0.0.0.0
-remoteTestingMachinePort: 5566
-remoteTesting: false
-resourceConfigDir: src/test/resources/CI/tests
-componentsConfigDir: src/test/resources/CI/components
-importResourceConfigDir: src/test/resources/CI/importResource
-importResourceTestsConfigDir: src/test/resources/CI/importResourceTests
-errorConfigurationFile: ../catalog-be/src/main/resources/config/error-configuration.yaml
-configurationFile: ../catalog-be/src/main/resources/config/configuration.yaml
-importTypesConfigDir: src/test/resources/CI/importTypesTest
-browser: FireFox
-windowsDownloadDirectory: "c:\\apache-ftpserver-1.1.0\\res\\home\\"
-systemUnderDebug: true
-reportDBhost: dbhost
-reportDBport: 27017
-sdcHttpMethod: http
-localDataCenter: DC-Automate01
-
-useBrowserMobProxy: false
-captureTraffic: false
-
-janusGraphPropertiesFile: src/main/resources/ci/conf/janusgraph.properties
-
-stopOnClassFailure: false
-#todo
-onboardingBeHost: localhost
-onboardingBePort: 8283
-#List of non-abstract resources to keep during JanusGraph cleanup between tests
-#Only 1.0 version will be kept
-resourcesNotToDelete:
- - tosca.nodes.Compute
- - tosca.nodes.Database
- - tosca.nodes.ObjectStorage
- - tosca.nodes.BlockStorage
- - tosca.nodes.LoadBalancer
- - org.openecomp.resource.cp.Port
- - org.openecomp.resource.vl.Network
-
-#Resource categories to keep (including all their subcategories)
-resourceCategoriesNotToDelete:
- - Generic
- - Network L2-3
- - Network L4+
- - Application L4+
- - Network Connectivity
-
-#Service categories to keep
-serviceCategoriesNotToDelete:
- - Mobility
- - Network L1-3
- - Network L4
- - VoIP Call Control \ No newline at end of file
diff --git a/ui-ci/src/main/resources/ci/conf/extent-config.xml b/ui-ci/src/main/resources/ci/conf/extent-config.xml
deleted file mode 100644
index 4eb7f681aa..0000000000
--- a/ui-ci/src/main/resources/ci/conf/extent-config.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<extentreports>
- <configuration>
- <!-- report theme -->
- <!-- standard, dark -->
- <theme>standard</theme>
-
- <!-- document encoding -->
- <!-- defaults to UTF-8 -->
- <encoding>UTF-8</encoding>
-
- <!-- protocol for script and stylesheets -->
- <!-- defaults to https -->
- <protocol>https</protocol>
-
- <!-- title of the document -->
- <documentTitle>ASDC Automation Report</documentTitle>
-
- <!-- report name - displayed at top-nav -->
- <reportName> ASDC Automation Report </reportName>
-
- <!-- report headline - displayed at top-nav, after reportHeadline -->
- <reportHeadline></reportHeadline>
-
- <!-- global date format override -->
- <!-- defaults to yyyy-MM-dd -->
- <dateFormat>yyyy-MM-dd</dateFormat>
-
- <!-- global time format override -->
- <!-- defaults to HH:mm:ss -->
- <timeFormat>HH:mm:ss</timeFormat>
-
- <!-- custom javascript -->
- <scripts>
- <![CDATA[
- $(document).ready(function() {
- $('.logo-content' ).remove();
- $('.charts div:nth-child(2)').remove();
- });
- ]]>
- </scripts>
-
- <!-- custom styles -->
- <styles>
- <![CDATA[
- .report-name {padding-top: 1px; font-size: 15px; font-weight: bold;}
- ]]>
- </styles>
- </configuration>
-</extentreports> \ No newline at end of file
diff --git a/ui-ci/src/main/resources/ci/conf/janusgraph.properties b/ui-ci/src/main/resources/ci/conf/janusgraph.properties
deleted file mode 100644
index 9d67ed2f2f..0000000000
--- a/ui-ci/src/main/resources/ci/conf/janusgraph.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-storage.backend=cql
-storage.hostname=cassandrahost
-storage.port=9042
-
-cache.db-cache-clean-wait = 20
-cache.db-cache-time = 180000
-cache.db-cache-size = 0.5 \ No newline at end of file
diff --git a/ui-ci/src/main/resources/ci/conf/log4j2.properties b/ui-ci/src/main/resources/ci/conf/log4j2.properties
deleted file mode 100644
index ec22601d6a..0000000000
--- a/ui-ci/src/main/resources/ci/conf/log4j2.properties
+++ /dev/null
@@ -1,49 +0,0 @@
-status = error
-dest = err
-name = PropertiesConfig
-
-property.filename = ${targetlog}logs/ci-log.out
-
-#filter.threshold.type = ThresholdFilter
-#filter.threshold.level = debug
-
-appender.rolling.type = RollingFile
-appender.rolling.name = RollingFile
-appender.rolling.fileName = ${filename}
-appender.rolling.filePattern = ${targetlog}logs/ci-%d{MM-dd-yy-HH-mm-ss}-%i.log.gz
-appender.rolling.layout.type = PatternLayout
-appender.rolling.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %5p [%10c] : %m%n
-appender.rolling.policies.type = Policies
-appender.rolling.policies.size.type = SizeBasedTriggeringPolicy
-appender.rolling.policies.size.size=5MB
-appender.rolling.strategy.type = DefaultRolloverStrategy
-appender.rolling.strategy.max = 10
-
-appender.console.type = Console
-appender.console.name = STDOUT
-appender.console.layout.type = PatternLayout
-appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %5p %10c:%L - %m%n
-appender.console.filter.threshold.type = ThresholdFilter
-appender.console.filter.threshold.level = info
-
-loggers=org.apache.cassandra.service.StorageProxy,org.janusgraph.diskstorage.cassandra.CassandraTransaction,org.openecomp.sdc.ci.tests.utils
-
-logger.org.apache.cassandra.service.StorageProxy.name = org.apache.cassandra.service.StorageProxy
-logger.org.apache.cassandra.service.StorageProxy.level=info
-logger.org.apache.cassandra.service.StorageProxy.appendRef.rolling.ref = RollingFile
-logger.org.apache.cassandra.service.StorageProxy.appendRef.stdout.ref = STDOUT
-
-logger.org.janusgraph.diskstorage.cassandra.CassandraTransaction.name = org.janusgraph.diskstorage.cassandra.CassandraTransaction
-logger.org.janusgraph.diskstorage.cassandra.CassandraTransaction.level =info
-logger.org.janusgraph.diskstorage.cassandra.CassandraTransaction.appendRef.rolling.ref = RollingFile
-logger.org.janusgraph.diskstorage.cassandra.CassandraTransaction.appendRef.stdout.ref = STDOUT
-
-logger.org.openecomp.sdc.ci.tests.utils.name = org.openecomp.sdc.ci.tests.utils
-logger.org.openecomp.sdc.ci.tests.utils.level = info
-logger.org.openecomp.sdc.ci.tests.utils.appendRef.rolling.ref = RollingFile
-logger.org.openecomp.sdc.ci.tests.utils.appendRef.stdout.ref = STDOUT
-logger.org.openecomp.sdc.ci.tests.utils.additivity = false
-
-rootLogger.level = info
-rootLogger.appenderRef.stdout.ref = STDOUT
-rootLogger.appenderRef.rolling.ref = RollingFile \ No newline at end of file
diff --git a/ui-ci/src/main/resources/ci/scripts/addUsersFromList_new.sh b/ui-ci/src/main/resources/ci/scripts/addUsersFromList_new.sh
deleted file mode 100644
index e695db26b2..0000000000
--- a/ui-ci/src/main/resources/ci/scripts/addUsersFromList_new.sh
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/bin/bash
-
-function help_usage ()
-{
- echo "$0 -ip <ip> -f <userToAdd_file>"
- echo "for example: -ip 127.0.0.1 -f /var/tmp/userToAdd.txt"
- exit
-}
-
-function check_file_existance ()
-{
-echo "check_file_existance $1"
-if [ $1 == "" ]; then
- echo "Please provide full path to user file"
- exit;
-elif [ -f $1 ]; then
- source $1
- USERS=("${USER_LIST[@]}")
- echo "file exist" $1
-else
- echo "Provided user file does not exist"
- exit
-fi
-}
-
-function check_ip_existance ()
-{
-if [ $1 == "" ]; then
- echo "Please provide ip address"
- exit;
-fi
-}
-
-function addUser ()
-{
- #for user in "${USER_LIST[@]}"; do
- for user in "${USERS[@]}"; do
- PING=`ping -c 1 $IP > /var/tmp/ping.log`
- pattern1='100% packet loss'
- pattern2='Host Unreachable'
- COUNT=`egrep -c "$pattern1|$pattern2" /var/tmp/ping.log`
- if [ $COUNT -eq 0 ]; then
- # curl -i -X post -d '{ "userId" : "kk1123", "role" : "ADMIN" }' -H "Content-Type: application/json" -H "USER_ID: jh0003" http://192.168.111.9:8080/sdc2/rest/v1/user
- userId=`echo $user|awk '{print $1}'`
- role=`echo $user|awk '{print $2}'`
- firstName=`echo $user|awk '{print $3}'`
- lastName=`echo $user|awk '{print $4}'`
- email=`echo $user|awk '{print $5}'`
- curl --noproxy '*' -i -X post -d '{ "userId" : "'${userId}'", "role" : "'${role}'", "firstName" : "'${firstName}'", "lastName" : "'${lastName}'", "email" : "'${email}'" }' -H "Content-Type: application/json" -H "USER_ID: jh0003" https://${IP}:8443/sdc2/rest/v1/user
- else
- echo "Host" $IP "Is Unreachable"
- fi
- done
-curl --noproxy '*' -i -X post -d '{"consumerName": "ci","consumerSalt": "2a1f887d607d4515d4066fe0f5452a50","consumerPassword": "0a0dc557c3bf594b1a48030e3e99227580168b21f44e285c69740b8d5b13e33b"}' -H "Content-Type: application/json" -H "USER_ID: jh0003" -H "Authorization:Basic Y2k6MTIzNDU2" https://${IP}:8443/sdc2/rest/v1/consumers
-
-}
-
-#main
-[ $# -eq 0 ] && help_usage
-while [ $# -ne 0 ]; do
- case $1 in
- "-f")
- USER_FILE=$2
- shift 1
- shift 1
- ;;
- -ip)
- IP=$2
- shift 1
- shift 1
- ;;
- *)
-# help_usage
- ;;
- esac
-done
-
-check_file_existance $USER_FILE
-check_ip_existance $IP
-addUser
diff --git a/ui-ci/src/main/resources/ci/scripts/copyToStorage.sh b/ui-ci/src/main/resources/ci/scripts/copyToStorage.sh
deleted file mode 100644
index a113c54e60..0000000000
--- a/ui-ci/src/main/resources/ci/scripts/copyToStorage.sh
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/bin/bash
-
-REPORT_NAME=$1
-VERSION=$2
-ENV=$3
-
-
-if [ -z "$REPORT_NAME" ]
- then
- source ExtentReport/versions.info
- now=$(date +'%Y-%m-%d_%H_%M')
- REPORT_NAME="${now}"
- VERSION="${osVersion}"
- if [[ $env == *"DEV20"* ]]
- then
- ENV="Nightly"
- else
- ENV=""
- fi
-
- fi
-
-source conf/attInternal.info
-IP=$automationResutlsRepo
-PASS=$automationResutlsRepoPass
-
-/usr/bin/expect << EOF
-spawn ssh admin@${IP} mkdir -p -m 775 /home/admin/reports/${ENV}/${VERSION}/UI/
-
-expect {
- -re ".*es.*o.*" {
- exp_send "yes\r"
- exp_continue
- }
- -re ".*sword.*" {
- exp_send ${PASS}\r
- }
-}
-
-expect eof
-
-spawn scp -pr ExtentReport admin@${IP}:/home/admin/reports/${ENV}/${VERSION}/UI/${REPORT_NAME}/
-
-expect {
- -re ".*es.*o.*" {
- exp_send "yes\r"
- exp_continue
- }
- -re ".*sword.*" {
- exp_send ${PASS}\r
- }
-}
-
-expect eof
-EOF
diff --git a/ui-ci/src/main/resources/ci/scripts/sendMail.sh b/ui-ci/src/main/resources/ci/scripts/sendMail.sh
deleted file mode 100644
index 932b624a33..0000000000
--- a/ui-ci/src/main/resources/ci/scripts/sendMail.sh
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/bin/bash
-
-now=$(date +'%Y%-m%d%H%M')
-
-REPORT_NAME=$1
-VERSION=$2
-ENV=$3
-
-RECIPIENTS1="md9897@att.com,NETCOM_ASDC_DEV@att.com,IL-D2-QA-Alex@att.com,bs5719@att.com,yg356h@att.com,yr9970@att.com,sl615n@att.com,yn813h@att.com,as221v@att.com,ms172g@att.com,ma2244@att.com,el489u@att.com,gg980r@att.com,ak991p@att.com,bv095y@att.com,ms656r@att.com,df502y@att.com,bt750h@att.com,ln699k@att.com,hm104p@att.com"
-#RECIPIENTS2="dl-asdcqa@att.com"
-RECIPIENTS2="md9897@att.com,NETCOM_ASDC_DEV@att.com,IL-D2-QA-Alex@att.com,bs5719@att.com,yg356h@att.com,yr9970@att.com,sl615n@att.com,yn813h@att.com,as221v@att.com,ms172g@att.com,ma2244@att.com,el489u@att.com,gg980r@att.com,ak991p@att.com,bv095y@att.com,ms656r@att.com,df502y@att.com,bt750h@att.com,ln699k@att.com,hm104p@att.com"
-
-source ExtentReport/versions.info
-if [ -z "$REPORT_NAME" ]
- then
- source ExtentReport/versions.info
- now=$(date +'%Y-%m-%d_%H_%M')
- REPORT_NAME="${now}"
- VERSION="${osVersion}"
-
-
-fi
-
-if [[ $env == *"DEV20"* ]]
- then
- ENV="Nightly"
- RECIPIENTS=$RECIPIENTS1
- else
- ENV=""
- RECIPIENTS=$RECIPIENTS2
-fi
-
-#REPORT_ZIP_FILE=ExtentReport_${now}.zip
-REPORT_FOLDER='ExtentReport'
-REPORT_HTML_FILE=${REPORT_FOLDER}/*Report.html
-BODY_MESSAGE='Hello, \n\n Please find automation results on following link: \n\n http://asdc-srv-210-45.tlv.intl.att.com/'${ENV}'/'${VERSION}'/UI/'${REPORT_NAME}'/SDC_UI_Extent_Report.html \n\nThanks, \nASDC QA Team\n\n '
-
-#OLD_FILE=$(find ./ -type f -name ${REPORT_ZIP_FILE} -print)
-#if [ ! -z ${OLD_FILE} ]
-#then
-# rm -f ${REPORT_ZIP_FILE}
-# echo "Removing old zip file............"
-#fi
-
-#echo "Creating new zip file"
-#zip -r ${REPORT_ZIP_FILE} ./${REPORT_FOLDER}
-
-
-
-echo -e ${BODY_MESSAGE} | mail -s 'E2E Automation '$ENV' results - SDC '$VERSION -r 'ASDC@Automation.team' $RECIPIENTS
diff --git a/ui-ci/src/main/resources/ci/scripts/startTest.sh b/ui-ci/src/main/resources/ci/scripts/startTest.sh
deleted file mode 100644
index 20afd86414..0000000000
--- a/ui-ci/src/main/resources/ci/scripts/startTest.sh
+++ /dev/null
@@ -1,181 +0,0 @@
-#!/bin/bash
-REMOTE_DEBUG=false
-RERUN=true
-JAVA_OPTION=""
-debug_port=8000
-TEST_SUITES=testSuites
-fileName=testng-failed.xml
-
-function help_usage ()
-{
- echo
- echo "$0 (<jar_file_name> <suite file name>) [-r/rerun <true/false> -d/debug <true/false>]"
- echo "nohup ./startTest.sh ui-ci-1707.0.5-SNAPSHOT-jar-with-dependencies.jar extendedSanity.xml -r false -d true &"
- echo "by default rerun is true and remote debug is false."
- echo
- exit 2
-}
-
-function isBoolean ()
-{
- PARAM_NAME=$1
- VALUE=$2
- if [[ ${VALUE} != "true" ]] && [[ ${VALUE} != "false" ]]; then
- echo "Valid parameter" ${PARAM_NAME} "values are: true/false"
- help_usage
- fi
-}
-
-function prepareFailedXmlFile ()
-{
- echo "1="$1 "2="$2 "fileName="${fileName}
- PATTERN=`grep -w "test name=" ${FULL_PATH}/${TEST_SUITES}/$2 | awk -F'"' '{print $2}'`
- sed '/<test name="'${PATTERN}'"/,/<!-- '${PATTERN}' --/d' $1 > ${FULL_PATH}/${TEST_SUITES}/${fileName}
- sed -i 's/thread-count="[0-9]\+"/thread-count="1"/g' ${FULL_PATH}/${TEST_SUITES}/${fileName}
- if [ -s "ExtentReport/ShortReport.csv" ]
- then
- SKIP_TESTS_LIST=$(cat ExtentReport/ShortReport.csv |awk -F, '{print $2}' | sed 's/&.*//g' | uniq)
- for SKIP_TEST in ${SKIP_TESTS_LIST}; do
- sed -i "s/.*\"${SKIP_TEST}\".*//g" ${FULL_PATH}/${TEST_SUITES}/${fileName};
- done;
- fi
-}
-
-function setUpdatedTimeToReport ()
-{
- LINE_NUMBER_OF_START_REPORT_DATE=`grep -A1 -nw "Start" ExtentReport/SDC_UI_Extent_Report.html | tail -1 | awk '{print $1}' | tr -d -`
- END_REPORT_DATE=`grep -A1 -nw "End" ExtentReport/SDC_UI_Extent_Report.html | tail -1 | awk -F'[>|<]' '{print $3}'`
- EPOCH_START_REPORT_DATE=`date --date="${1}" +%s`
- EPOCH_END_REPORT_DATE=`date --date="${END_REPORT_DATE}" +%s`
- let DIFF_EPOCH_TIME=${EPOCH_END_REPORT_DATE}-${EPOCH_START_REPORT_DATE}
- TAKEN_TIME_IN_MINUTES=`echo $((${DIFF_EPOCH_TIME}/60))`
- LINE_NUMBER_OF_TAKEN_REPORT_TIME=`grep -A1 -nw "Time Taken" ExtentReport/SDC_UI_Extent_Report.html | tail -1 | awk '{print $1}' | tr -d -`
- PATTERN="div class='panel-lead'>";
- sed -i "${LINE_NUMBER_OF_START_REPORT_DATE}s/${PATTERN}.*\</${PATTERN}$1\<\//1" ExtentReport/SDC_UI_Extent_Report.html
- sed -i "${LINE_NUMBER_OF_TAKEN_REPORT_TIME}s/${PATTERN}.*\</${PATTERN}${TAKEN_TIME_IN_MINUTES} min\<\//1" ExtentReport/SDC_UI_Extent_Report.html
-}
-
-#main
-[ $# -lt 2 ] && help_usage
-
-JAR_FILE=$1
-SUITE_FILE=$2
-
-while [ $# -ne 0 ]; do
- case $1 in
- -r|rerun)
- RERUN=$2
- isBoolean $1 ${RERUN}
- shift 1
- shift 1
- ;;
- -d|debug)
- REMOTE_DEBUG=$2
- isBoolean $1 ${REMOTE_DEBUG}
- shift 1
- shift 1
- ;;
- *)
- shift 1
- ;;
- esac
-done
-
-CURRENT_DIR=`pwd`
-BASEDIR=$(dirname $0)
-
-if [ ${BASEDIR:0:1} = "/" ]
-then
- FULL_PATH=$BASEDIR
-else
- FULL_PATH=$CURRENT_DIR/$BASEDIR
-fi
-LOGS_PROP_FILE=file:${FULL_PATH}/conf/log4j2.properties
-#############################################
-TARGET_DIR=${FULL_PATH}/target
-CONF_FILE=${FULL_PATH}/conf/attsdc.yaml
-
-DEBUG=true
-MainClass=org.openecomp.sdc.ci.tests.run.StartTest
-
-TESTS_DIR=/opt/app/sdc/ci/resources/tests
-COMPONENTS_DIR=/opt/app/sdc/ci/resources/components
-
-
-TARGET_LOG_DIR="${TARGET_DIR}/"
-
-
-######ADD USERS################
-
-BE_IP=`cat conf/attsdc.yaml | grep catalogBeHost| awk '{print $2}'`
-
-ADD_USERS_SCRIPT="addUsersFromList_new.sh"
-USER_LIST="conf/userList.txt"
-chmod +x ${ADD_USERS_SCRIPT}
-echo "add users..."
-./${ADD_USERS_SCRIPT} -ip ${BE_IP} -f ${USER_LIST}
-
-
-
-
-if [ ${REMOTE_DEBUG} == "true" ]; then
- echo "Debug mode, Listen on port $debug_port";
- JAVA_OPTION="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=${debug_port}" ;
-fi
-
-cmd="java -Xmx2048m -Xms1024m $JAVA_OPTION -DdisplayException=true -Dtargetlog=${TARGET_LOG_DIR} -DfilePath=${FILES_TEST} -Dconfig.resource=${CONF_FILE} -Ddebug=${DEBUG} -Dlog4j.configuration=${LOGS_PROP_FILE} -Dorg.freemarker.loggerLibrary=none -cp $JAR_FILE ${MainClass} $SUITE_FILE &"
-
-
-if [ $DEBUG == "true" ]
-then
- $cmd
-else
- $cmd >> /dev/null
-fi
-
-if [ ${RERUN} == "true" ]; then
- if [ -f ${TARGET_DIR}/${fileName} ]; then
- echo "Prepare" ${TARGET_DIR}/${fileName} "file to rerun all failed tests ...";
- prepareFailedXmlFile ${TARGET_DIR}/${fileName} $SUITE_FILE;
- SUITE_FILE=${fileName};
- cmd="java -Xmx2048m -Xms1024m $JAVA_OPTION -DdisplayException=true -Dtargetlog=${TARGET_LOG_DIR} -DfilePath=${FILES_TEST} -Dconfig.resource=${CONF_FILE} -Ddebug=${DEBUG} -Dlog4j.configuration=${LOGS_PROP_FILE} -Dorg.freemarker.loggerLibrary=none -cp $JAR_FILE ${MainClass} $SUITE_FILE &"
- $cmd;
- fi
-fi
-
-status=`echo $?`
-
-source ExtentReport/versions.info
-now=$(date +'%Y-%m-%d_%H_%M')
-REPORT_NAME=${now}
-VERSION=${osVersion}
-REPORT_START_DATE=${reportStartTime}
-
-if [ ${RERUN} == "true" ]; then
- setUpdatedTimeToReport "${REPORT_START_DATE}";
-fi
-
-if [[ $env == *"DEV20"* ]]
-then
- MYENV="Nightly"
-else
- MYENV=""
-fi
-
-COPY_REPORT_SCRIPT="copyToStorage.sh"
-chmod +x ${COPY_REPORT_SCRIPT}
-echo "copy report to storage..."
-( ./${COPY_REPORT_SCRIPT} ${REPORT_NAME} ${VERSION} ${MYENV} )
-
-
-MAILING_SCRIPT_NAME="sendMail.sh"
-chmod +x ${MAILING_SCRIPT_NAME}
-echo "Sending report via mail..."
-`./${MAILING_SCRIPT_NAME} ${REPORT_NAME} ${VERSION} ${MYENV}`
-
-
-echo "##################################################"
-echo "################# status is ${status} #################"
-echo "##################################################"
-
-exit $status
diff --git a/ui-ci/src/main/resources/ci/testSuites/PortMirroring.xml b/ui-ci/src/main/resources/ci/testSuites/PortMirroring.xml
deleted file mode 100644
index da03e8285e..0000000000
--- a/ui-ci/src/main/resources/ci/testSuites/PortMirroring.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="uitests" configfailurepolicy="continue" parallel="methods" thread-count="2">
- <test name="PortMirroringTests">
- <classes>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.PortMirroring"/>
- </classes>
- </test>
-</suite> \ No newline at end of file
diff --git a/ui-ci/src/main/resources/ci/testSuites/andreyPara.xml b/ui-ci/src/main/resources/ci/testSuites/andreyPara.xml
deleted file mode 100644
index 3e3efdd9cd..0000000000
--- a/ui-ci/src/main/resources/ci/testSuites/andreyPara.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
- <suite name="uitests" configfailurepolicy="continue" parallel="methods" thread-count="2" data-provider-thread-count="2">
-
-<listeners>
- <listener class-name="com.att.automation.common.report_portal_integration.listeners.ReportPortalListener"/>
-</listeners>
-
- <test name="VF1">
- <classes>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.Vf">
- <methods>
- <include name="updateVF"/>
- </methods>
- </class>
-
- </classes>
- </test> <!-- uitests -->
-
- <test name="VF2">
- <classes>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.Vf">
- <methods>
- <include name="addUpdateDeleteDeploymentArtifactToVfTest"/>
- <include name="addPropertiesToVfcInstanceInVfTest"/>
- </methods>
- </class>
-
- </classes>
- </test> <!-- uitests -->
-</suite> <!-- uisuite --> \ No newline at end of file
diff --git a/ui-ci/src/main/resources/ci/testSuites/archiveRestoreSanity.xml b/ui-ci/src/main/resources/ci/testSuites/archiveRestoreSanity.xml
deleted file mode 100644
index e712730d59..0000000000
--- a/ui-ci/src/main/resources/ci/testSuites/archiveRestoreSanity.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="uitests" configfailurepolicy="continue" parallel="methods" thread-count="4" data-provider-thread-count="2">
- <parameter name="makeDistribution" value="true"/>
-
- <test name="uiSanity">
- <classes>
-
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.ArchiveRestoreTest"/>
- <!-- <class name="org.openecomp.sdc.ci.tests.execute.sanity.Product"/> -->
-
-
- </classes>
- </test> <!-- uitests -->
-</suite> <!-- uisuite --> \ No newline at end of file
diff --git a/ui-ci/src/main/resources/ci/testSuites/arifactsSanity.xml b/ui-ci/src/main/resources/ci/testSuites/arifactsSanity.xml
deleted file mode 100644
index 3a637065ca..0000000000
--- a/ui-ci/src/main/resources/ci/testSuites/arifactsSanity.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="uitests" configfailurepolicy="continue" parallel="methods" thread-count="4" data-provider-thread-count="2">
- <parameter name="makeDistribution" value="true"/>
-
- <test name="uiSanity">
- <classes>
-
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.VFCArtifacts"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.VfArtifacts"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.VfDeploymentInformationalArtifacts"/>
- <class name="org.openecomp.sdc.ci.tests.US.ImportUpdateInformationalDeploymentArtifacts"/>
- <class name="org.openecomp.sdc.ci.tests.US.MIBsArtifactsOnResourceInstance"/>
- <class name="org.openecomp.sdc.ci.tests.US.NewArtifactTypeGuide"/>
- <class name="org.openecomp.sdc.ci.tests.US.RemoveRestrictionOfDeploymentArtifacts"/>
-
- </classes>
- </test> <!-- uitests -->
-</suite> <!-- uisuite --> \ No newline at end of file
diff --git a/ui-ci/src/main/resources/ci/testSuites/complexServiceSanity.xml b/ui-ci/src/main/resources/ci/testSuites/complexServiceSanity.xml
deleted file mode 100644
index 02eb27f9a8..0000000000
--- a/ui-ci/src/main/resources/ci/testSuites/complexServiceSanity.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="systemtests" configfailurepolicy="continue" parallel="methods" thread-count="2" data-provider-thread-count="2">
- <parameter name="makeDistribution" value="true"/>
- <test name="complexServiceSanity">
- <classes>
- <class name="org.openecomp.sdc.ci.tests.execute.AmdocsComplexService.CreatePath"/>
- </classes>
- </test> <!-- uitests -->
-</suite> <!-- uisuite --> \ No newline at end of file
diff --git a/ui-ci/src/main/resources/ci/testSuites/devOnboardE2EOneFileSanity.xml b/ui-ci/src/main/resources/ci/testSuites/devOnboardE2EOneFileSanity.xml
deleted file mode 100644
index acf4be4be3..0000000000
--- a/ui-ci/src/main/resources/ci/testSuites/devOnboardE2EOneFileSanity.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="uitests" configfailurepolicy="continue">
- <test name="uitests">
- <classes>
- <!--onboard-->
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.OnboardingFlowsUi">
- <methods>
- <include name="onboardVNFTestSanityOneFile"/>
- </methods>
- </class>
- </classes>
- </test> <!-- uitests -->
-</suite> <!-- uisuite --> \ No newline at end of file
diff --git a/ui-ci/src/main/resources/ci/testSuites/extendedSanity.xml b/ui-ci/src/main/resources/ci/testSuites/extendedSanity.xml
deleted file mode 100644
index 00b98c9f23..0000000000
--- a/ui-ci/src/main/resources/ci/testSuites/extendedSanity.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="uitests" configfailurepolicy="continue" parallel="methods" thread-count="4" data-provider-thread-count="2">
- <parameter name="makeDistribution" value="true"/>
-
- <test name="uiSanity">
- <classes>
-
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.ToscaValidationTest"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.OnboardingFlowsUi">
- <methods>
- <exclude name="onboardVNFTestSanity"/>
- <exclude name="onboardVNFShotFlow"/>
- <exclude name="onboardVNFTest"/>
- <exclude name="onboardVNFTestSanityOneFile"/>
- </methods>
- </class>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.CatalogLeftPanelTest"/>
- <!--<class name="org.openecomp.sdc.ci.tests.execute.sanity.Vf"/>-->
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.VfAPI"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.Service"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.ImportVFCAsset"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.ImportDCAE"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.DeploymentViewTests"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.VFCArtifacts"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.VfArtifacts"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.VfDeploymentInformationalArtifacts"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.AdminUserManagment"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.PNF"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.PropertiesAssignment"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.PropertiesAssignmentUpdateFlow">
- <methods>
- <exclude name="updatePropertyChangeVfiVersionTest"/>
- <exclude name="deletePropertyChangeVfiVersionTest"/>
- </methods>
- </class>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.ArchiveRestoreTest"/>
- <!-- <class name="org.openecomp.sdc.ci.tests.execute.sanity.Product"/> -->
-
- <class name="org.openecomp.sdc.ci.tests.US.ImportUpdateInformationalDeploymentArtifacts"/>
- <class name="org.openecomp.sdc.ci.tests.US.MIBsArtifactsOnResourceInstance"/>
- <class name="org.openecomp.sdc.ci.tests.US.NewArtifactTypeGuide"/>
- <class name="org.openecomp.sdc.ci.tests.US.RemoveRestrictionOfDeploymentArtifacts"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.OnboardingFlowsThroughAPI"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.PortMirroring"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.Annotation"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.UpgradeServices"/>
- <!-- <class name="org.openecomp.sdc.ci.tests.US.AddComponentInstancesArtifactsInCsar"/> -->
-
- </classes>
- </test> <!-- uitests -->
-</suite> <!-- uisuite --> \ No newline at end of file
diff --git a/ui-ci/src/main/resources/ci/testSuites/fullCI.xml b/ui-ci/src/main/resources/ci/testSuites/fullCI.xml
deleted file mode 100644
index 940026d30c..0000000000
--- a/ui-ci/src/main/resources/ci/testSuites/fullCI.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="uitests" configfailurepolicy="continue" parallel="methods" thread-count="2" data-provider-thread-count="2">
- <test name="uiSanity">
- <classes>
-
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.Onboard">
- <methods>
- <exclude name="onboardVNFTestSanity"/>
- </methods>
- </class>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.CatalogLeftPanelTest"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.Vf"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.Service"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.ImportVFCAsset"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.ImportDCAE"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.DeploymentViewTests"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.VFCArtifacts"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.VfArtifacts"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.VfDeploymentInformationalArtifacts"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.Product"/>
-
- <class name="org.openecomp.sdc.ci.tests.US.ImportUpdateInformationalDeploymentArtifacts"/>
- <class name="org.openecomp.sdc.ci.tests.US.MIBsArtifactsOnResourceInstance"/>
- <class name="org.openecomp.sdc.ci.tests.US.NewArtifactTypeGuide"/>
- <class name="org.openecomp.sdc.ci.tests.US.RemoveRestrictionOfDeploymentArtifacts"/>
-
-
-
-
-
- </classes>
- </test> <!-- uitests -->
-</suite> <!-- uisuite --> \ No newline at end of file
diff --git a/ui-ci/src/main/resources/ci/testSuites/gabSanity.xml b/ui-ci/src/main/resources/ci/testSuites/gabSanity.xml
deleted file mode 100644
index 035bf695ea..0000000000
--- a/ui-ci/src/main/resources/ci/testSuites/gabSanity.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="uitests" configfailurepolicy="continue" parallel="methods" thread-count="1"
- data-provider-thread-count="1">
-
- <parameter name="makeDistribution" value="false"/>
-
- <test name="uiSanity">
- <classes>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.GAB"/>
- </classes>
- </test>
-</suite>
diff --git a/ui-ci/src/main/resources/ci/testSuites/onapUiSanity.xml b/ui-ci/src/main/resources/ci/testSuites/onapUiSanity.xml
deleted file mode 100644
index 546f26981e..0000000000
--- a/ui-ci/src/main/resources/ci/testSuites/onapUiSanity.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="uitests" configfailurepolicy="continue" parallel="methods" thread-count="1"
- data-provider-thread-count="1">
-
- <parameter name="makeDistribution" value="false"/>
-
- <test name="uiSanity">
- <classes>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.Vf">
- <methods>
- <include name="changeInstanceNameInVfTest"/>
- </methods>
- </class>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.Service">
- <methods>
- <include name="updateService"/>
- </methods>
- </class>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.OnboardingFlowsUi">
- <methods>
- <include name="onapOnboardVNFflow"/>
- <include name="onapOnboardVSPValidationsSanityFlow"/>
- <include name="onboardPNFSoftwareInformationFlow"/>
- </methods>
- </class>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.GAB"/>
- </classes>
- </test>
-</suite>
diff --git a/ui-ci/src/main/resources/ci/testSuites/onboardVNFWithoutDistribution.xml b/ui-ci/src/main/resources/ci/testSuites/onboardVNFWithoutDistribution.xml
deleted file mode 100644
index 54c4ea854b..0000000000
--- a/ui-ci/src/main/resources/ci/testSuites/onboardVNFWithoutDistribution.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="uitests" configfailurepolicy="continue" parallel="methods" thread-count="1" data-provider-thread-count="1">
- <parameter name="makeDistribution" value="false"/>
- <parameter name="eraseAfterTests" value="false"/>
-
- <test name="uiSanity">
- <classes>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.Onboard">
- <methods>
- <include name="onboardVNFTestSanity"/>
- </methods>
- </class>
- </classes>
- </test> <!-- uitests -->
-</suite> <!-- uisuite --> \ No newline at end of file
diff --git a/ui-ci/src/main/resources/ci/testSuites/onboardingVNFs.xml b/ui-ci/src/main/resources/ci/testSuites/onboardingVNFs.xml
deleted file mode 100644
index c55da4274c..0000000000
--- a/ui-ci/src/main/resources/ci/testSuites/onboardingVNFs.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="uitests" configfailurepolicy="continue" parallel="methods" thread-count="2" data-provider-thread-count="2">
- <parameter name="makeDistribution" value="true"/>
-
- <test name="uiSanity">
- <classes>
-
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.Onboard">
- <methods>
- <exclude name="onboardVNFTestSanity"/>
- <exclude name="onboardVNFShotFlow"/>
- <exclude name="onboardRandomVNFsTest"/>
- </methods>
- </class>
-
-
- </classes>
- </test> <!-- uitests -->
-</suite> <!-- uisuite --> \ No newline at end of file
diff --git a/ui-ci/src/main/resources/ci/testSuites/onboardingVNFsShortFlow.xml b/ui-ci/src/main/resources/ci/testSuites/onboardingVNFsShortFlow.xml
deleted file mode 100644
index 4a4628a9ed..0000000000
--- a/ui-ci/src/main/resources/ci/testSuites/onboardingVNFsShortFlow.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="uitests" configfailurepolicy="continue" parallel="methods" thread-count="2" data-provider-thread-count="2">
- <parameter name="makeDistribution" value="true"/>
-
- <test name="uiSanity">
- <classes>
-
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.Onboard">
- <methods>
- <include name="onboardVNFShotFlow"/>
- </methods>
- </class>
-
-
- </classes>
- </test> <!-- uitests -->
-</suite> <!-- uisuite --> \ No newline at end of file
diff --git a/ui-ci/src/main/resources/ci/testSuites/propertyAssignmentSanity.xml b/ui-ci/src/main/resources/ci/testSuites/propertyAssignmentSanity.xml
deleted file mode 100644
index 0a7e30edf7..0000000000
--- a/ui-ci/src/main/resources/ci/testSuites/propertyAssignmentSanity.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="uitests" configfailurepolicy="continue" parallel="methods" thread-count="1" data-provider-thread-count="1">
- <parameter name="makeDistribution" value="true"/>
-
- <test name="uiSanity">
- <classes>
-
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.PropertiesAssignment"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.PropertiesAssignmentUpdateFlow">
- <methods>
- <exclude name="updatePropertyChangeVfiVersionTest"/>
- <exclude name="deletePropertyChangeVfiVersionTest"/>
- </methods>
- </class>
-
- </classes>
- </test> <!-- uitests -->
-</suite> <!-- uisuite --> \ No newline at end of file
diff --git a/ui-ci/src/main/resources/ci/testSuites/sanity.xml b/ui-ci/src/main/resources/ci/testSuites/sanity.xml
deleted file mode 100644
index c8fd8f14b1..0000000000
--- a/ui-ci/src/main/resources/ci/testSuites/sanity.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="uitests" configfailurepolicy="continue" parallel="methods" thread-count="4" data-provider-thread-count="2">
- <test name="uiSanity">
- <classes>
-
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.Onboard">
- <methods>
- <include name="onboardVNFTestSanity"/>
- </methods>
- </class>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.CatalogLeftPanelTest"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.Vf"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.Service"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.ImportVFCAsset"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.ImportDCAE"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.DeploymentViewTests"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.VFCArtifacts"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.VfArtifacts"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.VfDeploymentInformationalArtifacts"/>
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.AdminUserManagment"/>
- <!-- <class name="org.openecomp.sdc.ci.tests.execute.sanity.Product"/> -->
-
-
-
-
-
- </classes>
- </test> <!-- uitests -->
-</suite> <!-- uisuite --> \ No newline at end of file
diff --git a/ui-ci/src/main/resources/ci/testSuites/toscaValidationSuite.xml b/ui-ci/src/main/resources/ci/testSuites/toscaValidationSuite.xml
deleted file mode 100644
index 96c538dfc9..0000000000
--- a/ui-ci/src/main/resources/ci/testSuites/toscaValidationSuite.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="uitests" configfailurepolicy="continue" parallel="methods" thread-count="2" data-provider-thread-count="2">
- <parameter name="makeDistribution" value="false"/>
-
- <test name="OnbordingDataProviders">
- <classes>
-
- <class name="org.openecomp.sdc.ci.tests.dataProvider.OnbordingDataProviders">
- <methods>
- <include name="OnbordingDataProviders"/>
- <!-- <exclude name="onboardVNFShotFlow"/>
- <exclude name="onboardRandomVNFsTest"/> -->
- </methods>
- </class>
- <!-- <class name="org.openecomp.sdc.ci.tests.execute.sanity.Onboard">
- <methods>
- <include name="onboardRandomVNFsTest"/>
- </methods>
- </class> -->
-
- </classes>
- </test> <!-- uitests -->
-</suite> <!-- uisuite --> \ No newline at end of file
diff --git a/ui-ci/src/main/resources/ci/testSuites/vspValidationAllFlows.xml b/ui-ci/src/main/resources/ci/testSuites/vspValidationAllFlows.xml
deleted file mode 100644
index 71677a95a5..0000000000
--- a/ui-ci/src/main/resources/ci/testSuites/vspValidationAllFlows.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="uitests" configfailurepolicy="continue" parallel="methods" thread-count="1" data-provider-thread-count="1">
-
- <parameter name="makeDistribution" value="false"/>
-
- <test name="vspValidationAllFlows">
- <classes>
-
- <class name="org.openecomp.sdc.ci.tests.execute.sanity.OnboardingFlowsUi">
- <methods>
- <include name="onapOnboardVSPValidationsSanityFlow"/>
- <include name="onapOnboardVSPValidationsConfigurationChangeCheck"/>
- <include name="onapOnboardVSPCertificationQueryFlow"/>
- <include name="onapOnboardVSPComplianceCheckFlow"/>
- <include name="onapOnboardVSPComplianceCheckOperations"/>
- <include name="onapOnboardVSPCertificationQueryOperations"/>
- </methods>
- </class>
-
- </classes>
- </test> <!-- uitests -->
-</suite> <!-- uisuite --> \ No newline at end of file
diff --git a/ui-ci/src/main/resources/images/gizmorambo.jpg b/ui-ci/src/main/resources/images/gizmorambo.jpg
deleted file mode 100644
index c9a8fe8a64..0000000000
--- a/ui-ci/src/main/resources/images/gizmorambo.jpg
+++ /dev/null
Binary files differ
diff --git a/ui-ci/src/main/resources/log4j2.xml b/ui-ci/src/main/resources/log4j2.xml
deleted file mode 100644
index 5a92e611b0..0000000000
--- a/ui-ci/src/main/resources/log4j2.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="ERROR" packages="com.epam.ta.reportportal.log4j.appender">
- <properties>
- <property name="pattern">[%d{HH:mm:ss,SSS}] %-5p (%F:%L) - %m%n</property>
- <property name="report.pattern">%m%n</property>
- </properties>
- <Appenders>
- <Console name="Console" target="SYSTEM_OUT">
- <PatternLayout pattern="${pattern}"/>
- </Console>
- <ReportPortalLog4j2Appender name="ReportPortalAppender">
- <PatternLayout pattern="${pattern}"/>
- </ReportPortalLog4j2Appender>
- <Console name="ConsoleReport" target="SYSTEM_OUT">
- <PatternLayout pattern="${report.pattern}"/>
- </Console>
- <ReportPortalLog4j2Appender name="ReportPortalLogReport">
- <PatternLayout pattern="${report.pattern}"/>
- </ReportPortalLog4j2Appender>
- </Appenders>
- <Loggers>
- <Root level="all">
- <AppenderRef ref="Console"/>
- <AppenderRef ref="ReportPortalAppender"/>
- </Root>
- <logger name="upload.file.to.reportportal" level="all" additivity="false">
- <AppenderRef ref="ReportPortalAppender"/>
- </logger>
- <logger name="logger.report" level="all" additivity="false">
-<!-- <AppenderRef ref="ConsoleReport"/> -->
- <AppenderRef ref="ReportPortalLogReport"/>
- </logger>
- <logger name="rp.org.apache.http" level="WARN"/>
- <logger name="org.apache.http" level="WARN"/>
- <logger name="com.epam.reportportal" level="WARN"/>
- <logger name="CouchDbDataAdapter" level="WARN"/>
- </Loggers>
-</Configuration> \ No newline at end of file
diff --git a/ui-ci/src/main/resources/reportportal.properties b/ui-ci/src/main/resources/reportportal.properties
deleted file mode 100644
index 373610ef62..0000000000
--- a/ui-ci/src/main/resources/reportportal.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-rp.endpoint = http://reportportal.intl.att.com:8080
-rp.uuid = 4be0a132-e2ea-4a8c-a0d4-54367259d8d2
-rp.project= ASDC
-rp.mode = DEBUG
-rp.enable = true \ No newline at end of file
diff --git a/ui-ci/src/test/Completetheform.js b/ui-ci/src/test/Completetheform.js
deleted file mode 100644
index 7e8b7572cc..0000000000
--- a/ui-ci/src/test/Completetheform.js
+++ /dev/null
@@ -1,3 +0,0 @@
-/**
- * New node file
- */