use of com.alessiodp.core.common.logging.LoggerManager in project ADP-Core by AlessioDP.
the class StorageTest method setUp.
@BeforeAll
public static void setUp() {
ADPPlugin mockPlugin = mock(ADPPlugin.class);
LoggerManager mockLoggerManager = mock(LoggerManager.class);
when(mockPlugin.getLoggerManager()).thenReturn(mockLoggerManager);
when(mockPlugin.getFolder()).thenReturn(Paths.get("./"));
}
use of com.alessiodp.core.common.logging.LoggerManager in project ADP-Core by AlessioDP.
the class SchedulerTest method setUp.
@BeforeAll
public static void setUp() {
LoggerManager mockLoggerManager = mock(LoggerManager.class);
when(mockPlugin.getLoggerManager()).thenReturn(mockLoggerManager);
when(mockPlugin.getFolder()).thenReturn(Paths.get("./"));
}
use of com.alessiodp.core.common.logging.LoggerManager in project ADP-Core by AlessioDP.
the class ADPPlugin method preHandle.
/**
* Preparation before the main handle method
* Initialize necessary classes
*/
protected final void preHandle() {
loggerManager = new LoggerManager(this);
loginAlertsManager = new LoginAlertsManager();
initializeCore();
}
use of com.alessiodp.core.common.logging.LoggerManager in project Parties by AlessioDP.
the class MigrationsTest method setUp.
@BeforeAll
public static void setUp(@TempDir Path tempDir) {
LoggerManager mockLoggerManager = mock(LoggerManager.class);
when(mockPlugin.getLoggerManager()).thenReturn(mockLoggerManager);
when(mockPlugin.getPluginFallbackName()).thenReturn("parties");
when(mockPlugin.getFolder()).thenReturn(tempDir);
when(mockPlugin.getResource(anyString())).thenAnswer((mock) -> ClassLoader.getSystemResourceAsStream(mock.getArgument(0)));
when(mockLoggerManager.isDebugEnabled()).thenReturn(true);
// Mock managers for player/party initialization
ColorManager mockColorManager = mock(ColorManager.class);
when(mockPlugin.getColorManager()).thenReturn(mockColorManager);
when(mockColorManager.searchColorByName(anyString())).thenReturn(null);
PlayerManager mockPlayerManager = mock(PlayerManager.class);
when(mockPlugin.getPlayerManager()).thenReturn(mockPlayerManager);
when(mockPlayerManager.initializePlayer(any())).thenAnswer((mock) -> SQLDispatcherTest.initializePlayer(mockPlugin, mock.getArgument(0)));
PartyManager mockPartyManager = mock(PartyManager.class);
when(mockPlugin.getPartyManager()).thenReturn(mockPartyManager);
when(mockPartyManager.initializeParty(any())).thenAnswer((mock) -> SQLDispatcherTest.initializeParty(mockPlugin, mock.getArgument(0)));
// Mock names
OfflineUser mockOfflineUser = mock(OfflineUser.class);
when(mockPlugin.getOfflinePlayer(any())).thenReturn(mockOfflineUser);
when(mockOfflineUser.getName()).thenReturn("Dummy");
ConfigMain.STORAGE_SETTINGS_GENERAL_SQL_PREFIX = "test_";
staticPlugin = Mockito.mockStatic(ADPPlugin.class);
when(ADPPlugin.getInstance()).thenReturn(mockPlugin);
}
use of com.alessiodp.core.common.logging.LoggerManager in project Parties by AlessioDP.
the class PartiesPlaceholderTest method setUp.
@BeforeAll
public static void setUp() {
LoggerManager mockLoggerManager = mock(LoggerManager.class);
when(mockPlugin.getLoggerManager()).thenReturn(mockLoggerManager);
when(mockPlugin.getDatabaseManager()).thenReturn(mockDatabaseManager);
when(mockPlugin.getMessageUtils()).thenReturn(mockMessageUtils);
when(mockMessageUtils.convertRawPlaceholder(any(), any(), any(), any())).thenCallRealMethod();
// Mock names
OfflineUser mockOfflineUser = mock(OfflineUser.class);
when(mockPlugin.getOfflinePlayer(any())).thenReturn(mockOfflineUser);
when(mockOfflineUser.getName()).thenReturn("Dummy");
staticPlugin = mockStatic(ADPPlugin.class);
when(ADPPlugin.getInstance()).thenReturn(mockPlugin);
}
Aggregations