aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/onap-tosca-datatype/pom.xml5
-rw-r--r--common/onap-tosca-datatype/src/test/java/org/onap/sdc/tosca/datatypes/model/CapabilityDefinitionTest.java32
2 files changed, 37 insertions, 0 deletions
diff --git a/common/onap-tosca-datatype/pom.xml b/common/onap-tosca-datatype/pom.xml
index e00394f64f..15beac28d5 100644
--- a/common/onap-tosca-datatype/pom.xml
+++ b/common/onap-tosca-datatype/pom.xml
@@ -41,6 +41,11 @@
<version>${junit.version}</version>
</dependency>
<dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
diff --git a/common/onap-tosca-datatype/src/test/java/org/onap/sdc/tosca/datatypes/model/CapabilityDefinitionTest.java b/common/onap-tosca-datatype/src/test/java/org/onap/sdc/tosca/datatypes/model/CapabilityDefinitionTest.java
new file mode 100644
index 0000000000..939ef7e1ce
--- /dev/null
+++ b/common/onap-tosca-datatype/src/test/java/org/onap/sdc/tosca/datatypes/model/CapabilityDefinitionTest.java
@@ -0,0 +1,32 @@
+package org.onap.sdc.tosca.datatypes.model;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+
+import static org.junit.Assert.assertEquals;
+
+public class CapabilityDefinitionTest {
+
+
+ CapabilityDefinition capabilityDefinition;
+
+ @Before
+ public void initialize() {
+ capabilityDefinition = new CapabilityDefinition();
+ }
+
+ @Test
+ public void testClone() {
+ CapabilityDefinition cap2 = capabilityDefinition.clone();
+ assertIfObjectsAreSame(cap2, capabilityDefinition);
+ }
+
+ private void assertIfObjectsAreSame(CapabilityDefinition expected, CapabilityDefinition actual) {
+ assertEquals(expected.getAttributes(), actual.getAttributes());
+ assertEquals(expected.getDescription(), actual.getDescription());
+ assertEquals(expected.getOccurrences(), actual.getOccurrences());
+ assertEquals(expected.getProperties(), actual.getProperties());
+ assertEquals(expected.getType(), actual.getType());
+ }
+} \ No newline at end of file