PowerMock is a Java framework that allows you to unit test code normally regarded as untestable.

Overview

PowerMock

Build Status Maven Central Download Javadoc

Writing unit tests can be hard and sometimes good design has to be sacrificed for the sole purpose of testability. Often testability corresponds to good design, but this is not always the case. For example final classes and methods cannot be used, private methods sometimes need to be protected or unnecessarily moved to a collaborator, static methods should be avoided completely and so on simply because of the limitations of existing frameworks.

PowerMock is a framework that extends other mock libraries such as EasyMock with more powerful capabilities. PowerMock uses a custom classloader and bytecode manipulation to enable mocking of static methods, constructors, final classes and methods, private methods, removal of static initializers and more. By using a custom classloader no changes need to be done to the IDE or continuous integration servers which simplifies adoption. Developers familiar with the supported mock frameworks will find PowerMock easy to use, since the entire expectation API is the same, both for static methods and constructors. PowerMock aims to extend the existing API's with a small number of methods and annotations to enable the extra features. Currently PowerMock supports EasyMock and Mockito.

When writing unit tests it is often useful to bypass encapsulation and therefore PowerMock includes several features that simplifies reflection specifically useful for testing. This allows easy access to internal state, but also simplifies partial and private mocking.

Please note that PowerMock is mainly intended for people with expert knowledge in unit testing. Putting it in the hands of junior developers may cause more harm than good.

News

  • 2019-04-21: PowerMock 2.0.2 has been released and is avaliable in Maven Central. The release includes fixes for issue with PowerMock JavaAgent and the latest JDK and a security issue with the build script.
  • 2019-01-07: PowerMock 2.0.0 has been released. Main changes: offical supporting Mockito 2.x and dropping supporting Mockito 1.x. This release also supports Java 9. Other change read in release notes.
  • 2017-08-12: PowerMock 1.7.1 has been released with one, but significant change: the old API for verifying static mock has been deprecated and a new one has been added. Old API will be removed in version PowerMock 2.0 due to incompatibility with Mockito Public API.
  • 2017-06-16: PowerMock 1.7.0 has been released with support for Mockito 2 (not only beta versions) and new features such as global @PowerMockIgnore as well as bug fixes and other improvements. See release notes and change log for details.
  • 2017-02-03: Johan blogs about how to mock slf4j with PowerMock at his blog

Older News

Documentation

Contributing to PowerMock

Please, read the guideline for a new contributor before start.

Support and discussion

Join the mailing-list here for questions, feedback and support.

Comments
  • Test generates java.lang.VerifyError: Inconsistent stackmap frames at branch target

    Test generates java.lang.VerifyError: Inconsistent stackmap frames at branch target

    From [email protected] on November 06, 2011 15:23:48

    I suspect this may be a manifestation of this issue: https://bugs.eclipse.org/bugs/show_bug.cgi?id=339388 . It wasn't clear if this is a Java issue, or something that needs to be fixed on a product-by-product basis, so I thought I'd bring it to your attention just in case. What steps will reproduce the problem? 1. Compiling and running my project with Java 1.7.0_01 on Windows (I tried to isolate the problem, but it only appears in the context of the entire project.) What is the expected output? What do you see instead? When I run certain tests (described below), I get the following runtime error:

    1. testOpenWriter_file_string_autoflush_setsEncodings(edu.gvsu.kurmasz.warszawa.io.OutputHelperTest2) java.lang.VerifyError: Inconsistent stackmap frames at branch target 134 in method edu.gvsu.kurmasz.warszawa.io.OutputHelperTest2$CharsetTes ter.values()[Ledu/gvsu/kurmasz/warszawa/io/OutputHelperTest2$CharsetTester; at offset 126 at edu.gvsu.kurmasz.warszawa.io.OutputHelperTest2.testOpenWriter_file_string_autoflush_setsEncodings(OutputHelperTest2.java:353) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:66) at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.runTestMethod(PowerMoc kJUnit44RunnerDelegateImpl.java:307) at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:86) at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:94) at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.executeTest(PowerMockJ Unit44RunnerDelegateImpl.java:294) at org.powermock.modules.junit4.internal.impl.PowerMockJUnit47RunnerDelegateImpl$PowerMockJUnit47MethodRunner.executeTestInSuper(Pow erMockJUnit47RunnerDelegateImpl.java:112) at org.powermock.modules.junit4.internal.impl.PowerMockJUnit47RunnerDelegateImpl$PowerMockJUnit47MethodRunner.executeTest(PowerMockJ Unit47RunnerDelegateImpl.java:73) at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.runBeforesThenTestThen Afters(PowerMockJUnit44RunnerDelegateImpl.java:282) at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:84) at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:49) at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.invokeTestMethod(PowerMockJUnit44RunnerDelegateImpl .java:207) at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.runMethods(PowerMockJUnit44RunnerDelegateImpl.java:
    2. at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$1.run(PowerMockJUnit44RunnerDelegateImpl.java:120) at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:34) at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:44) at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.run(PowerMockJUnit44RunnerDelegateImpl.java:118) at org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.run(JUnit4TestSuiteChunkerImpl.java:102) at org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner.run(AbstractCommonPowerMockRunner.java:53) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:24) What version of the product are you using? On what operating system? I'm using java 1.7.0_01 on Windows with the following jar files: cglib-nodep-2.2.jar junit-4.8.2.jar objenesis-1.2.jar javassist-3.15.0-GA.jar mockito-all-1.8.5.jar powermock-mockito-1.4.10-full.jar Please provide any additional information below. * Everything works fine I compile the project using java 1.6.
    • Everything works fine if I run the tests using this flag: -XX:-UseSplitVerifier
    • If I take the offending class and its test and move them to a new project, the problem disappears (i.e., I can't seem to isolate the problem in a small example.)

    Thus, I suspect this may be a manifestation of this issue: https://bugs.eclipse.org/bugs/show_bug.cgi?id=339388 . It wasn't clear if this is a Java issue, or something that needs to be fixed on a product-by-product basis.

    If it helps, I've also attached a copy of the test file. The problem seems to be related to the enum CharacterTester

    Attachment: OutputHelperTest.java

    Original issue: http://code.google.com/p/powermock/issues/detail?id=355

    bug imported Priority:High 
    opened by johanhaleby 171
  • PowerMock disables EclEmma code coverage

    PowerMock disables EclEmma code coverage

    From [email protected] on September 10, 2012 09:55:56

    What steps will reproduce the problem? 1.Create a powermock test with Mockito, the test class is decorated with @RunWith and @PrepareForTest annotation. 2.Run the Test with "coverage as". What is the expected output? What do you see instead? Expected: EclEmma shows correct code coverage report. Instead: EclEmma shows zero code coverage on target class. What version of the product are you using? On what operating system? 1. Eclipse is 3.7.

    1. EclEmma Plugin: 2.1.4.
    2. PowerMock: powermock-mockito-1.4.12-full.jar.
    3. OS: Windows XP sp2.
    4. JDK: 1.6. Please provide any additional information below. N/A.

    Original issue: http://code.google.com/p/powermock/issues/detail?id=402

    bug Priority:High Cannot be fixed 
    opened by johanhaleby 59
  • Calling another method in the same class from equals results in a StackOverflowError

    Calling another method in the same class from equals results in a StackOverflowError

    From [email protected] on January 16, 2009 18:40:35

    E.g. public class ClassA {

    @Override public int hashCode() { return getId(); }

    public int getId() { return 3; } }

    Original issue: http://code.google.com/p/powermock/issues/detail?id=88

    bug imported Priority:High 
    opened by johanhaleby 40
  • Test with PowerMock fails when run on java 1.7.0_65

    Test with PowerMock fails when run on java 1.7.0_65

    From begul1234 on July 17, 2014 10:28:21

    What steps will reproduce the problem? - Have a unit test annotated with @RunWith(PowerMockRunner.class) @PrepareForTest(MyEndpoint.class) and use mockStatic(MyEndpoint.class); in the setUp method of the test. What is the expected output? What do you see instead? I would expect that the test runs normally and without error as it did before with older java versions (1.7.0_55 works).

    Instead the test fails with the following stacktrace: java.lang.VerifyError: Bad method call from inside of a branch Exception Details: Location: net/sample/api/endpoint/AbstractB2CJaxRsEndpoint.(Lorg/powermock/core/IndicateReloadClass;)V @41: invokespecial Reason: Error exists in the bytecode Bytecode: 0000000: 2a2b 4e4d 1210 b800 1604 bd00 0d59 032d 0000010: 5313 0126 b800 1bb8 0021 3a05 1905 b200 0000020: 25a5 000e 2a01 c000 27b7 002a a700 0a2c 0000030: 2db7 002a 0157 b1 Stackmap Table: full_frame(@47,{UninitializedThis,Object[#39],UninitializedThis,Object[#39],Top,Object[#13]},{}) full_frame(@54,{Object[#2],Object[#39],Object[#2],Object[#39],Top,Object[#13]},{}) java.lang.VerifyError: Bad method call from inside of a branch Exception Details: Location: net/sample/api/endpoint/AbstractB2CJaxRsEndpoint.(Lorg/powermock/core/IndicateReloadClass;)V @41: invokespecial Reason: Error exists in the bytecode Bytecode: 0000000: 2a2b 4e4d 1210 b800 1604 bd00 0d59 032d 0000010: 5313 0126 b800 1bb8 0021 3a05 1905 b200 0000020: 25a5 000e 2a01 c000 27b7 002a a700 0a2c 0000030: 2db7 002a 0157 b1
    Stackmap Table: full_frame(@47,{UninitializedThis,Object[#39],UninitializedThis,Object[#39],Top,Object[#13]},{}) full_frame(@54,{Object[#2],Object[#39],Object[#2],Object[#39],Top,Object[#13]},{})

    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2532)
    at java.lang.Class.getDeclaredConstructors(Class.java:1901)
    at org.mockito.internal.creation.jmock.ClassImposterizer.setConstructorsAccessible(ClassImposterizer.java:75)
    at org.mockito.internal.creation.jmock.ClassImposterizer.imposterise(ClassImposterizer.java:70)
    at org.powermock.api.mockito.internal.mockcreation.MockCreator.createMethodInvocationControl(MockCreator.java:110)
    at org.powermock.api.mockito.internal.mockcreation.MockCreator.mock(MockCreator.java:60)
    at org.powermock.api.mockito.PowerMockito.mockStatic(PowerMockito.java:70)
    at net.sample.api.endpoint.contacting.communication.peer.CommunicationTest.setUp(CommunicationTest.java:82)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.junit.internal.runners.MethodRoadie.runBefores(MethodRoadie.java:132)
    at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:95)
    at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.executeTest(PowerMockJUnit44RunnerDelegateImpl.java:296)
    at org.powermock.modules.junit4.internal.impl.PowerMockJUnit49RunnerDelegateImpl$PowerMockJUnit49MethodRunner.executeTestInSuper(PowerMockJUnit49RunnerDelegateImpl.java:116)
    at org.powermock.modules.junit4.internal.impl.PowerMockJUnit49RunnerDelegateImpl$PowerMockJUnit49MethodRunner.executeTest(PowerMockJUnit49RunnerDelegateImpl.java:77)
    at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.runBeforesThenTestThenAfters(PowerMockJUnit44RunnerDelegateImpl.java:284)
    at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:86)
    at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:49)
    at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.invokeTestMethod(PowerMockJUnit44RunnerDelegateImpl.java:209)
    at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.runMethods(PowerMockJUnit44RunnerDelegateImpl.java:148)
    at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$1.run(PowerMockJUnit44RunnerDelegateImpl.java:122)
    at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:33)
    at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:45)
    at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.run(PowerMockJUnit44RunnerDelegateImpl.java:120)
    at org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.run(JUnit4TestSuiteChunkerImpl.java:101)
    at org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner.run(AbstractCommonPowerMockRunner.java:53)
    at org.powermock.modules.junit4.PowerMockRunner.run(PowerMockRunner.java:53)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:249)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:142)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
    at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:104)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75) What version of the product are you using? On what operating system? PowerMock 1.5.5 on MacOSX or Linux Please provide any additional information below.
    

    Original issue: http://code.google.com/p/powermock/issues/detail?id=504

    bug Deferred imported Priority:Medium 
    opened by johanhaleby 34
  • OSGi-ify PowerMock

    OSGi-ify PowerMock

    From [email protected] on November 13, 2009 20:06:39

    Please add OSGi metadata to manifest files. This will allow in-container testing with PowerMock.

    Original issue: http://code.google.com/p/powermock/issues/detail?id=204

    enhancement imported Priority:Low 
    opened by johanhaleby 34
  • Test case with expectedExceptions fails when using PowerMock with TestNG.

    Test case with expectedExceptions fails when using PowerMock with TestNG.

    From [email protected] on February 02, 2012 20:37:36

    What steps will reproduce the problem? 1. Create a Test class which has the below method @ObjectFactory public IObjectFactory getObjectFactory() { return new org.powermock.modules.testng.PowerMockObjectFactory(); } 2. Create a test case with expectedExceptions annotation 3. Run it using Eclipse TestNG plugin. What is the expected output? What do you see instead? We are expecting the test case to pass but test case fails and gives the below message . Expected exception com.org.test.DAOException but got org.testng.TestException: Expected exception com.org.test.DAOException but got com.org.test.DAOException: com.org.test.DAOException at org.testng.internal.Invoker.handleInvocationResults(Invoker.java:1459) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1222) What version of the product are you using? On what operating system? TestiNG 6.3.1 Power mock 1.4.11. Eclipse Plugin for TestNG. Windows XP. Please provide any additional information below. The same test case passes with TestNG when we don't use power mock.

    After debugging through the TestNG code, noticed that below line (# 1794) in isExpectedException method inside the testng/src/main/java/org/testng/internal/Invoker.java fails.

    exception.isAssignableFrom(realExceptionClass): this statement always returns false even if the exception and realExpectionClass are same.

    Original issue: http://code.google.com/p/powermock/issues/detail?id=366

    bug imported Priority:Medium 
    opened by johanhaleby 31
  • createPartialMock should support mocking overridden methods in super classes

    createPartialMock should support mocking overridden methods in super classes

    From [email protected] on October 29, 2008 12:45:40

    If A extends B and both have a method called "mockMe" (A overrides B's mockMe method) you should be able to specify where in the class hierarchy the method should be mocked.

    Original issue: http://code.google.com/p/powermock/issues/detail?id=51

    enhancement imported Priority:Medium 
    opened by johanhaleby 30
  • JDK 9 support

    JDK 9 support

    What steps will reproduce the problem?

    @RunWith(PowerMockRunner.class)
    public class Mockjdk9Test{
    
        @Test
        public void helloJava9() {
            System.out.println("Success");
        }
    }
    

    What is the expected output? Success What do you see instead?

    org.objenesis.ObjenesisException: java.lang.reflect.InvocationTargetException
    Caused by: java.lang.reflect.InvocationTargetException
    Caused by: java.lang.IllegalAccessError: class jdk.internal.reflect.ConstructorAccessorImpl loaded by org/powermock/core/classloader/MockClassLoader cannot access jdk/internal/reflect superclass jdk.internal.reflect.MagicAccessorImpl
    

    What version of the product are you using? 1.6.6 On what operating system? Fedora 25 Please provide any additional information below. JDK 9 build 166 Checkout http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/36223b379545 for why it now fails

    Thanks!

    enhancement 
    opened by johnpoth 28
  • PowerMock sometimes causes other TestNG tests to fail

    PowerMock sometimes causes other TestNG tests to fail

    From [email protected] on December 16, 2010 19:55:01

    Please see the attached small demo project with two test classes that demonstrate the problem.

    My environment is the following: Windows 7 Enterprise 64-bit JDK 1.6.0_22 Maven 2.2.1 PowerMock 1.4.6 TestNG 5.14.1

    ServiceTest uses PowerMock to mock class with final modifier (@PrepareForTest and @ObjectFactory are there). XmlReaderTest just creates new instance of SAXParser. Each of the tests succeed when they run independently. However XmlReaderTest fails when running the whole suite with the following exception:

    java.lang.ClassCastException: com.sun.org.apache.xerces.internal.parsers.SAXParser cannot be cast to org.xml.sax.XMLReader

    FAQ describes this issue and advises to solve it by adding @PowerMockIgnore({"javax.xml.", "org.xml.sax."}) to XmlReaderTest. And this fix works. BUT why does PowerMock alter behavior of other tests? It is definetely not OK.

    There are other classloading issues that are not demoed in this sample. The overall idea is that tests that do not use PowerMock must not be affected by it.

    Partially the problem is that there is only one ObjectFactory per suite and this ObjectFactory is responsible for creating all test class instances. I have solved the problem by writing and applying custom ObjectFactory that inspects test class and delegates creation of test class instance to PowerMockObjectFactory ONLY if test class has PowerMock annotations. Otherwise ObjectFactory delegates creation to default ObjectFactoryImpl.

    It seems to me that similar ObjectFactory logic should be the part of the library. Classloader that PowerMock uses causes issues for other tests frequently and sometimes it is VERY HARD to understand what is going wrong.

    Attachment: affecting-other-tests.zip

    Original issue: http://code.google.com/p/powermock/issues/detail?id=299

    bug imported Priority:Medium 
    opened by johanhaleby 28
  • Class not prepared for test - even though it is.

    Class not prepared for test - even though it is.

    What steps will reproduce the problem?

    Run this example:

    @RunWith(PowerMockRunner.class)
    @PrepareForTest(BackgroundMusicManager.class)
    class ConfigurationContextTest {
    
        private BackgroundMusicManager mockMusicManager;
    
        @BeforeEach
        void setup() {
            mockMusicManager = mock(BackgroundMusicManager.class);
            mockStatic(BackgroundMusicManager.class);
            when(BackgroundMusicManager.getInstance()).thenReturn(mockMusicManager);
        }
    
        @Test 
        void test() {
            // some code
        }
    }
    

    Where the BackgroundMusicManager.java contains this, amongst other things:

    @Slf4j
    public class BackgroundMusicManager {
    
        @Getter
        private static BackgroundMusicManager instance = new BackgroundMusicManager();
    
    }
    

    What is the expected output?

    I expect the test to run at least.

    What do you see instead?

    org.powermock.api.mockito.ClassNotPreparedException: 
    
    [Ljava.lang.Object;@7a9c84a5
    The class net.gazeplay.commons.utils.games.BackgroundMusicManager not prepared for test.
    
    	at org.powermock.api.mockito.expectation.reporter.MockitoPowerMockReporter.classNotPrepared(MockitoPowerMockReporter.java:29)
    	at org.powermock.api.mockito.internal.mockcreation.MockTypeValidatorFactory$DefaultMockTypeValidator.validate(MockTypeValidatorFactory.java:37)
    	at org.powermock.api.mockito.internal.mockcreation.AbstractMockCreator.validateType(AbstractMockCreator.java:10)
    	at org.powermock.api.mockito.internal.mockcreation.DefaultMockCreator.createMock(DefaultMockCreator.java:49)
    	at org.powermock.api.mockito.internal.mockcreation.DefaultMockCreator.mock(DefaultMockCreator.java:40)
    	at org.powermock.api.mockito.PowerMockito.mockStatic(PowerMockito.java:62)
    	at net.gazeplay.ui.scenes.configuration.ConfigurationContextTest.setup(ConfigurationContextTest.java:31)
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
    	at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:628)
    	at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:117)
    	at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.invokeMethodInExtensionContext(ClassTestDescriptor.java:439)
    	at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.lambda$synthesizeBeforeEachMethodAdapter$15(ClassTestDescriptor.java:427)
    	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeBeforeEachMethods$3(TestMethodTestDescriptor.java:149)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeBeforeMethodsOrCallbacksUntilExceptionOccurs(TestMethodTestDescriptor.java:169)
    	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeBeforeEachMethods(TestMethodTestDescriptor.java:148)
    	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:123)
    	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:68)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:135)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
    	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
    	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
    	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
    	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
    	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
    	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
    	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
    	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
    	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
    	at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
    	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:229)
    	at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:197)
    	at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:211)
    	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:191)
    	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)
    	at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:69)
    	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
    	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230)
    	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58)
    

    Where line 31: mockStatic(BackgroundMusicManager.class);

    What version of the product are you using? 2.0.4

    opened by Tohaker 27
  • PowerMockito + Mockito 1.9.5 NoClassDefFound

    PowerMockito + Mockito 1.9.5 NoClassDefFound

    From mellowaredev on July 20, 2012 19:53:25

    It looks like Mockito 1.9.5 removed the MockitoInvocationHandler.java class PowerMockito was counting on.

    java.lang.NoClassDefFoundError: org/mockito/internal/MockitoInvocationHandler at org.powermock.api.mockito.PowerMockito.mock(PowerMockito.java:138)

    Original issue: http://code.google.com/p/powermock/issues/detail?id=398

    bug imported Priority:High 
    opened by johanhaleby 25
  • Will there be a new release based on powermock 2.0.9?

    Will there be a new release based on powermock 2.0.9?

    Hi, @johnjohndoe @darxriggs

    Is this something you can debug and fix?

    No, I'd like to consult some questions about the new release.

    Is this question about PowerMock usage?

    No.

    None of the above, want to create a GitHub issue

    I'd like to ask about the release plan,If no new version is released, is there an EOS/EOL plan for the current version? it would be a great help if I can get the answer. Thank you!

    opened by ACaiXLD1115 0
  • Bump actions/checkout from 2 to 3.1.0

    Bump actions/checkout from 2 to 3.1.0

    Bumps actions/checkout from 2 to 3.1.0.

    Release notes

    Sourced from actions/checkout's releases.

    v3.1.0

    What's Changed

    New Contributors

    Full Changelog: https://github.com/actions/checkout/compare/v3.0.2...v3.1.0

    v3.0.2

    What's Changed

    Full Changelog: https://github.com/actions/checkout/compare/v3...v3.0.2

    v3.0.1

    v3.0.0

    • Updated to the node16 runtime by default
      • This requires a minimum Actions Runner version of v2.285.0 to run, which is by default available in GHES 3.4 or later.

    v2.4.2

    What's Changed

    Full Changelog: https://github.com/actions/checkout/compare/v2...v2.4.2

    v2.4.1

    • Fixed an issue where checkout failed to run in container jobs due to the new git setting safe.directory

    v2.4.0

    • Convert SSH URLs like org-<ORG_ID>@github.com: to https://github.com/ - pr

    v2.3.5

    Update dependencies

    v2.3.4

    v2.3.3

    ... (truncated)

    Changelog

    Sourced from actions/checkout's changelog.

    v3.1.0

    v3.0.2

    v3.0.1

    v3.0.0

    v2.3.1

    v2.3.0

    v2.2.0

    v2.1.1

    • Changes to support GHES (here and here)

    v2.1.0

    v2.0.0

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 0
  • Bump gradle-release from 2.4.0 to 3.0.2

    Bump gradle-release from 2.4.0 to 3.0.2

    Bumps gradle-release from 2.4.0 to 3.0.2.

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies java 
    opened by dependabot[bot] 0
  • Bump gradle-animalsniffer-plugin from 1.4.1 to 1.6.0

    Bump gradle-animalsniffer-plugin from 1.4.1 to 1.6.0

    Bumps gradle-animalsniffer-plugin from 1.4.1 to 1.6.0.

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies java 
    opened by dependabot[bot] 0
  • Why just one test worked when using mockStatic in method modified by @BeforeClass?

    Why just one test worked when using mockStatic in method modified by @BeforeClass?

    Why test1 logger the message, but I use mockStatic in @BeforeClass? How to make test1's logger mock just using mockStatic. junit:4.13 Test Class

    @RunWith(PowerMockRunner.class)
    @PrepareForTest({
            LoggerFactory.class
    })
    public class ServiceTest {
    
        @InjectMocks
        private ServiceB serviceB;
    
        @BeforeClass
        public static void setUpClass() {
            PowerMockito.mockStatic(LoggerFactory.class);
            PowerMockito.when(LoggerFactory.getLogger(Mockito.any(Class.class)))
                    .thenReturn(PowerMockito.mock(Logger.class));
        }
    
        @Test
        public void test() {
            String s = serviceB.fun1();
        }
    
        @Test
        public void test1() {
            String s = serviceB.fun1();
        }
    }
    

    ServiceB

    @Service
    public class ServiceB {
    
        private final Logger logger = LoggerFactory.getLogger(ServiceB.class);
    
        @Autowired
        private ServiceA serviceA;
    
        public String fun1() {
            logger.info("------serviceB--log------");
            return "Hello";
        }
    }
    

    console log

    23:07:53.213 [main] INFO com.example.surefiletest.service.ServiceB - ------serviceB--log------
    
    Process finished with exit code 0
    
    opened by luoyanzecs 0
  • WARNING: An illegal reflective access operation has occurred

    WARNING: An illegal reflective access operation has occurred

    WARNING: An illegal reflective access operation has occurred 2022-07-11 16:03:21.965 WARNING: Illegal reflective access by org.powermock.reflect.internal.WhiteboxImpl (file:/Users/philips/.gradle/caches/transforms-3/1733d2050651f35ec24574fd8e61a4a1/transformed/jetified-powermock-reflect-2.0.9.jar) to method java.util.concurrent.TimeUnit.cvt(long,long,long)

    opened by rakshashettyphilips 0
