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.
Permalink
Failed to load latest commit information.
src
test/mocking/test
.gitignore
Readme.md

Readme.md

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