I have the following method
public List<? extends Parent> fetch(final LocalDate testDate) {
.....
return list;
}
@Test
void test_method() {
List<? extends Parent> childList = List.of(child);
when(serviceClass.fetch(DATE)).thenReturn(childList);
}
mockito doesnt seem to like the when and return message following:
Cannot resolve method 'thenReturn(List<capture of ? extends Parent>)'
I dont understand why