Mockito

  • 17
    Jul

    Validating if the mocked function was called

    Mockito provides “Verify()” which can be used to validate if mock object’s function was called with proper arguments. verify() can be used to verify that a mocked object #...

    Read More
  • 16
    Jul

    Validating object type created with Mockito

    Following code snippet demonstrates Mocking an Interface with and validating it’s type. import org.junit.Test; import static org.mockito.Mockito.*; import static org.junit.Assert.assertTrue; interface Car { boolean needsFuel(); double getEngineTemperature(); void driveTo(String...

    Read More
  • 16
    Jul

    Mockito spy() – mocking and using an object at same time..

    If your test method is designed to mock a service under implementation and at same time there is another method which need to use an object of same class,...

    Read More
  • 16
    Jul

    Lifecycle of a Mockito test

    Lifecycle of Mock objects Mockito allows execution of tests for classes with dependency under development (or external databases whose access is not available at run-time). Creating and accessing mock...

    Read More
  • 16
    Jul

    How to automation if a feature is in development

    Overcoming Automation challenges in an Agile development ======================================================== During development phase when a feature is still not ready for automation, general expectations is to take up automation once feature...

    Read More