summaryrefslogtreecommitdiffstats
path: root/adapters/mso-catalog-db-adapter/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'adapters/mso-catalog-db-adapter/src/test')
-rw-r--r--adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/NetworkCollectionCatalogDbQueryTest.java19
-rw-r--r--adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql24
2 files changed, 37 insertions, 6 deletions
diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/NetworkCollectionCatalogDbQueryTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/NetworkCollectionCatalogDbQueryTest.java
index 440270e047..0ffc213a4e 100644
--- a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/NetworkCollectionCatalogDbQueryTest.java
+++ b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/NetworkCollectionCatalogDbQueryTest.java
@@ -30,13 +30,13 @@ import java.util.List;
import javax.transaction.Transactional;
import org.junit.Before;
import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.onap.so.adapters.catalogdb.CatalogDBApplication;
import org.onap.so.adapters.catalogdb.CatalogDbAdapterBaseTest;
import org.onap.so.db.catalog.beans.BuildingBlockDetail;
import org.onap.so.db.catalog.beans.CollectionNetworkResourceCustomization;
import org.onap.so.db.catalog.beans.CollectionResourceCustomization;
import org.onap.so.db.catalog.beans.CollectionResourceInstanceGroupCustomization;
+import org.onap.so.db.catalog.beans.CvnfcConfigurationCustomization;
+import org.onap.so.db.catalog.beans.CvnfcCustomization;
import org.onap.so.db.catalog.beans.InstanceGroup;
import org.onap.so.db.catalog.beans.NetworkCollectionResourceCustomization;
import org.onap.so.db.catalog.client.CatalogDbClientPortChanger;
@@ -44,9 +44,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.server.LocalServerPort;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.ActiveProfiles;
-import org.springframework.test.context.junit4.SpringRunner;
public class NetworkCollectionCatalogDbQueryTest extends CatalogDbAdapterBaseTest {
@@ -149,4 +146,16 @@ public class NetworkCollectionCatalogDbQueryTest extends CatalogDbAdapterBaseTes
assertNotNull(collectionNetworkCust);
logger.debug(collectionNetworkCust.getModelCustomizationUUID());
}
+
+ @Test
+ public void getCvnfcCustomization() {
+ client.getServiceByID(serviceUUID);
+ String vfId = "cb82ffd8-252a-11e7-93ae-92361f002671";
+ String vnfId = "68dc9a92-214c-11e7-93ae-92361f002671";
+
+ CvnfcConfigurationCustomization fabricConfig =
+ client.getCvnfcCustomization(serviceUUID, vnfId, vfId, "dadc2c8c-2bab-11e9-b210-d663bd873d95");
+ assertEquals("386c9aa7-9318-48ee-a6d1-1bf0f85de385", fabricConfig.getModelCustomizationUUID());
+ }
+
}
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 32c51293c2..8fd171bf64 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
@@ -213,8 +213,30 @@ VALUES ( '1',
'testNfcFunction',
'testNfcNamingCode',
'2018-07-17 14:05:08',
+ '9bcce658-9b37-11e8-98d0-529269fb1459',1),
+ ( '2',
+ 'dadc2c8c-2bab-11e9-b210-d663bd873d95',
+ 'testModelInstanceName',
+ 'b25735fe-9b37-11e8-98d0-529269fb1459',
+ 'ba7e6ef0-9b37-11e8-98d0-529269fb1459',
+ 'testModelVersion',
+ 'testModelName',
+ 'testToscaNodeType',
+ 'testCvnfcCustomzationDescription',
+ 'testNfcFunction',
+ 'testNfcNamingCode',
+ '2018-07-17 14:05:08',
'9bcce658-9b37-11e8-98d0-529269fb1459',1);
+
+
+INSERT IGNORE INTO `configuration` (`MODEL_UUID`, `MODEL_INVARIANT_UUID`, `MODEL_VERSION`, `MODEL_NAME`, `TOSCA_NODE_TYPE`, `DESCRIPTION`, `CREATION_TIMESTAMP`) VALUES
+ ('d2195b0e-307a-4d30-b82f-9c82001d965e', '2f0a4b7a-dfdb-4f82-a2ab-b65d1ddd5e8e', '13.0', 'Fabric Configuration', 'org.openecomp.nodes.FabricConfiguration', 'A fabric Configuration object', '2019-06-04 20:12:20');
+
+INSERT IGNORE INTO `cvnfc_configuration_customization` (`MODEL_CUSTOMIZATION_UUID`, `MODEL_INSTANCE_NAME`, `CONFIGURATION_TYPE`, `CONFIGURATION_ROLE`, `CONFIGURATION_FUNCTION`, `POLICY_NAME`, `CREATION_TIMESTAMP`, `CONFIGURATION_MODEL_UUID`, `CVNFC_CUSTOMIZATION_ID`) VALUES
+ ('386c9aa7-9318-48ee-a6d1-1bf0f85de385', 'Fabric Configuration 0', '5G', 'Fabric Config', 'Network Cloud', 'Config_MS_fabric_configuration_FRWL.1.xml', '2019-06-04 20:12:20', 'd2195b0e-307a-4d30-b82f-9c82001d965e', '2');
+
+
insert into service(model_uuid, model_name, model_invariant_uuid, model_version, description, creation_timestamp, tosca_csar_artifact_uuid, service_type, service_role, environment_context, workload_context) values
('5df8b6de-2083-11e7-93ae-92361f002676', 'PNF_routing_service', '9647dfc4-2083-11e7-93ae-92361f002676', '1.0', 'PNF service', '2019-03-08 12:00:29', null, 'NA', 'NA', 'Luna', 'Oxygen');
@@ -231,4 +253,4 @@ insert into workflow(artifact_uuid, artifact_name, name, operation_name, version
('5b0c4322-643d-4c9f-b184-4516049e99b1', 'testingWorkflow.bpmn', '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');
+('ff2ae348-214a-11e7-93ae-92361f002671', '1'); \ No newline at end of file