No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Playing With Unit Test - Mocking

This code i've tried to explain the value of thenAnswer in Mockito.

  • Mocking a method to return a response based on the parameters passed to the method in spy at runtime.
  • Mockito's when(methodCall).thenAnswer( ... ) to implement that.
  • invocation.getArguments gets the Arguments at runtime.

My Blog which explains a scenario for this : Dynamic Mocking Reponse