Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-32670] Integration test showing that branch property strateg…
…ies are hidden by default for multibranch Pipeline projects.

Originally-Committed-As: 96460b497b3427fcfba461fbcf45933318b91b34
  • Loading branch information
jglick committed Mar 15, 2016
1 parent 9e88a2c commit 7c2e34e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion multibranch/pom.xml
Expand Up @@ -53,7 +53,7 @@ THE SOFTWARE.
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>branch-api</artifactId>
<version>1.1</version>
<version>1.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
Expand Down
Expand Up @@ -37,11 +37,13 @@
import javax.annotation.Nonnull;
import jenkins.branch.BranchProperty;
import jenkins.branch.BranchPropertyDescriptor;
import jenkins.branch.BranchPropertyStrategyDescriptor;
import jenkins.branch.BranchSource;
import jenkins.branch.DefaultBranchPropertyStrategy;
import jenkins.plugins.git.GitSCMSource;
import jenkins.scm.api.SCMHead;
import jenkins.scm.api.SCMSource;
import jenkins.scm.api.SCMSourceDescriptor;
import jenkins.scm.impl.SingleSCMSource;
import static org.hamcrest.Matchers.*;
import org.jenkinsci.plugins.scriptsecurity.scripts.ScriptApproval;
Expand All @@ -53,6 +55,7 @@
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.BuildWatcher;
import org.jvnet.hudson.test.Issue;
import org.jvnet.hudson.test.JenkinsRule;
import org.jvnet.hudson.test.TestExtension;

Expand Down Expand Up @@ -114,6 +117,7 @@ public class WorkflowMultiBranchProjectTest {
return p;
}

@Issue("JENKINS-32670")
@Test public void visibleBranchProperties() throws Exception {
WorkflowMultiBranchProject p = r.jenkins.createProject(WorkflowMultiBranchProject.class, "p");
Set<Class<? extends BranchProperty>> clazzes = new HashSet<Class<? extends BranchProperty>>();
Expand All @@ -123,6 +127,7 @@ public class WorkflowMultiBranchProjectTest {
// RateLimitBranchProperty & BuildRetentionBranchProperty hidden by JobPropertyStep.HideSuperfluousBranchProperties.
// UntrustedBranchProperty hidden because it applies only to Project.
assertEquals(Collections.<Class<? extends BranchProperty>>emptySet(), clazzes);
assertEquals(Collections.<BranchPropertyStrategyDescriptor>emptyList(), r.jenkins.getDescriptorByType(BranchSource.DescriptorImpl.class).propertyStrategyDescriptors(p, r.jenkins.getDescriptorByType(SingleSCMSource.DescriptorImpl.class)));
}

@SuppressWarnings("rawtypes")
Expand Down

0 comments on commit 7c2e34e

Please sign in to comment.