summaryrefslogtreecommitdiffstats
path: root/adapters/mso-catalog-db-adapter
diff options
context:
space:
mode:
authorManamohan <MS00534989@techmahindra.com>2020-02-17 16:13:45 +0530
committerManamohan <MS00534989@techmahindra.com>2020-02-17 16:13:45 +0530
commit9737ae116859da4548dcd1bf3ba73d339f326c52 (patch)
tree9974f0c9fe07c893492e88675783c71be30c5a03 /adapters/mso-catalog-db-adapter
parent460b2c35e214b9422e9313a4bad8253669791ebf (diff)
Based on Controller Actor calling CDS or APPC(Current Flow)
-Added BBNameSelectionReference table having bbName along with action,scope,actor -Updated CatalogDbClient to use BBNameSelectionReference Table -Updated ControllerExecution bmpn to select flow as per Controller Actor -Corrected Format Error Issue-ID: SO-2316 Signed-off-by: Pooja03 <pm00501616@techmahindra.com> Change-Id: I21fad846249f773308e34abcac134d3ee0694027 Signed-off-by: Manamohan <MS00534989@techmahindra.com>
Diffstat (limited to 'adapters/mso-catalog-db-adapter')
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V8.4__AddBBNameSelectionReference.sql16
-rw-r--r--adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java17
2 files changed, 33 insertions, 0 deletions
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V8.4__AddBBNameSelectionReference.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V8.4__AddBBNameSelectionReference.sql
new file mode 100644
index 0000000000..2b8d4ea69f
--- /dev/null
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V8.4__AddBBNameSelectionReference.sql
@@ -0,0 +1,16 @@
+use catalogdb;
+
+CREATE TABLE IF NOT EXISTS `bbname_selection_reference` (
+ `ID` INT(11) NOT NULL AUTO_INCREMENT,
+ `CONTROLLER_ACTOR` varchar(200) NOT NULL ,
+ `SCOPE` varchar(200) NOT NULL,
+ `ACTION` varchar(200) NOT NULL,
+ `BB_NAME` varchar(200) NOT NULL,
+ PRIMARY KEY (`ID`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+INSERT INTO bbname_selection_reference (CONTROLLER_ACTOR,SCOPE,ACTION,BB_NAME)
+VALUES
+('APPC', 'vfModule', 'healthCheck','GenericVnfHealthCheckBB'),
+('APPC', 'vfModule', 'configScaleOut','ConfigurationScaleOutBB'),
+('APPC', 'vnf', 'healthCheck','GenericVnfHealthCheckBB'); \ 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 739b4b62de..e0d5d3803f 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
@@ -33,6 +33,7 @@ import org.junit.Before;
import org.junit.Test;
import org.onap.so.adapters.catalogdb.CatalogDbAdapterBaseTest;
import org.onap.so.db.catalog.beans.AuthenticationType;
+import org.onap.so.db.catalog.beans.BBNameSelectionReference;
import org.onap.so.db.catalog.beans.CloudIdentity;
import org.onap.so.db.catalog.beans.CloudSite;
import org.onap.so.db.catalog.beans.CloudifyManager;
@@ -754,5 +755,21 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest {
assertNotEquals(0, cloudSites.size());
}
+ @Test
+ public void getBBNameSelectionReference_validData_expectedOutput() {
+ BBNameSelectionReference bbNameSelectionReference =
+ client.getBBNameSelectionReference("APPC", "vfModule", "healthCheck");
+ assertNotNull(bbNameSelectionReference);
+ assertEquals("GenericVnfHealthCheckBB", bbNameSelectionReference.getBbName());
+ }
+
+ @Test
+ public void getBBNameSelectionReference_invalidData_nullOutput() {
+ BBNameSelectionReference bbNameSelectionReference =
+ client.getBBNameSelectionReference("ABC", "vfModule", "healthCheck");
+ assertNull(bbNameSelectionReference);
+
+ }
+
}