Skip to content

Commit

Permalink
Avoid calling TransientActionFactory from SCMRevisionActionTest m…
Browse files Browse the repository at this point in the history
…ock (#215)
  • Loading branch information
jglick authored Jun 16, 2023
1 parent 36a9af1 commit 886669a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/test/java/jenkins/scm/api/SCMRevisionActionTest.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package jenkins.scm.api;

import hudson.model.Action;
import hudson.model.Actionable;
import java.util.List;
import java.util.stream.Collectors;
import jenkins.scm.impl.mock.MockSCMController;
import jenkins.scm.impl.mock.MockSCMDiscoverBranches;
import jenkins.scm.impl.mock.MockSCMHead;
Expand Down Expand Up @@ -77,5 +80,11 @@ public String getDisplayName() {
public String getSearchUrl() {
return null;
}

@SuppressWarnings("deprecation") // avoid TransientActionFactory
@Override
public <T extends Action> List<T> getActions(Class<T> type) {
return getActions().stream().filter(type::isInstance).map(type::cast).collect(Collectors.toList());
}
}
}

0 comments on commit 886669a

Please sign in to comment.