Skip to content

Commit

Permalink
Fix ACM DS test (#1900)
Browse files Browse the repository at this point in the history
Signed-off-by: Marinov Avgustin <[email protected]>
  • Loading branch information
avgustinmm authored Oct 17, 2024
1 parent b48a50e commit 331cf8e
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ void verifyTagFilteringAndManagement() {
final DistributionSet readOnly = testdataFactory.createDistributionSet();
final DistributionSet hidden = testdataFactory.createDistributionSet();
final DistributionSetTag dsTag = distributionSetTagManagement.create(entityFactory.tag().create().name("dsTag"));
final DistributionSetTag dsTag2 = distributionSetTagManagement.create(entityFactory.tag().create().name("dsTag2"));

// perform tag assignment before setting access rules
distributionSetManagement.assignTag(Arrays.asList(permitted.getId(), readOnly.getId(), hidden.getId()),
Expand Down Expand Up @@ -230,16 +231,12 @@ void verifyTagFilteringAndManagement() {
.isInstanceOf(InsufficientPermissionException.class);

// assignment is denied for readOnlyTarget (read, but no update permissions)
// dsTag2- since - it is tagged with dsTag and won't do anything if assigning dsTag
assertThatThrownBy(() -> {
distributionSetManagement.assignTag(Collections.singletonList(readOnly.getId()), dsTag.getId());
distributionSetManagement.assignTag(Collections.singletonList(readOnly.getId()), dsTag2.getId());
}).as("Missing update permissions for target to toggle tag assignment.")
.isInstanceOf(InsufficientPermissionException.class);

// assignment is denied for readOnlyTarget (read, but no update permissions)
assertThatThrownBy(() -> distributionSetManagement.unassignTag(List.of(readOnly.getId()), dsTag.getId()))
.as("Missing update permissions for target to toggle tag assignment.")
.isInstanceOf(InsufficientPermissionException.class);

// assignment is denied for hiddenTarget since it's hidden
assertThatThrownBy(() -> distributionSetManagement.unassignTag(Collections.singletonList(hidden.getId()), dsTag.getId()))
.as("Missing update permissions for target to toggle tag assignment.")
Expand Down

0 comments on commit 331cf8e

Please sign in to comment.