0

I have a Spring Boot Test with a Bean I want to spy on:

@SpyBean
private TimeseriesWriter writer;

@Test
public void testEmpty() {
    ...
    Mockito.verify(writer, Mockito.never()).updateTimeseries(any());
}

I was under the impression that this is how I verify that the updateTimeseries method is never called. But I get following error:

org.mockito.exceptions.misusing.UnfinishedVerificationException: 
Missing method call for verify(mock) here:
-> at com.xxxTest.testEmpty(xxxTest.java:134)

Debugging shows that the method is definitely not called. So how do I verify that?

EasterBunnyBugSmasher
  • 1,507
  • 2
  • 15
  • 34

0 Answers0