private IMethodInstance mockIMethodDependantUponOtherMethods() throws Exception {
return mockIMethodDependantUponOtherMethods(ClassWithMethodsToTest.class);
}
private IMethodInstance mockIMethodDependantUponOtherMethods(Class methodClass) throws Exception {
IMethodInstance methodInstance = mock(IMethodInstance.class);
ITestNGMethod testNgMethod = mock(ITestNGMethod.class);
when(methodInstance.getMethod()).thenReturn(testNgMethod);
when(testNgMethod.getRealClass()).thenReturn(methodClass);
when(testNgMethod.getMethodsDependedUpon()).thenReturn(new String[]{"method1, method2"});
Method methodWithoutAnnotations = ClassWithMethodsToTest.class.getMethod(ClassWithMethodsToTest.WITHOUT_ANNOTATIONS);