org.powermock.api.mockito.ClassNotPreparedException: The class com.activeandroid.content.ContentProvider not prepared for test. To prepare this class, add class to the '@PrepareForTest' annotation. In case if you don't use this annotation, add the annotation on class or method level.

stackoverflow.com | 4 months ago
  1. 0

    PowerMock + Robolectric + ActiveAndroid

    Stack Overflow | 6 months ago | user5483163
    org.powermock.api.mockito.ClassNotPreparedException: The class com.activeandroid.content.ContentProvider not prepared for test. To prepare this class, add class to the '@PrepareForTest' annotation. In case if you don't use this annotation, add the annotation on class or method level.
  2. 0

    android - PowerMock + Robolectric - Stack Overflow на русском

    stackoverflow.com | 4 months ago
    org.powermock.api.mockito.ClassNotPreparedException: The class com.activeandroid.content.ContentProvider not prepared for test. To prepare this class, add class to the '@PrepareForTest' annotation. In case if you don't use this annotation, add the annotation on class or method level.
  3. 0

    mockito: The class [X] not prepared for test

    Stack Overflow | 2 months ago | Amadeu Cabanilles
    org.powermock.api.mockito.ClassNotPreparedException: The class org.springframework.web.util.WebUtils not prepared for test. To prepare this class, add class to the '@PrepareForTest' annotation. In case if you don't use this annotation, add the annotation on class or method level.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    1 unregistered visitors

    Root Cause Analysis

    1. org.powermock.api.mockito.ClassNotPreparedException

      The class com.activeandroid.content.ContentProvider not prepared for test. To prepare this class, add class to the '@PrepareForTest' annotation. In case if you don't use this annotation, add the annotation on class or method level.

      at org.powermock.api.mockito.expectation.reporter.MockitoPowerMockReporter.classNotPrepared()
    2. org.powermock.api
      MockitoPowerMockReporter.classNotPrepared
      1. org.powermock.api.mockito.expectation.reporter.MockitoPowerMockReporter.classNotPrepared(MockitoPowerMockReporter.java:31)
      1 frame
    3. powermock-api-mockito
      PowerMockito.mockStatic
      1. org.powermock.api.mockito.internal.mockcreation.MockTypeValidatorFactory$DefaultMockTypeValidator.validate(MockTypeValidatorFactory.java:38)
      2. org.powermock.api.mockito.internal.mockcreation.AbstractMockCreator.validateType(AbstractMockCreator.java:18)
      3. org.powermock.api.mockito.internal.mockcreation.MockCreator.createMock(MockCreator.java:57)
      4. org.powermock.api.mockito.internal.mockcreation.MockCreator.mock(MockCreator.java:47)
      5. org.powermock.api.mockito.PowerMockito.mockStatic(PowerMockito.java:71)
      5 frames
    4. handsfree.penny.common
      DeckardActivityTest.testStaticMocking
      1. handsfree.penny.common.DeckardActivityTest.testStaticMocking(DeckardActivityTest.java:30)
      1 frame
    5. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:498)
      4 frames
    6. JUnit
      InvokeMethod.evaluate
      1. org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
      2. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      3. org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
      4. org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      4 frames
    7. Roboelectric
      RobolectricTestRunner.runChild
      1. org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:251)
      2. org.robolectric.RobolectricTestRunner.runChild(RobolectricTestRunner.java:188)
      3. org.robolectric.RobolectricTestRunner.runChild(RobolectricTestRunner.java:54)
      3 frames
    8. JUnit
      ParentRunner$2.evaluate
      1. org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
      2. org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
      3. org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
      4. org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
      5. org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
      5 frames
    9. Roboelectric
      RobolectricTestRunner$1.evaluate
      1. org.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:152)
      1 frame
    10. JUnit
      ParentRunner.run
      1. org.junit.runners.ParentRunner.run(ParentRunner.java:363)
      1 frame
    11. powermock-module-junit4
      DelegatingPowerMockRunner.run
      1. org.powermock.modules.junit4.internal.impl.DelegatingPowerMockRunner$2.call(DelegatingPowerMockRunner.java:148)
      2. org.powermock.modules.junit4.internal.impl.DelegatingPowerMockRunner$2.call(DelegatingPowerMockRunner.java:140)
      3. org.powermock.modules.junit4.internal.impl.DelegatingPowerMockRunner.withContextClassLoader(DelegatingPowerMockRunner.java:131)
      4. org.powermock.modules.junit4.internal.impl.DelegatingPowerMockRunner.run(DelegatingPowerMockRunner.java:140)
      4 frames
    12. powermock-module-junit4-common
      AbstractCommonPowerMockRunner.run
      1. org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.run(JUnit4TestSuiteChunkerImpl.java:121)
      2. org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner.run(AbstractCommonPowerMockRunner.java:53)
      2 frames
    13. powermock-module-junit4
      PowerMockRunner.run
      1. org.powermock.modules.junit4.PowerMockRunner.run(PowerMockRunner.java:59)
      1 frame
    14. JUnit
      JUnitCore.run
      1. org.junit.runners.Suite.runChild(Suite.java:128)
      2. org.junit.runners.Suite.runChild(Suite.java:27)
      3. org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
      4. org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
      5. org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
      6. org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
      7. org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
      8. org.junit.runners.ParentRunner.run(ParentRunner.java:363)
      9. org.junit.runner.JUnitCore.run(JUnitCore.java:137)
      9 frames
    15. IntelliJ junit4 module
      JUnit4IdeaTestRunner.startRunnerWithArgs
      1. com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
      1 frame
    16. IDEA
      JUnitStarter.main
      1. com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234)
      2. com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74)
      2 frames
    17. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:498)
      4 frames
    18. IDEA
      AppMain.main
      1. com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
      1 frame