Skip to content

Commit

Permalink
fixed unit test
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
  • Loading branch information
thjaeckle committed Jul 7, 2022
1 parent 449108e commit f91f5d8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ default JsonObject buildJsonView(final ResourceKey resourceKey,
if (isAuthorizationSubjectRelevant) {
final JsonObject inputJsonObject = JsonFactory.newObject(jsonFields);
final JsonObject allowedJsonView = inputJsonObject.get(allowlist);
return JsonFactory.newObject(allowedJsonView, enforcedJsonView); // TODO TJ in which way to merge??
return JsonFactory.newObject(allowedJsonView, enforcedJsonView);
} else {
return enforcedJsonView;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,13 @@ public void acceptByPolicyWithRevokeOnAttribute() {

expectAndAnswerSudoRetrieveThing(sudoRetrieveThingResponse);

final JsonObject jsonObjectWithoutAttr = thingWithPolicy.remove(attributePointer);
final JsonObject jsonObjectWithoutAttr = JsonObject.newBuilder()
.set("thingId", "thing:id") // this is re-added as first field being a "special" field always visible after enforcement
.set("_revision", 1)
.set("_namespace", "thing")
.set("policyId","policy:id")
.set("attributes",JsonObject.empty())
.build();
final RetrieveThingResponse retrieveThingResponseWithoutAttr =
RetrieveThingResponse.of(THING_ID, jsonObjectWithoutAttr, headers());
expectMsg(retrieveThingResponseWithoutAttr);
Expand Down

0 comments on commit f91f5d8

Please sign in to comment.