Unit Test Coverage Part:2 19/34019/2
authoramshegokar <AS00500801@techmahindra.com>
Mon, 5 Mar 2018 09:22:28 +0000 (14:52 +0530)
committerTakamune Cho <tc012c@att.com>
Mon, 5 Mar 2018 16:54:58 +0000 (16:54 +0000)
Unit Test Coverage for:
1. Snapshot.java
2. Volume.java
3. Volume_.java
4. Template.java
5. SnapshotRestoreResponse.java

Sonar Link:
https://sonar.onap.org/code?id=org.onap.appc%3Aappc&selected=org.onap.appc%3Aappc-iaas-adapter-bundle%3Asrc%2Fmain%2Fjava%2Forg%2Fonap%2Fappc%2Fadapter%2Fopenstack%2Fheat%2Fmodel

Change-Id: I18ecc259973bbd3934f9ccd4cc20d897444d9d76
Issue-ID: APPC-686
Signed-off-by: amshegokar <AS00500801@techmahindra.com>
appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestSnapshot.java [new file with mode: 0644]
appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestSnapshotRestoreResponse.java [new file with mode: 0644]
appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestTemplate.java [new file with mode: 0644]
appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestVolume.java [new file with mode: 0644]
appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestVolume_.java [new file with mode: 0644]

diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestSnapshot.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestSnapshot.java
new file mode 100644 (file)
index 0000000..1adc63e
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : APPC
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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.appc.adapter.openstack.heat.model;
+
+import static org.junit.Assert.*;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class TestSnapshot {
+    private Snapshot snapshot;
+
+    @Before
+    public void setUp() {
+        snapshot = new Snapshot();
+    }
+
+    @Test
+    public void testGetBackupId() {
+        snapshot.setId("222");
+        assertNotNull(snapshot.getId());
+        assertEquals(snapshot.getId(), "222");
+    }
+
+    @Test
+    public void testGetName() {
+        snapshot.setName("ABC");
+        assertNotNull(snapshot.getName());
+        assertEquals(snapshot.getName(), "ABC");
+    }
+
+    @Test
+    public void testGetStatus() {
+        snapshot.setStatus("status");
+        assertNotNull(snapshot.getStatus());
+        assertEquals(snapshot.getStatus(), "status");
+    }
+
+    @Test
+    public void testGetStatusReason() {
+        snapshot.setStatusReason("statusReason");
+        assertNotNull(snapshot.getStatusReason());
+        assertEquals(snapshot.getStatusReason(), "statusReason");
+    }
+
+    @Test
+    public void testGetCreationTime() {
+        snapshot.setCreationTime("01-March-2018");
+        assertNotNull(snapshot.getCreationTime());
+        assertEquals(snapshot.getCreationTime(), "01-March-2018");
+    }
+
+    @Test
+    public void testToString_ReturnNonEmptyString() {
+        assertNotEquals(snapshot.toString(), "");
+        assertNotEquals(snapshot.toString(), null);
+    }
+}
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestSnapshotRestoreResponse.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestSnapshotRestoreResponse.java
new file mode 100644 (file)
index 0000000..3947161
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : APPC
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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.appc.adapter.openstack.heat.model;
+
+import static org.junit.Assert.*;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class TestSnapshotRestoreResponse {
+    private SnapshotRestoreResponse snapshotRestoreResponse;
+
+    @Before
+    public void setUp() {
+        snapshotRestoreResponse = new SnapshotRestoreResponse();
+    }
+
+    @Test
+    public void testGetCode() {
+        snapshotRestoreResponse.setCode("200");
+        assertNotNull(snapshotRestoreResponse.getCode());
+        assertEquals(snapshotRestoreResponse.getCode(), "200");
+    }
+
+    @Test
+    public void testMessage() {
+        snapshotRestoreResponse.setMessage("Success");
+        assertNotNull(snapshotRestoreResponse.getMessage());
+        assertEquals(snapshotRestoreResponse.getMessage(), "Success");
+    }
+
+    @Test
+    public void testTitle() {
+        snapshotRestoreResponse.setTitle("A1");
+        assertNotNull(snapshotRestoreResponse.getTitle());
+        assertEquals(snapshotRestoreResponse.getTitle(), "A1");
+    }
+
+    @Test
+    public void testToString_ReturnNonEmptyString() {
+        assertNotEquals(snapshotRestoreResponse.toString(), "");
+        assertNotEquals(snapshotRestoreResponse.toString(), null);
+    }
+}
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestTemplate.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestTemplate.java
new file mode 100644 (file)
index 0000000..e225480
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : APPC
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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.appc.adapter.openstack.heat.model;
+
+import static org.junit.Assert.*;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class TestTemplate {
+    private Template template;
+
+    @Before
+    public void setUp() {
+        template = new Template();
+    }
+
+    @Test
+    public void testGetHeatTemplateVersion() {
+        template.setHeatTemplateVersion("1.0");
+        assertNotNull(template.getHeatTemplateVersion());
+        assertEquals(template.getHeatTemplateVersion(), "1.0");
+    }
+
+    @Test
+    public void testToString_ReturnNonEmptyString() {
+        assertNotEquals(template.toString(), "");
+        assertNotEquals(template.toString(), null);
+    }
+
+}
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestVolume.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestVolume.java
new file mode 100644 (file)
index 0000000..c70c261
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : APPC
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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.appc.adapter.openstack.heat.model;
+
+import static org.junit.Assert.*;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class TestVolume {
+    private Volume volume;
+
+    @Before
+    public void setUp() {
+        volume = new Volume();
+    }
+
+    @Test
+    public void testGetType() {
+        volume.setType("A");
+        assertNotNull(volume.getType());
+        assertEquals(volume.getType(), "A");
+    }
+
+    @Test
+    public void testToString_ReturnNonEmptyString() {
+        assertNotEquals(volume.toString(), "");
+        assertNotEquals(volume.toString(), null);
+    }
+}
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestVolume_.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestVolume_.java
new file mode 100644 (file)
index 0000000..f20cea4
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : APPC
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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.appc.adapter.openstack.heat.model;
+
+import static org.junit.Assert.*;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class TestVolume_ {
+    private Volume_ volume_;
+
+    @Before
+    public void setUp() {
+        volume_ = new Volume_();
+    }
+
+    @Test
+    public void testGetStatus() {
+        volume_.setStatus("Success");
+        assertNotNull(volume_.getStatus());
+        assertEquals(volume_.getStatus(), "Success");
+    }
+
+    @Test
+    public void testGetName() {
+        volume_.setName("XYZ");
+        assertNotNull(volume_.getName());
+        assertEquals(volume_.getName(), "XYZ");
+    }
+
+    @Test
+    public void testGetResourceId() {
+        volume_.setResourceId("333");
+        assertNotNull(volume_.getResourceId());
+        assertEquals(volume_.getResourceId(), "333");
+    }
+
+    @Test
+    public void testGetAction() {
+        volume_.setAction("action");
+        assertNotNull(volume_.getAction());
+        assertEquals(volume_.getAction(), "action");
+    }
+
+    @Test
+    public void testGetType() {
+        volume_.setType("A");
+        assertNotNull(volume_.getType());
+        assertEquals(volume_.getType(), "A");
+    }
+
+    @Test
+    public void testToString_ReturnNonEmptyString() {
+        assertNotEquals(volume_.toString(), "");
+        assertNotEquals(volume_.toString(), null);
+    }
+}