summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSatyaki Mallick <satyaki.mallick@huawei.com>2018-10-18 15:28:36 +0530
committerVitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com>2018-10-22 12:30:32 +0000
commit4a1a59ccde8eff936b7db6ba4736c861dd688d7a (patch)
tree329e39211b55d1a536c52e49d40517f1d3e23456
parent0e4ec678478fa791a9e4841f984b3968496b77c0 (diff)
Add UT for CapabilityDefinition
Add UT for CapabilityDefinition. Issue-ID: SDC-1774 Change-Id: I141489dab051eb1e7ae6e33353ca378dfad7325f Signed-off-by: Satyaki Mallick <satyaki.mallick@huawei.com>
-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