Skip to content

Added ability to provide custom message to assertThrows\expectThrows methods - #2793

Merged
juherr merged 1 commit into
testng-team:masterfrom
anatolyuzhakov:feature/add-assert-throws-overloads
Aug 30, 2022
Merged

juherr merged 1 commit into
testng-team:masterfrom
anatolyuzhakov:feature/add-assert-throws-overloads

Conversation

@anatolyuzhakov

Copy link
Copy Markdown
Contributor
  • overloaded Assert.assertThrows and Assert.expectThrows methods;
  • added tests for overloaded Assert.expectThrows method;
  • updated CHANGES.txt.

- added tests for overloaded Assert.expectThrows method.
String.format(
"Expected %s to be thrown, but nothing was thrown", throwableClass.getSimpleName());
throw new AssertionError(message);
throw new AssertionError(message != null ? message : nothingThrownMessage);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use positive condition

@juherr
juherr merged commit c72d23a into testng-team:master Aug 30, 2022
@anatolyuzhakov
anatolyuzhakov deleted the feature/add-assert-throws-overloads branch August 30, 2022 21:07
@juherr juherr added this to the 7.7.0 milestone Sep 7, 2026 — with ChatGPT Codex Connector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants