summaryrefslogtreecommitdiffstats
path: root/mso-catalog-db
diff options
context:
space:
mode:
authorBenjamin, Max (mb388a) <mb388a@us.att.com>2018-09-29 10:41:54 -0400
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2018-11-05 10:22:41 -0500
commit6fa3d2b80d2384b830e3231fe69a8daf7884a35e (patch)
tree565014596071f8b57919d762dc4d9733de7ea92f /mso-catalog-db
parent6b4910cc194286bccb2a63f63d12bfefcdb7fb3f (diff)
Springboot 2.0 upgrade
corrected typo in CloudConfiguration class removed files which should not have been merged updated gr api test cases with dynamic cloud owner updated groovy files to allow for dynamic cloud owner values moved VFModularity folder to mso-infrastructure bpmn updated GR API layer to include cloud owner added enum for default cloud owner - fixing junit test cases for using catalogDb client r2 - fixing junit test cases for using catalogDb client - Internal review comments incorporated for merging mocking into BaseTest - Internal review comments incorporated for removing direct repo calls - CLONE - Key Management Hardcoded encryption key | fixing junits - CLONE - Key Management Hardcoded encryption key Updated builder to use String.format Added exception specifically for issues interacting with requestdbadapter Updated exception message and added junit test case removed useless error handling test case from workflow changed method name and added junit coverage to errors added max retry and success status after completed bb Added case to handle when homing is not called during assign vnf. Fixing fortify issues | Implementing review comments - Key Management Hardcoded encryption key - fixing prop files - Key Management Hardcoded encryption key include network ID for completion handler Added exception handling for saving to requestdb - Adding a check on the predicate availability on the repository before firing the query with default conditions. This ensures that the api returns data only when there is an input against which it was able to form some conditions Modify UT to show that the API does not behave - adding negative test case for checkInstanceNameDuplicate added assertion that global count var was reset to 0 updated rollback to reset current sequence count var workflowaction calls rollback is complete before error workflowaction will set failure on successful rollback added check for isrollback to know which complete to call removed file which should not have been added add fabric check before running vf module a la carte Enhance UCPEMigrateService junits and add them to Jenkins build.. Added back removed test case for ManualTasks Added test case for response error Added rainy day test cases for ManualTasks revert the other change and fix the rollback logic instead fixed current sequence and updated rollback code added network cloud heat template parameters to mapper Generate a unique subRequestId for each request to APP-C. reverted conditional logic for determining fabric Fix Bean scanning so it picks up the resttemplate removed unnecessary RestTemplate Bean configurations removed file which should not have been added workflowaction calls rollback is complete before error workflowaction will set failure on successful rollback added check for isrollback to know which complete to call add fabric check before running vf module a la carte added assertion that global count var was reset to 0 updated rollback to reset current sequence count var include network ID for completion handler Revert Application.yaml change accidentally checked in Added exception handling for saving to requestdb Added case to handle when homing is not called during assign vnf. removed useless error handling test case from workflow changed method name and added junit coverage to errors ... add cloud owner variable to camunda in mapping Revert "Pass cloudOwner to subflow DoCreateVfModuleVolumeV2. Added juint test to verify variables are set in the execution. Set default cloudOwner in main module CreateVfModuleVolumeInfraV2" updated cloud configuration pojo to inlcude defaults Revert "Test to verify ServiceInstance object mapping" Test to verify ServiceInstance object mapping Pass cloudOwner to subflow DoCreateVfModuleVolumeV2. Added juint test to verify variables are set in the execution. Set default cloudOwner in main module CreateVfModuleVolumeInfraV2 Pass cloudOwner to subflow DoCreateVfModuleVolumeV2. Set default cloudOwner 'att-aic' if null per old requirements. removed references to att-aic from BBInputSetup Changes done in encryption decryption logic | used DelegateExecutionFake in Tests Changes done in encryption decryption logic | used DelegateExecutionFake in Tests Changes done in encryption decryption logic Changes done in encryption decryption logic | removed Default Auth Constant as per the comments Changes done in encryption decryption logic | Fixed UT Changes done in encryption decryption logic | Added XmlComparator assertion for verifying XML Changes done in encryption decryption logic | Reverted as per the review comment Changes done in encryption decryption logic | Fixed UTs Changes done in encryption decryption logic | Fixed UTs Changes done in encryption decryption logic | modified related encrypted properties in test yaml files Changes done in encryption decryption logic for fortify issue resolution | Fixed UTs Changes done in encryption decryption logic | modified related encrypted properties in yaml files Changes done in encryption decryption logic for fortify issue resolution. Fixed Property fetching issue in required file Added TasksBeansTest using openpojo Removed renamed test file from tasksbeans Updated imports on TasksBeansTest Added openpojo test to replace the individual tests Removed tests that provided no coverage script clean up -Update reference data to support distinct recreate and replace requests with their own sequences Update reference data to support distinct recreate and replace requests with their own sequences- Fix seq number Update reference data to support distinct recreate and replace requests with their own sequences added null check to mdc and interceptors to sdnc cxf validations can now match against multiple BBs reverted changes to BBInputSetup class added support for pre and post validation for BBs initial commit of generic building block validator converted test to no longer be a springboot test Remove cosmetic changes from BPMN files to be consistent. Remove minor changes that are not related to functionality. Rework to implement the functionality as part of Validator Combine the verification methods into one based on the flow's name; change the logging. Add verification of status of other VF Modules in the VNF for the delete/deactivate/unassign. added network-technology validation for CreateNetworkBB Sonar Issue Fix | Changes done in encryption decryption logic | Refactoring Changes done in encryption decryption logic| Used AES/GCM/NoPadding algorithm | fixed sonar issues added network-type and network-technology to mapper Continue the fight to make JUNITS work properly Update ASDC ATT to be springboot 2.0 compliant Continue to fix Unit tests for springboot 2.0 port removed autowired from workflowactionbbtaskstest fixed workflowactiontest and reduced size by 500 lines Update last of UT for mockito upgrade to 2.0 Fix more JUNITS due to mockito 2.0 upgrade Unit Test fixes to use proper mockito not spring Update Base Test to import proper packages for compile Additional Springboot 2.0 changes, for tests Additional springboot 2.0 fixes and upgrades Update Migration to be Flyway 5 Compliant Fix MSOBPMN Infrastructure common tests Fix Groovy Unit Tests in CommonBPMN Project Update MSO common BPMN to Springboot 2.0 Upgrade ASDC controller to SpringBoot 2.0 Port Openstack adapters to springboot 2.0 Fix VFC Adapter to be springboot 2 compatible Port CatalogDB adapter code to springboot 2 Port SDNC Adapter to Springboot 2.0 ... added update scripts to macro data instead of v12 sql added secondarypolicy to rainy day handling table confirm subnet map is not null in adapter response shallow copy subnet before AAI udpate update AAIObjectType to use uriTemplate extract subnet data from adapter response update correct AAIObjectType for subnet query update subnet(s) in AAI on network create completion confirm subnet map is not null in adapter response shallow copy subnet before AAI udpate update AAIObjectType to use uriTemplate extract subnet data from adapter response update correct AAIObjectType for subnet query update subnet(s) in AAI on network create completion fixed test http entity unit test to remove testing appid and transaction id added unit test for querySubsystemHealth method. also added resttemplate mock to implement healthcheck endpoint fixed unit test to use mock instead of actually goes out to health check endpoint added code to extend globalhealthcheck to include pinging other components and consolidate the responses converted test to no longer be a springboot test Remove cosmetic changes from BPMN files to be consistent. Remove minor changes that are not related to functionality. added update scripts to macro data instead of v12 sql Rework to implement the functionality as part of Validator added secondarypolicy to rainy day handling table added network-type and network-technology to mapper Combine the verification methods into one based on the flow's name; change the logging. Add verification of status of other VF Modules in the VNF for the delete/deactivate/unassign. updated how request db is set to failure in workflowA corrected code to match existing unit tests corrected tests after springboot 2 upgrade Added Required UTs in UpdateConfigurationStateTest and also fixed some UTs. added in missing parenthesis on method call added back execution variable for allotted uri addressed comments on pull request refactor AAI Rest calls from groovy files - Changes as per review comments checkin to refactor AAI rest | Fixing AAIResourceClient.update call refactor AAI Rest calls from groovy files - UpdateConfiguration refactor AAI Rest calls from groovy file - DeleteConfiguration refactor AAI Rest calls from groovy file - UpdateConfiguration refactor AAI Rest calls from groovy file - CreateConfiguration & ConfigurationUtils refactor AAI Rest calls from groovy files - Fix getARByID issue checkin to refactor AAI rest | Adding Junits checkin to refactor AAI rest | Adding few more classes checkin to refactor AAI rest of DoCreateVfModuleVolumeV2 checkin to refactor AAI rest | Update junit checkin to refactor AAI rest of DoCreateVfModuleVolumeV2 | Adding junits checkin to refactor AAI rest of DoCreateVfModuleVolumeV2 | Adding junits checkin to refactor AAI rest of DoCreateVfModuleVolumeV2.groovy ... updated in and out mapping to be generalBuildingBlock change source out mapping to generalBuildingBlock Change-Id: I122f1ebe3e15b77da0a55af201d89d47e326bf83 Issue-ID: SO-1098 Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'mso-catalog-db')
-rw-r--r--mso-catalog-db/pom.xml17
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/BuildingBlockDetail.java3
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatusStateTransitionDirective.java3
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/NorthBoundRequest.java3
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/OrchestrationFlow.java3
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/RainyDayHandlerStatus.java16
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/projections/InlineAllottedResources.java64
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/projections/InlineNetworks.java72
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/projections/InlineService.java52
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/projections/InlineVfModules.java59
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/projections/InlineVnf.java76
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CvnfcCustomizationRepository.java3
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkResourceCustomizationRepository.java3
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceRepository.java3
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfCustomizationRepository.java7
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfcCustomizationRepository.java1
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/exceptions/NoEntityFoundException.java37
-rw-r--r--mso-catalog-db/src/test/java/org/onap/so/db/catalog/EmbeddedMariaDbConfig.java2
-rw-r--r--mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/CloudSiteRepositoryTest.java5
-rw-r--r--mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/CloudifyManagerRepositoryTest.java4
-rw-r--r--mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/VnfVfmoduleCvnfcConfigurationCustomizationRepositoryTest.java9
-rw-r--r--mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/VnfcCustomizationRepositoryTest.java7
-rw-r--r--mso-catalog-db/src/test/resources/application-test.yaml7
23 files changed, 102 insertions, 354 deletions
diff --git a/mso-catalog-db/pom.xml b/mso-catalog-db/pom.xml
index 364ac96413..de88d29f52 100644
--- a/mso-catalog-db/pom.xml
+++ b/mso-catalog-db/pom.xml
@@ -1,5 +1,4 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -38,7 +37,19 @@
</plugins>
<pluginManagement>
<plugins>
-
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.3</version>
+ <configuration>
+ <source>1.8</source>
+ <target>1.8</target>
+ <fork>true</fork>
+ <compilerArgs>
+ <arg>-parameters</arg>
+ </compilerArgs>
+ </configuration>
+ </plugin>
</plugins>
</pluginManagement>
</build>
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/BuildingBlockDetail.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/BuildingBlockDetail.java
index 36a9db77ed..cc2abacce2 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/BuildingBlockDetail.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/BuildingBlockDetail.java
@@ -30,6 +30,7 @@ import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
@@ -48,7 +49,7 @@ public class BuildingBlockDetail implements Serializable {
@Id
@Column(name = "id")
- @GeneratedValue
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@BusinessKey
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatusStateTransitionDirective.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatusStateTransitionDirective.java
index 517b17af91..245fcdcf92 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatusStateTransitionDirective.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatusStateTransitionDirective.java
@@ -27,6 +27,7 @@ import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@@ -43,7 +44,7 @@ public class OrchestrationStatusStateTransitionDirective implements Serializable
@Id
@Column(name = "id")
- @GeneratedValue
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Enumerated(EnumType.STRING)
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/NorthBoundRequest.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/NorthBoundRequest.java
index 67f23c1e43..0df176c3f8 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/NorthBoundRequest.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/NorthBoundRequest.java
@@ -28,6 +28,7 @@ import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
@@ -51,7 +52,7 @@ public class NorthBoundRequest implements Serializable {
@Id
@Column(name = "id")
- @GeneratedValue
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@BusinessKey
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/OrchestrationFlow.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/OrchestrationFlow.java
index 058947e6b1..fc017c63aa 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/OrchestrationFlow.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/OrchestrationFlow.java
@@ -27,6 +27,7 @@ import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
@@ -49,7 +50,7 @@ public class OrchestrationFlow implements Serializable {
@Id
@Column(name = "ID")
- @GeneratedValue
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@BusinessKey
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/RainyDayHandlerStatus.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/RainyDayHandlerStatus.java
index f341c4cb5c..23d9d7bc6c 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/RainyDayHandlerStatus.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/RainyDayHandlerStatus.java
@@ -25,6 +25,7 @@ import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@@ -45,7 +46,7 @@ public class RainyDayHandlerStatus implements Serializable {
@Id
@Column(name = "id")
- @GeneratedValue
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@BusinessKey
@@ -71,12 +72,15 @@ public class RainyDayHandlerStatus implements Serializable {
@BusinessKey
@Column(name = "POLICY")
private String policy;
+
+ @Column(name = "SECONDARY_POLICY")
+ private String secondaryPolicy;
@Override
public String toString() {
return new ToStringBuilder(this).append("id", id).append("flowName", flowName)
.append("serviceType", serviceType).append("vnfType", vnfType).append("errorCode", errorCode)
- .append("workStep", workStep).append("policy", policy).toString();
+ .append("workStep", workStep).append("policy", policy).append("secondaryPolicy",secondaryPolicy).toString();
}
@Override
@@ -151,4 +155,12 @@ public class RainyDayHandlerStatus implements Serializable {
public void setPolicy(String policy) {
this.policy = policy;
}
+
+ public String getSecondaryPolicy() {
+ return secondaryPolicy;
+ }
+
+ public void setSecondaryPolicy(String secondaryPolicy) {
+ this.secondaryPolicy = secondaryPolicy;
+ }
}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/projections/InlineAllottedResources.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/projections/InlineAllottedResources.java
deleted file mode 100644
index c03e988e2e..0000000000
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/projections/InlineAllottedResources.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * 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.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.so.db.catalog.data.projections;
-
-import org.onap.so.db.catalog.beans.AllottedResourceCustomization;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.data.rest.core.config.Projection;
-
-@Projection(name = "InlineAllottedResources", types = { AllottedResourceCustomization.class })
-public interface InlineAllottedResources {
-
- String getModelCustomizationUUID();
- String getModelInstanceName();
- String getMaxInstances();
- String getMinInstances();
- String getNfNamingCode();
- String getNfRole();
- String getNfType();
- String getNfFunction();
- String getTargetNetworkRole();
- String getProvidingServiceModelInvariantUUID();
- String getProvidingServiceModelName();
- String getProvidingServiceModelUUID();
-
- @Value("#{target.getAllottedResource().getDescription()}")
- String getDescription();
-
- @Value("#{target.getAllottedResource().getCreated()}")
- String getCreated();
-
-
- @Value("#{target.getAllottedResource().getModelInvariantUUID()}")
- String getModelInvariantUuid ();
-
- @Value("#{target.getAllottedResource().getModelName()}")
- String getModelName ();
-
- @Value("#{target.getAllottedResource().getModelUUID()}")
- String getModelUuid ();
-
- @Value("#{target.getAllottedResource().getToscaNodeType()}")
- String getToscaNodeType ();
-
- @Value("#{target.getAllottedResource().getSubcategory()}")
- String getSubcategory ();
-} \ No newline at end of file
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/projections/InlineNetworks.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/projections/InlineNetworks.java
deleted file mode 100644
index 8311df8adf..0000000000
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/projections/InlineNetworks.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * 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.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.so.db.catalog.data.projections;
-
-
-import java.sql.Timestamp;
-
-import org.onap.so.db.catalog.beans.NetworkResourceCustomization;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.data.rest.core.config.Projection;
-
-@Projection(name = "InlineNetworks", types = { NetworkResourceCustomization.class })
-public interface InlineNetworks {
-
- String getModelCustomizationUUID();
- String getModelInstanceName();
- String getNetworkTechnology();
- String getNetworkType();
- String getNetworkScope();
- String getNetworkRole();
-
- @Value("#{target.getNetworkResource().getDescription()}")
- String getDescription();
-
- @Value("#{target.getNetworkResource().getCreated()}")
- Timestamp getCreated();
-
- @Value("#{target.getNetworkResource().getModelVersion()}")
- String getModelVersion();
-
- @Value("#{target.getNetworkResource().getModelInvariantUUID()}")
- String getModelInvariantUUID();
-
- @Value("#{target.getNetworkResource().getModelName()}")
- String getModelName ();
-
- @Value("#{target.getNetworkResource().getModelUUID()}")
- String getModelUUID ();
-
- @Value("#{target.getNetworkResource().getNeutronNetworkType()}")
- String getNeutronNetworkType ();
-
- @Value("#{target.getNetworkResource().getAicVersionMin()}")
- String getAicVersionMin ();
-
- @Value("#{target.getNetworkResource().getAicVersionMax()}")
- String getAicVersionMax ();
-
- @Value("#{target.getNetworkResource().getOrchestrationMode()}")
- String getOrchestrationMode ();
-
- @Value("#{target.getNetworkResource().getToscaNodeType()}")
- String getToscaNodeType ();
-} \ No newline at end of file
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/projections/InlineService.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/projections/InlineService.java
deleted file mode 100644
index c7241acd8b..0000000000
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/projections/InlineService.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * 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.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.so.db.catalog.data.projections;
-
-
-import java.util.List;
-import java.util.Map;
-
-import org.onap.so.db.catalog.beans.Service;
-import org.onap.so.db.catalog.beans.ServiceRecipe;
-import org.springframework.data.rest.core.config.Projection;
-
-@Projection(name = "InlineService", types = { Service.class })
-public interface InlineService {
-
- String getModelName();
- String getDescription();
- String getCreated();
- String getModelUUID();
- String getModelInvariantUUID();
- String getModelVersion();
- String getServiceType();
- String getServiceRole();
- String getEnvironmentContext();
- String getWorkloadContext();
-
- List<InlineNetworks> getNetworkCustomizations();
-
- List<InlineVnf> getVnfCustomizations();
-
- List<InlineAllottedResources> getAllottedCustomizations();
-
- Map<String, ServiceRecipe> getRecipes ();
-} \ No newline at end of file
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/projections/InlineVfModules.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/projections/InlineVfModules.java
deleted file mode 100644
index 316a02b016..0000000000
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/projections/InlineVfModules.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * 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.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.so.db.catalog.data.projections;
-
-import org.onap.so.db.catalog.beans.VfModuleCustomization;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.data.rest.core.config.Projection;
-
-@Projection(name = "InlineVfModules", types = { VfModuleCustomization.class })
-public interface InlineVfModules {
-
- String getModelCustomizationUUID();
-
- @Value("#{target.getVfModule().getModelName()}")
- String getModelName ();
-
- @Value("#{target.getVfModule().getModelUUID()}")
- String getModelUUID ();
-
- @Value("#{target.getVfModule().getModelInvariantUUID()}")
- String getModelInvariantUUID ();
-
- @Value("#{target.getVfModule().getModelVersion()}")
- String getModelVersion ();
-
- @Value("#{target.getVfModule().getDescription()}")
- String getDescription();
-
- @Value("#{target.getVfModule().getIsBase()}")
- Boolean getIsBase();
-
- String getMinInstances();
- String getMaxInstances();
- String getAvailabilityZoneCount();
- String getLabel();
- String getInitialCount();
-
- @Value("#{target.getVfModule().getCreated()}")
- String getCreated();
-
-} \ No newline at end of file
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/projections/InlineVnf.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/projections/InlineVnf.java
deleted file mode 100644
index 17e54f9b45..0000000000
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/projections/InlineVnf.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * 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.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.so.db.catalog.data.projections;
-
-import java.util.List;
-
-import org.onap.so.db.catalog.beans.VnfResourceCustomization;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.data.rest.core.config.Projection;
-
-@Projection(name = "InlineVnf", types = { VnfResourceCustomization.class })
-public interface InlineVnf {
-
- String getModelInstanceName();
-
- String getModelCustomizationUUID();
-
- @Value("#{target.getVnfResources().getModelUUID()}")
- String getModelUUID();
-
- @Value("#{target.getVnfResources().getModelInvariantUUID()}")
- String getModelInvariantUUID();
-
- @Value("#{target.getVnfResources().getModelName()}")
- String getModelName();
-
- @Value("#{target.getVnfResources().getModelVersion()}")
- String getModelVersion();
-
- @Value("#{target.getVnfResources().getToscaNodeType()}")
- String getToscaNodeType ();
-
- @Value("#{target.getVnfResources().getDescription()}")
- String getDescription();
-
- @Value("#{target.getVnfResources().getOrchestrationMode()}")
- String getOrchestrationMode();
-
- @Value("#{target.getVnfResources().getAicVersionMin()}")
- String getAicVersionMin();
-
- @Value("#{target.getVnfResources().getAicVersionMax()}")
- String getAicVersionMax();
-
- String getMinInstances();
- String getMaxInstances();
- String getAvailabilityZoneMaxCount();
- String getNfFunction();
- String getNfType();
- String getNfRole();
- String getNfNamingCode();
- String getMultiStageDesign();
-
- @Value("#{target.getVnfResources().getCreated()}")
- String getCreated();
-
- List<InlineVfModules> getVfModuleCustomizations();
-} \ No newline at end of file
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CvnfcCustomizationRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CvnfcCustomizationRepository.java
index 3eeef07c97..0c82b84c0f 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CvnfcCustomizationRepository.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CvnfcCustomizationRepository.java
@@ -23,12 +23,11 @@ package org.onap.so.db.catalog.data.repository;
import java.util.List;
import org.onap.so.db.catalog.beans.CvnfcCustomization;
-import org.onap.so.db.catalog.data.projections.InlineVnf;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
-@RepositoryRestResource(collectionResourceRel = "cvnfcCustomization", path = "cvnfcCustomization", excerptProjection = InlineVnf.class)
+@RepositoryRestResource(collectionResourceRel = "cvnfcCustomization", path = "cvnfcCustomization")
public interface CvnfcCustomizationRepository extends JpaRepository<CvnfcCustomization, String> {
CvnfcCustomization findOneByModelCustomizationUUID(String modelCustomizationUuid);
List<CvnfcCustomization> findByModelCustomizationUUID(String modelCustomizationUUID);
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkResourceCustomizationRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkResourceCustomizationRepository.java
index c169f3661a..799d98c5e4 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkResourceCustomizationRepository.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkResourceCustomizationRepository.java
@@ -23,11 +23,10 @@ package org.onap.so.db.catalog.data.repository;
import java.util.List;
import org.onap.so.db.catalog.beans.NetworkResourceCustomization;
-import org.onap.so.db.catalog.data.projections.InlineNetworks;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
-@RepositoryRestResource(collectionResourceRel = "networkResourceCustomization", path = "networkResourceCustomization", excerptProjection = InlineNetworks.class)
+@RepositoryRestResource(collectionResourceRel = "networkResourceCustomization", path = "networkResourceCustomization")
public interface NetworkResourceCustomizationRepository extends JpaRepository<NetworkResourceCustomization, String> {
List<NetworkResourceCustomization> findByModelCustomizationUUID(String modelCustomizationUUID);
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceRepository.java
index 6d432c443c..2d29a78351 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceRepository.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceRepository.java
@@ -21,14 +21,13 @@
package org.onap.so.db.catalog.data.repository;
import org.onap.so.db.catalog.beans.Service;
-import org.onap.so.db.catalog.data.projections.InlineService;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
import java.util.List;
-@RepositoryRestResource(collectionResourceRel = "service", path = "service", excerptProjection = InlineService.class)
+@RepositoryRestResource(collectionResourceRel = "service", path = "service")
public interface ServiceRepository extends JpaRepository<Service, String> {
List<Service> findByModelName(String modelName);
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfCustomizationRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfCustomizationRepository.java
index 46a4cfba11..17ae017da4 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfCustomizationRepository.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfCustomizationRepository.java
@@ -20,15 +20,14 @@
package org.onap.so.db.catalog.data.repository;
+import java.util.List;
+
import org.onap.so.db.catalog.beans.VnfResourceCustomization;
-import org.onap.so.db.catalog.data.projections.InlineVnf;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
-import java.util.List;
-
-@RepositoryRestResource(collectionResourceRel = "vnfResourceCustomization", path = "vnfResourceCustomization", excerptProjection = InlineVnf.class)
+@RepositoryRestResource(collectionResourceRel = "vnfResourceCustomization", path = "vnfResourceCustomization")
public interface VnfCustomizationRepository extends JpaRepository<VnfResourceCustomization, String> {
List<VnfResourceCustomization> findByModelCustomizationUUID(String modelCustomizationUUID);
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfcCustomizationRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfcCustomizationRepository.java
index 4ccbf5831f..64840f11f9 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfcCustomizationRepository.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfcCustomizationRepository.java
@@ -21,7 +21,6 @@
package org.onap.so.db.catalog.data.repository;
import org.onap.so.db.catalog.beans.VnfcCustomization;
-import org.onap.so.db.catalog.data.projections.InlineVnf;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/exceptions/NoEntityFoundException.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/exceptions/NoEntityFoundException.java
new file mode 100644
index 0000000000..f06d7c9c17
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/exceptions/NoEntityFoundException.java
@@ -0,0 +1,37 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.db.catalog.exceptions;
+
+
+public class NoEntityFoundException extends Exception {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 545820289784366486L;
+
+ public NoEntityFoundException(String errorMessage) {
+ super(errorMessage);
+ }
+
+
+
+}
diff --git a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/EmbeddedMariaDbConfig.java b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/EmbeddedMariaDbConfig.java
index 147de51c67..06a7b1ed29 100644
--- a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/EmbeddedMariaDbConfig.java
+++ b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/EmbeddedMariaDbConfig.java
@@ -23,7 +23,7 @@ import ch.vorburger.exec.ManagedProcessException;
import ch.vorburger.mariadb4j.DBConfigurationBuilder;
import ch.vorburger.mariadb4j.springframework.MariaDB4jSpringService;
import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
+import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
diff --git a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/CloudSiteRepositoryTest.java b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/CloudSiteRepositoryTest.java
index c5ae3cc83c..8978f38298 100644
--- a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/CloudSiteRepositoryTest.java
+++ b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/CloudSiteRepositoryTest.java
@@ -24,6 +24,7 @@ import org.junit.Assert;
import org.junit.Test;
import org.onap.so.db.catalog.BaseTest;
import org.onap.so.db.catalog.beans.CloudSite;
+import org.onap.so.db.catalog.exceptions.NoEntityFoundException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
@@ -43,7 +44,9 @@ public class CloudSiteRepositoryTest extends BaseTest {
@Test
public void findOneTest() throws Exception {
- CloudSite cloudSite = cloudSiteRepository.findOne("mtn13");
+ CloudSite cloudSite = cloudSiteRepository.findById("mtn13").
+ orElseThrow(() -> new NoEntityFoundException("Cannot Find Operation"));
+
Assert.assertNotNull(cloudSite);
Assert.assertEquals("mtn13",cloudSite.getId());
}
diff --git a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/CloudifyManagerRepositoryTest.java b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/CloudifyManagerRepositoryTest.java
index 34c22b07b2..1ed8c84435 100644
--- a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/CloudifyManagerRepositoryTest.java
+++ b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/CloudifyManagerRepositoryTest.java
@@ -24,6 +24,7 @@ import org.junit.Assert;
import org.junit.Test;
import org.onap.so.db.catalog.BaseTest;
import org.onap.so.db.catalog.beans.CloudifyManager;
+import org.onap.so.db.catalog.exceptions.NoEntityFoundException;
import org.springframework.beans.factory.annotation.Autowired;
public class CloudifyManagerRepositoryTest extends BaseTest {
@@ -33,7 +34,8 @@ public class CloudifyManagerRepositoryTest extends BaseTest {
@Test
public void findOneTest() throws Exception {
- CloudifyManager cloudifyManager = cloudifyManagerRepository.findOne("mtn13");
+ CloudifyManager cloudifyManager = cloudifyManagerRepository.findById("mtn13")
+ .orElseThrow(() -> new NoEntityFoundException("Cannot Find Operation"));
Assert.assertNotNull(cloudifyManager);
Assert.assertEquals("mtn13", cloudifyManager.getId());
}
diff --git a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/VnfVfmoduleCvnfcConfigurationCustomizationRepositoryTest.java b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/VnfVfmoduleCvnfcConfigurationCustomizationRepositoryTest.java
index 52cb46f391..6f0e3020b1 100644
--- a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/VnfVfmoduleCvnfcConfigurationCustomizationRepositoryTest.java
+++ b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/VnfVfmoduleCvnfcConfigurationCustomizationRepositoryTest.java
@@ -36,6 +36,7 @@ import org.onap.so.db.catalog.beans.VnfResource;
import org.onap.so.db.catalog.beans.VnfResourceCustomization;
import org.onap.so.db.catalog.beans.VnfVfmoduleCvnfcConfigurationCustomization;
import org.onap.so.db.catalog.beans.VnfcCustomization;
+import org.onap.so.db.catalog.exceptions.NoEntityFoundException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
@@ -51,7 +52,10 @@ public class VnfVfmoduleCvnfcConfigurationCustomizationRepositoryTest extends Ba
List<VnfVfmoduleCvnfcConfigurationCustomization> vnfVfmoduleCvnfcConfigurationCustomizationList = vnfVfmoduleCvnfcConfigurationCustomizationRepository.findAll();
Assert.assertFalse(CollectionUtils.isEmpty(vnfVfmoduleCvnfcConfigurationCustomizationList));
- VnfVfmoduleCvnfcConfigurationCustomization vnfVfmoduleCvnfcConfigurationCustomization = vnfVfmoduleCvnfcConfigurationCustomizationRepository.findOne(1);
+ VnfVfmoduleCvnfcConfigurationCustomization vnfVfmoduleCvnfcConfigurationCustomization =
+ vnfVfmoduleCvnfcConfigurationCustomizationRepository.findById(1).orElseThrow(() -> new NoEntityFoundException("Cannot Find Operation"));
+
+
Assert.assertTrue(vnfVfmoduleCvnfcConfigurationCustomization.getConfigurationFunction().equalsIgnoreCase("testConfigurationFunction"));
}
@@ -112,7 +116,8 @@ public class VnfVfmoduleCvnfcConfigurationCustomizationRepositoryTest extends Ba
vnfVfmoduleCvnfcConfigurationCustomizationRepository.save(vnfVfmoduleCvnfcConfigurationCustomization);
- VnfVfmoduleCvnfcConfigurationCustomization foundVnfVfmoduleCvnfcConfigurationCustomization = vnfVfmoduleCvnfcConfigurationCustomizationRepository.findOne(1);
+ VnfVfmoduleCvnfcConfigurationCustomization foundVnfVfmoduleCvnfcConfigurationCustomization =
+ vnfVfmoduleCvnfcConfigurationCustomizationRepository.findById(1).orElseThrow(() -> new NoEntityFoundException("Cannot Find Operation"));
if(foundVnfVfmoduleCvnfcConfigurationCustomization == null)
diff --git a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/VnfcCustomizationRepositoryTest.java b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/VnfcCustomizationRepositoryTest.java
index 0f82c8abf0..1fc6617c2c 100644
--- a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/VnfcCustomizationRepositoryTest.java
+++ b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/VnfcCustomizationRepositoryTest.java
@@ -29,6 +29,7 @@ import org.junit.Assert;
import org.junit.Test;
import org.onap.so.db.catalog.BaseTest;
import org.onap.so.db.catalog.beans.VnfcCustomization;
+import org.onap.so.db.catalog.exceptions.NoEntityFoundException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
@@ -42,7 +43,8 @@ public class VnfcCustomizationRepositoryTest extends BaseTest {
List<VnfcCustomization> vnfcCustomizationList = vnfcCustomizationRepository.findAll();
Assert.assertFalse(CollectionUtils.isEmpty(vnfcCustomizationList));
- VnfcCustomization vnfcCustomization = vnfcCustomizationRepository.findOne("9bcce658-9b37-11e8-98d0-529269fb1459");
+ VnfcCustomization vnfcCustomization = vnfcCustomizationRepository.findById("9bcce658-9b37-11e8-98d0-529269fb1459").
+ orElseThrow(() -> new NoEntityFoundException("Cannot Find Operation"));
Assert.assertTrue(vnfcCustomization.getDescription().equalsIgnoreCase("testVnfcCustomizationDescription"));
}
@@ -54,7 +56,8 @@ public class VnfcCustomizationRepositoryTest extends BaseTest {
vnfcCustomization.setModelCustomizationUUID("cf9f6efc-9f14-11e8-98d0-529269fb1459");
vnfcCustomizationRepository.save(vnfcCustomization);
- VnfcCustomization foundVnfcCustomization = vnfcCustomizationRepository.findOne("cf9f6efc-9f14-11e8-98d0-529269fb1459");
+ VnfcCustomization foundVnfcCustomization = vnfcCustomizationRepository.findById("cf9f6efc-9f14-11e8-98d0-529269fb1459").
+ orElseThrow(() -> new NoEntityFoundException("Cannot Find Operation"));
assertThat(vnfcCustomization, sameBeanAs(foundVnfcCustomization)
.ignoring("created"));
diff --git a/mso-catalog-db/src/test/resources/application-test.yaml b/mso-catalog-db/src/test/resources/application-test.yaml
index dbff1c1d2f..5d04aa49be 100644
--- a/mso-catalog-db/src/test/resources/application-test.yaml
+++ b/mso-catalog-db/src/test/resources/application-test.yaml
@@ -14,12 +14,11 @@ mso:
spring:
datasource:
- url: jdbc:mariadb://localhost:3307/
+ jdbc-url: jdbc:mariadb://localhost:3307/
username: root
password: password
driver-class-name: org.mariadb.jdbc.Driver
- initialize: true
- initialization-mode: never
+ initialization-mode: always
jpa:
generate-ddl: false
show-sql: true
@@ -44,7 +43,7 @@ spring:
role: ACTUATOR
mariaDB4j:
dataDir:
- port: 3307
+ port: 0
databaseName: catalog_db
server: