Skip to content

Commit

Permalink
Remove PowerMock
Browse files Browse the repository at this point in the history
  • Loading branch information
basil committed Dec 17, 2021
1 parent 78da0f4 commit 417ef02
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 23 deletions.
23 changes: 7 additions & 16 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.7</version>
<version>4.31</version>
<relativePath />
</parent>

Expand Down Expand Up @@ -83,27 +83,18 @@
<dependency>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-annotations</artifactId>
<version>4.1.4</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<scope>test</scope>
<version>4.5.1</version>
<optional>true</optional>
<exclusions>
<exclusion>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito2</artifactId>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<!-- For docker integration tests -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,21 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.jvnet.hudson.test.JenkinsRule;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.modules.junit4.PowerMockRunner;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.powermock.api.mockito.PowerMockito.when;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

/**
* Tests for the "Remove Irrelevant Groups" feature.
*
* @author Fredrik Persson &lt;fredrik6.persson@sonymobile.com&gt;
*/
@RunWith(PowerMockRunner.class)
@PowerMockIgnore({"javax.crypto.*", "javax.xml.*", "com.sun.*", "org.xml.*"})
public class RemoveIrrelevantGroupsTest {

@Rule
Expand All @@ -76,7 +72,7 @@ private void setUpJenkinsUsedGroups(String... groups) {
usedGroups.add(group);
}

AuthorizationStrategy authorizationStrategy = PowerMockito.mock(AuthorizationStrategy.class);
AuthorizationStrategy authorizationStrategy = mock(AuthorizationStrategy.class);
when(authorizationStrategy.getGroups()).thenReturn(usedGroups);
jenkinsRule.getInstance().setAuthorizationStrategy(authorizationStrategy);
}
Expand Down

0 comments on commit 417ef02

Please sign in to comment.