Skip to content

Commit

Permalink
feat(decentral-client-library):596-tracex add functionallity which ch…
Browse files Browse the repository at this point in the history
…ecks if an policy already exists.
  • Loading branch information
ds-mwesener committed Mar 22, 2024
1 parent 0d0a9f5 commit 9a87106
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ public boolean policyDefinitionExists(final String policyName) throws GetEdcPoli
} catch (HttpClientErrorException e) {
if (e.getStatusCode().value() == HttpStatus.NOT_FOUND.value()) {
log.info(String.format("Policy with id %s not found within the edc", policyName));
return false;
} else {
throw new GetEdcPolicyDefinitionException(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ void givenPolicyName_WhenGetPolicy_ThenNotExists() throws GetEdcPolicyDefinition
String policyName = "policyName";
when(endpointConfig.getPolicyDefinition()).thenReturn("/management/v2/policydefinitions" + "/" + policyName);

ResponseEntity<String> responseEntity = ResponseEntity.badRequest().build();
ResponseEntity<String> responseEntity = ResponseEntity.notFound().build();
when(restTemplate.getForEntity(anyString(), eq(String.class))).thenReturn(responseEntity);

// when
Expand Down

0 comments on commit 9a87106

Please sign in to comment.