Commit f78a5585 authored by Stephane Nicoll's avatar Stephane Nicoll

Merge pull request #11910 from dreis2211:optimize-applicationhome-unittest-check

* pr/11910:
  Optimize ApplicationHome.isUnitTest()
parents 825397bc 7108a1fc
......@@ -105,7 +105,9 @@ public class ApplicationHome {
private boolean isUnitTest() {
try {
for (StackTraceElement element : Thread.currentThread().getStackTrace()) {
StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
for (int i = stackTrace.length - 1; i >= 0; i--) {
StackTraceElement element = stackTrace[i];
if (element.getClassName().startsWith("org.junit.")) {
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment