Skip to content

Commit

Permalink
Modify tests to accomodate badge changes
Browse files Browse the repository at this point in the history
Add new badge permission to tests. Remove tests for badge disabling. Add
tests testing authentication, permission and ACL access.

Signed-off-by: Kirill.Sybin <[email protected]>
  • Loading branch information
Kirill.Sybin committed Aug 18, 2024
1 parent ee33af4 commit 8603726
Show file tree
Hide file tree
Showing 3 changed files with 308 additions and 40 deletions.
5 changes: 4 additions & 1 deletion src/test/java/org/dependencytrack/auth/PermissionsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@
import static org.dependencytrack.auth.Permissions.Constants.VIEW_VULNERABILITY;
import static org.dependencytrack.auth.Permissions.Constants.VULNERABILITY_ANALYSIS;
import static org.dependencytrack.auth.Permissions.Constants.VULNERABILITY_MANAGEMENT;
import static org.dependencytrack.auth.Permissions.Constants.VIEW_BADGES;
public class PermissionsTest {

@Test
public void testPermissionEnums() {
Assert.assertEquals(13, Permissions.values().length);
Assert.assertEquals(14, Permissions.values().length);
Assert.assertEquals("BOM_UPLOAD", Permissions.BOM_UPLOAD.name());
Assert.assertEquals("VIEW_PORTFOLIO", Permissions.VIEW_PORTFOLIO.name());
Assert.assertEquals("PORTFOLIO_MANAGEMENT", Permissions.PORTFOLIO_MANAGEMENT.name());
Expand All @@ -52,6 +53,7 @@ public void testPermissionEnums() {
Assert.assertEquals("PROJECT_CREATION_UPLOAD", Permissions.PROJECT_CREATION_UPLOAD.name());
Assert.assertEquals("POLICY_MANAGEMENT", Permissions.POLICY_MANAGEMENT.name());
Assert.assertEquals("TAG_MANAGEMENT", Permissions.TAG_MANAGEMENT.name());
Assert.assertEquals("VIEW_BADGES", Permissions.VIEW_BADGES.name());
}

@Test
Expand All @@ -69,5 +71,6 @@ public void testPermissionConstants() {
Assert.assertEquals("PROJECT_CREATION_UPLOAD", PROJECT_CREATION_UPLOAD);
Assert.assertEquals("POLICY_MANAGEMENT", POLICY_MANAGEMENT);
Assert.assertEquals("TAG_MANAGEMENT", TAG_MANAGEMENT);
Assert.assertEquals("VIEW_BADGES", VIEW_BADGES);
}
}
Loading

0 comments on commit 8603726

Please sign in to comment.