I have a service that I am mocking using Mockito. Is there any way that I can verify the parameters passed to the service call?
For example:
I have a service named employeeAnalyzer.calculateAnnualAppraisalForEmployee(Employee emp)
.
So from unit test I would like to do something like
verifyThat ("John", emp.getName());
verifyThat ("Doe", emp.getLastName);
Basically I want to spy on the parameter that was sent to the service which I inject using
@InjectMocks
EmployeeAnalyzer employeeAnalyzer;
Thanks in advance.
when()
? Maybe the classEmployee
is ridiculous to create and I'm only interested in some properties? – Hettie