Nigel Perkins
ee314364e1
Invoke JUnit assertEquals with Argument Order (expected, actual)
The JUnit API documents assertEquals as taking the expected argument
before the actual argument. Failure to adhere to this can result in
very confusing test failure messages.
For example in testTransformOneValue 'old' contains 'A' and 'expected'
contains 'a'. If the implementer does not lower-case the key, the
failure message is as follows if the argument order is
(actual, expected):
EtlTest > testTransformOneValue FAILED
java.lang.AssertionError: expected:<{A=1}> but was:<{a=1}>
at org.junit.Assert.fail(Assert.java:88)
at org.junit.Assert.failNotEquals(Assert.java:834)
at org.junit.Assert.assertEquals(Assert.java:118)
at org.junit.Assert.assertEquals(Assert.java:144)
at EtlTest.testTransformOneValue(EtlTest.java:27)
This is very confusing as "was:<{a=1}>" is exactly what we were hoping
the result would be.