summaryrefslogtreecommitdiffstats
path: root/mso-catalog-db/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'mso-catalog-db/src/test')
-rw-r--r--mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/ActivitySpecRepositoryTest.java35
-rw-r--r--mso-catalog-db/src/test/resources/schema.sql34
2 files changed, 48 insertions, 21 deletions
diff --git a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/ActivitySpecRepositoryTest.java b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/ActivitySpecRepositoryTest.java
new file mode 100644
index 0000000000..024940f68d
--- /dev/null
+++ b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/ActivitySpecRepositoryTest.java
@@ -0,0 +1,35 @@
+/*
+ * ============LICENSE_START======================================================= Copyright (C) 2019 Nordix
+ * Foundation. ================================================================================ Licensed under the
+ * Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may
+ * obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific language governing permissions and limitations under the
+ * License.
+ *
+ * SPDX-License-Identifier: Apache-2.0 ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.db.catalog.data.repository;
+
+import java.util.List;
+import org.junit.Assert;
+import org.junit.Test;
+import org.onap.so.db.catalog.BaseTest;
+import org.onap.so.db.catalog.beans.ActivitySpec;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.CollectionUtils;
+
+public class ActivitySpecRepositoryTest extends BaseTest {
+
+ @Autowired
+ private ActivitySpecRepository activitySpecRepository;
+
+ @Test
+ public void findAllTest() throws Exception {
+ List<ActivitySpec> activitySpecList = activitySpecRepository.findAll();
+ Assert.assertFalse(CollectionUtils.isEmpty(activitySpecList));
+ }
+}
diff --git a/mso-catalog-db/src/test/resources/schema.sql b/mso-catalog-db/src/test/resources/schema.sql
index 5e43f8f3e2..f5e7d52ba4 100644
--- a/mso-catalog-db/src/test/resources/schema.sql
+++ b/mso-catalog-db/src/test/resources/schema.sql
@@ -280,6 +280,7 @@ DROP TABLE IF EXISTS `configuration_customization`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `configuration_customization` (
+ `ID` int(11) NOT NULL AUTO_INCREMENT,
`MODEL_CUSTOMIZATION_UUID` varchar(200) NOT NULL,
`MODEL_INSTANCE_NAME` varchar(200) NOT NULL,
`CONFIGURATION_TYPE` varchar(200) DEFAULT NULL,
@@ -288,27 +289,18 @@ CREATE TABLE `configuration_customization` (
`CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`CONFIGURATION_MODEL_UUID` varchar(200) NOT NULL,
`SERVICE_PROXY_CUSTOMIZATION_MODEL_CUSTOMIZATION_UUID` varchar(200) DEFAULT NULL,
- `CONFIGURATION_CUSTOMIZATION_MODEL_CUSTOMIZATION_UUID` varchar(200) DEFAULT NULL,
- PRIMARY KEY (`MODEL_CUSTOMIZATION_UUID`),
- KEY `fk_configuration_customization__configuration_idx` (`CONFIGURATION_MODEL_UUID`),
- KEY `fk_configuration_customization__service_proxy_customization_idx` (`SERVICE_PROXY_CUSTOMIZATION_MODEL_CUSTOMIZATION_UUID`),
- KEY `fk_configuration_customization__configuration_customization_idx` (`CONFIGURATION_CUSTOMIZATION_MODEL_CUSTOMIZATION_UUID`),
- CONSTRAINT `fk_configuration_customization__configuration_customization1` FOREIGN KEY (`CONFIGURATION_CUSTOMIZATION_MODEL_CUSTOMIZATION_UUID`) REFERENCES `configuration_customization` (`MODEL_CUSTOMIZATION_UUID`) ON DELETE CASCADE ON UPDATE CASCADE,
- CONSTRAINT `fk_configuration_resource_customization__configuration_resour1` FOREIGN KEY (`CONFIGURATION_MODEL_UUID`) REFERENCES `configuration` (`MODEL_UUID`) ON DELETE CASCADE ON UPDATE CASCADE
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-/*!40101 SET character_set_client = @saved_cs_client */;
-
---
--- Table structure for table `configuration_customization_to_service`
---
-
-DROP TABLE IF EXISTS `configuration_customization_to_service`;
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `configuration_customization_to_service` (
- `SERVICE_MODEL_UUID` varchar(200) NOT NULL,
- `RESOURCE_MODEL_CUSTOMIZATION_UUID` varchar(200) NOT NULL,
- PRIMARY KEY (`SERVICE_MODEL_UUID`,`RESOURCE_MODEL_CUSTOMIZATION_UUID`)
+ `CONFIGURATION_CUSTOMIZATION_MODEL_CUSTOMIZATION_ID` int(11) DEFAULT NULL,
+ `SERVICE_MODEL_UUID` varchar(200),
+ PRIMARY KEY (`ID`),
+ KEY `fk_configuration_customization__configuration_idx` (`CONFIGURATION_MODEL_UUID`),
+ KEY `fk_configuration_customization__service_idx` (`SERVICE_MODEL_UUID`),
+ UNIQUE KEY `uk_configuration_customization` (`MODEL_CUSTOMIZATION_UUID` ASC, `SERVICE_MODEL_UUID` ASC),
+ CONSTRAINT `fk_configuration_customization__configuration1` FOREIGN KEY (`CONFIGURATION_MODEL_UUID`)
+ REFERENCES `configuration` (`MODEL_UUID`)
+ ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `fk_configuration_customization__service1` FOREIGN KEY (`SERVICE_MODEL_UUID`)
+ REFERENCES `service` (`MODEL_UUID`)
+ ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;