aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIttay Stern <ittay.stern@att.com>2019-02-21 14:04:39 +0200
committerIttay Stern <ittay.stern@att.com>2019-02-21 14:21:18 +0200
commit135fc9d006c5923d4a1ca4822c5a71362f5db573 (patch)
treeaae5dce4bc0cc8ac2d6afa83bf0d86065e3c3b90
parent660beccba22f856a73b324f5394f2a79c709affd (diff)
Enable AsyncInstantiationBusinessLogic tests
Issue-ID: VID-378 Change-Id: If0dd6147f1ce7fba3db01c85359f17abad8bcb07 Signed-off-by: Ittay Stern <ittay.stern@att.com>
-rwxr-xr-xepsdk-app-onap/src/main/webapp/WEB-INF/conf/system.properties415
-rwxr-xr-xepsdk-app-onap/src/main/webapp/WEB-INF/conf/system_template.properties297
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/config/DataSourceConfig.java19
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/config/MockedAaiClientAndFeatureManagerConfig.java7
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBusinessLogicTest.java210
-rw-r--r--vid-app-common/src/test/resources/WEB-INF/conf/system.properties5
-rw-r--r--vid-app-common/src/test/resources/WEB-INF/fusion/orm/Fusion.hbm.xml394
-rw-r--r--vid-app-common/src/test/resources/WEB-INF/fusion/orm/Workflow.hbm.xml66
8 files changed, 972 insertions, 441 deletions
diff --git a/epsdk-app-onap/src/main/webapp/WEB-INF/conf/system.properties b/epsdk-app-onap/src/main/webapp/WEB-INF/conf/system.properties
index dba844112..1d0a45522 100755
--- a/epsdk-app-onap/src/main/webapp/WEB-INF/conf/system.properties
+++ b/epsdk-app-onap/src/main/webapp/WEB-INF/conf/system.properties
@@ -1,208 +1,209 @@
-###
-# ================================================================================
-# eCOMP Portal SDK
-# ================================================================================
-# Copyright (C) 2017 AT&T Intellectual Property
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ================================================================================
-###
-# Properties read by ECOMP Core library, ecompSDK-core.jar
-# testing - props 1.0
-##########################################################################
-# The following properties should NOT be changed by partner applications.
-##########################################################################
-
-application_user_id = 30000
-post_default_role_id = 16
-clustered = true
-
-#Enable Fusion Mobile capabilities for the application
-mobile_enable = false
-
-# Cache config file is needed on the classpath
-cache_config_file_path = /WEB-INF/classes/cache.ccf
-cache_switch = 199
-cache_load_on_startup = false
-
-user_name = fullName
-decryption_key = AGLDdG4D04BKm2IxIWEr8o==
-
-##########################################################################
-# The following properties MAY require changes by partner applications.
-##########################################################################
-
-#Oracle
-#db.userName=quantumbd
-#db.password=c1syn2yhmr
-#db.connectionURL=jdbc:oracle:thin:todo.link
-#db.hib.dialect=org.hibernate.dialect.Oracle10gDialect
-#db.driver=oracle.jdbc.driver.OracleDriver
-#Hibernate
-#hb.dialect=org.hibernate.dialect.Oracle10gDialect
-#hb.show_sql=true
-
-#Postgre
-#db.userName=XXXX
-#db.password=XXXX
-#db.connectionURL=jdbc:postgresql://XXXX/XX
-#db.hib.dialect=org.hibernate.dialect.PostgreSQLDialect
-#db.driver=org.postgresql.Driver
-#hb.dialect=org.hibernate.dialect.PostgreSQLDialect
-#hb.show_sql=true
-
-cookie_domain = onap.org
-#Mysql
-db.driver = org.mariadb.jdbc.Driver
-db.connectionURL = jdbc:mariadb://localhost:3306/vid_openecomp_epsdk
-db.userName = euser
-db.password = euser
-#db.hib.dialect = org.hibernate.dialect.MySQLDialect
-db.min_pool_size = 5
-db.max_pool_size = 10
-hb.dialect = org.hibernate.dialect.MySQLDialect
-
-hb.show_sql = false # this property is set in logger configuration to keep console output clean
-hb.idle_connection_test_period = 3600
-app_display_name = VID
-files_path = /tmp
-
-# menu settings
-#menu_query_name = menuData
-#menu_properties_file_location = /WEB-INF/fusion/menu/
-#application_menu_set_name = APP
-#application_menu_attribute_name = applicationMenuData
-#application_menu_properties_name = menu.properties
-#business_direct_menu_set_name = BD
-#business_direct_menu_properties_name = bd.menu.properties
-#business_direct_menu_attribute_name = businessDirectMenuData
-
-application_name = Virtual Infrastructure Deployment
-application_user_id = 30000
-post_default_role_id = 16
-clustered = true
-
-#Enable Fusion Mobile capabilities for the application
-mobile_enable = false
-
-# Cache config file is needed on the classpath
-cache_config_file_path = /WEB-INF/classes/cache.ccf
-cache_switch = 199
-cache_load_on_startup = false
-
-user_name = fullName
-decryption_key = AGLDdG4D04BKm2IxIWEr8o==
-
-#element map files
-element_map_file_path = app/fusionapp/files/
-element_map_icon_path = app/fusionapp/icons/
-
-#aai related properties
-#aai.server.url.base=https://aai.api.openecomp.org:8443/aai/
-#aai.server.url=https://aai.api.openecomp.org:8443/aai/v8/
-#aai.oldserver.url.base=https://aai.api.openecomp.org:8443/aai/servers/
-#aai.oldserver.url=https://aai.api.openecomp.org:8443/aai/servers/v3/
-aai.server.url.base=https://104.239.249.183:8443/aai/
-aai.server.url=https://104.239.249.183:8443/aai/v13/
-aai.oldserver.url.base=https://104.239.249.183:8443/aai/servers/
-aai.oldserver.url=https://104.239.249.183:8443/aai/servers/v3/
-aai.truststore.filename=tomcat_keystore
-aai.truststore.passwd.x=OBF:1ks51l8d1o3i1pcc1r2r1e211r391kls1pyj1z7u1njf1lx51go21hnj1y0k1mli1sop1k8o1j651vu91mxw1vun1mze1vv11j8x1k5i1sp11mjc1y161hlr1gm41m111nkj1z781pw31kku1r4p1e391r571pbm1o741l4x1ksp
-aai.keystore.filename=tomcat_keystore
-aai.keystore.passwd.x=OBF:1ks51l8d1o3i1pcc1r2r1e211r391kls1pyj1z7u1njf1lx51go21hnj1y0k1mli1sop1k8o1j651vu91mxw1vun1mze1vv11j8x1k5i1sp11mjc1y161hlr1gm41m111nkj1z781pw31kku1r4p1e391r571pbm1o741l4x1ksp
-
-aai.vid.username=VID
-aai.vid.passwd.x=OBF:1jm91i0v1jl9
-
-aai.use.client.cert=false
-aai.vnf.provstatus=PREPROV,NVTPROV,PROV,CAPPED
-#Cron Schedules
-log_cron = 0 0/1 * * * ?;
-mylogins_feed_cron = 0 0/60 * * * ?;
-#sessiontimeout_feed_cron = 0 * * * * ? *
-my_login_feed_output_dir = /tmp/MyLogins
-
-# ECOMP Portal Shared Context REST API URL
-ecomp_shared_context_rest_url= https://www.openecomp.org:8080/ecompportal/context
-
-# Link shown in Help menu
-contact_us_link = https://www.openecomp.org/EcompPortal/ECOMP+Portal+Home
-
-# An Unique 128-bit value defined to identify a specific version
-# of an application deployed on a specific virtual machine.
-# This value must be generated and updated by the application
-# which is using the ECOMP SDK at the time of its deployment.
-# Online Unique UUID generator - https://www.uuidgenerator.net/
-instance_uuid=292b461a-2954-4b63-a3f9-f916c7ad3bc0
-
-
-
-#authenticate user server
-authenticate_user_server=http://todo_enter_auth_server_hostname:8383/openid-connect-server-webapp/allUsers
-
-#MSO related properties
-#simulator
-#mso.server.url=http://localhost:8089
-#dev2dev
-#good
-mso.server.url=https://mso.api.simpledemo.onap.org:8443/onap/so/infra
-mso.polling.interval.msecs=2000
-mso.max.polls=3
-mso.user.name=infraportal
-mso.password.x=OBF:1ghz1kfx1j1w1m7w1i271e8q1eas1hzj1m4i1iyy1kch1gdz
-#E2E is v3
-mso.restapi.svc.e2einstance=/e2eServiceInstances/v3
-mso.restapi.svc.instance=/serviceInstantiation/v7/serviceInstances
-mso.restapi.svc.instance.deleteAndUnassign=/serviceInstantiation/v7/serviceInstances
-mso.restapi.vnf.instance=/serviceInstances/v6/<service_instance_id>/vnfs
-mso.restapi.vnf.changemanagement.instance=/serviceInstances/v6/<service_instance_id>/vnfs/<vnf_instance_id>/<request_type>
-mso.restapi.network.instance=/serviceInstances/v6/<service_instance_id>/networks
-mso.restapi.vf.module.instance=/serviceInstances/v6/<service_instance_id>/vnfs/<vnf_instance_id>/vfModules
-mso.restapi.vf.module.scaleout=/serviceInstantiation/v7/serviceInstances/<service_instance_id>/vnfs/<vnf_instance_id>/vfModules/scaleOut
-mso.restapi.volume.group.instance=/serviceInstances/v6/<service_instance_id>/vnfs/<vnf_instance_id>/volumeGroups
-mso.restapi.get.orc.req=/orchestrationRequests/v6
-mso.restapi.get.orc.reqs=/orchestrationRequests/v6?
-mso.restapi.get.man.tasks=/tasks/v1
-mso.restapi.configurations=/serviceInstances/v6/<service_instance_id>/configurations
-mso.restapi.configuration.instance=${mso.restapi.configurations}/<configuration_id>
-
-mso.restapi.serviceInstantiationApiRoot=/serviceInstantiation/v7
-mso.restapi.serviceInstanceCreate=${mso.restapi.serviceInstantiationApiRoot}/serviceInstances
-mso.restapi.serviceInstanceAssign=${mso.restapi.serviceInstantiationApiRoot}/serviceInstances/assign
-
-mso.restapi.cloudResourcesApiRoot=/cloudResources/v1
-mso.restapi.operationalEnvironment=${mso.restapi.cloudResourcesApiRoot}/operationalEnvironments/<operational_environment_id>
-
-mso.restapi.operationalEnvironment.activate=${mso.restapi.operationalEnvironment}/activate
-mso.restapi.operationalEnvironment.deactivate=${mso.restapi.operationalEnvironment}/deactivate
-mso.restapi.operationalEnvironment.create=${mso.restapi.cloudResourcesApiRoot}/operationalEnvironments
-
-mso.restapi.cloudResourcesRequestsApiRoot=/cloudResourcesRequests/v1
-mso.restapi.operationalEnvironment.cloudResourcesRequests.status=${mso.restapi.cloudResourcesRequestsApiRoot}?requestId=<request_id>
-
-mso.displayTestAPIOnScreen=true
-mso.defaultTestAPI=GR_API
-mso.maxOpenedInstantiationRequests=20
-mso.asyncPollingIntervalSeconds=1
-refreshTimeInstantiationDashboard=10
-
-vid.truststore.filename=/opt/app/vid/etc/org.onap.vid.trust.jks
-vid.truststore.passwd.x=OBF:1dx01j0e1hs01t981mis1dws156s1ojc1qjc1zsx1pw31qob1qr71pyj1zst1qhy1ojq156i1dua1mm21tb61hvi1j0g1du2
-mso.dme2.client.timeout=30000
-mso.dme2.client.read.timeout=120000
-scheduler.create.new.vnf.change.instance=/v1/ChangeManagement/schedules/
-scheduler.get.time.slots=/v1/ChangeManagement/schedules/
-scheduler.server.url=http://BYO.scheduler:8989/scheduler
-
-scheduler.submit.new.vnf.change=/v1/ChangeManagement/schedules/{scheduleId}/approvals
+###
+# ================================================================================
+# eCOMP Portal SDK
+# ================================================================================
+# Copyright (C) 2017 AT&T Intellectual Property
+# ================================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ================================================================================
+###
+# Properties read by ECOMP Core library, ecompSDK-core.jar
+# testing - props 1.0
+##########################################################################
+# The following properties should NOT be changed by partner applications.
+##########################################################################
+
+application_user_id = 30000
+post_default_role_id = 16
+clustered = true
+
+#Enable Fusion Mobile capabilities for the application
+mobile_enable = false
+
+# Cache config file is needed on the classpath
+cache_config_file_path = /WEB-INF/classes/cache.ccf
+cache_switch = 199
+cache_load_on_startup = false
+
+user_name = fullName
+decryption_key = AGLDdG4D04BKm2IxIWEr8o==
+
+##########################################################################
+# The following properties MAY require changes by partner applications.
+##########################################################################
+
+#Oracle
+#db.userName=quantumbd
+#db.password=c1syn2yhmr
+#db.connectionURL=jdbc:oracle:thin:todo.link
+#db.hib.dialect=org.hibernate.dialect.Oracle10gDialect
+#db.driver=oracle.jdbc.driver.OracleDriver
+#Hibernate
+#hb.dialect=org.hibernate.dialect.Oracle10gDialect
+#hb.show_sql=true
+
+#Postgre
+#db.userName=XXXX
+#db.password=XXXX
+#db.connectionURL=jdbc:postgresql://XXXX/XX
+#db.hib.dialect=org.hibernate.dialect.PostgreSQLDialect
+#db.driver=org.postgresql.Driver
+#hb.dialect=org.hibernate.dialect.PostgreSQLDialect
+#hb.show_sql=true
+
+cookie_domain = onap.org
+#Mysql
+db.driver = org.mariadb.jdbc.Driver
+db.connectionURL = jdbc:mariadb://localhost:3306/vid_openecomp_epsdk
+db.userName = euser
+db.password = euser
+#db.hib.dialect = org.hibernate.dialect.MySQLDialect
+db.min_pool_size = 5
+db.max_pool_size = 10
+hb.dialect = org.hibernate.dialect.MySQLDialect
+
+hb.show_sql = false # this property is set in logger configuration to keep console output clean
+hb.idle_connection_test_period = 3600
+app_display_name = VID
+files_path = /tmp
+
+# menu settings
+#menu_query_name = menuData
+#menu_properties_file_location = /WEB-INF/fusion/menu/
+#application_menu_set_name = APP
+#application_menu_attribute_name = applicationMenuData
+#application_menu_properties_name = menu.properties
+#business_direct_menu_set_name = BD
+#business_direct_menu_properties_name = bd.menu.properties
+#business_direct_menu_attribute_name = businessDirectMenuData
+
+application_name = Virtual Infrastructure Deployment
+application_user_id = 30000
+post_default_role_id = 16
+clustered = true
+
+#Enable Fusion Mobile capabilities for the application
+mobile_enable = false
+
+# Cache config file is needed on the classpath
+cache_config_file_path = /WEB-INF/classes/cache.ccf
+cache_switch = 199
+cache_load_on_startup = false
+
+user_name = fullName
+decryption_key = AGLDdG4D04BKm2IxIWEr8o==
+
+#element map files
+element_map_file_path = app/fusionapp/files/
+element_map_icon_path = app/fusionapp/icons/
+
+#aai related properties
+#aai.server.url.base=https://aai.api.openecomp.org:8443/aai/
+#aai.server.url=https://aai.api.openecomp.org:8443/aai/v8/
+#aai.oldserver.url.base=https://aai.api.openecomp.org:8443/aai/servers/
+#aai.oldserver.url=https://aai.api.openecomp.org:8443/aai/servers/v3/
+aai.server.url.base=https://104.239.249.183:8443/aai/
+aai.server.url=https://104.239.249.183:8443/aai/v13/
+aai.oldserver.url.base=https://104.239.249.183:8443/aai/servers/
+aai.oldserver.url=https://104.239.249.183:8443/aai/servers/v3/
+aai.truststore.filename=tomcat_keystore
+aai.truststore.passwd.x=OBF:1ks51l8d1o3i1pcc1r2r1e211r391kls1pyj1z7u1njf1lx51go21hnj1y0k1mli1sop1k8o1j651vu91mxw1vun1mze1vv11j8x1k5i1sp11mjc1y161hlr1gm41m111nkj1z781pw31kku1r4p1e391r571pbm1o741l4x1ksp
+aai.keystore.filename=tomcat_keystore
+aai.keystore.passwd.x=OBF:1ks51l8d1o3i1pcc1r2r1e211r391kls1pyj1z7u1njf1lx51go21hnj1y0k1mli1sop1k8o1j651vu91mxw1vun1mze1vv11j8x1k5i1sp11mjc1y161hlr1gm41m111nkj1z781pw31kku1r4p1e391r571pbm1o741l4x1ksp
+
+aai.vid.username=VID
+aai.vid.passwd.x=OBF:1jm91i0v1jl9
+
+aai.use.client.cert=false
+aai.vnf.provstatus=PREPROV,NVTPROV,PROV,CAPPED
+#Cron Schedules
+log_cron = 0 0/1 * * * ?;
+mylogins_feed_cron = 0 0/60 * * * ?;
+#sessiontimeout_feed_cron = 0 * * * * ? *
+my_login_feed_output_dir = /tmp/MyLogins
+
+# ECOMP Portal Shared Context REST API URL
+ecomp_shared_context_rest_url= https://www.openecomp.org:8080/ecompportal/context
+
+# Link shown in Help menu
+contact_us_link = https://www.openecomp.org/EcompPortal/ECOMP+Portal+Home
+
+# An Unique 128-bit value defined to identify a specific version
+# of an application deployed on a specific virtual machine.
+# This value must be generated and updated by the application
+# which is using the ECOMP SDK at the time of its deployment.
+# Online Unique UUID generator - https://www.uuidgenerator.net/
+instance_uuid=292b461a-2954-4b63-a3f9-f916c7ad3bc0
+
+
+
+#authenticate user server
+authenticate_user_server=http://todo_enter_auth_server_hostname:8383/openid-connect-server-webapp/allUsers
+
+#MSO related properties
+#simulator
+#mso.server.url=http://localhost:8089
+#dev2dev
+#good
+mso.server.url=https://mso.api.simpledemo.onap.org:8443/onap/so/infra
+mso.polling.interval.msecs=2000
+mso.max.polls=3
+mso.user.name=infraportal
+mso.password.x=OBF:1ghz1kfx1j1w1m7w1i271e8q1eas1hzj1m4i1iyy1kch1gdz
+#E2E is v3
+mso.restapi.svc.e2einstance=/e2eServiceInstances/v3
+mso.restapi.svc.instance=/serviceInstantiation/v7/serviceInstances
+mso.restapi.svc.instance.deleteAndUnassign=/serviceInstantiation/v7/serviceInstances
+mso.restapi.vnf.instance=/serviceInstances/v6/<service_instance_id>/vnfs
+mso.restapi.vnf.changemanagement.instance=/serviceInstances/v6/<service_instance_id>/vnfs/<vnf_instance_id>/<request_type>
+mso.restapi.network.instance=/serviceInstances/v6/<service_instance_id>/networks
+mso.restapi.vf.module.instance=/serviceInstances/v6/<service_instance_id>/vnfs/<vnf_instance_id>/vfModules
+mso.restapi.vf.module.scaleout=/serviceInstantiation/v7/serviceInstances/<service_instance_id>/vnfs/<vnf_instance_id>/vfModules/scaleOut
+mso.restapi.volume.group.instance=/serviceInstances/v6/<service_instance_id>/vnfs/<vnf_instance_id>/volumeGroups
+mso.restapi.instance.group=/serviceInstantiation/v7/instanceGroups
+mso.restapi.get.orc.req=/orchestrationRequests/v6
+mso.restapi.get.orc.reqs=/orchestrationRequests/v6?
+mso.restapi.get.man.tasks=/tasks/v1
+mso.restapi.configurations=/serviceInstances/v6/<service_instance_id>/configurations
+mso.restapi.configuration.instance=${mso.restapi.configurations}/<configuration_id>
+
+mso.restapi.serviceInstantiationApiRoot=/serviceInstantiation/v7
+mso.restapi.serviceInstanceCreate=${mso.restapi.serviceInstantiationApiRoot}/serviceInstances
+mso.restapi.serviceInstanceAssign=${mso.restapi.serviceInstantiationApiRoot}/serviceInstances/assign
+
+mso.restapi.cloudResourcesApiRoot=/cloudResources/v1
+mso.restapi.operationalEnvironment=${mso.restapi.cloudResourcesApiRoot}/operationalEnvironments/<operational_environment_id>
+
+mso.restapi.operationalEnvironment.activate=${mso.restapi.operationalEnvironment}/activate
+mso.restapi.operationalEnvironment.deactivate=${mso.restapi.operationalEnvironment}/deactivate
+mso.restapi.operationalEnvironment.create=${mso.restapi.cloudResourcesApiRoot}/operationalEnvironments
+
+mso.restapi.cloudResourcesRequestsApiRoot=/cloudResourcesRequests/v1
+mso.restapi.operationalEnvironment.cloudResourcesRequests.status=${mso.restapi.cloudResourcesRequestsApiRoot}?requestId=<request_id>
+
+mso.displayTestAPIOnScreen=true
+mso.defaultTestAPI=GR_API
+mso.maxOpenedInstantiationRequests=20
+mso.asyncPollingIntervalSeconds=1
+refreshTimeInstantiationDashboard=10
+
+vid.truststore.filename=/opt/app/vid/etc/org.onap.vid.trust.jks
+vid.truststore.passwd.x=OBF:1dx01j0e1hs01t981mis1dws156s1ojc1qjc1zsx1pw31qob1qr71pyj1zst1qhy1ojq156i1dua1mm21tb61hvi1j0g1du2
+mso.dme2.client.timeout=30000
+mso.dme2.client.read.timeout=120000
+scheduler.create.new.vnf.change.instance=/v1/ChangeManagement/schedules/
+scheduler.get.time.slots=/v1/ChangeManagement/schedules/
+scheduler.server.url=http://BYO.scheduler:8989/scheduler
+
+scheduler.submit.new.vnf.change=/v1/ChangeManagement/schedules/{scheduleId}/approvals
scheduler.get.schedules=/v1/ChangeManagement/schedules/scheduleDetails/ \ No newline at end of file
diff --git a/epsdk-app-onap/src/main/webapp/WEB-INF/conf/system_template.properties b/epsdk-app-onap/src/main/webapp/WEB-INF/conf/system_template.properties
index 6b5b37c91..5668b785b 100755
--- a/epsdk-app-onap/src/main/webapp/WEB-INF/conf/system_template.properties
+++ b/epsdk-app-onap/src/main/webapp/WEB-INF/conf/system_template.properties
@@ -1,148 +1,149 @@
-#DB Info
-#db.userName=XXXX
-#db.password=XXXX
-#db.connectionURL=jdbc:oracle:thin:@XXXX/XX
-#db.hib.dialect=org.hibernate.dialect.Oracle10gDialect
-#db.driver=oracle.jdbc.driver.OracleDriver
-#Hibernate
-#hb.dialect=org.hibernate.dialect.Oracle10gDialect
-#hb.show_sql=true
-
-#Postgre
-#db.userName=XXXX
-#db.password=XXXX
-#db.connectionURL=jdbc:postgresql://XXXX/XX
-#db.hib.dialect=org.hibernate.dialect.PostgreSQLDialect
-#db.driver=org.postgresql.Driver
-#hb.dialect=org.hibernate.dialect.PostgreSQLDialect
-#hb.show_sql=true
-
-cookie_domain = onap.org
-#mysql
-db.driver = org.mariadb.jdbc.Driver
-db.connectionURL = jdbc:mariadb://${VID_MYSQL_HOST}:${VID_MYSQL_PORT}/${VID_MYSQL_DBNAME}
-db.userName = ${VID_MYSQL_USER}
-db.password = ${VID_MYSQL_PASS}
-db.hib.dialect = org.hibernate.dialect.MySQLDialect
-db.min_pool_size = 5
-db.max_pool_size = 10
-hb.dialect = org.hibernate.dialect.MySQLDialect
-
-hb.show_sql = false # this property is set in logger configuration to keep console output clean
-hb.idle_connection_test_period = 3600
-app_display_name = ${VID_APP_DISPLAY_NAME}
-files_path = /tmp
-
-# menu settings
-#menu_query_name = menuData
-#menu_properties_file_location = /WEB-INF/fusion/menu/
-#application_menu_set_name = APP
-#application_menu_attribute_name = applicationMenuData
-#application_menu_properties_name = menu.properties
-#business_direct_menu_set_name = BD
-#business_direct_menu_properties_name = bd.menu.properties
-#business_direct_menu_attribute_name = businessDirectMenuData
-
-application_name = Virtual Infrastructure Deployment
-application_user_id = 30000
-post_default_role_id = 16
-clustered = true
-
-#Enable Fusion Mobile capabilities for the application
-mobile_enable = false
-
-# Cache config file is needed on the classpath
-cache_config_file_path = /WEB-INF/classes/cache.ccf
-cache_switch = 199
-cache_load_on_startup = false
-
-user_name = fullName
-
-decryption_key = ${VID_DECRYPTION_KEY}
-
-#element map files
-element_map_file_path = /tmp
-element_map_icon_path = app/vid/icons/
-
-#aai related properties
-aai.server.url.base=${VID_AAI_URL}/aai/
-aai.server.url=${VID_AAI_URL}/aai/v13/
-aai.oldserver.url.base=${VID_AAI_URL}/aai/servers/
-aai.oldserver.url=${VID_AAI_URL}/aai/servers/v3/
-aai.truststore.filename=${AAI_TRUSTSTORE_FILENAME}
-aai.truststore.passwd.x=${AAI_TRUSTSTORE_PASSWD_X}
-aai.keystore.filename=${AAI_KEYSTORE_FILENAME}
-aai.keystore.passwd.x=${AAI_KEYSTORE_PASSWD_X}
-aai.vid.username=${AAI_VID_UID}
-aai.vid.passwd.x=${AAI_VID_PASSWD_X}
-aai.use.client.cert=${AAI_USE_CLIENT_CERT}
-aai.vnf.provstatus=${AAI_VNF_PROVSTATUS}
-
-# ECOMP Portal Shared Context REST API URL
-ecomp_shared_context_rest_url=${VID_ECOMP_SHARED_CONTEXT_REST_URL}
-# Link shown in Help menu
-contact_us_link=${VID_CONTACT_US_LINK}
-#Cron Schedules
-log_cron = 0 0/1 * * * ?;
-mylogins_feed_cron = 0 0/60 * * * ?;
-#sessiontimeout_feed_cron = 0 * * * * ? *
-my_login_feed_output_dir = ${VID_MYLOGIN_FEED_DIRECTORY}
-
-# An Unique 128-bit value defined to identify a specific version
-# of an application deployed on a specific virtual machine.
-# This value must be generated and updated by the application
-# which is using the ECOMP SDK at the time of its deployment.
-# Online Unique UUID generator - https://www.uuidgenerator.net/
-instance_uuid=292b461a-2954-4b63-a3f9-f916c7ad3bc0
-
-
-#MSO related properties
-#simulator
-mso.server.url=${VID_MSO_SERVER_URL}
-mso.polling.interval.msecs=${MSO_POLLING_INTERVAL_MSECS}
-mso.max.polls=10
-mso.user.name=${VID_MSO_USER}
-mso.password.x=${VID_MSO_PASS}
-#E2E is v3
-mso.restapi.svc.e2einstance=/e2eServiceInstances/v3
-mso.restapi.svc.instance=/serviceInstantiation/v7/serviceInstances
-mso.restapi.svc.instance.deleteAndUnassign=/serviceInstantiation/v7/serviceInstances
-mso.restapi.vnf.instance=/serviceInstances/v6/<service_instance_id>/vnfs
-mso.restapi.vnf.changemanagement.instance=/serviceInstances/v6/<service_instance_id>/vnfs/<vnf_instance_id>/<request_type>
-mso.restapi.network.instance=/serviceInstances/v6/<service_instance_id>/networks
-mso.restapi.vf.module.scaleout=/serviceInstantiation/v7/serviceInstances/<service_instance_id>/vnfs/<vnf_instance_id>/vfModules/scaleOut
-mso.restapi.vf.module.instance=/serviceInstances/v6/<service_instance_id>/vnfs/<vnf_instance_id>/vfModules
-mso.restapi.volume.group.instance=/serviceInstances/v6/<service_instance_id>/vnfs/<vnf_instance_id>/volumeGroups
-mso.restapi.get.orc.req=/orchestrationRequests/v6
-mso.restapi.get.orc.reqs=/orchestrationRequests/v6?
-mso.restapi.get.man.tasks=/tasks/v1
-mso.restapi.configurations=/serviceInstances/v6/<service_instance_id>/configurations
-mso.restapi.configuration.instance=${mso.restapi.configurations}/<configuration_id>
-
-mso.restapi.serviceInstantiationApiRoot=/serviceInstantiation/v7
-mso.restapi.serviceInstanceCreate=${mso.restapi.serviceInstantiationApiRoot}/serviceInstances
-mso.restapi.serviceInstanceAssign=${mso.restapi.serviceInstantiationApiRoot}/serviceInstances/assign
-
-mso.restapi.cloudResourcesApiRoot=/cloudResources/v1
-mso.restapi.operationalEnvironment=${mso.restapi.cloudResourcesApiRoot}/operationalEnvironments/<operational_environment_id>
-
-mso.restapi.operationalEnvironment.activate=${mso.restapi.operationalEnvironment}/activate
-mso.restapi.operationalEnvironment.deactivate=${mso.restapi.operationalEnvironment}/deactivate
-mso.restapi.operationalEnvironment.create=${mso.restapi.cloudResourcesApiRoot}/operationalEnvironments
-
-mso.restapi.cloudResourcesRequestsApiRoot=/cloudResourcesRequests/v1
-mso.restapi.operationalEnvironment.cloudResourcesRequests.status=${mso.restapi.cloudResourcesRequestsApiRoot}?requestId=<request_id>
-
-mso.displayTestAPIOnScreen=true
-mso.defaultTestAPI=GR_API
-mso.maxOpenedInstantiationRequests=20
-mso.asyncPollingIntervalSeconds=1
-refreshTimeInstantiationDashboard=10
-
-vid.truststore.filename=${VID_TRUSTSTORE_FILE}
-vid.truststore.passwd.x=${VID_TRUSTSTORE_PASS}
-mso.dme2.client.timeout=${MSO_DME2_CLIENT_TIMEOUT}
-mso.dme2.client.read.timeout=${MSO_DME2_CLIENT_READ_TIMEOUT}
-mso.dme2.server.url=${MSO_DME2_SERVER_URL}
-mso.dme2.enabled=${MSO_DME2_ENABLED}
-scheduler.basic.auth=
+#DB Info
+#db.userName=XXXX
+#db.password=XXXX
+#db.connectionURL=jdbc:oracle:thin:@XXXX/XX
+#db.hib.dialect=org.hibernate.dialect.Oracle10gDialect
+#db.driver=oracle.jdbc.driver.OracleDriver
+#Hibernate
+#hb.dialect=org.hibernate.dialect.Oracle10gDialect
+#hb.show_sql=true
+
+#Postgre
+#db.userName=XXXX
+#db.password=XXXX
+#db.connectionURL=jdbc:postgresql://XXXX/XX
+#db.hib.dialect=org.hibernate.dialect.PostgreSQLDialect
+#db.driver=org.postgresql.Driver
+#hb.dialect=org.hibernate.dialect.PostgreSQLDialect
+#hb.show_sql=true
+
+cookie_domain = onap.org
+#mysql
+db.driver = org.mariadb.jdbc.Driver
+db.connectionURL = jdbc:mariadb://${VID_MYSQL_HOST}:${VID_MYSQL_PORT}/${VID_MYSQL_DBNAME}
+db.userName = ${VID_MYSQL_USER}
+db.password = ${VID_MYSQL_PASS}
+db.hib.dialect = org.hibernate.dialect.MySQLDialect
+db.min_pool_size = 5
+db.max_pool_size = 10
+hb.dialect = org.hibernate.dialect.MySQLDialect
+
+hb.show_sql = false # this property is set in logger configuration to keep console output clean
+hb.idle_connection_test_period = 3600
+app_display_name = ${VID_APP_DISPLAY_NAME}
+files_path = /tmp
+
+# menu settings
+#menu_query_name = menuData
+#menu_properties_file_location = /WEB-INF/fusion/menu/
+#application_menu_set_name = APP
+#application_menu_attribute_name = applicationMenuData
+#application_menu_properties_name = menu.properties
+#business_direct_menu_set_name = BD
+#business_direct_menu_properties_name = bd.menu.properties
+#business_direct_menu_attribute_name = businessDirectMenuData
+
+application_name = Virtual Infrastructure Deployment
+application_user_id = 30000
+post_default_role_id = 16
+clustered = true
+
+#Enable Fusion Mobile capabilities for the application
+mobile_enable = false
+
+# Cache config file is needed on the classpath
+cache_config_file_path = /WEB-INF/classes/cache.ccf
+cache_switch = 199
+cache_load_on_startup = false
+
+user_name = fullName
+
+decryption_key = ${VID_DECRYPTION_KEY}
+
+#element map files
+element_map_file_path = /tmp
+element_map_icon_path = app/vid/icons/
+
+#aai related properties
+aai.server.url.base=${VID_AAI_URL}/aai/
+aai.server.url=${VID_AAI_URL}/aai/v13/
+aai.oldserver.url.base=${VID_AAI_URL}/aai/servers/
+aai.oldserver.url=${VID_AAI_URL}/aai/servers/v3/
+aai.truststore.filename=${AAI_TRUSTSTORE_FILENAME}
+aai.truststore.passwd.x=${AAI_TRUSTSTORE_PASSWD_X}
+aai.keystore.filename=${AAI_KEYSTORE_FILENAME}
+aai.keystore.passwd.x=${AAI_KEYSTORE_PASSWD_X}
+aai.vid.username=${AAI_VID_UID}
+aai.vid.passwd.x=${AAI_VID_PASSWD_X}
+aai.use.client.cert=${AAI_USE_CLIENT_CERT}
+aai.vnf.provstatus=${AAI_VNF_PROVSTATUS}
+
+# ECOMP Portal Shared Context REST API URL
+ecomp_shared_context_rest_url=${VID_ECOMP_SHARED_CONTEXT_REST_URL}
+# Link shown in Help menu
+contact_us_link=${VID_CONTACT_US_LINK}
+#Cron Schedules
+log_cron = 0 0/1 * * * ?;
+mylogins_feed_cron = 0 0/60 * * * ?;
+#sessiontimeout_feed_cron = 0 * * * * ? *
+my_login_feed_output_dir = ${VID_MYLOGIN_FEED_DIRECTORY}
+
+# An Unique 128-bit value defined to identify a specific version
+# of an application deployed on a specific virtual machine.
+# This value must be generated and updated by the application
+# which is using the ECOMP SDK at the time of its deployment.
+# Online Unique UUID generator - https://www.uuidgenerator.net/
+instance_uuid=292b461a-2954-4b63-a3f9-f916c7ad3bc0
+
+
+#MSO related properties
+#simulator
+mso.server.url=${VID_MSO_SERVER_URL}
+mso.polling.interval.msecs=${MSO_POLLING_INTERVAL_MSECS}
+mso.max.polls=10
+mso.user.name=${VID_MSO_USER}
+mso.password.x=${VID_MSO_PASS}
+#E2E is v3
+mso.restapi.svc.e2einstance=/e2eServiceInstances/v3
+mso.restapi.svc.instance=/serviceInstantiation/v7/serviceInstances
+mso.restapi.svc.instance.deleteAndUnassign=/serviceInstantiation/v7/serviceInstances
+mso.restapi.vnf.instance=/serviceInstances/v6/<service_instance_id>/vnfs
+mso.restapi.vnf.changemanagement.instance=/serviceInstances/v6/<service_instance_id>/vnfs/<vnf_instance_id>/<request_type>
+mso.restapi.network.instance=/serviceInstances/v6/<service_instance_id>/networks
+mso.restapi.vf.module.scaleout=/serviceInstantiation/v7/serviceInstances/<service_instance_id>/vnfs/<vnf_instance_id>/vfModules/scaleOut
+mso.restapi.vf.module.instance=/serviceInstances/v6/<service_instance_id>/vnfs/<vnf_instance_id>/vfModules
+mso.restapi.volume.group.instance=/serviceInstances/v6/<service_instance_id>/vnfs/<vnf_instance_id>/volumeGroups
+mso.restapi.instance.group=/serviceInstantiation/v7/instanceGroups
+mso.restapi.get.orc.req=/orchestrationRequests/v6
+mso.restapi.get.orc.reqs=/orchestrationRequests/v6?
+mso.restapi.get.man.tasks=/tasks/v1
+mso.restapi.configurations=/serviceInstances/v6/<service_instance_id>/configurations
+mso.restapi.configuration.instance=${mso.restapi.configurations}/<configuration_id>
+
+mso.restapi.serviceInstantiationApiRoot=/serviceInstantiation/v7
+mso.restapi.serviceInstanceCreate=${mso.restapi.serviceInstantiationApiRoot}/serviceInstances
+mso.restapi.serviceInstanceAssign=${mso.restapi.serviceInstantiationApiRoot}/serviceInstances/assign
+
+mso.restapi.cloudResourcesApiRoot=/cloudResources/v1
+mso.restapi.operationalEnvironment=${mso.restapi.cloudResourcesApiRoot}/operationalEnvironments/<operational_environment_id>
+
+mso.restapi.operationalEnvironment.activate=${mso.restapi.operationalEnvironment}/activate
+mso.restapi.operationalEnvironment.deactivate=${mso.restapi.operationalEnvironment}/deactivate
+mso.restapi.operationalEnvironment.create=${mso.restapi.cloudResourcesApiRoot}/operationalEnvironments
+
+mso.restapi.cloudResourcesRequestsApiRoot=/cloudResourcesRequests/v1
+mso.restapi.operationalEnvironment.cloudResourcesRequests.status=${mso.restapi.cloudResourcesRequestsApiRoot}?requestId=<request_id>
+
+mso.displayTestAPIOnScreen=true
+mso.defaultTestAPI=GR_API
+mso.maxOpenedInstantiationRequests=20
+mso.asyncPollingIntervalSeconds=1
+refreshTimeInstantiationDashboard=10
+
+vid.truststore.filename=${VID_TRUSTSTORE_FILE}
+vid.truststore.passwd.x=${VID_TRUSTSTORE_PASS}
+mso.dme2.client.timeout=${MSO_DME2_CLIENT_TIMEOUT}
+mso.dme2.client.read.timeout=${MSO_DME2_CLIENT_READ_TIMEOUT}
+mso.dme2.server.url=${MSO_DME2_SERVER_URL}
+mso.dme2.enabled=${MSO_DME2_ENABLED}
+scheduler.basic.auth=
diff --git a/vid-app-common/src/test/java/org/onap/vid/config/DataSourceConfig.java b/vid-app-common/src/test/java/org/onap/vid/config/DataSourceConfig.java
index ba8060da7..b25a7f238 100644
--- a/vid-app-common/src/test/java/org/onap/vid/config/DataSourceConfig.java
+++ b/vid-app-common/src/test/java/org/onap/vid/config/DataSourceConfig.java
@@ -1,21 +1,25 @@
package org.onap.vid.config;
+import java.util.Properties;
+import javax.sql.DataSource;
import org.hibernate.SessionFactory;
import org.onap.portalsdk.core.service.DataAccessService;
import org.onap.portalsdk.core.service.DataAccessServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.core.io.Resource;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
import org.springframework.orm.hibernate4.HibernateTransactionManager;
import org.springframework.orm.hibernate4.LocalSessionFactoryBean;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;
-import javax.sql.DataSource;
-import java.util.Properties;
-
+/*
+this class enable using in-memory DB in Unit test.
+*/
@Configuration
@EnableTransactionManagement
public class DataSourceConfig {
@@ -36,8 +40,15 @@ public class DataSourceConfig {
properties.put("hbm2ddl.auto", "create");
properties.put("hibernate.hbm2ddl.auto", "create");
- sessionFactory.setPackagesToScan("org.onap");
+ Resource[] mappingLocations = {
+ new ClassPathResource("WEB-INF/fusion/orm/Fusion.hbm.xml"),
+ new ClassPathResource("WEB-INF/fusion/orm/Workflow.hbm.xml"),
+ new ClassPathResource("WEB-INF/fusion/orm/RNoteBookIntegration.hbm.xml")
+ };
+
sessionFactory.setHibernateProperties(properties);
+ sessionFactory.setPackagesToScan("org.onap");
+ sessionFactory.setMappingLocations(mappingLocations);
return sessionFactory;
}
diff --git a/vid-app-common/src/test/java/org/onap/vid/config/MockedAaiClientAndFeatureManagerConfig.java b/vid-app-common/src/test/java/org/onap/vid/config/MockedAaiClientAndFeatureManagerConfig.java
index 1a4eb528e..83b125949 100644
--- a/vid-app-common/src/test/java/org/onap/vid/config/MockedAaiClientAndFeatureManagerConfig.java
+++ b/vid-app-common/src/test/java/org/onap/vid/config/MockedAaiClientAndFeatureManagerConfig.java
@@ -2,6 +2,8 @@ package org.onap.vid.config;
import org.mockito.Mockito;
import org.onap.vid.aai.AaiClientInterface;
+import org.onap.vid.services.CloudOwnerService;
+import org.onap.vid.services.CloudOwnerServiceImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.togglz.core.manager.FeatureManager;
@@ -15,6 +17,11 @@ public class MockedAaiClientAndFeatureManagerConfig {
}
@Bean
+ public CloudOwnerService cloudOwnerService(AaiClientInterface aaiClient, FeatureManager featureManager) {
+ return new CloudOwnerServiceImpl(aaiClient, featureManager);
+ }
+
+ @Bean
public AaiClientInterface aaiClient() {
return Mockito.mock(AaiClientInterface.class);
}
diff --git a/vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBusinessLogicTest.java b/vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBusinessLogicTest.java
index 96b39bcb1..0e74fbd9a 100644
--- a/vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBusinessLogicTest.java
+++ b/vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBusinessLogicTest.java
@@ -1,9 +1,65 @@
package org.onap.vid.services;
+import static com.google.common.collect.Maps.newHashMap;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.contains;
+import static org.hamcrest.Matchers.hasItem;
+import static org.hamcrest.Matchers.hasItems;
+import static org.hamcrest.Matchers.hasProperty;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.matchesPattern;
+import static org.hamcrest.Matchers.not;
+import static org.hamcrest.core.Every.everyItem;
+import static org.hamcrest.core.IsEqual.equalTo;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.anyInt;
+import static org.mockito.Mockito.anyString;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import static org.onap.vid.job.Job.JobStatus.COMPLETED;
+import static org.onap.vid.job.Job.JobStatus.FAILED;
+import static org.onap.vid.job.Job.JobStatus.IN_PROGRESS;
+import static org.onap.vid.job.Job.JobStatus.PAUSE;
+import static org.onap.vid.job.Job.JobStatus.PENDING;
+import static org.onap.vid.job.Job.JobStatus.STOPPED;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertNull;
+import static org.testng.Assert.assertTrue;
+
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.time.Instant;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.UUID;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
+import javax.inject.Inject;
import net.javacrumbs.jsonunit.JsonAssert;
import org.apache.commons.io.IOUtils;
import org.hibernate.SessionFactory;
@@ -36,9 +92,21 @@ import org.onap.vid.model.JobAuditStatus;
import org.onap.vid.model.JobAuditStatus.SourceStatus;
import org.onap.vid.model.NameCounter;
import org.onap.vid.model.ServiceInfo;
-import org.onap.vid.model.serviceInstantiation.*;
+import org.onap.vid.model.serviceInstantiation.InstanceGroup;
+import org.onap.vid.model.serviceInstantiation.Network;
+import org.onap.vid.model.serviceInstantiation.ServiceInstantiation;
+import org.onap.vid.model.serviceInstantiation.VfModule;
+import org.onap.vid.model.serviceInstantiation.Vnf;
import org.onap.vid.mso.MsoOperationalEnvironmentTest;
-import org.onap.vid.mso.model.*;
+import org.onap.vid.mso.model.InstanceGroupInstantiationRequestDetails;
+import org.onap.vid.mso.model.ModelInfo;
+import org.onap.vid.mso.model.NetworkInstantiationRequestDetails;
+import org.onap.vid.mso.model.ServiceDeletionRequestDetails;
+import org.onap.vid.mso.model.ServiceInstantiationRequestDetails;
+import org.onap.vid.mso.model.VfModuleInstantiationRequestDetails;
+import org.onap.vid.mso.model.VfModuleMacro;
+import org.onap.vid.mso.model.VnfInstantiationRequestDetails;
+import org.onap.vid.mso.model.VolumeGroupRequestDetails;
import org.onap.vid.mso.rest.AsyncRequestStatus;
import org.onap.vid.properties.Features;
import org.onap.vid.testUtils.TestUtils;
@@ -46,33 +114,11 @@ import org.onap.vid.utils.DaoUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.testng.Assert;
-import org.testng.annotations.*;
-
-import javax.inject.Inject;
-import java.io.IOException;
-import java.lang.reflect.Method;
-import java.net.URL;
-import java.time.Instant;
-import java.time.LocalDateTime;
-import java.time.ZoneId;
-import java.util.Optional;
-import java.util.*;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.stream.Collectors;
-import java.util.stream.IntStream;
-
-import static com.google.common.collect.Maps.newHashMap;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.contains;
-import static org.hamcrest.Matchers.*;
-import static org.hamcrest.core.Every.everyItem;
-import static org.hamcrest.core.IsEqual.equalTo;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.*;
-import static org.onap.vid.job.Job.JobStatus.*;
-import static org.testng.Assert.*;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
@ContextConfiguration(classes = {DataSourceConfig.class, SystemProperties.class, MockedAaiClientAndFeatureManagerConfig.class})
public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseTest {
@@ -268,7 +314,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
dataAccessService.saveDomainObject(jobDao, getPropsMap());
}
- @Test(enabled = false)
+ @Test
public void testServiceInfoAreOrderedAsExpected() {
int userId = 2222;
createNewTestServicesInfo(String.valueOf(userId));
@@ -277,7 +323,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
assertThat("Services aren't ordered as expected", serviceInfoListResult, equalTo(expectedOrderServiceInfo));
}
- @Test(enabled = false)
+ @Test
public void testServiceInfoAreFilteredAsExpected() {
int userId = 2222;
createNewTestServicesInfoForFilter(String.valueOf(userId));
@@ -293,7 +339,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
assertThat("Services aren't ordered filtered as expected", serviceInfoFilteredByUser, equalTo(expectedFilterByUser));
}
- @Test(enabled = false, dataProvider = "pauseAndInstanceParams")
+ @Test(dataProvider = "pauseAndInstanceParams")
public void createMacroServiceInstantiationMsoRequestUniqueName(Boolean isPause, HashMap<String, String> vfModuleInstanceParamsMap, List vnfInstanceParams) throws Exception {
defineMocks();
ServiceInstantiation serviceInstantiationPayload = generateMockMacroServiceInstantiationPayload(isPause, createVnfList(vfModuleInstanceParamsMap, vnfInstanceParams, true), 2, true, PROJECT_NAME, false);
@@ -355,7 +401,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
};
}
- @Test(enabled = false, dataProvider="dataProviderForInstanceNames")
+ @Test(dataProvider="dataProviderForInstanceNames")
public void pushBulkJob_bulkWithSize3_instancesNamesAreExactlyAsExpected(boolean isUserProvidedNaming, List<String> expectedNames) {
int bulkSize = 3;
@@ -375,7 +421,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
assertEquals(serviceInfoList.stream().map(ServiceInfo::getServiceInstanceName).collect(Collectors.toList()), expectedNames);
}
- @Test(enabled = false, dataProvider = "aLaCarteAndMacroPayload")
+ @Test(dataProvider = "aLaCarteAndMacroPayload")
public void generateMockServiceInstantiationPayload_serializeBackAndForth_sourceShouldBeTheSame(ServiceInstantiation serviceInstantiationPayload) throws IOException {
ObjectMapper mapper = new ObjectMapper();
final String asString = mapper.writeValueAsString(serviceInstantiationPayload);
@@ -455,7 +501,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
return generateMockMacroServiceInstantiationPayload(isPause, vnfs, 1, true, PROJECT_NAME, false);
}
- @Test(enabled = false)
+ @Test
public void testUpdateServiceInfo_WithExistingServiceInfo_ServiceInfoIsUpdated() {
UUID uuid = createFakedJobAndServiceInfo();
final String STEPH_CURRY = "Steph Curry";
@@ -484,12 +530,12 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
return uuid;
}
- @Test(enabled = false, expectedExceptions = GenericUncheckedException.class, expectedExceptionsMessageRegExp = UPDATE_SERVICE_INFO_EXCEPTION_MESSAGE)
+ @Test(expectedExceptions = GenericUncheckedException.class, expectedExceptionsMessageRegExp = UPDATE_SERVICE_INFO_EXCEPTION_MESSAGE)
public void testUpdateServiceInfo_WithNonExisting_ThrowException() {
asyncInstantiationBL.updateServiceInfo(UUID.randomUUID(), x -> x.setServiceInstanceName("not matter"));
}
- @Test(enabled = false, expectedExceptions = GenericUncheckedException.class, expectedExceptionsMessageRegExp = UPDATE_SERVICE_INFO_EXCEPTION_MESSAGE)
+ @Test(expectedExceptions = GenericUncheckedException.class, expectedExceptionsMessageRegExp = UPDATE_SERVICE_INFO_EXCEPTION_MESSAGE)
public void testUpdateServiceInfo_WithDoubleServiceWithSameJobUuid_ThrowException() {
UUID uuid = createFakedJobAndServiceInfo();
ServiceInfo serviceInfo = new ServiceInfo();
@@ -508,25 +554,25 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
}
- @Test(enabled = false, dataProvider = "isPauseAndPropertyDataProvider")
+ @Test(dataProvider = "isPauseAndPropertyDataProvider")
public void testServiceInstantiationPath_RequestPathIsAsExpected(boolean isPause, String expectedProperty) {
ServiceInstantiation serviceInstantiationPauseFlagTrue = generateMacroMockServiceInstantiationPayload(isPause, createVnfList(instanceParamsMapWithoutParams, Collections.EMPTY_LIST, true));
String path = asyncInstantiationBL.getServiceInstantiationPath(serviceInstantiationPauseFlagTrue);
Assert.assertEquals(path, SystemProperties.getProperty(expectedProperty));
}
- @Test(enabled = false)
+ @Test
public void testCreateVnfEndpoint_useProvidedInstanceId() {
String path = asyncInstantiationBL.getVnfInstantiationPath("myGreatId");
- assertThat(path, equalTo("/serviceInstances/v7/myGreatId/vnfs"));
+ assertThat(path, matchesPattern("/serviceInstances/v./myGreatId/vnfs"));
}
- @Test(enabled = false)
+ @Test
public void createServiceInfo_WithUserProvidedNamingFalse_ServiceInfoIsAsExpected() throws IOException {
createMacroServiceInfo_WithUserProvidedNamingFalse_ServiceInfoIsAsExpected(true);
}
- @Test(enabled = false)
+ @Test
public void createServiceInfo_WithUserProvidedNamingFalseAndNoVfmodules_ServiceInfoIsAsExpected() throws IOException {
createMacroServiceInfo_WithUserProvidedNamingFalse_ServiceInfoIsAsExpected(false);
}
@@ -554,7 +600,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
MsoOperationalEnvironmentTest.assertThatExpectationIsLikeObject(expected, result);
}
- @Test(enabled = false)
+ @Test
public void createALaCarteService_WithUserProvidedNamingFalse_RequestDetailsIsAsExpected() throws IOException {
ServiceInstantiation serviceInstantiationPayload = generateMockALaCarteServiceInstantiationPayload(false,
newHashMap(),
@@ -571,7 +617,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
MsoOperationalEnvironmentTest.assertThatExpectationIsLikeObject(expected, result);
}
- @Test(enabled = false)
+ @Test
public void generateALaCarteServiceInstantiationRequest_withVnfList_HappyFllow() throws IOException {
ServiceInstantiation serviceInstantiationPayload = generateALaCarteWithVnfsServiceInstantiationPayload();
RequestDetailsWrapper<ServiceInstantiationRequestDetails> result =
@@ -581,7 +627,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
MsoOperationalEnvironmentTest.assertThatExpectationIsLikeObject(serviceExpected, result);
}
- @Test(enabled = false, dataProvider = "createVnfParameters")
+ @Test(dataProvider = "createVnfParameters")
public void createVnfRequestDetails_detailsAreAsExpected(boolean isFlagAddCloudOwnerActive, boolean isUserProvidedNaming, String file) throws IOException {
final List<Vnf> vnfList = new ArrayList<>(createVnfList(new HashMap<>(), null, isUserProvidedNaming, true).values());
@@ -619,7 +665,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
};
}
- @Test(enabled = false, dataProvider = "vfModuleRequestDetails")
+ @Test(dataProvider = "vfModuleRequestDetails")
public void createVfModuleRequestDetails_detailsAreAsExpected(String volumeGroupInstanceId, boolean isUserProvidedNaming, String fileName) throws IOException {
ModelInfo siModelInfo = createServiceModelInfo();
@@ -660,7 +706,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
};
}
- @Test(enabled = false, dataProvider = "expectedAggregatedParams")
+ @Test(dataProvider = "expectedAggregatedParams")
public void testAggregateInstanceParamsAndSuppFile(Map<String, String> instanceParams, Map<String, String> suppParams, List<VfModuleInstantiationRequestDetails.UserParamMap<String, String>> expected) {
List<VfModuleInstantiationRequestDetails.UserParamMap<String, String>> aggParams = ((AsyncInstantiationBusinessLogicImpl)asyncInstantiationBL).aggregateAllInstanceParams(instanceParams, suppParams);
assertThat("Aggregated params are not as expected", aggParams, equalTo(expected));
@@ -674,7 +720,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
};
}
- @Test(enabled = false, dataProvider = "expectedNetworkRequestDetailsParameters")
+ @Test(dataProvider = "expectedNetworkRequestDetailsParameters")
public void createNetworkRequestDetails_detailsAreAsExpected(boolean isUserProvidedNaming, String filePath) throws IOException {
final List<Network> networksList = new ArrayList<>(createNetworkList(null, isUserProvidedNaming, true).values());
@@ -692,7 +738,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
MsoOperationalEnvironmentTest.assertThatExpectationIsLikeObject(expected, result);
}
- @Test(enabled = false)
+ @Test
public void createInstanceGroupRequestDetails_detailsAreAsExpected() throws IOException {
final InstanceGroup instanceGroup = createInstanceGroup(true, Action.Create);
@@ -710,7 +756,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
MsoOperationalEnvironmentTest.assertThatExpectationIsLikeObject(expected, result);
}
- @Test(enabled = false)
+ @Test
public void checkIfNullProjectNameSentToMso(){
ServiceInstantiation serviceInstantiationPayload = generateMockMacroServiceInstantiationPayload(true,
createVnfList(vfModuleInstanceParamsMapWithParamsToRemove, Collections.EMPTY_LIST, false),
@@ -732,7 +778,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
}
- @Test(enabled = false)
+ @Test
public void pushBulkJob_macroServiceverifyCreatedDateBehavior_createdDateIsTheSameForAllServicesInSameBulk() {
LocalDateTime startTestDate = LocalDateTime.now().withNano(0);
final ServiceInstantiation request = generateMockMacroServiceInstantiationPayload(
@@ -744,7 +790,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
pushJobAndAssertDates(startTestDate, request);
}
- @Test(enabled = false)
+ @Test
public void whenCreateServiceInfo_thenModelId_isModelVersionId() {
ServiceInfo serviceInfo = asyncInstantiationBL.createServiceInfo("userID",
generateALaCarteWithVnfsServiceInstantiationPayload(),
@@ -756,7 +802,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
}
- @Test(enabled = false)
+ @Test
public void pushBulkJob_aLaCarteServiceverifyCreatedDateBehavior_createdDateIsTheSameForAllServicesInSameBulk() {
LocalDateTime startTestDate = LocalDateTime.now().withNano(0);
final ServiceInstantiation request = generateALaCarteServiceInstantiationPayload();
@@ -807,7 +853,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
};
}
- @Test(enabled = false, dataProvider = "msoToJobStatusDataProvider")
+ @Test(dataProvider = "msoToJobStatusDataProvider")
public void whenGetStatusFromMso_calcRightJobStatus(String msoStatus, Job.JobStatus expectedJobStatus) {
AsyncRequestStatus asyncRequestStatus = asyncRequestStatusResponse(msoStatus);
assertThat(asyncInstantiationBL.calcStatus(asyncRequestStatus), equalTo(expectedJobStatus));
@@ -852,7 +898,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
}
- @Test(enabled = false, dataProvider = "auditStatuses")
+ @Test(dataProvider = "auditStatuses")
public void givenSomeAuditStatuses_getStatusesOfSpecificSourceAndJobId_getSortedResultsMatchingToParameters(SourceStatus expectedSource, String [] expectedSortedStatuses){
UUID jobUuid = UUID.randomUUID();
List<JobAuditStatus> auditStatusList = com.google.common.collect.ImmutableList.of(
@@ -870,7 +916,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
- @Test(enabled = false)
+ @Test
public void addSomeVidStatuses_getThem_verifyGetInsertedWithoutDuplicates(){
ImmutableList<JobStatus> statusesToBeInserted = ImmutableList.of(PENDING, IN_PROGRESS, IN_PROGRESS, COMPLETED);
UUID jobUuid = UUID.randomUUID();
@@ -915,7 +961,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
};
}
- @Test(enabled = false, dataProvider = "msoAuditStatuses")
+ @Test(dataProvider = "msoAuditStatuses")
public void addSomeMsoStatuses_getThem_verifyGetInsertedWithoutDuplicates(UUID jobUuid, ImmutableList<JobAuditStatus> msoStatuses, ImmutableList<String> expectedStatuses, String assertionReason) {
msoStatuses.forEach(status -> {
asyncInstantiationBL.auditMsoStatus(status.getJobId(), status.getJobStatus(), status.getRequestId() != null ? status.getRequestId().toString() : null, status.getAdditionalInfo());
@@ -924,7 +970,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
assertThat( assertionReason, statusesFromDB, is(expectedStatuses));
}
- @Test(enabled = false)
+ @Test
public void addSameStatusOfVidAndMso_verifyThatBothWereAdded(){
UUID jobUuid = UUID.randomUUID();
JobStatus sameStatus = IN_PROGRESS;
@@ -947,7 +993,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
};
}
- @Test(enabled = false, dataProvider="msoRequestStatusFiles")
+ @Test(dataProvider="msoRequestStatusFiles")
public void verifyAsyncRequestStatus_canBeReadFromSample(String msoResponseFile) throws IOException {
AsyncRequestStatus asyncRequestStatus = TestUtils.readJsonResourceFileAsObject(
msoResponseFile,
@@ -955,7 +1001,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
assertThat(asyncRequestStatus.request.requestStatus.getRequestState(), equalTo("COMPLETE"));
}
- @Test(enabled = false)
+ @Test
public void deleteJobInfo_pending_deleted() {
doNothing().when(jobsBrokerServiceMock).delete(any());
UUID uuid = createServicesInfoWithDefaultValues(PENDING);
@@ -963,7 +1009,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
assertNotNull(asyncInstantiationBL.getServiceInfoByJobId(uuid).getDeletedAt(), "service info wasn't deleted");
}
- @Test(enabled = false, expectedExceptions = IllegalStateException.class, expectedExceptionsMessageRegExp = DELETE_SERVICE_INFO_STATUS_EXCEPTION_MESSAGE)
+ @Test(expectedExceptions = IllegalStateException.class, expectedExceptionsMessageRegExp = DELETE_SERVICE_INFO_STATUS_EXCEPTION_MESSAGE)
public void deleteJobInfo_notAllowdStatus_shouldSendError() {
UUID uuid = createServicesInfoWithDefaultValues(COMPLETED);
doThrow(new IllegalStateException(DELETE_SERVICE_INFO_STATUS_EXCEPTION_MESSAGE)).when(jobsBrokerServiceMock).delete(any());
@@ -982,7 +1028,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
.map(v -> new Object[]{v}).collect(Collectors.toList()).toArray(new Object[][]{});
}
- @Test(enabled = false, dataProvider = "jobStatusesFinal")
+ @Test(dataProvider = "jobStatusesFinal")
public void whenHideService_theServiceNotReturnedInServiceList(JobStatus jobStatus) {
UUID uuidToHide = createServicesInfoWithDefaultValues(jobStatus);
UUID uuidToShown = createServicesInfoWithDefaultValues(jobStatus);
@@ -1007,7 +1053,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
.map(v -> new Object[]{v}).collect(Collectors.toList()).toArray(new Object[][]{});
}
- @Test(enabled = false, dataProvider = "jobStatusesNotFinal",
+ @Test(dataProvider = "jobStatusesNotFinal",
expectedExceptions = OperationNotAllowedException.class,
expectedExceptionsMessageRegExp = "jobId.*Service status does not allow hide service, status = .*")
public void hideServiceInfo_notAllowedStatus_shouldSendError(JobStatus jobStatus) {
@@ -1020,7 +1066,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
}
}
- @Test(enabled = false)
+ @Test
public void whenUseGetCounterInMultiThreads_EachThreadGetDifferentCounter() throws InterruptedException {
int SIZE = 200;
ExecutorService executor = Executors.newFixedThreadPool(SIZE);
@@ -1041,7 +1087,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
assertThat(expectedResults.size(), is(0));
}
- @Test(enabled = false)
+ @Test
public void whenUseGetCounterForSameName_numbersReturnedByOrder() {
String name = UUID.randomUUID().toString();
@@ -1051,7 +1097,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
}
}
- @Test(enabled = false)
+ @Test
public void whenNamedInUsedInAai_getNextNumber() {
String name = someCommonStepsAndGetName();
ResourceType type = ResourceType.GENERIC_VNF;
@@ -1069,7 +1115,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
when(aaiClient.isNodeTypeExistsByName(eq(AsyncInstantiationBusinessLogicImpl.NAME_FOR_CHECK_AAI_STATUS), any())).thenReturn(false);
}
- @Test(enabled = false, expectedExceptions=ExceptionWithRequestInfo.class)
+ @Test(expectedExceptions=ExceptionWithRequestInfo.class)
public void whenAaiBadResponseCode_throwInvalidAAIResponseException() {
String name = someCommonStepsAndGetName();
ResourceType type = ResourceType.SERVICE_INSTANCE;
@@ -1077,7 +1123,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
asyncInstantiationBL.getUniqueName(name, type);
}
- @Test(enabled = false, expectedExceptions=MaxRetriesException.class)
+ @Test(expectedExceptions=MaxRetriesException.class)
public void whenAaiAlwaysReturnNameUsed_throwInvalidAAIResponseException() {
String name = someCommonStepsAndGetName();
ResourceType type = ResourceType.VF_MODULE;
@@ -1086,7 +1132,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
asyncInstantiationBL.getUniqueName(name, type);
}
- @Test(enabled = false)
+ @Test
public void testFormattingOfNameAndCounter() {
AsyncInstantiationBusinessLogicImpl bl = (AsyncInstantiationBusinessLogicImpl) asyncInstantiationBL;
assertThat(bl.formatNameAndCounter("x", 0), equalTo("x"));
@@ -1096,7 +1142,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
assertThat(bl.formatNameAndCounter("x", 1234), equalTo("x_1234"));
}
- @Test(enabled = false)
+ @Test
public void pushBulkJob_verifyAlacarteFlow_useALaCartServiceInstantiationJobType(){
final ServiceInstantiation request = generateALaCarteServiceInstantiationPayload();
@@ -1109,7 +1155,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
assertTrue(argumentCaptor.getValue().equals(JobType.ALaCarteServiceInstantiation));
}
- @Test(enabled = false)
+ @Test
public void pushBulkJob_verifyMacroFlow_useMacroServiceInstantiationJobType(){
final ServiceInstantiation request = generateMacroMockServiceInstantiationPayload(false, Collections.emptyMap());
@@ -1122,7 +1168,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
assertTrue(argumentCaptor.getValue().equals(JobType.MacroServiceInstantiation));
}
- @Test(enabled = false)
+ @Test
public void generateALaCarteServiceInstantiationRequest_verifyRequestIsAsExpected() throws IOException {
ServiceInstantiation serviceInstantiationPayload = generateALaCarteServiceInstantiationPayload();
final URL resource = this.getClass().getResource("/payload_jsons/bulk_alacarte_service_request.json");
@@ -1132,7 +1178,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
MsoOperationalEnvironmentTest.assertThatExpectationIsLikeObject(expected, result);
}
- @Test(enabled = false)
+ @Test
public void generateALaCarteServiceDeletionRequest_verifyRequestIsAsExpected() throws IOException {
final URL resource = this.getClass().getResource("/payload_jsons/bulk_alacarte_service_deletion_request.json");
String expected = IOUtils.toString(resource, "UTF-8");
@@ -1144,17 +1190,17 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
MsoOperationalEnvironmentTest.assertThatExpectationIsLikeObject(expected, result);
}
- @Test(enabled = false)
+ @Test
public void getALaCarteServiceDeletionPath_verifyPathIsAsExpected() throws IOException {
- String expected = "/serviceInstantiation/v7/serviceInstances/f36f5734-e9df-4fbf-9f35-61be13f028a1";
+ String expected = "/serviceInstantiation/v./serviceInstances/f36f5734-e9df-4fbf-9f35-61be13f028a1";
String result = asyncInstantiationBL.getServiceDeletionPath("f36f5734-e9df-4fbf-9f35-61be13f028a1");
- assertThat(expected,equalTo(result));
+ assertThat(result, matchesPattern(expected));
}
- @Test(enabled = false)
+ @Test
public void getInstanceGroupsDeletionPath_verifyPathIsAsExpected() {
assertEquals(asyncInstantiationBL.getInstanceGroupDeletePath("9aada4af-0f9b-424f-ae21-e693bd3e005b"),
@@ -1229,7 +1275,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
};
}
- @Test(enabled = false, dataProvider="testBuildVnfInstanceParamsDataProvider")
+ @Test(dataProvider="testBuildVnfInstanceParamsDataProvider")
public void testBuildVnfInstanceParams(List<Map<String, String>> currentVnfInstanceParams,
List<List<Map<String, String>>> vfModulesInstanceParams,
boolean isFeatureActive,
@@ -1242,7 +1288,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
}
- @Test(enabled = false)
+ @Test
public void whenLcpRegionNotEmpty_thenCloudRegionIdOfResourceIsLegacy() {
String legacyCloudRegion = "legacyCloudRegion";
Vnf vnf = new Vnf(new ModelInfo(), null, null, Action.Create.name(), null, "anyCloudRegion", legacyCloudRegion, null, null, null, false, null, null);
@@ -1251,7 +1297,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
}
- @Test(enabled = false)
+ @Test
public void whenLcpRegionNotEmpty_thenCloudRegionIdOfServiceIsLegacy() {
String legacyCloudRegion = "legacyCloudRegion";
ServiceInstantiation service = new ServiceInstantiation(new ModelInfo(), null, null, null, null, null, null,
@@ -1260,7 +1306,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
assertThat(service.getLcpCloudRegionId(), equalTo(legacyCloudRegion));
}
- @Test(enabled = false)
+ @Test
public void createVolumeGroup_verifyResultAsExpected() throws IOException {
final URL resource = this.getClass().getResource("/payload_jsons/volumegroup_instantiation_request.json");
VfModule vfModule = createVfModule("201673MowAvpnVpeBvL..AVPN_vRE_BV..module-1",
@@ -1285,7 +1331,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT
MsoOperationalEnvironmentTest.assertThatExpectationIsLikeObject(expected, result);
}
- @Test(enabled = false)
+ @Test
public void getJobTypeByRequest_verifyResultAsExpected(){
ServiceInstantiation service = new ServiceInstantiation(new ModelInfo(), null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null, null, null,
diff --git a/vid-app-common/src/test/resources/WEB-INF/conf/system.properties b/vid-app-common/src/test/resources/WEB-INF/conf/system.properties
index baf56d36c..ef444944d 100644
--- a/vid-app-common/src/test/resources/WEB-INF/conf/system.properties
+++ b/vid-app-common/src/test/resources/WEB-INF/conf/system.properties
@@ -150,12 +150,17 @@ mso.restapi.network.instance=/serviceInstances/v5/<service_instance_id>/networks
mso.restapi.vf.module.instance=/serviceInstances/v7/<service_instance_id>/vnfs/<vnf_instance_id>/vfModules
mso.restapi.vf.module.scaleout=/serviceInstantiation/v7/serviceInstances/<service_instance_id>/vnfs/<vnf_instance_id>/vfModules/scaleOut
mso.restapi.volume.group.instance=/serviceInstances/v5/<service_instance_id>/vnfs/<vnf_instance_id>/volumeGroups
+mso.restapi.instance.group=/serviceInstantiation/v7/instanceGroups
mso.restapi.get.orc.req=/orchestrationRequests/v5
mso.restapi.get.orc.reqs=/orchestrationRequests/v5?
mso.restapi.get.man.tasks=/tasks/v1
mso.restapi.configurations=/serviceInstances/v6/<service_instance_id>/configurations
mso.restapi.configuration.instance=${mso.restapi.configurations}<configuration_id>
+mso.restapi.serviceInstantiationApiRoot=/serviceInstantiation/v7
+mso.restapi.serviceInstanceCreate=${mso.restapi.serviceInstantiationApiRoot}/serviceInstances
+mso.restapi.serviceInstanceAssign=${mso.restapi.serviceInstantiationApiRoot}/serviceInstances/assign
+
vid.truststore.filename=/opt/app/vid/etc/vid_keystore.jks
mso.dme2.client.timeout=30000
mso.dme2.client.read.timeout=120000
diff --git a/vid-app-common/src/test/resources/WEB-INF/fusion/orm/Fusion.hbm.xml b/vid-app-common/src/test/resources/WEB-INF/fusion/orm/Fusion.hbm.xml
new file mode 100644
index 000000000..e9eed439b
--- /dev/null
+++ b/vid-app-common/src/test/resources/WEB-INF/fusion/orm/Fusion.hbm.xml
@@ -0,0 +1,394 @@
+<?xml version="1.0"?>
+<!--
+ ============LICENSE_START==========================================
+ ONAP Portal SDK
+ ===================================================================
+ Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ ===================================================================
+
+ Unless otherwise specified, all software contained herein is licensed
+ under the Apache License, Version 2.0 (the “License”);
+ you may not use this software except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ Unless otherwise specified, all documentation contained herein is licensed
+ under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ you may not use this documentation except in compliance with the License.
+ You may obtain a copy of the License at
+
+ https://creativecommons.org/licenses/by/4.0/
+
+ Unless required by applicable law or agreed to in writing, documentation
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ ============LICENSE_END============================================
+
+
+ -->
+
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping package="org.onap.portalsdk.core.domain">
+
+ <!-- User class mapping details -->
+ <class name="User" table="FN_USER">
+ <id name="id" column="user_id" >
+ <generator class="native">
+ <param name="sequence">seq_fn_user</param>
+ </generator>
+ </id>
+
+ <property name="orgId" column="org_id"/>
+ <property name="managerId" column="manager_id"/>
+ <property name="firstName" column="first_name"/>
+ <property name="middleInitial" column="middle_name"/>
+ <property name="lastName" column="last_name"/>
+ <property name="phone" column="phone"/>
+ <property name="fax" column="fax"/>
+ <property name="cellular" column="cellular"/>
+ <property name="email" column="email"/>
+ <property name="addressId" column="address_id"/>
+ <property name="alertMethodCd" column="alert_method_cd"/>
+
+ <property name="address1" column="address_line_1"/>
+ <property name="address2" column="address_line_2"/>
+ <property name="city" column="city"/>
+ <property name="state" column="state_cd"/>
+ <property name="zipCode" column="zip_code"/>
+ <property name="country" column="country_cd"/>
+
+ <property name="hrid" column="hrid"/>
+ <property name="orgUserId" column="org_user_id"/>
+ <property name="orgCode" column="org_code"/>
+ <property name="loginId" column="login_id"/>
+ <property name="loginPwd" column="login_pwd"/>
+ <property name="lastLoginDate" column="last_login_date" type="timestamp"/>
+
+ <property name="locationClli" column="location_clli" />
+ <property name="orgManagerUserId" column="org_manager_userid" />
+ <property name="company" column="company" />
+ <property name="department" column="department" />
+ <property name="departmentName" column="department_name" />
+ <property name="businessUnit" column="business_unit" />
+ <property name="businessUnitName" column="business_unit_name" />
+ <property name="jobTitle" column="job_title" />
+ <property name="siloStatus" column="silo_status" />
+ <property name="financialLocCode" column="fin_loc_code" />
+
+ <property name="active" column="active_yn" type="yes_no"/>
+ <property name="internal" column="is_internal_yn" type="yes_no"/>
+
+ <property name="created" type="timestamp" column="created_date" />
+ <property name="modified" type="timestamp" column="modified_date" />
+
+ <property name="createdId" column="created_id" />
+ <property name="modifiedId" column="modified_id" />
+ <property name="timeZoneId" column="timezone" />
+
+ <set name="userApps" table="FN_USER_ROLE" lazy="false" sort="natural" inverse="true" cascade="all-delete-orphan">
+ <key column="user_id"/>
+ <one-to-many class="org.onap.portalsdk.core.domain.UserApp" />
+ </set>
+
+ <set name="pseudoRoles" table="FN_USER_PSEUDO_ROLE" lazy="false" sort="natural">
+ <key column="user_id"/>
+ <many-to-many column="pseudo_role_id" class="org.onap.portalsdk.core.domain.Role" />
+ </set>
+ </class>
+
+ <!-- Profile class mapping details;
+ dupe of User class, but fewer fields -->
+ <class name="Profile" table="FN_USER">
+ <id name="id" column="user_id" >
+ <generator class="increment"/>
+ </id>
+ <property name="first_name" column="first_name"/>
+ <property name="last_name" column="last_name"/>
+ <property name="email" column="email"/>
+ <property name="orgManagerUserId" column="org_manager_userid" />
+ <property name="active_yn" column="active_yn"/>
+ <property name="orgUserId" column="org_user_id"/>
+ </class>
+
+ <class name="UserApp" table="fn_user_role">
+ <composite-id>
+ <key-property name="userId" type="long">
+ <column name="user_id" precision="11" scale="0" />
+ </key-property>
+ <key-many-to-one name="app" class="org.onap.portalsdk.core.domain.App" column="app_id" />
+ <key-many-to-one name="role" class="org.onap.portalsdk.core.domain.Role" column="role_id" />
+ </composite-id>
+ <property name="priority" type="java.lang.Short">
+ <column name="priority" precision="4" scale="0" />
+ </property>
+ </class>
+
+ <!-- App class mapping details -->
+ <class name="App" table="fn_app">
+ <id name="id" column="app_id"/>
+ <property name="name" column="app_name"/>
+ <property name="appPassword" column="app_password"/>
+ <property name="username" column="app_username"/>
+ <property name="imageUrl" column="app_image_url"/>
+ <property name="description" column="app_description"/>
+ <property name="notes" column="app_notes"/>
+ <property name="url" column="app_url"/>
+ <property name="alternateUrl" column="app_alternate_url"/>
+ <property name="restEndpoint" column="app_rest_endpoint"/>
+ <property name="mlAppName" column="ml_app_name"/>
+ <property name="mlAppAdminId" column="ml_app_admin_id"/>
+ <property name="motsId" column="mots_id"/>
+ <property name="open" column="open"/>
+ <property name="enabled" column="enabled"/>
+ <property name="thumbnail" column="thumbnail" type="blob"/>
+ <property name="uebKey" column="ueb_key"/>
+ <property name="uebSecret" column="ueb_secret"/>
+ <property name="uebTopicName" column="ueb_topic_name"/>
+ </class>
+
+
+ <!-- Audit Log class mapping details -->
+ <class name="AuditLog" table="fn_audit_log">
+ <id name="id" column="log_id">
+ <!-- <generator class="sequence">
+ <param name="sequence">seq_fn_audit_log</param>
+ </generator> -->
+ <generator class="native">
+ <param name="sequence">seq_fn_audit_log</param>
+ </generator>
+ </id>
+ <property name="activityCode" column="activity_cd"/>
+ <property name="affectedRecordId" column="affected_record_id" />
+ <property name="comments" column="comments" />
+ <property name="createdId" column="user_id" />
+ </class>
+
+ <!-- User Role class mapping details -->
+ <class name="Role" table="FN_ROLE">
+ <id name="id" column="role_id">
+ <generator class="native">
+ <param name="sequence">seq_fn_role</param>
+ </generator>
+ </id>
+
+ <property name="name" column="role_name"/>
+ <property name="priority" column="priority" />
+ <property name="active" column="active_yn" type="yes_no"/>
+
+ <set name="roleFunctions" table="FN_ROLE_FUNCTION" lazy="false" sort="natural">
+ <key column="role_id"/>
+ <many-to-many column="function_cd" class="org.onap.portalsdk.core.domain.RoleFunction"/>
+ </set>
+
+ <set name="childRoles" table="FN_ROLE_COMPOSITE" lazy="false" sort="natural">
+ <key column="parent_role_id"/>
+ <many-to-many column="child_role_id" class="org.onap.portalsdk.core.domain.Role"/>
+ </set>
+
+ <set name="parentRoles" table="FN_ROLE_COMPOSITE" lazy="false" sort="natural">
+ <key column="child_role_id"/>
+ <many-to-many column="parent_role_id" class="org.onap.portalsdk.core.domain.Role"/>
+ </set>
+
+ </class>
+
+
+
+ <!-- User Role Function class mapping details -->
+ <class name="RoleFunction" table="FN_FUNCTION">
+ <id name="code" column="function_cd" />
+ <property name="name" column="function_name" />
+ <property name="type" column="type" />
+ <property name="action" column="action" />
+ </class>
+
+ <!-- Menu class mapping details -->
+ <class name="Menu" table="FN_MENU">
+ <id name="id" column="menu_id">
+ <generator class="native">
+ <param name="sequence">seq_fn_menu</param>
+ </generator>
+ </id>
+
+ <!-- <property name="menuLevel" column="level-1"/> -->
+ <property name="label" column="label"/>
+ <property name="parentId" column="parent_id"/>
+ <property name="action" column="action"/>
+ <property name="functionCd" column="function_cd"/>
+ <property name="sortOrder" column="sort_order"/>
+ <property name="servlet" column="servlet"/>
+ <property name="queryString" column="query_string"/>
+ <property name="externalUrl" column="external_url"/>
+ <property name="target" column="target"/>
+ <property name="menuSetCode" column="menu_set_cd"/>
+ <property name="active" column="active_yn" type="yes_no"/>
+ <property name="separator" column="separator_yn" type="yes_no"/>
+ <property name="imageSrc" column="image_src" />
+ </class>
+
+ <class name="MenuData" table="FN_MENU">
+ <!-- <id name="id" column="menu_id"/> -->
+ <id name="id" column="menu_id">
+ <generator class="native">
+ <param name="sequence">seq_fn_menu</param>
+ </generator>
+ </id>
+ <property name="label" column="label"/>
+ <property name="action" column="action"/>
+ <property name="functionCd" column="function_cd"/>
+ <property name="sortOrder" column="sort_order"/>
+ <property name="servlet" column="servlet"/>
+ <property name="queryString" column="query_string"/>
+ <property name="externalUrl" column="external_url"/>
+ <property name="target" column="target"/>
+ <property name="active" column="active_yn" type="yes_no"/>
+ <property name="separator" column="separator_yn" type="yes_no"/>
+ <property name="imageSrc" column="image_src" />
+ <property name="menuSetCode" column="menu_set_cd" />
+
+ <many-to-one name="parentMenu" column="parent_id" class="MenuData"/>
+
+ <set name="childMenus" lazy="false" sort="natural" inverse="true" where="active_yn = 'Y'">
+ <key column="parent_id"/>
+ <one-to-many class="MenuData"/>
+ </set>
+ </class>
+
+ <!-- Broadcast Message class mapping details -->
+ <class name="BroadcastMessage" table="fn_broadcast_message">
+ <id name="id" column="message_id">
+ <generator class="native">
+ <param name="sequence">seq_fn_broadcast_message</param>
+ </generator>
+ </id>
+ <property name="messageText" column="message_text"/>
+ <property name="locationId" column="message_location_id"/>
+
+ <property name="startDate" column="broadcast_start_date" type="timestamp"/>
+ <property name="endDate" column="broadcast_end_date" type="timestamp"/>
+
+ <property name="sortOrder" column="sort_order"/>
+ <property name="active" column="active_yn" type="yes_no"/>
+
+ <property name="siteCd" column="broadcast_site_cd" />
+ </class>
+
+
+ <!-- State Lookup class mapping details -->
+ <class name="LuState" table="FN_LU_STATE">
+ <id name="abbr" column="state_cd" />
+ <property name="state" />
+ </class>
+
+ <!-- Country Lookup class mapping details -->
+ <class name="LuCountry" table="FN_LU_COUNTRY">
+ <id name="abbr" column="country_cd" />
+ <property name="country" />
+ <property name="fullName" column="full_name" />
+ <property name="webphoneCountryLabel" column="fullwebphone_country_label_name" />
+ </class>
+
+ <class name="LuTimeZone" table="FN_LU_TIMEZONE">
+ <id name="timezoneId" column="timezone_id" />
+ <property name="name" column="timezone_name" />
+ <property name="value" column="timezone_value" />
+ </class>
+
+
+ <!-- Lookup (id/value bean) class mapping details -->
+ <class name="Lookup">
+ <composite-id name="nameValueId" class="org.onap.portalsdk.core.domain.support.NameValueId">
+ <key-property name="val"/>
+ <key-property name="lab" />
+ </composite-id>
+ </class>
+
+ <class name="UrlsAccessible" table="V_URL_ACCESS">
+ <composite-id name="urlsAccessibleKey" class="org.onap.portalsdk.core.domain.UrlsAccessibleKey">
+ <key-property name="url" column="url"/>
+ <key-property name="functionCd" column="function_cd"/>
+ </composite-id>
+ </class>
+
+
+ <query name="ParentIdForLabelList">
+ select distinct md.parentMenu.id from MenuData as md where md.label = :paramLabel and md.label is not null
+ </query>
+
+ <query name="IdForLabelList">
+ select distinct md.id from MenuData as md where md.label = :paramLabel
+ </query>
+
+ <query name="parentList">
+ select distinct md.id, md.label, md.parentMenu.id from MenuData as md where md.label is not null
+ </query>
+
+ <query name="functionCDlistOld">
+ select distinct functionCd from MenuData
+ </query>
+
+ <query name="functionCDlist">
+ select distinct code from RoleFunction
+ </query>
+
+ <query name="menuData">
+ from MenuData where menuSetCode = :menu_set_cd and parentMenu is null
+ </query>
+ <query name="restrictedUrls">
+ FROM UrlsAccessible A where upper(A.urlsAccessibleKey.url) = upper(:current_url)
+ </query>
+
+ <query name="getUserNameById">
+ select firstName, lastName from User where id = :user_id
+ </query>
+
+ <query name="getUserEmail">
+ select email from User where id = :user_id
+ </query>
+
+ <query name="getAllUsers">
+ select id, firstName, lastName from User where active = true order by lastName, firstName
+ </query>
+
+ <query name="getRoleNameById">
+ select name from Role where id = :role_id
+ </query>
+
+ <query name="getAllRoles">
+ select id, name from Role order by name
+ </query>
+
+ <query name="getUserByProfileId">
+ select orgUserId from User where id = :user_id
+ </query>
+
+ <query name="getUserIdByorgUserId">
+ select id from User where orgUserId = :orgUserId
+ </query>
+
+ <query name="getUserByOrgUserId">
+ FROM User WHERE orgUserId = :org_user_id
+ </query>
+
+ <query name="getUserByLoginId">
+ FROM User WHERE loginId = :login_id
+ </query>
+
+ <query name="getUserByLoginIdLoginPwd">
+ FROM User WHERE loginId = :login_id and loginPwd = :login_pwd
+ </query>
+
+</hibernate-mapping>
diff --git a/vid-app-common/src/test/resources/WEB-INF/fusion/orm/Workflow.hbm.xml b/vid-app-common/src/test/resources/WEB-INF/fusion/orm/Workflow.hbm.xml
new file mode 100644
index 000000000..75361ed34
--- /dev/null
+++ b/vid-app-common/src/test/resources/WEB-INF/fusion/orm/Workflow.hbm.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0"?>
+<!--
+ ============LICENSE_START==========================================
+ ONAP Portal SDK
+ ===================================================================
+ Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ ===================================================================
+
+ Unless otherwise specified, all software contained herein is licensed
+ under the Apache License, Version 2.0 (the “License”);
+ you may not use this software except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ Unless otherwise specified, all documentation contained herein is licensed
+ under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ you may not use this documentation except in compliance with the License.
+ You may obtain a copy of the License at
+
+ https://creativecommons.org/licenses/by/4.0/
+
+ Unless required by applicable law or agreed to in writing, documentation
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ ============LICENSE_END============================================
+
+
+ -->
+
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping package="org.onap.portalsdk.workflow.domain">
+
+
+ <!-- WorkflowSchedule mapping details -->
+ <class name="WorkflowSchedule" table="fn_schedule_workflows">
+ <id name="id" column="id_schedule_workflows">
+ <generator class="native">
+ </generator>
+ </id>
+
+ <property name="serverUrl" column="workflow_server_url"/>
+ <property name="workflowKey" column="workflow_key"/>
+ <property name="arguments" column="workflow_arguments"/>
+ <property name="cronDetails" column="startDateTimeCron"/>
+ <property name="startDateTime" column="start_date_time"/>
+ <property name="endDateTime" column="endDateTime"/>
+ <property name="recurrence" column="recurrence"/>
+
+ </class>
+
+
+
+</hibernate-mapping>