public class TestName extends TestWatcher
public class TestNameTest {
@Rule
public TestName name= new TestName();
@Test
public void testA() {
assertEquals("testA", name.getMethodName());
}
@Test
public void testB() {
assertEquals("testB", name.getMethodName());
}
}
| Constructor and Description |
|---|
TestName() |
| Modifier and Type | Method and Description |
|---|---|
String |
getMethodName() |
protected void |
starting(Description d)
Invoked when a test is about to start
|
protected void starting(Description d)
TestWatcherstarting in class TestWatcherpublic String getMethodName()