2 * ============LICENSE_START=======================================================
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
13 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
22 package org.onap.appc.adapter.openstack.heat.model;
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;
29 import org.junit.Before;
30 import org.junit.Test;
32 public class TestData {
34 private Environment environment;
35 private Resources__ resources__;
36 private Template template;
41 environment = new Environment();
42 resources__ = new Resources__();
43 template = new Template();
47 public void testGetStatus() {
48 data.setStatus("status");
49 assertNotNull(data.getStatus());
50 assertEquals("status", data.getStatus());
54 public void testGetName() {
56 assertNotNull(data.getName());
57 assertEquals("XYZ", data.getName());
61 public void testGetStackUserProjectId() {
62 data.setStackUserProjectId("stackUserProjectId");
63 assertNotNull(data.getStackUserProjectId());
64 assertEquals("stackUserProjectId", data.getStackUserProjectId());
68 public void testGetAction() {
69 data.setAction("action");
70 assertNotNull(data.getAction());
71 assertEquals("action", data.getAction());
75 public void testGetProjectId() {
76 data.setProjectId("projectId");
77 assertNotNull(data.getProjectId());
78 assertEquals("projectId", data.getProjectId());
82 public void testGetId() {
84 assertNotNull(data.getId());
85 assertEquals("Id", data.getId());
89 public void testToString_ReturnNonEmptyString() {
90 assertNotEquals("", data.toString());
91 assertNotEquals(null, data.toString());
95 public void testSetEnvironment() {
96 data.setEnvironment(environment);
97 assertNotNull(data.getEnvironment());
101 public void testGetEnvironment() {
102 data.setEnvironment(environment);
103 assertSame(environment, data.getEnvironment());
107 public void testSetTemplate() {
108 data.setTemplate(template);
109 assertNotNull(data.getTemplate());
113 public void testGetTemplate() {
114 data.setTemplate(template);
115 assertSame(template, data.getTemplate());
119 public void testSetResources__() {
120 data.setResources(resources__);
121 assertNotNull(data.getResources());
125 public void testGetResources__() {
126 data.setResources(resources__);
127 assertSame(resources__, data.getResources());