Saturday, April 13, 2019

Mockito revisited

https://github.com/mockito/mockito


I have used Mockito in 2010. Then I never did SERIOUS Java development any more (shame on me...)

Yet I strongly believe that a solid implementation of Mocks is the foundation of healthy, fully testable software.
If you can't entirely automate your application tests, you are playing with your life.


https://search.maven.org/artifact/org.mockito/mockito-core/2.26.0/jar

<dependency>
    <groupId>org.mockito</groupId>
    <artifactId>mockito-core</artifactId>
    <version>2.26.0</version>
</dependency>









https://github.com/in28minutes/MockitoTutorialForBeginners



https://www.baeldung.com/mockito-annotations

source code is here https://github.com/eugenp/tutorials/tree/master/testing-modules/mockito


https://static.javadoc.io/org.mockito/mockito-core/2.27.0/org/mockito/Mock.html

@Mock
List mockedList;


https://static.javadoc.io/org.mockito/mockito-core/2.27.0/org/mockito/Spy.html

@Spy
List spiedList = new ArrayList();


https://static.javadoc.io/org.mockito/mockito-core/2.27.0/org/mockito/ArgumentCaptor.html

@Captor
ArgumentCaptor argCaptor;


I am getting : Illegal reflective access by org.mockito.internal.util.reflection.AccessibilityChanger
Hopefully Mockito folks will fix this one da.







No comments: