diff options
Diffstat (limited to 'so-etsi-nfvo/so-etsi-nfvo-ns-lcm')
7 files changed, 33 insertions, 17 deletions
diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/pom.xml b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/pom.xml index 3178b28502..6d47e06784 100644 --- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/pom.xml +++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/pom.xml @@ -108,5 +108,10 @@ <version>${equalsverifier-version}</version> <scope>test</scope> </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-test</artifactId> + <scope>test</scope> + </dependency> </dependencies> </project>
\ No newline at end of file diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/tasks/InstantiateNsTask.java b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/tasks/InstantiateNsTask.java index a6d35e301e..aeb2d11934 100644 --- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/tasks/InstantiateNsTask.java +++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/tasks/InstantiateNsTask.java @@ -31,7 +31,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.camunda.bpm.engine.delegate.DelegateExecution; import org.onap.so.adapters.etsisol003adapter.lcm.v1.model.Tenant; import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.NsdInfo; diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/test/resources/application.yaml b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/test/resources/application.yaml index 101e17a791..5a8e250157 100644 --- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/test/resources/application.yaml +++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/test/resources/application.yaml @@ -22,14 +22,19 @@ spring: pool-name: ns-lcm-bpmn-pool registerMbeans: true nfvo: - jdbcUrl: jdbc:h2:mem:nfvo;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE;INIT=CREATE SCHEMA IF NOT EXISTS nfvo; + jdbcUrl: jdbc:h2:mem:nfvo;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE;INIT=CREATE SCHEMA IF NOT EXISTS nfvo;MODE=MYSQL;DATABASE_TO_LOWER=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE driver-class-name: org.h2.Driver pool-name: ns-lcm-bpmn-pool registerMbeans: true + test: + database: + replace: NONE jpa: generate-ddl: true + dialect: org.hibernate.dialect.MySQL5Dialect hibernate: ddl-auto: create + database-platform: org.hibernate.dialect.MariaDBDialect hibernate: dialect: org.hibernate.dialect.H2Dialect hbm2ddl: diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/resources/db/migration/V1_1__create_nfvo_tables.sql b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/resources/db/migration/V1_1__create_nfvo_tables.sql index 85a732b83e..7f50c791f6 100644 --- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/resources/db/migration/V1_1__create_nfvo_tables.sql +++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/resources/db/migration/V1_1__create_nfvo_tables.sql @@ -1,7 +1,7 @@ use nfvo; CREATE TABLE IF NOT EXISTS `JOB` ( - `JOB_ID` varchar(255) NOT NULL, + `JOB_ID` varchar(255) PRIMARY KEY NOT NULL, `JOB_TYPE` varchar(255) NOT NULL, `JOB_ACTION` varchar(255) NOT NULL, `RESOURCE_ID` varchar(255) NOT NULL, @@ -10,26 +10,24 @@ CREATE TABLE IF NOT EXISTS `JOB` ( `START_TIME` DATETIME DEFAULT NULL, `END_TIME` DATETIME DEFAULT NULL, `PROGRESS` int(11) DEFAULT NULL, - `PROCESS_INSTANCE_ID` varchar(255) DEFAULT NULL, - PRIMARY KEY (`JOB_ID`) + `PROCESS_INSTANCE_ID` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `JOB_STATUS` ( - `ID` INT NOT NULL AUTO_INCREMENT, + `ID` INT NOT NULL PRIMARY KEY AUTO_INCREMENT, `UPDATED_TIME` DATETIME NOT NULL, `DESCRIPTION` longtext DEFAULT NULL, `STATUS` varchar(255) NOT NULL, `JOB_ID` varchar(255) NOT NULL, - PRIMARY KEY (`ID`), FOREIGN KEY (JOB_ID) REFERENCES JOB(JOB_ID) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `NS_INST` ( - `NS_INST_ID` varchar(255) NOT NULL, + `NS_INST_ID` varchar(255) PRIMARY KEY NOT NULL, `NAME` varchar(255) NOT NULL, `NS_PACKAGE_ID` varchar(255) DEFAULT NULL, `NSD_ID` varchar(255) NOT NULL, @@ -38,12 +36,11 @@ CREATE TABLE IF NOT EXISTS `NS_INST` ( `STATUS` varchar(255) NOT NULL, `STATUS_UPDATED_TIME` DATETIME NOT NULL, `GLOBAL_CUSTOMER_ID` varchar(255) DEFAULT NULL, - `SERVICE_TYPE` varchar(255) DEFAULT NULL, - PRIMARY KEY (`NS_INST_ID`) + `SERVICE_TYPE` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `NF_INST` ( - `NF_INST_ID` varchar(255) NOT NULL, + `NF_INST_ID` varchar(255) PRIMARY KEY NOT NULL, `NAME` varchar(255) DEFAULT NULL, `VNFD_ID` varchar(255) DEFAULT NULL, `PACKAGE_ID` varchar(255) DEFAULT NULL, @@ -51,14 +48,13 @@ CREATE TABLE IF NOT EXISTS `NF_INST` ( `STATUS` varchar(255) NOT NULL, `CREATE_TIME` DATETIME DEFAULT NULL, `LAST_UPDATE_TIME` DATETIME DEFAULT NULL, - PRIMARY KEY (`NF_INST_ID`), FOREIGN KEY (NS_INST_ID) REFERENCES NS_INST(NS_INST_ID) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `NS_LCM_OP_OCCS` ( - `ID` varchar(255) NOT NULL, + `ID` varchar(255) PRIMARY KEY NOT NULL, `OPERATION_STATE` varchar(255) NOT NULL, `STATE_ENTERED_TIME` DATETIME DEFAULT NULL, `START_TIME` DATETIME DEFAULT NULL, @@ -68,7 +64,6 @@ CREATE TABLE IF NOT EXISTS `NS_LCM_OP_OCCS` ( `OPERATION_PARAMS` longtext NOT NULL, `IS_CANCEL_PENDING` varchar(255) NOT NULL, `CANCEL_MODE` varchar(255) DEFAULT NULL, - PRIMARY KEY (`ID`), FOREIGN KEY (NS_INST_ID) REFERENCES NS_INST(NS_INST_ID) ON UPDATE CASCADE ON DELETE CASCADE diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/test/java/org/onap/so/etsi/nfvo/ns/lcm/database/DatabaseServiceProviderTest.java b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/test/java/org/onap/so/etsi/nfvo/ns/lcm/database/DatabaseServiceProviderTest.java index fcf7f9c373..b9858a8dd5 100644 --- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/test/java/org/onap/so/etsi/nfvo/ns/lcm/database/DatabaseServiceProviderTest.java +++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/test/java/org/onap/so/etsi/nfvo/ns/lcm/database/DatabaseServiceProviderTest.java @@ -23,6 +23,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.time.LocalDateTime; +import java.time.temporal.ChronoUnit; import java.util.List; import java.util.Optional; import java.util.UUID; @@ -55,7 +56,7 @@ public class DatabaseServiceProviderTest { private static final String RANDOM_ID = UUID.randomUUID().toString(); private static final String DUMMY_NAME = "NAME"; - private static final LocalDateTime CURRENT_DATE_TIME = LocalDateTime.now(); + private static final LocalDateTime CURRENT_DATE_TIME = LocalDateTime.now().truncatedTo(ChronoUnit.MILLIS); @Autowired private DatabaseServiceProvider databaseServiceProvider; diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/test/resources/application.yaml b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/test/resources/application.yaml index adc36aca1d..478a5b5ac7 100644 --- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/test/resources/application.yaml +++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/test/resources/application.yaml @@ -17,14 +17,19 @@ spring: datasource: hikari: nfvo: - jdbcUrl: jdbc:h2:mem:nfvo;DB_CLOSE_DELAY=-1;INIT=CREATE SCHEMA IF NOT EXISTS nfvo; + jdbcUrl: jdbc:h2:mem:nfvo;DB_CLOSE_DELAY=-1;INIT=CREATE SCHEMA IF NOT EXISTS nfvo;MODE=MYSQL;DATABASE_TO_LOWER=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE driver-class-name: org.h2.Driver pool-name: ns-lcm-bpmn-pool registerMbeans: true + test: + database: + replace: NONE jpa: generate-ddl: true + dialect: org.hibernate.dialect.MySQL5Dialect hibernate: ddl-auto: create + database-platform: org.hibernate.dialect.MariaDBDialect hibernate: dialect: org.hibernate.dialect.H2Dialect hbm2ddl: diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/test/resources/application.yaml b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/test/resources/application.yaml index 6f2b4d26c5..608cde2471 100644 --- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/test/resources/application.yaml +++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/test/resources/application.yaml @@ -24,14 +24,19 @@ spring: pool-name: ns-lcm-bpmn-pool registerMbeans: true nfvo: - jdbcUrl: jdbc:h2:mem:NFVO;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE;INIT=CREATE SCHEMA IF NOT EXISTS NFVO; + jdbcUrl: jdbc:h2:mem:NFVO;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE;INIT=CREATE SCHEMA IF NOT EXISTS NFVO;MODE=MYSQL;DATABASE_TO_LOWER=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE driver-class-name: org.h2.Driver pool-name: ns-lcm-nfvo-pool registerMbeans: true + test: + database: + replace: NONE jpa: generate-ddl: true + dialect: org.hibernate.dialect.MySQL5Dialect hibernate: ddl-auto: create + database-platform: org.hibernate.dialect.MariaDBDialect logging: level: org.reflections.Reflections: ERROR |