From 323c5290f9246d625581818037f0e219e985eeb6 Mon Sep 17 00:00:00 2001 From: Oleksandra Ishchuk Date: Thu, 8 Jan 2026 13:14:52 +0100 Subject: [PATCH 1/4] Add missing ifPresent check --- .../java/com/backbase/stream/service/AccessGroupService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stream-access-control/access-control-core/src/main/java/com/backbase/stream/service/AccessGroupService.java b/stream-access-control/access-control-core/src/main/java/com/backbase/stream/service/AccessGroupService.java index 913a4e289..14c620ce4 100644 --- a/stream-access-control/access-control-core/src/main/java/com/backbase/stream/service/AccessGroupService.java +++ b/stream-access-control/access-control-core/src/main/java/com/backbase/stream/service/AccessGroupService.java @@ -1030,7 +1030,7 @@ public Mono updateExistingDataGroupsBatch(BatchProductGro // it should be external data item ids (both add and remove) Set arrangementsToAdd = new HashSet<>(); Set arrangementsToRemove = new HashSet<>(); - affectedArrangements.forEach((internalId, externalId) -> { + affectedArrangements.forEach((internalId, externalId) -> pg.ifPresent(p -> { boolean shouldBeInGroup = StreamUtils.getInternalProductIds(pg.get()).contains(internalId) || pg.get().getCustomDataGroupItems().stream() @@ -1048,7 +1048,7 @@ public Mono updateExistingDataGroupsBatch(BatchProductGro internalId, externalId, dbsDataGroup.getName()); arrangementsToRemove.add(externalId); } - }); + })); if (!CollectionUtils.isEmpty(arrangementsToAdd)) { batchUpdateRequest.add(new DataItemBatchUpdate() .dataGroupIdentifier(new DataGroupNameIdentifier() From 3a43cccdb2fe19f51d9ecfba2ea3f2a6bc720275 Mon Sep 17 00:00:00 2001 From: Oleksandra Ishchuk Date: Thu, 8 Jan 2026 13:35:12 +0100 Subject: [PATCH 2/4] Add test to verify NoSuchElementException (No value present) is not thrown --- .../service/AccessGroupServiceTest.java | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/stream-access-control/access-control-core/src/test/java/com/backbase/stream/service/AccessGroupServiceTest.java b/stream-access-control/access-control-core/src/test/java/com/backbase/stream/service/AccessGroupServiceTest.java index b84232d46..b3934e0a3 100644 --- a/stream-access-control/access-control-core/src/test/java/com/backbase/stream/service/AccessGroupServiceTest.java +++ b/stream-access-control/access-control-core/src/test/java/com/backbase/stream/service/AccessGroupServiceTest.java @@ -849,6 +849,55 @@ void updateExistingDataGroupsBatchWithSameInDbsIngestionModeReplace() { verify(dataGroupIntegrationApi, times(0)).batchUpdateDataItems(any()); } + @Test + void updateExistingDataGroupsBatchWhenNoMatchingInDbsIngestionModeReplace() { + // Given + BatchProductGroupTask batchProductGroupTask = new BatchProductGroupTask(); + batchProductGroupTask.setIngestionMode(BatchProductIngestionMode.REPLACE); + batchProductGroupTask.setBatchProductGroup(new BatchProductGroup().productGroups( + List.of(new BaseProductGroup().name("Test product group")))); + + DataGroup unmatchedDataGroup1 = buildDataGroupItem( + "Unmatched Data Group 1", + "Unmatched Data Group 1", + "unmatched-1" + ); + DataGroup unmatchedDataGroup2 = buildDataGroupItem( + "Unmatched Data Group 2", + "Unmatched Data Group 2", + "unmatched-2" + ); + + BaseProductGroup productGroup1 = buildBaseProductGroup( + "Different Product Group 1", + "Different Product Group 1", + BaseProductGroup.ProductGroupTypeEnum.REPOSITORIES, + "different-1" + ); + BaseProductGroup productGroup2 = buildBaseProductGroup( + "Different Product Group 2", + "Different Product Group 2", + BaseProductGroup.ProductGroupTypeEnum.REPOSITORIES, + "different-2" + ); + + when(arrangementsApi.postSearchArrangements(any())) + .thenReturn(Mono.just(new ArrangementSearchesListResponse() + .arrangementElements(List.of( + new ArrangementItem().id("unmatched-1").externalArrangementId("ext-unmatched-1"), + new ArrangementItem().id("unmatched-2").externalArrangementId("ext-unmatched-2") + )))); + + // When + subject.updateExistingDataGroupsBatch(batchProductGroupTask, + List.of(unmatchedDataGroup1, unmatchedDataGroup2), + List.of(productGroup1, productGroup2)) + .block(); + + // Then + verify(dataGroupIntegrationApi, times(0)).batchUpdateDataItems(any()); + } + @Test void updateExistingDataGroupsBatchWithMissingInDbsIngestionModeReplace() { // Given From c0e4ab6346b53008ac43f1f22f534c7486d9c431 Mon Sep 17 00:00:00 2001 From: Oleksandra Ishchuk Date: Thu, 8 Jan 2026 13:38:10 +0100 Subject: [PATCH 3/4] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6534e4e1c..9c02818b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog All notable changes to this project will be documented in this file. +## [9.2.0](https://github.com/Backbase/stream-services/compare/9.2.0...9.3.0) +### Changed + - fix for NoSuchElementException (No value present) thrown while update data groups + ## [9.1.0](https://github.com/Backbase/stream-services/compare/9.0.0...9.1.0) ### Changed - added partitioning to a batch permission update request From 7e9dc3bfbda0c8a22fff221681f6383fe1e33cd1 Mon Sep 17 00:00:00 2001 From: "Sasha (Oleksandra)" <99425330+sasha-ishchuk@users.noreply.github.com> Date: Thu, 15 Jan 2026 17:05:40 +0100 Subject: [PATCH 4/4] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c02818b9..200235e5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Changelog All notable changes to this project will be documented in this file. -## [9.2.0](https://github.com/Backbase/stream-services/compare/9.2.0...9.3.0) +## [9.3.0](https://github.com/Backbase/stream-services/compare/9.2.0...9.3.0) ### Changed - fix for NoSuchElementException (No value present) thrown while update data groups