Catalog alignment
[sdc.git] / catalog-model / src / test / java / org / openecomp / sdc / be / model / ServiceTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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=========================================================
19  */
20
21 package org.openecomp.sdc.be.model;
22
23 import org.junit.BeforeClass;
24 import org.junit.Test;
25 import org.openecomp.sdc.be.config.Configuration;
26 import org.openecomp.sdc.be.config.ConfigurationManager;
27 import org.openecomp.sdc.be.datatypes.elements.ForwardingPathDataDefinition;
28 import org.openecomp.sdc.common.api.ConfigurationSource;
29 import org.openecomp.sdc.common.impl.ExternalConfiguration;
30 import org.openecomp.sdc.common.impl.FSConfigurationSource;
31
32 import java.util.Map;
33
34 public class ServiceTest {
35
36         protected static ConfigurationManager configurationManager;
37         static Configuration.EnvironmentContext environmentContext = new Configuration.EnvironmentContext();
38
39         @BeforeClass
40         public static void init() {
41                 String appConfigDir = "src/test/resources/config";
42                 ConfigurationSource configurationSource = new FSConfigurationSource(ExternalConfiguration.getChangeListener(),
43                                 appConfigDir);
44                 configurationManager = new ConfigurationManager(configurationSource);
45
46                 Configuration configuration = new Configuration();
47
48                 configuration.setJanusGraphInMemoryGraph(true);
49                 environmentContext.setDefaultValue("General_Revenue-Bearing");
50                 configuration.setEnvironmentContext(environmentContext);
51
52                 configurationManager.setConfiguration(configuration);
53         }
54
55         private Service createTestSubject() {
56                 return new Service();
57         }
58         
59         @Test
60         public void testCtor() throws Exception {
61                 new Service(new ComponentMetadataDefinition());
62         }
63         
64         @Test
65         public void testGetServiceApiArtifacts() throws Exception {
66                 Service testSubject;
67                 Map<String, ArtifactDefinition> result;
68
69                 // default test
70                 testSubject = createTestSubject();
71                 result = testSubject.getServiceApiArtifacts();
72         }
73
74         
75         @Test
76         public void testSetServiceApiArtifacts() throws Exception {
77                 Service testSubject;
78                 Map<String, ArtifactDefinition> serviceApiArtifacts = null;
79
80                 // default test
81                 testSubject = createTestSubject();
82                 testSubject.setServiceApiArtifacts(serviceApiArtifacts);
83         }
84
85         
86         @Test
87         public void testGetProjectCode() throws Exception {
88                 Service testSubject;
89                 String result;
90
91                 // default test
92                 testSubject = createTestSubject();
93                 result = testSubject.getProjectCode();
94         }
95
96         
97         @Test
98         public void testGetForwardingPaths() throws Exception {
99                 Service testSubject;
100                 Map<String, ForwardingPathDataDefinition> result;
101
102                 // default test
103                 testSubject = createTestSubject();
104                 result = testSubject.getForwardingPaths();
105         }
106
107         
108         @Test
109         public void testSetForwardingPaths() throws Exception {
110                 Service testSubject;
111                 Map<String, ForwardingPathDataDefinition> forwardingPaths = null;
112
113                 // default test
114                 testSubject = createTestSubject();
115                 testSubject.setForwardingPaths(forwardingPaths);
116         }
117
118         
119         @Test
120         public void testAddForwardingPath() throws Exception {
121                 Service testSubject;
122                 ForwardingPathDataDefinition forwardingPathDataDefinition = new ForwardingPathDataDefinition();
123                 ForwardingPathDataDefinition result;
124
125                 // default test
126                 testSubject = createTestSubject();
127                 result = testSubject.addForwardingPath(forwardingPathDataDefinition);
128         }
129
130         
131         @Test
132         public void testSetProjectCode() throws Exception {
133                 Service testSubject;
134                 String projectName = "";
135
136                 // default test
137                 testSubject = createTestSubject();
138                 testSubject.setProjectCode(projectName);
139         }
140
141         
142         @Test
143         public void testGetDistributionStatus() throws Exception {
144                 Service testSubject;
145                 DistributionStatusEnum result;
146
147                 // default test
148                 testSubject = createTestSubject();
149                 result = testSubject.getDistributionStatus();
150         }
151
152         
153         @Test
154         public void testSetDistributionStatus() throws Exception {
155                 Service testSubject;
156                 DistributionStatusEnum distributionStatus = null;
157
158                 // test 1
159                 testSubject = createTestSubject();
160                 distributionStatus = null;
161                 testSubject.setDistributionStatus(distributionStatus);
162                 testSubject.setDistributionStatus(DistributionStatusEnum.DISTRIBUTED);
163         }
164
165         
166         @Test
167         public void testSetEcompGeneratedNaming() throws Exception {
168                 Service testSubject;
169                 Boolean ecompGeneratedNaming = null;
170
171                 // default test
172                 testSubject = createTestSubject();
173                 testSubject.setEcompGeneratedNaming(ecompGeneratedNaming);
174         }
175
176         
177         @Test
178         public void testIsEcompGeneratedNaming() throws Exception {
179                 Service testSubject;
180                 Boolean result;
181
182                 // default test
183                 testSubject = createTestSubject();
184                 result = testSubject.isEcompGeneratedNaming();
185         }
186
187         
188         @Test
189         public void testSetNamingPolicy() throws Exception {
190                 Service testSubject;
191                 String namingPolicy = "";
192
193                 // default test
194                 testSubject = createTestSubject();
195                 testSubject.setNamingPolicy(namingPolicy);
196         }
197
198         
199         @Test
200         public void testGetNamingPolicy() throws Exception {
201                 Service testSubject;
202                 String result;
203
204                 // default test
205                 testSubject = createTestSubject();
206                 result = testSubject.getNamingPolicy();
207         }
208
209         
210         @Test
211         public void testGetEnvironmentContext() throws Exception {
212                 Service testSubject;
213                 String result;
214
215                 // default test
216                 testSubject = createTestSubject();
217                 result = testSubject.getEnvironmentContext();
218         }
219
220         
221         @Test
222         public void testSetEnvironmentContext() throws Exception {
223                 Service testSubject;
224                 String environmentContext = "";
225
226                 // default test
227                 testSubject = createTestSubject();
228                 testSubject.setEnvironmentContext(environmentContext);
229         }
230
231         
232         @Test
233         public void testSetServiceType() throws Exception {
234                 Service testSubject;
235                 String serviceType = "";
236
237                 // default test
238                 testSubject = createTestSubject();
239                 testSubject.setServiceType(serviceType);
240         }
241
242         
243         @Test
244         public void testGetServiceType() throws Exception {
245                 Service testSubject;
246                 String result;
247
248                 // default test
249                 testSubject = createTestSubject();
250                 result = testSubject.getServiceType();
251         }
252
253         
254         @Test
255         public void testSetServiceRole() throws Exception {
256                 Service testSubject;
257                 String serviceRole = "";
258
259                 // default test
260                 testSubject = createTestSubject();
261                 testSubject.setServiceRole(serviceRole);
262         }
263
264         
265         @Test
266         public void testGetServiceRole() throws Exception {
267                 Service testSubject;
268                 String result;
269
270                 // default test
271                 testSubject = createTestSubject();
272                 result = testSubject.getServiceRole();
273         }
274
275         
276
277
278         
279         @Test
280         public void testToString() throws Exception {
281                 Service testSubject;
282                 String result;
283
284                 // default test
285                 testSubject = createTestSubject();
286                 result = testSubject.toString();
287         }
288
289         
290         @Test
291         public void testSetSpecificComponetTypeArtifacts() throws Exception {
292                 Service testSubject;
293                 Map<String, ArtifactDefinition> specificComponentTypeArtifacts = null;
294
295                 // default test
296                 testSubject = createTestSubject();
297                 testSubject.setSpecificComponetTypeArtifacts(specificComponentTypeArtifacts);
298         }
299 }