aboutsummaryrefslogtreecommitdiffstats
path: root/asdc-controller/src/test/java/org/openecomp/mso/asdc/installer/heat/tests/ToscaResourceInstallerTest.java
blob: 98cf6608024f9c5bc1da226cb48834246778300d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
/*-
 * ============LICENSE_START=======================================================
 * ONAP - SO
 * ================================================================================
 * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
 * ================================================================================
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============LICENSE_END=========================================================
 */

package org.openecomp.mso.asdc.installer.heat.tests;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.tuple.Pair;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.mockito.Mockito;
import org.openecomp.mso.asdc.client.ASDCConfiguration;
import org.openecomp.mso.asdc.client.exceptions.ArtifactInstallerException;
import org.openecomp.mso.asdc.client.tests.ASDCControllerTest;
import org.openecomp.mso.asdc.installer.ToscaResourceStructure;
import org.openecomp.mso.asdc.installer.VfResourceStructure;
import org.openecomp.mso.asdc.installer.heat.ToscaResourceInstaller;
import org.openecomp.mso.db.catalog.CatalogDatabase;
import org.openecomp.mso.db.catalog.beans.AllottedResource;
import org.openecomp.mso.db.catalog.beans.AllottedResourceCustomization;
import org.openecomp.mso.db.catalog.beans.NetworkResource;
import org.openecomp.mso.db.catalog.beans.NetworkResourceCustomization;
import org.openecomp.mso.db.catalog.beans.Service;
import org.openecomp.mso.db.catalog.beans.ServiceToAllottedResources;
import org.openecomp.mso.db.catalog.beans.ServiceToNetworks;
import org.openecomp.mso.db.catalog.beans.ServiceToResourceCustomization;
import org.openecomp.mso.db.catalog.beans.TempNetworkHeatTemplateLookup;
import org.openecomp.mso.db.catalog.beans.ToscaCsar;
import org.openecomp.mso.db.catalog.beans.VfModule;
import org.openecomp.mso.db.catalog.beans.VfModuleCustomization;
import org.openecomp.mso.db.catalog.beans.VfModuleToHeatFiles;
import org.openecomp.mso.db.catalog.beans.VnfResCustomToVfModuleCustom;
import org.openecomp.mso.db.catalog.beans.VnfResource;
import org.openecomp.mso.db.catalog.beans.VnfResourceCustomization;
import org.openecomp.mso.properties.MsoJavaProperties;
import org.openecomp.mso.properties.MsoPropertiesException;
import org.openecomp.mso.properties.MsoPropertiesFactory;
import org.onap.sdc.api.IDistributionClient;
import org.onap.sdc.api.notification.IArtifactInfo;
import org.onap.sdc.api.notification.INotificationData;
import org.onap.sdc.api.notification.IResourceInstance;
import org.onap.sdc.api.results.IDistributionClientDownloadResult;
import org.onap.sdc.api.results.IDistributionClientResult;
import org.onap.sdc.tosca.parser.api.ISdcCsarHelper;
import org.onap.sdc.tosca.parser.impl.FilterType;
import org.onap.sdc.tosca.parser.impl.SdcTypes;
import org.onap.sdc.toscaparser.api.CapabilityAssignment;
import org.onap.sdc.toscaparser.api.CapabilityAssignments;
import org.onap.sdc.toscaparser.api.Group;
import org.onap.sdc.toscaparser.api.NodeTemplate;
import org.onap.sdc.toscaparser.api.RequirementAssignments;
import org.onap.sdc.toscaparser.api.elements.Metadata;
import org.onap.sdc.toscaparser.api.parameters.Input;
import org.onap.sdc.utils.DistributionActionResultEnum;

import mockit.Mock;
import mockit.MockUp;

public class ToscaResourceInstallerTest {

	private static MsoPropertiesFactory msoPropertiesFactory = new MsoPropertiesFactory();

	private static String heatExample;
	private static String heatExampleMD5HashBase64;

	private static INotificationData iNotif;

	private static IDistributionClientDownloadResult downloadResult;
	private static IDistributionClientDownloadResult downloadCorruptedResult;

	private static IDistributionClientResult successfulClientInitResult;
	private static IDistributionClientResult unsuccessfulClientInitResult;

	private static IDistributionClient distributionClient;

	private static IArtifactInfo artifactInfo1;

	private static IResourceInstance resource1;

	private static VfResourceStructure vrs;

	public static final String ASDC_PROP = MsoJavaProperties.class.getClassLoader().getResource("mso.json").toString()
			.substring(5);
	public static final String ASDC_PROP2 = MsoJavaProperties.class.getClassLoader().getResource("mso2.json").toString()
			.substring(5);
	public static final String ASDC_PROP3 = MsoJavaProperties.class.getClassLoader().getResource("mso3.json").toString()
			.substring(5);
	public static final String ASDC_PROP_BAD = MsoJavaProperties.class.getClassLoader().getResource("mso-bad.json")
			.toString().substring(5);
	public static final String ASDC_PROP_WITH_NULL = MsoJavaProperties.class.getClassLoader()
			.getResource("mso-with-NULL.json").toString().substring(5);

	@BeforeClass
	public static final void prepareMockNotification() throws MsoPropertiesException, IOException, URISyntaxException,
			NoSuchAlgorithmException, ArtifactInstallerException {

		heatExample = new String(Files.readAllBytes(Paths.get(
				ASDCControllerTest.class.getClassLoader().getResource("resource-examples/autoscaling.yaml").toURI())));
		MessageDigest md = MessageDigest.getInstance("MD5");
		byte[] md5Hash = md.digest(heatExample.getBytes());
		heatExampleMD5HashBase64 = Base64.encodeBase64String(md5Hash);

		iNotif = Mockito.mock(INotificationData.class);

		// Create fake ArtifactInfo
		artifactInfo1 = Mockito.mock(IArtifactInfo.class);
		Mockito.when(artifactInfo1.getArtifactChecksum())
				.thenReturn(ToscaResourceInstallerTest.heatExampleMD5HashBase64);

		Mockito.when(artifactInfo1.getArtifactName()).thenReturn("artifact1");
		Mockito.when(artifactInfo1.getArtifactType()).thenReturn(ASDCConfiguration.HEAT);
		Mockito.when(artifactInfo1.getArtifactURL())
				.thenReturn("https://localhost:8080/v1/catalog/services/srv1/2.0/resources/aaa/1.0/artifacts/aaa.yml");
		Mockito.when(artifactInfo1.getArtifactUUID()).thenReturn("UUID1");
		Mockito.when(artifactInfo1.getArtifactDescription()).thenReturn("testos artifact1");

		distributionClient = Mockito.mock(IDistributionClient.class);

		// Now provision the NotificationData mock
		List<IArtifactInfo> listArtifact = new ArrayList<>();
		listArtifact.add(artifactInfo1);

		// Create fake resource Instance
		resource1 = Mockito.mock(IResourceInstance.class);
		// Mockito.when(resource1.getResourceType()).thenReturn("VF");
		Mockito.when(resource1.getResourceName()).thenReturn("resourceName");
		Mockito.when(resource1.getArtifacts()).thenReturn(listArtifact);

		List<IResourceInstance> resources = new ArrayList<>();
		resources.add(resource1);

		Mockito.when(iNotif.getResources()).thenReturn(resources);
		Mockito.when(iNotif.getDistributionID()).thenReturn("distributionID1");
		Mockito.when(iNotif.getServiceName()).thenReturn("serviceName1");
		Mockito.when(iNotif.getServiceUUID()).thenReturn("serviceNameUUID1");
		Mockito.when(iNotif.getServiceVersion()).thenReturn("1.0");

		downloadResult = Mockito.mock(IDistributionClientDownloadResult.class);
		Mockito.when(downloadResult.getArtifactPayload()).thenReturn(heatExample.getBytes());
		Mockito.when(downloadResult.getDistributionActionResult()).thenReturn(DistributionActionResultEnum.SUCCESS);
		Mockito.when(downloadResult.getDistributionMessageResult()).thenReturn("Success");

		downloadCorruptedResult = Mockito.mock(IDistributionClientDownloadResult.class);
		Mockito.when(downloadCorruptedResult.getArtifactPayload()).thenReturn((heatExample + "badone").getBytes());
		Mockito.when(downloadCorruptedResult.getDistributionActionResult())
				.thenReturn(DistributionActionResultEnum.SUCCESS);
		Mockito.when(downloadCorruptedResult.getDistributionMessageResult()).thenReturn("Success");

		vrs = new VfResourceStructure(iNotif, resource1);
		try {
			vrs.addArtifactToStructure(distributionClient, artifactInfo1, downloadResult);
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
		try {
			vrs.createVfModuleStructures();
		} catch (ArtifactInstallerException e) {
			e.printStackTrace();
		}
		vrs.getNotification();
		vrs.getArtifactsMapByUUID();
		vrs.getCatalogNetworkResourceCustomization();
		vrs.getCatalogResourceCustomization();
		vrs.getCatalogService();
		vrs.getCatalogServiceToAllottedResources();
		vrs.getCatalogServiceToNetworks();
		vrs.getCatalogVnfResource();
		vrs.getResourceInstance();
		vrs.getVfModulesStructureList();
		vrs.getVfModuleStructure();
		vrs.setCatalogNetworkResourceCustomization(new NetworkResourceCustomization());
		vrs.setCatalogResourceCustomization(new AllottedResourceCustomization());
		vrs.setCatalogService(new Service());
		vrs.setCatalogServiceToAllottedResources(new ServiceToAllottedResources());
		vrs.setCatalogServiceToNetworks(new ServiceToNetworks());
		vrs.setCatalogVnfResource(new VnfResource());
		vrs.setSuccessfulDeployment();

		AllottedResourceCustomization arc = new AllottedResourceCustomization();
		arc.setModelCustomizationUuid("modelCustomizationUuid");
		List<AllottedResourceCustomization> allottedResources = new ArrayList<>();
		allottedResources.add(arc);

		NetworkResourceCustomization nrc = new NetworkResourceCustomization();
		nrc.setModelCustomizationUuid("modelCustomizationUuid");
		List<NetworkResourceCustomization> networkResources = new ArrayList<>();
		networkResources.add(nrc);

		new MockUp<CatalogDatabase>() {
			@Mock
			public List<AllottedResourceCustomization> getAllAllottedResourcesByServiceModelUuid(
					String serviceModelUuid) {
				return allottedResources;
			}
		};
		new MockUp<CatalogDatabase>() {
			@Mock
			public List<NetworkResourceCustomization> getAllNetworksByServiceModelUuid(String serviceModelUuid) {
				return networkResources;
			}
		};

		// Mock now the ASDC distribution client behavior
		successfulClientInitResult = Mockito.mock(IDistributionClientResult.class);
		Mockito.when(successfulClientInitResult.getDistributionActionResult())
				.thenReturn(DistributionActionResultEnum.SUCCESS);

		unsuccessfulClientInitResult = Mockito.mock(IDistributionClientResult.class);
		Mockito.when(unsuccessfulClientInitResult.getDistributionActionResult())
				.thenReturn(DistributionActionResultEnum.GENERAL_ERROR);

	}

	@Before
	public final void initBeforeEachTest() throws MsoPropertiesException {
		// load the config
		msoPropertiesFactory.removeAllMsoProperties();
		msoPropertiesFactory.initializeMsoProperties(ASDCConfiguration.MSO_PROP_ASDC, ASDC_PROP);
	}

	@AfterClass
	public static final void kill() throws MsoPropertiesException {

		msoPropertiesFactory.removeMsoProperties(ASDCConfiguration.MSO_PROP_ASDC);

	}

	@Test
	public void isResourceAlreadyDeployedAllotedResourceTest() {
		Mockito.when(resource1.getResourceType()).thenReturn("VF");
		Mockito.when(resource1.getCategory()).thenReturn("Allotted Resource");
		ToscaResourceInstaller tri = new ToscaResourceInstaller();

		try {
			tri.isResourceAlreadyDeployed(vrs);
		} catch (ArtifactInstallerException e) {
		}
	}

	@Test(expected=Exception.class)
	@Ignore // 1802 merge
	public void installTheResourceTest() {

		/*
		 * COMMENTED OUT BECAUSE IT DOES NOT COMPILE IN ONAP JENKINS BUILD
		 * 
		ToscaResourceStructure trs = new ToscaResourceStructure();
		trs.getAllottedResource();
		trs.getAllottedList();
		trs.getCatalogAllottedResourceCustomization();
		trs.getCatalogAllottedServiceToResourceCustomization();
		trs.getCatalogNetworkResource();
		trs.getCatalogNetworkResourceCustomization();
		trs.getCatalogResourceCustomization();
		trs.getCatalogService();
		trs.getCatalogTempNetworkHeatTemplateLookup();
		trs.getCatalogToscaCsar();
		trs.getCatalogVfModule();
		trs.getCatalogVfModuleCustomization();
		trs.getCatalogVfModuleToHeatFiles();
		trs.getCatalogVfServiceToResourceCustomization();
		trs.getCatalogVlServiceToResourceCustomization();
		trs.getCatalogVnfResCustomToVfModuleCustom();
		trs.getCatalogVnfResource();
		trs.getCatalogVnfResourceCustomization();
		trs.getEnvHeatTemplateUUID();
		trs.getHeatFilesUUID();
		trs.getHeatTemplateUUID();
		trs.getNetworkTypes();
		trs.getSdcCsarHelper();
		trs.getServiceMetadata();
		trs.getServiceToResourceCustomization();
		trs.getServiceVersion();
		trs.getToscaArtifact();
		trs.getVfTypes();
		trs.getVolHeatEnvTemplateUUID();
		trs.getVolHeatTemplateUUID();

		NodeTemplate nodeTemplate = Mockito.mock(NodeTemplate.class);
		List<NodeTemplate> alnt = new ArrayList<>();
		trs.setAllottedList(alnt);
		trs.setAllottedResource(new AllottedResource());
		trs.setCatalogAllottedResourceCustomization(new AllottedResourceCustomization());
		trs.setCatalogAllottedServiceToResourceCustomization(new ServiceToResourceCustomization());
		trs.setCatalogNetworkResource(new NetworkResource());
		trs.setCatalogNetworkResourceCustomization(new NetworkResourceCustomization());
		trs.setCatalogResourceCustomization(new AllottedResourceCustomization());
		trs.setCatalogService(new Service());
		trs.setCatalogTempNetworkHeatTemplateLookup(new TempNetworkHeatTemplateLookup());
		trs.setCatalogToscaCsar(new ToscaCsar());
		trs.setCatalogVfModule(new VfModule());
		trs.setCatalogVfModuleCustomization(new VfModuleCustomization());
		trs.setCatalogVfModuleToHeatFiles(new VfModuleToHeatFiles());
		trs.setCatalogVfServiceToResourceCustomization(new ServiceToResourceCustomization());
		trs.setCatalogVlServiceToResourceCustomization(new ServiceToResourceCustomization());
		trs.setCatalogVnfResCustomToVfModuleCustom(new VnfResCustomToVfModuleCustom());
		trs.setCatalogVnfResource(new VnfResource());
		trs.setCatalogVnfResourceCustomization(new VnfResourceCustomization());
		trs.setEnvHeatTemplateUUID("envHeatTemplateUUID");
		trs.setHeatFilesUUID("heatFilesUUID");
		trs.setHeatTemplateUUID("heatTemplateUUID");
		trs.setNetworkTypes(alnt);
		trs.setVolHeatTemplateUUID("volHeatTemplateUUID");
		trs.setSdcCsarHelper(new ISdcCsarHelper() {

			@Override
			public List<NodeTemplate> getGroupMembersFromTopologyTemplate(String arg0) {
			    return null;
			}

			@Override
			public List<Map<String, Object>> getGroupsOfOriginOfNodeTemplate(NodeTemplate arg0) {
			    return null;
			}

			@Override
			public List<Map<String,Map<String,Object>>> getGroupsOfTopologyTemplateByToscaGroupType(String arg0) {
			    return null;
			}

			@Override
			public List<Map<String,Map<String,Object>>> getGroupsOfTopologyTemplate() {
			    return null;
			}

			@Override
			public List<Map<String,Map<String,Object>>> getPoliciesOfTargetByToscaPolicyType(NodeTemplate arg0, String arg1) {
			    return null;
			}

			@Override
			public List<Map<String,Map<String,Object>>> getPoliciesOfTarget(NodeTemplate arg0) {
			    return null;
			}

			@Override
			public NodeTemplate getNodeTemplateByName(String arg0) {
			    return null;
			}

			@Override
			public List<Map<String,Object>> getPolicyTargetsFromOrigin(NodeTemplate arg0, String arg1) {
			    return null;
			}

			@Override
			public List<NodeTemplate> getPolicyTargetsFromTopologyTemplate(String arg0) {
			    return null;
			}

			@Override
			public List<Map<String,Object>> getPoliciesOfOriginOfNodeTemplateByToscaPolicyType(NodeTemplate arg0, String arg1) {
			    return null;
			}

			@Override
			public List<Map<String,Object>> getPoliciesOfOriginOfNodeTemplate(NodeTemplate arg0) {
			    return null;
			}

			@Override
			public List<Map<String,Map<String,Object>>>  getPoliciesOfTopologyTemplateByToscaPolicyType(String arg0) {
			    return null;
			}

			@Override
			public List<Map<String,Map<String,Object>>> getPoliciesOfTopologyTemplate() {
			    return null;
			}

			////////////////////////////////

			@Override
			public boolean hasTopology(NodeTemplate arg0) {
				return false;
			}

			@Override
			public NodeTemplate getVnfConfig(String arg0) {
				return null;
			}

			@Override
			public List<NodeTemplate> getVfcListByVf(String arg0) {
				return null;
			}

			@Override
			public List<Group> getVfModulesByVf(String arg0) {
				return null;
			}

			@Override
			public String getTypeOfNodeTemplate(NodeTemplate arg0) {
				return null;
			}

			@Override
			public List<NodeTemplate> getServiceVlList() {
				return null;
			}

			@Override
			public List<NodeTemplate> getServiceVfList() {
				return null;
			}

			@Override
			public String getServiceSubstitutionMappingsTypeName() {
				return null;
			}

			@Override
			public List<NodeTemplate> getServiceNodeTemplatesByType(String arg0) {
				return null;
			}

			@Override
			public List<NodeTemplate> getServiceNodeTemplates() {
				return null;
			}

			@Override
			public List<NodeTemplate> getServiceNodeTemplateBySdcType(SdcTypes arg0) {
				return null;
			}

			@Override
			public Map<String, Object> getServiceMetadataProperties() {
				return null;
			}

			@Override
			public Metadata getServiceMetadata() {
				return null;
			}

			@Override
			public List<Input> getServiceInputs() {
				return null;
			}

			@Override
			public Object getServiceInputLeafValueOfDefaultAsObject(String arg0) {
				return null;
			}

			@Override
			public String getServiceInputLeafValueOfDefault(String arg0) {
				return null;
			}

			@Override
			public String getNodeTemplatePropertyLeafValue(NodeTemplate arg0, String arg1) {
				return null;
			}

			@Override
			public Object getNodeTemplatePropertyAsObject(NodeTemplate arg0, String arg1) {
				return null;
			}

			@Override
			public List<Pair<NodeTemplate, NodeTemplate>> getNodeTemplatePairsByReqName(List<NodeTemplate> arg0,
					List<NodeTemplate> arg1, String arg2) {
				return null;
			}

			@Override
			public String getNodeTemplateCustomizationUuid(NodeTemplate arg0) {
				return null;
			}

			@Override
			public List<NodeTemplate> getNodeTemplateChildren(NodeTemplate arg0) {
				return null;
			}

			@Override
			public List<NodeTemplate> getNodeTemplateBySdcType(NodeTemplate arg0, SdcTypes arg1) {
				return null;
			}

			@Override
			public String getMetadataPropertyValue(Metadata arg0, String arg1) {
				return null;
			}

			@Override
			public List<NodeTemplate> getMembersOfVfModule(NodeTemplate arg0, Group arg1) {
				return null;
			}

			@Override
			public String getGroupPropertyLeafValue(Group arg0, String arg1) {
				return null;
			}

			@Override
			public Object getGroupPropertyAsObject(Group arg0, String arg1) {
				return null;
			}

			@Override
			public Map<String, Map<String, Object>> getCpPropertiesFromVfcAsObject(NodeTemplate arg0) {
				return null;
			}

			@Override
			public Map<String, Map<String, Object>> getCpPropertiesFromVfc(NodeTemplate arg0) {
				return null;
			}

			@Override
			public List<NodeTemplate> getCpListByVf(String arg0) {
				return null;
			}

			@Override
			public String getConformanceLevel() {
				return null;
			}

			@Override
			public List<NodeTemplate> getAllottedResources() {
				return null;
			}

			@Override
			public Map<String, String> filterNodeTemplatePropertiesByValue(NodeTemplate arg0, FilterType arg1,
					String arg2) {
				return null;
			}

			@Override
			public CapabilityAssignments getCapabilitiesOf(NodeTemplate arg0) {
				// TODO Auto-generated method stub
				return null;
			}

			@Override
			public String getCapabilityPropertyLeafValue(CapabilityAssignment arg0, String arg1) {
				// TODO Auto-generated method stub
				return null;
			}

			@Override
			public Metadata getNodeTemplateMetadata(NodeTemplate arg0) {
				// TODO Auto-generated method stub
				return null;
			}

			@Override
			public RequirementAssignments getRequirementsOf(NodeTemplate arg0) {
				// TODO Auto-generated method stub
				return null;
			}

			@Override
			public Map<String, String> getServiceMetadataAllProperties() {
				// TODO Auto-generated method stub
				return null;
			}

			@Override
			public NodeTemplate getServiceNodeTemplateByNodeName(String arg0) {
				// TODO Auto-generated method stub
				return null;
			}
		});
		// trs.setServiceMetadata(new Metadata(new HashMap<>()));
		trs.setServiceToResourceCustomization(new ServiceToResourceCustomization());
		trs.setServiceVersion("1.0");
		trs.setToscaArtifact(new IArtifactInfo() {

			@Override
			public List<IArtifactInfo> getRelatedArtifacts() {
				return null;
			}

			@Override
			public IArtifactInfo getGeneratedArtifact() {
				return null;
			}

			@Override
			public String getArtifactVersion() {
				return null;
			}

			@Override
			public String getArtifactUUID() {
				return null;
			}

			@Override
			public String getArtifactURL() {
				return null;
			}

			@Override
			public String getArtifactType() {
				return null;
			}

			@Override
			public Integer getArtifactTimeout() {
				return null;
			}

			@Override
			public String getArtifactName() {
				return null;
			}

			@Override
			public String getArtifactDescription() {
				return null;
			}

			@Override
			public String getArtifactChecksum() {
				return null;
			}
		});
		trs.setVfTypes(alnt);
		trs.setVnfAlreadyInstalled(true);
		trs.setVolHeatEnvTemplateUUID("volHeatEnvTemplateUUID");
		trs.isVnfAlreadyInstalled();

		try{
		trs.updateResourceStructure(artifactInfo1);
		
		}catch(Exception e){}
		
		ToscaResourceInstaller tri = new ToscaResourceInstaller();

		try {
			tri.installTheResource(trs, vrs);
		} catch (ArtifactInstallerException e) {
		}
		*/
	}
}