diff --git a/src/main/java/org/eclipse/tractusx/valueaddedservice/service/logic/BusinessPartnersLogicService.java b/src/main/java/org/eclipse/tractusx/valueaddedservice/service/logic/BusinessPartnersLogicService.java index 3384e76..a462eda 100644 --- a/src/main/java/org/eclipse/tractusx/valueaddedservice/service/logic/BusinessPartnersLogicService.java +++ b/src/main/java/org/eclipse/tractusx/valueaddedservice/service/logic/BusinessPartnersLogicService.java @@ -51,13 +51,15 @@ private List filterBusinessPartnersByRole(List filteredBusinessPartnerDTOS; log.debug("Roles {}",roles); log.debug("Code Roles {} {}",CSV_ROLE_READ_SUPPLIER,CSV_ROLE_READ_CUSTOMER); - if (roles.contains(CSV_ROLE_READ_SUPPLIER) && roles.contains(CSV_ROLE_READ_CUSTOMER)) { + + if (roles.stream().anyMatch(role -> role.equalsIgnoreCase(CSV_ROLE_READ_SUPPLIER)) && + roles.stream().anyMatch(role -> role.equalsIgnoreCase(CSV_ROLE_READ_CUSTOMER))) { // User has both roles, no need to filter filteredBusinessPartnerDTOS = businessPartnerDTOS; - } else if (roles.contains(CSV_ROLE_READ_SUPPLIER)) { + } else if (roles.stream().anyMatch(role -> role.equalsIgnoreCase(CSV_ROLE_READ_SUPPLIER))) { // User can only read suppliers and those who are not customers filteredBusinessPartnerDTOS = filterSuppliers(businessPartnerDTOS); - } else if (roles.contains(CSV_ROLE_READ_CUSTOMER)) { + } else if (roles.stream().anyMatch(role -> role.equalsIgnoreCase(CSV_ROLE_READ_CUSTOMER))) { // User can only read customers and those who are not suppliers filteredBusinessPartnerDTOS = filterCustomers(businessPartnerDTOS); } else { diff --git a/src/main/java/org/eclipse/tractusx/valueaddedservice/service/logic/RequestLogicService.java b/src/main/java/org/eclipse/tractusx/valueaddedservice/service/logic/RequestLogicService.java index 2033182..2bb86e9 100644 --- a/src/main/java/org/eclipse/tractusx/valueaddedservice/service/logic/RequestLogicService.java +++ b/src/main/java/org/eclipse/tractusx/valueaddedservice/service/logic/RequestLogicService.java @@ -122,7 +122,7 @@ private List handleSequentialRequests() { private List handleNonSequentialRequests() { List finalDtoList = new ArrayList<>(); - String body = "[\"\"]"; + String body = "[]"; HttpEntity httpEntity = createHttpEntity(body); log.info("Sequential requests not enabled. Starting process to fetch external business partners from generic.");