#1423 Implement CMI spawn integration

This commit is contained in:
Gabriele C
2017-11-28 12:57:39 +01:00
parent 350321c80b
commit c7c8e673f0
6 changed files with 145 additions and 16 deletions
@@ -31,6 +31,7 @@ public class ServerListenerTest {
private static final String ESSENTIALS = "Essentials";
private static final String ESSENTIALS_SPAWN = "EssentialsSpawn";
private static final String CMI = "CMI";
private static final String MULTIVERSE = "Multiverse-Core";
private static final String PROTOCOL_LIB = "ProtocolLib";
@@ -58,6 +59,10 @@ public class ServerListenerTest {
public void shouldForwardPluginNameOnEnable() {
checkEnableHandling(ESSENTIALS, () -> verify(pluginHookService).tryHookToEssentials());
checkEnableHandling(ESSENTIALS_SPAWN, () -> verify(spawnLoader).loadEssentialsSpawn());
checkEnableHandling(CMI, () -> {
verify(pluginHookService).tryHookToCMI();
verify(spawnLoader).loadCMISpawn();
});
checkEnableHandling(MULTIVERSE, () -> verify(pluginHookService).tryHookToMultiverse());
checkEnableHandling(PROTOCOL_LIB, () -> verify(protocolLibService).setup());
checkEnableHandling("UnknownPlugin", () -> verifyZeroInteractions(pluginHookService, spawnLoader));
@@ -67,6 +72,10 @@ public class ServerListenerTest {
public void shouldForwardPluginNameOnDisable() {
checkDisableHandling(ESSENTIALS, () -> verify(pluginHookService).unhookEssentials());
checkDisableHandling(ESSENTIALS_SPAWN, () -> verify(spawnLoader).unloadEssentialsSpawn());
checkDisableHandling(CMI, () -> {
verify(pluginHookService).unhookCMI();
verify(spawnLoader).unloadCMISpawn();
});
checkDisableHandling(MULTIVERSE, () -> verify(pluginHookService).unhookMultiverse());
checkDisableHandling(PROTOCOL_LIB, () -> verify(protocolLibService).disable());
checkDisableHandling("UnknownPlugin", () -> verifyZeroInteractions(pluginHookService, spawnLoader));