Skip to content

Commit

Permalink
Merge pull request eclipse-tractusx#518 from catenax-ng/feature/TRI-X…
Browse files Browse the repository at this point in the history
…XX-fix-critical-findings

feat(impl):[TRI-XXX] fix criticals
  • Loading branch information
ds-ext-kmassalski authored Sep 5, 2023
2 parents b6516c7 + f609b49 commit 2691af2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ private Optional<String> readFromSemanticHub(final String urn) {
try {
final UriComponentsBuilder uriBuilder = UriComponentsBuilder.fromUriString(
config.getModelJsonSchemaEndpoint());
final Map<String, String> values = Map.of(PLACEHOLDER_URN, urn);
return Optional.ofNullable(restTemplate.getForObject(uriBuilder.build(values), String.class));
uriBuilder.uriVariables(Map.of(PLACEHOLDER_URN, urn));
return Optional.ofNullable(restTemplate.getForObject(uriBuilder.build().toUri(), String.class));
} catch (final RestClientException e) {
log.error("Unable to retrieve schema from semantic hub for urn '{}'", urn, e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ public AssetAdministrationShellDescriptor getAssetAdministrationShellDescriptor(
public LookupShellsResponse getAllAssetAdministrationShellIdsByAssetLink(
final List<IdentifierKeyValuePair> assetIds) {
final UriComponentsBuilder uriBuilder = UriComponentsBuilder.fromUriString(shellLookupEndpoint);
final var values = Map.of(PLACEHOLDER_ASSET_IDS, StringMapper.mapToString(assetIds));
return restTemplate.exchange(uriBuilder.build(values), HttpMethod.GET, null, LookupShellsResponse.class)
uriBuilder.uriVariables(Map.of(PLACEHOLDER_ASSET_IDS, StringMapper.mapToString(assetIds)));
return restTemplate.exchange(uriBuilder.build().toUri(), HttpMethod.GET, null, LookupShellsResponse.class)
.getBody();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ public LookupShellsResponse getAllAssetAdministrationShellIdsByAssetLink(
final EndpointDataReference endpointDataReference, final List<IdentifierKeyValuePair> assetIds) {
final String shellLookupEndpoint = endpointDataReference.getEndpoint() + lookupShellsTemplate;
final UriComponentsBuilder uriBuilder = UriComponentsBuilder.fromUriString(shellLookupEndpoint);
final var values = Map.of(PLACEHOLDER_ASSET_IDS, StringMapper.mapToString(assetIds));
return edcRestTemplate.exchange(uriBuilder.build(values), HttpMethod.GET,
uriBuilder.uriVariables(Map.of(PLACEHOLDER_ASSET_IDS, StringMapper.mapToString(assetIds)));
return edcRestTemplate.exchange(uriBuilder.build().toUri(), HttpMethod.GET,
new HttpEntity<>(null, headers(endpointDataReference)), LookupShellsResponse.class).getBody();
}

Expand Down

0 comments on commit 2691af2

Please sign in to comment.