Why does JUnit take an additional few seconds per class in Junit test file?

Viewed 91

I have a single test in a JUnit test. When i choose to run this Junit test 100 times, it takes about 1-2 seconds for the test to initialize, then it runs it 100 times almost instantly. So it seems all the time is in the initialization.

When I have @Nested classes, each of those classes take about 1-2 seconds to initialize, while it takes a few milliseconds for the test itself to actually run.

I was wondering what is causing this 1-2 second initialization time for each class in a JUnit file.

0 Answers
Related