There is a generic method that takes a class as parameter and I have problems stubbing it with Mockito. The method looks like this:
public
Nice one @Ash. I used your generic class matcher to prepare below. This can be used if we want to prepare mock of a specific Type.(not instance)
private Class streamSourceClass() {
return Mockito.argThat(new ArgumentMatcher>() {
@Override
public boolean matches(Object argument) {
// TODO Auto-generated method stub
return false;
}
});
}
Usage:
Mockito.when(restTemplate.getForObject(Mockito.anyString(),
**streamSourceClass(),**
Mockito.anyObject));