-
Notifications
You must be signed in to change notification settings - Fork 551
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
Actually check if the negative tests do their job #4054
Conversation
Your Pull Request was automatically labelled as: "✨ Fix" |
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
Slimefun preview buildA Slimefun preview build is available for testing! https://preview-builds.walshy.dev/download/Slimefun/4054/5e1334cb
|
This works but ima check when I'm on my computer if there is a cleaner way to do this |
(I may or may not have completely forgot about this, I'd say just go for it since nothing jumps out as better) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Actually a much easier way to do this: Assertions.assertThrows(
AssertionError.class,
() -> server.getPluginManager().assertEventFired(TalismanActivateEvent.class, e -> true)
); |
Walshy chad moment |
Quality Gate passedIssues Measures |
Oh wow, cool trick |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (idk if I'm allowed to approve a pr that I committed to like this....)
Description
While adding tests to #3920 I pushed some tests which would never fail, this fixes them
Proposed changes
Set a flag if the event failure is correctly caught. If not the test has actually failed, so we throw a new exception of our own.
Related Issues (if applicable)
Checklist
Nonnull
andNullable
annotations to my methods to indicate their behaviour for null values