List of utility methods to do Assert Equal
void | assertEquals(Object expected, Object actual) assert Equals if (!expected.equals(actual)) { throw new RuntimeException(String.format("Values didn't match, epected: %s actual: %s", expected.toString(), actual.toString())); |
boolean | assertEquals(Object o1, Object o2) assert Equals return o1 == null && o2 == null ? true : (o1 != null ? o1.equals(o2) : false);
|
void | assertEquals(Object obj1, Object obj2, String errMsg) assert Equals if (obj1 == null) { assertNull(obj2, errMsg); return; if (!obj1.equals(obj2)) { throw new RuntimeException(errMsg); |
void | assertEquals(Object obj1, Object obj2, String message) Solleva una @link(IllegalArgumentException) con message message in caso di object non null if (!obj1.equals(obj2)) { throw new IllegalArgumentException(message); |
void | assertEquals(Object val1, Object val2) assert Equals assertEquals(null, val1, val2); |
void | assertEquals(String expected, String actual) assert Equals if (expected == null && actual != null || expected != null && !expected.equals(actual)) { throw new AssertionError("Expected: " + coalesce(expected) + ", actual: " + coalesce(actual)); System.out.println("Passed: " + coalesce(actual)); |
void | assertEquals(String expected, String current) This method is used in the static block to checks whether the field costCenter is available. if (!expected.equals(current)) { throw new RuntimeException("Assertion failed. Expected: <" + expected + "> but was: <" + current + ">"); |
void | assertEquals(String message, Object expected, Object actual) Asserts that two objects are equal. if (expected == null && actual == null) return; if (expected != null && isEquals(expected, actual)) return; failNotEquals(message, expected, actual); |
void | assertEquals(T expected, T actual) assert Equals if (expected == null) { if (actual != null) { throw new AssertionError("Not equals. expected is null, but actual is [" + actual + "]"); if (!expected.equals(actual)) { throw new AssertionError("Not equals. expected is [" + expected + "], but actual is [" + actual + "]"); |
void | assertEqualsAny(Object obj1, Object[] objects, String errMsg) assert Equals Any if (null == objects) { throw new RuntimeException(errMsg); for (Object obj2 : objects) { if (obj1 == null) { if (obj2 == null) { return; continue; if (obj1.equals(obj2)) { return; throw new RuntimeException(errMsg); |