Skip to content
Permalink
Browse files

[JENKINS-43507] Measure twice, cut once

- checking with the set eliminates an incorrect copy-pasta error
  • Loading branch information...
stephenc committed Jun 22, 2017
1 parent b4759fb commit d60356851c8ae6a37a46fa40f44711e35bd3c1aa
@@ -230,7 +230,7 @@ public GitHubSCMNavigator(String apiUri, String repoOwner, String scanCredential
// legacy constructor means legacy defaults
this.traits = new ArrayList<>();
this.traits.add(new BranchDiscoveryTrait(true, true));
this.traits.add(new ForkPullRequestDiscoveryTrait(EnumSet.of(ChangeRequestCheckoutStrategy.HEAD),
this.traits.add(new ForkPullRequestDiscoveryTrait(EnumSet.of(ChangeRequestCheckoutStrategy.MERGE),
new ForkPullRequestDiscoveryTrait.TrustContributors()));
if (!GitHubSCMSource.DescriptorImpl.SAME.equals(checkoutCredentialsId)) {
traits.add(new SSHCheckoutTrait(checkoutCredentialsId));
@@ -2,7 +2,9 @@

import java.util.Arrays;
import java.util.Collections;
import java.util.EnumSet;
import jenkins.model.Jenkins;
import jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy;
import jenkins.scm.api.trait.SCMTrait;
import jenkins.scm.impl.trait.RegexSCMSourceFilterTrait;
import jenkins.scm.impl.trait.WildcardSCMHeadFilterTrait;
@@ -1529,7 +1531,7 @@ public void given__legacyCode__when__constructor_cloud__then__discoveryTraitDefa
),
Matchers.<SCMTrait<?>>allOf(
instanceOf(ForkPullRequestDiscoveryTrait.class),
hasProperty("strategyId", is(2)),
hasProperty("strategies", is(EnumSet.of(ChangeRequestCheckoutStrategy.MERGE))),
hasProperty("trust", instanceOf(ForkPullRequestDiscoveryTrait.TrustContributors.class))
)
)
@@ -1562,7 +1564,7 @@ public void given__legacyCode__when__constructor_server__then__discoveryTraitDef
),
Matchers.<SCMTrait<?>>allOf(
instanceOf(ForkPullRequestDiscoveryTrait.class),
hasProperty("strategyId", is(2)),
hasProperty("strategies", is(EnumSet.of(ChangeRequestCheckoutStrategy.MERGE))),
hasProperty("trust", instanceOf(ForkPullRequestDiscoveryTrait.TrustContributors.class))
),
Matchers.<SCMTrait<?>>allOf(
@@ -3,7 +3,9 @@
import java.io.File;
import java.util.Arrays;
import java.util.Collections;
import java.util.EnumSet;
import jenkins.model.Jenkins;
import jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy;
import jenkins.scm.api.trait.SCMSourceTrait;
import jenkins.scm.api.trait.SCMTrait;
import jenkins.scm.impl.trait.WildcardSCMHeadFilterTrait;
@@ -367,7 +369,7 @@ public void given__legacyCode__when__constructor_cloud__then__discoveryTraitDefa
),
Matchers.<SCMSourceTrait>allOf(
instanceOf(ForkPullRequestDiscoveryTrait.class),
hasProperty("strategyId", is(1)),
hasProperty("strategies", is(EnumSet.of(ChangeRequestCheckoutStrategy.MERGE))),
hasProperty("trust", instanceOf(ForkPullRequestDiscoveryTrait.TrustContributors.class))
)
)
@@ -403,7 +405,7 @@ public void given__legacyCode__when__constructor_server__then__discoveryTraitDef
),
Matchers.<SCMSourceTrait>allOf(
instanceOf(ForkPullRequestDiscoveryTrait.class),
hasProperty("strategyId", is(1)),
hasProperty("strategies", is(EnumSet.of(ChangeRequestCheckoutStrategy.MERGE))),
hasProperty("trust", instanceOf(ForkPullRequestDiscoveryTrait.TrustContributors.class))
),
Matchers.<SCMSourceTrait>allOf(

0 comments on commit d603568

Please sign in to comment.
You can’t perform that action at this time.