Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

anatolyuzhakov
Copy link
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
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
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