Skip to content

Commit a8560e8

Browse files
author
Mihail Slavchev
committed
fix unit test
getDeclatedMethods() returns an array of Method objects that are not sorted and are not in any particular order.
1 parent 66eb8cc commit a8560e8

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

binding-generator/src/test/java/com/tns/DumpMethodTests.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,14 @@ public void isMethodSupported_method_returns_correct_result() throws NoSuchMetho
201201
boolean isSupportedMethod = (boolean)m.invoke(Dump.class, params);
202202
Assert.assertTrue(isSupportedMethod);
203203

204-
params[0] = new MethodInfo(AbstractClass.class.getDeclaredMethods()[1]); //PrivateMethod
204+
MethodInfo mi = null;
205+
for (Method m1: AbstractClass.class.getDeclaredMethods()) {
206+
if (m1.getName().equals("PrivateMethod")) {
207+
mi = new MethodInfo(m1);
208+
break;
209+
}
210+
}
211+
params[0] = mi;
205212
isSupportedMethod = (boolean)m.invoke(Dump.class, params);
206213
Assert.assertFalse(isSupportedMethod);
207214
}

0 commit comments

Comments
 (0)