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:
parent
03e5b9ab1e
commit
45601c8aef
@ -78,23 +78,20 @@ class TestTalismanActivateEvent {
|
|||||||
activateAnvilTalisman(true, true);
|
activateAnvilTalisman(true, true);
|
||||||
server.getPluginManager().assertEventFired(TalismanActivateEvent.class, ignored -> true);
|
server.getPluginManager().assertEventFired(TalismanActivateEvent.class, ignored -> true);
|
||||||
server.getPluginManager().clearEvents();
|
server.getPluginManager().clearEvents();
|
||||||
|
|
||||||
// Assert the normal talisman does not activate in the ender chest
|
// Assert the normal talisman does not activate in the ender chest
|
||||||
activateAnvilTalisman(false, true);
|
activateAnvilTalisman(false, true);
|
||||||
try {
|
Assertions.assertThrows(
|
||||||
server.getPluginManager().assertEventFired(TalismanActivateEvent.class, ignored -> true);
|
AssertionError.class,
|
||||||
} catch (AssertionError ignored) {
|
() -> server.getPluginManager().assertEventFired(TalismanActivateEvent.class, ignored -> true)
|
||||||
return; // This is expected; the event should not have fired
|
);
|
||||||
}
|
|
||||||
server.getPluginManager().clearEvents();
|
|
||||||
|
|
||||||
// Assert the ender talisman does not activate in the inventory
|
// Assert the ender talisman does not activate in the inventory
|
||||||
try {
|
activateAnvilTalisman(true, false);
|
||||||
activateAnvilTalisman(true, false);
|
Assertions.assertThrows(
|
||||||
server.getPluginManager().assertEventFired(TalismanActivateEvent.class, ignored -> true);
|
AssertionError.class,
|
||||||
} catch (AssertionError ignored) {
|
() -> server.getPluginManager().assertEventFired(TalismanActivateEvent.class, ignored -> true)
|
||||||
return; // This is expected; the event should not have fired
|
);
|
||||||
}
|
|
||||||
server.getPluginManager().clearEvents();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
Reference in New Issue
Block a user