public static Map getBodyWithIds()

in src/main/java/platform/qa/base/convertors/RestApiConvertor.java [67:85]


    public static Map<String, Object> getBodyWithIds(Map<String, String> queryParams, List<Request> context) {
        Map<String, Object> bodyWithIds = new HashMap<>(getQueryParamsWithIds(queryParams, context));

        //For array inside parameters
        queryParams.entrySet().stream()
                .filter(param -> isNotEmpty(substringBetween(param.getValue(), "[", "]")))
                .forEach(param -> {
                    var value = substringBetween(param.getValue(), "[", "]");
                    var requests = context.stream()
                            .filter(request -> request.isResultContainsKey(value))
                            .collect(Collectors.toList());
                    if (CollectionUtils.isNotEmpty(requests)) {
                        bodyWithIds.replace(param.getKey(),
                                requests.stream()
                                        .map(request -> request.getResultValueByKey(value)).collect(Collectors.toList()));
                    }
                });
        return bodyWithIds;
    }