diff --git a/CHANGELOG.md b/CHANGELOG.md index c4bc0fb25c..57c9c48532 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Updated license header to "Copyright (c) 2021,2024 Contributors to the Eclipse Foundation" +- Changed lookupGlobalAssetIds to lookupShellsByBPN, which provides full object. ## [4.4.0] - 2024-01-15 ### Added diff --git a/irs-registry-client/src/main/java/org/eclipse/tractusx/irs/registryclient/DigitalTwinRegistryService.java b/irs-registry-client/src/main/java/org/eclipse/tractusx/irs/registryclient/DigitalTwinRegistryService.java index 47f969ec02..1afd1d3bb2 100644 --- a/irs-registry-client/src/main/java/org/eclipse/tractusx/irs/registryclient/DigitalTwinRegistryService.java +++ b/irs-registry-client/src/main/java/org/eclipse/tractusx/irs/registryclient/DigitalTwinRegistryService.java @@ -34,15 +34,13 @@ public interface DigitalTwinRegistryService { /** - * Retrieves the global asset IDs of all asset administration shells for a given BPN. + * Retrieves the shell details of all asset administration shells for a given BPN. * * @param bpn the BPN to retrieve the shells for - * @return the collection of global asset IDs + * @return the collection of asset administration shells */ - default Collection lookupGlobalAssetIds(final String bpn) throws RegistryServiceException { - return fetchShells(lookupShellIdentifiers(bpn)).stream() - .map(AssetAdministrationShellDescriptor::getGlobalAssetId) - .toList(); + default Collection lookupShellsByBPN(final String bpn) throws RegistryServiceException { + return fetchShells(lookupShellIdentifiers(bpn)).stream().toList(); } /** diff --git a/irs-registry-client/src/test/java/org/eclipse/tractusx/irs/registryclient/decentral/DecentralDigitalTwinRegistryServiceTest.java b/irs-registry-client/src/test/java/org/eclipse/tractusx/irs/registryclient/decentral/DecentralDigitalTwinRegistryServiceTest.java index d8afd5a72f..5df9a62db4 100644 --- a/irs-registry-client/src/test/java/org/eclipse/tractusx/irs/registryclient/decentral/DecentralDigitalTwinRegistryServiceTest.java +++ b/irs-registry-client/src/test/java/org/eclipse/tractusx/irs/registryclient/decentral/DecentralDigitalTwinRegistryServiceTest.java @@ -203,11 +203,12 @@ void shouldReturnExpectedGlobalAssetId() throws RegistryServiceException { expectedShell); // when - final Collection globalAssetIds = decentralDigitalTwinRegistryService.lookupGlobalAssetIds( + final Collection assetAdministrationShellDescriptors = decentralDigitalTwinRegistryService.lookupShellsByBPN( digitalTwinRegistryKey.bpn()); + String actualGlobalAssetId = assetAdministrationShellDescriptors.stream().findFirst().map(AssetAdministrationShellDescriptor::getGlobalAssetId).get(); // then - Assertions.assertThat(globalAssetIds).containsExactly(expectedGlobalAssetId); + Assertions.assertThat(actualGlobalAssetId).isEqualTo(expectedGlobalAssetId); } }