UT for the BPMN flow
[so.git] / asdc-controller / src / test / java / org / openecomp / mso / asdc / installer / heat / tests / ToscaResourceInstallerTest.java
1 /*-\r
2  * ============LICENSE_START=======================================================\r
3  * ONAP - SO\r
4  * ================================================================================\r
5  * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.\r
6  * ================================================================================\r
7  * Licensed under the Apache License, Version 2.0 (the "License");\r
8  * you may not use this file except in compliance with the License.\r
9  * You may obtain a copy of the License at\r
10  *\r
11  *      http://www.apache.org/licenses/LICENSE-2.0\r
12  *\r
13  * Unless required by applicable law or agreed to in writing, software\r
14  * distributed under the License is distributed on an "AS IS" BASIS,\r
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
16  * See the License for the specific language governing permissions and\r
17  * limitations under the License.\r
18  * ============LICENSE_END=========================================================\r
19  */\r
20 \r
21 package org.openecomp.mso.asdc.installer.heat.tests;\r
22 \r
23 import java.io.IOException;\r
24 import java.io.UnsupportedEncodingException;\r
25 import java.net.URISyntaxException;\r
26 import java.nio.file.Files;\r
27 import java.nio.file.Paths;\r
28 import java.security.MessageDigest;\r
29 import java.security.NoSuchAlgorithmException;\r
30 import java.util.ArrayList;\r
31 import java.util.List;\r
32 import java.util.Map;\r
33 \r
34 import org.apache.commons.codec.binary.Base64;\r
35 import org.apache.commons.lang3.tuple.Pair;\r
36 import org.junit.AfterClass;\r
37 import org.junit.Before;\r
38 import org.junit.BeforeClass;\r
39 import org.junit.Test;\r
40 import org.mockito.Mockito;\r
41 import org.openecomp.mso.asdc.client.ASDCConfiguration;\r
42 import org.openecomp.mso.asdc.client.exceptions.ArtifactInstallerException;\r
43 import org.openecomp.mso.asdc.client.tests.ASDCControllerTest;\r
44 import org.openecomp.mso.asdc.installer.ToscaResourceStructure;\r
45 import org.openecomp.mso.asdc.installer.VfResourceStructure;\r
46 import org.openecomp.mso.asdc.installer.heat.ToscaResourceInstaller;\r
47 import org.openecomp.mso.db.catalog.CatalogDatabase;\r
48 import org.openecomp.mso.db.catalog.beans.AllottedResource;\r
49 import org.openecomp.mso.db.catalog.beans.AllottedResourceCustomization;\r
50 import org.openecomp.mso.db.catalog.beans.NetworkResource;\r
51 import org.openecomp.mso.db.catalog.beans.NetworkResourceCustomization;\r
52 import org.openecomp.mso.db.catalog.beans.Service;\r
53 import org.openecomp.mso.db.catalog.beans.ServiceToAllottedResources;\r
54 import org.openecomp.mso.db.catalog.beans.ServiceToNetworks;\r
55 import org.openecomp.mso.db.catalog.beans.ServiceToResourceCustomization;\r
56 import org.openecomp.mso.db.catalog.beans.TempNetworkHeatTemplateLookup;\r
57 import org.openecomp.mso.db.catalog.beans.ToscaCsar;\r
58 import org.openecomp.mso.db.catalog.beans.VfModule;\r
59 import org.openecomp.mso.db.catalog.beans.VfModuleCustomization;\r
60 import org.openecomp.mso.db.catalog.beans.VfModuleToHeatFiles;\r
61 import org.openecomp.mso.db.catalog.beans.VnfResCustomToVfModuleCustom;\r
62 import org.openecomp.mso.db.catalog.beans.VnfResource;\r
63 import org.openecomp.mso.db.catalog.beans.VnfResourceCustomization;\r
64 import org.openecomp.mso.properties.MsoJavaProperties;\r
65 import org.openecomp.mso.properties.MsoPropertiesException;\r
66 import org.openecomp.mso.properties.MsoPropertiesFactory;\r
67 import org.openecomp.sdc.api.IDistributionClient;\r
68 import org.openecomp.sdc.api.notification.IArtifactInfo;\r
69 import org.openecomp.sdc.api.notification.INotificationData;\r
70 import org.openecomp.sdc.api.notification.IResourceInstance;\r
71 import org.openecomp.sdc.api.results.IDistributionClientDownloadResult;\r
72 import org.openecomp.sdc.api.results.IDistributionClientResult;\r
73 import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper;\r
74 import org.openecomp.sdc.tosca.parser.impl.FilterType;\r
75 import org.openecomp.sdc.tosca.parser.impl.SdcTypes;\r
76 import org.openecomp.sdc.toscaparser.api.Group;\r
77 import org.openecomp.sdc.toscaparser.api.NodeTemplate;\r
78 import org.openecomp.sdc.toscaparser.api.elements.Metadata;\r
79 import org.openecomp.sdc.toscaparser.api.parameters.Input;\r
80 import org.openecomp.sdc.utils.DistributionActionResultEnum;\r
81 \r
82 import mockit.Mock;\r
83 import mockit.MockUp;\r
84 \r
85 public class ToscaResourceInstallerTest {\r
86 \r
87         private static MsoPropertiesFactory msoPropertiesFactory = new MsoPropertiesFactory();\r
88 \r
89         private static String heatExample;\r
90         private static String heatExampleMD5HashBase64;\r
91 \r
92         private static INotificationData iNotif;\r
93 \r
94         private static IDistributionClientDownloadResult downloadResult;\r
95         private static IDistributionClientDownloadResult downloadCorruptedResult;\r
96 \r
97         private static IDistributionClientResult successfulClientInitResult;\r
98         private static IDistributionClientResult unsuccessfulClientInitResult;\r
99 \r
100         private static IDistributionClient distributionClient;\r
101 \r
102         private static IArtifactInfo artifactInfo1;\r
103 \r
104         private static IResourceInstance resource1;\r
105 \r
106         private static VfResourceStructure vrs;\r
107 \r
108         public static final String ASDC_PROP = MsoJavaProperties.class.getClassLoader().getResource("mso.json").toString()\r
109                         .substring(5);\r
110         public static final String ASDC_PROP2 = MsoJavaProperties.class.getClassLoader().getResource("mso2.json").toString()\r
111                         .substring(5);\r
112         public static final String ASDC_PROP3 = MsoJavaProperties.class.getClassLoader().getResource("mso3.json").toString()\r
113                         .substring(5);\r
114         public static final String ASDC_PROP_BAD = MsoJavaProperties.class.getClassLoader().getResource("mso-bad.json")\r
115                         .toString().substring(5);\r
116         public static final String ASDC_PROP_WITH_NULL = MsoJavaProperties.class.getClassLoader()\r
117                         .getResource("mso-with-NULL.json").toString().substring(5);\r
118 \r
119         @BeforeClass\r
120         public static final void prepareMockNotification() throws MsoPropertiesException, IOException, URISyntaxException,\r
121                         NoSuchAlgorithmException, ArtifactInstallerException {\r
122 \r
123                 heatExample = new String(Files.readAllBytes(Paths.get(\r
124                                 ASDCControllerTest.class.getClassLoader().getResource("resource-examples/autoscaling.yaml").toURI())));\r
125                 MessageDigest md = MessageDigest.getInstance("MD5");\r
126                 byte[] md5Hash = md.digest(heatExample.getBytes());\r
127                 heatExampleMD5HashBase64 = Base64.encodeBase64String(md5Hash);\r
128 \r
129                 iNotif = Mockito.mock(INotificationData.class);\r
130 \r
131                 // Create fake ArtifactInfo\r
132                 artifactInfo1 = Mockito.mock(IArtifactInfo.class);\r
133                 Mockito.when(artifactInfo1.getArtifactChecksum())\r
134                                 .thenReturn(ToscaResourceInstallerTest.heatExampleMD5HashBase64);\r
135 \r
136                 Mockito.when(artifactInfo1.getArtifactName()).thenReturn("artifact1");\r
137                 Mockito.when(artifactInfo1.getArtifactType()).thenReturn(ASDCConfiguration.HEAT);\r
138                 Mockito.when(artifactInfo1.getArtifactURL())\r
139                                 .thenReturn("https://localhost:8080/v1/catalog/services/srv1/2.0/resources/aaa/1.0/artifacts/aaa.yml");\r
140                 Mockito.when(artifactInfo1.getArtifactUUID()).thenReturn("UUID1");\r
141                 Mockito.when(artifactInfo1.getArtifactDescription()).thenReturn("testos artifact1");\r
142 \r
143                 distributionClient = Mockito.mock(IDistributionClient.class);\r
144 \r
145                 // Now provision the NotificationData mock\r
146                 List<IArtifactInfo> listArtifact = new ArrayList<IArtifactInfo>();\r
147                 listArtifact.add(artifactInfo1);\r
148 \r
149                 // Create fake resource Instance\r
150                 resource1 = Mockito.mock(IResourceInstance.class);\r
151                 // Mockito.when(resource1.getResourceType()).thenReturn("VF");\r
152                 Mockito.when(resource1.getResourceName()).thenReturn("resourceName");\r
153                 Mockito.when(resource1.getArtifacts()).thenReturn(listArtifact);\r
154 \r
155                 List<IResourceInstance> resources = new ArrayList<>();\r
156                 resources.add(resource1);\r
157 \r
158                 Mockito.when(iNotif.getResources()).thenReturn(resources);\r
159                 Mockito.when(iNotif.getDistributionID()).thenReturn("distributionID1");\r
160                 Mockito.when(iNotif.getServiceName()).thenReturn("serviceName1");\r
161                 Mockito.when(iNotif.getServiceUUID()).thenReturn("serviceNameUUID1");\r
162                 Mockito.when(iNotif.getServiceVersion()).thenReturn("1.0");\r
163 \r
164                 downloadResult = Mockito.mock(IDistributionClientDownloadResult.class);\r
165                 Mockito.when(downloadResult.getArtifactPayload()).thenReturn(heatExample.getBytes());\r
166                 Mockito.when(downloadResult.getDistributionActionResult()).thenReturn(DistributionActionResultEnum.SUCCESS);\r
167                 Mockito.when(downloadResult.getDistributionMessageResult()).thenReturn("Success");\r
168 \r
169                 downloadCorruptedResult = Mockito.mock(IDistributionClientDownloadResult.class);\r
170                 Mockito.when(downloadCorruptedResult.getArtifactPayload()).thenReturn((heatExample + "badone").getBytes());\r
171                 Mockito.when(downloadCorruptedResult.getDistributionActionResult())\r
172                                 .thenReturn(DistributionActionResultEnum.SUCCESS);\r
173                 Mockito.when(downloadCorruptedResult.getDistributionMessageResult()).thenReturn("Success");\r
174 \r
175                 vrs = new VfResourceStructure(iNotif, resource1);\r
176                 try {\r
177                         vrs.addArtifactToStructure(distributionClient, artifactInfo1, downloadResult);\r
178                 } catch (UnsupportedEncodingException e) {\r
179                         e.printStackTrace();\r
180                 }\r
181                 try {\r
182                         vrs.createVfModuleStructures();\r
183                 } catch (ArtifactInstallerException e) {\r
184                         e.printStackTrace();\r
185                 }\r
186                 vrs.getNotification();\r
187                 vrs.getArtifactsMapByUUID();\r
188                 vrs.getCatalogNetworkResourceCustomization();\r
189                 vrs.getCatalogResourceCustomization();\r
190                 vrs.getCatalogService();\r
191                 vrs.getCatalogServiceToAllottedResources();\r
192                 vrs.getCatalogServiceToNetworks();\r
193                 vrs.getCatalogVnfResource();\r
194                 vrs.getResourceInstance();\r
195                 vrs.getVfModulesStructureList();\r
196                 vrs.getVfModuleStructure();\r
197                 vrs.setCatalogNetworkResourceCustomization(new NetworkResourceCustomization());\r
198                 vrs.setCatalogResourceCustomization(new AllottedResourceCustomization());\r
199                 vrs.setCatalogService(new Service());\r
200                 vrs.setCatalogServiceToAllottedResources(new ServiceToAllottedResources());\r
201                 vrs.setCatalogServiceToNetworks(new ServiceToNetworks());\r
202                 vrs.setCatalogVnfResource(new VnfResource());\r
203                 vrs.setSuccessfulDeployment();\r
204 \r
205                 AllottedResourceCustomization arc = new AllottedResourceCustomization();\r
206                 arc.setModelCustomizationUuid("modelCustomizationUuid");\r
207                 List<AllottedResourceCustomization> allottedResources = new ArrayList<>();\r
208                 allottedResources.add(arc);\r
209 \r
210                 NetworkResourceCustomization nrc = new NetworkResourceCustomization();\r
211                 nrc.setModelCustomizationUuid("modelCustomizationUuid");\r
212                 List<NetworkResourceCustomization> networkResources = new ArrayList<>();\r
213                 networkResources.add(nrc);\r
214 \r
215                 new MockUp<CatalogDatabase>() {\r
216                         @Mock\r
217                         public List<AllottedResourceCustomization> getAllAllottedResourcesByServiceModelUuid(\r
218                                         String serviceModelUuid) {\r
219                                 return allottedResources;\r
220                         }\r
221                 };\r
222                 new MockUp<CatalogDatabase>() {\r
223                         @Mock\r
224                         public List<NetworkResourceCustomization> getAllNetworksByServiceModelUuid(String serviceModelUuid) {\r
225                                 return networkResources;\r
226                         }\r
227                 };\r
228 \r
229                 // Mock now the ASDC distribution client behavior\r
230                 successfulClientInitResult = Mockito.mock(IDistributionClientResult.class);\r
231                 Mockito.when(successfulClientInitResult.getDistributionActionResult())\r
232                                 .thenReturn(DistributionActionResultEnum.SUCCESS);\r
233 \r
234                 unsuccessfulClientInitResult = Mockito.mock(IDistributionClientResult.class);\r
235                 Mockito.when(unsuccessfulClientInitResult.getDistributionActionResult())\r
236                                 .thenReturn(DistributionActionResultEnum.GENERAL_ERROR);\r
237 \r
238         }\r
239 \r
240         @Before\r
241         public final void initBeforeEachTest() throws MsoPropertiesException {\r
242                 // load the config\r
243                 msoPropertiesFactory.removeAllMsoProperties();\r
244                 msoPropertiesFactory.initializeMsoProperties(ASDCConfiguration.MSO_PROP_ASDC, ASDC_PROP);\r
245         }\r
246 \r
247         @AfterClass\r
248         public static final void kill() throws MsoPropertiesException {\r
249 \r
250                 msoPropertiesFactory.removeMsoProperties(ASDCConfiguration.MSO_PROP_ASDC);\r
251 \r
252         }\r
253 \r
254         @Test\r
255         public void isResourceAlreadyDeployedAllotedResourceTest() {\r
256                 Mockito.when(resource1.getResourceType()).thenReturn("VF");\r
257                 Mockito.when(resource1.getCategory()).thenReturn("Allotted Resource");\r
258                 ToscaResourceInstaller tri = new ToscaResourceInstaller();\r
259 \r
260                 try {\r
261                         tri.isResourceAlreadyDeployed(vrs);\r
262                 } catch (ArtifactInstallerException e) {\r
263                 }\r
264         }\r
265 \r
266         @Test(expected=Exception.class)\r
267         public void installTheResourceTest() {\r
268 \r
269                 ToscaResourceStructure trs = new ToscaResourceStructure();\r
270                 trs.getAllottedResource();\r
271                 trs.getAllottedList();\r
272                 trs.getCatalogAllottedResourceCustomization();\r
273                 trs.getCatalogAllottedServiceToResourceCustomization();\r
274                 trs.getCatalogNetworkResource();\r
275                 trs.getCatalogNetworkResourceCustomization();\r
276                 trs.getCatalogResourceCustomization();\r
277                 trs.getCatalogService();\r
278                 trs.getCatalogTempNetworkHeatTemplateLookup();\r
279                 trs.getCatalogToscaCsar();\r
280                 trs.getCatalogVfModule();\r
281                 trs.getCatalogVfModuleCustomization();\r
282                 trs.getCatalogVfModuleToHeatFiles();\r
283                 trs.getCatalogVfServiceToResourceCustomization();\r
284                 trs.getCatalogVlServiceToResourceCustomization();\r
285                 trs.getCatalogVnfResCustomToVfModuleCustom();\r
286                 trs.getCatalogVnfResource();\r
287                 trs.getCatalogVnfResourceCustomization();\r
288                 trs.getEnvHeatTemplateUUID();\r
289                 trs.getHeatFilesUUID();\r
290                 trs.getHeatTemplateUUID();\r
291                 trs.getNetworkTypes();\r
292                 trs.getSdcCsarHelper();\r
293                 trs.getServiceMetadata();\r
294                 trs.getServiceToResourceCustomization();\r
295                 trs.getServiceVersion();\r
296                 trs.getToscaArtifact();\r
297                 trs.getVfTypes();\r
298                 trs.getVolHeatEnvTemplateUUID();\r
299                 trs.getVolHeatTemplateUUID();\r
300 \r
301                 NodeTemplate nodeTemplate = Mockito.mock(NodeTemplate.class);\r
302                 List<NodeTemplate> alnt = new ArrayList<>();\r
303                 trs.setAllottedList(alnt);\r
304                 trs.setAllottedResource(new AllottedResource());\r
305                 trs.setCatalogAllottedResourceCustomization(new AllottedResourceCustomization());\r
306                 trs.setCatalogAllottedServiceToResourceCustomization(new ServiceToResourceCustomization());\r
307                 trs.setCatalogNetworkResource(new NetworkResource());\r
308                 trs.setCatalogNetworkResourceCustomization(new NetworkResourceCustomization());\r
309                 trs.setCatalogResourceCustomization(new AllottedResourceCustomization());\r
310                 trs.setCatalogService(new Service());\r
311                 trs.setCatalogTempNetworkHeatTemplateLookup(new TempNetworkHeatTemplateLookup());\r
312                 trs.setCatalogToscaCsar(new ToscaCsar());\r
313                 trs.setCatalogVfModule(new VfModule());\r
314                 trs.setCatalogVfModuleCustomization(new VfModuleCustomization());\r
315                 trs.setCatalogVfModuleToHeatFiles(new VfModuleToHeatFiles());\r
316                 trs.setCatalogVfServiceToResourceCustomization(new ServiceToResourceCustomization());\r
317                 trs.setCatalogVlServiceToResourceCustomization(new ServiceToResourceCustomization());\r
318                 trs.setCatalogVnfResCustomToVfModuleCustom(new VnfResCustomToVfModuleCustom());\r
319                 trs.setCatalogVnfResource(new VnfResource());\r
320                 trs.setCatalogVnfResourceCustomization(new VnfResourceCustomization());\r
321                 trs.setEnvHeatTemplateUUID("envHeatTemplateUUID");\r
322                 trs.setHeatFilesUUID("heatFilesUUID");\r
323                 trs.setHeatTemplateUUID("heatTemplateUUID");\r
324                 trs.setNetworkTypes(alnt);\r
325                 trs.setVolHeatTemplateUUID("volHeatTemplateUUID");\r
326                 trs.setSdcCsarHelper(new ISdcCsarHelper() {\r
327 \r
328                         @Override\r
329                         public boolean hasTopology(NodeTemplate arg0) {\r
330                                 return false;\r
331                         }\r
332 \r
333                         @Override\r
334                         public NodeTemplate getVnfConfig(String arg0) {\r
335                                 return null;\r
336                         }\r
337 \r
338                         @Override\r
339                         public List<NodeTemplate> getVfcListByVf(String arg0) {\r
340                                 return null;\r
341                         }\r
342 \r
343                         @Override\r
344                         public List<Group> getVfModulesByVf(String arg0) {\r
345                                 return null;\r
346                         }\r
347 \r
348                         @Override\r
349                         public String getTypeOfNodeTemplate(NodeTemplate arg0) {\r
350                                 return null;\r
351                         }\r
352 \r
353                         @Override\r
354                         public List<NodeTemplate> getServiceVlList() {\r
355                                 return null;\r
356                         }\r
357 \r
358                         @Override\r
359                         public List<NodeTemplate> getServiceVfList() {\r
360                                 return null;\r
361                         }\r
362 \r
363                         @Override\r
364                         public String getServiceSubstitutionMappingsTypeName() {\r
365                                 return null;\r
366                         }\r
367 \r
368                         @Override\r
369                         public List<NodeTemplate> getServiceNodeTemplatesByType(String arg0) {\r
370                                 return null;\r
371                         }\r
372 \r
373                         @Override\r
374                         public List<NodeTemplate> getServiceNodeTemplates() {\r
375                                 return null;\r
376                         }\r
377 \r
378                         @Override\r
379                         public List<NodeTemplate> getServiceNodeTemplateBySdcType(SdcTypes arg0) {\r
380                                 return null;\r
381                         }\r
382 \r
383                         @Override\r
384                         public Map<String, Object> getServiceMetadataProperties() {\r
385                                 return null;\r
386                         }\r
387 \r
388                         @Override\r
389                         public Metadata getServiceMetadata() {\r
390                                 return null;\r
391                         }\r
392 \r
393                         @Override\r
394                         public List<Input> getServiceInputs() {\r
395                                 return null;\r
396                         }\r
397 \r
398                         @Override\r
399                         public Object getServiceInputLeafValueOfDefaultAsObject(String arg0) {\r
400                                 return null;\r
401                         }\r
402 \r
403                         @Override\r
404                         public String getServiceInputLeafValueOfDefault(String arg0) {\r
405                                 return null;\r
406                         }\r
407 \r
408                         @Override\r
409                         public String getNodeTemplatePropertyLeafValue(NodeTemplate arg0, String arg1) {\r
410                                 return null;\r
411                         }\r
412 \r
413                         @Override\r
414                         public Object getNodeTemplatePropertyAsObject(NodeTemplate arg0, String arg1) {\r
415                                 return null;\r
416                         }\r
417 \r
418                         @Override\r
419                         public List<Pair<NodeTemplate, NodeTemplate>> getNodeTemplatePairsByReqName(List<NodeTemplate> arg0,\r
420                                         List<NodeTemplate> arg1, String arg2) {\r
421                                 return null;\r
422                         }\r
423 \r
424                         @Override\r
425                         public String getNodeTemplateCustomizationUuid(NodeTemplate arg0) {\r
426                                 return null;\r
427                         }\r
428 \r
429                         @Override\r
430                         public List<NodeTemplate> getNodeTemplateChildren(NodeTemplate arg0) {\r
431                                 return null;\r
432                         }\r
433 \r
434                         @Override\r
435                         public List<NodeTemplate> getNodeTemplateBySdcType(NodeTemplate arg0, SdcTypes arg1) {\r
436                                 return null;\r
437                         }\r
438 \r
439                         @Override\r
440                         public String getMetadataPropertyValue(Metadata arg0, String arg1) {\r
441                                 return null;\r
442                         }\r
443 \r
444                         @Override\r
445                         public List<NodeTemplate> getMembersOfVfModule(NodeTemplate arg0, Group arg1) {\r
446                                 return null;\r
447                         }\r
448 \r
449                         @Override\r
450                         public String getGroupPropertyLeafValue(Group arg0, String arg1) {\r
451                                 return null;\r
452                         }\r
453 \r
454                         @Override\r
455                         public Object getGroupPropertyAsObject(Group arg0, String arg1) {\r
456                                 return null;\r
457                         }\r
458 \r
459                         @Override\r
460                         public Map<String, Map<String, Object>> getCpPropertiesFromVfcAsObject(NodeTemplate arg0) {\r
461                                 return null;\r
462                         }\r
463 \r
464                         @Override\r
465                         public Map<String, Map<String, Object>> getCpPropertiesFromVfc(NodeTemplate arg0) {\r
466                                 return null;\r
467                         }\r
468 \r
469                         @Override\r
470                         public List<NodeTemplate> getCpListByVf(String arg0) {\r
471                                 return null;\r
472                         }\r
473 \r
474                         @Override\r
475                         public String getConformanceLevel() {\r
476                                 return null;\r
477                         }\r
478 \r
479                         @Override\r
480                         public List<NodeTemplate> getAllottedResources() {\r
481                                 return null;\r
482                         }\r
483 \r
484                         @Override\r
485                         public Map<String, String> filterNodeTemplatePropertiesByValue(NodeTemplate arg0, FilterType arg1,\r
486                                         String arg2) {\r
487                                 return null;\r
488                         }\r
489                 });\r
490                 // trs.setServiceMetadata(new Metadata(new HashMap<>()));\r
491                 trs.setServiceToResourceCustomization(new ServiceToResourceCustomization());\r
492                 trs.setServiceVersion("1.0");\r
493                 trs.setToscaArtifact(new IArtifactInfo() {\r
494 \r
495                         @Override\r
496                         public List<IArtifactInfo> getRelatedArtifacts() {\r
497                                 return null;\r
498                         }\r
499 \r
500                         @Override\r
501                         public IArtifactInfo getGeneratedArtifact() {\r
502                                 return null;\r
503                         }\r
504 \r
505                         @Override\r
506                         public String getArtifactVersion() {\r
507                                 return null;\r
508                         }\r
509 \r
510                         @Override\r
511                         public String getArtifactUUID() {\r
512                                 return null;\r
513                         }\r
514 \r
515                         @Override\r
516                         public String getArtifactURL() {\r
517                                 return null;\r
518                         }\r
519 \r
520                         @Override\r
521                         public String getArtifactType() {\r
522                                 return null;\r
523                         }\r
524 \r
525                         @Override\r
526                         public Integer getArtifactTimeout() {\r
527                                 return null;\r
528                         }\r
529 \r
530                         @Override\r
531                         public String getArtifactName() {\r
532                                 return null;\r
533                         }\r
534 \r
535                         @Override\r
536                         public String getArtifactDescription() {\r
537                                 return null;\r
538                         }\r
539 \r
540                         @Override\r
541                         public String getArtifactChecksum() {\r
542                                 return null;\r
543                         }\r
544                 });\r
545                 trs.setVfTypes(alnt);\r
546                 trs.setVnfAlreadyInstalled(true);\r
547                 trs.setVolHeatEnvTemplateUUID("volHeatEnvTemplateUUID");\r
548                 trs.isVnfAlreadyInstalled();\r
549 \r
550                 trs.updateResourceStructure(artifactInfo1);\r
551                 ToscaResourceInstaller tri = new ToscaResourceInstaller();\r
552 \r
553                 try {\r
554                         tri.installTheResource(trs, vrs);\r
555                 } catch (ArtifactInstallerException e) {\r
556                 }\r
557         }\r
558 }\r