diff --git a/irs-api/src/main/java/org/eclipse/tractusx/irs/aaswrapper/job/ItemContainer.java b/irs-api/src/main/java/org/eclipse/tractusx/irs/aaswrapper/job/ItemContainer.java index 3505f1865e..afe2b53639 100644 --- a/irs-api/src/main/java/org/eclipse/tractusx/irs/aaswrapper/job/ItemContainer.java +++ b/irs-api/src/main/java/org/eclipse/tractusx/irs/aaswrapper/job/ItemContainer.java @@ -29,6 +29,7 @@ import lombok.Getter; import lombok.Singular; import lombok.extern.jackson.Jacksonized; +import org.apache.commons.lang3.StringUtils; import org.eclipse.tractusx.irs.component.Bpn; import org.eclipse.tractusx.irs.component.Relationship; import org.eclipse.tractusx.irs.component.Submodel; @@ -60,4 +61,8 @@ public class ItemContainer { @Singular private List metrics; + + public List getBpnsWithManufacturerName() { + return this.getBpns().stream().filter(bpn -> StringUtils.isNotBlank(bpn.getManufacturerName())).toList(); + } } diff --git a/irs-api/src/main/java/org/eclipse/tractusx/irs/aaswrapper/job/ItemTreesAssembler.java b/irs-api/src/main/java/org/eclipse/tractusx/irs/aaswrapper/job/ItemTreesAssembler.java index e3ed3107c9..fc9c7fad31 100644 --- a/irs-api/src/main/java/org/eclipse/tractusx/irs/aaswrapper/job/ItemTreesAssembler.java +++ b/irs-api/src/main/java/org/eclipse/tractusx/irs/aaswrapper/job/ItemTreesAssembler.java @@ -31,7 +31,6 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; import org.eclipse.tractusx.irs.component.Bpn; import org.eclipse.tractusx.irs.component.Relationship; import org.eclipse.tractusx.irs.component.Submodel; @@ -65,7 +64,7 @@ public class ItemTreesAssembler { tombstones.addAll(itemGraph.getTombstones()); shells.addAll(itemGraph.getShells()); submodels.addAll(itemGraph.getSubmodels()); - bpns.addAll(itemGraph.getBpns().stream().filter(bpn -> StringUtils.isNotBlank(bpn.getManufacturerName())).toList()); + bpns.addAll(itemGraph.getBpnsWithManufacturerName()); }); log.info("Assembled item graph from {} partial graphs", numberOfPartialTrees); diff --git a/irs-api/src/main/java/org/eclipse/tractusx/irs/services/IrsItemGraphQueryService.java b/irs-api/src/main/java/org/eclipse/tractusx/irs/services/IrsItemGraphQueryService.java index 03e00e7f7c..648e984807 100644 --- a/irs-api/src/main/java/org/eclipse/tractusx/irs/services/IrsItemGraphQueryService.java +++ b/irs-api/src/main/java/org/eclipse/tractusx/irs/services/IrsItemGraphQueryService.java @@ -386,7 +386,7 @@ private ItemContainer retrievePartialResults(final MultiTransferJob multiJob) { shells.addAll(itemContainer.getShells()); submodels.addAll(itemContainer.getSubmodels()); metrics.addAll(itemContainer.getMetrics()); - bpns.addAll(itemContainer.getBpns()); + bpns.addAll(itemContainer.getBpnsWithManufacturerName()); }); } catch (BlobPersistenceException e) {