美文网首页
1.获取当前执行的类和方法名

1.获取当前执行的类和方法名

作者: 0Xday | 来源:发表于2018-08-05 21:32 被阅读0次

@Test
public void show() {
System.out.println(Thread.currentThread() .getStackTrace()[1].getClassName()+":"+Thread.currentThread() .getStackTrace()[1].getMethodName());
}

eg:com.mishimao.mishimao_api.MishimaoApiApplicationTests:show

相关文章

网友评论

      本文标题:1.获取当前执行的类和方法名

      本文链接:https://www.haomeiwen.com/subject/afdivftx.html