diff options
Diffstat (limited to 'adapters')
8 files changed, 61 insertions, 32 deletions
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/db/migration/R__CloudConfigMigration.java b/adapters/mso-catalog-db-adapter/src/main/java/db/migration/R__CloudConfigMigration.java index 053c6da1cb..469a7ad7e4 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/db/migration/R__CloudConfigMigration.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/db/migration/R__CloudConfigMigration.java @@ -69,21 +69,6 @@ public class R__CloudConfigMigration implements JdbcMigration, MigrationInfoProv CloudConfig cloudConfig = null; - String tableQuery = "SELECT * FROM identity_services"; - int totalRetries = 20; - boolean tableExists = false; - int count = 1; - while (!tableExists && count != totalRetries) { - try (Statement stmt = connection.createStatement();) { - stmt.executeQuery(tableQuery); - tableExists = true; - } catch (SQLException e) { - count++; - // Wait 5 mintues - Thread.sleep(300000); - } - } - // Try the override file String configLocation = System.getProperty("spring.config.additional-location"); if (configLocation != null) { diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__WorkflowDesignerData.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__WorkflowDesignerData.sql new file mode 100644 index 0000000000..c74ce6940c --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__WorkflowDesignerData.sql @@ -0,0 +1,27 @@ +use catalogdb; + +DELETE FROM activity_spec_to_activity_spec_parameters; +DELETE FROM activity_spec_to_activity_spec_categories; +DELETE FROM activity_spec; +DELETE FROM activity_spec_categories; +DELETE FROM activity_spec_parameters; + +INSERT INTO activity_spec (NAME, DESCRIPTION, VERSION) +VALUES ('VNFSetInMaintFlagActivity','Activity to Set InMaint Flag in A&AI',1.0); + +INSERT INTO activity_spec_categories (NAME) +VALUES ('VNF'); + +INSERT INTO activity_spec_parameters (NAME, TYPE, DIRECTION, DESCRIPTION) +VALUES('WorkflowException','WorkflowException','outputParameters','Description'); + +INSERT INTO activity_spec_to_activity_spec_categories(ACTIVITY_SPEC_ID, ACTIVITY_SPEC_CATEGORIES_ID) +VALUES +( +(select ID from ACTIVITY_SPEC where NAME='VNFSetInMaintFlagActivity' and VERSION=1.0), +(select ID from activity_spec_categories where NAME='VNF')); + +INSERT INTO activity_spec_to_activity_spec_parameters( ACTIVITY_SPEC_ID, ACTIVITY_SPEC_PARAMETERS_ID) +VALUES( +(select ID from ACTIVITY_SPEC where NAME='VNFSetInMaintFlagActivity' and VERSION=1.0), +(select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='outputParameters'));
\ No newline at end of file diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.10__AlterforWorkFlowDesignerTables.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.10__AlterforWorkFlowDesignerTables.sql new file mode 100644 index 0000000000..775455d589 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.10__AlterforWorkFlowDesignerTables.sql @@ -0,0 +1,14 @@ +use catalogdb; + +ALTER TABLE activity_spec_to_activity_spec_categories DROP FOREIGN KEY fk_activity_spec_to_activity_spec_categories__activity_spec_c1; + +ALTER TABLE activity_spec_categories modify id INT(11) not null auto_increment; + +ALTER TABLE activity_spec_to_activity_spec_categories ADD + CONSTRAINT `fk_activity_spec_to_activity_spec_categories__activity_spec_c1` + FOREIGN KEY (`ACTIVITY_SPEC_CATEGORIES_ID`) + REFERENCES `activity_spec_categories` (`ID`) + ON DELETE CASCADE + ON UPDATE CASCADE; + +ALTER TABLE activity_spec_to_activity_spec_categories modify id INT(11) not null auto_increment;
\ No newline at end of file diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java index e1152bad4a..51b44b0d3a 100644 --- a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java +++ b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java @@ -658,4 +658,19 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest { Assert.assertNull(workflow); } + @Test + public void getWorkflowByModelUUID_validUuid_expectedOutput() { + List<Workflow> workflows = client.findWorkflowByModelUUID("ff2ae348-214a-11e7-93ae-92361f002671"); + assertTrue(workflows != null); + assertTrue(workflows.size() != 0); + + assertEquals("testingWorkflow", workflows.get(0).getArtifactName()); + } + + @Test + public void getWorkflowByModelUUID_invalidUuid_nullOutput() { + Workflow workflow = client.findWorkflowByArtifactUUID(UUID.randomUUID().toString()); + Assert.assertNull(workflow); + } + } diff --git a/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql b/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql index af00732f2b..0229dd0d85 100644 --- a/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql +++ b/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql @@ -226,3 +226,6 @@ insert into pnf_resource_customization_to_service(service_model_uuid, resource_m insert into workflow(artifact_uuid, artifact_name, name, operation_name, version, description, body, resource_target, source) values ('5b0c4322-643d-4c9f-b184-4516049e99b1', 'testingWorkflow', 'testingWorkflow', 'create', 1, 'Test Workflow', null, 'vnf', 'sdc'); + +insert into vnf_resource_to_workflow(vnf_resource_model_uuid, workflow_id) values +('ff2ae348-214a-11e7-93ae-92361f002671', '1'); diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java index d13b1724df..4753b1c18d 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java @@ -67,7 +67,7 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync { private static final Logger logger = LoggerFactory.getLogger(MsoNetworkAdapterAsyncImpl.class); private static final String BPEL_AUTH_PROP = "org.onap.so.adapters.network.bpelauth"; - private static final String ENCRYPTION_KEY_PROP = "org.onap.so.adapters.network.encryptionKey"; + private static final String ENCRYPTION_KEY_PROP = "mso.msoKey"; private static final String NETWORK_EXCEPTION_MSG = "Got a NetworkException on createNetwork: "; private static final String CREATE_NETWORK_ERROR_LOGMSG = "{} {} Error sending createNetwork notification {} "; private static final String FAULT_INFO_ERROR_LOGMSG = "{} {} Exception - fault info "; diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRest.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRest.java index 487b14b942..e81b211b27 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRest.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRest.java @@ -359,22 +359,7 @@ public class VnfAdapterRest { vfModuleStackId.value = "479D3D8B-6360-47BC-AB75-21CC91981484"; outputs.value = VolumeAdapterRest.testMap(); } else { - // vnfAdapter.createVnf (createReq.getCloudSiteId(), - // createReq.getTenantId(), - // createReq.getVnfType(), - // createReq.getVnfVersion(), - // createReq.getVfModuleName(), - // createReq.getRequestType(), - // createReq.getVolumeGroupStackId(), - // createReq.getVfModuleParams(), - // createReq.getFailIfExists(), - // createReq.getBackout(), - // createReq.getMsoRequest(), - // vfModuleStackId, - // outputs, - // vnfRollback); vnfAdapter.createVfModule(req.getCloudSiteId(), req.getCloudOwner(), req.getTenantId(), - // req.getVnfType(), completeVnfVfModuleType, req.getVnfVersion(), req.getVnfId(), req.getVfModuleName(), req.getVfModuleId(), req.getRequestType(), req.getVolumeGroupStackId(), req.getBaseVfModuleStackId(), req.getModelCustomizationUuid(), req.getVfModuleParams(), diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfAdapterImplTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfAdapterImplTest.java index f314d32328..0c56222558 100644 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfAdapterImplTest.java +++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfAdapterImplTest.java @@ -296,7 +296,7 @@ public class MsoVnfAdapterImplTest extends BaseRestTestUtils { Map<String, Object> map = new HashMap<>(); map.put("key1", "value1"); instance.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", - "VFMOD", "volumeGroupHeatStackId", "baseVfHeatStackId", "88a6ca3ee0394ade9403f075db23167e", map, + "VFMOD", "volumeGroupHeatStackId", "baseVfHeatStackId", "9b339a61-69ca-465f-86b8-1c72c582b8e8", map, Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, msoRequest, new Holder<>(), new Holder<Map<String, String>>(), new Holder<VnfRollback>()); } |