Skip to content
Permalink
Browse files

[JENKINS-51584] Unit test was not quite correct.

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 5b6acd7c2cd6a1f1784f2fe8b13875bde5a54fa0
Showing with 11 additions and 3 deletions.
  1. +11 −3 test/src/test/java/jenkins/model/TransientActionFactoryTest.java
@@ -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;
@@ -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;
@@ -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();

0 comments on commit 5b6acd7

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