From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Thu, 3 Dec 2020 14:04:57 -0800 Subject: [PATCH] Better AnnotationTest printout diff --git a/src/test/java/org/bukkit/AnnotationTest.java b/src/test/java/org/bukkit/AnnotationTest.java index 1c6a41644257cd35ced235af6cc60efc925ebc18..b94d87832a271a76a5c8c0c9bf403c35348b31ed 100644 --- a/src/test/java/org/bukkit/AnnotationTest.java +++ b/src/test/java/org/bukkit/AnnotationTest.java @@ -118,13 +118,18 @@ public class AnnotationTest { Collections.sort(errors); - System.out.println(errors.size() + " missing annotation(s):"); + StringBuilder builder = new StringBuilder() + .append("There ") + .append(errors.size() != 1 ? "are " : "is ") + .append(errors.size()) + .append(" missing annotation") + .append(errors.size() != 1 ? "s:\n" : ":\n"); + for (String message : errors) { - System.out.print("\t"); - System.out.println(message); + builder.append("\t").append(message).append("\n"); } - Assert.fail("There " + errors.size() + " are missing annotation(s)"); + Assert.fail(builder.toString()); } private static void collectClasses(@NotNull File from, @NotNull Map to) throws IOException {