Skip to content

Commit 19af1fb

Browse files
committed
Use runner object for runner events
1 parent 8da7e92 commit 19af1fb

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

src/main/java/com/nordstrom/automation/junit/LifecycleHooks.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,16 +159,14 @@ public static void intercept(@This final Object runner, @SuperCall final Callabl
159159
}
160160
}
161161

162-
TestClass testClass = getTestClassOf(runner);
163-
164162
for (RunnerWatcher watcher : runnerWatcherLoader) {
165-
watcher.runStarted(testClass);
163+
watcher.runStarted(runner);
166164
}
167165

168166
proxy.call();
169167

170168
for (RunnerWatcher watcher : runnerWatcherLoader) {
171-
watcher.runFinished(testClass);
169+
watcher.runFinished(runner);
172170
}
173171
}
174172

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
package com.nordstrom.automation.junit;
22

3-
import org.junit.runners.model.TestClass;
4-
53
public interface RunnerWatcher {
64

75
/**
86
* Called when a test runner is about to run.
97
*
10-
* @param testClass {@link TestClass} object for this test runner
8+
* @param runner JUnit test runner
119
*/
12-
public void runStarted(TestClass testClass);
10+
public void runStarted(Object runner);
1311

1412
/**
1513
* Called when a test runner has finished running.
1614
*
17-
* @param testClass {@link TestClass} object for this test runner
15+
* @param runner JUnit test runner
1816
*/
19-
public void runFinished(TestClass testClass);
17+
public void runFinished(Object runner);
2018

2119
}

0 commit comments

Comments
 (0)