Releases(powermock-2.0.9)
  • powermock-2.0.9(Nov 2, 2020)

  • powermock-2.0.8(Nov 1, 2020)

  • powermock-2.0.2(Apr 21, 2019)

  • powermock-2.0.1(Apr 21, 2019)

  • powermock-2.0.0(Jan 7, 2019)

    • 2019-01-07 - 77 commits by 10 authors - published to Bintray
    • Commits: Arthur Zagretdinov (56), PowerMock Release Tools (11), Henri Tremblay (2), Ismael Juma (2), beegee1 (1), Enrico Olivelli (1), hsynkrtl (1), Paul Parenko (1), Sean Gilhooly (1), Timo Meinen (1)
    • [Major changes] Mockito Public API Support Roadmap [(#726)]
    • [Major changes] Dropped supporting Mockito 1.x as result removed module powermock-api-mockito
    • [Major changes] Dropped supporting EasyMock 3.1. Offical supported EasyMock 3.5 (https://github.com/powermock/powermock/issues/726)
    • [Enhancements] Removed deprecated code in PowerMock 2.0. (#839)
    • [Enhancements] JDK 9 support (#783)
    • [Bugfixes] Fixes #888: Disable Security of X-Stream (#962)
    • [Bugfixes] #959 fix compile error due to unused import of a class which is not i… (#960)
    • [Bugfixes] Issue 939: Error with setInternalState and JDK12 "java.lang.NoSuchFieldException: modifiers (#955) (https://github.com/powermock/powermock/pull/948)
    • [Bugfixes] Compile error due to unused import of a class which is not in the dependencies (#959)
    • [Bugfixes] JDK9, power mockito 2.0.0-beta.5 - final class issue when mocking static method (#888)
    • [Bugfixes] @Mock annotation from easymock api does not work for two fields of the same type. (#755)
    Source code(tar.gz)
    Source code(zip)
  • powermock-2.0.0-RC.1(Oct 24, 2018)

    • 2018-10-24 - 69 commits by 6 authors - published to Bintray
    • Commits: Arthur Zagretdinov (54), PowerMock Release Tools (11), Henri Tremblay (1), hsynkrtl (1), Ismael Juma (1), Sean Gilhooly (1)
    • [Major changes] Mockito Public API Support Roadmap (#726)
    • [Major changes] Dropped supporting Mockito 1.x as result removed module powermock-api-mockito
    • [Major changes] Dropped supporting EasyMock 3.1. Offical supported EasyMock 3.5
    • [Bugfixes] @Mock annotation from easymock api does not work for two fields of the same type. (#755)
    • [Enhancements] Removed deprecated code in PowerMock 2.0. (#839)
    • [Enhancements] JDK 9 support (#783)
    • Preparing PowerMock 2.0 Release without ByteBuddy [ci maven-central-release] (#948)
    • Use EasyMock exposed MockType instead of the deprecated internal one (#944)
    • Update PowerMockAgent.java (#878)
    Source code(tar.gz)
    Source code(zip)
  • powermock-1.7.4(Feb 24, 2018)

  • powermock-2.0.0-beta.5(Sep 17, 2017)

    It's a first PowerMock 2.0.0 release published to Maven Central.

    Published:

    Maven Central

    Download

    Major changes

    • Using only Public Mockito API (#726)
    • Removed deprecated code. (#839)
    • Support JDK 9.0 (#783)

    Bug Fixes

    • Fixed regression issue with @mock annotation from easymock api does not work for two fields of the same type. (#755)

    Incapability with PowerMock 1.x:

    • Possible incapability due toString methods returns by default name of mocked.
    • Fully drop supporting of Mockito 1.x
    • Removed deprecated PowerMockito verifyStatic(). It is replaced by verifyStatic(Class) mockStatic does not reset mocking process anymore. As result you may get the UnfinishedVerificationException or UnfinishedStubbingException
    • Remove deprecated API: Supporting jUnit 3
    • Remove deprecated annotation 'org.powermock.core.classloader.annotations.Mock'

    Other changes:

    • Removed all Mockito copy-pasted code
    • Use delegate MockMaker to prevent issue with replacing Mockito MockMaker when PowerMock in class path (see #769, mockito/mockito#1004)
    • Replace using Mockito internal classes with Mockito public API, except annotation processing (#838).
    Source code(tar.gz)
    Source code(zip)
  • powermock-1.7.3(Sep 16, 2017)

  • powermock-1.7.2(Sep 15, 2017)

    Published to Bintray

    • [Bugfixes] @Mock annotation from easymock api does not work for two fields of the same type. (#755)
    • [Enhancements] Use Mockito Shipkit for CD (#826)
    Source code(tar.gz)
    Source code(zip)
  • powermock-2.0.0-beta.1(Sep 10, 2017)

    2.0.0-beta.1 (2017-09-10) - 35 commits by Arthur Zagretdinov (32), Wojtek Wilk (2), PowerMock Release Tools (1) - published to Bintray

    [Major changes] Mockito Public API Support Roadmap (#726) [Enhancements] Removed deprecated code in PowerMock 2.0. (#839) [Enhancements] Use Mockito Shipkit for CD (#826)

    Incapability with PowerMock 1.x:

    • Possible incapability due toString methods returns by default name of mocked.
    • Fully drop supporting of Mockito 1.x
    • Removed deprecated PowerMockito verifyStatic(). It is replaced by verifyStatic(Class) mockStatic does not reset mocking process anymore. As result you may get the UnfinishedVerificationException or UnfinishedStubbingException
    • Remove deprecated API: Supporting jUnit 3
    • Remove deprecated annotation 'org.powermock.core.classloader.annotations.Mock'

    Other changes:

    • Removed all Mockito copy-pasted code
    • Use delegate MockMaker to prevent issue with replacing Mockito MockMaker when PowerMock in class path (see #769, mockito/mockito#1004)
    • Replace using Mockito internal classes with Mockito public API, except annotation processing (#838).
    Source code(tar.gz)
    Source code(zip)
  • powermock-1.7.1(Aug 12, 2017)

    Major changes

    • The release contains one, but significant change: the old API for verifying static mock has been deprecated and a new one has been added. Old API will be removed in version PowerMock 2.0 due to incompatibility with Mockito Public API (#832)
    Source code(tar.gz)
    Source code(zip)
  • powermock-1.7.0(Jun 16, 2017)

    Majority changes

    • Added support for non beta versions of Mockito 2. Thanks to everyone that helped out and provided pull requests.
    • Added ability to set global @PowerMockIgnore.

    Improvements

    • Implement #793 PowerMockMaker for Mockito 2: A new version of PowerMockMaker implemented. It does not conflict with Mockito MockMaker any more.
    • Added supporting Mockito 2.x (thanks to Gregor Stamac @gstamac for pull request)
    • Added supporting global ignore via configuration (issue # #801)
    • Added supporting org.mockito.internal.creation.bytebuddy.InlineByteBuddyMockMaker via PowerMock configuration (issues #793, #774)

    Bug fixes

    • Fixed issue #722 IllegalArgumentException is output to standard error (thanks to Kotaro Nanri @k-nanri for pull request)
    • Fixed issue #717 Regression: MethodNotFoundException
    • Fixed issue #731 No methods matching the name(s) get were found in the class hierarchy for interfaces
    • Fixed issue #753 fix to upgrade code to be compatible with later versions of Mockito (thanks to emmaLP @emmaLP for pull request)
    • Fixed issue #763 whenNew not matching constructor when null is passed as first or last argument. (thanks to @podarsmarty podarsmarty for pull request)
    • Fixed issue #781 Call mocked equals static method instead of real (thanks to @Ilya-Gh Ilya Ghirici for pull request)
    • Fixed issue #772: PowerMockIgnorePackagesExtractorImpl should visit interfaces. (thanks to François Jacques @hypnoce for pull request)
    • Fixed issue with javax.xml and org.w3c. Previously when PowerMock was used with class which works with XML adding @PowerMockIgnore({"org.w3c.*", "javax.xml.*"}) was required. See example

    Other changes:

    • Optimizations in powermock-reflect (thanks to Roman Leventov @leventov for pull request) (#724)
    • Migrated from Maven to Gradle (#728)
    • Fix for #701 partially does not work any more, because ByteBuddy implementation of MockMaker always intercept calls to equals and return true only in case if passed object is the same instance of mocked object.
    Source code(tar.gz)
    Source code(zip)
  • powermock-1.7.0RC4(Mar 5, 2017)

  • powermock-1.7.0RC2(Jan 28, 2017)

    Majority changes

    Release includes two majority changes:

    • Support Mockito 2.4.0 for PowerMock 1.x (thanks to Gregor Stamac @gstamac for pull request)
    • Migrate from Maven to Gradle (#728)

    Bug fixes

    • Fix issue #722 IllegalArgumentException is output to standard error (thanks to Kotaro Nanri @k-nanri for pull request)
    • Fix issue #717 Regression: MethodNotFoundException
    • Fix issue #731 No methods matching the name(s) get were found in the class hierarchy for interfaces

    Other changes:

    • Optimizations in powermock-reflect (thanks to Roman Leventov @leventov for pull request) (#724)
    Source code(tar.gz)
    Source code(zip)
  • powermock-1.6.6(Jan 25, 2017)

    Highlights

    • PowerMock can work with JaCoCo offline instrumenting to get code coverage.
    • Jacoco offline instrumentation incompatibility with powermock byte-code manipulation when using @SuppressStaticInitializationFor (issue 645)
    • Fixed "TooManyActualInvocations when class is prepared for test" (issue 656)
    • Fixed ClassNotFoundException when loading cglib enhanced classes created by Spring (issue 695)
    • @Mock fields are now injectable again (1.6.5 regression) (issue 668)
    • Using Powermock with Roo/AspectJ no longer throws NullPointerException (issue 676)
    • Added support for specifying constructor parameters for Mockito for whenNew (Only mock specific calls to new)
    • Added support for setting private static final fields (thanks to Andrei Petcu @andreicristianpetcu for pull request)

    Other changes

    See change log for more details

    Source code(tar.gz)
    Source code(zip)
Owner
PowerMock
PowerMock is a Java framework that allows you to unit test code normally regarded as untestable
PowerMock
Kotlin wrapper for React Test Renderer, which can be used to unit test React components in a Kotlin/JS project.

Kotlin API for React Test Renderer Kotlin wrapper for React Test Renderer, which can be used to unit test React components in a Kotlin/JS project. How

Xavier Cho 7 Jun 8, 2022
Toster - Small test dsl based on adb commands that allows you to test the mobile application close to user actions

toster Small test dsl based on adb commands that allows you to test the mobile a

Alexander Kulikovskiy 31 Sep 1, 2022
Most popular Mocking framework for unit tests written in Java

Most popular mocking framework for Java Current version is 3.x Still on Mockito 1.x? See what's new in Mockito 2! Mockito 3 does not introduce any bre

mockito 13.6k Jan 4, 2023
Android Unit Testing Framework

Robolectric is the industry-standard unit testing framework for Android. With Robolectric, your tests run in a simulated Android environment inside a

Robolectric 5.6k Jan 3, 2023
Lbc-test-app - Test Android Senior Leboncoin

Test Android Senior Leboncoin ?? Mathieu EDET Overview Min API version : 24 This

null 0 Feb 7, 2022
A powerful test framework for Android

Cafe A powerful test framework for Android named Case Automated Framework for Everyone. Home Page http://baiduqa.github.com/Cafe/ How to make Cafe dow

Baidu 367 Nov 22, 2022
A powerful test framework for Android

Cafe A powerful test framework for Android named Case Automated Framework for Everyone. Home Page http://baiduqa.github.com/Cafe/ How to make Cafe dow

Baidu 367 Nov 22, 2022
Powerful, elegant and flexible test framework for Kotlin with additional assertions, property testing and data driven testing

Kotest is a flexible and comprehensive testing tool for Kotlin with multiplatform support. To learn more about Kotest, visit kotest.io or see our quic

Kotest 3.8k Jan 3, 2023
3 types of Tests in Android (Unit - instrumentation - UI)

UnitTestingPractice 3 types of Tests in Android Unit instrumentation (Integration) UI Unit Testing benefits confirm code work like a charm simulate Ap

Ahmed Tawfiq 8 Mar 23, 2022
Fixtures for Kotlin providing generated values for unit testing

A tool to generate well-defined, but essentially random, input following the idea of constrained non-determinism.

Appmattus Limited 191 Dec 21, 2022
A simple project to help developers in writing their unit tests in Android Platform.

AndroidUnitTesting A simple project to help developers in writing their unit tests in Android Platform. This is not a multi-module project, but has th

Bruno Gabriel dos Santos 4 Nov 10, 2021
null 866 Dec 27, 2022
A programmer-oriented testing framework for Java.

JUnit 4 JUnit is a simple framework to write repeatable tests. It is an instance of the xUnit architecture for unit testing frameworks. For more infor

JUnit 8.4k Jan 9, 2023
A programmer-oriented testing framework for Java.

JUnit 4 JUnit is a simple framework to write repeatable tests. It is an instance of the xUnit architecture for unit testing frameworks. For more infor

JUnit 8.4k Dec 28, 2022
Android library that allows you to run your acceptance tests written in Gherkin in your Android instrumentation tests.

Green Coffee Green Coffee is a library that allows you to run your acceptance tests written in Gherkin in your Android instrumentation tests using the

Mauricio Togneri 227 Nov 21, 2022
kraskaska-runner: This application allows you to automatically restart specific command. Initially made for minecraft servers.

kraskaska-runner This application allows you to automatically restart specific command. Initially made for minecraft servers. Usage: Usage: kraskaska-

Kraskaska 2 Aug 30, 2022
TestObserver to easily test LiveData and make assertions on them.

JCenter Update LiveData Testing is currently published on JCenter - it will serve packages until February 1st, 2022. LiveData Testing packages will be

Josef Raska 395 Dec 8, 2022
A custom instrumentation test runner for Android that generates XML reports for integration with other tools.

Android JUnit Report Test Runner Introduction The Android JUnit report test runner is a custom instrumentation test runner for Android that creates XM

Jason Sankey 148 Nov 25, 2022
Linkester is an Android library that aims to help Android developers test their deep links implementation.

Linkester Linkester is an Android library that aims to help Android developers test their deep links implementation. The idea is to have a new launche

Ahmad Melegy 79 Dec 9, 2022