diff options
author | Steve Smokowski <ss835w@att.com> | 2020-02-18 17:14:40 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-02-18 17:14:40 +0000 |
commit | 2d11a7092c292a3987ad0b105fe31ee8a0390294 (patch) | |
tree | dd81ebe972cb7656e09050213d8e8fff19967429 /adapters/mso-catalog-db-adapter | |
parent | a71813fd697298b9a9bddea6eacc9de5fada2de0 (diff) | |
parent | 9737ae116859da4548dcd1bf3ba73d339f326c52 (diff) |
Merge "Based on Controller Actor calling CDS or APPC(Current Flow)"
Diffstat (limited to 'adapters/mso-catalog-db-adapter')
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 b4dfca3c6c..03ef24ded0 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); + + } + } |