Search in sources :

Example 1 with VelocityMockComponent

use of utilities.mocks.VelocityMockComponent in project Plan by plan-player-analytics.

the class VelocitySystemTest method velocityEnables.

@Test
void velocityEnables(@TempDir Path temp) throws Exception {
    PlanSystem velocitySystem = new VelocityMockComponent(temp).getPlanSystem();
    try {
        PlanConfig config = velocitySystem.getConfigSystem().getConfig();
        config.set(WebserverSettings.PORT, TEST_PORT_NUMBER);
        config.set(ProxySettings.IP, "8.8.8.8");
        DBSystem dbSystem = velocitySystem.getDatabaseSystem();
        SQLiteDB db = dbSystem.getSqLiteFactory().usingDefaultFile();
        db.setTransactionExecutorServiceProvider(MoreExecutors::newDirectExecutorService);
        dbSystem.setActiveDatabase(db);
        velocitySystem.enable();
        assertTrue(velocitySystem.isEnabled());
    } finally {
        velocitySystem.disable();
    }
}
Also used : VelocityMockComponent(utilities.mocks.VelocityMockComponent) DBSystem(com.djrapitops.plan.storage.database.DBSystem) SQLiteDB(com.djrapitops.plan.storage.database.SQLiteDB) MoreExecutors(com.google.common.util.concurrent.MoreExecutors) PlanConfig(com.djrapitops.plan.settings.config.PlanConfig) Test(org.junit.jupiter.api.Test)

Aggregations

PlanConfig (com.djrapitops.plan.settings.config.PlanConfig)1 DBSystem (com.djrapitops.plan.storage.database.DBSystem)1 SQLiteDB (com.djrapitops.plan.storage.database.SQLiteDB)1 MoreExecutors (com.google.common.util.concurrent.MoreExecutors)1 Test (org.junit.jupiter.api.Test)1 VelocityMockComponent (utilities.mocks.VelocityMockComponent)1