public static synchronized void verify ( Object ... objects ) { for ( Object mock : objects ) { if ( mock instanceof Class < ? > ) { verifyClass ( ( Class < ? > ) mock ) ; } else { EasyMockMethodInvocationControl invocationControl = ( EasyMockMethodInvocationControl ) MockRepository . getInstanceMethodInvocationControl ( mock ) ; if ( invocationControl != null ) { invocationControl . verify ( ) ; } else { if ( isNiceReplayAndVerifyMode ( ) && ! isEasyMocked ( mock ) ) { // ignore non-mock } else { /* * Delegate to easy mock class extension if we have no * handler registered for this object. */ try { org . easymock . EasyMock . verify ( mock ) ; } catch ( RuntimeException e ) { throw new RuntimeException ( mock + " is not a mock object" , e ) ; } } } } } }
Switches the mocks or classes to verify mode . Note that you must use this method when using PowerMock!