[SDC-29] rebase continue work to align source
[sdc.git] / test-apis-ci / src / main / java / org / openecomp / sdc / ci / tests / utils / validation / CsarValidationUtils.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2017 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.ci.tests.utils.validation;
22
23 import static org.testng.AssertJUnit.assertTrue;
24
25 import java.io.File;
26 import java.nio.charset.StandardCharsets;
27 import java.nio.file.Files;
28 import java.nio.file.Path;
29 import java.util.ArrayList;
30 import java.util.List;
31 import java.util.Map;
32
33 import org.openecomp.sdc.be.model.Resource;
34 import org.openecomp.sdc.ci.tests.datatypes.GroupHeatMetaDefinition;
35 import org.openecomp.sdc.ci.tests.datatypes.HeatMetaFirstLevelDefinition;
36 import org.openecomp.sdc.ci.tests.datatypes.TypeHeatMetaDefinition;
37 import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
38 import org.openecomp.sdc.ci.tests.utils.CsarParserUtils;
39 import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
40 import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
41 import org.openecomp.sdc.ci.tests.utils.rest.ImportRestUtils;
42 import org.openecomp.sdc.common.rest.api.RestResponseAsByteArray;
43 import org.openecomp.sdc.common.util.ZipUtil;
44
45 public class CsarValidationUtils {
46
47         public static String getCsarPayload(String csarName, String fileLocation) throws Exception {
48
49                 RestResponseAsByteArray csar = ImportRestUtils.getCsar(csarName, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
50                 assertTrue("Return response code different from 200", csar.getHttpStatusCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
51                 Map<String, byte[]> readZip = null;
52                 byte[] data = csar.getResponse();
53                 if (data != null && data.length > 0) {
54                         readZip = ZipUtil.readZip(data);
55
56                 }
57                 byte[] artifactsBs = readZip.get(fileLocation);
58                 String str = new String(artifactsBs, StandardCharsets.UTF_8);
59                 return str;
60
61         }
62         
63         public static String getCsarPayload(File csarName, String fileLocation) throws Exception {
64
65 //              RestResponseAsByteArray csar = ImportRestUtils.getCsar(csarName, ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER));
66 //              assertTrue("Return response code different from 200", csar.getHttpStatusCode() == BaseRestUtils.STATUS_CODE_SUCCESS);
67                 Map<String, byte[]> readZip = null;
68                 Path path = csarName.toPath();
69                 
70                 byte[] data = Files.readAllBytes(path);
71                 if (data != null && data.length > 0) {
72                         readZip = ZipUtil.readZip(data);
73                 }
74                 byte[] artifactsBs = readZip.get(fileLocation);
75                 String str = new String(artifactsBs, StandardCharsets.UTF_8);
76                 return str;
77
78         }
79
80         public static void validateCsarVfArtifact(String csarUUID, Resource resource) throws Exception {
81
82                 List<TypeHeatMetaDefinition> listTypeHeatMetaDefinition = CsarParserUtils.getListTypeHeatMetaDefinition(csarUUID);
83                 assertTrue(
84                                 "check group count, expected: " + getGroupCount(listTypeHeatMetaDefinition) + ", actual: "
85                                                 + resource.getGroups().size(),
86                                 getGroupCount(listTypeHeatMetaDefinition) == resource.getGroups().size());
87                 assertTrue(
88                                 "check artifact count, expected: " + getArtifactCount(listTypeHeatMetaDefinition, false) + ", actual: "
89                                                 + resource.getDeploymentArtifacts().size(),
90                                 getArtifactCount(listTypeHeatMetaDefinition, false) == resource.getDeploymentArtifacts().size());
91
92         }
93         
94         /*public static List<TypeHeatMetaDefinition> getListTypeHeatMetaDefinition(String csarUUID) throws Exception {
95
96                 String artifactHeatMetaLocation = "Artifacts/HEAT.meta";
97                 JSONParser parser = new JSONParser();
98                 String csarPayload = getCsarPayload(csarUUID, artifactHeatMetaLocation);
99                 if (csarPayload != null) {
100                         Object parse = parser.parse(csarPayload);
101                         JSONObject jsonObject = (JSONObject) parse;
102                         JSONObject jsonObjectImportStructure = (JSONObject) jsonObject.get("importStructure");
103                         List<TypeHeatMetaDefinition> listHeatMetaDefenition = new ArrayList<TypeHeatMetaDefinition>();
104                         listHeatMetaDefenition = getArtifactsByGroup(jsonObjectImportStructure, listHeatMetaDefenition);
105                         return listHeatMetaDefenition;
106                 }
107                 return null;
108
109         }*/
110         
111         /*public static List<TypeHeatMetaDefinition> getListTypeHeatMetaDefinition(File csarUUID) throws Exception {
112
113                 String artifactHeatMetaLocation = "Artifacts/HEAT.meta";
114                 JSONParser parser = new JSONParser();
115                 String csarPayload = getCsarPayload(csarUUID, artifactHeatMetaLocation);
116                 if (csarPayload != null) {
117                         Object parse = parser.parse(csarPayload);
118                         JSONObject jsonObject = (JSONObject) parse;
119                         JSONObject jsonObjectImportStructure = (JSONObject) jsonObject.get("importStructure");
120                         List<TypeHeatMetaDefinition> listHeatMetaDefenition = new ArrayList<TypeHeatMetaDefinition>();
121                         listHeatMetaDefenition = getArtifactsByGroup(jsonObjectImportStructure, listHeatMetaDefenition);
122                         return listHeatMetaDefenition;
123                 }
124                 return null;
125
126         }*/
127         
128         private static Integer getGroupCount(List<TypeHeatMetaDefinition> listHeatMetaDefenition) {
129                 int count = 0;
130                 for (TypeHeatMetaDefinition typeHeatMetaDefinition : listHeatMetaDefenition) {
131                         count = count + typeHeatMetaDefinition.getGroupHeatMetaDefinition().size();
132                 }
133                 return count;
134         }
135         
136         private static Integer getArtifactCount(List<TypeHeatMetaDefinition> listHeatMetaDefenition, Boolean isEnvIncluded) {
137                 int count = 0;
138                 List<HeatMetaFirstLevelDefinition> uniqeArtifactList = new ArrayList<>();
139
140                 for (TypeHeatMetaDefinition typeHeatMetaDefinition : listHeatMetaDefenition) {
141                         for (GroupHeatMetaDefinition groupHeatMetaDefinition : typeHeatMetaDefinition
142                                         .getGroupHeatMetaDefinition()) {
143                                 if (isEnvIncluded) {
144                                         count = count + groupHeatMetaDefinition.getArtifactList().size();
145                                 } else {
146                                         for (HeatMetaFirstLevelDefinition fileName : groupHeatMetaDefinition.getArtifactList()) {
147                                                 if (!fileName.getFileName().contains(".env") && !uniqeArtifactList.contains(fileName)) {
148                                                         uniqeArtifactList.add(fileName);
149                                                         count = count + 1;
150                                                 }
151                                         }
152                                 }
153                         }
154                 }
155                 return count;
156         }
157         
158         /*protected static List<TypeHeatMetaDefinition> getArtifactsByGroup(JSONObject jsonObjectImportStructure, List<TypeHeatMetaDefinition> listHeatMetaDefenition) {
159
160                 @SuppressWarnings("unchecked")
161                 Set<Object> typeSet = jsonObjectImportStructure.keySet();
162                 for (Object type : typeSet) {
163                         TypeHeatMetaDefinition heatMetaDefenition = new TypeHeatMetaDefinition();
164                         log.debug(type.toString());
165                         log.debug("{}", jsonObjectImportStructure.get(type));
166                         JSONArray array = (JSONArray) jsonObjectImportStructure.get(type);
167                         heatMetaDefenition.setTypeName((String) type);
168                         List<GroupHeatMetaDefinition> groupHeatMetaDefinitions = new ArrayList<GroupHeatMetaDefinition>();
169                         heatMetaDefenition.setGroupHeatMetaDefinition(fetchArtifactByGroupFromJsonArray(array, groupHeatMetaDefinitions, true, false));
170                         listHeatMetaDefenition.add(heatMetaDefenition);
171                 }
172                 return listHeatMetaDefenition;
173         }*/
174         
175 /*      protected static List<GroupHeatMetaDefinition> fetchArtifactByGroupFromJsonArray(JSONArray array, List<GroupHeatMetaDefinition> listGroupHeatMetaDefinition, Boolean openNewGroup, Boolean isNested) {
176
177                 GroupHeatMetaDefinition groupHeatMetaDefinition;
178
179                 if (array != null) {
180                         for (int i = 0; i < array.size(); i++) {
181                                 if (openNewGroup) {
182                                         groupHeatMetaDefinition = new GroupHeatMetaDefinition();
183                                         int groupNumber = listGroupHeatMetaDefinition.size() + 1;
184                                         log.debug("groupName={}", groupNumber);
185                                         groupHeatMetaDefinition.setGroup(groupNumber);
186                                         listGroupHeatMetaDefinition.add(groupHeatMetaDefinition);
187                                         PropertyHeatMetaDefinition propertyHeatMetaDefinition = new PropertyHeatMetaDefinition();
188                                         propertyHeatMetaDefinition.setName("isBase");
189                                         propertyHeatMetaDefinition.setValue(false);
190                                         groupHeatMetaDefinition.setPropertyHeatMetaDefinition(propertyHeatMetaDefinition);
191                                 }
192                                 groupHeatMetaDefinition = listGroupHeatMetaDefinition.get(listGroupHeatMetaDefinition.size() - 1);
193                                 JSONObject jsonObject = (JSONObject) array.get(i);
194                                 fetchArtifactByGroupFromJsonObject(listGroupHeatMetaDefinition, groupHeatMetaDefinition, jsonObject, isNested);
195                         }
196                 }
197                 return listGroupHeatMetaDefinition;
198         }*/
199         
200         
201         /*public static void fetchArtifactByGroupFromJsonObject(List<GroupHeatMetaDefinition> listGroupHeatMetaDefinition, GroupHeatMetaDefinition groupHeatMetaDefinition, JSONObject jsonObject, Boolean isNested) {
202                 @SuppressWarnings("unchecked")
203                 Set<Object> groupsKey = jsonObject.keySet();
204                 for (Object groupKey : groupsKey) {
205                         String groupKeyStr = (String) groupKey;
206                         if (groupKeyStr.equals("isBase")) {
207                                 PropertyHeatMetaDefinition propertyHeatMetaDefinition = new PropertyHeatMetaDefinition();
208                                 propertyHeatMetaDefinition.setName(groupKeyStr);
209                                 propertyHeatMetaDefinition.setValue((boolean) jsonObject.get(groupKeyStr));
210                                 if (!groupHeatMetaDefinition.getPropertyHeatMetaDefinition().equals(propertyHeatMetaDefinition)) {
211                                         groupHeatMetaDefinition.getPropertyHeatMetaDefinition().setValue((boolean) jsonObject.get(groupKeyStr));
212                                 }
213                         }
214                         if (groupKeyStr.equals("fileName")) {
215                                 String artifactName = (String) jsonObject.get(groupKeyStr);
216                                 String artifactType = ArtifactTypeEnum.HEAT_ARTIFACT.getType();
217                                 if(isNested){
218                                         artifactType = ArtifactTypeEnum.HEAT_NESTED.getType();
219                                 }
220                                 if(jsonObject.get("type") != null && isNested == false){
221                                         artifactType = (String) jsonObject.get("type");
222                                 }
223                                 HeatMetaFirstLevelDefinition heatMetaFirstLevelDefinition = new HeatMetaFirstLevelDefinition(artifactName, artifactType);
224                                 List<HeatMetaFirstLevelDefinition> listArtifactNames = groupHeatMetaDefinition.getArtifactList();
225                                 listArtifactNames.add(heatMetaFirstLevelDefinition);
226                                 groupHeatMetaDefinition.setArtifactList(listArtifactNames);
227                         } else {
228                                 if((groupKeyStr.equals("env"))){
229                                         if (jsonObject.get(groupKeyStr) instanceof JSONObject){
230                                                 fetchArtifactByGroupFromJsonObject(listGroupHeatMetaDefinition, groupHeatMetaDefinition, (JSONObject) jsonObject.get(groupKeyStr), false);
231                                         }else{
232                                                 assertTrue("Expected object is JSONObject, but actual: " + jsonObject.get(groupKeyStr).getClass(), jsonObject.get(groupKeyStr).getClass().equals("JSONObject"));
233                                         }
234                                 }
235                                 if((groupKeyStr.equals("nested"))){
236                                         if (jsonObject.get(groupKeyStr) instanceof JSONArray){
237                                                 fetchArtifactByGroupFromJsonArray((JSONArray) jsonObject.get(groupKeyStr), listGroupHeatMetaDefinition, false, true);
238                                         }else{
239                                                 assertTrue("Expected object is JSONArray, but actual: " + jsonObject.get(groupKeyStr).getClass(), jsonObject.get(groupKeyStr).getClass().equals("JSONArray"));
240                                         }
241                                         
242                                 }else if (!(groupKeyStr.equals("isBase") || groupKeyStr.equals("type") || groupKeyStr.equals("env"))) {
243                                         if (jsonObject.get(groupKeyStr) instanceof JSONArray){
244                                                 fetchArtifactByGroupFromJsonArray((JSONArray) jsonObject.get(groupKeyStr), listGroupHeatMetaDefinition, false, false);
245                                         }else{
246                                                 assertTrue("Expected object is JSONArray, but actual: " + jsonObject.get(groupKeyStr).getClass(), jsonObject.get(groupKeyStr).getClass().equals("JSONArray"));
247                                         }
248                                 }
249                         }
250                 }
251         }*/
252         
253         /*public static List<TypeHeatMetaDefinition> getListTypeHeatMetaDefinition(String csarUUID) throws Exception {
254
255                 String artifactHeatMetaLocation = "Artifacts/HEAT.meta";
256                 JSONParser parser = new JSONParser();
257                 String csarPayload = getCsarPayload(csarUUID, artifactHeatMetaLocation);
258                 if (csarPayload != null) {
259                         Object parse = parser.parse(csarPayload);
260                         JSONObject jsonObject = (JSONObject) parse;
261                         JSONObject jsonObjectImportStructure = (JSONObject) jsonObject.get("importStructure");
262                         List<TypeHeatMetaDefinition> listHeatMetaDefenition = new ArrayList<TypeHeatMetaDefinition>();
263                         listHeatMetaDefenition = getArtifactsByGroup(jsonObjectImportStructure, listHeatMetaDefenition);
264                         return listHeatMetaDefenition;
265                 }
266                 return null;
267
268         }
269
270         protected static List<TypeHeatMetaDefinition> getArtifactsByGroup(JSONObject jsonObjectImportStructure,
271                         List<TypeHeatMetaDefinition> listHeatMetaDefenition) {
272
273                 @SuppressWarnings("unchecked")
274                 Set<Object> typeSet = jsonObjectImportStructure.keySet();
275                 for (Object type : typeSet) {
276                         TypeHeatMetaDefinition heatMetaDefenition = new TypeHeatMetaDefinition();
277                         log.debug(type.toString());
278                         log.debug("{}", jsonObjectImportStructure.get(type));
279                         JSONArray array = (JSONArray) jsonObjectImportStructure.get(type);
280                         heatMetaDefenition.setTypeName((String) type);
281                         List<GroupHeatMetaDefinition> groupHeatMetaDefinitions = new ArrayList<GroupHeatMetaDefinition>();
282                         heatMetaDefenition.setGroupHeatMetaDefinition(fetchArtifactByGroup(array, groupHeatMetaDefinitions, true));
283                         listHeatMetaDefenition.add(heatMetaDefenition);
284                 }
285                 return listHeatMetaDefenition;
286         }
287
288         protected static List<GroupHeatMetaDefinition> fetchArtifactByGroup(JSONArray array,
289                         List<GroupHeatMetaDefinition> listGroupHeatMetaDefinition, Boolean openNewGroup) {
290
291                 GroupHeatMetaDefinition groupHeatMetaDefinition;
292
293                 if (array != null) {
294                         for (int i = 0; i < array.size(); i++) {
295                                 if (openNewGroup) {
296                                         groupHeatMetaDefinition = new GroupHeatMetaDefinition();
297                                         int groupNumber = listGroupHeatMetaDefinition.size() + 1;
298                                         log.debug("groupName={}", groupNumber);
299                                         groupHeatMetaDefinition.setGroup(groupNumber);
300                                         listGroupHeatMetaDefinition.add(groupHeatMetaDefinition);
301                                         PropertyHeatMetaDefinition propertyHeatMetaDefinition = new PropertyHeatMetaDefinition();
302                                         propertyHeatMetaDefinition.setName("isBase");
303                                         propertyHeatMetaDefinition.setValue(false);
304                                         groupHeatMetaDefinition.setPropertyHeatMetaDefinition(propertyHeatMetaDefinition);
305                                 }
306                                 groupHeatMetaDefinition = listGroupHeatMetaDefinition.get(listGroupHeatMetaDefinition.size() - 1);
307                                 JSONObject jsonObject = (JSONObject) array.get(i);
308                                 @SuppressWarnings("unchecked")
309                                 Set<Object> groupsKey = jsonObject.keySet();
310                                 for (Object groupKey : groupsKey) {
311                                         String groupKeyStr = (String) groupKey;
312                                         if (groupKeyStr.equals("isBase")) {
313                                                 PropertyHeatMetaDefinition propertyHeatMetaDefinition = new PropertyHeatMetaDefinition();
314                                                 propertyHeatMetaDefinition.setName(groupKeyStr);
315                                                 propertyHeatMetaDefinition.setValue((boolean) jsonObject.get(groupKeyStr));
316                                                 if (!groupHeatMetaDefinition.getPropertyHeatMetaDefinition()
317                                                                 .equals(propertyHeatMetaDefinition)) {
318                                                         groupHeatMetaDefinition.getPropertyHeatMetaDefinition()
319                                                                         .setValue((boolean) jsonObject.get(groupKeyStr));
320                                                 }
321                                         }
322                                         if (groupKeyStr.equals("fileName") || groupKeyStr.equals("env")) {
323                                                 String artifactName = (String) jsonObject.get(groupKeyStr);
324                                                 List<String> listArtifactNames = groupHeatMetaDefinition.getArtifactList();
325                                                 listArtifactNames.add(artifactName);
326                                                 groupHeatMetaDefinition.setArtifactList(listArtifactNames);
327                                         } else {
328                                                 if (!groupKeyStr.equals("isBase")) {
329                                                         fetchArtifactByGroup((JSONArray) jsonObject.get(groupKeyStr), listGroupHeatMetaDefinition,
330                                                                         false);
331                                                 }
332                                         }
333                                 }
334                         }
335                 }
336                 return listGroupHeatMetaDefinition;
337         }
338
339         private static Integer getArtifactCount(List<TypeHeatMetaDefinition> listHeatMetaDefenition,
340                         Boolean isEnvIncluded) {
341                 int count = 0;
342                 List<String> uniqeArtifactList = new ArrayList<>();
343
344                 for (TypeHeatMetaDefinition typeHeatMetaDefinition : listHeatMetaDefenition) {
345                         for (GroupHeatMetaDefinition groupHeatMetaDefinition : typeHeatMetaDefinition
346                                         .getGroupHeatMetaDefinition()) {
347                                 if (isEnvIncluded) {
348                                         count = count + groupHeatMetaDefinition.getArtifactList().size();
349                                 } else {
350                                         for (String fileName : groupHeatMetaDefinition.getArtifactList()) {
351                                                 if (!fileName.contains(".env") && !uniqeArtifactList.contains(fileName)) {
352                                                         uniqeArtifactList.add(fileName);
353                                                         count = count + 1;
354                                                 }
355                                         }
356                                 }
357                         }
358                 }
359                 return count;
360         }
361
362         private static Integer getGroupCount(List<TypeHeatMetaDefinition> listHeatMetaDefenition) {
363                 int count = 0;
364                 for (TypeHeatMetaDefinition typeHeatMetaDefinition : listHeatMetaDefenition) {
365                         count = count + typeHeatMetaDefinition.getGroupHeatMetaDefinition().size();
366                 }
367                 return count;
368         }
369
370         private static String groupNameBuilder(Resource resource) {
371                 String separator = "::";
372                 String module = "module-";
373                 String groupName = resource.getSystemName() + separator + module;
374                 return groupName;
375         }
376
377         public static void validateCsarVfArtifact(String csarUUID, Resource resource) throws Exception {
378
379                 List<TypeHeatMetaDefinition> listTypeHeatMetaDefinition = getListTypeHeatMetaDefinition(csarUUID);
380                 assertTrue(
381                                 "check group count, expected: " + getGroupCount(listTypeHeatMetaDefinition) + ", actual: "
382                                                 + resource.getGroups().size(),
383                                 getGroupCount(listTypeHeatMetaDefinition) == resource.getGroups().size());
384                 assertTrue(
385                                 "check artifact count, expected: " + getArtifactCount(listTypeHeatMetaDefinition, false) + ", actual: "
386                                                 + resource.getDeploymentArtifacts().size(),
387                                 getArtifactCount(listTypeHeatMetaDefinition, false) == resource.getDeploymentArtifacts().size());
388
389         }
390
391         public static void validateToscaDefinitonObjectVsResource(ToscaDefinition toscaDefinition, Resource resource)
392                         throws Exception {
393
394                 assertTrue(
395                                 "check resource instance count, expected: " + getResourceInstanceCount(toscaDefinition) + ", actual: "
396                                                 + resource.getComponentInstances().size(),
397                                 getResourceInstanceCount(toscaDefinition) == resource.getComponentInstances().size());
398                 assertTrue(
399                                 "check resource instance relation count, expected: " + getResourceInstanceRelationCount(toscaDefinition)
400                                                 + ", actual: " + resource.getComponentInstancesRelations().size(),
401                                 getResourceInstanceRelationCount(toscaDefinition) == resource.getComponentInstancesRelations().size());
402
403         }
404
405         public static Integer getResourceInstanceCount(ToscaDefinition toscaDefinition) {
406
407                 return toscaDefinition.getTopology_template().getNode_templates().size();
408         }
409
410         public static Integer getResourceInstanceRelationCount(ToscaDefinition toscaDefinition) {
411                 int count = 0;
412 //              List<ToscaNodeTemplatesTopologyTemplateDefinition> toscaNodeTemplatesTopologyTemplateDefinition = toscaDefinition
413 //                              .getTopology_template().getToscaNodeTemplatesTopologyTemplateDefinition();
414                 Map<String,ToscaNodeTemplatesTopologyTemplateDefinition> toscaNodeTemplatesTopologyTemplateDefinition = toscaDefinition.getTopology_template().getNode_templates();
415                 for (int i = 0; i < toscaNodeTemplatesTopologyTemplateDefinition.size(); i++) {
416 //                      List<ToscaRequirementsNodeTemplatesDefinition> requirements = toscaNodeTemplatesTopologyTemplateDefinition.get(i).getRequirements();
417                         
418                         for(Entry entry: toscaDefinition.getTopology_template().getNode_templates().entrySet() ){
419                                 if (entry.getValue().equals("requirements")){
420                                         
421                                 }
422                         }
423                         
424                         if (requirements != null) {
425                                 for (ToscaRequirementsNodeTemplatesDefinition requirement : requirements) {
426                                         if (requirement.getNode() != null) {
427                                                 count = count + 1;
428                                         }
429                                 }
430                         }
431                 }
432                 return count;
433         }
434
435         // not finished yet
436         private static void validateCsarVfgroup(String csarUUID, Resource resource) {
437
438                 List<GroupDefinition> groups = resource.getGroups();
439                 for (GroupDefinition groupDefinition : groups) {
440                         List<String> artifacts = groupDefinition.getArtifacts();
441                         assertTrue("group description is null", groupDefinition.getDescription() != null);
442                         assertTrue("InvariantUUID is null", groupDefinition.getInvariantUUID() != null);
443                         // groupDefinition.getMembers();
444                         assertTrue(
445                                         "name format mismatch, expected: " + groupNameBuilder(resource) + "[0-9], actual: "
446                                                         + groupDefinition.getName(),
447                                         groupDefinition.getName().contains(groupNameBuilder(resource)));
448                         // groupDefinition.getProperties();
449                         // groupDefinition.getPropertyValueCounter();
450                         assertTrue(groupDefinition.getType().equals(getGroupType()));
451                 }
452
453                 String expectedCsarUUID = csarUUID;
454                 // String expectedToscaResourceName = "org.openecomp.resource.vf." +
455                 // WordUtils.capitalize(resourceDetails.getName().toLowerCase());
456                 //
457                 // assertTrue("csarUUID : " + buildAssertMessage(expectedCsarUUID,
458                 // resource.getCsarUUID()),
459                 // expectedCsarUUID.equals(resource.getCsarUUID()));
460                 // assertTrue("toscaResourceName : " +
461                 // buildAssertMessage(expectedToscaResourceName,
462                 // resource.getToscaResourceName()),
463                 // expectedToscaResourceName.equals(resource.getToscaResourceName()));
464                 //
465                 // RestResponse getResourceResponse =
466                 // ResourceRestUtils.getResource(resource.getUniqueId());
467                 // Resource getResource =
468                 // ResponseParser.parseToObjectUsingMapper(getResourceResponse.getResponse(),
469                 // Resource.class);
470                 // assertTrue("csarUUID : " + buildAssertMessage(expectedCsarUUID,
471                 // getResource.getCsarUUID()),
472                 // expectedCsarUUID.equals(getResource.getCsarUUID()));
473                 // assertTrue("toscaResourceName : " +
474                 // buildAssertMessage(expectedToscaResourceName,
475                 // getResource.getToscaResourceName()),
476                 // expectedToscaResourceName.equals(getResource.getToscaResourceName()));
477
478         }
479
480         private static String getGroupType() {
481                 return "org.openecomp.groups.VfModule";
482         }
483 */
484
485         
486         
487         
488 }