Skip to content

Commit

Permalink
Introduce missing assertEquals(long, Long, String) overload
Browse files Browse the repository at this point in the history
This reinstates a method that was introduced in
80e02ff but accidentally replaced in
89dc584.
  • Loading branch information
Stephan202 committed Dec 27, 2024
1 parent db6c5a9 commit e4a6944
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions testng-asserts/src/main/java/org/testng/Assert.java
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,18 @@ public static void assertEquals(Long actual, long expected, String message) {
assertEquals(actual, Long.valueOf(expected), message);
}

/**
* Asserts that two longs are equal. If they are not, an AssertionError, with the given message,
* is thrown.
*
* @param actual the actual value
* @param expected the expected value
* @param message the assertion error message
*/
public static void assertEquals(long actual, Long expected, String message) {
assertEquals(Long.valueOf(actual), expected, message);
}

/**
* Asserts that two longs are equal. If they are not, an AssertionError, with the given message,
* is thrown.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public void assertEqualsBoxedUnboxedLong() {
assertEquals(a, b);
assertEquals(a, b, "");
assertEquals(b, a);
assertEquals(b, a, "");
assertEquals(Long.valueOf(b), a, "");
}

Expand Down

0 comments on commit e4a6944

Please sign in to comment.