When testing a method of an abstract class, because the called object cannot be directly new, we can use Mockito.mock(My.class, Mockito.CALLS_REAL_METHODS), and then we can call the tested method.
private void givenAbstractStoryURLHandler() { abstractStoryURLHandler = Mockito.mock(AbstractStoryURLHandler.class, Mockito.CALLS_REAL_METHODS); } private void whenGetAncestors() throws Exception{ createMocks(); abstractStoryURLHandler.getAncestors(mockAssetCategory); }