2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.openecomp.sdc.ci.tests.utils.rest;
23 import static org.testng.AssertJUnit.assertNotNull;
24 import static org.testng.AssertJUnit.assertTrue;
26 import java.io.IOException;
27 import java.util.ArrayList;
28 import java.util.HashMap;
29 import java.util.List;
31 import java.util.Map.Entry;
33 import org.apache.http.HttpResponse;
34 import org.apache.http.client.methods.HttpGet;
35 import org.apache.http.impl.client.CloseableHttpClient;
36 import org.apache.http.impl.client.HttpClients;
37 import org.codehaus.jackson.map.ObjectMapper;
38 import org.openecomp.sdc.be.datatypes.enums.AssetTypeEnum;
39 import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
40 import org.openecomp.sdc.be.model.ArtifactDefinition;
41 import org.openecomp.sdc.be.model.Component;
42 import org.openecomp.sdc.be.model.ComponentInstance;
43 import org.openecomp.sdc.be.model.Resource;
44 import org.openecomp.sdc.be.model.Service;
45 import org.openecomp.sdc.ci.tests.api.Urls;
46 import org.openecomp.sdc.ci.tests.config.Config;
47 import org.openecomp.sdc.ci.tests.datatypes.ArtifactAssetStructure;
48 import org.openecomp.sdc.ci.tests.datatypes.AssetStructure;
49 import org.openecomp.sdc.ci.tests.datatypes.ResourceAssetStructure;
50 import org.openecomp.sdc.ci.tests.datatypes.ResourceDetailedAssetStructure;
51 import org.openecomp.sdc.ci.tests.datatypes.ResourceInstanceAssetStructure;
52 import org.openecomp.sdc.ci.tests.datatypes.ServiceAssetStructure;
53 import org.openecomp.sdc.ci.tests.datatypes.ServiceDetailedAssetStructure;
54 import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
55 import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
56 import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
57 import org.openecomp.sdc.ci.tests.utils.Utils;
58 import org.slf4j.Logger;
59 import org.slf4j.LoggerFactory;
61 import com.google.gson.Gson;
62 import com.google.gson.JsonArray;
63 import com.google.gson.JsonElement;
64 import com.google.gson.JsonObject;
65 import com.google.gson.JsonParser;
67 public class AssetRestUtils extends BaseRestUtils {
68 static Gson gson = new Gson();
69 static ObjectMapper objectMapper = new ObjectMapper();
71 static Logger logger = LoggerFactory.getLogger(UserRestUtils.class.getName());
72 static final String contentTypeHeaderData = "application/json";
73 static final String acceptHeaderDate = "application/json";
74 static final String basicAuthentication = "Basic Y2k6MTIzNDU2";
75 // /asdc/v1/catalog/{services/resources}/{componentUUID}/artifacts/{artifactUUID}
76 static final String COMPONENT_ARTIFACT_URL = "/asdc/v1/catalog/%s/%s/artifacts/%s";
77 // /asdc/v1/catalog/{services/resources}/{componentUUID}/resourceInstances/{resourceInstanceName}/artifacts/{artifactUUID}
78 static final String RESOURCE_INSTANCE_ARTIFACT_URL = "/asdc/v1/catalog/%s/%s/resourceInstances/%s/artifacts/%s";
80 public static HttpResponse getComponentToscaModel(AssetTypeEnum assetType, String uuid) throws IOException {
81 Config config = Utils.getConfig();
82 CloseableHttpClient httpclient = HttpClients.createDefault();
83 String url = String.format(Urls.GET_TOSCA_MODEL, config.getCatalogBeHost(), config.getCatalogBePort(),
84 assetType.getValue(), uuid);
85 HttpGet httpGet = new HttpGet(url);
87 httpGet.addHeader(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), "ci");
88 httpGet.addHeader(HttpHeaderEnum.AUTHORIZATION.getValue(), basicAuthentication);
90 logger.debug("Send GET request to get Tosca model: {}", url);
92 return httpclient.execute(httpGet);
95 public static RestResponse getComponentListByAssetType(boolean isBasicAuthentication, AssetTypeEnum assetType,
96 String... filterArrayString) throws IOException {
97 Config config = Utils.getConfig();
98 Map<String, String> headersMap = new HashMap<String, String>();
99 headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
100 headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
101 if (isBasicAuthentication) {
102 headersMap.put(HttpHeaderEnum.AUTHORIZATION.getValue(), basicAuthentication);
104 headersMap.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), "ci");
106 HttpRequest http = new HttpRequest();
107 String url = String.format(Urls.GET_ASSET_LIST, config.getCatalogBeHost(), config.getCatalogBePort(),
108 assetType.getValue());
109 if (filterArrayString != null && filterArrayString.length > 0) {
110 url = buildUrlWithFilter(url, filterArrayString);
113 RestResponse sendGetResourceAssets = http.httpSendGet(url, headersMap);
115 return sendGetResourceAssets;
118 public static RestResponse getFilteredComponentList(AssetTypeEnum assetType, String query) throws IOException {
119 Config config = Utils.getConfig();
120 Map<String, String> headersMap = new HashMap<String, String>();
121 headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
122 headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
123 headersMap.put(HttpHeaderEnum.AUTHORIZATION.getValue(), basicAuthentication);
124 headersMap.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), "ci");
126 HttpRequest http = new HttpRequest();
128 String url = String.format(Urls.GET_FILTERED_ASSET_LIST, config.getCatalogBeHost(), config.getCatalogBePort(),
129 assetType.getValue(), query);
131 logger.debug("Send GET request to get Resource Assets: {}", url);
132 logger.debug("Request headers: {}", headersMap);
134 RestResponse sendGetResourceAssets = http.httpSendGet(url, headersMap);
136 return sendGetResourceAssets;
139 public static String buildUrlWithFilter(String url, String[] filterArrayString) {
140 StringBuilder sb = new StringBuilder();
141 int length = filterArrayString.length;
143 for (String filterString : filterArrayString) {
144 sb.append(filterString);
146 if (length != count) {
150 return url + "?" + sb;
153 public static RestResponse getAssetMetadataByAssetTypeAndUuid(boolean isBasicAuthentication,
154 AssetTypeEnum assetType, String uuid) throws IOException {
156 Config config = Utils.getConfig();
157 Map<String, String> headersMap = new HashMap<String, String>();
158 headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), contentTypeHeaderData);
159 headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate);
160 if (isBasicAuthentication) {
161 headersMap.put(HttpHeaderEnum.AUTHORIZATION.getValue(), basicAuthentication);
163 headersMap.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), "ci");
165 HttpRequest http = new HttpRequest();
166 String url = String.format(Urls.GET_ASSET_METADATA, config.getCatalogBeHost(), config.getCatalogBePort(),
167 assetType.getValue(), uuid);
169 logger.debug("Send GET request to get Resource Assets: {}", url);
170 logger.debug("Request headers: {} ", headersMap);
172 RestResponse sendGetResourceAssets = http.httpSendGet(url, headersMap);
174 return sendGetResourceAssets;
177 public static List<ResourceAssetStructure> getResourceAssetList(RestResponse assetResponse) {
178 List<ResourceAssetStructure> resourceAssetList = new ArrayList<>();
180 JsonElement jelement = new JsonParser().parse(assetResponse.getResponse());
181 JsonArray componenetArray = (JsonArray) jelement;
182 for (JsonElement jElement : componenetArray) {
183 ResourceAssetStructure resource = gson.fromJson(jElement, ResourceAssetStructure.class);
184 resourceAssetList.add(resource);
186 return resourceAssetList;
189 public static ResourceDetailedAssetStructure getResourceAssetMetadata(RestResponse assetResponse) {
191 List<ResourceInstanceAssetStructure> resourcesList = new ArrayList<>();
192 List<ArtifactAssetStructure> artifactsList = new ArrayList<>();
193 ResourceDetailedAssetStructure resourceAssetMetadata = new ResourceDetailedAssetStructure();
194 String response = assetResponse.getResponse();
196 JsonObject jObject = (JsonObject) new JsonParser().parse(response);
197 resourceAssetMetadata = gson.fromJson(jObject, ResourceDetailedAssetStructure.class);
199 setResourceInstanceAssetList(resourcesList, jObject);
200 resourceAssetMetadata.setResources(resourcesList);
202 setArtifactAssetList(artifactsList, jObject);
203 resourceAssetMetadata.setArtifacts(artifactsList);
205 return resourceAssetMetadata;
208 public static void generalMetadataFieldsValidatior(AssetStructure assetMetadata, Component component) {
210 assertTrue("Expected resourceUuid is " + component.getUUID() + " actual: " + assetMetadata.getUuid(),
211 assetMetadata.getUuid().equals(component.getUUID()));
213 "Expected resourceInvariantUuid is " + component.getInvariantUUID() + " actual: "
214 + assetMetadata.getInvariantUUID(),
215 assetMetadata.getInvariantUUID().equals(component.getInvariantUUID()));
216 assertTrue("Expected asset name is " + component.getName() + " actual: " + assetMetadata.getName(),
217 assetMetadata.getName().equals(component.getName()));
218 assertTrue("Expected asset version is " + component.getVersion() + " actual: " + assetMetadata.getVersion(),
219 assetMetadata.getVersion().equals(component.getVersion()));
221 "Expected asset lastUpdaterUserId is " + component.getLastUpdaterUserId() + " actual: "
222 + assetMetadata.getLastUpdaterUserId(),
223 assetMetadata.getLastUpdaterUserId().equals(component.getLastUpdaterUserId()));
224 assertNotNull("Expected asset toscaModel is null", assetMetadata.getToscaModelURL());
226 "Expected asset category is " + component.getCategories().get(0).getName() + " actual: "
227 + assetMetadata.getCategory(),
228 assetMetadata.getCategory().equals(component.getCategories().get(0).getName()));
230 "Expected asset lifeCycleState is " + component.getLifecycleState() + " actual: "
231 + assetMetadata.getLifecycleState(),
232 assetMetadata.getLifecycleState().equals(component.getLifecycleState().toString()));
236 public static void resourceMetadataValidatior(ResourceDetailedAssetStructure resourceAssetMetadata,
237 Resource resource, AssetTypeEnum assetType) {
239 generalMetadataFieldsValidatior(resourceAssetMetadata, resource);
241 "Expected asset lastUpdaterFullName is " + resource.getLastUpdaterFullName() + " actual: "
242 + resourceAssetMetadata.getLastUpdaterFullName(),
243 resourceAssetMetadata.getLastUpdaterFullName().equals(resource.getLastUpdaterFullName()));
245 "Expected asset subCategory is " + resource.getCategories().get(0).getSubcategories().get(0).getName()
246 + " actual: " + resourceAssetMetadata.getSubCategory(),
247 resourceAssetMetadata.getSubCategory()
248 .equals(resource.getCategories().get(0).getSubcategories().get(0).getName()));
250 "Expected asset toscaResourceName is " + resource.getToscaResourceName() + " actual: "
251 + resourceAssetMetadata.getToscaResourceName(),
252 resourceAssetMetadata.getToscaResourceName().equals(resource.getToscaResourceName()));
254 "Expected asset resourceType is " + resource.getResourceType() + " actual: "
255 + resourceAssetMetadata.getResourceType(),
256 resourceAssetMetadata.getResourceType().equals(resource.getResourceType().toString()));
257 resourceInstanceAssetValidator(resourceAssetMetadata.getResources(), resource, assetType);
258 // resourceInstanceAssetValidator(resourceAssetMetadata.getResources(),
260 artifactAssetValidator(resourceAssetMetadata.getArtifacts(), resource, assetType);
264 public static void serviceMetadataValidatior(ServiceDetailedAssetStructure serviceAssetMetadata, Service service,
265 AssetTypeEnum assetType) {
267 generalMetadataFieldsValidatior(serviceAssetMetadata, service);
269 "Expected asset lastUpdaterFullName is " + service.getLastUpdaterFullName() + " actual: "
270 + serviceAssetMetadata.getLastUpdaterFullName(),
271 serviceAssetMetadata.getLastUpdaterFullName().equals(service.getLastUpdaterFullName()));
273 "Expected asset distributionStatus is " + service.getDistributionStatus() + " actual: "
274 + serviceAssetMetadata.getDistributionStatus(),
275 serviceAssetMetadata.getDistributionStatus().equals(service.getDistributionStatus().toString()));
276 resourceInstanceAssetValidator(serviceAssetMetadata.getResources(), service, assetType);
277 // resourceInstanceAssetValidator(serviceAssetMetadata.getResources(),
279 artifactAssetValidator(serviceAssetMetadata.getArtifacts(), service, assetType);
283 private static void artifactAssetValidator(List<ArtifactAssetStructure> artifactAssetStructureList,
284 Component component, AssetTypeEnum assetType) {
285 Map<String, ArtifactDefinition> componentDeploymentArtifacts = component.getDeploymentArtifacts();
286 validateArtifactMetadata(componentDeploymentArtifacts, artifactAssetStructureList, component.getUUID(),
290 private static void validateArtifactMetadata(Map<String, ArtifactDefinition> componentDeploymentArtifacts,
291 List<ArtifactAssetStructure> artifactAssetStructureList, String componentUuid, AssetTypeEnum assetType,
292 String resourceInstanceName) {
294 for (Entry<String, ArtifactDefinition> componentDeploymentArtifact : componentDeploymentArtifacts.entrySet()) {
295 ArtifactAssetStructure artifactAssetStructure = getArtifactMetadata(artifactAssetStructureList,
296 componentDeploymentArtifact.getValue().getArtifactUUID());
297 ArtifactDefinition componentDeploymentArtifactValue = componentDeploymentArtifact.getValue();
298 if (artifactAssetStructure != null) {
300 "Expected artifact asset artifactName is " + componentDeploymentArtifactValue.getArtifactName()
301 + " actual: " + artifactAssetStructure.getArtifactName(),
302 componentDeploymentArtifactValue.getArtifactName()
303 .equals(artifactAssetStructure.getArtifactName()));
305 "Expected artifact asset Type is " + componentDeploymentArtifactValue.getArtifactType()
306 + " actual: " + artifactAssetStructure.getArtifactType(),
307 componentDeploymentArtifactValue.getArtifactType()
308 .equals(artifactAssetStructure.getArtifactType()));
309 // assertNotNull("Expected artifact asset resourceInvariantUUID
311 // resourceInstanceAssetStructure.getResourceInvariantUUID());
312 // String expectedArtifactUrl = "/asdc/v1/catalog/" +
313 // assetType.getValue() + "/" + componentUuid + "/artifacts/" +
314 // componentDeploymentArtifactValue.getArtifactUUID();
315 String expectedArtifactUrl = "";
316 if (resourceInstanceName == null) {
317 expectedArtifactUrl = String.format(COMPONENT_ARTIFACT_URL, assetType.getValue(), componentUuid,
318 componentDeploymentArtifactValue.getArtifactUUID());
320 expectedArtifactUrl = String.format(RESOURCE_INSTANCE_ARTIFACT_URL, assetType.getValue(),
321 componentUuid, resourceInstanceName, componentDeploymentArtifactValue.getArtifactUUID());
325 "Expected artifact asset URL is " + expectedArtifactUrl + " actual: "
326 + artifactAssetStructure.getArtifactURL(),
327 artifactAssetStructure.getArtifactURL().equals(expectedArtifactUrl));
329 "Expected artifact asset description is " + componentDeploymentArtifactValue.getDescription()
330 + " actual: " + artifactAssetStructure.getArtifactDescription(),
331 componentDeploymentArtifactValue.getDescription().toString()
332 .equals(artifactAssetStructure.getArtifactDescription()));
334 "Expected artifact asset checkSum is " + componentDeploymentArtifactValue.getArtifactChecksum()
335 + " actual: " + artifactAssetStructure.getArtifactChecksum(),
336 componentDeploymentArtifactValue.getArtifactChecksum()
337 .equals(artifactAssetStructure.getArtifactChecksum()));
339 "Expected artifact asset version is " + componentDeploymentArtifactValue.getArtifactVersion()
340 + " actual: " + artifactAssetStructure.getArtifactVersion(),
341 componentDeploymentArtifactValue.getArtifactVersion()
342 .equals(artifactAssetStructure.getArtifactVersion()));
343 if (componentDeploymentArtifactValue.getTimeout() > 0) {
345 "Expected artifact asset timeout is " + componentDeploymentArtifactValue.getTimeout()
346 + " actual: " + artifactAssetStructure.getArtifactTimeout(),
347 componentDeploymentArtifactValue.getTimeout()
348 .equals(artifactAssetStructure.getArtifactTimeout()));
352 assertTrue("artifact asset with UUID" + componentDeploymentArtifact.getValue().getArtifactUUID()
353 + " not found in get Metadata response", false);
359 private static ArtifactAssetStructure getArtifactMetadata(List<ArtifactAssetStructure> artifactAssetStructureList,
360 String artifactUUID) {
361 for (ArtifactAssetStructure artifactAssetStructure : artifactAssetStructureList) {
362 if (artifactAssetStructure.getArtifactUUID().equals(artifactUUID)) {
363 return artifactAssetStructure;
369 private static void resourceInstanceAssetValidator(
370 List<ResourceInstanceAssetStructure> resourceInstanceAssetStructures, Component component,
371 AssetTypeEnum assetType) {
373 List<ComponentInstance> componentInstances = component.getComponentInstances();
374 if (componentInstances != null) {
375 for (ComponentInstance componentInstance : componentInstances) {
376 ResourceInstanceAssetStructure resourceInstanceAssetStructure = getResourceInstanceMetadata(
377 resourceInstanceAssetStructures, componentInstance.getName());
378 if (resourceInstanceAssetStructure != null) {
380 "Expected RI asset resourceName is " + componentInstance.getComponentName() + " actual: "
381 + resourceInstanceAssetStructure.getResourceName(),
382 componentInstance.getComponentName()
383 .equals(resourceInstanceAssetStructure.getResourceName()));
385 "Expected RI asset Name is " + componentInstance.getName() + " actual: "
386 + resourceInstanceAssetStructure.getResourceInstanceName(),
387 componentInstance.getName()
388 .equals(resourceInstanceAssetStructure.getResourceInstanceName()));
389 assertNotNull("Expected RI asset resourceInvariantUUID is null",
390 resourceInstanceAssetStructure.getResourceInvariantUUID());
392 "Expected RI asset resourceVersion is " + componentInstance.getComponentVersion()
393 + " actual: " + resourceInstanceAssetStructure.getResourceVersion(),
394 componentInstance.getComponentVersion()
395 .equals(resourceInstanceAssetStructure.getResourceVersion()));
397 "Expected RI asset resourceType is " + componentInstance.getOriginType() + " actual: "
398 + resourceInstanceAssetStructure.getResourceType(),
399 componentInstance.getOriginType().toString()
400 .equals(resourceInstanceAssetStructure.getResourceType()));
402 "Expected RI asset resourceUUID is " + componentInstance.getComponentUid() + " actual: "
403 + resourceInstanceAssetStructure.getResourceUUID(),
404 componentInstance.getComponentUid()
405 .equals(resourceInstanceAssetStructure.getResourceUUID()));
406 validateArtifactMetadata(componentInstance.getDeploymentArtifacts(),
407 resourceInstanceAssetStructure.getArtifacts(), component.getUUID(), assetType,
408 componentInstance.getNormalizedName());
409 // validateArtifactMetadata(componentInstance.getDeploymentArtifacts(),
410 // resourceInstanceAssetStructure.getArtifacts(),
411 // component.getUUID(), AssetTypeEnum.RESOURCES);
413 assertTrue("resourceInstance asset with UUID" + componentInstance.getComponentUid()
414 + " not found in get Metadata response", false);
421 // private static ResourceInstanceAssetStructure
422 // getResourceInstanceMetadata(List<ResourceInstanceAssetStructure>
423 // resourceInstanceAssetStructures, String componentUid) {
424 private static ResourceInstanceAssetStructure getResourceInstanceMetadata(
425 List<ResourceInstanceAssetStructure> resourceInstanceAssetStructures, String name) {
426 for (ResourceInstanceAssetStructure resourceInstanceAssetStructure : resourceInstanceAssetStructures) {
427 if (resourceInstanceAssetStructure.getResourceInstanceName().equals(name)) {
428 return resourceInstanceAssetStructure;
434 public static ServiceDetailedAssetStructure getServiceAssetMetadata(RestResponse assetResponse) {
436 List<ResourceInstanceAssetStructure> resourcesList = new ArrayList<>();
437 List<ArtifactAssetStructure> artifactsList = new ArrayList<>();
438 ServiceDetailedAssetStructure serviceAssetMetadata;
440 JsonObject jObject = (JsonObject) new JsonParser().parse(assetResponse.getResponse());
441 serviceAssetMetadata = gson.fromJson(jObject, ServiceDetailedAssetStructure.class);
443 setResourceInstanceAssetList(resourcesList, jObject);
444 serviceAssetMetadata.setResources(resourcesList);
446 setArtifactAssetList(artifactsList, jObject);
447 serviceAssetMetadata.setArtifacts(artifactsList);
449 return serviceAssetMetadata;
452 public static void setArtifactAssetList(List<ArtifactAssetStructure> artifactsList, JsonObject jObject) {
453 JsonArray artifactsArray = jObject.getAsJsonArray("artifacts");
454 if (artifactsArray != null) {
455 for (JsonElement jElement : artifactsArray) {
456 ArtifactAssetStructure artifact = gson.fromJson(jElement, ArtifactAssetStructure.class);
457 artifactsList.add(artifact);
462 public static void setResourceInstanceAssetList(List<ResourceInstanceAssetStructure> resourcesList,
463 JsonObject jObject) {
464 JsonArray resourcesArray = jObject.getAsJsonArray("resources");
465 if (resourcesArray != null) {
466 for (JsonElement jElement : resourcesArray) {
467 ResourceInstanceAssetStructure resource = gson.fromJson(jElement, ResourceInstanceAssetStructure.class);
468 resourcesList.add(resource);
473 public static List<ServiceAssetStructure> getServiceAssetList(RestResponse assetResponse) {
474 List<ServiceAssetStructure> serviceAssetList = new ArrayList<>();
476 JsonElement jelement = new JsonParser().parse(assetResponse.getResponse());
477 JsonArray componenetArray = (JsonArray) jelement;
478 for (JsonElement jElement : componenetArray) {
479 ServiceAssetStructure service = gson.fromJson(jElement, ServiceAssetStructure.class);
480 serviceAssetList.add(service);
482 return serviceAssetList;
485 public static List<String> getResourceNamesList(List<ResourceAssetStructure> resourceAssetList) {
486 List<String> assetNamesList = new ArrayList<>();
487 for (ResourceAssetStructure resourceAsset : resourceAssetList) {
488 assetNamesList.add(resourceAsset.getName());
490 return assetNamesList;
493 public static List<String> getServiceNamesList(List<ServiceAssetStructure> serviceAssetList) {
494 List<String> assetNamesList = new ArrayList<>();
495 for (ServiceAssetStructure serviceAsset : serviceAssetList) {
496 assetNamesList.add(serviceAsset.getName());
498 return assetNamesList;
501 public static void checkResourceTypeInObjectList(List<ResourceAssetStructure> resourceAssetList,
502 ResourceTypeEnum resourceType) {
503 for (ResourceAssetStructure resourceAsset : resourceAssetList) {
505 "Expected resourceType is " + resourceType.toString() + " actual: "
506 + resourceAsset.getResourceType(),
507 resourceAsset.getResourceType().equals(resourceType.toString()));