In some edge cases, it might be impossible or impractical to create the mocks by simply using the
PowerMockito.when().thenReturn() syntax. In such cases, the generic
Answer interface could be very handy.
In this recipe, we will learn how to make use of the
Answer interface to create some unusual mocking strategies.
EmployeeController.findEmployeeByEmail method we saw in the previous recipe? We are going to write one more test for that method in this recipe.