Data-Junit Test Case Added
[appc.git] / appc-adapters / appc-iaas-adapter / appc-iaas-adapter-bundle / src / test / java / org / onap / appc / adapter / openstack / heat / model / TestData.java
1 /*
2 * ============LICENSE_START=======================================================
3 * ONAP : APPC
4 * ================================================================================
5 * Copyright 2018 TechMahindra
6 *=================================================================================
7 * Modifications Copyright (c) 2018-2019 IBM
8 *=================================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
12 *
13 *     http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 * ============LICENSE_END=========================================================
21 */
22 package org.onap.appc.adapter.openstack.heat.model;
23
24 import static org.junit.Assert.assertEquals;
25 import static org.junit.Assert.assertNotEquals;
26 import static org.junit.Assert.assertNotNull;
27 import static org.junit.Assert.assertSame;
28
29 import org.junit.Before;
30 import org.junit.Test;
31
32 public class TestData {
33     private Data data;
34     private Environment environment;
35     private Resources__ resources__;
36     private Template template;
37
38     @Before
39     public void setUp() {
40         data = new Data();
41         environment = new Environment();
42         resources__ = new Resources__();
43         template = new Template();
44     }
45
46     @Test
47     public void testGetStatus() {
48         data.setStatus("status");
49         assertNotNull(data.getStatus());
50         assertEquals("status", data.getStatus());
51     }
52
53     @Test
54     public void testGetName() {
55         data.setName("XYZ");
56         assertNotNull(data.getName());
57         assertEquals("XYZ", data.getName());
58     }
59
60     @Test
61     public void testGetStackUserProjectId() {
62         data.setStackUserProjectId("stackUserProjectId");
63         assertNotNull(data.getStackUserProjectId());
64         assertEquals("stackUserProjectId", data.getStackUserProjectId());
65     }
66
67     @Test
68     public void testGetAction() {
69         data.setAction("action");
70         assertNotNull(data.getAction());
71         assertEquals("action", data.getAction());
72     }
73
74     @Test
75     public void testGetProjectId() {
76         data.setProjectId("projectId");
77         assertNotNull(data.getProjectId());
78         assertEquals("projectId", data.getProjectId());
79     }
80
81     @Test
82     public void testGetId() {
83         data.setId("Id");
84         assertNotNull(data.getId());
85         assertEquals("Id", data.getId());
86     }
87
88     @Test
89     public void testToString_ReturnNonEmptyString() {
90         assertNotEquals("", data.toString());
91         assertNotEquals(null, data.toString());
92     }
93
94     @Test
95     public void testSetEnvironment() {
96         data.setEnvironment(environment);
97         assertNotNull(data.getEnvironment());
98     }
99
100     @Test
101     public void testGetEnvironment() {
102         data.setEnvironment(environment);
103         assertSame(environment, data.getEnvironment());
104     }
105
106     @Test
107     public void testSetTemplate() {
108         data.setTemplate(template);
109         assertNotNull(data.getTemplate());
110     }
111
112     @Test
113     public void testGetTemplate() {
114         data.setTemplate(template);
115         assertSame(template, data.getTemplate());
116     }
117
118     @Test
119     public void testSetResources__() {
120         data.setResources(resources__);
121         assertNotNull(data.getResources());
122     }
123
124     @Test
125     public void testGetResources__() {
126         data.setResources(resources__);
127         assertSame(resources__, data.getResources());
128     }
129 }