2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.sdc.be.datatypes.components;
23 import org.junit.Assert;
24 import org.junit.Test;
25 import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
28 public class ServiceMetadataDataDefinitionTest {
30 private ServiceMetadataDataDefinition createTestSubject() {
31 return new ServiceMetadataDataDefinition();
35 public void testCopyConstructor() throws Exception {
36 ServiceMetadataDataDefinition testSubject;
39 testSubject = createTestSubject();
40 ServiceMetadataDataDefinition serviceMetadataDataDefinition = new ServiceMetadataDataDefinition(testSubject);
44 public void testGetDistributionStatus() throws Exception {
45 ServiceMetadataDataDefinition testSubject;
49 testSubject = createTestSubject();
50 result = testSubject.getDistributionStatus();
55 public void testSetDistributionStatus() throws Exception {
56 ServiceMetadataDataDefinition testSubject;
57 String distributionStatus = "";
60 testSubject = createTestSubject();
61 testSubject.setDistributionStatus(distributionStatus);
66 public void testGetServiceType() throws Exception {
67 ServiceMetadataDataDefinition testSubject;
71 testSubject = createTestSubject();
72 result = testSubject.getServiceType();
77 public void testSetServiceType() throws Exception {
78 ServiceMetadataDataDefinition testSubject;
79 String serviceType = "";
82 testSubject = createTestSubject();
83 testSubject.setServiceType(serviceType);
88 public void testGetServiceRole() throws Exception {
89 ServiceMetadataDataDefinition testSubject;
93 testSubject = createTestSubject();
94 result = testSubject.getServiceRole();
99 public void testSetServiceRole() throws Exception {
100 ServiceMetadataDataDefinition testSubject;
101 String serviceRole = "";
104 testSubject = createTestSubject();
105 testSubject.setServiceRole(serviceRole);
110 public void testIsEcompGeneratedNaming() throws Exception {
111 ServiceMetadataDataDefinition testSubject;
115 testSubject = createTestSubject();
116 result = testSubject.isEcompGeneratedNaming();
121 public void testSetEcompGeneratedNaming() throws Exception {
122 ServiceMetadataDataDefinition testSubject;
123 Boolean ecompGeneratedNaming = null;
126 testSubject = createTestSubject();
127 testSubject.setEcompGeneratedNaming(ecompGeneratedNaming);
132 public void testGetNamingPolicy() throws Exception {
133 ServiceMetadataDataDefinition testSubject;
137 testSubject = createTestSubject();
138 result = testSubject.getNamingPolicy();
143 public void testSetNamingPolicy() throws Exception {
144 ServiceMetadataDataDefinition testSubject;
145 String namingPolicy = "";
148 testSubject = createTestSubject();
149 testSubject.setNamingPolicy(namingPolicy);
154 public void testToString() throws Exception {
155 ServiceMetadataDataDefinition testSubject;
159 testSubject = createTestSubject();
160 result = testSubject.toString();
165 public void testHashCode() throws Exception {
166 ServiceMetadataDataDefinition testSubject;
170 testSubject = createTestSubject();
171 result = testSubject.hashCode();
175 public void testgetActualComponentType() throws Exception {
176 ServiceMetadataDataDefinition testSubject;
180 testSubject = createTestSubject();
181 result = testSubject.getActualComponentType();
182 testSubject.setComponentType(ComponentTypeEnum.PRODUCT);
183 result = testSubject.getActualComponentType();
187 public void testEquals() throws Exception {
188 ServiceMetadataDataDefinition testSubject;
193 testSubject = createTestSubject();
195 result = testSubject.equals(obj);
196 Assert.assertEquals(false, result);
197 result = testSubject.equals(testSubject);
198 Assert.assertEquals(true, result);
199 result = testSubject.equals(new ServiceMetadataDataDefinition());
200 Assert.assertEquals(true, result);