Basically, I have a teardown method that I want to log to the console which test was just run. How would I go about getting that string?
I can get the class name, bu
In my own project I access this data thanks to a JUnit @Rule.
String testName;
String className;
@Rule
public TestWatcher watcher = new TestWatcher() {
public void starting(Description description) {
testName = description.getMethodName();
className = description.getClassName();
logger.info("Starting test " + testName + " in class " + className);
}
};