Skip to content

Commit

Permalink
[JENKINS-51584] Unit test was not quite correct.
Browse files Browse the repository at this point in the history
Calling getActions(class) will include actions froma TransientActionFactory.

To get the correct results just call getActions() and then filter the result.
  • Loading branch information
jtnord committed May 30, 2018
1 parent ed4c94a commit 5b6acd7
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions test/src/test/java/jenkins/model/TransientActionFactoryTest.java
Expand Up @@ -25,7 +25,14 @@
package jenkins.model;

import hudson.Util;
import hudson.model.*;
import hudson.model.AbstractItem;
import hudson.model.AbstractProject;
import hudson.model.Action;
import hudson.model.Actionable;
import hudson.model.FreeStyleBuild;
import hudson.model.FreeStyleProject;
import hudson.model.InvisibleAction;
import hudson.model.ProminentProjectAction;
import hudson.model.queue.FoldableAction;

import java.io.IOException;
Expand All @@ -34,8 +41,6 @@
import java.util.List;
import org.hamcrest.Matchers;

import static org.hamcrest.Matchers.hasSize;
import static org.junit.Assert.*;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;
Expand All @@ -45,6 +50,9 @@

import javax.annotation.Nonnull;

import static org.hamcrest.Matchers.hasSize;
import static org.junit.Assert.*;

public class TransientActionFactoryTest {

@Rule public JenkinsRule r = new JenkinsRule();
Expand Down

0 comments on commit 5b6acd7

Please sign in to comment.