0

I am creating a map where when an acceptance/regression test case is run, It should give me all the Class instances it is called So that I can map these classes with their respective regression test case. Is there any way that I can get all the class instances it is executed from java when a test case is run?

Ex: regression test case A -> service class(which contains all the dependencies class)

Koushik J
  • 552
  • 3
  • 10
  • 23
  • You can use the get stack trace method from Throwable https://docs.oracle.com/javase/7/docs/api/java/lang/Throwable.html#getStackTrace() – Gopinath Radhakrishnan May 31 '22 at 11:13
  • 1
    [`Thread.getAllStackTraces()`](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Thread.html#getAllStackTraces()) – Holger May 31 '22 at 14:31

0 Answers0