From 4a1a59ccde8eff936b7db6ba4736c861dd688d7a Mon Sep 17 00:00:00 2001 From: Satyaki Mallick Date: Thu, 18 Oct 2018 15:28:36 +0530 Subject: Add UT for CapabilityDefinition Add UT for CapabilityDefinition. Issue-ID: SDC-1774 Change-Id: I141489dab051eb1e7ae6e33353ca378dfad7325f Signed-off-by: Satyaki Mallick --- common/onap-tosca-datatype/pom.xml | 5 ++++ .../datatypes/model/CapabilityDefinitionTest.java | 32 ++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 common/onap-tosca-datatype/src/test/java/org/onap/sdc/tosca/datatypes/model/CapabilityDefinitionTest.java (limited to 'common') 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 @@ -40,6 +40,11 @@ test ${junit.version} + + org.mockito + mockito-core + test + com.google.guava guava 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 -- cgit 1.2.3-korg