Probably the data1 method, but does not guarantee this, it will use the one that the JVM first provides junit4.
Here is the relevant code from junit:
private FrameworkMethod getParametersMethod(TestClass testClass) throws Exception { List<FrameworkMethod> methods= testClass.getAnnotatedMethods(Parameters.class); for (FrameworkMethod each : methods) { int modifiers= each.getMethod().getModifiers(); if (Modifier.isStatic(modifiers) && Modifier.isPublic(modifiers)) return each; } throw new Exception("No public static parameters method on class " + testClass.getName()); }
Thus, the first public, static annotated method will be used, which he will find, but he can find them in any order.
Why do you have your test written this way? You should have only one @Parameters -annotated method.
skaffman
source share