Thanks to your answer, I found in the Assert class this
static String format(String message, Object expected, Object actual) { String formatted= ""; if (message != null && !message.equals("")) formatted= message + " "; String expectedString= String.valueOf(expected); String actualString= String.valueOf(actual); if (expectedString.equals(actualString)) return formatted + "expected: " + formatClassAndValue(expected, expectedString) + " but was: " + formatClassAndValue(actual, actualString); else return formatted + "expected:<" + expectedString + "> but was:<" + actualString + ">"; }
I think I cannot change the Junit Assert class, but I can create a new class in my project with the same name, just changing the format, right? Or can I just change the format in my class and this will affect the throw of an Exception?
Lorm source share