From 9f646db94a83300bff34b9e422036a0c60dca93f Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Sun, 9 Jun 2024 13:42:54 +0200 Subject: [PATCH] Print full class path for enums (UnitLogger) --- .../staropensource/sosengine/unittests/UnitLogger.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/base/src/main/java/de/staropensource/sosengine/unittests/UnitLogger.java b/base/src/main/java/de/staropensource/sosengine/unittests/UnitLogger.java index 319a18a..29efd2d 100644 --- a/base/src/main/java/de/staropensource/sosengine/unittests/UnitLogger.java +++ b/base/src/main/java/de/staropensource/sosengine/unittests/UnitLogger.java @@ -46,9 +46,16 @@ public class UnitLogger { StringBuilder args = new StringBuilder(); for (Object arg : additionalStuff) { + boolean stringQuotes = arg instanceof String; + + // Print full class path for enums + if (arg instanceof Enum) { + arg = arg.getClass().getName() + "." + ((Enum) arg).name(); + } + if (!args.isEmpty()) args.append(" "); args.append("'"); - if (arg instanceof String) + if (stringQuotes) args.append("\"").append(arg).append("\""); else args.append(arg);