From f5da5198e43addc77989dee8b500cb69e9885f93 Mon Sep 17 00:00:00 2001 From: BT2983 Date: Mon, 23 Jul 2018 23:51:20 -0600 Subject: Adding naming micro-service code - more tests. Integration tests and more unit tests. Change-Id: Id3500085a43ff817d04d8f407e5cdbc4271dfb35 Issue-ID: CCSDK-342 Signed-off-by: BT2983 --- .../main/resources/db/changelog/db.changelog-master.xml | 11 ++--------- .../changelog/scripts/rel_18_10/01_initial_ref_data_v1.sql | 6 +++++- .../changelog/scripts/rel_18_10/04_ref_data_extrn_int.sql | 14 +++++++++++--- .../db/changelog/scripts/rel_18_10/create_base_tables.sql | 6 +++--- 4 files changed, 21 insertions(+), 16 deletions(-) (limited to 'ms/neng/src/main/resources/db/changelog') diff --git a/ms/neng/src/main/resources/db/changelog/db.changelog-master.xml b/ms/neng/src/main/resources/db/changelog/db.changelog-master.xml index 9d735e64..dbbd71b6 100644 --- a/ms/neng/src/main/resources/db/changelog/db.changelog-master.xml +++ b/ms/neng/src/main/resources/db/changelog/db.changelog-master.xml @@ -1,5 +1,5 @@ -/*- + - - - - - - - diff --git a/ms/neng/src/main/resources/db/changelog/scripts/rel_18_10/01_initial_ref_data_v1.sql b/ms/neng/src/main/resources/db/changelog/scripts/rel_18_10/01_initial_ref_data_v1.sql index 44d86f0a..e5a4e117 100644 --- a/ms/neng/src/main/resources/db/changelog/scripts/rel_18_10/01_initial_ref_data_v1.sql +++ b/ms/neng/src/main/resources/db/changelog/scripts/rel_18_10/01_initial_ref_data_v1.sql @@ -5,14 +5,18 @@ --set @@autocommit:=0; ---delete all records delete from SERVICE_PARAMETER; INSERT INTO SERVICE_PARAMETER(NAME, VALUE, CREATED_BY) VALUES ('initial_increment','10,40,50,100','Initial'); +INSERT INTO SERVICE_PARAMETER(NAME, VALUE, CREATED_BY) VALUES ('max_gen_attempt','50','Initial'); INSERT INTO SERVICE_PARAMETER(NAME, VALUE, CREATED_BY) VALUES ('recipe_separator','|":",','Initial'); +INSERT INTO SERVICE_PARAMETER(NAME, VALUE, CREATED_BY) VALUES ('use_db_policy','N','Initial'); delete from IDENTIFIER_MAP; +INSERT INTO IDENTIFIER_MAP(POLICY_FN_NAME, JS_FN_NAME, CREATED_BY) VALUES ('sub_str','substring', 'Initial'); INSERT INTO IDENTIFIER_MAP(POLICY_FN_NAME, JS_FN_NAME, CREATED_BY) VALUES ('substr','substring', 'Initial'); +INSERT INTO IDENTIFIER_MAP(POLICY_FN_NAME, JS_FN_NAME, CREATED_BY) VALUES ('to_lower_case','toLowerCase', 'Initial'); +INSERT INTO IDENTIFIER_MAP(POLICY_FN_NAME, JS_FN_NAME, CREATED_BY) VALUES ('to_upper_case','toUpperCase', 'Initial'); commit; diff --git a/ms/neng/src/main/resources/db/changelog/scripts/rel_18_10/04_ref_data_extrn_int.sql b/ms/neng/src/main/resources/db/changelog/scripts/rel_18_10/04_ref_data_extrn_int.sql index bc72a2e8..7b0973c2 100644 --- a/ms/neng/src/main/resources/db/changelog/scripts/rel_18_10/04_ref_data_extrn_int.sql +++ b/ms/neng/src/main/resources/db/changelog/scripts/rel_18_10/04_ref_data_extrn_int.sql @@ -1,24 +1,32 @@ --liquibase formatted sql --changeset ref_data_update:18_10.ref_data_update.sql --- clean up any data delete from external_interface; ---insert the data - insert into external_interface(SYSTEM,PARAM,URL_SUFFIX,CREATED_TIME,CREATED_BY,LAST_UPDATED_TIME,LAST_UPDATED_BY) values('aai','vnf-name','nodes/generic-vnfs?vnf-name=',sysdate(),'nengsys',sysdate(),'nengsys'); +insert into external_interface(SYSTEM,PARAM,URL_SUFFIX,CREATED_TIME,CREATED_BY,LAST_UPDATED_TIME,LAST_UPDATED_BY) +values('aai','VNF','nodes/generic-vnfs?vnf-name=',sysdate(),'nengsys',sysdate(),'nengsys'); insert into external_interface(SYSTEM,PARAM,URL_SUFFIX,CREATED_TIME,CREATED_BY,LAST_UPDATED_TIME,LAST_UPDATED_BY) values('aai','vnfc-name','nodes/vnfcs?vnfc-name=',sysdate(),'nengsys',sysdate(),'nengsys'); +insert into external_interface(SYSTEM,PARAM,URL_SUFFIX,CREATED_TIME,CREATED_BY,LAST_UPDATED_TIME,LAST_UPDATED_BY) +values('aai','VNFC','nodes/vnfcs?vnfc-name=',sysdate(),'nengsys',sysdate(),'nengsys'); insert into external_interface(SYSTEM,PARAM,URL_SUFFIX,CREATED_TIME,CREATED_BY,LAST_UPDATED_TIME,LAST_UPDATED_BY) values('aai','vserver-name','nodes/vservers?vserver-name=',sysdate(),'nengsys',sysdate(),'nengsys'); insert into external_interface(SYSTEM,PARAM,URL_SUFFIX,CREATED_TIME,CREATED_BY,LAST_UPDATED_TIME,LAST_UPDATED_BY) values('aai','vf-module-name','nodes/vf-modules?vf-module-name=',sysdate(),'nengsys',sysdate(),'nengsys'); +insert into external_interface(SYSTEM,PARAM,URL_SUFFIX,CREATED_TIME,CREATED_BY,LAST_UPDATED_TIME,LAST_UPDATED_BY) +values('aai','VFMODULE','nodes/vf-modules?vf-module-name=',sysdate(),'nengsys',sysdate(),'nengsys'); +insert into external_interface(SYSTEM,PARAM,URL_SUFFIX,CREATED_TIME,CREATED_BY,LAST_UPDATED_TIME,LAST_UPDATED_BY) +values('aai','VF-MODULE','nodes/vf-modules?vf-module-name=',sysdate(),'nengsys',sysdate(),'nengsys'); insert into external_interface(SYSTEM,PARAM,URL_SUFFIX,CREATED_TIME,CREATED_BY,LAST_UPDATED_TIME,LAST_UPDATED_BY) values('aai','service-instance-id','nodes/service-instances?service-instance-id=',sysdate(),'nengsys',sysdate(),'nengsys'); +insert into external_interface(SYSTEM,PARAM,URL_SUFFIX,CREATED_TIME,CREATED_BY,LAST_UPDATED_TIME,LAST_UPDATED_BY) +values('aai','VM','nodes/vservers?vserver-name=',sysdate(),'nengsys',sysdate(),'nengsys'); + commit; diff --git a/ms/neng/src/main/resources/db/changelog/scripts/rel_18_10/create_base_tables.sql b/ms/neng/src/main/resources/db/changelog/scripts/rel_18_10/create_base_tables.sql index f79dd3fc..4cfe05c8 100644 --- a/ms/neng/src/main/resources/db/changelog/scripts/rel_18_10/create_base_tables.sql +++ b/ms/neng/src/main/resources/db/changelog/scripts/rel_18_10/create_base_tables.sql @@ -10,14 +10,14 @@ NAME VARCHAR(500) COMMENT 'Generated name', PREFIX VARCHAR(100) COMMENT 'The prefix for the name. (The part of the name before the sequence number.)', SUFFIX VARCHAR(100) COMMENT 'The suffix for the name. (The part of the name after the sequence number.)', IS_RELEASED CHAR(1) COMMENT 'Indicating if the entry is released/unassigned', -CREATED_TIME DATETIME DEFAULT CURRENT_TIMESTAMP, +CREATED_TIME DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, CREATED_BY VARCHAR(50), LAST_UPDATED_TIME DATETIME, LAST_UPDATED_BY VARCHAR(50)) AUTO_INCREMENT=100; -- COMMENT 'TABLE TO STORE GENERATED NAMES'; CREATE TABLE SERVICE_PARAMETER (SERVICE_PARAMETER_ID INTEGER PRIMARY KEY AUTO_INCREMENT, -NAME VARCHAR(500) COMMENT 'Parameter name' NOT NULL UNIQUE, +NAME VARCHAR(500) NOT NULL COMMENT 'Parameter name', VALUE VARCHAR(500) COMMENT 'Parameter value', CREATED_TIME DATETIME DEFAULT CURRENT_TIMESTAMP, CREATED_BY VARCHAR(50), @@ -26,7 +26,7 @@ LAST_UPDATED_BY VARCHAR(50) ) AUTO_INCREMENT=100; CREATE TABLE IDENTIFIER_MAP (IDENTIFIER_MAP_ID INTEGER PRIMARY KEY AUTO_INCREMENT, -POLICY_FN_NAME VARCHAR(500) COMMENT 'Function name in policy manager' NOT NULL UNIQUE, +POLICY_FN_NAME VARCHAR(500) COMMENT 'Function name in policy manager' NOT NULL, JS_FN_NAME VARCHAR(500) COMMENT 'Equivalent name in Java or script', CREATED_TIME DATETIME DEFAULT CURRENT_TIMESTAMP, CREATED_BY VARCHAR(50), -- cgit 1.2.3-korg