use of com.djrapitops.plan.storage.database.DBSystem in project Plan by plan-player-analytics.
the class JSErrorRegressionTest method savePlayerData.
private static void savePlayerData() {
DBSystem dbSystem = planSystem.getDatabaseSystem();
Database database = dbSystem.getDatabase();
UUID uuid = TestConstants.PLAYER_ONE_UUID;
database.executeTransaction(new PlayerRegisterTransaction(uuid, RandomData::randomTime, TestConstants.PLAYER_ONE_NAME));
FinishedSession session = new FinishedSession(uuid, serverUUID, 1000L, 11000L, 500L, new DataMap());
database.executeTransaction(new WorldNameStoreTransaction(serverUUID, "world"));
database.executeTransaction(new SessionEndTransaction(session));
}
use of com.djrapitops.plan.storage.database.DBSystem in project Plan by plan-player-analytics.
the class ActiveCookieStoreTest method createActiveCookieStore.
@BeforeEach
void createActiveCookieStore() {
DBSystem dbSystem = Mockito.mock(DBSystem.class);
Database db = Mockito.mock(Database.class);
when(dbSystem.getDatabase()).thenReturn(db);
underTest = new ActiveCookieStore(Mockito.mock(ActiveCookieExpiryCleanupTask.class), Mockito.mock(PlanConfig.class), dbSystem, Mockito.mock(Processing.class));
user = new User(TestConstants.PLAYER_ONE_NAME, "console", null, PassEncryptUtil.createHash("testPass"), 0, WebUser.getPermissionsForLevel(0));
}
use of com.djrapitops.plan.storage.database.DBSystem in project Plan by plan-player-analytics.
the class BungeeSystemTest method bungeeDoesNotEnableWithDefaultIP.
@Test
void bungeeDoesNotEnableWithDefaultIP() {
EnableException thrown = assertThrows(EnableException.class, () -> {
PlanSystem bungeeSystem = component.getPlanSystem();
try {
PlanConfig config = bungeeSystem.getConfigSystem().getConfig();
config.set(WebserverSettings.PORT, TEST_PORT_NUMBER);
config.set(ProxySettings.IP, "0.0.0.0");
DBSystem dbSystem = bungeeSystem.getDatabaseSystem();
SQLiteDB db = dbSystem.getSqLiteFactory().usingDefaultFile();
db.setTransactionExecutorServiceProvider(MoreExecutors::newDirectExecutorService);
dbSystem.setActiveDatabase(db);
// Throws EnableException
bungeeSystem.enable();
} finally {
bungeeSystem.disable();
}
});
assertEquals("IP setting still 0.0.0.0 - Configure Alternative_IP/IP that connects to the Proxy server.", thrown.getMessage());
}
Aggregations