/** * Verifies certain behavior happened at least once / exact number of times * / never. E.g: * * <pre> * verifyStatic(times(5)); * ClassWithStaticMethod.someStaticMethod("was called five times"); * * verifyStatic(atLeast(2)); * ClassWithStaticMethod.someStaticMethod("was called at least two times"); * * //you can use flexible argument matchers, e.g: * verifyStatic(atLeastOnce()); * ClassWithStaticMethod.someMethod(<b>anyString()</b>); * </pre> * * <b>times(1) is the default</b> and can be omitted * <p> * * @param verificationMode * times(x), atLeastOnce() or never() * @deprecated Will be removed in PowerMock 2. Please use {@link #verifyStatic(Class, VerificationMode)} */ @Deprecated public static synchronized void verifyStatic(VerificationMode verificationMode) { Whitebox.getInternalState(Mockito.class, MockingProgress.class).verificationStarted( POWERMOCKITO_CORE.wrapInStaticVerificationMode(verificationMode)); }
/** * Verifies certain behavior of the <code>mockedClass</code> happened at least once / exact number of times * / never. E.g: * * <pre> * verifyStatic(ClassWithStaticMethod.class, times(5)); * ClassWithStaticMethod.someStaticMethod("was called five times"); * * verifyStatic(ClassWithStaticMethod.class, atLeast(2)); * ClassWithStaticMethod.someStaticMethod("was called at least two times"); * * //you can use flexible argument matchers, e.g: * verifyStatic(ClassWithStaticMethod.class, atLeastOnce()); * ClassWithStaticMethod.someMethod(<b>anyString()</b>); * </pre> * * <b>times(1) is the default</b> and can be omitted * <p> * * @param mockedClass the mocked class behavior of that have to be verified. * @param verificationMode * times(x), atLeastOnce() or never() * */ public static synchronized <T> void verifyStatic(Class<T> mockedClass, VerificationMode verificationMode) { Whitebox.getInternalState(Mockito.class, MockingProgress.class).verificationStarted( POWERMOCKITO_CORE.wrapInStaticVerificationMode(mockedClass, verificationMode)); }