when(relatedProviderAddressAlternateIdentificationRepo.save(anyList())).thenAnswer(new Answer() {
public Object answer(InvocationOnMock invocation) {
return invocation.getArguments()[0];
}
});
Or
when(relatedProviderAddressAlternateIdentificationRepo.save(any(Class.class))).thenAnswer(new Answer() {
public Object answer(InvocationOnMock invocation) {
return invocation.getArguments()[0];
}
});
Class.class could be any custom class, eg: User.class
public Object answer(InvocationOnMock invocation) {
return invocation.getArguments()[0];
}
});
Or
when(relatedProviderAddressAlternateIdentificationRepo.save(any(Class.class))).thenAnswer(new Answer() {
public Object answer(InvocationOnMock invocation) {
return invocation.getArguments()[0];
}
});
Class.class could be any custom class, eg: User.class