Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import org.htmlunit.Page;
import org.htmlunit.WebResponse;
import org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.jvnet.hudson.test.Issue;
Expand All @@ -62,6 +63,12 @@

private WorkflowMultiBranchProject pr;

@BeforeAll
static void enableManagePermission() {
// TODO remove when baseline contains https://github.com/jenkinsci/jenkins/pull/23873

Check warning on line 68 in src/test/java/com/cloudbees/jenkins/plugins/bitbucket/Security2033Test.java

View check run for this annotation

ci.jenkins.io / Open Tasks Scanner

TODO

NORMAL: remove when baseline contains https://github.com/jenkinsci/jenkins/pull/23873
Jenkins.MANAGE.setEnabled(true);
}

@BeforeEach
void setup(JenkinsRule rule) throws Exception {
j = rule;
Expand Down Expand Up @@ -151,7 +158,7 @@
try (ACLContext aclContext = ACL.as(User.getOrCreateByIdOrFullName(NOT_AUTHORIZED_USER))) {
assertThatThrownBy(() -> descriptor.doShowStats())
.isInstanceOf(AccessDeniedException3.class)
.hasMessage(NOT_AUTHORIZED_USER + " is missing the Overall/Administer permission");
.hasMessage(NOT_AUTHORIZED_USER + " is missing the Overall/Manage permission");
}
}

Expand All @@ -162,7 +169,7 @@
try (ACLContext aclContext = ACL.as(User.getOrCreateByIdOrFullName(NOT_AUTHORIZED_USER))) {
assertThatThrownBy(() -> descriptor.doClear())
.isInstanceOf(AccessDeniedException3.class)
.hasMessage(NOT_AUTHORIZED_USER + " is missing the Overall/Administer permission");
.hasMessage(NOT_AUTHORIZED_USER + " is missing the Overall/Manage permission");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@

private static JenkinsRule r;

@BeforeAll
static void enableManagePermission() {
// TODO remove when baseline contains https://github.com/jenkinsci/jenkins/pull/23873

Check warning on line 78 in src/test/java/com/cloudbees/jenkins/plugins/bitbucket/endpoints/BitbucketEndpointConfigurationTest.java

View check run for this annotation

ci.jenkins.io / Open Tasks Scanner

TODO

NORMAL: remove when baseline contains https://github.com/jenkinsci/jenkins/pull/23873
Jenkins.MANAGE.setEnabled(true);
}

@BeforeAll
static void init(JenkinsRule rule) {
r = rule;
Expand Down Expand Up @@ -131,7 +137,7 @@
assertThatThrownBy(() ->
instance.setEndpoints(List.of(buildCloudEndpoint(true, "first"), buildCloudEndpoint(true, "second"), buildCloudEndpoint(true, "third")))
)
.hasMessage(hudson.security.Messages.AccessDeniedException2_MissingPermission("anonymous", "Overall/Administer"));
.hasMessage(hudson.security.Messages.AccessDeniedException2_MissingPermission("anonymous", "Overall/Manage"));
} finally {
r.jenkins.setAuthorizationStrategy(AuthorizationStrategy.UNSECURED);
}
Expand Down Expand Up @@ -188,8 +194,8 @@
assertThat(instance.getEndpoints()).element(1).satisfies(endpoint -> {
assertThat(endpoint.getDisplayName()).isEqualTo("Example Org");
assertThat(endpoint.getServerURL()).isEqualTo("http://example.org:8080/bitbucket");
assertThat(endpoint.isManageHooks()).isFalse();

Check warning on line 197 in src/test/java/com/cloudbees/jenkins/plugins/bitbucket/endpoints/BitbucketEndpointConfigurationTest.java

View check run for this annotation

ci.jenkins.io / Java Compiler

compiler:testCompile

NORMAL: isManageHooks() in com.cloudbees.jenkins.plugins.bitbucket.api.endpoint.BitbucketEndpoint has been deprecated and marked for removal
assertThat(endpoint.getCredentialsId()).isNull();

Check warning on line 198 in src/test/java/com/cloudbees/jenkins/plugins/bitbucket/endpoints/BitbucketEndpointConfigurationTest.java

View check run for this annotation

ci.jenkins.io / Java Compiler

compiler:testCompile

NORMAL: getCredentialsId() in com.cloudbees.jenkins.plugins.bitbucket.api.endpoint.BitbucketEndpoint has been deprecated and marked for removal
});
}

Expand Down Expand Up @@ -620,8 +626,8 @@
BitbucketServerEndpoint endpoint3 = (BitbucketServerEndpoint) instance.getEndpoints().get(2);
assertThat(endpoint3.getDisplayName()).isEqualTo("Example Org");
assertThat(endpoint3.getServerURL()).isEqualTo("http://example.org:8080/bitbucket");
assertThat(endpoint3.isManageHooks()).isFalse();

Check warning on line 629 in src/test/java/com/cloudbees/jenkins/plugins/bitbucket/endpoints/BitbucketEndpointConfigurationTest.java

View check run for this annotation

ci.jenkins.io / Java Compiler

compiler:testCompile

NORMAL: isManageHooks() in com.cloudbees.jenkins.plugins.bitbucket.impl.endpoint.AbstractBitbucketEndpoint has been deprecated and marked for removal
assertThat(endpoint3.getCredentialsId()).isNull();

Check warning on line 630 in src/test/java/com/cloudbees/jenkins/plugins/bitbucket/endpoints/BitbucketEndpointConfigurationTest.java

View check run for this annotation

ci.jenkins.io / Java Compiler

compiler:testCompile

NORMAL: getCredentialsId() in com.cloudbees.jenkins.plugins.bitbucket.impl.endpoint.AbstractBitbucketEndpoint has been deprecated and marked for removal
}

@Test
Expand Down
Loading