- List<String> policiesList = new ArrayList<>();
- JSONArray policiesArray = new JSONArray(policiesString);
- for (int i = 0; i < policiesArray.length(); i++) {
- JSONObject policyObject = policiesArray.getJSONObject(i);
- if (policyObject.get("policyTypeId").equals(policyTypeId)) {
- policiesList.add(policyObject.toString());
- }
- }
- logger.debug("A1 client: policies = {}", policiesList);
- return Flux.fromIterable(policiesList);
- } catch (JSONException ex) { // invalid json
- return Flux.error(ex);
- }
- }
-
- private Mono<String> createPolicyMono(String policyString) {
- try {
- JSONObject policyObject = new JSONObject(policyString);
- String policy = policyObject.toString();
- logger.debug("A1 client: policy = {}", policy);
- return Mono.just(policy);
+ JSONObject jsonObject = new JSONObject(inputString);
+ String jsonString = jsonObject.toString();
+ logger.debug("A1 client: received string = {}", jsonString);
+ return Mono.just(jsonString);