assertNotNull(mock(AbstractMethodMocking.class));
}
@Test
public void canSpyOnAnonymousClasses() throws Exception {
AbstractMethodMocking tested = new AbstractMethodMocking() {
@Override
protected String getIt() {
return null;
}
};
assertNull(tested.getValue());
AbstractMethodMocking spy = spy(tested);
when(spy.getValue()).thenReturn("something");
assertEquals("something", spy.getValue());
}