@Test public void testArgsStaticMethod() throws IllegalAccessException, InvocationTargetException { Method method = ClassUtils.getStaticMethod(InnerClass.class, "argStaticMethod", new Class[] {String.class}); method.invoke(null, new Object[] {"test"}); assertTrue("argument method was not invoked.", InnerClass.argCalled); }
@Test public void testNoArgsStaticMethod() throws IllegalAccessException, InvocationTargetException { Method method = ClassUtils.getStaticMethod(InnerClass.class, "staticMethod", (Class[]) null); method.invoke(null, (Object[]) null); assertTrue("no argument method was not invoked.", InnerClass.noArgCalled); }