Skip to content

Commit

Permalink
Fixes @LocalData when being used on a test method in superclass (#907)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlatombe authored Jan 23, 2025
1 parent fe86233 commit 8235962
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/org/jvnet/hudson/test/recipes/LocalData.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void setup(JenkinsRule jenkinsRule, LocalData recipe) throws Exception {
Method testMethod;

try {
testMethod = desc.getTestClass().getDeclaredMethod(desc.getMethodName());
testMethod = desc.getTestClass().getMethod(desc.getMethodName());
} catch (NoSuchMethodException ex) {
testMethod = desc.getTestClass().getDeclaredMethod(desc.getMethodName(), JenkinsRule.class);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package org.jvnet.hudson.test.recipes;


/**
* Illustrates a case where a test class extends another test class that has test methods using the LocalData recipe.
*/
public class LocalDataExtendedTest extends LocalDataZipTest {
}

0 comments on commit 8235962

Please sign in to comment.