aboutsummaryrefslogtreecommitdiffstats
path: root/models-tosca/src/main/java/org
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2019-04-09 16:58:20 +0000
committerliamfallon <liam.fallon@est.tech>2019-04-09 16:58:20 +0000
commit942cd0a012a2a4e9fd44e680dc6c4c7f4bcf8c62 (patch)
tree532643c15d2a4dc0823fce3c0372ac1ee07e444b /models-tosca/src/main/java/org
parente678e5af567040022f23ed7a1ba1723b82434418 (diff)
Add unit tests for policy type and policy filters
THis review adds unit tests for the authorative concepts in the models-tosc module and adds unit tests for the authorative and and database providers. Issue-ID: POLICY-1095 Change-Id: If98deea99658056030dd47725b0c0a4266d84106 Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'models-tosca/src/main/java/org')
-rw-r--r--models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaModel.java3
-rw-r--r--models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplate.java6
-rw-r--r--models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaTopologyTemplate.java3
3 files changed, 8 insertions, 4 deletions
diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaModel.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaModel.java
index a322c167f..204ef5b9d 100644
--- a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaModel.java
+++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaModel.java
@@ -24,6 +24,7 @@ import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
+import javax.persistence.FetchType;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.OneToOne;
@@ -57,7 +58,7 @@ import org.onap.policy.models.base.PfValidationResult;
public class JpaToscaModel extends PfModel {
private static final long serialVersionUID = 8800599637708309945L;
- @OneToOne(cascade = CascadeType.ALL)
+ @OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
private JpaToscaServiceTemplates serviceTemplates;
/**
diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplate.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplate.java
index fda0c8014..5f50e4a43 100644
--- a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplate.java
+++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplate.java
@@ -27,6 +27,7 @@ import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
+import javax.persistence.FetchType;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.OneToOne;
@@ -70,14 +71,15 @@ public class JpaToscaServiceTemplate extends JpaToscaEntityType<ToscaServiceTemp
@SerializedName("tosca_definitions_version")
private String toscaDefinitionsVersion;
- @OneToOne(cascade = CascadeType.ALL)
+ @OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
@SerializedName("data_types")
private JpaToscaDataTypes dataTypes;
- @OneToOne(cascade = CascadeType.ALL)
+ @OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
@SerializedName("policy_types")
private JpaToscaPolicyTypes policyTypes;
+ @Column
@SerializedName("topology_template")
private JpaToscaTopologyTemplate topologyTemplate;
diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaTopologyTemplate.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaTopologyTemplate.java
index 3476258cf..b1c3f209d 100644
--- a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaTopologyTemplate.java
+++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaTopologyTemplate.java
@@ -26,6 +26,7 @@ import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
+import javax.persistence.FetchType;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.OneToOne;
@@ -68,7 +69,7 @@ public class JpaToscaTopologyTemplate extends PfConcept implements PfAuthorative
@Column(name = "description")
private String description;
- @OneToOne(cascade = CascadeType.ALL)
+ @OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
private JpaToscaPolicies policies;
/**