From d378b128007a47ea99a3831003365531a596147f Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Mon, 13 May 2024 16:32:00 +0200 Subject: [PATCH 1/2] fix(test): [#533] fix NPE in Cucumber integration tests #533 broke integration tests because now an empty BPNL is not returned anymore => NPE in tests --- .../irs/cucumber/E2ETestHelperForPolicyStoreApi.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/E2ETestHelperForPolicyStoreApi.java b/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/E2ETestHelperForPolicyStoreApi.java index 55dccb54c7..70fa253f2f 100644 --- a/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/E2ETestHelperForPolicyStoreApi.java +++ b/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/E2ETestHelperForPolicyStoreApi.java @@ -123,7 +123,11 @@ public static HashMap> getExpectedBpnToPolicyIdsMapping( public static Stream extractPolicyIdsForBpn( final Map>> bpnToPoliciesMap, final String bpn) { - return extractPolicyIds(bpnToPoliciesMap.get(bpn).stream()); + ArrayList> policyIds = bpnToPoliciesMap.get(bpn); + if (policyIds == null) { + policyIds = new ArrayList<>(); + } + return extractPolicyIds(policyIds.stream()); } @SuppressWarnings("rawtypes") From e5d47f3e633ed9cdd19c927440a36f3959c1f55e Mon Sep 17 00:00:00 2001 From: Matthias Fischer Date: Mon, 13 May 2024 16:33:48 +0200 Subject: [PATCH 2/2] fix(test): [#533] use interface List instead of ArrayList --- .../tractusx/irs/cucumber/E2ETestHelperForPolicyStoreApi.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/E2ETestHelperForPolicyStoreApi.java b/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/E2ETestHelperForPolicyStoreApi.java index 70fa253f2f..599b404d38 100644 --- a/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/E2ETestHelperForPolicyStoreApi.java +++ b/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/E2ETestHelperForPolicyStoreApi.java @@ -123,7 +123,7 @@ public static HashMap> getExpectedBpnToPolicyIdsMapping( public static Stream extractPolicyIdsForBpn( final Map>> bpnToPoliciesMap, final String bpn) { - ArrayList> policyIds = bpnToPoliciesMap.get(bpn); + List> policyIds = bpnToPoliciesMap.get(bpn); if (policyIds == null) { policyIds = new ArrayList<>(); }