5e2bd827760cd6a90dff5264931488af5f98cfde
[so.git] / adapters / mso-catalog-db-adapter / src / test / java / org / onap / so / db / catalog / client / CatalogDbClientTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 - 2018 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.onap.so.db.catalog.client;
22
23 import java.util.List;
24 import java.util.UUID;
25
26 import org.junit.Assert;
27 import org.junit.Before;
28 import org.junit.Test;
29 import org.junit.runner.RunWith;
30 import org.onap.so.adapters.catalogdb.CatalogDBApplication;
31 import org.onap.so.db.catalog.beans.AuthenticationType;
32 import org.onap.so.db.catalog.beans.CloudIdentity;
33 import org.onap.so.db.catalog.beans.CloudSite;
34 import org.onap.so.db.catalog.beans.CloudifyManager;
35 import org.onap.so.db.catalog.beans.ExternalServiceToInternalService;
36 import org.onap.so.db.catalog.beans.InstanceGroup;
37 import org.onap.so.db.catalog.beans.NetworkResourceCustomization;
38 import org.onap.so.db.catalog.beans.ServerType;
39 import org.onap.so.db.catalog.beans.Service;
40 import org.onap.so.db.catalog.beans.ServiceRecipe;
41 import org.onap.so.db.catalog.beans.VfModule;
42 import org.onap.so.db.catalog.beans.VfModuleCustomization;
43 import org.onap.so.db.catalog.beans.VnfComponentsRecipe;
44 import org.onap.so.db.catalog.beans.VnfRecipe;
45 import org.onap.so.db.catalog.beans.VnfResource;
46 import org.onap.so.db.catalog.beans.VnfResourceCustomization;
47 import org.onap.so.db.catalog.beans.macro.RainyDayHandlerStatus;
48 import org.springframework.beans.factory.annotation.Autowired;
49 import org.springframework.beans.factory.annotation.Value;
50 import org.springframework.boot.context.embedded.LocalServerPort;
51 import org.springframework.boot.test.context.SpringBootTest;
52 import org.springframework.test.context.ActiveProfiles;
53 import org.springframework.test.context.junit4.SpringRunner;
54
55 @RunWith(SpringRunner.class)
56 @SpringBootTest(classes = CatalogDBApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
57 @ActiveProfiles("test")
58 public class CatalogDbClientTest {
59     public static final String MTN13 = "mtn13";
60     @LocalServerPort
61     private int port;
62
63     @Value("${mso.db.auth}")
64     private String msoAdaptersAuth;
65
66     @Autowired
67     CatalogDbClientPortChanger client;
68
69     @Before
70     public void initialize(){
71         client.wiremockPort= String.valueOf(port);
72     }
73
74     @Test
75     public void testGetRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep(){
76         RainyDayHandlerStatus rainyDayHandlerStatus = client.getRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep("AssignServiceInstanceBB", "*", "*", "*", "*");
77         Assert.assertEquals("Rollback", rainyDayHandlerStatus.getPolicy());
78     }
79
80     @Test
81     public void testGetRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStepRecordNotFound(){
82         RainyDayHandlerStatus rainyDayHandlerStatus = client.getRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep(UUID.randomUUID().toString(), "*", "*", "*", "*");
83         Assert.assertNull(rainyDayHandlerStatus);
84     }
85
86     @Test
87     public void testGetCloudSiteHappyPath() throws Exception {
88         CloudSite cloudSite = client.getCloudSite(MTN13);
89         Assert.assertNotNull(cloudSite);
90         Assert.assertNotNull(cloudSite.getIdentityService());
91         Assert.assertEquals("MDT13", cloudSite.getClli());
92         Assert.assertEquals("mtn13", cloudSite.getRegionId());
93         Assert.assertEquals("MTN13", cloudSite.getIdentityServiceId());
94     }
95
96     @Test
97     public void testGetCloudSiteNotFound() throws Exception {
98         CloudSite cloudSite = client.getCloudSite(UUID.randomUUID().toString());
99         Assert.assertNull(cloudSite);
100     }
101
102     @Test
103     public void testGetCloudifyManagerHappyPath() throws Exception {
104         CloudifyManager cloudifyManager = client.getCloudifyManager("mtn13");
105         Assert.assertNotNull(cloudifyManager);
106         Assert.assertEquals("http://localhost:28090/v2.0", cloudifyManager.getCloudifyUrl());
107
108     }
109
110     @Test
111     public void testGetCloudifyManagerNotFound() throws Exception {
112         CloudifyManager cloudifyManager = client.getCloudifyManager(UUID.randomUUID().toString());
113         Assert.assertNull(cloudifyManager);
114     }
115
116
117     @Test
118     public void testGetCloudSiteByClliAndAicVersionHappyPath() throws Exception {
119         CloudSite cloudSite = client.getCloudSiteByClliAndAicVersion("MDT13", "2.5");
120         Assert.assertNotNull(cloudSite);
121     }
122
123     @Test
124     public void testGetCloudSiteByClliAndAicVersionNotFound() throws Exception {
125         CloudSite cloudSite = client.getCloudSiteByClliAndAicVersion("MDT13", "232496239746328");
126         Assert.assertNull(cloudSite);
127     }
128
129     @Test
130     public void testGetServiceByID() throws Exception {
131         Service serviceByID = client.getServiceByID("5df8b6de-2083-11e7-93ae-92361f002671");
132         Assert.assertNotNull(serviceByID);
133         Assert.assertEquals("MSOTADevInfra_vSAMP10a_Service", serviceByID.getModelName());
134         Assert.assertEquals("NA", serviceByID.getServiceType());
135         Assert.assertEquals("NA", serviceByID.getServiceRole());
136     }
137
138     @Test
139     public void testGetServiceByIDNotFound() throws Exception {
140         Service serviceByID = client.getServiceByID(UUID.randomUUID().toString());
141         Assert.assertNull(serviceByID);
142     }
143
144     @Test
145     public void testGetVfModuleByModelUUID() throws Exception {
146         VfModule vfModule = client.getVfModuleByModelUUID("20c4431c-246d-11e7-93ae-92361f002671");
147         Assert.assertNotNull(vfModule);
148         Assert.assertNotNull(vfModule.getVfModuleCustomization());
149         Assert.assertEquals("78ca26d0-246d-11e7-93ae-92361f002671", vfModule.getModelInvariantUUID());
150         Assert.assertEquals("vSAMP10aDEV::base::module-0", vfModule.getModelName());
151     }
152
153     @Test
154     public void testGetVfModuleByModelUUIDNotFound() throws Exception {
155         VfModule vfModule = client.getVfModuleByModelUUID(UUID.randomUUID().toString());
156         Assert.assertNull(vfModule);
157     }
158
159     @Test
160     public void testGetVnfResourceByModelUUID() throws Exception {
161         VnfResource vnfResource = client.getVnfResourceByModelUUID("ff2ae348-214a-11e7-93ae-92361f002671");
162         Assert.assertNotNull(vnfResource);
163         Assert.assertEquals("vSAMP10a", vnfResource.getModelName());
164     }
165
166     @Test
167     public void testGetVnfResourceByModelUUIDNotFound() throws Exception {
168         VnfResource vnfResource = client.getVnfResourceByModelUUID(UUID.randomUUID().toString());
169         Assert.assertNull(vnfResource);
170     }
171
172     @Test
173     public void testGetVnfResourceCustomizationByModelCustomizationUUID() {
174         VnfResourceCustomization vnfResourceCustomization = client.getVnfResourceCustomizationByModelCustomizationUUID("68dc9a92-214c-11e7-93ae-92361f002671");
175         Assert.assertNotNull(vnfResourceCustomization);
176         Assert.assertEquals("vSAMP", vnfResourceCustomization.getNfRole());
177         Assert.assertNotNull(vnfResourceCustomization.getModelCustomizationUUID());
178         Assert.assertNotNull(vnfResourceCustomization.getVnfResources());
179         Assert.assertNotNull(vnfResourceCustomization.getVfModuleCustomizations());
180         Assert.assertEquals("vSAMP10a", vnfResourceCustomization.getVnfResources().getModelName());
181
182     }
183
184     @Test
185     public void testGetVnfResourceCustomizationByModelCustomizationUUINotFound() {
186         VnfResourceCustomization vnfResourceCustomization = client.getVnfResourceCustomizationByModelCustomizationUUID(UUID.randomUUID().toString());
187         Assert.assertNull(vnfResourceCustomization);
188     }
189
190     @Test
191     public void testGetInstanceGroupByModelUUID() {
192         InstanceGroup instanceGroup = client.getInstanceGroupByModelUUID("0c8692ef-b9c0-435d-a738-edf31e71f38b");
193         Assert.assertNotNull(instanceGroup);
194         Assert.assertEquals("network_collection_resource_1806..NetworkCollection..0", instanceGroup.getModelName());
195         Assert.assertEquals("org.openecomp.resource.cr.NetworkCollectionResource1806", instanceGroup.getToscaNodeType().toString());
196     }
197
198     @Test
199     public void testGetVfModuleCustomizationByModelCuztomizationUUID() {
200         VfModuleCustomization vfModuleCustomization = client.getVfModuleCustomizationByModelCuztomizationUUID("cb82ffd8-252a-11e7-93ae-92361f002671");
201         Assert.assertNotNull(vfModuleCustomization);
202         Assert.assertNotNull(vfModuleCustomization.getModelCustomizationUUID());
203         Assert.assertEquals("base", vfModuleCustomization.getLabel());
204     }
205
206     @Test
207     public void testGetVfModuleCustomizationByModelCuztomizationUUIDNotFound() {
208         VfModuleCustomization vfModuleCustomization = client.getVfModuleCustomizationByModelCuztomizationUUID(UUID.randomUUID().toString());
209         Assert.assertNull(vfModuleCustomization);
210     }
211
212     @Test
213     public void testGetNetworkResourceCustomizationByModelCustomizationUUID() {
214         NetworkResourceCustomization networkResourceCustomization = client.getNetworkResourceCustomizationByModelCustomizationUUID("3bdbb104-476c-483e-9f8b-c095b3d308ac");
215         Assert.assertNotNull(networkResourceCustomization);
216         Assert.assertNotNull(networkResourceCustomization.getModelCustomizationUUID());
217         Assert.assertEquals("CONTRAIL30_GNDIRECT 9", networkResourceCustomization.getModelInstanceName());
218         Assert.assertNotNull(networkResourceCustomization.getNetworkResource());
219     }
220
221     @Test
222     public void testGetNetworkResourceCustomizationByModelCustomizationUUIDNotFound() {
223         NetworkResourceCustomization networkResourceCustomization = client.getNetworkResourceCustomizationByModelCustomizationUUID(UUID.randomUUID().toString());
224         Assert.assertNull(networkResourceCustomization);
225     }
226
227     @Test
228     public void testGgetVfModuleCustomizationByModelCustomizationUUIDAndVfModuleModelUUID() {
229         VfModuleCustomization vfModuleCustomization = client.getVfModuleCustomizationByModelCustomizationUUIDAndVfModuleModelUUID("cb82ffd8-252a-11e7-93ae-92361f002672", "20c4431c-246d-11e7-93ae-92361f002672");
230         Assert.assertNotNull(vfModuleCustomization);
231         Assert.assertNotNull(vfModuleCustomization.getModelCustomizationUUID());
232         Assert.assertNotNull(vfModuleCustomization.getVfModule());
233         Assert.assertEquals("base", vfModuleCustomization.getLabel());
234     }
235
236     @Test
237     public void testGgetVfModuleCustomizationByModelCustomizationUUIDAndVfModuleModelUUIDNotFound() {
238         VfModuleCustomization vfModuleCustomization = client.getVfModuleCustomizationByModelCustomizationUUIDAndVfModuleModelUUID("cb82ffd8-252a-11e7-93ae-92361f002672", UUID.randomUUID().toString());
239         Assert.assertNull(vfModuleCustomization);
240     }
241
242     @Test
243     public void testGetFirstByServiceModelUUIDAndAction() {
244         ServiceRecipe serviceRecipe = client.getFirstByServiceModelUUIDAndAction("4694a55f-58b3-4f17-92a5-796d6f5ffd0d", "createInstance");
245         Assert.assertNotNull(serviceRecipe);
246         Assert.assertNotNull(serviceRecipe.getServiceModelUUID());
247         Assert.assertNotNull(serviceRecipe.getAction());
248         Assert.assertEquals("/mso/async/services/CreateGenericALaCarteServiceInstance", serviceRecipe.getOrchestrationUri());
249         Assert.assertEquals("MSOTADevInfra aLaCarte", serviceRecipe.getDescription());
250     }
251
252     @Test
253     public void testGetFirstByServiceModelUUIDAndActionNotFound() {
254         ServiceRecipe serviceRecipe = client.getFirstByServiceModelUUIDAndAction("5df8b6de-2083-11e7-93ae-92361f002671", UUID.randomUUID().toString());
255         Assert.assertNull(serviceRecipe);
256     }
257     
258     @Test
259     public void testGetFirstVnfResourceByModelInvariantUUIDAndModelVersion() {
260         VnfResource vnfResource = client.getFirstVnfResourceByModelInvariantUUIDAndModelVersion("2fff5b20-214b-11e7-93ae-92361f002671", "2.0");
261         Assert.assertNotNull(vnfResource);
262         Assert.assertNotNull(vnfResource.getModelInvariantId());
263         Assert.assertNotNull(vnfResource.getModelVersion());
264         Assert.assertNotNull(vnfResource.getHeatTemplates());
265         Assert.assertNotNull(vnfResource.getVnfResourceCustomizations());
266         Assert.assertEquals("vSAMP10a", vnfResource.getModelName());
267     }
268
269     @Test
270     public void testGetFirstVnfResourceByModelInvariantUUIDAndModelVersionNotFound() {
271         VnfResource vnfResource = client.getFirstVnfResourceByModelInvariantUUIDAndModelVersion("2fff5b20-214b-11e7-93ae-92361f002671", UUID.randomUUID().toString());
272         Assert.assertNull(vnfResource);
273     }
274
275     @Test
276     public void testGetFirstVnfResourceCustomizationByModelInstanceNameAndVnfResources() {
277         VnfResource vnfr = new VnfResource();
278         vnfr.setModelUUID("ff2ae348-214a-11e7-93ae-92361f002671");
279         VnfResourceCustomization firstVnfResourceCustomizationByModelInstanceNameAndVnfResources = client.getFirstVnfResourceCustomizationByModelInstanceNameAndVnfResources("vSAMP10a 1", vnfr);
280         Assert.assertNotNull(firstVnfResourceCustomizationByModelInstanceNameAndVnfResources);
281         Assert.assertEquals("vSAMP", firstVnfResourceCustomizationByModelInstanceNameAndVnfResources.getNfRole());
282         Assert.assertEquals("vSAMP10a 1", firstVnfResourceCustomizationByModelInstanceNameAndVnfResources.getModelInstanceName());
283         Assert.assertNotNull(firstVnfResourceCustomizationByModelInstanceNameAndVnfResources.getVnfResources());
284         Assert.assertNotNull(firstVnfResourceCustomizationByModelInstanceNameAndVnfResources.getVfModuleCustomizations());
285     }
286
287     @Test
288     public void testGetFirstVnfRecipeByNfRoleAndAction() {
289         VnfRecipe vnfRecipe = client.getFirstVnfRecipeByNfRoleAndAction("GR-API-DEFAULT", "createInstance");
290         Assert.assertNotNull(vnfRecipe);
291         Assert.assertNotNull(vnfRecipe.getNfRole());
292         Assert.assertNotNull(vnfRecipe.getAction());
293         Assert.assertEquals("Gr api recipe to create vnf", vnfRecipe.getDescription());
294         Assert.assertEquals("/mso/async/services/WorkflowActionBB", vnfRecipe.getOrchestrationUri());
295     }
296
297     @Test
298     public void testGetFirstVnfRecipeByNfRoleAndActionNotFound() {
299         VnfRecipe vnfRecipe = client.getFirstVnfRecipeByNfRoleAndAction(UUID.randomUUID().toString(), "createInstance");
300         Assert.assertNull(vnfRecipe);
301     }
302
303     @Test
304     public void testGetFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction() {
305         VnfComponentsRecipe vnfComponentsRecipe = client.getFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction("20c4431c-246d-11e7-93ae-92361f002671", "volumeGroup", "createInstance");
306         Assert.assertNotNull(vnfComponentsRecipe);
307         Assert.assertNotNull(vnfComponentsRecipe.getAction());
308         Assert.assertNotNull(vnfComponentsRecipe.getVfModuleModelUUID());
309         Assert.assertNotNull(vnfComponentsRecipe.getVnfComponentType());
310         Assert.assertEquals("Gr api recipe to create volume-group", vnfComponentsRecipe.getDescription());
311         Assert.assertEquals("/mso/async/services/WorkflowActionBB", vnfComponentsRecipe.getOrchestrationUri());
312
313     }
314
315
316     @Test
317     public void testGetFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndActionNotFound() {
318         VnfComponentsRecipe vnfComponentsRecipe = client.getFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction(UUID.randomUUID().toString(), "volumeGroup", "createInstance");
319         Assert.assertNull(vnfComponentsRecipe);
320     }
321
322     @Test
323     public void testGetFirstVnfComponentsRecipeByVnfComponentTypeAndAction() {
324         VnfComponentsRecipe vnfComponentsRecipe = client.getFirstVnfComponentsRecipeByVnfComponentTypeAndAction("volumeGroup", "createInstance");
325         Assert.assertNotNull(vnfComponentsRecipe);
326         Assert.assertNotNull(vnfComponentsRecipe.getAction());
327         Assert.assertNotNull(vnfComponentsRecipe.getVnfComponentType());
328         Assert.assertEquals("VID_DEFAULT recipe t", vnfComponentsRecipe.getDescription());
329         Assert.assertEquals("/mso/async/services/CreateVfModuleVolumeInfraV1", vnfComponentsRecipe.getOrchestrationUri());
330     }
331
332     @Test
333     public void testGetServiceByModelVersionAndModelInvariantUUID() {
334         Service service = client.getServiceByModelVersionAndModelInvariantUUID("2.0", "9647dfc4-2083-11e7-93ae-92361f002671");
335         Assert.assertNotNull(service);
336         Assert.assertNotNull(service.getModelVersion());
337         Assert.assertNotNull(service.getModelInvariantUUID());
338         Assert.assertEquals("MSOTADevInfra_vSAMP10a_Service", service.getModelName());
339         Assert.assertEquals("NA", service.getServiceRole());
340     }
341
342     @Test
343     public void testGetServiceByModelVersionAndModelInvariantUUIDNotFound() {
344         Service service = client.getServiceByModelVersionAndModelInvariantUUID("2.0", UUID.randomUUID().toString());
345         Assert.assertNull(service);
346     }
347
348     @Test
349     public void testGetVfModuleByModelInvariantUUIDAndModelVersion() {
350         VfModule vfModule = client.getVfModuleByModelInvariantUUIDAndModelVersion("78ca26d0-246d-11e7-93ae-92361f002671", "2");
351         Assert.assertNotNull(vfModule);
352         Assert.assertNotNull(vfModule.getModelVersion());
353         Assert.assertNotNull(vfModule.getModelInvariantUUID());
354         Assert.assertEquals("vSAMP10aDEV::base::module-0", vfModule.getModelName());
355         Assert.assertEquals("vSAMP10a DEV Base", vfModule.getDescription());
356     }
357
358     @Test
359     public void testGetVfModuleByModelInvariantUUIDAndModelVersionNotFound() {
360         VfModule vfModule = client.getVfModuleByModelInvariantUUIDAndModelVersion(UUID.randomUUID().toString(), "2");
361         Assert.assertNull(vfModule);
362     }
363     
364     @Test
365     public void testGetServiceByModelInvariantUUIDOrderByModelVersionDesc() {
366         List<Service> serviceList = client.getServiceByModelInvariantUUIDOrderByModelVersionDesc("9647dfc4-2083-11e7-93ae-92361f002671");
367         Assert.assertFalse(serviceList.isEmpty());
368         Assert.assertEquals(2, serviceList.size());
369         Service service = serviceList.get(0);
370         Assert.assertEquals("2.0", service.getModelVersion());
371     }
372
373     @Test
374     public void testGetServiceByModelInvariantUUIDOrderByModelVersionDescNotFound() {
375         List<Service> serviceList = client.getServiceByModelInvariantUUIDOrderByModelVersionDesc(UUID.randomUUID().toString());
376         Assert.assertTrue(serviceList.isEmpty());
377     }
378
379     @Test
380     public void testGetVfModuleByModelInvariantUUIDOrderByModelVersionDesc() {
381         List<VfModule> moduleList = client.getVfModuleByModelInvariantUUIDOrderByModelVersionDesc("78ca26d0-246d-11e7-93ae-92361f002671");
382         Assert.assertFalse(moduleList.isEmpty());
383         Assert.assertEquals(2, moduleList.size());
384         VfModule module = moduleList.get(0);
385         Assert.assertEquals("vSAMP10a DEV Base",module.getDescription());
386     }
387
388     @Test
389     public void testPostCloudSite() {
390         CatalogDbClientPortChanger localClient = new CatalogDbClientPortChanger("http://localhost:" + client.wiremockPort, msoAdaptersAuth, client.wiremockPort);
391         CloudSite cloudSite = new CloudSite();
392         cloudSite.setId("MTN6");
393         cloudSite.setClli("TESTCLLI");
394         cloudSite.setRegionId("regionId");
395         cloudSite.setCloudVersion("VERSION");
396         cloudSite.setPlatform("PLATFORM");
397
398         CloudIdentity cloudIdentity = new CloudIdentity();
399         cloudIdentity.setId("RANDOMID");
400         cloudIdentity.setIdentityUrl("URL");
401         cloudIdentity.setMsoId("MSO_ID");
402         cloudIdentity.setMsoPass("MSO_PASS");
403         cloudIdentity.setAdminTenant("ADMIN_TENANT");
404         cloudIdentity.setMemberRole("ROLE");
405         cloudIdentity.setIdentityServerType(ServerType.KEYSTONE);
406         cloudIdentity.setIdentityAuthenticationType(AuthenticationType.RACKSPACE_APIKEY);
407         cloudSite.setIdentityService(cloudIdentity);
408         localClient.postCloudSite(cloudSite);
409         CloudSite getCloudSite = this.client.getCloudSite("MTN6");
410         Assert.assertNotNull(getCloudSite);
411         Assert.assertNotNull(getCloudSite.getIdentityService());
412         Assert.assertEquals("TESTCLLI", getCloudSite.getClli());
413         Assert.assertEquals("regionId", getCloudSite.getRegionId());
414         Assert.assertEquals("RANDOMID", getCloudSite.getIdentityServiceId());
415     }
416    @Test
417     public void testGetServiceByModelName() {
418         Service service = client.getServiceByModelName("MSOTADevInfra_Test_Service");
419         Assert.assertNotNull(service);
420         Assert.assertNotNull(service.getModelVersion());
421         Assert.assertNotNull(service.getModelInvariantUUID());
422         Assert.assertEquals("MSOTADevInfra_Test_Service", service.getModelName());
423         Assert.assertEquals("NA", service.getServiceRole());
424     }
425
426     @Test
427     public void testGetServiceByModelNameNotFound() {
428         Service service = client.getServiceByModelName("Not_Found");
429         Assert.assertNull(service);
430     }
431
432     @Test
433     public void testGetServiceByModelUUID() {
434         Service service = client.getServiceByModelUUID("5df8b6de-2083-11e7-93ae-92361f002679");
435         Assert.assertNotNull(service);
436         Assert.assertNotNull(service.getModelVersion());
437         Assert.assertNotNull(service.getModelInvariantUUID());
438         Assert.assertEquals("5df8b6de-2083-11e7-93ae-92361f002679", service.getModelUUID());
439         Assert.assertEquals("NA", service.getServiceRole());
440     }
441
442     @Test
443     public void testGetServiceByModelUUIDNotFound() {
444         Service service = client.getServiceByModelUUID("Not_Found");
445         Assert.assertNull(service);
446     }
447
448     @Test
449     public void testFindServiceRecipeByActionAndServiceModelUUID() {
450         ServiceRecipe serviceRecipe = client.findServiceRecipeByActionAndServiceModelUUID("createInstance","4694a55f-58b3-4f17-92a5-796d6f5ffd0d" );
451         Assert.assertNotNull(serviceRecipe);
452         Assert.assertNotNull(serviceRecipe.getServiceModelUUID());
453         Assert.assertNotNull(serviceRecipe.getAction());
454         Assert.assertEquals("/mso/async/services/CreateGenericALaCarteServiceInstance", serviceRecipe.getOrchestrationUri());
455         Assert.assertEquals("MSOTADevInfra aLaCarte", serviceRecipe.getDescription());
456     }
457
458     @Test
459     public void testFindServiceRecipeByActionAndServiceModelUUIDNotFound() {
460         ServiceRecipe serviceRecipe = client.findServiceRecipeByActionAndServiceModelUUID("not_found","5df8b6de-2083-11e7-93ae-test" );
461         Assert.assertNull(serviceRecipe);
462     }
463
464     @Test
465     public void testFindExternalToInternalServiceByServiceNameNotFound() {
466         ExternalServiceToInternalService externalServiceToInternalService = client.findExternalToInternalServiceByServiceName("Not_Found");
467         Assert.assertNull(externalServiceToInternalService);
468     }
469 }