Skip to content

Commit

Permalink
Update dependency org.jenkins-ci.plugins:plugin to v5.7 (#428)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: strangelookingnerd <49242855+strangelookingnerd@users.noreply.github.com>
  • Loading branch information
renovate[bot] and strangelookingnerd authored Feb 4, 2025
1 parent 184be0f commit fd80d87
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>5.6</version>
<version>5.7</version>
<relativePath />
</parent>

Expand Down
16 changes: 11 additions & 5 deletions src/test/java/jenkins/plugins/foldericon/PermissionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ void doUploadIcon(JenkinsRule r) throws Exception {
r.jenkins.setAuthorizationStrategy(strategy);

// unauthenticated
assertThrows(AccessDeniedException.class, () -> descriptor.doUploadIcon(mockRequest, null));
assertThrows(AccessDeniedException.class, () -> descriptor.doUploadIcon(mockRequest, project));
try (ACLContext ignored = ACL.as2(Jenkins.ANONYMOUS2)) {
assertThrows(AccessDeniedException.class, () -> descriptor.doUploadIcon(mockRequest, null));
assertThrows(AccessDeniedException.class, () -> descriptor.doUploadIcon(mockRequest, project));
}

// Item.READ
try (ACLContext ignored = ACL.as(User.get(READ_USER, true, Collections.emptyMap()))) {
Expand Down Expand Up @@ -127,8 +129,10 @@ void doCleanup(JenkinsRule r) throws Exception {
r.jenkins.setAuthorizationStrategy(strategy);

// unauthenticated
assertThrows(AccessDeniedException.class, () -> descriptor.doCleanup(null));
assertTrue(file.exists());
try (ACLContext ignored = ACL.as2(Jenkins.ANONYMOUS2)) {
assertThrows(AccessDeniedException.class, () -> descriptor.doCleanup(null));
assertTrue(file.exists());
}

// Jenkins.READ
try (ACLContext ignored = ACL.as(User.get(READ_USER, true, Collections.emptyMap()))) {
Expand Down Expand Up @@ -167,7 +171,9 @@ void getDiskUsage(JenkinsRule r) {
r.jenkins.setAuthorizationStrategy(strategy);

// unauthenticated
assertThrows(AccessDeniedException.class, descriptor::getDiskUsage);
try (ACLContext ignored = ACL.as2(Jenkins.ANONYMOUS2)) {
assertThrows(AccessDeniedException.class, descriptor::getDiskUsage);
}

// Jenkins.READ
try (ACLContext ignored = ACL.as(User.get(READ_USER, true, Collections.emptyMap()))) {
Expand Down

0 comments on commit fd80d87

Please sign in to comment.