Error Message:
org.mockito.exceptions.misusing.NotAMockException: Argument passed to Mockito.mockingDetails() should be a mock, but is an instance of class java.lang.Class! at org.mockito.internal.runners.StrictRunner.run(StrictRunner.java:52) at org.mockito.junit.MockitoJUnitRunner.run(MockitoJUnitRunner.java:163) at org.mockito.runners.MockitoJUnitRunner.run(MockitoJUnitRunner.java:53)
Solution:
Delete @RunWith(MockitoJUnitRunner.class)
and add
@Before public void before(){ log.info("start--------{}",this.getClass().getName()); MockitoAnnotations.openMocks(this); }
Read More:
- How to Solve Junit Unit Test Error: “No runnable methods“
- How to Solve JUnit Debugging initializationerror ERROR
- How to Solve JVM Common Errors: outofmemoryerror & stackoverflowerror
- How to Solve classnotfoundexception error in spark without Hadoop runtime
- How to Solve Errors encountered by maven
- How to Solve Flick operate Error: not serialized
- How to Solve Swagger error: IllegalStateException
- How to Solve IBM MQ Connect Error Code 2035
- How to Solve RAR Files Extract Error with sevenzipjbinding (Multithread Processing)
- How to Solve Error: Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package.
- How to Solve Error occurred during initialization of boot layer
- How to Solve zipkin Install Error in Windows
- How to Solve Springboot YML configurate logging.level error
- How to Solve EasyExcel3.0.5 Version Error
- How to Solve Error: No suitable driver found for
- How to Solve Log4j 2.5 upgrade to 2.15 error
- How to Solve Assert error (IDEA Package Imported)
- How to Solve Java Runtime (class file version 53.0)ERROR
- How to Solve Nosuchmethoderror Error
- How to Solve Image Upload Error: Uncaught (in promise) DOMException: Failed to execute ‘put‘ on ‘IDBObjectStore‘