Registry / testing / powermock-module-junit4-rule-agent

powermock-module-junit4-rule-agent

JSON →
library2.0.9javamavenunverified

PowerMock module providing JUnit 4 rule support with Java agent for mocking static methods and constructors.

<dependency> <groupId>org.powermock</groupId> <artifactId>powermock-module-junit4-rule-agent</artifactId> <version>2.0.9</version> </dependency>
INSTALL
IMPORT
SIG · POWERMOCK-MODULE-J
P
powermock-module-junit4-rule-agent
testingjavav2.0.9
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PowerMockRule
org.powermock.modules.junit4.rule.PowerMockRule

Uses PowerMockRule to enable mocking of static methods in JUnit 4 tests.

import org.junit.Rule; import org.junit.Test; import org.powermock.modules.junit4.rule.PowerMockRule; import static org.powermock.api.mockito.PowerMockito.mockStatic; public class Quickstart { @Rule public PowerMockRule rule = new PowerMockRule(); @Test public void testStatic() { mockStatic(System.class); // test logic } }
Debug
Known issues
gotchaPowerMock 2.0.9 requires Java 8+ and may conflict with newer JUnit versions.
fix
Use JUnit 4.12 or later, and ensure no conflicting mock frameworks.
affects: >=2.0.0
Upgrade
Version history
2.0.9latest on Maven
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
10
Resources
powermock-module-junit4-rule-agent — mvn dependency:get powermock-module-junit4-rule-agent · libregistry