Skip to content
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 cf3389f commit ed4c94a0a10eacc6fc5dee6783f88f216cb0017d
Showing with 1 addition and 1 deletion.
  1. +1 −1 test/src/test/java/jenkins/model/
@@ -155,7 +155,7 @@ public void transientActionsAreNotPersistedOnQueueItems() throws Exception {
FreeStyleProject p = r.createFreeStyleProject();
FreeStyleBuild build = r.buildAndAssertSuccess(p);
// MyProminentProjectAction is only added via the TransientActionFactory and should never be persisted.
assertThat(build.getActions(MyProminentProjectAction.class), hasSize(0));
assertThat(Util.filter(build.getActions(), MyProminentProjectAction.class), hasSize(0));
assertThat(Util.filter(build.getAllActions(), MyProminentProjectAction.class), hasSize(1));

0 comments on commit ed4c94a

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