aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSudarshan Kumar <sudars19@in.ibm.com>2019-01-30 13:15:51 +0530
committerPatrick Brady <patrick.brady@att.com>2019-01-30 21:54:24 +0000
commit42f25c371a46ff0521296f9de8c3092c27332aea (patch)
treeff57767ff7702629b24fdd8bc76a20b713e54abf
parent0b2b3cd7e8d18ed78046b3127aa1501c59b97f39 (diff)
Data-Junit Test Case Added
Data-Junit Test Case Added Issue-ID: APPC-1372 Change-Id: Ib0a8c0c66d23bedd213df17d517c10add0ee18a9 Signed-off-by: Sudarshan Kumar <sudars19@in.ibm.com>
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestData.java66
1 files changed, 56 insertions, 10 deletions
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestData.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestData.java
index 4d40dba36..34dcce22b 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestData.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/openstack/heat/model/TestData.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright 2018 TechMahindra
*=================================================================================
+* Modifications Copyright (c) 2018-2019 IBM
+*=================================================================================
* 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
@@ -19,65 +21,109 @@
*/
package org.onap.appc.adapter.openstack.heat.model;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertSame;
import org.junit.Before;
import org.junit.Test;
public class TestData {
private Data data;
+ private Environment environment;
+ private Resources__ resources__;
+ private Template template;
@Before
public void setUp() {
- data=new Data();
+ data = new Data();
+ environment = new Environment();
+ resources__ = new Resources__();
+ template = new Template();
}
@Test
public void testGetStatus() {
data.setStatus("status");
assertNotNull(data.getStatus());
- assertEquals(data.getStatus(),"status");
+ assertEquals("status", data.getStatus());
}
@Test
public void testGetName() {
data.setName("XYZ");
assertNotNull(data.getName());
- assertEquals(data.getName(),"XYZ");
+ assertEquals("XYZ", data.getName());
}
@Test
public void testGetStackUserProjectId() {
data.setStackUserProjectId("stackUserProjectId");
assertNotNull(data.getStackUserProjectId());
- assertEquals(data.getStackUserProjectId(),"stackUserProjectId");
+ assertEquals("stackUserProjectId", data.getStackUserProjectId());
}
@Test
public void testGetAction() {
data.setAction("action");
assertNotNull(data.getAction());
- assertEquals(data.getAction(),"action");
+ assertEquals("action", data.getAction());
}
@Test
public void testGetProjectId() {
data.setProjectId("projectId");
assertNotNull(data.getProjectId());
- assertEquals(data.getProjectId(),"projectId");
+ assertEquals("projectId", data.getProjectId());
}
@Test
public void testGetId() {
data.setId("Id");
assertNotNull(data.getId());
- assertEquals(data.getId(),"Id");
+ assertEquals("Id", data.getId());
}
@Test
public void testToString_ReturnNonEmptyString() {
- assertNotEquals(data.toString(), "");
- assertNotEquals(data.toString(), null);
+ assertNotEquals("", data.toString());
+ assertNotEquals(null, data.toString());
+ }
+
+ @Test
+ public void testSetEnvironment() {
+ data.setEnvironment(environment);
+ assertNotNull(data.getEnvironment());
+ }
+
+ @Test
+ public void testGetEnvironment() {
+ data.setEnvironment(environment);
+ assertSame(environment, data.getEnvironment());
+ }
+
+ @Test
+ public void testSetTemplate() {
+ data.setTemplate(template);
+ assertNotNull(data.getTemplate());
}
+ @Test
+ public void testGetTemplate() {
+ data.setTemplate(template);
+ assertSame(template, data.getTemplate());
+ }
+
+ @Test
+ public void testSetResources__() {
+ data.setResources(resources__);
+ assertNotNull(data.getResources());
+ }
+
+ @Test
+ public void testGetResources__() {
+ data.setResources(resources__);
+ assertSame(resources__, data.getResources());
+ }
}