모크토에서 verify
메소드를 작동 시키려고합니다. 다음 테스트를 수행했습니다.모토토 검증 실패하지 않음
@Test
public void testShouldFail()
{
String string = mock(String.class);
string.length();
verify(string, times(100)).length();
}
이 테스트는 실패하지만 통과합니다. 왜 아무도 알지 못해? 나는 Mockito를 잘못 사용하고 있습니까?
private interface Bar
{
public void foo();
}
@Test
public void testShouldFail()
{
Bar bar = mock(Bar.class);
bar.foo();
verify(bar, times(100)).foo();
}
테스트 할 때 두 번째 예제가 실패합니다. 자세한 내용을 제공 할 수 있습니까? –