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.model;
23 import org.junit.Test;
24 import org.openecomp.sdc.be.datatypes.elements.ForwardingPathDataDefinition;
28 public class ServiceTest {
30 private Service createTestSubject() {
35 public void testCtor() throws Exception {
36 new Service(new ComponentMetadataDefinition());
40 public void testGetServiceApiArtifacts() throws Exception {
42 Map<String, ArtifactDefinition> result;
45 testSubject = createTestSubject();
46 result = testSubject.getServiceApiArtifacts();
51 public void testSetServiceApiArtifacts() throws Exception {
53 Map<String, ArtifactDefinition> serviceApiArtifacts = null;
56 testSubject = createTestSubject();
57 testSubject.setServiceApiArtifacts(serviceApiArtifacts);
62 public void testGetProjectCode() throws Exception {
67 testSubject = createTestSubject();
68 result = testSubject.getProjectCode();
73 public void testGetForwardingPaths() throws Exception {
75 Map<String, ForwardingPathDataDefinition> result;
78 testSubject = createTestSubject();
79 result = testSubject.getForwardingPaths();
84 public void testSetForwardingPaths() throws Exception {
86 Map<String, ForwardingPathDataDefinition> forwardingPaths = null;
89 testSubject = createTestSubject();
90 testSubject.setForwardingPaths(forwardingPaths);
95 public void testAddForwardingPath() throws Exception {
97 ForwardingPathDataDefinition forwardingPathDataDefinition = new ForwardingPathDataDefinition();
98 ForwardingPathDataDefinition result;
101 testSubject = createTestSubject();
102 result = testSubject.addForwardingPath(forwardingPathDataDefinition);
107 public void testSetProjectCode() throws Exception {
109 String projectName = "";
112 testSubject = createTestSubject();
113 testSubject.setProjectCode(projectName);
118 public void testGetDistributionStatus() throws Exception {
120 DistributionStatusEnum result;
123 testSubject = createTestSubject();
124 result = testSubject.getDistributionStatus();
129 public void testSetDistributionStatus() throws Exception {
131 DistributionStatusEnum distributionStatus = null;
134 testSubject = createTestSubject();
135 distributionStatus = null;
136 testSubject.setDistributionStatus(distributionStatus);
137 testSubject.setDistributionStatus(DistributionStatusEnum.DISTRIBUTED);
142 public void testSetEcompGeneratedNaming() throws Exception {
144 Boolean ecompGeneratedNaming = null;
147 testSubject = createTestSubject();
148 testSubject.setEcompGeneratedNaming(ecompGeneratedNaming);
153 public void testIsEcompGeneratedNaming() throws Exception {
158 testSubject = createTestSubject();
159 result = testSubject.isEcompGeneratedNaming();
164 public void testSetNamingPolicy() throws Exception {
166 String namingPolicy = "";
169 testSubject = createTestSubject();
170 testSubject.setNamingPolicy(namingPolicy);
175 public void testGetNamingPolicy() throws Exception {
180 testSubject = createTestSubject();
181 result = testSubject.getNamingPolicy();
186 public void testGetEnvironmentContext() throws Exception {
191 testSubject = createTestSubject();
192 result = testSubject.getEnvironmentContext();
197 public void testSetEnvironmentContext() throws Exception {
199 String environmentContext = "";
202 testSubject = createTestSubject();
203 testSubject.setEnvironmentContext(environmentContext);
208 public void testSetServiceType() throws Exception {
210 String serviceType = "";
213 testSubject = createTestSubject();
214 testSubject.setServiceType(serviceType);
219 public void testGetServiceType() throws Exception {
224 testSubject = createTestSubject();
225 result = testSubject.getServiceType();
230 public void testSetServiceRole() throws Exception {
232 String serviceRole = "";
235 testSubject = createTestSubject();
236 testSubject.setServiceRole(serviceRole);
241 public void testGetServiceRole() throws Exception {
246 testSubject = createTestSubject();
247 result = testSubject.getServiceRole();
255 public void testToString() throws Exception {
260 testSubject = createTestSubject();
261 result = testSubject.toString();
266 public void testSetSpecificComponetTypeArtifacts() throws Exception {
268 Map<String, ArtifactDefinition> specificComponentTypeArtifacts = null;
271 testSubject = createTestSubject();
272 testSubject.setSpecificComponetTypeArtifacts(specificComponentTypeArtifacts);