use of com.djrapitops.plan.settings.config.PlanConfig in project Plan by plan-player-analytics.
the class TimeAmountFormatterExtraZerosTest method setUpFormatter.
@BeforeAll
static void setUpFormatter() {
PlanConfig config = Mockito.mock(PlanConfig.class);
when(config.get(FormatSettings.YEAR)).thenReturn("1 year, ");
when(config.get(FormatSettings.YEARS)).thenReturn("%years% years, ");
when(config.get(FormatSettings.MONTH)).thenReturn("1 month, ");
when(config.get(FormatSettings.MONTHS)).thenReturn("%months% months, ");
when(config.get(FormatSettings.DAY)).thenReturn("1d ");
when(config.get(FormatSettings.DAYS)).thenReturn("%days%d ");
when(config.get(FormatSettings.HOURS)).thenReturn("%zero%%hours%:");
when(config.get(FormatSettings.MINUTES)).thenReturn("%hours%%zero%%minutes%:");
when(config.get(FormatSettings.SECONDS)).thenReturn("%minutes%%zero%%seconds%");
when(config.get(FormatSettings.ZERO_SECONDS)).thenReturn("00:00:00");
underTest = new TimeAmountFormatter(config);
}
use of com.djrapitops.plan.settings.config.PlanConfig in project Plan by plan-player-analytics.
the class BungeeSystemTest method bungeeEnables.
@Test
void bungeeEnables() throws Exception {
PlanSystem bungeeSystem = component.getPlanSystem();
try {
PlanConfig config = bungeeSystem.getConfigSystem().getConfig();
config.set(WebserverSettings.PORT, TEST_PORT_NUMBER);
config.set(ProxySettings.IP, "8.8.8.8");
DBSystem dbSystem = bungeeSystem.getDatabaseSystem();
SQLiteDB db = dbSystem.getSqLiteFactory().usingDefaultFile();
db.setTransactionExecutorServiceProvider(MoreExecutors::newDirectExecutorService);
dbSystem.setActiveDatabase(db);
bungeeSystem.enable();
assertTrue(bungeeSystem.isEnabled());
} finally {
bungeeSystem.disable();
}
}
use of com.djrapitops.plan.settings.config.PlanConfig in project Plan by plan-player-analytics.
the class BungeeSystemTest method testEnableWithMySQL.
@Test
void testEnableWithMySQL() throws Exception {
PlanSystem bungeeSystem = component.getPlanSystem();
try {
PlanConfig config = bungeeSystem.getConfigSystem().getConfig();
// MySQL settings might not be available.
assumeTrue(dbPreparer.setUpMySQLSettings(config).isPresent());
config.set(WebserverSettings.PORT, TEST_PORT_NUMBER);
config.set(ProxySettings.IP, "8.8.8.8");
bungeeSystem.enable();
assertTrue(bungeeSystem.isEnabled());
} finally {
bungeeSystem.disable();
}
}
use of com.djrapitops.plan.settings.config.PlanConfig in project Plan by plan-player-analytics.
the class BukkitSystemTest method bukkitSystemHasDefaultConfigValuesAfterEnable.
@Test
void bukkitSystemHasDefaultConfigValuesAfterEnable() throws IllegalAccessException {
try {
system.enable();
PlanConfig config = system.getConfigSystem().getConfig();
TestSettings.assertValidDefaultValuesForAllSettings(config, TestSettings.getServerSettings());
} finally {
system.disable();
}
}
use of com.djrapitops.plan.settings.config.PlanConfig in project Plan by plan-player-analytics.
the class BukkitAFKListenerTest method setUp.
@BeforeAll
static void setUp() {
PlanConfig config = Mockito.mock(PlanConfig.class);
when(config.get(TimeSettings.AFK_THRESHOLD)).thenReturn(TimeUnit.MINUTES.toMillis(3));
errorLogger = Mockito.mock(ErrorLogger.class);
underTest = new BukkitAFKListener(config, errorLogger);
new SessionCache().cacheSession(TestConstants.PLAYER_ONE_UUID, new ActiveSession(null, null, 0, null, null));
new SessionCache().cacheSession(TestConstants.PLAYER_TWO_UUID, new ActiveSession(null, null, 0, null, null));
}
Aggregations