use of com.mercedesbenz.sechub.integrationtest.internal.TestJSONHelper in project sechub by mercedes-benz.
the class DeveloperAdministration method fetchProjectWhiteList.
public List<String> fetchProjectWhiteList(String projectId) {
List<String> result = new ArrayList<>();
String json = getRestHelper().getJSON(getUrlBuilder().buildAdminFetchProjectInfoUrl(projectId));
TestJSONHelper jsonHelper = TestJSONHelper.get();
JsonNode jsonNode = jsonHelper.readTree(json);
JsonNode whitelist = jsonNode.get("whiteList");
if (whitelist instanceof ArrayNode) {
ArrayNode arrayNode = (ArrayNode) whitelist;
for (JsonNode node : arrayNode) {
String uriText = node.textValue();
if (!uriText.trim().isEmpty()) {
result.add(uriText);
}
}
}
return result;
}
Aggregations