Categories
Mastering Development

Mock Static Methods in JUnit5 using PowerMockito

Need help for Mocking Static methods using JUnit5 with PowerMockito framework. Powermock junit5 and mockito2.x not working RunnerTestSuiteChunker not found import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.powermock.api.mockito.PowerMockito; import org.powermock.core.classloader.annotations.PowerMockIgnore; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; import static org.mockito.Mockito.*; @PrepareForTest(EnvironmentUtils.class) @RunWith(PowerMockRunner.class) public class RuleControllerTest { @Before public void setup() { PowerMockito.mockStatic(EnvironmentUtils.class); } @Test public void test_rule_create_rule() throws […]