aboutsummaryrefslogtreecommitdiffstats
path: root/adapters/mso-catalog-db-adapter
diff options
context:
space:
mode:
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);
+
+ }
+
}