diff --git a/irs-registry-client/src/main/java/org/eclipse/tractusx/irs/registryclient/decentral/DecentralDigitalTwinRegistryService.java b/irs-registry-client/src/main/java/org/eclipse/tractusx/irs/registryclient/decentral/DecentralDigitalTwinRegistryService.java index 9724382916..cb705304e2 100644 --- a/irs-registry-client/src/main/java/org/eclipse/tractusx/irs/registryclient/decentral/DecentralDigitalTwinRegistryService.java +++ b/irs-registry-client/src/main/java/org/eclipse/tractusx/irs/registryclient/decentral/DecentralDigitalTwinRegistryService.java @@ -104,16 +104,21 @@ private List fetchShellDescriptors(final Set final var connectorEndpoints = connectorEndpointsService.fetchConnectorEndpoints(bpn); calledEndpoints.addAll(connectorEndpoints); - final var service = endpointDataForConnectorsService; + return fetchShellDescriptorsForConnectorEndpoints(bpn, keys, connectorEndpoints); + } + + private List fetchShellDescriptorsForConnectorEndpoints(final String bpn, + final List keys, final List connectorEndpoints) { try { - final var futures = // - service.findEndpointDataForConnectors(connectorEndpoints) - .stream() - .map(edrFuture -> edrFuture.thenCompose( - edr -> supplyAsync(() -> fetchShellDescriptorsForKey(keys, edr)))) - .toList(); + final var futures = endpointDataForConnectorsService.findEndpointDataForConnectors(connectorEndpoints) + .stream() + .map(edrFuture -> edrFuture.thenCompose( + edr -> supplyAsync( + () -> fetchShellDescriptorsForKey(keys, + edr)))) + .toList(); return resultFinder.getFastestResult(futures).get();