Skip to content

Commit

Permalink
use Assume rather than checking null (#146)
Browse files Browse the repository at this point in the history
Signed-off-by: olivier lamy <[email protected]>
  • Loading branch information
olamy authored Sep 16, 2020
1 parent 9472748 commit 67c9aed
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.google.common.collect.ArrayListMultimap;
import hudson.EnvVars;
import hudson.Launcher;
import hudson.Plugin;
import hudson.model.*;
import hudson.model.Cause.UserIdCause;
import hudson.model.Cause.UpstreamCause;
Expand All @@ -39,6 +40,7 @@
import hudson.plugins.promoted_builds.conditions.DownstreamPassCondition;
import org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition;
import org.jenkinsci.plugins.workflow.job.WorkflowJob;
import org.junit.Assume;
import org.junit.Rule;
import org.junit.Test;

Expand Down Expand Up @@ -400,7 +402,8 @@ public void testBlockingTriggerWithMatrixProject() throws Exception {
@Issue("JENKINS-17751")
@Test
public void testTriggerFromPromotion() throws Exception {
assertNotNull("promoted-builds must be installed.", Jenkins.getInstance().getPlugin("promoted-builds"));
Plugin plugin = Jenkins.get().getPlugin( "promoted-builds");
Assume.assumeTrue(plugin!=null);
// Test combination with PromotedBuilds.
// Assert that the original build can be tracked from triggered build.
// The configuration is as following:
Expand Down

0 comments on commit 67c9aed

Please sign in to comment.