diff options
author | 2017-12-10 18:55:03 +0200 | |
---|---|---|
committer | 2017-12-10 19:33:38 +0200 | |
commit | 51d50f0ef642e0f996a1c8b8d2ef4838bdfec892 (patch) | |
tree | 3ac236a864d74d19b0f5c9020891a7a7e5c31b44 /ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/RestCDUtils.java | |
parent | b5cc2e0695f195716d6ccdc65e73807a6632ec70 (diff) |
Final commit to master merge from
Change-Id: Ib464f9a8828437c86fe6def8af238aaf83473507
Issue-ID: SDC-714
Signed-off-by: Tal Gitelman <tg851x@intl.att.com>
Diffstat (limited to 'ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/RestCDUtils.java')
-rw-r--r-- | ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/RestCDUtils.java | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/RestCDUtils.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/RestCDUtils.java index b2bad99d2a..aa219d0d12 100644 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/RestCDUtils.java +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/RestCDUtils.java @@ -32,7 +32,6 @@ import java.util.Map; import java.util.stream.Collectors; import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jettison.json.JSONArray; import org.codehaus.jettison.json.JSONObject; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.model.Component; @@ -253,23 +252,26 @@ public class RestCDUtils { final String userId = defaultAdminUser.getUserId(); List<Component> resourcesArrayList = map.get("products"); - List<String> collect = resourcesArrayList.stream().filter(s -> s.getName().startsWith("Ci")).map(e -> e.getUniqueId()) - .collect(Collectors.toList()); + List<String> collect = resourcesArrayList.stream().filter(s -> s.getName().startsWith(ElementFactory.getProductPrefix())). + map(e -> e.getUniqueId()). + collect(Collectors.toList()); for (String uId : collect) { ProductRestUtils.deleteProduct(uId, userId); } resourcesArrayList = map.get("services"); - collect = resourcesArrayList.stream().filter(s -> s.getName().startsWith("ci")).map(e -> e.getUniqueId()) - .collect(Collectors.toList()); + collect = resourcesArrayList.stream().filter(s -> s.getName().startsWith(ElementFactory.getServicePrefix())). + map(e -> e.getUniqueId()). + collect(Collectors.toList()); for (String uId : collect) { ServiceRestUtils.markServiceToDelete(uId, userId); } ServiceRestUtils.deleteMarkedServices(userId); resourcesArrayList = map.get("resources"); - collect = resourcesArrayList.stream().filter(s -> s.getName().startsWith("ci")) - .map(e -> e.getUniqueId()).collect(Collectors.toList()); + collect = resourcesArrayList.stream().filter(s -> s.getName().startsWith(ElementFactory.getResourcePrefix())). + map(e -> e.getUniqueId()). + collect(Collectors.toList()); for (String uId : collect) { ResourceRestUtils.markResourceToDelete(uId, userId); } |