1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-19 19:25:48 +00:00

[ci skip] Actually check if the negative tests do their job (#4054)

* Actually check if the negative tests do their job

* Changed comments

* walshys suggestion

---------

Co-authored-by: JustAHuman-xD <65748158+JustAHuman-xD@users.noreply.github.com>
This commit is contained in:
Alessio Colombo 2024-04-07 05:10:14 +02:00 committed by GitHub
parent 03e5b9ab1e
commit 45601c8aef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -78,23 +78,20 @@ class TestTalismanActivateEvent {
activateAnvilTalisman(true, true);
server.getPluginManager().assertEventFired(TalismanActivateEvent.class, ignored -> true);
server.getPluginManager().clearEvents();
// Assert the normal talisman does not activate in the ender chest
activateAnvilTalisman(false, true);
try {
server.getPluginManager().assertEventFired(TalismanActivateEvent.class, ignored -> true);
} catch (AssertionError ignored) {
return; // This is expected; the event should not have fired
}
server.getPluginManager().clearEvents();
Assertions.assertThrows(
AssertionError.class,
() -> server.getPluginManager().assertEventFired(TalismanActivateEvent.class, ignored -> true)
);
// Assert the ender talisman does not activate in the inventory
try {
activateAnvilTalisman(true, false);
server.getPluginManager().assertEventFired(TalismanActivateEvent.class, ignored -> true);
} catch (AssertionError ignored) {
return; // This is expected; the event should not have fired
}
server.getPluginManager().clearEvents();
Assertions.assertThrows(
AssertionError.class,
() -> server.getPluginManager().assertEventFired(TalismanActivateEvent.class, ignored -> true)
);
}
@Test