public static void throwExceptionIfMethodWasNotFound ( Class < ? > type , String methodName , Method methodToMock , Object ... arguments ) { if ( methodToMock == null ) { String methodNameData = "" ; if ( methodName != null ) { methodNameData = "with name '" + methodName + "' " ; } throw new MethodNotFoundException ( "No method found " + methodNameData + "with parameter types: [ " + getArgumentTypesAsString ( arguments ) + " ] in class " + getOriginalUnmockedType ( type ) . getName ( ) + "." ) ; } }
Throw exception if method was not found .