Java Testing Notes
  • Java Testing
  • Mockito
    • Mockito.mock()
    • Mockito.spy()
    • Mockito.verify()
    • Mockito.mockStatic()
    • ArgumentMatcher
    • ArgumentCaptor
  • PowerMockito
    • Why we need PowerMock?
    • PowerMockRunner
    • PrepareForTest
      • Understanding @PrepareForTest
    • SuppressStaticInitializationFor
    • PowerMockito.suppress()
    • PowerMockito.stub()
    • PowerMockito.replace()
    • PowerMockito.whenNew()
      • Limitation of PowerMockito.whenNew()
    • Whitebox.invokeMethod()
    • Whitebox.setInternalState()
    • Whitebox.getInternalState()
  • Tips
    • How to test ViewModel and LiveData
Powered by GitBook
On this page

Mockito

Mocking framework for unit tests in Java

As per there site:

Mockito is a mocking framework that tastes really good. It lets you write beautiful tests with a clean & simple API. Mockito doesn’t give you hangover because the tests are very readable and they produce clean verification errors.

PreviousJava TestingNextMockito.mock()

Last updated 1 year ago