diff --git a/src/test/java/com/fren_gor/packetInjectorAPI/tests/PacketEventManagerTest.java b/src/test/java/com/fren_gor/packetInjectorAPI/tests/PacketEventManagerTest.java index 65ce14d..7f2d004 100644 --- a/src/test/java/com/fren_gor/packetInjectorAPI/tests/PacketEventManagerTest.java +++ b/src/test/java/com/fren_gor/packetInjectorAPI/tests/PacketEventManagerTest.java @@ -173,6 +173,14 @@ void testPluginDisableEvent() { assertFalse(MAP_LISTENERS.containsKey(p), "Plugin hasn't been unregistered by disable event"); } + @Test + @DisplayName("Unregister not-registered plugin Test") + void testUnregisteredPluginUnregisterEvent() { + Plugin p = new DummyPlugin(); + assertDoesNotThrow(() -> PacketEventManager.unregisterPacketListener(p), + "PacketEventManager#unregisterPacketListener(Plugin) throws exceptions when not-registered plugin got unregistered"); + } + @Test @DisplayName("Unregister All Test") void testUnrgisterAll() { diff --git a/src/test/java/com/fren_gor/packetInjectorAPI/tests/dummyClasses/DummyPlugin.java b/src/test/java/com/fren_gor/packetInjectorAPI/tests/dummyClasses/DummyPlugin.java index cedac66..cb6c862 100644 --- a/src/test/java/com/fren_gor/packetInjectorAPI/tests/dummyClasses/DummyPlugin.java +++ b/src/test/java/com/fren_gor/packetInjectorAPI/tests/dummyClasses/DummyPlugin.java @@ -95,7 +95,7 @@ public Server getServer() { @Override public boolean isEnabled() { - return false; + return true; } @Override